From b70de9b9d7bff04cdb7332b91df237521f63d813 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Sat, 13 Apr 2013 12:55:06 -0400 Subject: [PATCH] Fixes --- .../api/blueprints/BlockSignature.java | 77 ------ .../api/blueprints/BlueprintManager.java | 35 --- .../buildcraft/api/blueprints/BptBlock.java | 235 ------------------ .../api/blueprints/BptBlockUtils.java | 86 ------- .../api/blueprints/BptSlotInfo.java | 55 ---- .../api/blueprints/IBptContext.java | 48 ---- .../api/blueprints/ItemSignature.java | 48 ---- .../buildcraft/api/bptblocks/BptBlockBed.java | 87 ------- .../api/bptblocks/BptBlockCustomStack.java | 35 --- .../api/bptblocks/BptBlockDelegate.java | 66 ----- .../api/bptblocks/BptBlockDirt.java | 43 ---- .../api/bptblocks/BptBlockDoor.java | 72 ------ .../api/bptblocks/BptBlockIgnore.java | 46 ---- .../api/bptblocks/BptBlockIgnoreMeta.java | 35 --- .../api/bptblocks/BptBlockInventory.java | 28 --- .../api/bptblocks/BptBlockLever.java | 39 --- .../api/bptblocks/BptBlockLiquid.java | 62 ----- .../api/bptblocks/BptBlockPiston.java | 29 --- .../api/bptblocks/BptBlockPumpkin.java | 54 ---- .../bptblocks/BptBlockRedstoneRepeater.java | 51 ---- .../bptblocks/BptBlockRotateInventory.java | 27 -- .../api/bptblocks/BptBlockRotateMeta.java | 85 ------- .../api/bptblocks/BptBlockSign.java | 65 ----- .../api/bptblocks/BptBlockStairs.java | 54 ---- .../api/bptblocks/BptBlockWallSide.java | 53 ---- 25 files changed, 1515 deletions(-) delete mode 100644 src/minecraft/buildcraft/api/blueprints/BlockSignature.java delete mode 100644 src/minecraft/buildcraft/api/blueprints/BlueprintManager.java delete mode 100644 src/minecraft/buildcraft/api/blueprints/BptBlock.java delete mode 100644 src/minecraft/buildcraft/api/blueprints/BptBlockUtils.java delete mode 100644 src/minecraft/buildcraft/api/blueprints/BptSlotInfo.java delete mode 100644 src/minecraft/buildcraft/api/blueprints/IBptContext.java delete mode 100644 src/minecraft/buildcraft/api/blueprints/ItemSignature.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockBed.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockCustomStack.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockDelegate.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockDirt.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockDoor.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockIgnore.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockInventory.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockLever.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockLiquid.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockPiston.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockPumpkin.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockRotateInventory.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockRotateMeta.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockSign.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockStairs.java delete mode 100644 src/minecraft/buildcraft/api/bptblocks/BptBlockWallSide.java diff --git a/src/minecraft/buildcraft/api/blueprints/BlockSignature.java b/src/minecraft/buildcraft/api/blueprints/BlockSignature.java deleted file mode 100644 index 51db24d48..000000000 --- a/src/minecraft/buildcraft/api/blueprints/BlockSignature.java +++ /dev/null @@ -1,77 +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.api.blueprints; - -public class BlockSignature { - - public String blockClassName; - public String tileClassName; - public String blockName; - public String mod; - public String modVersion; - public String customField; - - public BlockSignature(String str) { - String[] values = str.split("/"); - - int i = 0; - - if (values[0].equals("#B")) { - i++; - } - - blockClassName = values[i]; - tileClassName = values[i + 1]; - blockName = values[i + 2]; - mod = values[i + 3]; - modVersion = values[i + 4]; - customField = values[i + 5]; - - replaceNullWithStar(); - - } - - public BlockSignature() { - replaceNullWithStar(); - } - - @Override - public String toString() { - replaceNullWithStar(); - - return "#B/" + blockClassName + "/" + tileClassName + "/" + blockName + "/" + mod + "/" + modVersion + "/" + customField; - } - - public void replaceNullWithStar() { - if (blockClassName == null) { - blockClassName = "*"; - } - - if (tileClassName == null) { - tileClassName = "*"; - } - - if (blockName == null) { - blockName = "*"; - } - - if (mod == null) { - mod = "*"; - } - - if (modVersion == null) { - modVersion = "*"; - } - - if (customField == null) { - customField = "*"; - } - } -} diff --git a/src/minecraft/buildcraft/api/blueprints/BlueprintManager.java b/src/minecraft/buildcraft/api/blueprints/BlueprintManager.java deleted file mode 100644 index 9bab365be..000000000 --- a/src/minecraft/buildcraft/api/blueprints/BlueprintManager.java +++ /dev/null @@ -1,35 +0,0 @@ -package buildcraft.api.blueprints; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import buildcraft.api.core.BuildCraftAPI; - -@Deprecated -public class BlueprintManager { - - public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length]; - - public static ItemSignature getItemSignature(Item item) { - ItemSignature sig = new ItemSignature(); - - if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) { - sig.itemClassName = item.getClass().getSimpleName(); - } - - sig.itemName = item.getUnlocalizedName(new ItemStack(item)); - - return sig; - } - - public static BlockSignature getBlockSignature(Block block) { - return BlueprintManager.blockBptProps[0].getSignature(block); - } - - static { - // Initialize defaults for block properties. - for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) { - new BptBlock(i); - } - } -} diff --git a/src/minecraft/buildcraft/api/blueprints/BptBlock.java b/src/minecraft/buildcraft/api/blueprints/BptBlock.java deleted file mode 100644 index 3e2810128..000000000 --- a/src/minecraft/buildcraft/api/blueprints/BptBlock.java +++ /dev/null @@ -1,235 +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.api.blueprints; - -import java.util.ArrayList; -import java.util.LinkedList; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import buildcraft.api.core.BuildCraftAPI; - -/** - * This class allow to specify specific behavior for blocks stored in blueprints: - * - * - what items needs to be used to create that block - how the block has to be built on the world - how to rotate the block - what extra data to store / load - * in the blueprint - * - * Default implementations of this can be seen in the package buildcraft.api.bptblocks. The class BptBlockUtils provide some additional utilities. - * - * Blueprints perform "id translation" in case the block ids between a blueprint and the world installation are different. In order to translate block ids, - * blocks needs to be uniquely identified. By default, this identification is done by: - * - * - the block simple class name - the tile simple class name (if any) - the block name - * - * In certain circumstances, the above is not enough (e.g. if several blocks share the same class and the same name, with no tile). In this case, additional - * data may be provided by children of this class: - * - * - mod name - custom signature - * - * At blueprint load time, BuildCraft will check that each block id of the blueprint corresponds to the block id in the installation. If not, it will perform a - * search through the block list, and upon matching signature, it will translate all blocks ids of the blueprint to the installation ones. If no such block id - * is found, BuildCraft will assume that the block is not installed and will not load the blueprint. - */ - -@Deprecated -public class BptBlock { - - public final int blockId; - - public BptBlock(int blockId) { - this.blockId = blockId; - - BlueprintManager.blockBptProps[blockId] = this; - } - - /** - * Returns the requirements needed to build this block. When the requirements are met, they will be removed all at once from the builder, before calling - * buildBlock. - */ - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if (slot.blockId != 0) { - if (slot.storedRequirements.size() != 0) { - requirements.addAll(slot.storedRequirements); - } else { - requirements.add(new ItemStack(slot.blockId, 1, slot.meta)); - } - } - } - - /** - * This is called each time an item matches a reqquirement, that is: (req id == stack id) for damageable items (req id == stack id && req dmg == stack dmg) - * for other items by default, it will increase damage of damageable items by the amount of damage of the requirement, and remove the intended amount of non - * damageable item. - * - * Client may override this behavior for default items. Note that this subprogram may be called twice with the same parameters, once with a copy of - * requirements and stack to check if the entire requirements can be fullfilled, and once with the real inventory. Implementer is responsible for updating - * req (with the remaining requirements if any) and stack (after usage) - * - * returns: what was used (similer to req, but created from stack, so that any NBT based differences are drawn from the correct source) - */ - public ItemStack useItem(BptSlotInfo slot, IBptContext context, ItemStack req, ItemStack stack) { - ItemStack result = stack.copy(); - if (stack.isItemStackDamageable()) { - if (req.getItemDamage() + stack.getItemDamage() <= stack.getMaxDamage()) { - stack.setItemDamage(req.getItemDamage() + stack.getItemDamage()); - result.setItemDamage(req.getItemDamage()); - req.stackSize = 0; - } - - if (stack.getItemDamage() >= stack.getMaxDamage()) { - stack.stackSize = 0; - } - } else { - if (stack.stackSize >= req.stackSize) { - result.stackSize = req.stackSize; - stack.stackSize -= req.stackSize; - req.stackSize = 0; - } else { - req.stackSize -= stack.stackSize; - stack.stackSize = 0; - } - } - - if (stack.stackSize == 0 && stack.getItem().getContainerItem() != null) { - Item container = stack.getItem().getContainerItem(); - - stack.itemID = container.itemID; - stack.stackSize = 1; - stack.setItemDamage(0); - } - return result; - } - - /** - * Return true if the block on the world correspond to the block stored in the blueprint at the location given by the slot. By default, this subprogram is - * permissive and doesn't take into account metadata. - * - * Added metadata sensitivity //Krapht - */ - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && slot.meta == context.world().getBlockMetadata(slot.x, slot.y, slot.z); - } - - /** - * Perform a 90 degree rotation to the slot. - */ - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - /** - * Places the block in the world, at the location specified in the slot. - */ - public void buildBlock(BptSlotInfo slot, IBptContext context) { - // Meta needs to be specified twice, depending on the block behavior - context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,3); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3); - - if (Block.blocksList[slot.blockId] instanceof BlockContainer) { - TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z); - - slot.cpt.setInteger("x", slot.x); - slot.cpt.setInteger("y", slot.y); - slot.cpt.setInteger("z", slot.z); - - if (tile != null) { - tile.readFromNBT(slot.cpt); - } - } - } - - /** - * Return true if the block should not be placed to the world. Requirements will not be asked on such a block, and building will not be called. - */ - public boolean ignoreBuilding(BptSlotInfo slot) { - return false; - } - - /** - * Initializes a slot from the blueprint according to an objet placed on {x, y, z} on the world. This typically means adding entries in slot.cpt. Note that - * "id" and "meta" will be set automatically, corresponding to the block id and meta. - * - * By default, if the block is a BlockContainer, tile information will be to save / load the block. - */ - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { - if (Block.blocksList[slot.blockId] instanceof BlockContainer) { - TileEntity tile = context.world().getBlockTileEntity(x, y, z); - - if (tile != null) { - tile.writeToNBT(slot.cpt); - } - } - - if (Block.blocksList[slot.blockId] != null) { - ArrayList req = Block.blocksList[slot.blockId].getBlockDropped(context.world(), x, y, z, context.world().getBlockMetadata(x, y, z), 0); - - if (req != null) { - slot.storedRequirements.addAll(req); - } - } - } - - /** - * Called on a block when the blueprint has finished to place all the blocks. This may be useful to adjust variable depending on surrounding blocks that may - * not be there already at initial building. - */ - public void postProcessing(BptSlotInfo slot, IBptContext context) { - - } - - /** - * By default, block class name, block tile name and block name are used to define block signature. Overriding this subprogram may allow to replace some of - * these with stars, specify the mod that this block kind is coming from or add custom data to the signature. - */ - public BlockSignature getSignature(Block block) { - BlockSignature sig = new BlockSignature(); - - if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) { - sig.blockClassName = block.getClass().getSimpleName(); - - if (block instanceof BlockContainer) { - // TODO: Try to see if we can get a world instance to call with instead of null - TileEntity tile = ((BlockContainer) block).createNewTileEntity(null); - - if (tile != null) { - sig.tileClassName = tile.getClass().getSimpleName(); - } - } - } - - sig.blockName = block.getUnlocalizedName(); - sig.replaceNullWithStar(); - - return sig; - } - - /** - * By default, block name, block and tile classes, mod name and custom signature are matched to verify if a blueprint block corresponds to the installation - * block - except for the default blocks which don't check for classes. For any value, * means match with anything. For compatibilty and evolution reasons, - * mods may want to write a different policy, allowing to migrate one format to the other. - */ - public boolean match(Block block, BlockSignature sig) { - if (block == null) - return false; - - BlockSignature inst = BlueprintManager.getBlockSignature(block); - - return starMatch(sig.blockName, inst.blockName) && starMatch(sig.blockClassName, inst.blockClassName) - && starMatch(sig.tileClassName, inst.tileClassName) && starMatch(sig.customField, inst.customField) && starMatch(sig.mod, inst.mod); - } - - private boolean starMatch(String s1, String s2) { - return s1.equals("*") || s2.equals("*") || s1.equals(s2); - } -} diff --git a/src/minecraft/buildcraft/api/blueprints/BptBlockUtils.java b/src/minecraft/buildcraft/api/blueprints/BptBlockUtils.java deleted file mode 100644 index a2d4ec19e..000000000 --- a/src/minecraft/buildcraft/api/blueprints/BptBlockUtils.java +++ /dev/null @@ -1,86 +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.api.blueprints; - -import java.util.LinkedList; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -@Deprecated -public class BptBlockUtils { - - public static void requestInventoryContents(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - ItemStack[] stacks = getItemStacks(slot, context); - - for (ItemStack stack : stacks) { - if (stack != null) { - requirements.add(stack); - } - } - } - - public static void initializeInventoryContents(BptSlotInfo slot, IBptContext context, IInventory inventory) { - ItemStack[] stacks = new ItemStack[inventory.getSizeInventory()]; - - for (int i = 0; i < inventory.getSizeInventory(); ++i) { - stacks[i] = inventory.getStackInSlot(i); - } - - setItemStacks(slot, context, stacks); - } - - public static void buildInventoryContents(BptSlotInfo slot, IBptContext context, IInventory inventory) { - ItemStack[] stacks = getItemStacks(slot, context); - - for (int i = 0; i < stacks.length; ++i) { - inventory.setInventorySlotContents(i, stacks[i]); - } - } - - public static ItemStack[] getItemStacks(BptSlotInfo slot, IBptContext context) { - NBTTagList list = (NBTTagList) slot.cpt.getTag("inv"); - - if (list == null) - return new ItemStack[0]; - - ItemStack stacks[] = new ItemStack[list.tagCount()]; - - for (int i = 0; i < list.tagCount(); ++i) { - ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i)); - - if (stack != null && stack.itemID != 0 && stack.stackSize > 0) { - stacks[i] = context.mapItemStack(stack); - } - } - - return stacks; - } - - public static void setItemStacks(BptSlotInfo slot, IBptContext context, ItemStack[] stacks) { - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < stacks.length; ++i) { - NBTTagCompound cpt = new NBTTagCompound(); - nbttaglist.appendTag(cpt); - ItemStack stack = stacks[i]; - - if (stack != null && stack.stackSize != 0) { - stack.writeToNBT(cpt); - context.storeId(stack.itemID); - } - } - - slot.cpt.setTag("inv", nbttaglist); - } - -} diff --git a/src/minecraft/buildcraft/api/blueprints/BptSlotInfo.java b/src/minecraft/buildcraft/api/blueprints/BptSlotInfo.java deleted file mode 100644 index 32d5962f8..000000000 --- a/src/minecraft/buildcraft/api/blueprints/BptSlotInfo.java +++ /dev/null @@ -1,55 +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.api.blueprints; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -/** - * This class records a slot, either from a blueprint or from a block placed in the world. - */ - -@Deprecated -public class BptSlotInfo { - - public int blockId = 0; - public int meta = 0; - public int x; - public int y; - public int z; - - /** - * This field contains requirements for a given block when stored in the blueprint. Modders can either rely on this list or compute their own int BptBlock. - */ - public LinkedList storedRequirements = new LinkedList(); - - /** - * This tree contains additional data to be stored in the blueprint. By default, it will be initialized from BptBlock.initializeFromWorld with the standard - * readNBT function of the corresponding tile (if any) and will be loaded from BptBlock.buildBlock using the standard writeNBT function. - */ - public NBTTagCompound cpt = new NBTTagCompound(); - - @Override - public BptSlotInfo clone() { - BptSlotInfo obj = new BptSlotInfo(); - - obj.x = x; - obj.y = y; - obj.z = z; - obj.blockId = blockId; - obj.meta = meta; - obj.cpt = (NBTTagCompound) cpt.copy(); - - return obj; - } - -} diff --git a/src/minecraft/buildcraft/api/blueprints/IBptContext.java b/src/minecraft/buildcraft/api/blueprints/IBptContext.java deleted file mode 100644 index 4b8c67158..000000000 --- a/src/minecraft/buildcraft/api/blueprints/IBptContext.java +++ /dev/null @@ -1,48 +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.api.blueprints; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import buildcraft.api.core.IBox; -import buildcraft.api.core.Position; - -/** - * This interface provide contextual information when building or initializing blueprint slots. - */ - -@Deprecated -public interface IBptContext { - - /** - * If bptItemStack is an ItemStack extracted from the blueprint containing this mapping, this will return an item stack with the id of the current world - */ - public ItemStack mapItemStack(ItemStack bptItemStack); - - /** - * Blueprints may be created in a world with a given id setting, and then ported to a world with different ids. Heuristics are used to retreive these new - * ids automatically. This interface provide services to map ids from a blueprints to current ids in the world, and should be used whenever storing block - * numbers or item stacks in blueprints.. - */ - public int mapWorldId(int bptWorldId); - - /** - * This asks the id mapping to store a mapping from this Id, which may be either an itemId or a blockId. In effect, the blueprint will record it and make it - * available upon blueprint load. Note that block present in the blueprint are automatically stored upon blueprint save, so this is really only needed when - * writing ids that are e.g. in inventory stacks. - */ - public void storeId(int worldId); - - public Position rotatePositionLeft(Position pos); - - public IBox surroundingBox(); - - public World world(); -} diff --git a/src/minecraft/buildcraft/api/blueprints/ItemSignature.java b/src/minecraft/buildcraft/api/blueprints/ItemSignature.java deleted file mode 100644 index d6bd03104..000000000 --- a/src/minecraft/buildcraft/api/blueprints/ItemSignature.java +++ /dev/null @@ -1,48 +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.api.blueprints; - -@Deprecated -public class ItemSignature { - - public String itemClassName; - public String itemName; - - public ItemSignature(String str) { - String[] values = str.split("/"); - - itemClassName = values[1]; - itemName = values[2]; - - replaceNullWithStar(); - - } - - public ItemSignature() { - replaceNullWithStar(); - } - - @Override - public String toString() { - replaceNullWithStar(); - - return "#I/" + itemClassName + "/" + itemName; - } - - public void replaceNullWithStar() { - if (itemClassName == null) { - itemClassName = "*"; - } - - if (itemName == null) { - itemName = "*"; - } - } -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockBed.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockBed.java deleted file mode 100644 index 904f1a9f7..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockBed.java +++ /dev/null @@ -1,87 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockBed extends BptBlock { - - public BptBlockBed(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if ((slot.meta & 8) == 0) { - requirements.add(new ItemStack(Item.bed)); - } - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int orientation = (slot.meta & 7); - int others = slot.meta - orientation; - - switch (orientation) { - case 0: - slot.meta = 1 + others; - break; - case 1: - slot.meta = 2 + others; - break; - case 2: - slot.meta = 3 + others; - break; - case 3: - slot.meta = 0 + others; - break; - } - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - if ((slot.meta & 8) != 0) - return; - - context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1); - - int x2 = slot.x; - int z2 = slot.z; - - switch (slot.meta) { - case 0: - z2++; - break; - case 1: - x2--; - break; - case 2: - z2--; - break; - case 3: - x2++; - break; - } - - context.world().setBlock(x2, slot.y, z2, slot.blockId, slot.meta + 8,1); - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return (slot.meta & 8) != 0; - } -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockCustomStack.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockCustomStack.java deleted file mode 100644 index 959b7ebad..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockCustomStack.java +++ /dev/null @@ -1,35 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockCustomStack extends BptBlock { - - final ItemStack customStack; - - public BptBlockCustomStack(int blockId, ItemStack customStack) { - super(blockId); - - this.customStack = customStack; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(customStack.copy()); - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockDelegate.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockDelegate.java deleted file mode 100644 index c6b5ad33c..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockDelegate.java +++ /dev/null @@ -1,66 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BlueprintManager; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockDelegate extends BptBlock { - - final int delegateTo; - - public BptBlockDelegate(int blockId, int delegateTo) { - super(blockId); - - this.delegateTo = delegateTo; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - BptSlotInfo newSlot = slot.clone(); - slot.blockId = delegateTo; - - if (BlueprintManager.blockBptProps[delegateTo] != null) { - BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements); - } else { - super.addRequirements(newSlot, context, requirements); - } - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - BptSlotInfo newSlot = slot.clone(); - slot.blockId = delegateTo; - - if (BlueprintManager.blockBptProps[delegateTo] != null) - return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context); - else - return super.isValid(newSlot, context); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - BptSlotInfo newSlot = slot.clone(); - slot.blockId = delegateTo; - - if (BlueprintManager.blockBptProps[delegateTo] != null) { - BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context); - } else { - super.rotateLeft(newSlot, context); - } - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockDirt.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockDirt.java deleted file mode 100644 index 61643d64f..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockDirt.java +++ /dev/null @@ -1,43 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockDirt extends BptBlock { - - public BptBlockDirt(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(Block.dirt)); - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - context.world().setBlock(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta,1); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - int id = context.world().getBlockId(slot.x, slot.y, slot.z); - - return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID; - } -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockDoor.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockDoor.java deleted file mode 100644 index ffd0bbefe..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockDoor.java +++ /dev/null @@ -1,72 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockDoor extends BptBlock { - - final ItemStack stack; - - public BptBlockDoor(int blockId, ItemStack stack) { - super(blockId); - - this.stack = stack; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if ((slot.meta & 8) == 0) { - requirements.add(stack.copy()); - } - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int orientation = (slot.meta & 3); - int others = slot.meta - orientation; - - switch (orientation) { - case 0: - slot.meta = 1 + others; - break; - case 1: - slot.meta = 2 + others; - break; - case 2: - slot.meta = 3 + others; - break; - case 3: - slot.meta = 0 + others; - break; - } - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return (slot.meta & 8) != 0; - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1); - context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1); - - context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8,1); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1); - - } -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockIgnore.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockIgnore.java deleted file mode 100644 index dd58463df..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockIgnore.java +++ /dev/null @@ -1,46 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockIgnore extends BptBlock { - - public BptBlockIgnore(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 0, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return true; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return true; - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java deleted file mode 100644 index 0e4904637..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java +++ /dev/null @@ -1,35 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockIgnoreMeta extends BptBlock { - - public BptBlockIgnoreMeta(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockInventory.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockInventory.java deleted file mode 100644 index e4ebf7092..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockInventory.java +++ /dev/null @@ -1,28 +0,0 @@ -package buildcraft.api.bptblocks; - -import net.minecraft.inventory.IInventory; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockInventory extends BptBlock { - - public BptBlockInventory(int blockId) { - super(blockId); - - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - super.buildBlock(slot, context); - - IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); - - for (int i = 0; i < inv.getSizeInventory(); ++i) { - inv.setInventorySlotContents(i, null); - } - - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockLever.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockLever.java deleted file mode 100644 index 0a1eab231..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockLever.java +++ /dev/null @@ -1,39 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockLever extends BptBlockWallSide { - - public BptBlockLever(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int status = slot.meta - (slot.meta & 7); - - slot.meta -= status; - super.rotateLeft(slot, context); - slot.meta += status; - - } -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockLiquid.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockLiquid.java deleted file mode 100644 index 49172957e..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockLiquid.java +++ /dev/null @@ -1,62 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockLiquid extends BptBlock { - - private final ItemStack bucketStack; - - public BptBlockLiquid(int blockId, ItemStack bucketStack) { - super(blockId); - - this.bucketStack = bucketStack; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if (slot.meta == 0) { - requirements.add(bucketStack.copy()); - } - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - if (slot.meta == 0) - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0; - else - return true; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return slot.meta != 0; - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - if (slot.meta == 0) { - context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1); - } - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockPiston.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockPiston.java deleted file mode 100644 index b12693bdd..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockPiston.java +++ /dev/null @@ -1,29 +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.api.bptblocks; - -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockPiston extends BptBlockRotateMeta { - - public BptBlockPiston(int blockId) { - super(blockId, new int[] { 2, 5, 3, 4 }, true); - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - int meta = slot.meta & 7; - - context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, meta,1); - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockPumpkin.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockPumpkin.java deleted file mode 100644 index 43473f983..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockPumpkin.java +++ /dev/null @@ -1,54 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockPumpkin extends BptBlock { - - public BptBlockPumpkin(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - switch (slot.meta) { - case 0: - slot.meta = 1; - break; - case 1: - slot.meta = 2; - break; - case 2: - slot.meta = 3; - break; - case 3: - slot.meta = 0; - break; - } - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java deleted file mode 100644 index 67ca97c36..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java +++ /dev/null @@ -1,51 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockRedstoneRepeater extends BptBlock { - - public BptBlockRedstoneRepeater(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(Item.redstoneRepeater)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int step = slot.meta - (slot.meta & 3); - - switch (slot.meta - step) { - case 0: - slot.meta = 1 + step; - break; - case 1: - slot.meta = 2 + step; - break; - case 2: - slot.meta = 3 + step; - break; - case 3: - slot.meta = 0 + step; - break; - } - } -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockRotateInventory.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockRotateInventory.java deleted file mode 100644 index 319fcf7e7..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockRotateInventory.java +++ /dev/null @@ -1,27 +0,0 @@ -package buildcraft.api.bptblocks; - -import net.minecraft.inventory.IInventory; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockRotateInventory extends BptBlockRotateMeta { - - public BptBlockRotateInventory(int blockId, int[] rotations, boolean rotateForward) { - super(blockId, rotations, rotateForward); - - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - super.buildBlock(slot, context); - - IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); - - for (int i = 0; i < inv.getSizeInventory(); ++i) { - inv.setInventorySlotContents(i, null); - } - - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockRotateMeta.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockRotateMeta.java deleted file mode 100644 index eb846df5d..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockRotateMeta.java +++ /dev/null @@ -1,85 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockRotateMeta extends BptBlock { - - int[] rot; - boolean rotateForward; - - int infoMask = 0; - - public BptBlockRotateMeta(int blockId, int[] rotations, boolean rotateForward) { - super(blockId); - - rot = rotations; - - for (int i = 0; i < rot.length; ++i) { - if (rot[i] < 4) { - infoMask = (infoMask < 3 ? 3 : infoMask); - } else if (rot[i] < 8) { - infoMask = (infoMask < 7 ? 7 : infoMask); - } else if (rot[i] < 16) { - infoMask = (infoMask < 15 ? 15 : infoMask); - } - } - - this.rotateForward = rotateForward; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int pos = slot.meta & infoMask; - int others = slot.meta - pos; - - if (rotateForward) { - if (pos == rot[0]) { - pos = rot[1]; - } else if (pos == rot[1]) { - pos = rot[2]; - } else if (pos == rot[2]) { - pos = rot[3]; - } else if (pos == rot[3]) { - pos = rot[0]; - } - } else { - if (pos == rot[0]) { - pos = rot[3]; - } else if (pos == rot[1]) { - pos = rot[2]; - } else if (pos == rot[2]) { - pos = rot[0]; - } else if (pos == rot[3]) { - pos = rot[1]; - } - } - - slot.meta = pos + others; - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockSign.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockSign.java deleted file mode 100644 index 84a3996a9..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockSign.java +++ /dev/null @@ -1,65 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BlockSignature; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockSign extends BptBlock { - - boolean isWall; - - public BptBlockSign(int blockId, boolean isWall) { - super(blockId); - - this.isWall = isWall; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(Item.sign)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - if (!isWall) { - double angle = ((slot.meta) * 360.0) / 16.0; - angle += 90.0; - if (angle >= 360) { - angle -= 360; - } - slot.meta = (int) (angle / 360.0 * 16.0); - } else { - // slot.meta = ForgeDirection.values()[slot.meta].rotateLeft().ordinal(); - } - } - - @Override - public BlockSignature getSignature(Block block) { - BlockSignature sig = super.getSignature(block); - - if (isWall) { - sig.customField = "wall"; - } else { - sig.customField = "floor"; - } - - return sig; - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockStairs.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockStairs.java deleted file mode 100644 index 8ade4a4df..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockStairs.java +++ /dev/null @@ -1,54 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockStairs extends BptBlock { - - public BptBlockStairs(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - switch (slot.meta) { - case 0: - slot.meta = 2; - break; - case 1: - slot.meta = 3; - break; - case 2: - slot.meta = 1; - break; - case 3: - slot.meta = 0; - break; - } - } - -} diff --git a/src/minecraft/buildcraft/api/bptblocks/BptBlockWallSide.java b/src/minecraft/buildcraft/api/bptblocks/BptBlockWallSide.java deleted file mode 100644 index 8178d0f18..000000000 --- a/src/minecraft/buildcraft/api/bptblocks/BptBlockWallSide.java +++ /dev/null @@ -1,53 +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.api.bptblocks; - -import java.util.LinkedList; - -import net.minecraft.item.ItemStack; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockWallSide extends BptBlock { - - public BptBlockWallSide(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - final int XPos = 2; - final int XNeg = 1; - final int ZPos = 4; - final int ZNeg = 3; - - switch (slot.meta) { - case XPos: - slot.meta = ZPos; - break; - case ZNeg: - slot.meta = XPos; - break; - case XNeg: - slot.meta = ZNeg; - break; - case ZPos: - slot.meta = XNeg; - break; - } - } -}