Merge branch '6.5.x' of github.com:BuildCraft/BuildCraft into 7.1.x
This commit is contained in:
commit
507b41707d
6 changed files with 56 additions and 29 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<Class<? extends Block>> shiftRotations = new HashSet<Class<? extends Block>>();
|
||||
private final Set<Class<? extends Block>> blacklistedRotations = new HashSet<Class<? extends Block>>();
|
||||
|
||||
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<? extends Block> cls) {
|
||||
for (Class<? extends Block> shift : shiftRotations) {
|
||||
private boolean isClass(Set<Class<? extends Block>> set, Class<? extends Block> cls) {
|
||||
for (Class<? extends Block> 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -217,6 +219,10 @@ public class PipeItemsStripes extends Pipe<PipeTransportItems> implements IEnerg
|
|||
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();
|
||||
|
|
Loading…
Reference in a new issue