From e06e30dc87f926e8581df6f857b2c40b03b84c78 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 6 Mar 2013 18:22:17 -0500 Subject: [PATCH] First draft. Still lots to do. --- .classpath | 2 +- common/buildcraft/BuildCraftBuilders.java | 16 +-- common/buildcraft/BuildCraftCore.java | 14 +-- common/buildcraft/BuildCraftEnergy.java | 14 +-- common/buildcraft/BuildCraftFactory.java | 18 +-- common/buildcraft/BuildCraftSilicon.java | 4 +- common/buildcraft/BuildCraftTransport.java | 20 +-- .../api/blueprints/BlueprintManager.java | 2 +- .../buildcraft/api/blueprints/BptBlock.java | 2 +- .../buildcraft/builders/BlockArchitect.java | 4 +- .../builders/BlockBlueprintLibrary.java | 2 +- common/buildcraft/builders/BlockBuilder.java | 4 +- .../builders/gui/GuiBlueprintLibrary.java | 13 +- .../buildcraft/core/ItemBlockBuildCraft.java | 2 +- common/buildcraft/core/ItemBuildCraft.java | 3 +- .../buildcraft/core/ItemRedstoneChipset.java | 4 +- common/buildcraft/core/SpringPopulate.java | 20 +-- .../core/blueprints/BptBlueprint.java | 2 +- common/buildcraft/core/proxy/CoreProxy.java | 2 +- .../core/render/TextureLiquidsFX.java | 118 ------------------ common/buildcraft/energy/BlockEngine.java | 2 +- common/buildcraft/energy/BlockOilFlowing.java | 4 +- .../buildcraft/energy/EnergyProxyClient.java | 7 -- common/buildcraft/energy/EngineIron.java | 20 +-- common/buildcraft/energy/ItemBucketOil.java | 13 +- .../energy/gui/GuiCombustionEngine.java | 38 ++---- .../buildcraft/energy/gui/GuiSteamEngine.java | 5 +- .../energy/render/TextureFuelFX.java | 20 --- .../energy/render/TextureOilFX.java | 20 --- .../energy/render/TextureOilFlowFX.java | 114 ----------------- .../buildcraft/factory/BlockMiningWell.java | 2 +- common/buildcraft/factory/BlockQuarry.java | 4 +- common/buildcraft/factory/BlockRefinery.java | 4 +- .../buildcraft/silicon/ItemAssemblyTable.java | 2 +- .../transport/BlockGenericPipe.java | 95 +++++++------- common/buildcraft/transport/ItemFacade.java | 4 +- common/buildcraft/transport/ItemGate.java | 4 +- common/buildcraft/transport/ItemPipe.java | 2 +- .../buildcraft/transport/TileGenericPipe.java | 5 +- .../transport/render/FacadeItemRenderer.java | 2 - .../transport/render/PipeWorldRenderer.java | 2 +- .../transport/render/RenderPipe.java | 2 +- .../transport/utils/FacadeMatrix.java | 32 ++--- 43 files changed, 168 insertions(+), 501 deletions(-) delete mode 100644 common/buildcraft/core/render/TextureLiquidsFX.java delete mode 100644 common/buildcraft/energy/render/TextureFuelFX.java delete mode 100644 common/buildcraft/energy/render/TextureOilFX.java delete mode 100644 common/buildcraft/energy/render/TextureOilFlowFX.java diff --git a/.classpath b/.classpath index 37cb1f9480..9d71da7e87 100644 --- a/.classpath +++ b/.classpath @@ -2,6 +2,6 @@ - + diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index 9d78d3d79b..51b03feb92 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -231,35 +231,35 @@ public void initialize(FMLPreInitializationEvent evt) { fillerDestroy = fillerDestroyProp.getBoolean(DefaultProps.FILLER_DESTROY); templateItem = new ItemBptTemplate(Integer.parseInt(templateItemId.value)); - templateItem.setItemName("templateItem"); + templateItem.setUnlocalizedName("templateItem"); LanguageRegistry.addName(templateItem, "Template"); blueprintItem = new ItemBptBluePrint(Integer.parseInt(blueprintItemId.value)); - blueprintItem.setItemName("blueprintItem"); + blueprintItem.setUnlocalizedName("blueprintItem"); LanguageRegistry.addName(blueprintItem, "Blueprint"); markerBlock = new BlockMarker(Integer.parseInt(markerId.value)); - CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock")); + CoreProxy.proxy.registerBlock(markerBlock.setUnlocalizedName("markerBlock")); CoreProxy.proxy.addName(markerBlock, "Land Mark"); pathMarkerBlock = new BlockPathMarker(Integer.parseInt(pathMarkerId.value)); - CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock")); + CoreProxy.proxy.registerBlock(pathMarkerBlock.setUnlocalizedName("pathMarkerBlock")); CoreProxy.proxy.addName(pathMarkerBlock, "Path Mark"); fillerBlock = new BlockFiller(Integer.parseInt(fillerId.value)); - CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock")); + CoreProxy.proxy.registerBlock(fillerBlock.setUnlocalizedName("fillerBlock")); CoreProxy.proxy.addName(fillerBlock, "Filler"); builderBlock = new BlockBuilder(Integer.parseInt(builderId.value)); - CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock")); + CoreProxy.proxy.registerBlock(builderBlock.setUnlocalizedName("builderBlock")); CoreProxy.proxy.addName(builderBlock, "Builder"); architectBlock = new BlockArchitect(Integer.parseInt(architectId.value)); - CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock")); + CoreProxy.proxy.registerBlock(architectBlock.setUnlocalizedName("architectBlock")); CoreProxy.proxy.addName(architectBlock, "Architect Table"); libraryBlock = new BlockBlueprintLibrary(Integer.parseInt(libraryId.value)); - CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock")); + CoreProxy.proxy.registerBlock(libraryBlock.setUnlocalizedName("libraryBlock")); CoreProxy.proxy.addName(libraryBlock, "Blueprint Library"); GameRegistry.registerTileEntity(TileMarker.class, "Marker"); diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index c353c98560..87dd8a6532 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -213,7 +213,7 @@ public void loadConfiguration(FMLPreInitializationEvent evt) { Property wrenchId = BuildCraftCore.mainConfiguration.getItem("wrench.id", DefaultProps.WRENCH_ID); - wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setIconIndex(0 * 16 + 2).setItemName("wrenchItem"); + wrenchItem = (new ItemWrench(wrenchId.getInt(DefaultProps.WRENCH_ID))).setIconIndex(0 * 16 + 2).setUnlocalizedName("wrenchItem"); LanguageRegistry.addName(wrenchItem, "Wrench"); Property springId = BuildCraftCore.mainConfiguration.getBlock("springBlock.id", DefaultProps.SPRING_ID); @@ -229,23 +229,23 @@ public void loadConfiguration(FMLPreInitializationEvent evt) { BuildCraftCore.modifyWorld = modifyWorld.getBoolean(true); if(BuildCraftCore.modifyWorld) { - springBlock = new BlockSpring(Integer.parseInt(springId.value)).setBlockName("eternalSpring"); + springBlock = new BlockSpring(Integer.parseInt(springId.value)).setUnlocalizedName("eternalSpring"); GameRegistry.registerBlock(springBlock, "eternalSpring"); } - woodenGearItem = (new ItemBuildCraft(Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0).setItemName("woodenGearItem"); + woodenGearItem = (new ItemBuildCraft(Integer.parseInt(woodenGearId.value))).setIconIndex(1 * 16 + 0).setUnlocalizedName("woodenGearItem"); LanguageRegistry.addName(woodenGearItem, "Wooden Gear"); - stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))).setIconIndex(1 * 16 + 1).setItemName("stoneGearItem"); + stoneGearItem = (new ItemBuildCraft(Integer.parseInt(stoneGearId.value))).setIconIndex(1 * 16 + 1).setUnlocalizedName("stoneGearItem"); LanguageRegistry.addName(stoneGearItem, "Stone Gear"); - ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))).setIconIndex(1 * 16 + 2).setItemName("ironGearItem"); + ironGearItem = (new ItemBuildCraft(Integer.parseInt(ironGearId.value))).setIconIndex(1 * 16 + 2).setUnlocalizedName("ironGearItem"); LanguageRegistry.addName(ironGearItem, "Iron Gear"); - goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))).setIconIndex(1 * 16 + 3).setItemName("goldGearItem"); + goldGearItem = (new ItemBuildCraft(Integer.parseInt(goldenGearId.value))).setIconIndex(1 * 16 + 3).setUnlocalizedName("goldGearItem"); LanguageRegistry.addName(goldGearItem, "Gold Gear"); - diamondGearItem = (new ItemBuildCraft(Integer.parseInt(diamondGearId.value))).setIconIndex(1 * 16 + 4).setItemName("diamondGearItem"); + diamondGearItem = (new ItemBuildCraft(Integer.parseInt(diamondGearId.value))).setIconIndex(1 * 16 + 4).setUnlocalizedName("diamondGearItem"); LanguageRegistry.addName(diamondGearItem, "Diamond Gear"); } finally { mainConfiguration.save(); diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 3e318a1450..8cecb76f9b 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -120,27 +120,27 @@ public void initialize(FMLPreInitializationEvent evt) { LanguageRegistry.addName(new ItemStack(engineBlock, 1, 1), "Steam Engine"); LanguageRegistry.addName(new ItemStack(engineBlock, 1, 2), "Combustion Engine"); - oilStill = (new BlockOilStill(oilStillId.getInt(DefaultProps.OIL_STILL_ID), Material.water)).setBlockName("oil"); - CoreProxy.proxy.addName(oilStill.setBlockName("oilStill"), "Oil"); + oilStill = (new BlockOilStill(oilStillId.getInt(DefaultProps.OIL_STILL_ID), Material.water)).setUnlocalizedName("oil"); + CoreProxy.proxy.addName(oilStill.setUnlocalizedName("oilStill"), "Oil"); CoreProxy.proxy.registerBlock(oilStill); - oilMoving = (new BlockOilFlowing(oilMovingId.getInt(DefaultProps.OIL_MOVING_ID), Material.water)).setBlockName("oil"); - CoreProxy.proxy.addName(oilMoving.setBlockName("oilMoving"), "Oil"); + oilMoving = (new BlockOilFlowing(oilMovingId.getInt(DefaultProps.OIL_MOVING_ID), Material.water)).setUnlocalizedName("oil"); + CoreProxy.proxy.addName(oilMoving.setUnlocalizedName("oilMoving"), "Oil"); CoreProxy.proxy.registerBlock(oilMoving); // Oil and fuel if (oilMoving.blockID + 1 != oilStill.blockID) throw new RuntimeException("Oil Still id must be Oil Moving id + 1"); - fuel = new ItemBuildCraft(itemFuelId.getInt(DefaultProps.FUEL_ID)).setItemName("fuel"); + fuel = new ItemBuildCraft(itemFuelId.getInt(DefaultProps.FUEL_ID)).setUnlocalizedName("fuel"); LanguageRegistry.addName(fuel, "Fuel"); MinecraftForge.EVENT_BUS.register(new OilBucketHandler()); - bucketOil = (new ItemBucketOil(bucketOilId.getInt(DefaultProps.BUCKET_OIL_ID))).setItemName("bucketOil").setContainerItem(Item.bucketEmpty); + bucketOil = (new ItemBucketOil(bucketOilId.getInt(DefaultProps.BUCKET_OIL_ID))).setUnlocalizedName("bucketOil").setContainerItem(Item.bucketEmpty); LanguageRegistry.addName(bucketOil, "Oil Bucket"); - bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)).setItemName("bucketFuel").setContainerItem(Item.bucketEmpty); + bucketFuel = new ItemBuildCraft(Integer.parseInt(bucketFuelId.value)).setUnlocalizedName("bucketFuel").setContainerItem(Item.bucketEmpty); bucketFuel.setIconIndex(0 * 16 + 3).setMaxStackSize(1); LanguageRegistry.addName(bucketFuel, "Fuel Bucket"); diff --git a/common/buildcraft/BuildCraftFactory.java b/common/buildcraft/BuildCraftFactory.java index ad91900135..18252e0642 100644 --- a/common/buildcraft/BuildCraftFactory.java +++ b/common/buildcraft/BuildCraftFactory.java @@ -166,41 +166,41 @@ public void initialize(FMLPreInitializationEvent evt) { BuildCraftCore.mainConfiguration.save(); miningWellBlock = new BlockMiningWell(Integer.parseInt(minigWellId.value)); - CoreProxy.proxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock")); + CoreProxy.proxy.registerBlock(miningWellBlock.setUnlocalizedName("miningWellBlock")); CoreProxy.proxy.addName(miningWellBlock, "Mining Well"); plainPipeBlock = new BlockPlainPipe(Integer.parseInt(plainPipeId.value)); - CoreProxy.proxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock")); + CoreProxy.proxy.registerBlock(plainPipeBlock.setUnlocalizedName("plainPipeBlock")); CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe"); autoWorkbenchBlock = new BlockAutoWorkbench(Integer.parseInt(autoWorkbenchId.value)); - CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock")); + CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setUnlocalizedName("autoWorkbenchBlock")); CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table"); frameBlock = new BlockFrame(Integer.parseInt(frameId.value)); - CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock")); + CoreProxy.proxy.registerBlock(frameBlock.setUnlocalizedName("frameBlock")); CoreProxy.proxy.addName(frameBlock, "Frame"); quarryBlock = new BlockQuarry(Integer.parseInt(quarryId.value)); - CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock")); + CoreProxy.proxy.registerBlock(quarryBlock.setUnlocalizedName("machineBlock")); CoreProxy.proxy.addName(quarryBlock, "Quarry"); tankBlock = new BlockTank(Integer.parseInt(tankId.value)); - CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock")); + CoreProxy.proxy.registerBlock(tankBlock.setUnlocalizedName("tankBlock")); CoreProxy.proxy.addName(tankBlock, "Tank"); pumpBlock = new BlockPump(Integer.parseInt(pumpId.value)); - CoreProxy.proxy.registerBlock(pumpBlock.setBlockName("pumpBlock")); + CoreProxy.proxy.registerBlock(pumpBlock.setUnlocalizedName("pumpBlock")); CoreProxy.proxy.addName(pumpBlock, "Pump"); refineryBlock = new BlockRefinery(Integer.parseInt(refineryId.value)); - CoreProxy.proxy.registerBlock(refineryBlock.setBlockName("refineryBlock")); + CoreProxy.proxy.registerBlock(refineryBlock.setUnlocalizedName("refineryBlock")); CoreProxy.proxy.addName(refineryBlock, "Refinery"); hopperDisabled = Boolean.parseBoolean(hopperDisable.value); if (!hopperDisabled) { hopperBlock = new BlockHopper(Integer.parseInt(hopperId.value)); - CoreProxy.proxy.registerBlock(hopperBlock.setBlockName("blockHopper")); + CoreProxy.proxy.registerBlock(hopperBlock.setUnlocalizedName("blockHopper")); CoreProxy.proxy.addName(hopperBlock, "Hopper"); } diff --git a/common/buildcraft/BuildCraftSilicon.java b/common/buildcraft/BuildCraftSilicon.java index b2d29fbfc0..ea9b86b3df 100644 --- a/common/buildcraft/BuildCraftSilicon.java +++ b/common/buildcraft/BuildCraftSilicon.java @@ -77,7 +77,7 @@ public void initialize(FMLPreInitializationEvent evt) { BuildCraftCore.mainConfiguration.save(); laserBlock = new BlockLaser(Integer.parseInt(laserId.value)); - CoreProxy.proxy.addName(laserBlock.setBlockName("laserBlock"), "Laser"); + CoreProxy.proxy.addName(laserBlock.setUnlocalizedName("laserBlock"), "Laser"); CoreProxy.proxy.registerBlock(laserBlock); assemblyTableBlock = new BlockAssemblyTable(Integer.parseInt(assemblyTableId.value)); @@ -87,7 +87,7 @@ public void initialize(FMLPreInitializationEvent evt) { LanguageRegistry.addName(new ItemStack(assemblyTableBlock, 0, 1), "Advanced Crafting Table"); redstoneChipset = new ItemRedstoneChipset(Integer.parseInt(redstoneChipsetId.value)); - redstoneChipset.setItemName("redstoneChipset"); + redstoneChipset.setUnlocalizedName("redstoneChipset"); } diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index a714e60709..4440b95f40 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -198,7 +198,7 @@ private boolean testStrings(String[] excludedBlocks, World world, int i, int j, int meta = world.getBlockMetadata(i, j, k); for (String excluded : excludedBlocks) { - if (excluded.equals(block.getBlockName())) + if (excluded.equals(block.getUnlocalizedName())) return false; String[] tokens = excluded.split(":"); @@ -258,7 +258,7 @@ public void preInitialize(FMLPreInitializationEvent evt) { Property pipeWaterproofId = BuildCraftCore.mainConfiguration.getItem("pipeWaterproof.id", DefaultProps.PIPE_WATERPROOF_ID); pipeWaterproof = new ItemBuildCraft(Integer.parseInt(pipeWaterproofId.value)).setIconIndex(2 * 16 + 1); - pipeWaterproof.setItemName("pipeWaterproof"); + pipeWaterproof.setUnlocalizedName("pipeWaterproof"); pipeWaterproof.setCreativeTab(CreativeTabs.tabMaterials); LanguageRegistry.addName(pipeWaterproof, "Pipe Waterproof"); genericPipeBlock = new BlockGenericPipe(Integer.parseInt(genericPipeId.value)); @@ -304,44 +304,44 @@ public void preInitialize(FMLPreInitializationEvent evt) { Property redPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "redPipeWire.id", DefaultProps.RED_PIPE_WIRE); redPipeWire = new ItemBuildCraft(Integer.parseInt(redPipeWireId.value)).setIconIndex(4 * 16 + 0); - redPipeWire.setItemName("redPipeWire"); + redPipeWire.setUnlocalizedName("redPipeWire"); LanguageRegistry.addName(redPipeWire, "Red Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(redPipeWire, 8))); Property bluePipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "bluePipeWire.id", DefaultProps.BLUE_PIPE_WIRE); bluePipeWire = new ItemBuildCraft(Integer.parseInt(bluePipeWireId.value)).setIconIndex(4 * 16 + 1); - bluePipeWire.setItemName("bluePipeWire"); + bluePipeWire.setUnlocalizedName("bluePipeWire"); LanguageRegistry.addName(bluePipeWire, "Blue Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(bluePipeWire, 8))); Property greenPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "greenPipeWire.id", DefaultProps.GREEN_PIPE_WIRE); greenPipeWire = new ItemBuildCraft(Integer.parseInt(greenPipeWireId.value)).setIconIndex(4 * 16 + 2); - greenPipeWire.setItemName("greenPipeWire"); + greenPipeWire.setUnlocalizedName("greenPipeWire"); LanguageRegistry.addName(greenPipeWire, "Green Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(greenPipeWire, 8))); Property yellowPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "yellowPipeWire.id", DefaultProps.YELLOW_PIPE_WIRE); yellowPipeWire = new ItemBuildCraft(Integer.parseInt(yellowPipeWireId.value)).setIconIndex(4 * 16 + 3); - yellowPipeWire.setItemName("yellowPipeWire"); + yellowPipeWire.setUnlocalizedName("yellowPipeWire"); LanguageRegistry.addName(yellowPipeWire, "Yellow Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 11), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(yellowPipeWire, 8))); Property pipeGateId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGate.id", DefaultProps.GATE_ID); pipeGate = new ItemGate(Integer.parseInt(pipeGateId.value), 0).setIconIndex(2 * 16 + 3); - pipeGate.setItemName("pipeGate"); + pipeGate.setUnlocalizedName("pipeGate"); Property pipeGateAutarchicId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGateAutarchic.id", DefaultProps.GATE_AUTARCHIC_ID); pipeGateAutarchic = new ItemGate(Integer.parseInt(pipeGateAutarchicId.value), 1).setIconIndex(2 * 16 + 3); - pipeGateAutarchic.setItemName("pipeGateAutarchic"); + pipeGateAutarchic.setUnlocalizedName("pipeGateAutarchic"); Property pipeFacadeId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeFacade.id", DefaultProps.PIPE_FACADE_ID); facadeItem = new ItemFacade(Integer.parseInt(pipeFacadeId.value)); - facadeItem.setItemName("pipeFacade"); + facadeItem.setUnlocalizedName("pipeFacade"); } finally { BuildCraftCore.mainConfiguration.save(); @@ -440,7 +440,7 @@ public static Item createPipe(int defaultID, Class clas, String int id = prop.getInt(defaultID); ItemPipe res = BlockGenericPipe.registerPipe(id, clas); - res.setItemName(clas.getSimpleName()); + res.setUnlocalizedName(clas.getSimpleName()); LanguageRegistry.addName(res, descr); // Add appropriate recipe to temporary list diff --git a/common/buildcraft/api/blueprints/BlueprintManager.java b/common/buildcraft/api/blueprints/BlueprintManager.java index 4a528bef67..bea845cc82 100644 --- a/common/buildcraft/api/blueprints/BlueprintManager.java +++ b/common/buildcraft/api/blueprints/BlueprintManager.java @@ -16,7 +16,7 @@ public static ItemSignature getItemSignature(Item item) { sig.itemClassName = item.getClass().getSimpleName(); } - sig.itemName = item.getItemNameIS(new ItemStack(item)); + sig.itemName = item.getUnlocalizedName(new ItemStack(item)); return sig; } diff --git a/common/buildcraft/api/blueprints/BptBlock.java b/common/buildcraft/api/blueprints/BptBlock.java index d1785b4661..aaf0678b56 100644 --- a/common/buildcraft/api/blueprints/BptBlock.java +++ b/common/buildcraft/api/blueprints/BptBlock.java @@ -206,7 +206,7 @@ public BlockSignature getSignature(Block block) { } } - sig.blockName = block.getBlockName(); + sig.blockName = block.getUnlocalizedName(); sig.replaceNullWithStar(); return sig; diff --git a/common/buildcraft/builders/BlockArchitect.java b/common/buildcraft/builders/BlockArchitect.java index beb57f0136..bb27f819f9 100644 --- a/common/buildcraft/builders/BlockArchitect.java +++ b/common/buildcraft/builders/BlockArchitect.java @@ -108,8 +108,8 @@ public void breakBlock(World world, int i, int j, int k, int par5, int par6) { } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { - super.onBlockPlacedBy(world, i, j, k, entityliving); + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) { + super.onBlockPlacedBy(world, i, j, k, entityliving, stack); ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); diff --git a/common/buildcraft/builders/BlockBlueprintLibrary.java b/common/buildcraft/builders/BlockBlueprintLibrary.java index 2246d3e166..ffcf139dd8 100644 --- a/common/buildcraft/builders/BlockBlueprintLibrary.java +++ b/common/buildcraft/builders/BlockBlueprintLibrary.java @@ -72,7 +72,7 @@ public int getBlockTextureFromSide(int i) { } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) { if (CoreProxy.proxy.isSimulating(world) && entityliving instanceof EntityPlayer) { TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getBlockTileEntity(i, j, k); tile.owner = ((EntityPlayer) entityliving).username; diff --git a/common/buildcraft/builders/BlockBuilder.java b/common/buildcraft/builders/BlockBuilder.java index 7671c26ac6..3f10970d70 100644 --- a/common/buildcraft/builders/BlockBuilder.java +++ b/common/buildcraft/builders/BlockBuilder.java @@ -112,8 +112,8 @@ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer e } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { - super.onBlockPlacedBy(world, i, j, k, entityliving); + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) { + super.onBlockPlacedBy(world, i, j, k, entityliving, stack); ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal()); diff --git a/common/buildcraft/builders/gui/GuiBlueprintLibrary.java b/common/buildcraft/builders/gui/GuiBlueprintLibrary.java index c40282c586..2b818761c0 100644 --- a/common/buildcraft/builders/gui/GuiBlueprintLibrary.java +++ b/common/buildcraft/builders/gui/GuiBlueprintLibrary.java @@ -110,16 +110,9 @@ protected void drawGuiContainerForegroundLayer(int par1, int par2) { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = 0; - // if (library.owner.equals(player.username)) { - i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/library_rw.png"); - // } else { - // i = mc.renderEngine - // .getTexture("/net/minecraft/src/buildcraft/builders/gui/library_r.png"); - // } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(i); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.func_98187_b(DefaultProps.TEXTURE_PATH_GUI + "/library_rw.png"); + int j = (width - xSize) / 2; int k = (height - ySize) / 2; drawTexturedModalRect(j, k, 0, 0, xSize, ySize); diff --git a/common/buildcraft/core/ItemBlockBuildCraft.java b/common/buildcraft/core/ItemBlockBuildCraft.java index 5d2383ab6c..f969c40fb0 100644 --- a/common/buildcraft/core/ItemBlockBuildCraft.java +++ b/common/buildcraft/core/ItemBlockBuildCraft.java @@ -20,7 +20,7 @@ public int getMetadata(int i) { @Override public String getItemDisplayName(ItemStack itemstack) { - return StringUtil.localize(getItemNameIS(itemstack)); + return StringUtil.localize(getUnlocalizedName(itemstack)); } } diff --git a/common/buildcraft/core/ItemBuildCraft.java b/common/buildcraft/core/ItemBuildCraft.java index 1723f0579c..af559505ce 100644 --- a/common/buildcraft/core/ItemBuildCraft.java +++ b/common/buildcraft/core/ItemBuildCraft.java @@ -17,12 +17,11 @@ public class ItemBuildCraft extends Item { public ItemBuildCraft(int i) { super(i); - setTextureFile(DefaultProps.TEXTURE_ITEMS); setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); } @Override public String getItemDisplayName(ItemStack itemstack) { - return StringUtil.localize(getItemNameIS(itemstack)); + return StringUtil.localize(getUnlocalizedName(itemstack)); } } diff --git a/common/buildcraft/core/ItemRedstoneChipset.java b/common/buildcraft/core/ItemRedstoneChipset.java index 1fc02f4787..5864ee86f8 100644 --- a/common/buildcraft/core/ItemRedstoneChipset.java +++ b/common/buildcraft/core/ItemRedstoneChipset.java @@ -35,8 +35,8 @@ public int getIconFromDamage(int i) { } @Override - public String getItemNameIS(ItemStack itemstack) { - return (new StringBuilder()).append(super.getItemName()).append(".").append(itemstack.getItemDamage()).toString(); + public String getUnlocalizedName(ItemStack itemstack) { + return (new StringBuilder()).append(super.getUnlocalizedName()).append(".").append(itemstack.getItemDamage()).toString(); } @Override diff --git a/common/buildcraft/core/SpringPopulate.java b/common/buildcraft/core/SpringPopulate.java index 69f3f800ea..b9bf5a0a3a 100644 --- a/common/buildcraft/core/SpringPopulate.java +++ b/common/buildcraft/core/SpringPopulate.java @@ -22,7 +22,7 @@ public class SpringPopulate { @ForgeSubscribe public void populate(PopulateChunkEvent.Post event) { - + boolean doGen = TerrainGen.populate(event.chunkProvider, event.world, event.rand, event.chunkX, event.chunkX, event.hasVillageGenerated, PopulateChunkEvent.Populate.EventType.CUSTOM); if (!doGen) { @@ -35,13 +35,13 @@ public void populate(PopulateChunkEvent.Post event) { doPopulate(event.world, event.rand, worldX, worldZ); } - + private void doPopulate(World world, Random random, int x, int z) { // A spring will be generated every 40th chunk. if(random.nextFloat() > 0.025f) return; - + // Do not generate water in the End or the Nether BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(x, z); if (biomegenbase.biomeID == BiomeGenBase.sky.biomeID || biomegenbase.biomeID == BiomeGenBase.hell.biomeID) @@ -49,17 +49,17 @@ private void doPopulate(World world, Random random, int x, int z) { int posX = x + random.nextInt(16); int posZ = z + random.nextInt(16); - + for(int i = 0; i < 5; i++) { int candidate = world.getBlockId(posX, i, posZ); if(candidate != Block.bedrock.blockID) continue; - - world.setBlock(posX, i + 1, posZ, BuildCraftCore.springBlock.blockID); + + world.func_94575_c(posX, i + 1, posZ, BuildCraftCore.springBlock.blockID); for(int j = i + 2; j < world.getActualHeight() - 10; j++) { if(!boreToSurface(world, posX, j, posZ)) { if(world.isAirBlock(posX, j, posZ)) - world.setBlockWithNotify(posX, j, posZ, Block.waterStill.blockID); + world.func_94575_c(posX, j, posZ, Block.waterStill.blockID); break; } } @@ -70,15 +70,15 @@ private void doPopulate(World world, Random random, int x, int z) { private boolean boreToSurface(World world, int x, int y, int z) { if(world.isAirBlock(x, y, z)) return false; - + int existing = world.getBlockId(x, y, z); if(existing != Block.stone.blockID && existing != Block.dirt.blockID && existing != Block.gravel.blockID && existing != Block.grass.blockID) return false; - - world.setBlockWithNotify(x, y, z, Block.waterStill.blockID); + + world.func_94575_c(x, y, z, Block.waterStill.blockID); return true; } } diff --git a/common/buildcraft/core/blueprints/BptBlueprint.java b/common/buildcraft/core/blueprints/BptBlueprint.java index 80f8fd69ad..ce08322bfd 100644 --- a/common/buildcraft/core/blueprints/BptBlueprint.java +++ b/common/buildcraft/core/blueprints/BptBlueprint.java @@ -358,7 +358,7 @@ private boolean itemMatch(ItemSignature sig, Item item) { if (!"*".equals(sig.itemClassName) && !item.getClass().getSimpleName().equals(sig.itemClassName)) return false; - if (!"*".equals(sig.itemName) && !item.getItemNameIS(new ItemStack(item)).equals(sig.itemName)) + if (!"*".equals(sig.itemName) && !item.getUnlocalizedName(new ItemStack(item)).equals(sig.itemName)) return false; return true; diff --git a/common/buildcraft/core/proxy/CoreProxy.java b/common/buildcraft/core/proxy/CoreProxy.java index f3dcbea414..e516d95cdd 100644 --- a/common/buildcraft/core/proxy/CoreProxy.java +++ b/common/buildcraft/core/proxy/CoreProxy.java @@ -98,7 +98,7 @@ public void initializeEntityRendering() { /* REGISTRATION */ public void registerBlock(Block block) { Item.itemsList[block.blockID] = null; - Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getBlockName()); + Item.itemsList[block.blockID] = new ItemBlockBuildCraft(block.blockID - 256, block.getUnlocalizedName()); } public void registerTileEntity(Class clas, String ident) { diff --git a/common/buildcraft/core/render/TextureLiquidsFX.java b/common/buildcraft/core/render/TextureLiquidsFX.java deleted file mode 100644 index 9bab2dedf4..0000000000 --- a/common/buildcraft/core/render/TextureLiquidsFX.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.core.render; - -import net.minecraft.client.renderer.RenderEngine; -import net.minecraftforge.client.ForgeHooksClient; -import cpw.mods.fml.client.FMLTextureFX; - -public class TextureLiquidsFX extends FMLTextureFX { - - private final int redMin, redMax, greenMin, greenMax, blueMin, blueMax; - private final String texture; - - public TextureLiquidsFX(int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax, int spriteIndex, String texture) { - super(spriteIndex); - - this.redMin = redMin; - this.redMax = redMax; - this.greenMin = greenMin; - this.greenMax = greenMax; - this.blueMin = blueMin; - this.blueMax = blueMax; - this.texture = texture; - setup(); - } - - @Override - public void setup() { - super.setup(); - - red = new float[tileSizeSquare]; - green = new float[tileSizeSquare]; - blue = new float[tileSizeSquare]; - alpha = new float[tileSizeSquare]; - } - - @Override - public void bindImage(RenderEngine renderengine) { - ForgeHooksClient.bindTexture(texture, 0); - } - - @Override - public void onTick() { - - for (int i = 0; i < tileSizeBase; ++i) { - for (int j = 0; j < tileSizeBase; ++j) { - float var3 = 0.0F; - - for (int k = i - 1; k <= i + 1; ++k) { - int r = k & tileSizeMask; - int g = j & tileSizeMask; - var3 += this.red[r + g * tileSizeBase]; - } - - this.green[i + j * tileSizeBase] = var3 / 3.3F + this.blue[i + j * tileSizeBase] * 0.8F; - } - } - - for (int i = 0; i < tileSizeBase; ++i) { - for (int j = 0; j < tileSizeBase; ++j) { - this.blue[i + j * tileSizeBase] += this.alpha[i + j * tileSizeBase] * 0.05F; - - if (this.blue[i + j * tileSizeBase] < 0.0F) { - this.blue[i + j * tileSizeBase] = 0.0F; - } - - this.alpha[i + j * tileSizeBase] -= 0.1F; - - if (Math.random() < 0.05D) { - this.alpha[i + j * tileSizeBase] = 0.5F; - } - } - } - - float af[] = green; - green = red; - red = af; - for (int i1 = 0; i1 < tileSizeSquare; i1++) { - float f1 = red[i1]; - if (f1 > 1.0F) { - f1 = 1.0F; - } - if (f1 < 0.0F) { - f1 = 0.0F; - } - float f2 = f1 * f1; - int r = (int) (redMin + f2 * (redMax - redMin)); - int g = (int) (greenMin + f2 * (greenMax - greenMin)); - int b = (int) (blueMin + f2 * (blueMax - blueMin)); - if (anaglyphEnabled) { - int i3 = (r * 30 + g * 59 + b * 11) / 100; - int j3 = (r * 30 + g * 70) / 100; - int k3 = (r * 30 + b * 70) / 100; - r = i3; - g = j3; - b = k3; - } - - imageData[i1 * 4 + 0] = (byte) r; - imageData[i1 * 4 + 1] = (byte) g; - imageData[i1 * 4 + 2] = (byte) b; - imageData[i1 * 4 + 3] = (byte) 255; - } - - } - - protected float red[]; - protected float green[]; - protected float blue[]; - protected float alpha[]; -} diff --git a/common/buildcraft/energy/BlockEngine.java b/common/buildcraft/energy/BlockEngine.java index 668a9fdd30..c754b5e11e 100644 --- a/common/buildcraft/energy/BlockEngine.java +++ b/common/buildcraft/energy/BlockEngine.java @@ -36,7 +36,7 @@ public BlockEngine(int i) { setHardness(0.5F); setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); - setBlockName("engineBlock"); + setUnlocalizedName("engineBlock"); } @Override diff --git a/common/buildcraft/energy/BlockOilFlowing.java b/common/buildcraft/energy/BlockOilFlowing.java index 89264b3825..c47f935046 100644 --- a/common/buildcraft/energy/BlockOilFlowing.java +++ b/common/buildcraft/energy/BlockOilFlowing.java @@ -80,7 +80,7 @@ public void updateTick(World world, int i, int j, int k, Random random) { world.setBlockWithNotify(i, j, k, 0); } else { world.setBlockMetadataWithNotify(i, j, k, l); - world.scheduleBlockUpdate(i, j, k, blockID, tickRate()); + world.scheduleBlockUpdate(i, j, k, blockID, tickRate(world)); world.notifyBlocksOfNeighborChange(i, j, k, blockID); } } else if (flag) { @@ -240,7 +240,7 @@ private boolean liquidCanDisplaceBlock(World world, int i, int j, int k) { public void onBlockAdded(World world, int i, int j, int k) { super.onBlockAdded(world, i, j, k); if (world.getBlockId(i, j, k) == blockID) { - world.scheduleBlockUpdate(i, j, k, blockID, tickRate()); + world.scheduleBlockUpdate(i, j, k, blockID, tickRate(world)); } } diff --git a/common/buildcraft/energy/EnergyProxyClient.java b/common/buildcraft/energy/EnergyProxyClient.java index dbd9640473..11d5512b63 100644 --- a/common/buildcraft/energy/EnergyProxyClient.java +++ b/common/buildcraft/energy/EnergyProxyClient.java @@ -5,9 +5,6 @@ import buildcraft.core.render.RenderingEntityBlocks; import buildcraft.core.render.RenderingEntityBlocks.EntityRenderIndex; import buildcraft.energy.render.RenderEngine; -import buildcraft.energy.render.TextureFuelFX; -import buildcraft.energy.render.TextureOilFX; -import buildcraft.energy.render.TextureOilFlowFX; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; @@ -21,10 +18,6 @@ public void registerTileEntities() { @Override public void registerTextureFX() { net.minecraft.client.renderer.RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine; - - renderEngine.registerTextureFX(new TextureOilFX()); - renderEngine.registerTextureFX(new TextureFuelFX()); - renderEngine.registerTextureFX(new TextureOilFlowFX()); } @Override diff --git a/common/buildcraft/energy/EngineIron.java b/common/buildcraft/energy/EngineIron.java index 6373bd6bcd..d39fd3fd50 100644 --- a/common/buildcraft/energy/EngineIron.java +++ b/common/buildcraft/energy/EngineIron.java @@ -107,7 +107,7 @@ public void burn() { if (burnTime > 0 || fuel.amount > 0) { if (burnTime > 0) { burnTime--; - } + } if (burnTime <= 0) { if(fuel != null) { if (--fuel.amount <= 0) { @@ -125,7 +125,7 @@ public void burn() { } } else if (penaltyCooling <= 0) { if (lastPowered) { - lastPowered = false; + lastPowered = false; penaltyCooling = 30 * 20; // 30 sec of penalty on top of the cooling } @@ -431,19 +431,11 @@ public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) { } } - public int getFuelId() { - return fuelTank.getLiquid() != null ? fuelTank.getLiquid().itemID : 0; - } - - public int getFuelMeta() { - return fuelTank.getLiquid() != null ? fuelTank.getLiquid().itemMeta : 0; - } - - public int getCoolantId() { - return coolantTank.getLiquid() != null ? coolantTank.getLiquid().itemID : 0; + public LiquidStack getFuel() { + return fuelTank.getLiquid(); } - public int getCoolantMeta() { - return coolantTank.getLiquid() != null ? coolantTank.getLiquid().itemMeta : 0; + public LiquidStack getCoolant() { + return coolantTank.getLiquid(); } } diff --git a/common/buildcraft/energy/ItemBucketOil.java b/common/buildcraft/energy/ItemBucketOil.java index 84c69d2127..c114ad8050 100644 --- a/common/buildcraft/energy/ItemBucketOil.java +++ b/common/buildcraft/energy/ItemBucketOil.java @@ -1,8 +1,8 @@ -/** +/** * Copyright (c) SpaceToad, 2011 * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public + * + * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ @@ -26,12 +26,7 @@ public ItemBucketOil(int i) { @Override public String getItemDisplayName(ItemStack itemstack) { - return StringUtil.localize(getItemNameIS(itemstack)); - } - - @Override - public String getTextureFile() { - return DefaultProps.TEXTURE_ITEMS; + return StringUtil.localize(getUnlocalizedName(itemstack)); } } diff --git a/common/buildcraft/energy/gui/GuiCombustionEngine.java b/common/buildcraft/energy/gui/GuiCombustionEngine.java index 76db9c909a..693fd9ad93 100644 --- a/common/buildcraft/energy/gui/GuiCombustionEngine.java +++ b/common/buildcraft/energy/gui/GuiCombustionEngine.java @@ -13,6 +13,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.Item; import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.liquids.LiquidStack; import org.lwjgl.opengl.GL11; @@ -37,9 +38,8 @@ protected void drawGuiContainerForegroundLayer(int par1, int par2) { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(i); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.func_98187_b(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png"); int j = (width - xSize) / 2; int k = (height - ySize) / 2; drawTexturedModalRect(j, k, 0, 0, xSize, ySize); @@ -48,31 +48,19 @@ protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { EngineIron engineIron = ((EngineIron) engine.engine); if (engine.getScaledBurnTime(58) > 0) { - displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), engineIron.getFuelId(), engineIron.getFuelMeta()); + displayGauge(j, k, 19, 104, engine.getScaledBurnTime(58), engineIron.getFuel()); } if (engineIron.getScaledCoolant(58) > 0) { - displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), engineIron.getCoolantId(), engineIron.getCoolantMeta()); + displayGauge(j, k, 19, 122, engineIron.getScaledCoolant(58), engineIron.getCoolant()); } } - private void displayGauge(int j, int k, int line, int col, int squaled, int liquidId, int liquidMeta) { - int liquidImgIndex = 0; - - if (liquidId <= 0) - return; - if (liquidId < Block.blocksList.length && Block.blocksList[liquidId] != null) { - ForgeHooksClient.bindTexture(Block.blocksList[liquidId].getTextureFile(), 0); - liquidImgIndex = Block.blocksList[liquidId].blockIndexInTexture; - } else if (Item.itemsList[liquidId] != null) { - ForgeHooksClient.bindTexture(Item.itemsList[liquidId].getTextureFile(), 0); - liquidImgIndex = Item.itemsList[liquidId].getIconFromDamage(liquidMeta); - } else - return; - - int imgLine = liquidImgIndex / 16; - int imgColumn = liquidImgIndex - imgLine * 16; - + private void displayGauge(int j, int k, int line, int col, int squaled, LiquidStack liquid) { + if (liquid == null) + { + return; + } int start = 0; while (true) { @@ -86,7 +74,7 @@ private void displayGauge(int j, int k, int line, int col, int squaled, int liqu squaled = 0; } - drawTexturedModalRect(j + col, k + line + 58 - x - start, imgColumn * 16, imgLine * 16 + (16 - x), 16, 16 - (16 - x)); + func_94065_a(j + col, k + line + 58 - x - start, liquid.getRenderingIcon(), 16, 16 - (16 - x)); start = start + 16; if (x == 0 || squaled == 0) { @@ -94,9 +82,7 @@ private void displayGauge(int j, int k, int line, int col, int squaled, int liqu } } - int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png"); - - mc.renderEngine.bindTexture(i); + mc.renderEngine.func_98187_b(DefaultProps.TEXTURE_PATH_GUI + "/combustion_engine_gui.png"); drawTexturedModalRect(j + col, k + line, 176, 0, 16, 60); } } diff --git a/common/buildcraft/energy/gui/GuiSteamEngine.java b/common/buildcraft/energy/gui/GuiSteamEngine.java index fcb7357006..17a75b4276 100644 --- a/common/buildcraft/energy/gui/GuiSteamEngine.java +++ b/common/buildcraft/energy/gui/GuiSteamEngine.java @@ -33,9 +33,8 @@ protected void drawGuiContainerForegroundLayer(int par1, int par2) { @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - int i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/steam_engine_gui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(i); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.func_98187_b(DefaultProps.TEXTURE_PATH_GUI + "/steam_engine_gui.png"); int j = (width - xSize) / 2; int k = (height - ySize) / 2; drawTexturedModalRect(j, k, 0, 0, xSize, ySize); diff --git a/common/buildcraft/energy/render/TextureFuelFX.java b/common/buildcraft/energy/render/TextureFuelFX.java deleted file mode 100644 index ec089d1608..0000000000 --- a/common/buildcraft/energy/render/TextureFuelFX.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.energy.render; - -import buildcraft.BuildCraftEnergy; -import buildcraft.core.render.TextureLiquidsFX; - -public class TextureFuelFX extends TextureLiquidsFX { - - public TextureFuelFX() { - super(150, 250, 150, 250, 0, 10, BuildCraftEnergy.fuel.getIconFromDamage(0), BuildCraftEnergy.fuel.getTextureFile()); - } -} diff --git a/common/buildcraft/energy/render/TextureOilFX.java b/common/buildcraft/energy/render/TextureOilFX.java deleted file mode 100644 index 4eef24193e..0000000000 --- a/common/buildcraft/energy/render/TextureOilFX.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.energy.render; - -import buildcraft.BuildCraftEnergy; -import buildcraft.core.render.TextureLiquidsFX; - -public class TextureOilFX extends TextureLiquidsFX { - - public TextureOilFX() { - super(10, 31, 10, 31, 10, 31, BuildCraftEnergy.oilStill.blockIndexInTexture, BuildCraftEnergy.oilStill.getTextureFile()); - } -} diff --git a/common/buildcraft/energy/render/TextureOilFlowFX.java b/common/buildcraft/energy/render/TextureOilFlowFX.java deleted file mode 100644 index f19f6ac9d4..0000000000 --- a/common/buildcraft/energy/render/TextureOilFlowFX.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.energy.render; - -import net.minecraft.client.renderer.RenderEngine; - -import org.lwjgl.opengl.GL11; - -import buildcraft.BuildCraftEnergy; -import buildcraft.core.DefaultProps; -import cpw.mods.fml.client.FMLTextureFX; - -public class TextureOilFlowFX extends FMLTextureFX { - - public TextureOilFlowFX() { - super(BuildCraftEnergy.oilMoving.blockIndexInTexture + 1); - - tileSize = 2; - - } - - @Override - protected void setup() { - super.setup(); - field_1138_g = new float[tileSizeSquare]; - field_1137_h = new float[tileSizeSquare]; - field_1136_i = new float[tileSizeSquare]; - field_1135_j = new float[tileSizeSquare]; - field_1134_k = 0; - } - - @Override - public void bindImage(RenderEngine renderengine) { - GL11.glBindTexture(3553, renderengine.getTexture(DefaultProps.TEXTURE_BLOCKS)); - } - - @Override - public void onTick() { - field_1134_k++; - for (int i = 0; i < tileSizeBase; i++) { - for (int k = 0; k < tileSizeBase; k++) { - float f = 0.0F; - for (int j1 = k - 2; j1 <= k; j1++) { - int k1 = i & tileSizeMask; - int i2 = j1 & tileSizeMask; - f += field_1138_g[k1 + i2 * tileSizeBase]; - } - - field_1137_h[i + k * tileSizeBase] = f / 3.2F + field_1136_i[i + k * tileSizeBase] * 0.8F; - } - } - - for (int j = 0; j < tileSizeBase; j++) { - for (int l = 0; l < tileSizeBase; l++) { - field_1136_i[j + l * tileSizeBase] += field_1135_j[j + l * tileSizeBase] * 0.05F; - if (field_1136_i[j + l * tileSizeBase] < 0.0F) { - field_1136_i[j + l * tileSizeBase] = 0.0F; - } - field_1135_j[j + l * tileSizeBase] -= 0.3F; - if (Math.random() < 0.20000000000000001D) { - field_1135_j[j + l * tileSizeBase] = 0.5F; - } - } - } - - float af[] = field_1137_h; - field_1137_h = field_1138_g; - field_1138_g = af; - for (int i1 = 0; i1 < tileSizeSquare; i1++) { - float f1 = field_1138_g[i1 - field_1134_k * tileSizeBase & tileSizeSquareMask]; - if (f1 > 1.0F) { - f1 = 1.0F; - } - if (f1 < 0.0F) { - f1 = 0.0F; - } - float f2 = f1 * f1; - int l1 = (int) (10F + f2 * 22F); - int j2 = (int) (50F + f2 * 64F); - int k2 = 255; - if (anaglyphEnabled) { - int i3 = (l1 * 30 + j2 * 59 + k2 * 11) / 100; - int j3 = (l1 * 30 + j2 * 70) / 100; - int k3 = (l1 * 30 + k2 * 70) / 100; - l1 = i3; - j2 = j3; - k2 = k3; - } - // imageData[i1 * 4 + 0] = (byte)l1; - // imageData[i1 * 4 + 1] = (byte)j2; - // imageData[i1 * 4 + 2] = (byte) k2; - // imageData[i1 * 4 + 3] = /*(byte)l2*/(byte)255; - - imageData[i1 * 4 + 0] = (byte) l1; - imageData[i1 * 4 + 1] = (byte) l1; - imageData[i1 * 4 + 2] = (byte) l1; - imageData[i1 * 4 + 3] = /* (byte)l2 */(byte) 255; - } - - } - - protected float field_1138_g[]; - protected float field_1137_h[]; - protected float field_1136_i[]; - protected float field_1135_j[]; - private int field_1134_k; -} diff --git a/common/buildcraft/factory/BlockMiningWell.java b/common/buildcraft/factory/BlockMiningWell.java index a25ccdaf7c..b919a7fbab 100644 --- a/common/buildcraft/factory/BlockMiningWell.java +++ b/common/buildcraft/factory/BlockMiningWell.java @@ -57,7 +57,7 @@ else if (j >= 0 && j < 6 && ForgeDirection.values()[j].getOpposite().ordinal() = } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) { ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal()); diff --git a/common/buildcraft/factory/BlockQuarry.java b/common/buildcraft/factory/BlockQuarry.java index 53e4295ef1..f4f19f71fd 100644 --- a/common/buildcraft/factory/BlockQuarry.java +++ b/common/buildcraft/factory/BlockQuarry.java @@ -47,8 +47,8 @@ public BlockQuarry(int i) { } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { - super.onBlockPlacedBy(world, i, j, k, entityliving); + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) { + super.onBlockPlacedBy(world, i, j, k, entityliving, stack); ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); diff --git a/common/buildcraft/factory/BlockRefinery.java b/common/buildcraft/factory/BlockRefinery.java index 93b1f88a30..b6da78d7f1 100644 --- a/common/buildcraft/factory/BlockRefinery.java +++ b/common/buildcraft/factory/BlockRefinery.java @@ -65,8 +65,8 @@ public TileEntity createNewTileEntity(World var1) { } @Override - public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { - super.onBlockPlacedBy(world, i, j, k, entityliving); + public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack stack) { + super.onBlockPlacedBy(world, i, j, k, entityliving, stack); ForgeDirection orientation = Utils.get2dOrientation(new Position(entityliving.posX, entityliving.posY, entityliving.posZ), new Position(i, j, k)); diff --git a/common/buildcraft/silicon/ItemAssemblyTable.java b/common/buildcraft/silicon/ItemAssemblyTable.java index 83af6d3ef0..6d8beb04c3 100644 --- a/common/buildcraft/silicon/ItemAssemblyTable.java +++ b/common/buildcraft/silicon/ItemAssemblyTable.java @@ -11,7 +11,7 @@ public ItemAssemblyTable(int par1) { } @Override - public String getItemNameIS(ItemStack par1ItemStack) { + public String getUnlocalizedName(ItemStack par1ItemStack) { return par1ItemStack.getItemDamage() == 0 ? "block.assemblyTableBlock" : "block.assemblyWorkbenchBlock"; } diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index 2f45709795..346c803144 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -47,13 +47,13 @@ static enum Part { Pipe, Gate } - + static class RaytraceResult { RaytraceResult(Part hitPart, MovingObjectPosition movingObjectPosition) { this.hitPart = hitPart; this.movingObjectPosition = movingObjectPosition; } - + public Part hitPart; public MovingObjectPosition movingObjectPosition; } @@ -230,14 +230,14 @@ public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, i @Override public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 origin, Vec3 direction) { RaytraceResult raytraceResult = doRayTrace(world, x, y, z, origin, direction); - + if (raytraceResult == null) { return null; } else { return raytraceResult.movingObjectPosition; } } - + public RaytraceResult doRayTrace(World world, int x, int y, int z, EntityPlayer entityPlayer) { double pitch = Math.toRadians(entityPlayer.rotationPitch); double yaw = Math.toRadians(entityPlayer.rotationYaw); @@ -245,39 +245,39 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, EntityPlayer double dirX = -Math.sin(yaw) * Math.cos(pitch); double dirY = -Math.sin(pitch); double dirZ = Math.cos(yaw) * Math.cos(pitch); - + double reachDistance = 5; - + if (entityPlayer instanceof EntityPlayerMP) { reachDistance = ((EntityPlayerMP) entityPlayer).theItemInWorldManager.getBlockReachDistance(); } - - Vec3 origin = Vec3.vec3dPool.getVecFromPool(entityPlayer.posX, entityPlayer.posY + 1.62 - entityPlayer.yOffset, entityPlayer.posZ); + + Vec3 origin = Vec3.fakePool.getVecFromPool(entityPlayer.posX, entityPlayer.posY + 1.62 - entityPlayer.yOffset, entityPlayer.posZ); Vec3 direction = origin.addVector(dirX * reachDistance, dirY * reachDistance, dirZ * reachDistance); - + return doRayTrace(world, x, y, z, origin, direction); } - + public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, Vec3 direction) { float xMin = Utils.pipeMinPos, xMax = Utils.pipeMaxPos, yMin = Utils.pipeMinPos, yMax = Utils.pipeMaxPos, zMin = Utils.pipeMinPos, zMax = Utils.pipeMaxPos; TileEntity pipeTileEntity = world.getBlockTileEntity(x, y, z); Pipe pipe = getPipe(world, x, y, z); - + if (pipeTileEntity == null || !isValid(pipe)) { return null; } - + /** - * pipe hits along x, y, and z axis, gate (all 6 sides) [and wires+facades] + * pipe hits along x, y, and z axis, gate (all 6 sides) [and wires+facades] */ MovingObjectPosition[] hits = new MovingObjectPosition[] { null, null, null, null, null, null, null, null, null }; - + boolean needAxisCheck = false; boolean needCenterCheck = true; - + // check along the x axis - + if (Utils.checkPipesConnections(world, pipeTileEntity, x - 1, y, z)) { xMin = 0.0F; needAxisCheck = true; @@ -287,7 +287,7 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, xMax = 1.0F; needAxisCheck = true; } - + if (needAxisCheck) { setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax); @@ -297,7 +297,7 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, needAxisCheck = false; needCenterCheck = false; // center already checked through this axis } - + // check along the y axis if (Utils.checkPipesConnections(world, pipeTileEntity, x, y - 1, z)) { @@ -309,7 +309,7 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, yMax = 1.0F; needAxisCheck = true; } - + if (needAxisCheck) { setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax); @@ -319,7 +319,7 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, needAxisCheck = false; needCenterCheck = false; // center already checked through this axis } - + // check along the z axis if (Utils.checkPipesConnections(world, pipeTileEntity, x, y, z - 1)) { @@ -331,7 +331,7 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, zMax = 1.0F; needAxisCheck = true; } - + if (needAxisCheck) { setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax); @@ -341,7 +341,7 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, needAxisCheck = false; needCenterCheck = false; // center already checked through this axis } - + // check center (only if no axis were checked/the pipe has no connections) if (needCenterCheck) { @@ -349,59 +349,59 @@ public RaytraceResult doRayTrace(World world, int x, int y, int z, Vec3 origin, hits[0] = super.collisionRayTrace(world, x, y, z, origin, direction); } - + // gates - + if (pipe.hasGate()) { for (int side = 0; side < 6; side++) { setBlockBoundsToGate(ForgeDirection.VALID_DIRECTIONS[side]); - + hits[3 + side] = super.collisionRayTrace(world, x, y, z, origin, direction); } } - + // TODO: check wires, facades // get closest hit - + double minLengthSquared = Double.POSITIVE_INFINITY; int minIndex = -1; - + for (int i = 0; i < hits.length; i++) { MovingObjectPosition hit = hits[i]; if (hit == null) continue; - + double lengthSquared = hit.hitVec.squareDistanceTo(origin); - + if (lengthSquared < minLengthSquared) { minLengthSquared = lengthSquared; minIndex = i; } } - + // reset bounds - + setBlockBounds(0, 0, 0, 1, 1, 1); - + if (minIndex == -1) { return null; } else { Part hitPart; - + if (minIndex < 3) { hitPart = Part.Pipe; } else { hitPart = Part.Gate; } - + return new RaytraceResult(hitPart, hits[minIndex]); } } - + private void setBlockBoundsToGate(ForgeDirection dir) { float min = Utils.pipeMinPos + 0.05F; float max = Utils.pipeMaxPos - 0.05F; - + switch (dir) { case DOWN: setBlockBounds(min, Utils.pipeMinPos - 0.10F, min, max, Utils.pipeMinPos, max); @@ -537,17 +537,17 @@ public int onBlockPlaced(World world, int x, int y, int z, int side, float par6, return meta; } - + @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving placer) { - super.onBlockPlacedBy(world, x, y, z, placer); + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving placer, ItemStack stack) { + super.onBlockPlacedBy(world, x, y, z, placer, stack); Pipe pipe = getPipe(world, x, y, z); if (isValid(pipe)) { pipe.onBlockPlacedBy(placer); } } - + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int par6, float xOffset, float yOffset, float zOffset) { super.onBlockActivated(world, x, y, z, entityplayer, par6, xOffset, yOffset, zOffset); @@ -629,17 +629,17 @@ else if (entityplayer.getCurrentEquippedItem().getItem() == BuildCraftTransport. pipe.container.scheduleRenderUpdate(); return true; } - + boolean openGateGui = false; if (pipe.hasGate()) { RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, entityplayer); - + if (rayTraceResult != null && rayTraceResult.hitPart == Part.Gate) { openGateGui = true; } } - + if (openGateGui) { pipe.gate.openGui(entityplayer); @@ -679,7 +679,7 @@ private boolean stripEquipment(Pipe pipe) { /** * Drops a pipe wire item of the passed color. - * + * * @param color */ private void dropWire(IPipe.WireColor color, World world, int i, int j, int k) { @@ -789,14 +789,13 @@ public void randomDisplayTick(World world, int i, int j, int k, Random random) { public static ItemPipe registerPipe(int key, Class clas) { ItemPipe item = new ItemPipe(key); - item.setItemName("buildcraftPipe." + clas.getSimpleName().toLowerCase()); - GameRegistry.registerItem(item, item.getItemName()); + item.setUnlocalizedName("buildcraftPipe." + clas.getSimpleName().toLowerCase()); + GameRegistry.registerItem(item, item.getUnlocalizedName()); pipes.put(item.itemID, clas); Pipe dummyPipe = createPipe(item.itemID); if (dummyPipe != null) { - item.setTextureFile(dummyPipe.getTextureFile()); item.setTextureIndex(dummyPipe.getTextureIndexForItem()); } diff --git a/common/buildcraft/transport/ItemFacade.java b/common/buildcraft/transport/ItemFacade.java index 43b7e3683f..2a6eb09ea6 100644 --- a/common/buildcraft/transport/ItemFacade.java +++ b/common/buildcraft/transport/ItemFacade.java @@ -53,7 +53,7 @@ public String getItemDisplayName(ItemStack itemstack) { } @Override - public String getItemNameIS(ItemStack itemstack) { + public String getUnlocalizedName(ItemStack itemstack) { return "item.Facade"; } @@ -102,7 +102,7 @@ public static void initialize() { } catch (Exception e) { continue; } - + if (!(b.blockID == 20)){ if (b.blockID == 7 || b.blockID == 18 || b.blockID == 19 || b.blockID == 95) { continue; diff --git a/common/buildcraft/transport/ItemGate.java b/common/buildcraft/transport/ItemGate.java index 4f0ca64fb7..635c2e78f5 100644 --- a/common/buildcraft/transport/ItemGate.java +++ b/common/buildcraft/transport/ItemGate.java @@ -53,8 +53,8 @@ public int getIconFromDamage(int i) { } @Override - public String getItemNameIS(ItemStack itemstack) { - return (new StringBuilder()).append(super.getItemName()).append(".").append(itemstack.getItemDamage()).toString(); + public String getUnlocalizedName(ItemStack itemstack) { + return (new StringBuilder()).append(super.getUnlocalizedName()).append(".").append(itemstack.getItemDamage()).toString(); } @SuppressWarnings("unchecked") diff --git a/common/buildcraft/transport/ItemPipe.java b/common/buildcraft/transport/ItemPipe.java index 4376475a37..06dfacc029 100644 --- a/common/buildcraft/transport/ItemPipe.java +++ b/common/buildcraft/transport/ItemPipe.java @@ -74,7 +74,7 @@ else if (id != Block.vine.blockID && id != Block.tallGrass.blockID && id != Bloc } if (BlockGenericPipe.placePipe(pipe, world, i, j, k, blockID, 0)) { - Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, entityplayer); + Block.blocksList[blockID].onBlockPlacedBy(world, i, j, k, entityplayer, itemstack); world.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F, block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java index 71f4380734..9c4e0aee07 100644 --- a/common/buildcraft/transport/TileGenericPipe.java +++ b/common/buildcraft/transport/TileGenericPipe.java @@ -252,9 +252,8 @@ private void refreshRenderState() { renderState.facadeMatrix.setConnected(direction, blockId != 0 && Block.blocksList[blockId] != null); if (Block.blocksList[blockId] != null) { Block block = Block.blocksList[blockId]; - renderState.facadeMatrix.setTextureFile(direction, block.getTextureFile()); - renderState.facadeMatrix.setTextureIndex(direction, - block.getBlockTextureFromSideAndMetadata(direction.ordinal(), this.facadeMeta[direction.ordinal()])); + + // TODO } } diff --git a/common/buildcraft/transport/render/FacadeItemRenderer.java b/common/buildcraft/transport/render/FacadeItemRenderer.java index 1c2820cb2a..ff99ba6bfd 100644 --- a/common/buildcraft/transport/render/FacadeItemRenderer.java +++ b/common/buildcraft/transport/render/FacadeItemRenderer.java @@ -29,7 +29,6 @@ private void renderFacadeItem(RenderBlocks render, ItemStack item, float transla // Render Facade GL11.glPushMatrix(); - ForgeHooksClient.bindTexture(block.getTextureFile(), 0); block.setBlockBounds(0F, 0F, 1F - 1F / 16F, 1F, 1F, 1F); render.setRenderBoundsFromBlock(block); GL11.glTranslatef(translateX, translateY, translateZ); @@ -62,7 +61,6 @@ private void renderFacadeItem(RenderBlocks render, ItemStack item, float transla GL11.glPopMatrix(); // Render StructurePipe - ForgeHooksClient.bindTexture(DefaultProps.TEXTURE_BLOCKS, 0); block = BuildCraftTransport.genericPipeBlock; int textureID = 7 * 16 + 13; // Structure pipe block.setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos - 1F / 16F); diff --git a/common/buildcraft/transport/render/PipeWorldRenderer.java b/common/buildcraft/transport/render/PipeWorldRenderer.java index 3ee581cc73..3c6f63eaa3 100644 --- a/common/buildcraft/transport/render/PipeWorldRenderer.java +++ b/common/buildcraft/transport/render/PipeWorldRenderer.java @@ -180,7 +180,7 @@ private void pipeFacadeRenderer(RenderBlocks renderblocks, Block block, PipeRend for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) { if (state.facadeMatrix.isConnected(direction)) { ForgeHooksClient.bindTexture(state.facadeMatrix.getTextureFile(direction), 0); - state.currentTextureIndex = state.facadeMatrix.getTextureIndex(direction); + state.currentTextureIndex = state.facadeMatrix.getTextureIcon(direction); // Hollow facade if (state.pipeConnectionMatrix.isConnected(direction)) { diff --git a/common/buildcraft/transport/render/RenderPipe.java b/common/buildcraft/transport/render/RenderPipe.java index a16a129f04..5b325da509 100644 --- a/common/buildcraft/transport/render/RenderPipe.java +++ b/common/buildcraft/transport/render/RenderPipe.java @@ -437,7 +437,7 @@ public void doRenderItem(IPipedItem entityitem, double d, double d1, double d2, GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glTranslatef(0, 0.25F, 0); GL11.glScalef(renderScale, renderScale, renderScale); - dummyEntityItem.func_92058_a(itemstack); + dummyEntityItem.setEntityItemStack(itemstack); customRenderItem.doRenderItem(dummyEntityItem, 0, 0, 0, 0, 0); GL11.glPopMatrix(); } diff --git a/common/buildcraft/transport/utils/FacadeMatrix.java b/common/buildcraft/transport/utils/FacadeMatrix.java index 5660dcf09d..fcfea0cfb9 100644 --- a/common/buildcraft/transport/utils/FacadeMatrix.java +++ b/common/buildcraft/transport/utils/FacadeMatrix.java @@ -4,38 +4,25 @@ import java.io.DataOutputStream; import java.io.IOException; +import net.minecraft.util.Icon; import net.minecraftforge.common.ForgeDirection; public class FacadeMatrix extends ConnectionMatrix { - private String[] _textureFiles = new String[ForgeDirection.VALID_DIRECTIONS.length]; - private int[] _textureIndex = new int[ForgeDirection.VALID_DIRECTIONS.length]; + private Icon[] _textureIcons = new Icon[ForgeDirection.VALID_DIRECTIONS.length]; private boolean dirty = false; public FacadeMatrix() { - for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) { - _textureFiles[direction.ordinal()] = ""; - } - } - - public String getTextureFile(ForgeDirection direction) { - return _textureFiles[direction.ordinal()]; } - public void setTextureFile(ForgeDirection direction, String filePath) { - if (!_textureFiles[direction.ordinal()].equals(filePath)) { - _textureFiles[direction.ordinal()] = filePath; - dirty = true; - } - } - public int getTextureIndex(ForgeDirection direction) { - return _textureIndex[direction.ordinal()]; + public Icon getTextureIcon(ForgeDirection direction) { + return _textureIcons[direction.ordinal()]; } - public void setTextureIndex(ForgeDirection direction, int value) { - if (_textureIndex[direction.ordinal()] != value) { - _textureIndex[direction.ordinal()] = value; + public void setTextureIcon(ForgeDirection direction, Icon value) { + if (_textureIcons[direction.ordinal()] != value) { + _textureIcons[direction.ordinal()] = value; dirty = true; } } @@ -55,8 +42,7 @@ public void clean() { public void readData(DataInputStream data) throws IOException { super.readData(data); for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { - _textureFiles[i] = data.readUTF(); - _textureIndex[i] = data.readInt(); + _textureIcons[i] = data.readInt(); } } @@ -65,7 +51,7 @@ public void writeData(DataOutputStream data) throws IOException { super.writeData(data); for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) { data.writeUTF(_textureFiles[i]); - data.writeInt(_textureIndex[i]); + data.writeInt(_textureIcons[i]); } } }