From 591313df4350c95b21fa228858bb77f4a906f728 Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 12 Apr 2014 23:32:42 +0300 Subject: [PATCH 1/7] Crappy temp fix for #1576 I think it's something with time. --- common/buildcraft/transport/PipeTransportFluids.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/buildcraft/transport/PipeTransportFluids.java b/common/buildcraft/transport/PipeTransportFluids.java index 5fd79865..e5b2b0c2 100644 --- a/common/buildcraft/transport/PipeTransportFluids.java +++ b/common/buildcraft/transport/PipeTransportFluids.java @@ -337,7 +337,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler private void moveFluids() { short newTimeSlot = (short) (container.getWorldObj().getTotalWorldTime() % travelDelay); - short outputCount = computeCurrentConnectionStatesAndTickFlows(newTimeSlot); + short outputCount = computeCurrentConnectionStatesAndTickFlows(newTimeSlot > 0 ? newTimeSlot : 0); moveFromPipe(outputCount); moveFromCenter(outputCount); moveToCenter(); From daa9ab82fb5a6e31d1f6e277f9a785f423382499 Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 12 Apr 2014 23:42:01 +0300 Subject: [PATCH 2/7] Update PipeTransportFluids.java --- common/buildcraft/transport/PipeTransportFluids.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/buildcraft/transport/PipeTransportFluids.java b/common/buildcraft/transport/PipeTransportFluids.java index e5b2b0c2..d2d32d61 100644 --- a/common/buildcraft/transport/PipeTransportFluids.java +++ b/common/buildcraft/transport/PipeTransportFluids.java @@ -337,7 +337,7 @@ public class PipeTransportFluids extends PipeTransport implements IFluidHandler private void moveFluids() { short newTimeSlot = (short) (container.getWorldObj().getTotalWorldTime() % travelDelay); - short outputCount = computeCurrentConnectionStatesAndTickFlows(newTimeSlot > 0 ? newTimeSlot : 0); + short outputCount = computeCurrentConnectionStatesAndTickFlows(newTimeSlot > 0 && newTimeSlot < travelDelay ? newTimeSlot : 0); moveFromPipe(outputCount); moveFromCenter(outputCount); moveToCenter(); From d5055969b04faca6c8b49eea07cee4f76cbea8ce Mon Sep 17 00:00:00 2001 From: SandGrainOne Date: Mon, 14 Apr 2014 01:00:51 +0200 Subject: [PATCH 3/7] Oil spouts wasn't visible above the ocean surface. --- common/buildcraft/energy/worldgen/OilPopulate.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/energy/worldgen/OilPopulate.java b/common/buildcraft/energy/worldgen/OilPopulate.java index a1d8dc50..0deec4f7 100644 --- a/common/buildcraft/energy/worldgen/OilPopulate.java +++ b/common/buildcraft/energy/worldgen/OilPopulate.java @@ -19,6 +19,7 @@ import java.util.Set; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockStaticLiquid; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.world.World; @@ -260,7 +261,7 @@ public class OilPopulate { private boolean isReplaceableFluid(World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); - return (block instanceof BlockFluidBase || block instanceof IFluidBlock) && block.getMaterial() != Material.lava; + return (block instanceof BlockStaticLiquid || block instanceof BlockFluidBase || block instanceof IFluidBlock) && block.getMaterial() != Material.lava; } private boolean isOil(World world, int x, int y, int z) { @@ -357,6 +358,10 @@ public class OilPopulate { continue; } + if (block instanceof BlockStaticLiquid) { + return y; + } + if (block instanceof BlockFluidBase) { return y; } From 080b4ba74990c6488f7c645cc64d3985f47e42fd Mon Sep 17 00:00:00 2001 From: SandGrainOne Date: Mon, 14 Apr 2014 09:42:27 +0200 Subject: [PATCH 4/7] Cylinder pattern was missing the name --- buildcraft_resources/assets/buildcraft/lang/en_US.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/buildcraft_resources/assets/buildcraft/lang/en_US.lang b/buildcraft_resources/assets/buildcraft/lang/en_US.lang index 7d90109a..1c6a3a8b 100644 --- a/buildcraft_resources/assets/buildcraft/lang/en_US.lang +++ b/buildcraft_resources/assets/buildcraft/lang/en_US.lang @@ -26,6 +26,7 @@ fillerpattern.horizon=Horizon fillerpattern.pyramid=Pyramid fillerpattern.stairs=Stairs fillerpattern.box=Box +fillerpattern.cylinder=Cylinder fluid.oil=Oil fluid.fuel=Fuel From fd9d9272b78414c819b895347150f43559d60a16 Mon Sep 17 00:00:00 2001 From: SandGrainOne Date: Mon, 14 Apr 2014 20:38:24 +0200 Subject: [PATCH 5/7] Change wire in recipe for gold gates --- common/buildcraft/BuildCraftSilicon.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/BuildCraftSilicon.java b/common/buildcraft/BuildCraftSilicon.java index 38fa16b9..67f0857c 100644 --- a/common/buildcraft/BuildCraftSilicon.java +++ b/common/buildcraft/BuildCraftSilicon.java @@ -165,8 +165,8 @@ public class BuildCraftSilicon extends BuildCraftMod { BuildcraftRecipes.assemblyTable.addRecipe(10000, ItemGate.makeGateItem(GateMaterial.REDSTONE, GateLogic.AND), Chipset.RED.getStack(), PipeWire.RED.getStack()); addGateRecipe(20000, GateMaterial.IRON, Chipset.IRON, PipeWire.RED, PipeWire.BLUE); - addGateRecipe(40000, GateMaterial.GOLD, Chipset.GOLD, PipeWire.RED, PipeWire.BLUE, PipeWire.YELLOW); - addGateRecipe(80000, GateMaterial.DIAMOND, Chipset.DIAMOND, PipeWire.RED, PipeWire.BLUE, PipeWire.YELLOW, PipeWire.GREEN); + addGateRecipe(40000, GateMaterial.GOLD, Chipset.GOLD, PipeWire.RED, PipeWire.BLUE, PipeWire.GREEN); + addGateRecipe(80000, GateMaterial.DIAMOND, Chipset.DIAMOND, PipeWire.RED, PipeWire.BLUE, PipeWire.GREEN, PipeWire.YELLOW); // REVERSAL RECIPES EnumSet materials = EnumSet.allOf(GateMaterial.class); From 42d0e641b861267f6fc0fec11dd16c630ddd9b15 Mon Sep 17 00:00:00 2001 From: robin4002 Date: Sat, 19 Apr 2014 15:27:00 +0200 Subject: [PATCH 6/7] Fix ClassCastException in tile entity, close #1584 --- .../builders/BlockBlueprintLibrary.java | 18 +++--- common/buildcraft/builders/BlockMarker.java | 8 ++- common/buildcraft/energy/BlockEngine.java | 23 ++++---- common/buildcraft/factory/BlockQuarry.java | 5 +- common/buildcraft/factory/BlockTank.java | 59 ++++++++++--------- .../transport/BlockGenericPipe.java | 9 ++- 6 files changed, 70 insertions(+), 52 deletions(-) diff --git a/common/buildcraft/builders/BlockBlueprintLibrary.java b/common/buildcraft/builders/BlockBlueprintLibrary.java index f06f4beb..cea6a6cf 100644 --- a/common/buildcraft/builders/BlockBlueprintLibrary.java +++ b/common/buildcraft/builders/BlockBlueprintLibrary.java @@ -43,12 +43,15 @@ public class BlockBlueprintLibrary extends BlockContainer { if (entityplayer.isSneaking()) return false; - TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getTileEntity(i, j, k); + TileEntity tile = world.getTileEntity(i, j, k); + if (tile instanceof TileBlueprintLibrary) { + TileBlueprintLibrary tileBlueprint = (TileBlueprintLibrary)tile; + if (!tileBlueprint.locked || entityplayer.getDisplayName().equals(tileBlueprint.owner)) + if (!world.isRemote) { + entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k); + } + } - if (!tile.locked || entityplayer.getDisplayName().equals(tile.owner)) - if (!world.isRemote) { - entityplayer.openGui(BuildCraftBuilders.instance, GuiIds.BLUEPRINT_LIBRARY, world, i, j, k); - } return true; } @@ -72,8 +75,9 @@ public class BlockBlueprintLibrary extends BlockContainer { @Override public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityliving, ItemStack stack) { if (!world.isRemote && entityliving instanceof EntityPlayer) { - TileBlueprintLibrary tile = (TileBlueprintLibrary) world.getTileEntity(i, j, k); - tile.owner = ((EntityPlayer) entityliving).getDisplayName(); + TileEntity tile = world.getTileEntity(i, j, k); + if (tile instanceof TileBlueprintLibrary) + ((TileBlueprintLibrary)tile).owner = ((EntityPlayer) entityliving).getDisplayName(); } } diff --git a/common/buildcraft/builders/BlockMarker.java b/common/buildcraft/builders/BlockMarker.java index 7340f814..bcdc0bdd 100644 --- a/common/buildcraft/builders/BlockMarker.java +++ b/common/buildcraft/builders/BlockMarker.java @@ -90,7 +90,9 @@ public class BlockMarker extends BlockContainer { @Override public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) { - ((TileMarker) world.getTileEntity(i, j, k)).tryConnection(); + TileEntity tile = world.getTileEntity(i, j, k); + if (tile instanceof TileMarker) + ((TileMarker) tile).tryConnection(); return true; } @@ -117,7 +119,9 @@ public class BlockMarker extends BlockContainer { @Override public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - ((TileMarker) world.getTileEntity(x, y, z)).updateSignals(); + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TileMarker) + ((TileMarker) tile).updateSignals(); dropTorchIfCantStay(world, x, y, z); } diff --git a/common/buildcraft/energy/BlockEngine.java b/common/buildcraft/energy/BlockEngine.java index 740a6df9..c5db6446 100644 --- a/common/buildcraft/energy/BlockEngine.java +++ b/common/buildcraft/energy/BlockEngine.java @@ -95,7 +95,7 @@ public class BlockEngine extends BlockBuildCraft { @Override public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int side, float par7, float par8, float par9) { - TileEngine tile = (TileEngine) world.getTileEntity(i, j, k); + TileEntity tile = world.getTileEntity(i, j, k); // Drop through if the player is sneaking if (player.isSneaking()) @@ -117,10 +117,13 @@ public class BlockEngine extends BlockBuildCraft { @Override public void onPostBlockPlaced(World world, int x, int y, int z, int par5) { - TileEngine tile = (TileEngine) world.getTileEntity(x, y, z); - tile.orientation = ForgeDirection.UP; - if (!tile.isOrientationValid()) - tile.switchOrientation(true); + TileEntity tile = world.getTileEntity(x, y, z); + if (tile instanceof TileEngine) { + TileEngine engine = (TileEngine)tile; + engine.orientation = ForgeDirection.UP; + if (!engine.isOrientationValid()) + engine.switchOrientation(true); + } } @Override @@ -131,9 +134,9 @@ public class BlockEngine extends BlockBuildCraft { @SuppressWarnings({"all"}) @Override public void randomDisplayTick(World world, int i, int j, int k, Random random) { - TileEngine tile = (TileEngine) world.getTileEntity(i, j, k); + TileEntity tile = world.getTileEntity(i, j, k); - if (!tile.isBurning()) + if (tile instanceof TileEngine && !((TileEngine) tile).isBurning()) return; float f = (float) i + 0.5F; @@ -158,10 +161,10 @@ public class BlockEngine extends BlockBuildCraft { @Override public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - TileEngine tile = (TileEngine) world.getTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(x, y, z); - if (tile != null) { - tile.checkRedstonePower(); + if (tile instanceof TileEngine) { + ((TileEngine) tile).checkRedstonePower(); } } diff --git a/common/buildcraft/factory/BlockQuarry.java b/common/buildcraft/factory/BlockQuarry.java index 520f7721..6419aec3 100644 --- a/common/buildcraft/factory/BlockQuarry.java +++ b/common/buildcraft/factory/BlockQuarry.java @@ -56,8 +56,9 @@ public class BlockQuarry extends BlockBuildCraft { world.setBlockMetadataWithNotify(i, j, k, orientation.getOpposite().ordinal(), 1); if (entityliving instanceof EntityPlayer) { - TileQuarry tq = (TileQuarry) world.getTileEntity(i, j, k); - tq.placedBy = (EntityPlayer) entityliving; + TileEntity tile = world.getTileEntity(i, j, k); + if (tile instanceof TileQuarry) + ((TileQuarry) tile).placedBy = (EntityPlayer) entityliving; } } diff --git a/common/buildcraft/factory/BlockTank.java b/common/buildcraft/factory/BlockTank.java index 8d480746..a0abe6ea 100644 --- a/common/buildcraft/factory/BlockTank.java +++ b/common/buildcraft/factory/BlockTank.java @@ -92,44 +92,47 @@ public class BlockTank extends BlockContainer { if (current != null) { FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current); - TileTank tank = (TileTank) world.getTileEntity(i, j, k); + TileEntity tile = world.getTileEntity(i, j, k); + if(tile instanceof TileTank) + { + TileTank tank = (TileTank)tile; + // Handle filled containers + if (liquid != null) { + int qty = tank.fill(ForgeDirection.UNKNOWN, liquid, true); - // Handle filled containers - if (liquid != null) { - int qty = tank.fill(ForgeDirection.UNKNOWN, liquid, true); + if (qty != 0 && !BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current)); + } - if (qty != 0 && !BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) { - entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current)); - } + return true; - return true; - - // Handle empty containers - } else { - FluidStack available = tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid; + // Handle empty containers + } else { + FluidStack available = tank.getTankInfo(ForgeDirection.UNKNOWN)[0].fluid; - if (available != null) { - ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, current); + if (available != null) { + ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, current); - liquid = FluidContainerRegistry.getFluidForFilledItem(filled); + liquid = FluidContainerRegistry.getFluidForFilledItem(filled); - if (liquid != null) { - if (!BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) { - if (current.stackSize > 1) { - if (!entityplayer.inventory.addItemStackToInventory(filled)) - return false; - else { + if (liquid != null) { + if (!BuildCraftCore.debugMode && !entityplayer.capabilities.isCreativeMode) { + if (current.stackSize > 1) { + if (!entityplayer.inventory.addItemStackToInventory(filled)) + return false; + else { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current)); + } + } else { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current)); + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, filled); } - } else { - entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, InvUtils.consumeItem(current)); - entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, filled); } + + tank.drain(ForgeDirection.UNKNOWN, liquid.amount, true); + + return true; } - - tank.drain(ForgeDirection.UNKNOWN, liquid.amount, true); - - return true; } } } diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index 582e4230..b78508c5 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -1020,9 +1020,12 @@ public class BlockGenericPipe extends BlockBuildCraft { boolean placed = world.setBlock(i, j, k, block, meta, 3); if (placed) { - TileGenericPipe tile = (TileGenericPipe) world.getTileEntity(i, j, k); - tile.initialize(pipe); - tile.sendUpdateToClient(); + TileEntity tile = world.getTileEntity(i, j, k); + if (tile instanceof TileGenericPipe) { + TileGenericPipe tilePipe = (TileGenericPipe) tile; + tilePipe.initialize(pipe); + tilePipe.sendUpdateToClient(); + } } return placed; From 98d8861ea39d7092f19c96cb8e50ad91a7efb5c9 Mon Sep 17 00:00:00 2001 From: SpaceToad Date: Sat, 26 Apr 2014 13:12:28 +0200 Subject: [PATCH 7/7] migrated to forge 60 and gradle 1.2 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 81db42e4..600a7e27 100755 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } @@ -26,7 +26,7 @@ group= "com.mod-buildcraft" archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] minecraft { - version = "1.7.2-10.12.0.1047" // McVersion-ForgeVersion this variable is later changed to contain only the MC version, while the apiVersion variable is used for the forge version. Yeah its stupid, and will be changed eentually. + version = "1.7.2-10.12.1.1060" // McVersion-ForgeVersion this variable is later changed to contain only the MC version, while the apiVersion variable is used for the forge version. Yeah its stupid, and will be changed eentually. assetDir = "run/assets" // the place for ForgeGradle to download the assets. The assets that the launcher gets and stuff