diff --git a/buildcraft_resources/changelog/7.0.17 b/buildcraft_resources/changelog/7.0.17 index bffa2d71..0c5d8078 100644 --- a/buildcraft_resources/changelog/7.0.17 +++ b/buildcraft_resources/changelog/7.0.17 @@ -3,3 +3,6 @@ Bugs fixed: * [#2892] Disconnect on large-resolution Zone Planner fullscreen (asie) * [#2891] Boxes ignoring the south and east boundaries when rounding (hea3ven) * Accidentally setting an area in the Zone Planner GUI upon pressing fullscreen (asie) +* Paintbrush not being re-dyeable if not fully used (asie) +* Stripes Pipe "breaking" fluid blocks (asie) +* Wrench failing to rotate double chests and beds (asie) diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index 9c095730..9ef9bdc5 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -653,10 +653,12 @@ public class BuildCraftCore extends BuildCraftMod { CoreProxy.proxy.addCraftingRecipe(new ItemStack(paintbrushItem), " iw", " gi", "s ", 's', "stickWood", 'g', "gearWood", 'w', new ItemStack(Blocks.wool, 1, 0), 'i', Items.string); + ItemStack anyPaintbrush = new ItemStack(paintbrushItem, 1, OreDictionary.WILDCARD_VALUE); + for (int i = 0; i < 16; i++) { ItemStack outputStack = new ItemStack(paintbrushItem); NBTUtils.getItemData(outputStack).setByte("color", (byte) i); - CoreProxy.proxy.addShapelessRecipe(outputStack, paintbrushItem, EnumColor.fromId(i).getDye()); + CoreProxy.proxy.addShapelessRecipe(outputStack, anyPaintbrush, EnumColor.fromId(i).getDye()); } // Convert old lists to new lists diff --git a/common/buildcraft/core/ItemWrench.java b/common/buildcraft/core/ItemWrench.java index 88da0ff9..0ce5b777 100644 --- a/common/buildcraft/core/ItemWrench.java +++ b/common/buildcraft/core/ItemWrench.java @@ -12,6 +12,7 @@ import java.util.HashSet; import java.util.Set; import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; import net.minecraft.block.BlockButton; import net.minecraft.block.BlockChest; import net.minecraft.block.BlockLever; @@ -22,10 +23,11 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.api.tools.IToolWrench; import buildcraft.core.lib.items.ItemBuildCraft; +import buildcraft.core.lib.utils.BlockUtils; public class ItemWrench extends ItemBuildCraft implements IToolWrench { - private final Set> shiftRotations = new HashSet>(); + private final Set> blacklistedRotations = new HashSet>(); public ItemWrench() { super(); @@ -35,11 +37,12 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench { shiftRotations.add(BlockLever.class); shiftRotations.add(BlockButton.class); shiftRotations.add(BlockChest.class); + blacklistedRotations.add(BlockBed.class); setHarvestLevel("wrench", 0); } - private boolean isShiftRotation(Class cls) { - for (Class shift : shiftRotations) { + private boolean isClass(Set> set, Class cls) { + for (Class shift : set) { if (shift.isAssignableFrom(cls)) { return true; } @@ -51,11 +54,16 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench { public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { Block block = world.getBlock(x, y, z); - if (block == null) { + if (block == null || isClass(blacklistedRotations, block.getClass())) { return false; } - if (player.isSneaking() != isShiftRotation(block.getClass())) { + if (player.isSneaking() != isClass(shiftRotations, block.getClass())) { + return false; + } + + // Double chests should NOT be rotated. + if (block instanceof BlockChest && BlockUtils.getOtherDoubleChest(world.getTileEntity(x, y, z)) != null) { return false; } diff --git a/common/buildcraft/core/lib/inventory/InvUtils.java b/common/buildcraft/core/lib/inventory/InvUtils.java index 34c370e1..1c563080 100644 --- a/common/buildcraft/core/lib/inventory/InvUtils.java +++ b/common/buildcraft/core/lib/inventory/InvUtils.java @@ -22,6 +22,7 @@ import net.minecraftforge.common.util.ForgeDirection; import buildcraft.api.core.IInvSlot; import buildcraft.core.lib.inventory.filters.IStackFilter; +import buildcraft.core.lib.utils.BlockUtils; public final class InvUtils { @@ -218,26 +219,7 @@ public final class InvUtils { */ public static IInventory getInventory(IInventory inv) { if (inv instanceof TileEntityChest) { - TileEntityChest chest = (TileEntityChest) inv; - - TileEntityChest adjacent = null; - - if (chest.adjacentChestXNeg != null) { - adjacent = chest.adjacentChestXNeg; - } - - if (chest.adjacentChestXPos != null) { - adjacent = chest.adjacentChestXPos; - } - - if (chest.adjacentChestZNeg != null) { - adjacent = chest.adjacentChestZNeg; - } - - if (chest.adjacentChestZPos != null) { - adjacent = chest.adjacentChestZPos; - } - + TileEntityChest adjacent = BlockUtils.getOtherDoubleChest((TileEntityChest) inv); if (adjacent != null) { return new InventoryLargeChest("", inv, adjacent); } diff --git a/common/buildcraft/core/lib/utils/BlockUtils.java b/common/buildcraft/core/lib/utils/BlockUtils.java index f8c319fd..029d753b 100644 --- a/common/buildcraft/core/lib/utils/BlockUtils.java +++ b/common/buildcraft/core/lib/utils/BlockUtils.java @@ -20,14 +20,13 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.network.play.server.S27PacketExplosion; import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; import net.minecraft.world.ChunkPosition; import net.minecraft.world.Explosion; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraft.world.chunk.Chunk; - import cpw.mods.fml.common.FMLCommonHandler; - import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.ForgeEventFactory; @@ -302,4 +301,31 @@ public final class BlockUtils { } return done; } + + public static TileEntityChest getOtherDoubleChest(TileEntity inv) { + if (inv instanceof TileEntityChest) { + TileEntityChest chest = (TileEntityChest) inv; + + TileEntityChest adjacent = null; + + if (chest.adjacentChestXNeg != null) { + adjacent = chest.adjacentChestXNeg; + } + + if (chest.adjacentChestXPos != null) { + adjacent = chest.adjacentChestXPos; + } + + if (chest.adjacentChestZNeg != null) { + adjacent = chest.adjacentChestZNeg; + } + + if (chest.adjacentChestZPos != null) { + adjacent = chest.adjacentChestZPos; + } + + return adjacent; + } + return null; + } } diff --git a/common/buildcraft/transport/pipes/PipeItemsStripes.java b/common/buildcraft/transport/pipes/PipeItemsStripes.java index ef3d38f3..0ae8ee75 100644 --- a/common/buildcraft/transport/pipes/PipeItemsStripes.java +++ b/common/buildcraft/transport/pipes/PipeItemsStripes.java @@ -13,12 +13,14 @@ import java.util.Collection; import java.util.LinkedList; import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.IFluidBlock; import cofh.api.energy.IEnergyHandler; import buildcraft.BuildCraftTransport; @@ -216,7 +218,11 @@ public class PipeItemsStripes extends Pipe implements IEnerg if (!BlockUtils.isUnbreakableBlock(getWorld(), (int) p.x, (int) p.y, (int) p.z)) { Block block = getWorld().getBlock((int) p.x, (int) p.y, (int) p.z); int metadata = getWorld().getBlockMetadata((int) p.x, (int) p.y, (int) p.z); - + + if (block instanceof BlockLiquid || block instanceof IFluidBlock) { + return maxReceive; + } + ItemStack stack = new ItemStack(block, 1, metadata); EntityPlayer player = CoreProxy.proxy.getBuildCraftPlayer((WorldServer) getWorld(), (int) p.x, (int) p.y, (int) p.z).get();