diff --git a/build.gradle b/build.gradle index 621bc62fa6..50c3291c86 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1696265388 +//version: 1702141377 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit buildscript { repositories { - mavenCentral() - - maven { - name 'forge' - url 'https://maven.minecraftforge.net' - } maven { // GTNH RetroFuturaGradle and ASM Fork name "GTNH Maven" url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" allowInsecureProtocol = true } - maven { - name 'sonatype' - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - maven { - name 'Scala CI dependencies' - url 'https://repo1.maven.org/maven2/' - } - mavenLocal() } } @@ -69,7 +54,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.26' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -302,7 +287,7 @@ if (apiPackage) { } if (accessTransformersFile) { - for (atFile in accessTransformersFile.split(",")) { + for (atFile in accessTransformersFile.split(" ")) { String targetFile = "src/main/resources/META-INF/" + atFile.trim() if (!getFile(targetFile).exists()) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) @@ -628,7 +613,7 @@ repositories { } maven { name = "ic2" - url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/") + url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/") content { includeGroup "net.industrial-craft" } @@ -646,7 +631,7 @@ repositories { def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderModule = "unimixins" -def mixinProviderVersion = "0.1.7.1" +def mixinProviderVersion = "0.1.13" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" ext.mixinProviderSpec = mixinProviderSpec @@ -687,6 +672,8 @@ configurations.all { substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier") + + substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets') } } @@ -793,12 +780,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.5.0' + def lwjgl3ifyVersion = '1.5.7' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.7') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35') } java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} @@ -1187,9 +1174,8 @@ publishing { version = System.getenv("RELEASE_VERSION") ?: identifiedVersion } } - repositories { - if (usesMavenPublishing.toBoolean()) { + if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { maven { url = mavenPublishUrl allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven @@ -1311,7 +1297,7 @@ def addCurseForgeRelation(String type, String name) { // Updating -def buildscriptGradleVersion = "8.2.1" +def buildscriptGradleVersion = "8.5" tasks.named('wrapper', Wrapper).configure { gradleVersion = buildscriptGradleVersion diff --git a/dependencies.gradle b/dependencies.gradle index cebee65c2d..13ee14b6f5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,22 +1,22 @@ // Add your dependencies here dependencies { - api('com.github.GTNewHorizons:EnderCore:0.2.17:dev') - implementation('com.github.GTNewHorizons:ForestryMC:4.6.14:dev') - implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.3-GTNH:dev') + api('com.github.GTNewHorizons:EnderCore:0.2.18:dev') + implementation('com.github.GTNewHorizons:ForestryMC:4.7.0:dev') + implementation('com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev') implementation("com.github.GTNewHorizons:GTNHLib:0.0.13:dev") - api('com.github.GTNewHorizons:BuildCraft:7.1.36:dev') + api('com.github.GTNewHorizons:BuildCraft:7.1.38:dev') api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748 shadowImplementation('cglib:cglib-nodep:3.3.0') - compileOnly('com.github.GTNewHorizons:waila:1.6.0:api') {transitive = false} - compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-259-GTNH:api') {transitive = false} - compileOnly('com.github.GTNewHorizons:Baubles:1.0.1.16:dev') {transitive = false} - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.30:dev') {transitive = false} - compileOnly('com.github.GTNewHorizons:Railcraft:9.15.0:api') {transitive = false} - compileOnly('com.github.GTNewHorizons:StorageDrawers:1.12.0-GTNH:api') {transitive = false} - implementation('com.github.GTNewHorizons:Chisel:2.11.4-GTNH:dev') {transitive = false} - compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api') {transitive = false} + compileOnly('com.github.GTNewHorizons:waila:1.6.5:api') {transitive = false} + compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-291-GTNH:api') {transitive = false} + compileOnly('com.github.GTNewHorizons:Baubles:1.0.3:dev') {transitive = false} + compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.106:dev') {transitive = false} + compileOnly('com.github.GTNewHorizons:Railcraft:9.15.2:api') {transitive = false} + compileOnly('com.github.GTNewHorizons:StorageDrawers:1.12.1-GTNH:api') {transitive = false} + compileOnly('com.github.GTNewHorizons:Chisel:2.12.3-GTNH:dev') {transitive = false} + compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.19-GTNH:api') {transitive = false} compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150 compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79e2..033e24c4cd 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 17a8ddce2d..1af9e0930b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb43..fcb6fca147 100755 --- a/gradlew +++ b/gradlew @@ -130,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. diff --git a/src/main/java/crazypants/enderio/EnderIO.java b/src/main/java/crazypants/enderio/EnderIO.java index 8ebe10a077..f4b15cd739 100644 --- a/src/main/java/crazypants/enderio/EnderIO.java +++ b/src/main/java/crazypants/enderio/EnderIO.java @@ -1,6 +1,8 @@ package crazypants.enderio; -import static crazypants.enderio.EnderIO.*; +import static crazypants.enderio.EnderIO.MODID; +import static crazypants.enderio.EnderIO.MOD_NAME; +import static crazypants.enderio.EnderIO.VERSION; import java.io.BufferedWriter; import java.io.File; diff --git a/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java b/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java index d9b971e8d7..5441880c77 100644 --- a/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java +++ b/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java @@ -641,8 +641,8 @@ public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { @Override public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) { - ItemStack equipped = player.getCurrentEquippedItem(); - if (!player.isSneaking() || equipped == null || equipped.getItem() != EnderIO.itemYetaWench) { + ITool tool = ToolUtil.getEquippedTool(player); + if (!player.isSneaking() || tool == null || !tool.canUse(player.getCurrentEquippedItem(), player, x, y, z)) { return; } ConduitUtil.openConduitGui(world, x, y, z, player); diff --git a/src/main/java/crazypants/enderio/conduit/ConduitDisplayMode.java b/src/main/java/crazypants/enderio/conduit/ConduitDisplayMode.java index b2c6a6f314..6f350f96cc 100644 --- a/src/main/java/crazypants/enderio/conduit/ConduitDisplayMode.java +++ b/src/main/java/crazypants/enderio/conduit/ConduitDisplayMode.java @@ -1,6 +1,15 @@ package crazypants.enderio.conduit; -import static crazypants.enderio.gui.IconEIO.*; +import static crazypants.enderio.gui.IconEIO.CROSS; +import static crazypants.enderio.gui.IconEIO.TICK; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_FLUID_OFF; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_ITEM_OFF; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_POWER_OFF; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE; +import static crazypants.enderio.gui.IconEIO.WRENCH_OVERLAY_REDSTONE_OFF; import java.util.List; diff --git a/src/main/java/crazypants/enderio/conduit/ConduitRecipes.java b/src/main/java/crazypants/enderio/conduit/ConduitRecipes.java index 8fb1913bbd..212b3f0208 100644 --- a/src/main/java/crazypants/enderio/conduit/ConduitRecipes.java +++ b/src/main/java/crazypants/enderio/conduit/ConduitRecipes.java @@ -1,10 +1,20 @@ package crazypants.enderio.conduit; import static crazypants.enderio.ModObject.blockPainter; -import static crazypants.enderio.material.Alloy.*; +import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON; +import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL; +import static crazypants.enderio.material.Alloy.END_STEEL; +import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY; +import static crazypants.enderio.material.Alloy.PHASED_GOLD; +import static crazypants.enderio.material.Alloy.REDSTONE_ALLOY; import static crazypants.enderio.material.Material.CONDUIT_BINDER; import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET; -import static crazypants.enderio.material.endergy.AlloyEndergy.*; +import static crazypants.enderio.material.endergy.AlloyEndergy.CRUDE_STEEL; +import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_ALLOY; +import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_PINK_SLIME; +import static crazypants.enderio.material.endergy.AlloyEndergy.ENERGETIC_SILVER; +import static crazypants.enderio.material.endergy.AlloyEndergy.MELODIC_ALLOY; +import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY; import static crazypants.util.RecipeUtil.addShaped; import net.minecraft.init.Blocks; diff --git a/src/main/java/crazypants/enderio/conduit/item/filter/ItemFilter.java b/src/main/java/crazypants/enderio/conduit/item/filter/ItemFilter.java index 0d904c8fc7..8ccd2652fa 100644 --- a/src/main/java/crazypants/enderio/conduit/item/filter/ItemFilter.java +++ b/src/main/java/crazypants/enderio/conduit/item/filter/ItemFilter.java @@ -165,7 +165,8 @@ private boolean isOreDicMatch(int filterItemIndex, ItemStack item) { } private boolean isNBTMatch(ItemStack filter, ItemStack item) { - if (filter.stackTagCompound == null && item.stackTagCompound == null) return true; + if (filter.stackTagCompound == null && (item.stackTagCompound == null || item.stackTagCompound.hasNoTags())) + return true; if (filter.stackTagCompound == null || item.stackTagCompound == null) return false; if (!filter.getTagCompound().hasKey("GEN")) return filter.stackTagCompound.equals(item.stackTagCompound); NBTTagCompound filterTag = (NBTTagCompound) filter.getTagCompound().copy(); diff --git a/src/main/java/crazypants/enderio/conduit/render/DefaultConduitRenderer.java b/src/main/java/crazypants/enderio/conduit/render/DefaultConduitRenderer.java index ad12bdf8f1..1df7cc1bdd 100644 --- a/src/main/java/crazypants/enderio/conduit/render/DefaultConduitRenderer.java +++ b/src/main/java/crazypants/enderio/conduit/render/DefaultConduitRenderer.java @@ -1,7 +1,14 @@ package crazypants.enderio.conduit.render; -import static com.enderio.core.client.render.CubeRenderer.*; -import static net.minecraftforge.common.util.ForgeDirection.*; +import static com.enderio.core.client.render.CubeRenderer.addVecWithUV; +import static com.enderio.core.client.render.CubeRenderer.setupVertices; +import static com.enderio.core.client.render.CubeRenderer.verts; +import static net.minecraftforge.common.util.ForgeDirection.DOWN; +import static net.minecraftforge.common.util.ForgeDirection.EAST; +import static net.minecraftforge.common.util.ForgeDirection.NORTH; +import static net.minecraftforge.common.util.ForgeDirection.SOUTH; +import static net.minecraftforge.common.util.ForgeDirection.UP; +import static net.minecraftforge.common.util.ForgeDirection.WEST; import java.util.Collection; import java.util.List; diff --git a/src/main/java/crazypants/enderio/item/ItemRecipes.java b/src/main/java/crazypants/enderio/item/ItemRecipes.java index 4a844493d8..39c8c54954 100644 --- a/src/main/java/crazypants/enderio/item/ItemRecipes.java +++ b/src/main/java/crazypants/enderio/item/ItemRecipes.java @@ -1,6 +1,11 @@ package crazypants.enderio.item; -import static crazypants.enderio.material.Alloy.*; +import static crazypants.enderio.material.Alloy.CONDUCTIVE_IRON; +import static crazypants.enderio.material.Alloy.DARK_STEEL; +import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL; +import static crazypants.enderio.material.Alloy.END_STEEL; +import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY; +import static crazypants.enderio.material.Alloy.SOULARIUM; import static crazypants.enderio.material.Material.VIBRANT_CYSTAL; import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY; import static crazypants.util.RecipeUtil.addShaped; diff --git a/src/main/java/crazypants/enderio/machine/AbstractMachineEntity.java b/src/main/java/crazypants/enderio/machine/AbstractMachineEntity.java index 3a20720b83..b2a6c25622 100644 --- a/src/main/java/crazypants/enderio/machine/AbstractMachineEntity.java +++ b/src/main/java/crazypants/enderio/machine/AbstractMachineEntity.java @@ -489,11 +489,7 @@ public void readFromItemStack(ItemStack stack) { if (stack == null || stack.stackTagCompound == null) { return; } - NBTTagCompound root = stack.stackTagCompound; - if (!root.hasKey("eio.abstractMachine")) { - return; - } - readCommon(root); + readCommon(stack.stackTagCompound); } @Override diff --git a/src/main/java/crazypants/enderio/machine/MachineRecipes.java b/src/main/java/crazypants/enderio/machine/MachineRecipes.java index cc0da44945..e342982b49 100644 --- a/src/main/java/crazypants/enderio/machine/MachineRecipes.java +++ b/src/main/java/crazypants/enderio/machine/MachineRecipes.java @@ -1,8 +1,19 @@ package crazypants.enderio.machine; import static crazypants.enderio.EnderIO.itemBasicCapacitor; -import static crazypants.enderio.material.Alloy.*; -import static crazypants.enderio.material.Material.*; +import static crazypants.enderio.material.Alloy.DARK_STEEL; +import static crazypants.enderio.material.Alloy.ELECTRICAL_STEEL; +import static crazypants.enderio.material.Alloy.END_STEEL; +import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY; +import static crazypants.enderio.material.Alloy.PHASED_GOLD; +import static crazypants.enderio.material.Alloy.PHASED_IRON; +import static crazypants.enderio.material.Alloy.REDSTONE_ALLOY; +import static crazypants.enderio.material.Alloy.SOULARIUM; +import static crazypants.enderio.material.Material.CONDUIT_BINDER; +import static crazypants.enderio.material.Material.ENDER_CRYSTAL; +import static crazypants.enderio.material.Material.PULSATING_CYSTAL; +import static crazypants.enderio.material.Material.SILICON; +import static crazypants.enderio.material.Material.VIBRANT_CYSTAL; import net.minecraft.init.Blocks; import net.minecraft.init.Items; diff --git a/src/main/java/crazypants/enderio/machine/capbank/network/ClientNetworkManager.java b/src/main/java/crazypants/enderio/machine/capbank/network/ClientNetworkManager.java index 7a578a245a..3d74ca9efc 100644 --- a/src/main/java/crazypants/enderio/machine/capbank/network/ClientNetworkManager.java +++ b/src/main/java/crazypants/enderio/machine/capbank/network/ClientNetworkManager.java @@ -4,13 +4,20 @@ import java.util.Map; import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.WorldEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import crazypants.enderio.machine.capbank.TileCapBank; public class ClientNetworkManager { private static final ClientNetworkManager instance = new ClientNetworkManager(); + static { + MinecraftForge.EVENT_BUS.register(instance); + } + public static ClientNetworkManager getInstance() { return instance; } @@ -53,4 +60,12 @@ public void addToNetwork(int id, TileCapBank tileCapBank) { CapBankClientNetwork network = getOrCreateNetwork(id); network.addMember(tileCapBank); } + + @SubscribeEvent + public void onWorldUnload(WorldEvent.Unload event) { + if (event.world.isRemote) { + networks.forEach((id, network) -> network.destroyNetwork()); + networks.clear(); + } + } } diff --git a/src/main/java/crazypants/enderio/machine/farm/FarmingStationSpecialRenderer.java b/src/main/java/crazypants/enderio/machine/farm/FarmingStationSpecialRenderer.java index 78a8a1a017..764750d6ca 100644 --- a/src/main/java/crazypants/enderio/machine/farm/FarmingStationSpecialRenderer.java +++ b/src/main/java/crazypants/enderio/machine/farm/FarmingStationSpecialRenderer.java @@ -1,6 +1,8 @@ package crazypants.enderio.machine.farm; -import static org.lwjgl.opengl.GL11.*; +import static org.lwjgl.opengl.GL11.GL_LIGHTING; +import static org.lwjgl.opengl.GL11.glDisable; +import static org.lwjgl.opengl.GL11.glEnable; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/crazypants/enderio/machine/obelisk/ObeliskSpecialRenderer.java b/src/main/java/crazypants/enderio/machine/obelisk/ObeliskSpecialRenderer.java index a02ff68348..e67d904d24 100644 --- a/src/main/java/crazypants/enderio/machine/obelisk/ObeliskSpecialRenderer.java +++ b/src/main/java/crazypants/enderio/machine/obelisk/ObeliskSpecialRenderer.java @@ -1,6 +1,14 @@ package crazypants.enderio.machine.obelisk; -import static org.lwjgl.opengl.GL11.*; +import static org.lwjgl.opengl.GL11.GL_ALL_ATTRIB_BITS; +import static org.lwjgl.opengl.GL11.glDepthMask; +import static org.lwjgl.opengl.GL11.glPopAttrib; +import static org.lwjgl.opengl.GL11.glPopMatrix; +import static org.lwjgl.opengl.GL11.glPushAttrib; +import static org.lwjgl.opengl.GL11.glPushMatrix; +import static org.lwjgl.opengl.GL11.glRotatef; +import static org.lwjgl.opengl.GL11.glScalef; +import static org.lwjgl.opengl.GL11.glTranslated; import java.util.Random; @@ -106,7 +114,7 @@ public void renderTileEntityAt(TileEntity te, double x, double y, double z, floa protected void renderItemStack(T te, World world, double x, double y, double z, float tick) { if (ei == null) { - ei = new EntityItem(world, 0, 0, 0, getFloatingItem(te)); + ei = new EntityItem(null, 0, 0, 0, getFloatingItem(te)); } ei.setEntityItemStack(getFloatingItem(te)); diff --git a/src/main/java/crazypants/enderio/machine/tank/BlockItemTank.java b/src/main/java/crazypants/enderio/machine/tank/BlockItemTank.java index d367d2ad09..51f610252a 100644 --- a/src/main/java/crazypants/enderio/machine/tank/BlockItemTank.java +++ b/src/main/java/crazypants/enderio/machine/tank/BlockItemTank.java @@ -71,14 +71,12 @@ public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, L EnderIO.blockTank.addDetailedEntries(itemstack, entityplayer, list, flag); } - private static final FluidTank dummy = new SmartTank(FluidRegistry.WATER, 16000); - private FluidTank loadTank(ItemStack stack) { if (stack.hasTagCompound()) { FluidTank tank = TileTank.loadTank(stack.getTagCompound()); - return tank != null ? tank : dummy; + return tank != null ? tank : new SmartTank(FluidRegistry.WATER, 16000); } - return dummy; + return new SmartTank(FluidRegistry.WATER, 16000); } private void saveTank(ItemStack stack, FluidTank tank) { diff --git a/src/main/java/crazypants/enderio/material/MaterialRecipes.java b/src/main/java/crazypants/enderio/material/MaterialRecipes.java index 0ddc5e001b..d81562d4c9 100644 --- a/src/main/java/crazypants/enderio/material/MaterialRecipes.java +++ b/src/main/java/crazypants/enderio/material/MaterialRecipes.java @@ -1,9 +1,28 @@ package crazypants.enderio.material; -import static crazypants.enderio.material.Alloy.*; -import static crazypants.enderio.material.Material.*; -import static crazypants.enderio.material.endergy.AlloyEndergy.*; -import static crazypants.enderio.power.Capacitors.*; +import static crazypants.enderio.material.Alloy.DARK_STEEL; +import static crazypants.enderio.material.Alloy.END_STEEL; +import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY; +import static crazypants.enderio.material.Alloy.PHASED_GOLD; +import static crazypants.enderio.material.Alloy.PHASED_IRON; +import static crazypants.enderio.material.Alloy.SOULARIUM; +import static crazypants.enderio.material.Material.BINDER_COMPOSITE; +import static crazypants.enderio.material.Material.CONDUIT_BINDER; +import static crazypants.enderio.material.Material.PRECIENT_CRYSTAL; +import static crazypants.enderio.material.endergy.AlloyEndergy.CRYSTALLINE_ALLOY; +import static crazypants.enderio.material.endergy.AlloyEndergy.ENERGETIC_SILVER; +import static crazypants.enderio.material.endergy.AlloyEndergy.MELODIC_ALLOY; +import static crazypants.enderio.material.endergy.AlloyEndergy.STELLAR_ALLOY; +import static crazypants.enderio.material.endergy.AlloyEndergy.VIVID_ALLOY; +import static crazypants.enderio.power.Capacitors.ACTIVATED_CAPACITOR; +import static crazypants.enderio.power.Capacitors.BASIC_CAPACITOR; +import static crazypants.enderio.power.Capacitors.CRYSTALLINE_CAPACITOR; +import static crazypants.enderio.power.Capacitors.ENDERGETIC_CAPACITOR; +import static crazypants.enderio.power.Capacitors.ENDERGISED_CAPACITOR; +import static crazypants.enderio.power.Capacitors.ENDER_CAPACITOR; +import static crazypants.enderio.power.Capacitors.MELODIC_CAPACITOR; +import static crazypants.enderio.power.Capacitors.SILVER_CAPACITOR; +import static crazypants.enderio.power.Capacitors.STELLAR_CAPACITOR; import java.util.ArrayList; diff --git a/src/main/java/crazypants/enderio/material/PowderIngot.java b/src/main/java/crazypants/enderio/material/PowderIngot.java index f3dd0d73ea..337d8907e2 100644 --- a/src/main/java/crazypants/enderio/material/PowderIngot.java +++ b/src/main/java/crazypants/enderio/material/PowderIngot.java @@ -1,6 +1,10 @@ package crazypants.enderio.material; -import static com.enderio.core.common.util.OreDictionaryHelper.*; +import static com.enderio.core.common.util.OreDictionaryHelper.DUST_ENDERPEARL; +import static com.enderio.core.common.util.OreDictionaryHelper.INGOT_COPPER; +import static com.enderio.core.common.util.OreDictionaryHelper.INGOT_ENDERIUM; +import static com.enderio.core.common.util.OreDictionaryHelper.INGOT_TIN; +import static com.enderio.core.common.util.OreDictionaryHelper.isRegistered; public enum PowderIngot { diff --git a/src/main/java/crazypants/enderio/teleport/telepad/TeleportEntityRenderHandler.java b/src/main/java/crazypants/enderio/teleport/telepad/TeleportEntityRenderHandler.java index cbd31202ba..c8575d5761 100644 --- a/src/main/java/crazypants/enderio/teleport/telepad/TeleportEntityRenderHandler.java +++ b/src/main/java/crazypants/enderio/teleport/telepad/TeleportEntityRenderHandler.java @@ -1,6 +1,23 @@ package crazypants.enderio.teleport.telepad; -import static org.lwjgl.opengl.GL11.*; +import static org.lwjgl.opengl.GL11.GL_ALL_ATTRIB_BITS; +import static org.lwjgl.opengl.GL11.GL_ALPHA_TEST; +import static org.lwjgl.opengl.GL11.GL_BLEND; +import static org.lwjgl.opengl.GL11.GL_CULL_FACE; +import static org.lwjgl.opengl.GL11.GL_LIGHTING; +import static org.lwjgl.opengl.GL11.GL_ONE; +import static org.lwjgl.opengl.GL11.GL_SMOOTH; +import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA; +import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D; +import static org.lwjgl.opengl.GL11.GL_ZERO; +import static org.lwjgl.opengl.GL11.glDepthMask; +import static org.lwjgl.opengl.GL11.glDisable; +import static org.lwjgl.opengl.GL11.glEnable; +import static org.lwjgl.opengl.GL11.glPushAttrib; +import static org.lwjgl.opengl.GL11.glPushMatrix; +import static org.lwjgl.opengl.GL11.glRotatef; +import static org.lwjgl.opengl.GL11.glShadeModel; +import static org.lwjgl.opengl.GL11.glTranslated; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; diff --git a/src/main/java/crazypants/enderio/waila/WailaCompat.java b/src/main/java/crazypants/enderio/waila/WailaCompat.java index 78016c3a90..67186712ed 100644 --- a/src/main/java/crazypants/enderio/waila/WailaCompat.java +++ b/src/main/java/crazypants/enderio/waila/WailaCompat.java @@ -1,6 +1,8 @@ package crazypants.enderio.waila; -import static crazypants.enderio.waila.IWailaInfoProvider.*; +import static crazypants.enderio.waila.IWailaInfoProvider.BIT_BASIC; +import static crazypants.enderio.waila.IWailaInfoProvider.BIT_COMMON; +import static crazypants.enderio.waila.IWailaInfoProvider.BIT_DETAILED; import java.text.MessageFormat; import java.util.List; @@ -123,8 +125,6 @@ public Entity getEntityByID(int p_73045_1_) { public static final WailaCompat INSTANCE = new WailaCompat(); - private static IWailaDataAccessor _accessor = null; - public static void load(IWailaRegistrar registrar) { registrar.registerStackProvider(INSTANCE, IFacade.class); registrar.registerStackProvider(INSTANCE, BlockDarkSteelAnvil.class); @@ -188,8 +188,6 @@ public List getWailaHead(ItemStack itemStack, List currenttip, I public List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - _accessor = accessor; - EntityPlayer player = accessor.getPlayer(); MovingObjectPosition pos = accessor.getPosition(); int x = pos.blockX, y = pos.blockY, z = pos.blockZ; @@ -265,7 +263,7 @@ public List getWailaBody(ItemStack itemStack, List currenttip, I } if (te instanceof IConduitBundle) { - getWailaBodyConduitBundle(itemStack, currenttip); + getWailaBodyConduitBundle(itemStack, currenttip, accessor); } else if (te instanceof IInternalPoweredTile && block == accessor.getBlock() && !(te instanceof TileCapBank)) { IInternalPoweredTile power = (IInternalPoweredTile) te; @@ -295,13 +293,13 @@ public List getWailaBody(ItemStack itemStack, List currenttip, I return currenttip; } - private void getWailaBodyConduitBundle(ItemStack itemStack, List currenttip) { + private void getWailaBodyConduitBundle(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor) { if (itemStack == null) { return; } if (itemStack.getItem() == EnderIO.itemPowerConduit || itemStack.getItem() == EnderIO.itemPowerConduitEndergy) { - NBTTagCompound nbtRoot = _accessor.getNBTData(); + NBTTagCompound nbtRoot = accessor.getNBTData(); if (nbtRoot.hasKey("storedEnergyRF")) { int stored = nbtRoot.getInteger("storedEnergyRF"); int max = nbtRoot.getInteger("maxStoredRF"); @@ -318,7 +316,7 @@ private void getWailaBodyConduitBundle(ItemStack itemStack, List current } } else if (itemStack.getItem() == EnderIO.itemLiquidConduit) { - NBTTagCompound nbtRoot = _accessor.getNBTData(); + NBTTagCompound nbtRoot = accessor.getNBTData(); if (nbtRoot.hasKey("fluidLocked") && nbtRoot.hasKey("FluidName")) { boolean fluidTypeLocked = nbtRoot.getBoolean("fluidLocked"); FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbtRoot); @@ -350,7 +348,7 @@ private void getWailaBodyConduitBundle(ItemStack itemStack, List current } } else if (itemStack.getItem() == EnderIO.itemMEConduit) { - NBTTagCompound nbtRoot = _accessor.getNBTData(); + NBTTagCompound nbtRoot = accessor.getNBTData(); if (nbtRoot.hasKey("isDense")) { boolean isDenseUltra = nbtRoot.getBoolean("isDenseUltra"); boolean isDense = nbtRoot.getBoolean("isDense"); @@ -409,7 +407,4 @@ public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCom return tag; } - public static NBTTagCompound getNBTData() { - return _accessor.getNBTData(); - } } diff --git a/src/main/java/crazypants/util/EE3Util.java b/src/main/java/crazypants/util/EE3Util.java index eebf28d2de..5ad0bcbfb7 100644 --- a/src/main/java/crazypants/util/EE3Util.java +++ b/src/main/java/crazypants/util/EE3Util.java @@ -1,6 +1,9 @@ package crazypants.util; -import static crazypants.enderio.material.Material.*; +import static crazypants.enderio.material.Material.BINDER_COMPOSITE; +import static crazypants.enderio.material.Material.CONDUIT_BINDER; +import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET; +import static crazypants.enderio.material.Material.SILICON; import java.util.ArrayList; import java.util.Arrays;