From b0c68772e2e2964ad058bba6720ba240a7e8c53e Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Fri, 24 Aug 2012 20:19:04 -0700 Subject: [PATCH 1/2] Pretty sure this cast shouldn't be here. --- common/buildcraft/energy/TileEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/buildcraft/energy/TileEngine.java b/common/buildcraft/energy/TileEngine.java index 5b5022de..c5969109 100644 --- a/common/buildcraft/energy/TileEngine.java +++ b/common/buildcraft/energy/TileEngine.java @@ -366,7 +366,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven return; } - engine.addEnergy((int) (provider.useEnergy(1, engine.maxEnergyReceived(), true) * 0.95F)); + engine.addEnergy(provider.useEnergy(1, engine.maxEnergyReceived(), true) * 0.95F); } public boolean isPoweredTile(TileEntity tile) { From b649839ba991bd842a393c8089f4e2746d0ae771 Mon Sep 17 00:00:00 2001 From: Krapht Date: Sat, 25 Aug 2012 11:48:25 +0200 Subject: [PATCH 2/2] Fix facades --- common/buildcraft/transport/ItemFacade.java | 91 +++------------------ 1 file changed, 12 insertions(+), 79 deletions(-) diff --git a/common/buildcraft/transport/ItemFacade.java b/common/buildcraft/transport/ItemFacade.java index 7f4dbe35..a3bfcabb 100644 --- a/common/buildcraft/transport/ItemFacade.java +++ b/common/buildcraft/transport/ItemFacade.java @@ -32,6 +32,7 @@ public class ItemFacade extends ItemBuildCraft { setHasSubtypes(true); setMaxDamage(0); + this.setTabToDisplayOn(CreativeTabs.tabMisc); } @Override @@ -43,7 +44,7 @@ public class ItemFacade extends ItemBuildCraft { if (Item.itemsList[decodedBlockId] != null){ name += ": " + ProxyCore.proxy.getItemDisplayName(newStack); } else { - name += " < BROKEN >"; + name += " < BROKEN (" + decodedBlockId + ":"+ decodedMeta +" )>"; } return name; } @@ -57,11 +58,10 @@ public class ItemFacade extends ItemBuildCraft { @Override @SideOnly(Side.CLIENT) public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) { - super.getSubItems(par1, par2CreativeTabs, itemList); + //Do not call super, that would add a 0:0 facade for (ItemStack stack : allFacades){ itemList.add(stack.copy()); } - } @Override @@ -94,13 +94,13 @@ public class ItemFacade extends ItemBuildCraft { if (stack.getItem() instanceof ItemBlock){ ItemBlock itemBlock = (ItemBlock) stack.getItem(); int blockId = itemBlock.getBlockID(); - //Block certain IDs + //Block certain IDs (Bedrock, leaves and spunge) if (blockId == 7 || blockId == 18 || blockId == 19) continue; if (Block.blocksList[blockId] != null && Block.blocksList[blockId].isOpaqueCube() && Block.blocksList[blockId].getBlockName() != null - && !Block.blocksList[blockId].hasTileEntity() + && !Block.blocksList[blockId].hasTileEntity(0) && Block.blocksList[blockId].renderAsNormalBlock()) { allFacades.add(new ItemStack(BuildCraftTransport.facadeItem, 1, ItemFacade.encode(blockId, stack.getItemDamage()))); @@ -120,80 +120,13 @@ public class ItemFacade extends ItemBuildCraft { private static List getCreativeContents(){ List itemList = new ArrayList(); -// Block[] var2 = new Block[] {Block.cobblestone, Block.stone, Block.oreDiamond, Block.oreGold, Block.oreIron, Block.oreCoal, Block.oreLapis, Block.oreRedstone, Block.stoneBrick, Block.stoneBrick, Block.stoneBrick, Block.stoneBrick, Block.blockClay, Block.blockDiamond, Block.blockGold, Block.blockSteel, Block.bedrock, Block.blockLapis, Block.brick, Block.cobblestoneMossy, Block.stairSingle, Block.stairSingle, Block.stairSingle, Block.stairSingle, Block.stairSingle, Block.stairSingle, Block.obsidian, Block.netherrack, Block.slowSand, Block.glowStone, Block.wood, Block.wood, Block.wood, Block.wood, Block.leaves, Block.leaves, Block.leaves, Block.leaves, Block.dirt, Block.grass, Block.sand, Block.sandStone, Block.sandStone, Block.sandStone, Block.gravel, Block.web, Block.planks, Block.planks, Block.planks, Block.planks, Block.sapling, Block.sapling, Block.sapling, Block.sapling, Block.deadBush, Block.sponge, Block.ice, Block.blockSnow, Block.plantYellow, Block.plantRed, Block.mushroomBrown, Block.mushroomRed, Block.cactus, Block.melon, Block.pumpkin, Block.pumpkinLantern, Block.vine, Block.fenceIron, Block.thinGlass, Block.netherBrick, Block.netherFence, Block.stairsNetherBrick, Block.whiteStone, Block.mycelium, Block.waterlily, Block.tallGrass, Block.tallGrass, Block.chest, Block.workbench, Block.glass, Block.tnt, Block.bookShelf, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.cloth, Block.dispenser, Block.stoneOvenIdle, Block.music, Block.jukebox, Block.pistonStickyBase, Block.pistonBase, Block.fence, Block.fenceGate, Block.ladder, Block.rail, Block.railPowered, Block.railDetector, Block.torchWood, Block.stairCompactPlanks, Block.stairCompactCobblestone, Block.stairsBrick, Block.stairsStoneBrickSmooth, Block.lever, Block.pressurePlateStone, Block.pressurePlatePlanks, Block.torchRedstoneActive, Block.button, Block.trapdoor, Block.enchantmentTable, Block.redstoneLampIdle}; -// int var3 = 0; -// int var4 = 0; -// int var5 = 0; -// int var6 = 0; -// int var7 = 0; -// int var8 = 0; -// int var9 = 0; -// int var10 = 0; -// int var11 = 1; -// int var12; -// int var13; -// -// for (var12 = 0; var12 < var2.length; ++var12) -// { -// var13 = 0; -// -// if (var2[var12] == Block.cloth) -// { -// var13 = var3++; -// } -// else if (var2[var12] == Block.stairSingle) -// { -// var13 = var4++; -// } -// else if (var2[var12] == Block.wood) -// { -// var13 = var5++; -// } -// else if (var2[var12] == Block.planks) -// { -// var13 = var6++; -// } -// else if (var2[var12] == Block.sapling) -// { -// var13 = var7++; -// } -// else if (var2[var12] == Block.stoneBrick) -// { -// var13 = var8++; -// } -// else if (var2[var12] == Block.sandStone) -// { -// var13 = var9++; -// } -// else if (var2[var12] == Block.tallGrass) -// { -// var13 = var11++; -// } -// else if (var2[var12] == Block.leaves) -// { -// var13 = var10++; -// } -// -// itemList.add(new ItemStack(var2[var12], 1, var13)); -// } -// -// for (Block block : Block.blocksList) -// { -// if (block != null) -// { -// block.addCreativeItems((ArrayList) itemList); -// } -// } -// -// int x = 0; -// for (Item item : Item.itemsList) -// { -// if (x++ >= 256 && item != null) -// { -// item.addCreativeItems((ArrayList) itemList); -// } -// } - + for (Block block : Block.blocksList) + { + if (block != null) + { + block.getSubBlocks(block.blockID, null, itemList); + } + } return itemList; }