From 91cb7c22a2b0a7843a775096fd5f0584d7745322 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Mon, 23 Sep 2013 12:09:59 -0400 Subject: [PATCH] UpdatedToNewForgeVersion --- .../prefab/RecipeHelper.java | 192 ------------------ src/dark/api/ProcessorRecipes.java | 3 +- src/dark/core/client/FXBeam.java | 6 +- src/dark/core/client/GuiBatteryBox.java | 2 +- src/dark/core/client/GuiCoalGenerator.java | 2 +- src/dark/core/client/GuiElectricFurnace.java | 2 +- .../core/client/renders/BlockRenderInfo.java | 2 +- .../client/renders/BlockRenderingHandler.java | 2 +- .../client/renders/RenderBlockEntity.java | 13 +- .../core/client/renders/RenderBlockFluid.java | 4 +- .../client/renders/RenderTileMachine.java | 6 +- src/dark/core/common/RecipeLoader.java | 5 +- src/dark/core/common/blocks/BlockOre.java | 3 +- src/dark/core/common/debug/BlockDebug.java | 3 +- src/dark/core/common/items/ItemTools.java | 24 +-- src/dark/core/common/items/ItemWrench.java | 2 +- .../common/machines/BlockBasicMachine.java | 3 +- .../core/common/machines/BlockSolarPanel.java | 3 +- src/dark/core/common/transmit/BlockWire.java | 3 +- src/dark/core/prefab/IExtraInfo.java | 3 +- .../prefab/helpers/AutoCraftingManager.java | 2 + src/dark/core/prefab/helpers/FluidHelper.java | 1 + src/dark/core/prefab/helpers/Pair.java | 45 ---- src/dark/core/prefab/helpers/Triple.java | 48 ----- .../core/prefab/invgui/GuiButtonArrow.java | 2 +- .../core/prefab/invgui/GuiGlobalList.java | 2 +- .../core/prefab/machine/BlockMachine.java | 3 +- src/dark/core/prefab/machine/BlockMulti.java | 3 +- .../core/registration/ModObjectRegistry.java | 3 +- 29 files changed, 61 insertions(+), 331 deletions(-) delete mode 100644 APIs/universalelectricity/prefab/RecipeHelper.java delete mode 100644 src/dark/core/prefab/helpers/Pair.java delete mode 100644 src/dark/core/prefab/helpers/Triple.java diff --git a/APIs/universalelectricity/prefab/RecipeHelper.java b/APIs/universalelectricity/prefab/RecipeHelper.java deleted file mode 100644 index 7471c1d89..000000000 --- a/APIs/universalelectricity/prefab/RecipeHelper.java +++ /dev/null @@ -1,192 +0,0 @@ -package universalelectricity.prefab; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.common.Configuration; -import cpw.mods.fml.common.registry.GameRegistry; - -/** - * This class is used to replace recipes that are already added in the existing recipe pool for - * crafting and smelting. All recipe functions take account of the Forge Ore Dictionary. It also - * includes some recipe helper functions to shorten some of your function calls. - * - * @author Calclavia - * - */ -public class RecipeHelper -{ - public static List getRecipesByOutput(ItemStack output) - { - List list = new ArrayList(); - - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).getRecipeOutput() == output) - { - list.add((IRecipe) obj); - } - } - } - - return list; - } - - /** - * Replaces a recipe with a new IRecipe. - * - * @return True if successful - */ - public static boolean replaceRecipe(IRecipe recipe, IRecipe newRecipe) - { - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).equals(recipe) || obj == recipe) - { - CraftingManager.getInstance().getRecipeList().remove(obj); - CraftingManager.getInstance().getRecipeList().add(newRecipe); - return true; - } - } - } - - return false; - } - - /** - * Replaces a recipe with the resulting ItemStack with a new IRecipe. - * - * @return True if successful - */ - public static boolean replaceRecipe(ItemStack recipe, IRecipe newRecipe) - { - if (removeRecipe(recipe)) - { - CraftingManager.getInstance().getRecipeList().add(newRecipe); - return true; - } - - return false; - } - - /** - * Removes a recipe by its IRecipe class. - * - * @return True if successful - */ - public static boolean removeRecipe(IRecipe recipe) - { - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj != null) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).equals(recipe) || obj == recipe) - { - CraftingManager.getInstance().getRecipeList().remove(obj); - return true; - } - } - } - } - - return false; - } - - /** - * Removes the first recipe found by its output. - * - * @return True if successful - */ - public static boolean removeRecipe(ItemStack stack) - { - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj != null) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).getRecipeOutput() != null) - { - if (((IRecipe) obj).getRecipeOutput().isItemEqual(stack)) - { - CraftingManager.getInstance().getRecipeList().remove(obj); - return true; - } - } - } - } - } - - return false; - } - - /** - * Removes all recipes found that has this output. You may use this with Forge Ore Dictionary to - * remove all recipes with the FoD ID. - * - * @return True if successful - */ - public static boolean removeRecipes(ItemStack... itemStacks) - { - boolean didRemove = false; - - for (Iterator itr = CraftingManager.getInstance().getRecipeList().iterator(); itr.hasNext();) - { - Object obj = itr.next(); - - if (obj != null) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).getRecipeOutput() != null) - { - for (ItemStack itemStack : itemStacks) - { - if (((IRecipe) obj).getRecipeOutput().isItemEqual(itemStack)) - { - itr.remove(); - didRemove = true; - break; - } - } - } - } - } - } - - return didRemove; - } - - /** - * Use this function if you want to check if the recipe is allowed in the configuration file. - */ - public static void addRecipe(IRecipe recipe, String name, Configuration configuration, boolean defaultBoolean) - { - if (configuration != null) - { - configuration.load(); - - if (configuration.get("Crafting", "Allow " + name + " Crafting", defaultBoolean).getBoolean(defaultBoolean)) - { - GameRegistry.addRecipe(recipe); - } - - configuration.save(); - } - } - - public static void addRecipe(IRecipe recipe, Configuration config, boolean defaultBoolean) - { - addRecipe(recipe, recipe.getRecipeOutput().getItemName(), config, defaultBoolean); - } -} diff --git a/src/dark/api/ProcessorRecipes.java b/src/dark/api/ProcessorRecipes.java index fca5b4b15..874167e6b 100644 --- a/src/dark/api/ProcessorRecipes.java +++ b/src/dark/api/ProcessorRecipes.java @@ -5,11 +5,12 @@ import java.util.HashMap; import java.util.List; import java.util.Random; +import com.builtbroken.common.Pair; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import dark.core.prefab.helpers.AutoCraftingManager; -import dark.core.prefab.helpers.Pair; /** Recipes for ore processor machines * diff --git a/src/dark/core/client/FXBeam.java b/src/dark/core/client/FXBeam.java index 86505aae8..bd5e34ed9 100644 --- a/src/dark/core/client/FXBeam.java +++ b/src/dark/core/client/FXBeam.java @@ -19,7 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly; import dark.core.common.DarkMain; /** Based off Thaumcraft's Beam Renderer. - * + * * @author Calclavia, Azanor */ @SideOnly(Side.CLIENT) public class FXBeam extends EntityFX @@ -165,7 +165,7 @@ public class FXBeam extends EntityFX } - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(this.texture)); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(this.texture)); GL11.glTexParameterf(3553, 10242, 10497.0F); GL11.glTexParameterf(3553, 10243, 10497.0F); @@ -230,6 +230,6 @@ public class FXBeam extends EntityFX tessellator.startDrawingQuads(); this.prevSize = size; - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation("/particles.png")); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("/particles.png")); } } \ No newline at end of file diff --git a/src/dark/core/client/GuiBatteryBox.java b/src/dark/core/client/GuiBatteryBox.java index a057f03fd..d18cb1312 100644 --- a/src/dark/core/client/GuiBatteryBox.java +++ b/src/dark/core/client/GuiBatteryBox.java @@ -50,7 +50,7 @@ public class GuiBatteryBox extends GuiContainer @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - this.mc.renderEngine.func_110577_a(batteryBoxTexture); + this.mc.renderEngine.bindTexture(batteryBoxTexture); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.containerWidth = (this.width - this.xSize) / 2; diff --git a/src/dark/core/client/GuiCoalGenerator.java b/src/dark/core/client/GuiCoalGenerator.java index 39bb95d05..b6378d361 100644 --- a/src/dark/core/client/GuiCoalGenerator.java +++ b/src/dark/core/client/GuiCoalGenerator.java @@ -62,7 +62,7 @@ public class GuiCoalGenerator extends GuiContainer @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - this.mc.renderEngine.func_110577_a(coalGeneratorTexture); + this.mc.renderEngine.bindTexture(coalGeneratorTexture); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); containerWidth = (this.width - this.xSize) / 2; diff --git a/src/dark/core/client/GuiElectricFurnace.java b/src/dark/core/client/GuiElectricFurnace.java index de9f7dc2e..31556450f 100644 --- a/src/dark/core/client/GuiElectricFurnace.java +++ b/src/dark/core/client/GuiElectricFurnace.java @@ -59,7 +59,7 @@ public class GuiElectricFurnace extends GuiContainer @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - this.mc.renderEngine.func_110577_a(electricFurnaceTexture); + this.mc.renderEngine.bindTexture(electricFurnaceTexture); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); containerWidth = (this.width - this.xSize) / 2; diff --git a/src/dark/core/client/renders/BlockRenderInfo.java b/src/dark/core/client/renders/BlockRenderInfo.java index 5675239c7..f420d736b 100644 --- a/src/dark/core/client/renders/BlockRenderInfo.java +++ b/src/dark/core/client/renders/BlockRenderInfo.java @@ -49,7 +49,7 @@ public class BlockRenderInfo } if (par1Icon == null) { - icon = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(TextureMap.field_110575_b)).func_110572_b("missingno"); + icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); } return icon; } diff --git a/src/dark/core/client/renders/BlockRenderingHandler.java b/src/dark/core/client/renders/BlockRenderingHandler.java index a0c9e7ad0..0ba1d97f1 100644 --- a/src/dark/core/client/renders/BlockRenderingHandler.java +++ b/src/dark/core/client/renders/BlockRenderingHandler.java @@ -30,7 +30,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler GL11.glPushMatrix(); if (CoreRecipeLoader.blockSolar != null && block.blockID == CoreRecipeLoader.blockSolar.blockID) { - FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(DarkMain.getInstance().DOMAIN, ModPrefab.MODEL_DIRECTORY + "solarPanel.png")); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(DarkMain.getInstance().DOMAIN, ModPrefab.MODEL_DIRECTORY + "solarPanel.png")); GL11.glTranslatef(0.0F, 1.5F, 0.0F); GL11.glRotatef(180f, 0f, 0f, 1f); solarPanelModel.render(0.0625F); diff --git a/src/dark/core/client/renders/RenderBlockEntity.java b/src/dark/core/client/renders/RenderBlockEntity.java index e68a1d88c..4654693ba 100644 --- a/src/dark/core/client/renders/RenderBlockEntity.java +++ b/src/dark/core/client/renders/RenderBlockEntity.java @@ -18,11 +18,6 @@ public class RenderBlockEntity extends Render public static RenderBlockEntity INSTANCE = new RenderBlockEntity(); - @Override - protected ResourceLocation func_110775_a(Entity entity) - { - throw new UnsupportedOperationException("Not supported yet."); - } private RenderBlockEntity() { @@ -43,7 +38,7 @@ public class RenderBlockEntity extends Render World world = entity.worldObj; BlockRenderInfo util = new BlockRenderInfo(); util.texture = entity.texture; - func_110776_a(TextureMap.field_110575_b); + this.bindTexture(TextureMap.locationBlocksTexture); for (int iBase = 0; iBase < entity.iSize; ++iBase) { @@ -191,4 +186,10 @@ public class RenderBlockEntity extends Render tessellator.draw(); } } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/src/dark/core/client/renders/RenderBlockFluid.java b/src/dark/core/client/renders/RenderBlockFluid.java index c781adc3d..cfc115ac0 100644 --- a/src/dark/core/client/renders/RenderBlockFluid.java +++ b/src/dark/core/client/renders/RenderBlockFluid.java @@ -18,7 +18,7 @@ import org.lwjgl.opengl.GL11; public class RenderBlockFluid { - private static final ResourceLocation BLOCK_TEXTURE = TextureMap.field_110575_b; + private static final ResourceLocation BLOCK_TEXTURE = TextureMap.locationBlocksTexture; private static Map flowingRenderCache = new HashMap(); private static Map stillRenderCache = new HashMap(); @@ -41,7 +41,7 @@ public class RenderBlockFluid Icon icon = flowing ? fluid.getFlowingIcon() : fluid.getStillIcon(); if (icon == null) { - icon = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(TextureMap.field_110575_b)).func_110572_b("missingno"); + icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); } return icon; } diff --git a/src/dark/core/client/renders/RenderTileMachine.java b/src/dark/core/client/renders/RenderTileMachine.java index f3de7e603..2d721b393 100644 --- a/src/dark/core/client/renders/RenderTileMachine.java +++ b/src/dark/core/client/renders/RenderTileMachine.java @@ -15,16 +15,16 @@ public abstract class RenderTileMachine extends TileEntitySpecialRenderer } /** Sudo method for setting the texture for current render - * + * * @param name */ public void bindTextureByName(String domain, String name) { - func_110628_a(new ResourceLocation(domain, name)); + this.bindTexture(new ResourceLocation(domain, name)); } public void bindTextureByName(ResourceLocation name) { - func_110628_a(name); + this.bindTexture(name); } /** Gets the texture based on block and metadata mainly used by item/block inv render */ diff --git a/src/dark/core/common/RecipeLoader.java b/src/dark/core/common/RecipeLoader.java index 66cc3584e..390d478fa 100644 --- a/src/dark/core/common/RecipeLoader.java +++ b/src/dark/core/common/RecipeLoader.java @@ -1,13 +1,14 @@ package dark.core.common; +import com.builtbroken.common.Pair; +import com.builtbroken.common.Triple; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; -import dark.core.prefab.helpers.Pair; -import dark.core.prefab.helpers.Triple; public abstract class RecipeLoader { diff --git a/src/dark/core/common/blocks/BlockOre.java b/src/dark/core/common/blocks/BlockOre.java index 2eb4e6a10..766dad556 100644 --- a/src/dark/core/common/blocks/BlockOre.java +++ b/src/dark/core/common/blocks/BlockOre.java @@ -3,6 +3,8 @@ package dark.core.common.blocks; import java.util.List; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; @@ -21,7 +23,6 @@ import dark.core.common.DarkMain; import dark.core.common.items.EnumMaterial; import dark.core.prefab.IExtraInfo.IExtraBlockInfo; import dark.core.prefab.ModPrefab; -import dark.core.prefab.helpers.Pair; public class BlockOre extends Block implements IExtraBlockInfo { diff --git a/src/dark/core/common/debug/BlockDebug.java b/src/dark/core/common/debug/BlockDebug.java index 3355a3659..1aa879725 100644 --- a/src/dark/core/common/debug/BlockDebug.java +++ b/src/dark/core/common/debug/BlockDebug.java @@ -3,6 +3,8 @@ package dark.core.common.debug; import java.util.List; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -15,7 +17,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.common.DMCreativeTab; import dark.core.common.DarkMain; -import dark.core.prefab.helpers.Pair; import dark.core.prefab.machine.BlockMachine; import dark.core.registration.ModObjectRegistry.BlockBuildData; diff --git a/src/dark/core/common/items/ItemTools.java b/src/dark/core/common/items/ItemTools.java index ba28a40dc..789a04ede 100644 --- a/src/dark/core/common/items/ItemTools.java +++ b/src/dark/core/common/items/ItemTools.java @@ -106,7 +106,7 @@ public class ItemTools extends ItemBasic output = output.substring(0, 100); } output.trim(); - player.sendChatToPlayer(ChatMessageComponent.func_111066_d("ReadOut> " + output)); + player.sendChatToPlayer(ChatMessageComponent.createFromText("ReadOut> " + output)); return true; } } @@ -117,10 +117,10 @@ public class ItemTools extends ItemBasic FluidTankInfo[] tanks = ((IFluidHandler) tileEntity).getTankInfo(ForgeDirection.getOrientation(side)); if (tanks != null) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d("FluidHandler> Side:" + ForgeDirection.getOrientation(side).toString() + " Tanks:" + tanks.length)); + player.sendChatToPlayer(ChatMessageComponent.createFromText("FluidHandler> Side:" + ForgeDirection.getOrientation(side).toString() + " Tanks:" + tanks.length)); for (FluidStack stack : FluidHelper.getFluidList(tanks)) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d("Fluid>" + stack.amount + "mb of " + stack.getFluid().getName())); + player.sendChatToPlayer(ChatMessageComponent.createFromText("Fluid>" + stack.amount + "mb of " + stack.getFluid().getName())); } return true; } @@ -130,45 +130,45 @@ public class ItemTools extends ItemBasic if (tool == EnumTools.MULTI_METER) { //TODO filter all units threw UE unit helper to created nicer looking output text - player.sendChatToPlayer(ChatMessageComponent.func_111066_d("Side>" + ForgeDirection.getOrientation(side).toString())); + player.sendChatToPlayer(ChatMessageComponent.createFromText("Side>" + ForgeDirection.getOrientation(side).toString())); boolean out = false; // Output electrical info if (tileEntity instanceof IElectrical) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(" Voltage> " + ElectricityDisplay.getDisplay(((IElectrical) tileEntity).getVoltage(), ElectricUnit.VOLTAGE, 2, true))); + player.sendChatToPlayer(ChatMessageComponent.createFromText(" Voltage> " + ElectricityDisplay.getDisplay(((IElectrical) tileEntity).getVoltage(), ElectricUnit.VOLTAGE, 2, true))); if (((IElectrical) tileEntity).getRequest(ForgeDirection.getOrientation(side).getOpposite()) > 0) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(" RequiredWatts> " + ElectricityDisplay.getDisplay(((IElectrical) tileEntity).getRequest(ForgeDirection.getOrientation(side).getOpposite()), ElectricUnit.WATT, 2, true))); + player.sendChatToPlayer(ChatMessageComponent.createFromText(" RequiredWatts> " + ElectricityDisplay.getDisplay(((IElectrical) tileEntity).getRequest(ForgeDirection.getOrientation(side).getOpposite()), ElectricUnit.WATT, 2, true))); } if (((IElectrical) tileEntity).getProvide(ForgeDirection.getOrientation(side).getOpposite()) > 0) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(" AvailableWatts> " + ElectricityDisplay.getDisplay(((IElectrical) tileEntity).getProvide(ForgeDirection.getOrientation(side).getOpposite()), ElectricUnit.WATT, 2, true))); + player.sendChatToPlayer(ChatMessageComponent.createFromText(" AvailableWatts> " + ElectricityDisplay.getDisplay(((IElectrical) tileEntity).getProvide(ForgeDirection.getOrientation(side).getOpposite()), ElectricUnit.WATT, 2, true))); } out = true; } //Output battery info if (tileEntity instanceof IElectricalStorage) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(" EnergyStored> " + ElectricityDisplay.getDisplay(((IElectricalStorage) tileEntity).getEnergyStored(), ElectricUnit.WATT, 2, true) + " out of " + ElectricityDisplay.getDisplay(((IElectricalStorage) tileEntity).getMaxEnergyStored(), ElectricUnit.WATT, 2, true) + " Max")); + player.sendChatToPlayer(ChatMessageComponent.createFromText(" EnergyStored> " + ElectricityDisplay.getDisplay(((IElectricalStorage) tileEntity).getEnergyStored(), ElectricUnit.WATT, 2, true) + " out of " + ElectricityDisplay.getDisplay(((IElectricalStorage) tileEntity).getMaxEnergyStored(), ElectricUnit.WATT, 2, true) + " Max")); out = true; } //Output wire info if (tileEntity instanceof IConductor) { out = true; - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(" Resistance> " + ElectricityDisplay.getDisplay(((IConductor) tileEntity).getResistance(), ElectricUnit.RESISTANCE, 2, true) + " | " + "AmpMax> " + ElectricityDisplay.getDisplay(((IConductor) tileEntity).getCurrentCapacity(), ElectricUnit.AMPERE, 2, true))); + player.sendChatToPlayer(ChatMessageComponent.createFromText(" Resistance> " + ElectricityDisplay.getDisplay(((IConductor) tileEntity).getResistance(), ElectricUnit.RESISTANCE, 2, true) + " | " + "AmpMax> " + ElectricityDisplay.getDisplay(((IConductor) tileEntity).getCurrentCapacity(), ElectricUnit.AMPERE, 2, true))); if (((IConductor) tileEntity).getNetwork() != null) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(" Network>" + ((IConductor) tileEntity).getNetwork().toString())); + player.sendChatToPlayer(ChatMessageComponent.createFromText(" Network>" + ((IConductor) tileEntity).getNetwork().toString())); - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(String.format(" Network>WattRequired> " + (((IConductor) tileEntity).getNetwork().getRequest() != null ? ElectricityDisplay.getDisplay(((IConductor) tileEntity).getNetwork().getRequest().getWatts(), ElectricUnit.WATT, 2, true) : "Error") + " | " + "TotalResistance> " + ElectricityDisplay.getDisplay(((IConductor) tileEntity).getNetwork().getTotalResistance(), ElectricUnit.RESISTANCE, 2, true)))); + player.sendChatToPlayer(ChatMessageComponent.createFromText(String.format(" Network>WattRequired> " + (((IConductor) tileEntity).getNetwork().getRequest() != null ? ElectricityDisplay.getDisplay(((IConductor) tileEntity).getNetwork().getRequest().getWatts(), ElectricUnit.WATT, 2, true) : "Error") + " | " + "TotalResistance> " + ElectricityDisplay.getDisplay(((IConductor) tileEntity).getNetwork().getTotalResistance(), ElectricUnit.RESISTANCE, 2, true)))); } } //If no ouput was created suggest that the block is not valid for connection if (!out) { - player.sendChatToPlayer(ChatMessageComponent.func_111066_d(" Error failed to connect to block")); + player.sendChatToPlayer(ChatMessageComponent.createFromText(" Error failed to connect to block")); } } diff --git a/src/dark/core/common/items/ItemWrench.java b/src/dark/core/common/items/ItemWrench.java index 56723b492..9ac72ba2a 100644 --- a/src/dark/core/common/items/ItemWrench.java +++ b/src/dark/core/common/items/ItemWrench.java @@ -22,7 +22,7 @@ public class ItemWrench extends ItemBasic implements IToolWrench this.setMaxStackSize(1); this.setMaxDamage(500 + config.get("general", "AddedWrenchUses", 500).getInt()); this.setCreativeTab(CreativeTabs.tabTools); - this.func_111206_d(DarkMain.getInstance().PREFIX + "wrench"); + this.setTextureName(DarkMain.getInstance().PREFIX + "wrench"); } @Override diff --git a/src/dark/core/common/machines/BlockBasicMachine.java b/src/dark/core/common/machines/BlockBasicMachine.java index 71445adbe..58009d43a 100644 --- a/src/dark/core/common/machines/BlockBasicMachine.java +++ b/src/dark/core/common/machines/BlockBasicMachine.java @@ -4,6 +4,8 @@ import java.util.List; import java.util.Random; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -16,7 +18,6 @@ import universalelectricity.core.UniversalElectricity; import dark.core.common.CommonProxy; import dark.core.common.DMCreativeTab; import dark.core.common.DarkMain; -import dark.core.prefab.helpers.Pair; import dark.core.prefab.machine.BlockMachine; import dark.core.registration.ModObjectRegistry.BlockBuildData; diff --git a/src/dark/core/common/machines/BlockSolarPanel.java b/src/dark/core/common/machines/BlockSolarPanel.java index fc464d187..864118fae 100644 --- a/src/dark/core/common/machines/BlockSolarPanel.java +++ b/src/dark/core/common/machines/BlockSolarPanel.java @@ -2,6 +2,8 @@ package dark.core.common.machines; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -10,7 +12,6 @@ import net.minecraftforge.oredict.OreDictionary; import universalelectricity.core.UniversalElectricity; import dark.core.client.renders.BlockRenderingHandler; import dark.core.common.DMCreativeTab; -import dark.core.prefab.helpers.Pair; import dark.core.prefab.machine.BlockMachine; import dark.core.registration.ModObjectRegistry.BlockBuildData; diff --git a/src/dark/core/common/transmit/BlockWire.java b/src/dark/core/common/transmit/BlockWire.java index 1c87a3927..8d5fad663 100644 --- a/src/dark/core/common/transmit/BlockWire.java +++ b/src/dark/core/common/transmit/BlockWire.java @@ -3,6 +3,8 @@ package dark.core.common.transmit; import java.util.List; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; @@ -17,7 +19,6 @@ import universalelectricity.core.vector.Vector3; import universalelectricity.prefab.tile.TileEntityConductor; import dark.core.common.DMCreativeTab; import dark.core.common.DarkMain; -import dark.core.prefab.helpers.Pair; import dark.core.prefab.machine.BlockMachine; import dark.core.registration.ModObjectRegistry.BlockBuildData; diff --git a/src/dark/core/prefab/IExtraInfo.java b/src/dark/core/prefab/IExtraInfo.java index 8319e764b..a0f178d2f 100644 --- a/src/dark/core/prefab/IExtraInfo.java +++ b/src/dark/core/prefab/IExtraInfo.java @@ -2,10 +2,11 @@ package dark.core.prefab; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.block.ITileEntityProvider; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.Configuration; -import dark.core.prefab.helpers.Pair; /** Used to handle info about the block that would normally be handled by the mod main class. Use the * BlockRegistry in order for these methods to be called on load of the mod. diff --git a/src/dark/core/prefab/helpers/AutoCraftingManager.java b/src/dark/core/prefab/helpers/AutoCraftingManager.java index ea23984b5..e60e22e44 100644 --- a/src/dark/core/prefab/helpers/AutoCraftingManager.java +++ b/src/dark/core/prefab/helpers/AutoCraftingManager.java @@ -3,6 +3,8 @@ package dark.core.prefab.helpers; import java.util.ArrayList; import java.util.List; +import com.builtbroken.common.Pair; + import net.minecraft.block.Block; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; diff --git a/src/dark/core/prefab/helpers/FluidHelper.java b/src/dark/core/prefab/helpers/FluidHelper.java index ed715db16..81e78e973 100644 --- a/src/dark/core/prefab/helpers/FluidHelper.java +++ b/src/dark/core/prefab/helpers/FluidHelper.java @@ -24,6 +24,7 @@ import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.IFluidHandler; import universalelectricity.core.vector.Vector3; +import com.builtbroken.common.Pair; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; diff --git a/src/dark/core/prefab/helpers/Pair.java b/src/dark/core/prefab/helpers/Pair.java deleted file mode 100644 index a7af65619..000000000 --- a/src/dark/core/prefab/helpers/Pair.java +++ /dev/null @@ -1,45 +0,0 @@ -package dark.core.prefab.helpers; - -public class Pair -{ - private final L left; - private final R right; - - public Pair(L left, R right) - { - this.left = left; - this.right = right; - } - - public L getKey() - { - return left; - } - - public R getValue() - { - return right; - } - - @Override - public int hashCode() - { - if (left == null || right == null) - { - super.hashCode(); - } - return left.hashCode() ^ right.hashCode(); - } - - @Override - public boolean equals(Object o) - { - if (o == null) - return false; - if (!(o instanceof Pair)) - return false; - Pair pairo = (Pair) o; - return this.left.equals(pairo.getKey()) && this.right.equals(pairo.getValue()); - } - -} \ No newline at end of file diff --git a/src/dark/core/prefab/helpers/Triple.java b/src/dark/core/prefab/helpers/Triple.java deleted file mode 100644 index d158f8abc..000000000 --- a/src/dark/core/prefab/helpers/Triple.java +++ /dev/null @@ -1,48 +0,0 @@ -package dark.core.prefab.helpers; - -public class Triple -{ - private final A aaa; - private final B bbb; - private final C ccc; - - public Triple(A left, B right, C ccc) - { - this.aaa = left; - this.bbb = right; - this.ccc = ccc; - } - - public A getA() - { - return aaa; - } - - public B getB() - { - return bbb; - } - - public C getC() - { - return ccc; - } - - @Override - public int hashCode() - { - return aaa.hashCode() ^ bbb.hashCode() ^ ccc.hashCode(); - } - - @Override - public boolean equals(Object o) - { - if (o == null) - return false; - if (!(o instanceof Triple)) - return false; - Triple pairo = (Triple) o; - return this.aaa.equals(pairo.getA()) && this.bbb.equals(pairo.getB()) && this.ccc.equals(pairo.getC()); - } - -} \ No newline at end of file diff --git a/src/dark/core/prefab/invgui/GuiButtonArrow.java b/src/dark/core/prefab/invgui/GuiButtonArrow.java index 3333f3095..f0a9f9870 100644 --- a/src/dark/core/prefab/invgui/GuiButtonArrow.java +++ b/src/dark/core/prefab/invgui/GuiButtonArrow.java @@ -28,7 +28,7 @@ public class GuiButtonArrow extends GuiButton { if (this.drawButton) { - par1Minecraft.func_110434_K().func_110577_a(gui_pic); + par1Minecraft.renderEngine.bindTexture(gui_pic); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); boolean var4 = width >= this.xPosition && hight >= this.yPosition && width < this.xPosition + this.width && hight < this.yPosition + this.height; int var5 = 106; diff --git a/src/dark/core/prefab/invgui/GuiGlobalList.java b/src/dark/core/prefab/invgui/GuiGlobalList.java index efdf1572a..70816d7d1 100644 --- a/src/dark/core/prefab/invgui/GuiGlobalList.java +++ b/src/dark/core/prefab/invgui/GuiGlobalList.java @@ -133,7 +133,7 @@ public class GuiGlobalList extends GuiContainer implements IScroll protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { ResourceLocation name = new ResourceLocation(ModPrefab.GUI_DIRECTORY + ":gui_access_base.png"); - this.mc.renderEngine.func_110577_a(name); + this.mc.renderEngine.bindTexture(name); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int containerWidth = (this.width - this.width) / 2; diff --git a/src/dark/core/prefab/machine/BlockMachine.java b/src/dark/core/prefab/machine/BlockMachine.java index 079c8c374..f5444970e 100644 --- a/src/dark/core/prefab/machine/BlockMachine.java +++ b/src/dark/core/prefab/machine/BlockMachine.java @@ -2,6 +2,8 @@ package dark.core.prefab.machine; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.block.ITileEntityProvider; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.tileentity.TileEntity; @@ -17,7 +19,6 @@ import dark.api.parts.INetworkPart; import dark.core.common.DarkMain; import dark.core.prefab.IExtraInfo.IExtraBlockInfo; import dark.core.prefab.ModPrefab; -import dark.core.prefab.helpers.Pair; import dark.core.registration.ModObjectRegistry.BlockBuildData; /** Basic TileEntity Container class designed to be used by generic machines. It is suggested that diff --git a/src/dark/core/prefab/machine/BlockMulti.java b/src/dark/core/prefab/machine/BlockMulti.java index 60e820212..d0fbc608c 100644 --- a/src/dark/core/prefab/machine/BlockMulti.java +++ b/src/dark/core/prefab/machine/BlockMulti.java @@ -3,6 +3,8 @@ package dark.core.prefab.machine; import java.util.Random; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.client.renderer.texture.IconRegister; @@ -19,7 +21,6 @@ import cpw.mods.fml.relauncher.SideOnly; import dark.core.common.DarkMain; import dark.core.prefab.IExtraInfo.IExtraBlockInfo; import dark.core.prefab.ModPrefab; -import dark.core.prefab.helpers.Pair; public class BlockMulti extends BlockContainer implements IExtraBlockInfo { diff --git a/src/dark/core/registration/ModObjectRegistry.java b/src/dark/core/registration/ModObjectRegistry.java index 4e21793b1..fdac66bbb 100644 --- a/src/dark/core/registration/ModObjectRegistry.java +++ b/src/dark/core/registration/ModObjectRegistry.java @@ -9,6 +9,8 @@ import java.lang.reflect.Type; import java.util.HashSet; import java.util.Set; +import com.builtbroken.common.Pair; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -23,7 +25,6 @@ import dark.core.common.DarkMain; import dark.core.prefab.IExtraInfo; import dark.core.prefab.IExtraInfo.IExtraBlockInfo; import dark.core.prefab.ModPrefab; -import dark.core.prefab.helpers.Pair; import dark.core.prefab.machine.BlockMachine; /** Handler to make registering all parts of a mod's objects that are loaded into the game by forge