diff --git a/src/minecraft/mekanism/client/RenderDynamicTank.java b/src/minecraft/mekanism/client/RenderDynamicTank.java index 36170b423..6bb71f35c 100644 --- a/src/minecraft/mekanism/client/RenderDynamicTank.java +++ b/src/minecraft/mekanism/client/RenderDynamicTank.java @@ -10,9 +10,9 @@ import mekanism.common.SynchronizedTankData.ValveData; import mekanism.common.TileEntityDynamicTank; import net.minecraft.block.Block; import net.minecraft.client.renderer.GLAllocation; -import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; @@ -48,7 +48,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer bindTextureByName(tileEntity.structure.liquidStored.canonical().getTextureSheet()); - if(data.location != null && data.height > 0) + if(data.location != null && data.height > 0 && Item.itemsList[tileEntity.structure.liquidStored.itemID] != null) { push(); @@ -122,6 +122,12 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer cachedCenterLiquids.put(data, map); } + int color = stack.asItemStack().getItem().getColorFromItemStack(stack.asItemStack(), 0); + float cR = (color >> 16 & 0xFF) / 255.0F; + float cG = (color >> 8 & 0xFF) / 255.0F; + float cB = (color & 0xFF) / 255.0F; + GL11.glColor4f(cR, cG, cB, 1.0F); + for(int i = 0; i < stages; i++) { displays[i] = GLAllocation.generateDisplayLists(1); @@ -139,6 +145,8 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer GL11.glEndList(); } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + return displays; } diff --git a/src/minecraft/mekanism/client/RenderMechanicalPipe.java b/src/minecraft/mekanism/client/RenderMechanicalPipe.java index 9a7e15182..d93b2bc79 100644 --- a/src/minecraft/mekanism/client/RenderMechanicalPipe.java +++ b/src/minecraft/mekanism/client/RenderMechanicalPipe.java @@ -168,6 +168,12 @@ public class RenderMechanicalPipe extends TileEntitySpecialRenderer cachedLiquids.put(side, map); } + int color = stack.asItemStack().getItem().getColorFromItemStack(stack.asItemStack(), 0); + float cR = (color >> 16 & 0xFF) / 255.0F; + float cG = (color >> 8 & 0xFF) / 255.0F; + float cB = (color & 0xFF) / 255.0F; + GL11.glColor4f(cR, cG, cB, 1.0F); + switch(side) { case UNKNOWN: @@ -319,6 +325,8 @@ public class RenderMechanicalPipe extends TileEntitySpecialRenderer } } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + return null; } } diff --git a/src/minecraft/mekanism/common/MekanismHooks.java b/src/minecraft/mekanism/common/MekanismHooks.java index e57e8de88..7776c4629 100644 --- a/src/minecraft/mekanism/common/MekanismHooks.java +++ b/src/minecraft/mekanism/common/MekanismHooks.java @@ -52,8 +52,10 @@ public final class MekanismHooks if(Loader.isModLoaded("BuildCraft|Energy")) BuildCraftLoaded = true; if(Loader.isModLoaded("Forestry")) ForestryLoaded = true; if(Loader.isModLoaded("ThermalExpansion")) TELoaded = true; - if(Loader.isModLoaded("Metallurgy3Core")) { + if(Loader.isModLoaded("Metallurgy3Core")) + { MetallurgyCoreLoaded = true; + if(Loader.isModLoaded("Metallurgy3Base")) MetallurgyBaseLoaded = true; } @@ -75,19 +77,27 @@ public final class MekanismHooks for(Map.Entry entry : Recipes.macerator.getRecipes().entrySet()) { - if(!Recipe.ENRICHMENT_CHAMBER.get().containsKey(entry.getKey())) + if(MekanismUtils.getName(entry.getKey()).startsWith("ore")) { - if(MekanismUtils.getName(entry.getKey()).startsWith("ore")) + if(!Recipe.ENRICHMENT_CHAMBER.containsRecipe(entry.getKey())) { RecipeHandler.addEnrichmentChamberRecipe(entry.getKey(), entry.getValue()); } } + else if(MekanismUtils.getName(entry.getKey()).startsWith("ingot")) + { + if(!Recipe.CRUSHER.containsRecipe(entry.getKey())) + { + RecipeHandler.addCrusherRecipe(entry.getKey(), entry.getValue()); + } + } } Recipes.matterAmplifier.addRecipe(new ItemStack(Mekanism.EnrichedAlloy), 50000); System.out.println("[Mekanism] Hooked into IC2 successfully."); } + if(BasicComponentsLoaded) { if(Mekanism.disableBCSteelCrafting) @@ -104,29 +114,39 @@ public final class MekanismHooks System.out.println("[Mekanism] Hooked into BasicComponents successfully."); } + if(BuildCraftLoaded) { System.out.println("[Mekanism] Hooked into BuildCraft successfully."); } + if(ForestryLoaded) { ForestryBiofuelID = getForestryItem("liquidBiofuel").itemID; ForestryBiofuelBucket = getForestryItem("bucketBiofuel"); System.out.println("[Mekanism] Hooked into Forestry successfully."); } + if(TELoaded) { for(IPulverizerRecipe recipe : CraftingManagers.pulverizerManager.getRecipeList()) { if(recipe.getSecondaryOutput() == null) { - if(!Recipe.ENRICHMENT_CHAMBER.get().containsKey(recipe.getInput())) + if(MekanismUtils.getName(recipe.getInput()).startsWith("ore")) { - if(MekanismUtils.getName(recipe.getInput()).startsWith("ore")) + if(!Recipe.ENRICHMENT_CHAMBER.containsRecipe(recipe.getInput())) { RecipeHandler.addEnrichmentChamberRecipe(recipe.getInput(), recipe.getPrimaryOutput()); } } + else if(MekanismUtils.getName(recipe.getInput()).startsWith("ingot")) + { + if(!Recipe.CRUSHER.containsRecipe(recipe.getInput())) + { + RecipeHandler.addCrusherRecipe(recipe.getInput(), recipe.getPrimaryOutput()); + } + } } } } diff --git a/src/minecraft/mekanism/common/MekanismUtils.java b/src/minecraft/mekanism/common/MekanismUtils.java index 2966b3b1d..6473aa7aa 100644 --- a/src/minecraft/mekanism/common/MekanismUtils.java +++ b/src/minecraft/mekanism/common/MekanismUtils.java @@ -8,12 +8,9 @@ import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; import mekanism.api.EnumColor; import mekanism.api.IConfigurable; -import mekanism.api.InfuseObject; import mekanism.api.Object3D; import mekanism.common.IFactory.RecipeType; import mekanism.common.PacketHandler.Transmission; diff --git a/src/minecraft/mekanism/common/RecipeHandler.java b/src/minecraft/mekanism/common/RecipeHandler.java index 5ac4645da..145c0cb93 100644 --- a/src/minecraft/mekanism/common/RecipeHandler.java +++ b/src/minecraft/mekanism/common/RecipeHandler.java @@ -159,6 +159,27 @@ public final class RecipeHandler recipes.put(input, output); } + public boolean containsRecipe(ItemStack input) + { + for(Object obj : get().entrySet()) + { + if(obj instanceof Map.Entry) + { + Map.Entry entry = (Map.Entry)obj; + + if(entry.getKey() instanceof ItemStack) + { + if(((ItemStack)entry.getKey()).isItemEqual(input)) + { + return true; + } + } + } + } + + return false; + } + public HashMap get() { return recipes; diff --git a/src/minecraft/mekanism/common/TileEntityUniversalCable.java b/src/minecraft/mekanism/common/TileEntityUniversalCable.java index 85006bb2e..d1a17bcf5 100644 --- a/src/minecraft/mekanism/common/TileEntityUniversalCable.java +++ b/src/minecraft/mekanism/common/TileEntityUniversalCable.java @@ -60,14 +60,6 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa { energyNetwork = network; } - - public void refreshTile(TileEntity tileEntity) - { - if(tileEntity instanceof IUniversalCable) - { - getNetwork().merge(((IUniversalCable)tileEntity).getNetwork()); - } - } @Override public void refreshNetwork() @@ -76,12 +68,15 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa { for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - refreshTile(Object3D.get(this).getFromSide(side).getTileEntity(worldObj)); + TileEntity tileEntity = Object3D.get(this).getFromSide(side).getTileEntity(worldObj); + + if(tileEntity instanceof IUniversalCable) + { + getNetwork().merge(((IUniversalCable)tileEntity).getNetwork()); + } } getNetwork().refresh(); - - System.out.println(getNetwork()); } }