diff --git a/src/api/java/buildcraft/api/blocks/IColorRemovable.java b/src/api/java/buildcraft/api/blocks/IColorRemovable.java deleted file mode 100755 index 6833da4db..000000000 --- a/src/api/java/buildcraft/api/blocks/IColorRemovable.java +++ /dev/null @@ -1,9 +0,0 @@ -package buildcraft.api.blocks; - -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -public interface IColorRemovable { - boolean removeColorFromBlock(World world, BlockPos pos, EnumFacing facing); -} diff --git a/src/api/java/buildcraft/api/blocks/package-info.java b/src/api/java/buildcraft/api/blocks/package-info.java deleted file mode 100755 index c3bc6eac1..000000000 --- a/src/api/java/buildcraft/api/blocks/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|blocks") -package buildcraft.api.blocks; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/blueprints/BlueprintDeployer.java b/src/api/java/buildcraft/api/blueprints/BlueprintDeployer.java deleted file mode 100755 index dad91b98f..000000000 --- a/src/api/java/buildcraft/api/blueprints/BlueprintDeployer.java +++ /dev/null @@ -1,30 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.io.File; - -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -/** This class is provided as a utility class for third-party mods that would like to easily deploy structures that are - * written in blueprints. It does not offer control on material that needs to get in, or how the structure is deployed, - * but allows to create contents of a blueprint in one cycle. Note that these functionalities will only work if - * BuildCraft is installed. */ -public abstract class BlueprintDeployer { - - /** The deployed instantiated by BuildCraft. This is set by the BuildCraft builder mod. Mods that want to work with - * BuildCraft not installed should check for this value to be not null. */ - public static BlueprintDeployer instance; - - /** Deploy the contents of the blueprints as if the builder was located at {pos} facing the direction dir. */ - public abstract void deployBlueprint(World world, BlockPos pos, EnumFacing facing, File file); - - /** Deploy the contents of the byte array as if the builder was located at {pos} facing the direction dir. */ - - public abstract void deployBlueprintFromFileStream(World world, BlockPos pos, EnumFacing dir, byte[] data); - -} diff --git a/src/api/java/buildcraft/api/blueprints/BuilderAPI.java b/src/api/java/buildcraft/api/blueprints/BuilderAPI.java deleted file mode 100755 index bbe10af37..000000000 --- a/src/api/java/buildcraft/api/blueprints/BuilderAPI.java +++ /dev/null @@ -1,15 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -public final class BuilderAPI { - public static ISchematicRegistry schematicRegistry; - public static ISchematicHelper schematicHelper; - - public static final int BREAK_ENERGY = 160; - public static final int BUILD_ENERGY = 240; - - private BuilderAPI() {} -} diff --git a/src/api/java/buildcraft/api/blueprints/BuildingPermission.java b/src/api/java/buildcraft/api/blueprints/BuildingPermission.java deleted file mode 100755 index 8661240c4..000000000 --- a/src/api/java/buildcraft/api/blueprints/BuildingPermission.java +++ /dev/null @@ -1,21 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -/** Schematics recorded in the blueprints can restrict situations where a blueprint can be used. A same schematic class - * can have different permissions depending on its contents. It's particularly useful when fixing a schematic, if - * blueprints that saved the previous version should not be built because of a bug (such as dupe bug on inventories). */ -public enum BuildingPermission { - /** No restrictions, blueprints using this schematic are good in all contexts. */ - ALL, - - /** This blueprints containing this schematic can only be used in creative. Maybe the block can't be crafted in - * survival in the first place, or the content of the schematic is known to have dupe bugs. */ - CREATIVE_ONLY, - - /** Blueprints containing this schematic should not be built. This is typically used when a critical problems have - * been fixed, but older versions of the schematic are too badly broken to be retreived. */ - NONE, -} diff --git a/src/api/java/buildcraft/api/blueprints/IBuilderContext.java b/src/api/java/buildcraft/api/blueprints/IBuilderContext.java deleted file mode 100755 index e5eb8900b..000000000 --- a/src/api/java/buildcraft/api/blueprints/IBuilderContext.java +++ /dev/null @@ -1,22 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; - -import buildcraft.api.core.IBox; - -/** This interface provide contextual information when building or initializing blueprint slots. */ -public interface IBuilderContext { - - Vec3d rotatePositionLeft(Vec3d pos); - - IBox surroundingBox(); - - World world(); - - MappingRegistry getMappingRegistry(); -} diff --git a/src/api/java/buildcraft/api/blueprints/ISchematicHelper.java b/src/api/java/buildcraft/api/blueprints/ISchematicHelper.java deleted file mode 100755 index 7327f2e20..000000000 --- a/src/api/java/buildcraft/api/blueprints/ISchematicHelper.java +++ /dev/null @@ -1,7 +0,0 @@ -package buildcraft.api.blueprints; - -import net.minecraft.item.ItemStack; - -public interface ISchematicHelper { - boolean isEqualItem(ItemStack a, ItemStack b); -} diff --git a/src/api/java/buildcraft/api/blueprints/ISchematicRegistry.java b/src/api/java/buildcraft/api/blueprints/ISchematicRegistry.java deleted file mode 100755 index 503c315d5..000000000 --- a/src/api/java/buildcraft/api/blueprints/ISchematicRegistry.java +++ /dev/null @@ -1,19 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; - -public interface ISchematicRegistry { - void registerSchematicBlock(Block block, Class clazz, Object... params); - - void registerSchematicBlock(IBlockState state, Class clazz, Object... params); - - void registerSchematicEntity(Class entityClass, Class schematicClass, Object... params); - - boolean isSupported(IBlockState state); -} diff --git a/src/api/java/buildcraft/api/blueprints/ITileBuilder.java b/src/api/java/buildcraft/api/blueprints/ITileBuilder.java deleted file mode 100755 index 2c06f64c3..000000000 --- a/src/api/java/buildcraft/api/blueprints/ITileBuilder.java +++ /dev/null @@ -1,13 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import net.minecraft.inventory.IInventory; - -public interface ITileBuilder extends IInventory { - - boolean isBuildingMaterialSlot(int i); - -} diff --git a/src/api/java/buildcraft/api/blueprints/MappingNotFoundException.java b/src/api/java/buildcraft/api/blueprints/MappingNotFoundException.java deleted file mode 100755 index f84cee627..000000000 --- a/src/api/java/buildcraft/api/blueprints/MappingNotFoundException.java +++ /dev/null @@ -1,13 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -public class MappingNotFoundException extends Exception { - private static final long serialVersionUID = 1L; - - public MappingNotFoundException(String msg) { - super(msg); - } -} diff --git a/src/api/java/buildcraft/api/blueprints/MappingRegistry.java b/src/api/java/buildcraft/api/blueprints/MappingRegistry.java deleted file mode 100755 index 4bdddb1c4..000000000 --- a/src/api/java/buildcraft/api/blueprints/MappingRegistry.java +++ /dev/null @@ -1,426 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map.Entry; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -import org.apache.logging.log4j.Level; - -import net.minecraft.block.Block; -import net.minecraft.crash.CrashReportCategory; -import net.minecraft.entity.Entity; -import net.minecraft.item.Item; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.util.ResourceLocation; - -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fml.common.FMLModContainer; -import net.minecraftforge.fml.common.Loader; -import net.minecraftforge.fml.common.ModContainer; -import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; -import net.minecraftforge.fml.common.registry.GameRegistry; - -import buildcraft.api.core.BCLog; - -// Deprecated as NBT will be saved in a compressing format rather than only for blocks, items and entities. -@Deprecated -public class MappingRegistry { - - public HashMap blockToId = new HashMap(); - public ArrayList idToBlock = new ArrayList(); - - public HashMap itemToId = new HashMap(); - public ArrayList idToItem = new ArrayList(); - - public HashMap, Integer> entityToId = new HashMap, Integer>(); - public ArrayList> idToEntity = new ArrayList>(); - - private void registerItem(Item item) { - if (item == null) throw new IllegalArgumentException("Cannot register a null item!"); - if (!itemToId.containsKey(item)) { - idToItem.add(item); - itemToId.put(item, idToItem.size() - 1); - } - } - - private void registerBlock(Block block) { - if (block == null) throw new IllegalArgumentException("Cannot register a null block!"); - if (!blockToId.containsKey(block)) { - idToBlock.add(block); - blockToId.put(block, idToBlock.size() - 1); - } - } - - private void registerEntity(Class entityClass) { - if (entityClass == null) throw new IllegalArgumentException("Cannot register a null entityClass!"); - if (!entityToId.containsKey(entityClass)) { - idToEntity.add(entityClass); - entityToId.put(entityClass, idToEntity.size() - 1); - } - } - - public Item getItemForId(int id) throws MappingNotFoundException { - if (id >= idToItem.size()) { - throw new MappingNotFoundException("no item mapping at position " + id); - } - - Item result = idToItem.get(id); - - if (result == null) { - throw new MappingNotFoundException("no item mapping at position " + id); - } else { - return result; - } - } - - public int getIdForItem(Item item) { - if (item == null) throw new NullPointerException("item"); - if (!itemToId.containsKey(item)) { - registerItem(item); - } - - return itemToId.get(item); - } - - public int itemIdToRegistry(int id) { - Item item = Item.getItemById(id); - - return getIdForItem(item); - } - - public ResourceLocation itemIdToWorld(int id) throws MappingNotFoundException { - Item item = getItemForId(id); - - return Item.REGISTRY.getNameForObject(item); - } - - public Block getBlockForId(int id) throws MappingNotFoundException { - if (id >= idToBlock.size()) { - throw new MappingNotFoundException("no block mapping at position " + id); - } - - Block result = idToBlock.get(id); - - if (result == null) { - throw new MappingNotFoundException("no block mapping at position " + id); - } else { - return result; - } - } - - public int getIdForBlock(Block block) { - if (!blockToId.containsKey(block)) { - registerBlock(block); - } - - return blockToId.get(block); - } - - public int blockIdToRegistry(int id) { - Block block = Block.getBlockById(id); - - return getIdForBlock(block); - } - - public ResourceLocation blockIdToWorld(int id) throws MappingNotFoundException { - Block block = getBlockForId(id); - - return Block.REGISTRY.getNameForObject(block); - } - - public Class getEntityForId(int id) throws MappingNotFoundException { - if (id >= idToEntity.size()) { - throw new MappingNotFoundException("no entity mapping at position " + id); - } - - Class result = idToEntity.get(id); - - if (result == null) { - throw new MappingNotFoundException("no entity mapping at position " + id); - } else { - return result; - } - } - - public int getIdForEntity(Class entity) { - if (!entityToId.containsKey(entity)) { - registerEntity(entity); - } - - return entityToId.get(entity); - } - - /** Relocates a stack nbt from the registry referential to the world referential. */ - public void stackToWorld(NBTTagCompound nbt) throws MappingNotFoundException { - // 1.7.10 back-compat - if (nbt.hasKey("id", Constants.NBT.TAG_SHORT)) { - Item item = getItemForId(nbt.getShort("id")); - nbt.setString("id", (Item.REGISTRY.getNameForObject(item).toString())); - } - } - - // versions before 1.8 saved stacks with an Item ID as a short - private boolean isOldStackLayout(NBTTagCompound nbt) { - return nbt.hasKey("id") && nbt.hasKey("Count") && nbt.hasKey("Damage") && nbt.getTag("id") instanceof NBTTagShort && nbt.getTag( - "Count") instanceof NBTTagByte && nbt.getTag("Damage") instanceof NBTTagShort; - } - - // 1.7.10 Back compat - public void scanAndTranslateStacksToWorld(NBTTagCompound nbt) throws MappingNotFoundException { - // First, check if this nbt is itself a stack - - if (isOldStackLayout(nbt)) { - stackToWorld(nbt); - } - - // Then, look at the nbt compound contained in this nbt (even if it's a - // stack) and checks for stacks in it. - for (String key : (Collection) nbt.getKeySet()) { - if (nbt.getTag(key) instanceof NBTTagCompound) { - try { - scanAndTranslateStacksToWorld(nbt.getCompoundTag(key)); - } catch (MappingNotFoundException e) { - nbt.removeTag(key); - } - } - - if (nbt.getTag(key) instanceof NBTTagList) { - NBTTagList list = (NBTTagList) nbt.getTag(key); - - if (list.getTagType() == Constants.NBT.TAG_COMPOUND) { - for (int i = list.tagCount() - 1; i >= 0; --i) { - try { - scanAndTranslateStacksToWorld(list.getCompoundTagAt(i)); - } catch (MappingNotFoundException e) { - list.removeTag(i); - } - } - } - } - } - } - - public void write(NBTTagCompound nbt) { - NBTTagList blocksMapping = new NBTTagList(); - - for (Block b : idToBlock) { - NBTTagCompound sub = new NBTTagCompound(); - if (b != null) { - Object obj = Block.REGISTRY.getNameForObject(b); - if (obj == null) { - BCLog.logger.error("Block " + b.getUnlocalizedName() + " (" + b.getClass().getName() - + ") does not have a registry name! This is a bug!"); - } else { - String name = obj.toString(); - if (name == null || name.length() == 0) { - BCLog.logger.error("Block " + b.getUnlocalizedName() + " (" + b.getClass().getName() - + ") has an empty registry name! This is a bug!"); - } else { - sub.setString("name", name); - } - } - } else { - throw new IllegalArgumentException("Found a null block!"); - } - blocksMapping.appendTag(sub); - } - - nbt.setTag("blocksMapping", blocksMapping); - - NBTTagList itemsMapping = new NBTTagList(); - - for (Item i : idToItem) { - NBTTagCompound sub = new NBTTagCompound(); - if (i != null) { - ResourceLocation obj = Item.REGISTRY.getNameForObject(i); - if (obj == null) { - BCLog.logger.error("Item " + i.getUnlocalizedName() + " (" + i.getClass().getName() - + ") does not have a registry name! This is a bug!"); - } else { - String name = obj.toString(); - if (name == null || name.length() == 0) { - BCLog.logger.error("Item " + i.getUnlocalizedName() + " (" + i.getClass().getName() - + ") has an empty registry name! This is a bug!"); - } else { - sub.setString("name", name); - } - } - } else { - throw new IllegalArgumentException("Found a null item!"); - } - itemsMapping.appendTag(sub); - } - - nbt.setTag("itemsMapping", itemsMapping); - - NBTTagList entitiesMapping = new NBTTagList(); - - for (Class e : idToEntity) { - NBTTagCompound sub = new NBTTagCompound(); - sub.setString("name", e.getCanonicalName()); - entitiesMapping.appendTag(sub); - } - - nbt.setTag("entitiesMapping", entitiesMapping); - - // System.out.println("[W] idToItem size : " + idToItem.size()); - // for (Item i : idToItem) { - // System.out.println("- " + (i != null ? i.toString() : "null")); - // } - } - - private Object getMissingMappingFromFML(boolean isBlock, String name, int i) { - ResourceLocation location = new ResourceLocation(name); - String modName = name.split(":")[0]; - if (Loader.isModLoaded(modName)) { - try { - FMLMissingMappingsEvent.MissingMapping mapping = new FMLMissingMappingsEvent.MissingMapping(isBlock ? GameRegistry.Type.BLOCK - : GameRegistry.Type.ITEM, location, i); - ListMultimap missingMapping = ArrayListMultimap.create(); - missingMapping.put(modName, mapping); - FMLMissingMappingsEvent event = new FMLMissingMappingsEvent(missingMapping); - for (ModContainer container : Loader.instance().getModList()) { - if (container instanceof FMLModContainer) { - event.applyModContainer(container); - ((FMLModContainer) container).handleModStateEvent(event); - if (mapping.getAction() != FMLMissingMappingsEvent.Action.DEFAULT) { - break; - } - } - } - if (mapping.getAction() == FMLMissingMappingsEvent.Action.REMAP) { - return mapping.getTarget(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - return null; - } - - public void read(NBTTagCompound nbt) { - NBTTagList blocksMapping = nbt.getTagList("blocksMapping", Constants.NBT.TAG_COMPOUND); - - for (int i = 0; i < blocksMapping.tagCount(); ++i) { - NBTTagCompound sub = blocksMapping.getCompoundTagAt(i); - if (!sub.hasKey("name")) { - // Keeping the order correct - idToBlock.add(null); - BCLog.logger.log(Level.WARN, "Can't load a block - corrupt blueprint!"); - continue; - } - String name = sub.getString("name"); - ResourceLocation location = new ResourceLocation(name); - Block b = null; - - if (!Block.REGISTRY.containsKey(location) && name.contains(":")) { - b = (Block) getMissingMappingFromFML(true, name, i); - if (b != null) { - BCLog.logger.info("Remapped " + name + " to " + Block.REGISTRY.getNameForObject(b)); - } - } - - if (b == null && Block.REGISTRY.containsKey(location)) { - b = (Block) Block.REGISTRY.getObject(location); - } - - if (b != null) { - registerBlock(b); - } else { - // Keeping the order correct - idToBlock.add(null); - BCLog.logger.log(Level.WARN, "Can't load block " + name); - } - } - - NBTTagList itemsMapping = nbt.getTagList("itemsMapping", Constants.NBT.TAG_COMPOUND); - - for (int i = 0; i < itemsMapping.tagCount(); ++i) { - NBTTagCompound sub = itemsMapping.getCompoundTagAt(i); - if (!sub.hasKey("name")) { - // Keeping the order correct - idToItem.add(null); - BCLog.logger.log(Level.WARN, "Can't load an item - corrupt blueprint!"); - continue; - } - - String name = sub.getString("name"); - ResourceLocation location = new ResourceLocation(name); - Item item = null; - - if (!Item.REGISTRY.containsKey(location) && name.contains(":")) { - item = (Item) getMissingMappingFromFML(false, name, i); - if (item != null) { - BCLog.logger.info("Remapped " + name + " to " + Item.REGISTRY.getNameForObject(item)); - } - } - - if (item == null && Item.REGISTRY.containsKey(location)) { - item = (Item) Item.REGISTRY.getObject(location); - } - - if (item != null) { - registerItem(item); - } else { - // Keeping the order correct - idToItem.add(null); - BCLog.logger.log(Level.WARN, "Can't load item " + name); - } - } - - NBTTagList entitiesMapping = nbt.getTagList("entitiesMapping", Constants.NBT.TAG_COMPOUND); - - for (int i = 0; i < entitiesMapping.tagCount(); ++i) { - NBTTagCompound sub = entitiesMapping.getCompoundTagAt(i); - String name = sub.getString("name"); - Class e = null; - - try { - e = (Class) Class.forName(name); - } catch (ClassNotFoundException e1) { - e1.printStackTrace(); - } - - if (e != null) { - registerEntity(e); - } else { - // Keeping the order correct - idToEntity.add(null); - BCLog.logger.log(Level.WARN, "Can't load entity " + name); - } - } - - // System.out.println("[R] idToItem size : " + idToItem.size()); - // for (Item i : idToItem) { - // System.out.println("- " + (i != null ? i.toString() : "null")); - // } - } - - public void addToCrashReport(CrashReportCategory cat) { - cat.addCrashSection("Item Map Count", itemToId.size()); - for (Entry e : itemToId.entrySet()) { - cat.addCrashSection(" - ID " + e.getValue(), Item.REGISTRY.getNameForObject(e.getKey())); - } - - cat.addCrashSection("Block Map Count", blockToId.size()); - for (Entry e : blockToId.entrySet()) { - cat.addCrashSection(" - ID " + e.getValue(), Block.REGISTRY.getNameForObject(e.getKey())); - } - - cat.addCrashSection("Entity Map Count", entityToId.size()); - for (Entry, Integer> e : entityToId.entrySet()) { - cat.addCrashSection(" - ID " + e.getValue(), e.getKey()); - } - } -} diff --git a/src/api/java/buildcraft/api/blueprints/Schematic.java b/src/api/java/buildcraft/api/blueprints/Schematic.java deleted file mode 100755 index c246a7104..000000000 --- a/src/api/java/buildcraft/api/blueprints/Schematic.java +++ /dev/null @@ -1,195 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; - -import buildcraft.api.core.IInvSlot; - -/** A schematic is a piece of a blueprint. It allows to stock blocks or entities to blueprints, and can have a state - * that moves from a blueprint referential to a world referential. Although default schematic behavior will be OK for a - * lot of objects, specific blocks and entities may be associated with a dedicated schematic class, which will be - * instantiated automatically. - * - * Schematic perform "id translation" in case the block ids between a blueprint and the world installation are - * different. Mapping is done through the builder context. - * - * Detailed documentation on the schematic behavior can be found on - * http://www.mod-buildcraft.com/wiki/doku.php?id=builder_support - * - * Example of schematics for minecraft blocks are available in the package buildcraft.core.schematics. */ -public abstract class Schematic { - /** Blocks are build in various stages, in order to make sure that a block can indeed be placed, and that it's - * unlikely to disturb other blocks. */ - public enum BuildingStage { - /** Standalone blocks do not change once placed. */ - STANDALONE, - - /** Expanding blocks will grow and may disturb other block locations, like liquids. */ - EXPANDING - } - - /** This is called to verify whether the required item is equal to the supplied item. - * - * Primarily rely on this for checking metadata/NBT - the item ID itself might have been filtered out by previously - * running code. */ - public boolean isItemMatchingRequirement(ItemStack suppliedStack, ItemStack requiredStack) { - return BuilderAPI.schematicHelper.isEqualItem(suppliedStack, requiredStack); - } - - /** This is called each time an item matches a requirement. By default, it will increase damage of items that can be - * damaged by the amount of the requirement, and remove the intended amount of items that can't be damaged. - * - * Client may override this behavior. 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 fulfilled, and once with the - * real inventory. Implementer is responsible for updating req (with the remaining requirements if any) and slot - * (after usage). - * - * returns what was used (similar to req, but created from slot, so that any NBT based differences are drawn from - * the correct source) */ - public ItemStack useItem(IBuilderContext context, ItemStack req, IInvSlot slot) { - ItemStack stack = slot.getStackInSlot(); - 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()) { - slot.decreaseStackInSlot(1); - } - } 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.stackSize = 1; - if (stack.getItem().hasContainerItem(stack)) { - ItemStack newStack = stack.getItem().getContainerItem(stack); - slot.setStackInSlot(newStack); - } else { - slot.setStackInSlot(null); - } - } - - return result; - } - - /** Perform a 90 degree rotation to the slot. */ - public void rotateLeft(IBuilderContext context) { - - } - - /** Applies translations to all positions in the schematic to center in the blueprint referential */ - public void translateToBlueprint(Vec3d transform) { - - } - - /** Apply translations to all positions in the schematic to center in the builder referential */ - public void translateToWorld(Vec3d transform) {} - - /** Translates blocks and item ids to the blueprint referential */ - public void idsToBlueprint(MappingRegistry registry) {} - - /** Translates blocks and item ids to the world referential */ - public void idsToWorld(MappingRegistry registry) {} - - /** Initializes a schematic for blueprint according to an objet placed on {x, y, z} on the world. For blocks, block - * and meta fields will be initialized automatically. */ - public void initializeFromObjectAt(IBuilderContext context, BlockPos pos) {} - - /** Places the block in the world, at the location specified in the slot, using the stack in parameters */ - public void placeInWorld(IBuilderContext context, BlockPos pos, List stacks) {} - - /** Write specific requirements coming from the world to the blueprint. */ - public void storeRequirements(IBuilderContext context, BlockPos pos) {} - - /** 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 writeToWorld. */ - public void getRequirementsForPlacement(IBuilderContext context, List requirements) {} - - /** Returns the amount of energy required to build this slot, depends on the stacks selected for the build. */ - public int getEnergyRequirement(List stacksUsed) { - int result = 0; - - if (stacksUsed != null) { - for (ItemStack s : stacksUsed) { - result += s.stackSize * BuilderAPI.BUILD_ENERGY; - } - } - - return result; - } - - /** Returns the flying stacks to display in the builder animation. */ - public List getStacksToDisplay(List stackConsumed) { - return stackConsumed; - } - - /** Return the stage where this schematic has to be built. */ - public BuildingStage getBuildStage() { - return BuildingStage.STANDALONE; - } - - /** 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. - * - * Post processing will be called on these blocks. */ - public boolean isAlreadyBuilt(IBuilderContext context, BlockPos pos) { - return true; - } - - /** 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. - * - * Post processing will be called on these blocks. */ - public boolean doNotBuild() { - return false; - } - - /** Return true if the schematic should not be used at all. This is computed straight after readFromNBT can be used - * to deactivate schematics in which an inconsistency is detected. It will be considered as a block of air instead. - * - * Post processing will *not* be called on these blocks. */ - public boolean doNotUse() { - return false; - } - - /** Return the maximium building permission for blueprint containing this schematic. */ - public BuildingPermission getBuildingPermission() { - return BuildingPermission.ALL; - } - - /** 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(IBuilderContext context, BlockPos pos) {} - - /** Saves this schematic to the blueprint NBT. */ - public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) {} - - /** Loads this schematic from the blueprint NBT. */ - public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) {} - - /** Returns the number of cycles to wait after building this schematic. Tiles and entities typically require more - * wait, around 5 cycles. */ - public int buildTime() { - return 1; - } -} diff --git a/src/api/java/buildcraft/api/blueprints/SchematicBlock.java b/src/api/java/buildcraft/api/blueprints/SchematicBlock.java deleted file mode 100755 index 952797d19..000000000 --- a/src/api/java/buildcraft/api/blueprints/SchematicBlock.java +++ /dev/null @@ -1,195 +0,0 @@ -/** Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.*; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFalling; -import net.minecraft.block.BlockLiquid; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.Rotation; -import net.minecraft.util.math.BlockPos; - -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fluids.BlockFluidBase; - -import buildcraft.api.core.BCLog; - -public class SchematicBlock extends SchematicBlockBase { - public IBlockState state = null; - public BuildingPermission defaultPermission = BuildingPermission.ALL; - - /** 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 Schematic. */ - public ItemStack[] storedRequirements = new ItemStack[0]; - - private boolean doNotUse = false; - - @Override - public void getRequirementsForPlacement(IBuilderContext context, List requirements) { - if (state != null) { - if (storedRequirements.length != 0) { - Collections.addAll(requirements, storedRequirements); - } else { - requirements.add(getItemStack(state)); - } - } - } - - @Override - public boolean isAlreadyBuilt(IBuilderContext context, BlockPos pos) { - IBlockState placed = context.world().getBlockState(pos); - if (state == placed) return true; - if (state.getBlock() != placed.getBlock()) return false; - // This fixes bugs with blocks like stairs that return extra properties that were not visible from the meta. - if (state.getBlock().getMetaFromState(state) == placed.getBlock().getMetaFromState(placed)) return true; - return false; - } - - @Override - public void placeInWorld(IBuilderContext context, BlockPos pos, List stacks) { - super.placeInWorld(context, pos, stacks); - - this.setBlockInWorld(context, pos); - } - - @Override - public void storeRequirements(IBuilderContext context, BlockPos pos) { - super.storeRequirements(context, pos); - - if (state != null) { - List req = state.getBlock().getDrops(context.world(), pos, state, 0); - - if (req != null) { - storedRequirements = new ItemStack[req.size()]; - req.toArray(storedRequirements); - } - } - } - - @Override - public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) { - super.writeSchematicToNBT(nbt, registry); - - writeBlockToNBT(nbt, registry); - writeRequirementsToNBT(nbt, registry); - } - - @Override - public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) { - super.readSchematicFromNBT(nbt, registry); - - readBlockFromNBT(nbt, registry); - if (!doNotUse()) { - readRequirementsFromNBT(nbt, registry); - } - } - - /** Get a list of relative block coordinates which have to be built before this block can be placed. */ - public Set getPrerequisiteBlocks(IBuilderContext context) { - Set indexes = new HashSet(); - if (state.getBlock() instanceof BlockFalling) { - indexes.add(new BlockPos(0, -1, 0)); - } - return indexes; - } - - @Override - public BuildingStage getBuildStage() { - if (state.getBlock() instanceof BlockFluidBase || state.getBlock() instanceof BlockLiquid) { - return BuildingStage.EXPANDING; - } else { - return BuildingStage.STANDALONE; - } - } - - @Override - public BuildingPermission getBuildingPermission() { - return defaultPermission; - } - - // Utility functions - protected void setBlockInWorld(IBuilderContext context, BlockPos pos) { - context.world().setBlockState(pos, state, 3); - } - - @Override - public boolean doNotUse() { - return doNotUse; - } - - protected void readBlockFromNBT(NBTTagCompound nbt, MappingRegistry registry) { - try { - Block block = registry.getBlockForId(nbt.getInteger("blockId")); - state = block.getStateFromMeta(nbt.getInteger("blockMeta")); - } catch (MappingNotFoundException e) { - BCLog.logger.info(e); - doNotUse = true; - } - } - - protected void readRequirementsFromNBT(NBTTagCompound nbt, MappingRegistry registry) { - if (nbt.hasKey("rq")) { - NBTTagList rq = nbt.getTagList("rq", Constants.NBT.TAG_COMPOUND); - - ArrayList rqs = new ArrayList(); - for (int i = 0; i < rq.tagCount(); ++i) { - try { - NBTTagCompound sub = rq.getCompoundTagAt(i); - registry.stackToWorld(sub); - rqs.add(ItemStack.loadItemStackFromNBT(sub)); - } catch (MappingNotFoundException e) { - defaultPermission = BuildingPermission.CREATIVE_ONLY; - } catch (Throwable t) { - t.printStackTrace(); - defaultPermission = BuildingPermission.CREATIVE_ONLY; - } - } - - storedRequirements = rqs.toArray(new ItemStack[rqs.size()]); - } else { - storedRequirements = new ItemStack[0]; - } - } - - protected void writeBlockToNBT(NBTTagCompound nbt, MappingRegistry registry) { - nbt.setInteger("blockId", registry.getIdForBlock(state.getBlock())); - nbt.setInteger("blockMeta", state.getBlock().getMetaFromState(state)); - } - - protected void writeRequirementsToNBT(NBTTagCompound nbt, MappingRegistry registry) { - if (storedRequirements.length > 0) { - NBTTagList rq = new NBTTagList(); - - for (ItemStack stack : storedRequirements) { - if (stack == null || stack.getItem() == null) throw new IllegalStateException("Found a null requirement! " + getClass()); - NBTTagCompound sub = new NBTTagCompound(); - stack.writeToNBT(sub); - rq.appendTag(sub); - } - - nbt.setTag("rq", rq); - } - } - - protected ItemStack getItemStack(IBlockState state, int quantity) { - return new ItemStack(state.getBlock(), quantity, state.getBlock().damageDropped(state)); - } - - protected ItemStack getItemStack(IBlockState state) { - return getItemStack(state, 1); - } - - // Pretty much all blocks (that rotate) rotate this way now - @Override - public void rotateLeft(IBuilderContext context) { - // FIXME: This might be the wrong way - state = state.withRotation(Rotation.CLOCKWISE_90); - } -} diff --git a/src/api/java/buildcraft/api/blueprints/SchematicBlockBase.java b/src/api/java/buildcraft/api/blueprints/SchematicBlockBase.java deleted file mode 100755 index 69f18a2eb..000000000 --- a/src/api/java/buildcraft/api/blueprints/SchematicBlockBase.java +++ /dev/null @@ -1,9 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -public abstract class SchematicBlockBase extends Schematic { - -} diff --git a/src/api/java/buildcraft/api/blueprints/SchematicEntity.java b/src/api/java/buildcraft/api/blueprints/SchematicEntity.java deleted file mode 100755 index 7ffba9442..000000000 --- a/src/api/java/buildcraft/api/blueprints/SchematicEntity.java +++ /dev/null @@ -1,194 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.math.Vec3d; - -import net.minecraftforge.common.util.Constants; - -public class SchematicEntity extends Schematic { - public Class entity; - - /** This tree contains additional data to be stored in the blueprint. By default, it will be initialized from - * Schematic.readFromWord with the standard readNBT function of the corresponding tile (if any) and will be loaded - * from BptBlock.writeToWorld using the standard writeNBT function. */ - public NBTTagCompound entityNBT = new NBTTagCompound(); - - /** 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 Schematic. */ - public ItemStack[] storedRequirements = new ItemStack[0]; - public BuildingPermission defaultPermission = BuildingPermission.ALL; - - @Override - public void getRequirementsForPlacement(IBuilderContext context, List requirements) { - Collections.addAll(requirements, storedRequirements); - } - - public void writeToWorld(IBuilderContext context) { - Entity e = EntityList.createEntityFromNBT(entityNBT, context.world()); - context.world().spawnEntityInWorld(e); - } - - public void readFromWorld(IBuilderContext context, Entity entity) { - entity.writeToNBTOptional(entityNBT); - } - - @Override - public void translateToBlueprint(Vec3d transform) { - NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6); - Vec3d pos = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2)); - pos = pos.add(transform); - entityNBT.setTag("Pos", this.newDoubleNBTList(pos.xCoord, pos.yCoord, pos.zCoord)); - } - - @Override - public void translateToWorld(Vec3d transform) { - NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6); - Vec3d pos = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2)); - pos = pos.add(transform); - - entityNBT.setTag("Pos", this.newDoubleNBTList(pos.xCoord, pos.yCoord, pos.zCoord)); - } - - @Override - public void idsToBlueprint(MappingRegistry registry) {} - - @Override - public void idsToWorld(MappingRegistry registry) { - try { - registry.scanAndTranslateStacksToWorld(entityNBT); - } catch (MappingNotFoundException e) { - entityNBT = new NBTTagCompound(); - } - } - - @Override - public void rotateLeft(IBuilderContext context) { - NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6); - Vec3d pos = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2)); - pos = context.rotatePositionLeft(pos); - entityNBT.setTag("Pos", this.newDoubleNBTList(pos.xCoord, pos.yCoord, pos.zCoord)); - - nbttaglist = entityNBT.getTagList("Rotation", 5); - float yaw = nbttaglist.getFloatAt(0); - yaw += 90; - entityNBT.setTag("Rotation", this.newFloatNBTList(yaw, nbttaglist.getFloatAt(1))); - } - - @Override - public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) { - super.writeSchematicToNBT(nbt, registry); - - nbt.setInteger("entityId", registry.getIdForEntity(entity)); - nbt.setTag("entity", entityNBT); - - NBTTagList rq = new NBTTagList(); - - for (ItemStack stack : storedRequirements) { - NBTTagCompound sub = new NBTTagCompound(); - stack.writeToNBT(stack.writeToNBT(sub)); - sub.setInteger("id", registry.getIdForItem(stack.getItem())); - rq.appendTag(sub); - } - - nbt.setTag("rq", rq); - } - - @Override - public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) { - super.readSchematicFromNBT(nbt, registry); - - entityNBT = nbt.getCompoundTag("entity"); - - NBTTagList rq = nbt.getTagList("rq", Constants.NBT.TAG_COMPOUND); - - ArrayList rqs = new ArrayList(); - - for (int i = 0; i < rq.tagCount(); ++i) { - try { - NBTTagCompound sub = rq.getCompoundTagAt(i); - - if (sub.getInteger("id") >= 0) { - // Maps the id in the blueprint to the id in the world - sub.setInteger("id", Item.REGISTRY.getIDForObject(registry.getItemForId(sub.getInteger("id")))); - - rqs.add(ItemStack.loadItemStackFromNBT(sub)); - } else { - defaultPermission = BuildingPermission.CREATIVE_ONLY; - } - } catch (Throwable t) { - t.printStackTrace(); - defaultPermission = BuildingPermission.CREATIVE_ONLY; - } - } - - storedRequirements = rqs.toArray(new ItemStack[rqs.size()]); - } - - protected NBTTagList newDoubleNBTList(double... par1ArrayOfDouble) { - NBTTagList nbttaglist = new NBTTagList(); - double[] adouble = par1ArrayOfDouble; - int i = par1ArrayOfDouble.length; - - for (int j = 0; j < i; ++j) { - double d1 = adouble[j]; - nbttaglist.appendTag(new NBTTagDouble(d1)); - } - - return nbttaglist; - } - - protected NBTTagList newFloatNBTList(float... par1ArrayOfFloat) { - NBTTagList nbttaglist = new NBTTagList(); - float[] afloat = par1ArrayOfFloat; - int i = par1ArrayOfFloat.length; - - for (int j = 0; j < i; ++j) { - float f1 = afloat[j]; - nbttaglist.appendTag(new NBTTagFloat(f1)); - } - - return nbttaglist; - } - - public boolean isAlreadyBuilt(IBuilderContext context) { - NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6); - Vec3d newPosition = new Vec3d(nbttaglist.getDoubleAt(0), nbttaglist.getDoubleAt(1), nbttaglist.getDoubleAt(2)); - - for (Object o : context.world().loadedEntityList) { - Entity e = (Entity) o; - - Vec3d existingPositon = new Vec3d(e.posX, e.posY, e.posZ); - - if (existingPositon.distanceTo(newPosition) <= 0.1) { - return true; - } - } - - return false; - } - - @Override - public int buildTime() { - return 5; - } - - @Override - public BuildingPermission getBuildingPermission() { - return defaultPermission; - } -} diff --git a/src/api/java/buildcraft/api/blueprints/SchematicFactory.java b/src/api/java/buildcraft/api/blueprints/SchematicFactory.java deleted file mode 100755 index 878b15714..000000000 --- a/src/api/java/buildcraft/api/blueprints/SchematicFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.HashMap; - -import net.minecraft.nbt.NBTTagCompound; - -public abstract class SchematicFactory { - - private static final HashMap> factories = new HashMap>(); - - private static final HashMap, SchematicFactory> schematicToFactory = - new HashMap, SchematicFactory>(); - - protected abstract S loadSchematicFromWorldNBT(NBTTagCompound nbt, MappingRegistry registry) throws MappingNotFoundException; - - public void saveSchematicToWorldNBT(NBTTagCompound nbt, S object, MappingRegistry registry) { - nbt.setString("factoryID", getClass().getCanonicalName()); - } - - public static Schematic createSchematicFromWorldNBT(NBTTagCompound nbt, MappingRegistry registry) throws MappingNotFoundException { - String factoryName = nbt.getString("factoryID"); - - if (factories.containsKey(factoryName)) { - return factories.get(factoryName).loadSchematicFromWorldNBT(nbt, registry); - } else { - return null; - } - } - - public static void registerSchematicFactory(Class clas, SchematicFactory factory) { - schematicToFactory.put(clas, factory); - factories.put(factory.getClass().getCanonicalName(), factory); - } - - public static SchematicFactory getFactory(Class clas) { - Class superClass = clas.getSuperclass(); - - if (schematicToFactory.containsKey(clas)) { - return schematicToFactory.get(clas); - } else if (superClass != null) { - return getFactory(superClass); - } else { - return null; - } - } - -} diff --git a/src/api/java/buildcraft/api/blueprints/SchematicFluid.java b/src/api/java/buildcraft/api/blueprints/SchematicFluid.java deleted file mode 100755 index 551c17f8c..000000000 --- a/src/api/java/buildcraft/api/blueprints/SchematicFluid.java +++ /dev/null @@ -1,84 +0,0 @@ -/** Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.BlockLiquid; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; - -import net.minecraftforge.fluids.FluidStack; - -public class SchematicFluid extends SchematicBlock { - - private final ItemStack fluidItem; - - public SchematicFluid(FluidStack fluidStack) { - this.fluidItem = new ItemStack(fluidStack.getFluid().getBlock(), 1); - } - - @Override - public void getRequirementsForPlacement(IBuilderContext context, List requirements) { - if (getLevel() == 0) { - requirements.add(fluidItem); - } - } - - @Override - public void storeRequirements(IBuilderContext context, BlockPos pos) { - // cancel requirements reading - } - - @Override - public boolean isAlreadyBuilt(IBuilderContext context, BlockPos pos) { - if (getLevel() == 0) { - return state == context.world().getBlockState(pos) && ((Integer) context.world().getBlockState(pos).getValue(BlockLiquid.LEVEL)) == 0; - } else { - return state == context.world().getBlockState(pos); - } - } - - @Override - public void rotateLeft(IBuilderContext context) { - - } - - @Override - public boolean doNotBuild() { - return getLevel() != 0; - } - - @Override - public void placeInWorld(IBuilderContext context, BlockPos pos, List stacks) { - if (getLevel() == 0) { - context.world().setBlockState(pos, state, 3); - } - } - - @Override - public void postProcessing(IBuilderContext context, BlockPos pos) { - if (getLevel() != 0) { - context.world().setBlockState(pos, state, 3); - } - } - - @Override - public List getStacksToDisplay(List stackConsumed) { - List result = new ArrayList(); - result.add(fluidItem); - return result; - } - - @Override - public int getEnergyRequirement(List stacksUsed) { - return 1 * BuilderAPI.BUILD_ENERGY; - } - - public int getLevel() { - return (Integer) state.getValue(BlockLiquid.LEVEL); - } -} diff --git a/src/api/java/buildcraft/api/blueprints/SchematicMask.java b/src/api/java/buildcraft/api/blueprints/SchematicMask.java deleted file mode 100755 index 50538e711..000000000 --- a/src/api/java/buildcraft/api/blueprints/SchematicMask.java +++ /dev/null @@ -1,83 +0,0 @@ -/** Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.WorldServer; - -import buildcraft.api.core.BuildCraftAPI; - -public class SchematicMask extends SchematicBlockBase { - /** True of the block should be a solid block (stone, grass or a furnace) and false if it shouldn't (flowers, air or - * vines) */ - public boolean isConcrete = true; - - public SchematicMask() { - - } - - public SchematicMask(boolean isConcrete) { - this.isConcrete = isConcrete; - } - - @Override - public void placeInWorld(IBuilderContext context, BlockPos pos, List stacks) { - if (isConcrete) { - if (stacks.size() == 0 || !BuildCraftAPI.isSoftBlock(context.world(), pos)) { - return; - } else { - ItemStack stack = stacks.get(0); - EntityPlayer player = BuildCraftAPI.fakePlayerProvider.getBuildCraftPlayer((WorldServer) context.world()).get(); - - // force the block to be air block, in case it's just a soft - // block which replacement is not straightforward - context.world().setBlockToAir(pos); - - // Find nearest solid surface to place on - EnumFacing solidFace = null; - for (EnumFacing face : EnumFacing.values()) { - BlockPos offset = pos.offset(face); - if (!BuildCraftAPI.isSoftBlock(context.world(), offset)) { - solidFace = face; - break; - } - } - ItemBlock itemBlock = (ItemBlock) stack.getItem(); - IBlockState state = itemBlock.block.onBlockPlaced(context.world(), pos, solidFace, 0, 0, 0, stack.getMetadata(), player); - itemBlock.placeBlockAt(stack, player, context.world(), pos, solidFace, 0, 0, 0, state); - - } - } else { - context.world().setBlockToAir(pos); - } - } - - @Override - public boolean isAlreadyBuilt(IBuilderContext context, BlockPos pos) { - if (isConcrete) { - return !BuildCraftAPI.getWorldProperty("replaceable").get(context.world(), pos); - } else { - return BuildCraftAPI.getWorldProperty("replaceable").get(context.world(), pos); - } - } - - @Override - public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) { - nbt.setBoolean("isConcrete", isConcrete); - } - - @Override - public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) { - isConcrete = nbt.getBoolean("isConcrete"); - } -} diff --git a/src/api/java/buildcraft/api/blueprints/SchematicTile.java b/src/api/java/buildcraft/api/blueprints/SchematicTile.java deleted file mode 100755 index 2dbbe2198..000000000 --- a/src/api/java/buildcraft/api/blueprints/SchematicTile.java +++ /dev/null @@ -1,116 +0,0 @@ -/** Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.blueprints; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; - -import buildcraft.api.core.JavaTools; - -public class SchematicTile extends SchematicBlock { - - /** This tree contains additional data to be stored in the blueprint. By default, it will be initialized from - * Schematic.readFromWord with the standard readNBT function of the corresponding tile (if any) and will be loaded - * from BptBlock.writeToWorld using the standard writeNBT function. */ - public NBTTagCompound tileNBT = new NBTTagCompound(); - - @Override - public void idsToBlueprint(MappingRegistry registry) {} - - @Override - public void idsToWorld(MappingRegistry registry) { - try { - registry.scanAndTranslateStacksToWorld(tileNBT); - } catch (MappingNotFoundException e) { - tileNBT = new NBTTagCompound(); - } - } - - public void onNBTLoaded() { - - } - - /** Places the block in the world, at the location specified in the slot. */ - @Override - public void placeInWorld(IBuilderContext context, BlockPos pos, List stacks) { - super.placeInWorld(context, pos, stacks); - - if (state.getBlock().hasTileEntity(state)) { - tileNBT.setInteger("x", pos.getX()); - tileNBT.setInteger("y", pos.getY()); - tileNBT.setInteger("z", pos.getZ()); - // The minecraft server argument doesn't seem to be used... - TileEntity tile = TileEntity.create(tileNBT); - tile.setWorldObj(context.world()); - context.world().setTileEntity(pos, tile); - } - } - - @Override - public void initializeFromObjectAt(IBuilderContext context, BlockPos pos) { - super.initializeFromObjectAt(context, pos); - - if (state.getBlock().hasTileEntity(state)) { - TileEntity tile = context.world().getTileEntity(pos); - - if (tile != null) { - tile.writeToNBT(tileNBT); - } - - tileNBT = (NBTTagCompound) tileNBT.copy(); - onNBTLoaded(); - } - } - - @Override - public void storeRequirements(IBuilderContext context, BlockPos pos) { - super.storeRequirements(context, pos); - - if (state.getBlock().hasTileEntity(state)) { - TileEntity tile = context.world().getTileEntity(pos); - - if (tile instanceof IInventory) { - IInventory inv = (IInventory) tile; - - ArrayList rqs = new ArrayList(); - - for (int i = 0; i < inv.getSizeInventory(); ++i) { - if (inv.getStackInSlot(i) != null) { - rqs.add(inv.getStackInSlot(i)); - } - } - - storedRequirements = JavaTools.concat(storedRequirements, rqs.toArray(new ItemStack[rqs.size()])); - } - } - } - - @Override - public void writeSchematicToNBT(NBTTagCompound nbt, MappingRegistry registry) { - super.writeSchematicToNBT(nbt, registry); - - nbt.setTag("blockCpt", tileNBT); - } - - @Override - public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) { - super.readSchematicFromNBT(nbt, registry); - - tileNBT = nbt.getCompoundTag("blockCpt"); - onNBTLoaded(); - } - - @Override - public int buildTime() { - return 5; - } -} diff --git a/src/api/java/buildcraft/api/blueprints/package-info.java b/src/api/java/buildcraft/api/blueprints/package-info.java deleted file mode 100755 index 3b3632424..000000000 --- a/src/api/java/buildcraft/api/blueprints/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.5", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|blueprints") -package buildcraft.api.blueprints; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/boards/IRedstoneBoard.java b/src/api/java/buildcraft/api/boards/IRedstoneBoard.java deleted file mode 100755 index 2aa375e92..000000000 --- a/src/api/java/buildcraft/api/boards/IRedstoneBoard.java +++ /dev/null @@ -1,12 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.boards; - -public interface IRedstoneBoard { - - void updateBoard(T container); - - RedstoneBoardNBT getNBTHandler(); -} diff --git a/src/api/java/buildcraft/api/boards/RedstoneBoardNBT.java b/src/api/java/buildcraft/api/boards/RedstoneBoardNBT.java deleted file mode 100755 index 8e327073a..000000000 --- a/src/api/java/buildcraft/api/boards/RedstoneBoardNBT.java +++ /dev/null @@ -1,45 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.boards; - -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import net.minecraftforge.common.util.Constants; - -public abstract class RedstoneBoardNBT { - - private static Random rand = new Random(); - - public abstract String getID(); - - public abstract void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced); - - public abstract String getDisplayName(); - - public abstract IRedstoneBoard create(NBTTagCompound nbt, T object); - - public abstract String getItemModelLocation(); - - public void createBoard(NBTTagCompound nbt) { - nbt.setString("id", getID()); - } - - public int getParameterNumber(NBTTagCompound nbt) { - if (!nbt.hasKey("parameters")) { - return 0; - } else { - return nbt.getTagList("parameters", Constants.NBT.TAG_COMPOUND).tagCount(); - } - } - - public float nextFloat(int difficulty) { - return 1F - (float) Math.pow(rand.nextFloat(), 1F / difficulty); - } -} diff --git a/src/api/java/buildcraft/api/boards/RedstoneBoardRegistry.java b/src/api/java/buildcraft/api/boards/RedstoneBoardRegistry.java deleted file mode 100755 index 5e8d4e288..000000000 --- a/src/api/java/buildcraft/api/boards/RedstoneBoardRegistry.java +++ /dev/null @@ -1,40 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.boards; - -import java.util.Collection; - -import net.minecraft.nbt.NBTTagCompound; - -public abstract class RedstoneBoardRegistry { - - public static RedstoneBoardRegistry instance; - - /** Register a redstone board type. - * - * @param redstoneBoardNBT The RedstoneBoardNBT instance containing the board information. - * @param energyCost RF price of the board, in RF. */ - public abstract void registerBoardType(RedstoneBoardNBT redstoneBoardNBT, int energyCost); - - @Deprecated - /** Register a redstone board type. Deprecated, use registerBoardType now. - * - * @param redstoneBoardNBT The RedstoneBoardNBT instance containing the board information. - * @param probability Since 6.4.x, this is used to calculate the RF price of the board in the Programming Table by - * doing (160000 / probability). */ - public abstract void registerBoardClass(RedstoneBoardNBT redstoneBoardNBT, float probability); - - public abstract void setEmptyRobotBoard(RedstoneBoardRobotNBT redstoneBoardNBT); - - public abstract RedstoneBoardRobotNBT getEmptyRobotBoard(); - - public abstract RedstoneBoardNBT getRedstoneBoard(NBTTagCompound nbt); - - public abstract RedstoneBoardNBT getRedstoneBoard(String id); - - public abstract Collection> getAllBoardNBTs(); - - public abstract int getEnergyCost(RedstoneBoardNBT board); -} diff --git a/src/api/java/buildcraft/api/boards/RedstoneBoardRobot.java b/src/api/java/buildcraft/api/boards/RedstoneBoardRobot.java deleted file mode 100755 index b0ed0638f..000000000 --- a/src/api/java/buildcraft/api/boards/RedstoneBoardRobot.java +++ /dev/null @@ -1,29 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.boards; - -import buildcraft.api.robots.AIRobot; -import buildcraft.api.robots.EntityRobotBase; - -public abstract class RedstoneBoardRobot extends AIRobot implements IRedstoneBoard { - - public RedstoneBoardRobot(EntityRobotBase iRobot) { - super(iRobot); - } - - @Override - public abstract RedstoneBoardRobotNBT getNBTHandler(); - - @Override - public final void updateBoard(EntityRobotBase container) { - - } - - @Override - public boolean canLoadFromNBT() { - return true; - } - -} diff --git a/src/api/java/buildcraft/api/boards/RedstoneBoardRobotNBT.java b/src/api/java/buildcraft/api/boards/RedstoneBoardRobotNBT.java deleted file mode 100755 index 4a4161b19..000000000 --- a/src/api/java/buildcraft/api/boards/RedstoneBoardRobotNBT.java +++ /dev/null @@ -1,23 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.boards; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import buildcraft.api.robots.EntityRobotBase; - -public abstract class RedstoneBoardRobotNBT extends RedstoneBoardNBT { - - @Override - public RedstoneBoardRobot create(NBTTagCompound nbt, EntityRobotBase robot) { - return create(robot); - } - - public abstract RedstoneBoardRobot create(EntityRobotBase robot); - - public abstract ResourceLocation getRobotTexture(); - -} diff --git a/src/api/java/buildcraft/api/boards/package-info.java b/src/api/java/buildcraft/api/boards/package-info.java deleted file mode 100755 index 6253f5b79..000000000 --- a/src/api/java/buildcraft/api/boards/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|boards") -package buildcraft.api.boards; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/crops/CropManager.java b/src/api/java/buildcraft/api/crops/CropManager.java deleted file mode 100755 index a5d9f6d64..000000000 --- a/src/api/java/buildcraft/api/crops/CropManager.java +++ /dev/null @@ -1,79 +0,0 @@ -package buildcraft.api.crops; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public final class CropManager { - private static List handlers = new ArrayList(); - private static ICropHandler defaultHandler; - - private CropManager() { - - } - - public static void registerHandler(ICropHandler cropHandler) { - handlers.add(cropHandler); - } - - public static void setDefaultHandler(ICropHandler cropHandler) { - defaultHandler = cropHandler; - } - - public static ICropHandler getDefaultHandler() { - return defaultHandler; - } - - public static boolean isSeed(ItemStack stack) { - for (ICropHandler cropHandler : handlers) { - if (cropHandler.isSeed(stack)) { - return true; - } - } - return defaultHandler.isSeed(stack); - } - - public static boolean canSustainPlant(World world, ItemStack seed, BlockPos pos) { - for (ICropHandler cropHandler : handlers) { - if (cropHandler.isSeed(seed) && cropHandler.canSustainPlant(world, seed, pos)) { - return true; - } - } - return defaultHandler.isSeed(seed) && defaultHandler.canSustainPlant(world, seed, pos); - } - - public static boolean plantCrop(World world, EntityPlayer player, ItemStack seed, BlockPos pos) { - for (ICropHandler cropHandler : handlers) { - if (cropHandler.isSeed(seed) && cropHandler.canSustainPlant(world, seed, pos) && cropHandler.plantCrop(world, player, seed, pos)) { - return true; - } - } - return defaultHandler.plantCrop(world, player, seed, pos); - } - - public static boolean isMature(IBlockAccess blockAccess, IBlockState state, BlockPos pos) { - for (ICropHandler cropHandler : handlers) { - if (cropHandler.isMature(blockAccess, state, pos)) { - return true; - } - } - return defaultHandler.isMature(blockAccess, state, pos); - } - - public static boolean harvestCrop(World world, BlockPos pos, List drops) { - IBlockState state = world.getBlockState(pos); - for (ICropHandler cropHandler : handlers) { - if (cropHandler.isMature(world, state, pos)) { - return cropHandler.harvestCrop(world, pos, drops); - } - } - return defaultHandler.isMature(world, state, pos) && defaultHandler.harvestCrop(world, pos, drops); - } - -} diff --git a/src/api/java/buildcraft/api/crops/ICropHandler.java b/src/api/java/buildcraft/api/crops/ICropHandler.java deleted file mode 100755 index 0eb41f8de..000000000 --- a/src/api/java/buildcraft/api/crops/ICropHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -package buildcraft.api.crops; - -import java.util.List; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public interface ICropHandler { - - /** Check if an item is a seed. - * - * @param stack - * @return true if the item can be planted. */ - boolean isSeed(ItemStack stack); - - /** Check if the item can be planted. You can assume canSustainPlant() will only be called if isSeed() returned - * true. - * - * @param world - * @param seed - * @param pos - * @return true if the item can be planted at pos. */ - boolean canSustainPlant(World world, ItemStack seed, BlockPos pos); - - /** Plant the item in the block. You can assume plantCrop() will only be called if canSustainPlant() returned true. - * - * @param world - * @param player - * @param seed - * @param pos - * @return true if the item was planted at pos. */ - boolean plantCrop(World world, EntityPlayer player, ItemStack seed, BlockPos pos); - - /** Check if a crop is mature and can be harvested. - * - * @param blockAccess - * @param state - * @param pos - * @return true if the block at pos is mature and can be harvested. */ - boolean isMature(IBlockAccess blockAccess, IBlockState state, BlockPos pos); - - /** Harvest the crop. You can assume harvestCrop() will only be called if isMature() returned true. - * - * @param world - * @param pos - * @param drops a list to return the harvest's drops. - * @return true if the block was successfully harvested. */ - boolean harvestCrop(World world, BlockPos pos, List drops); - -} diff --git a/src/api/java/buildcraft/api/crops/package-info.java b/src/api/java/buildcraft/api/crops/package-info.java deleted file mode 100755 index 803ce050a..000000000 --- a/src/api/java/buildcraft/api/crops/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.1", owner = "BuildCraftAPI|Core", provides = "BuildCraftAPI|crops") -package buildcraft.api.crops; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/events/BlockInteractionEvent.java b/src/api/java/buildcraft/api/events/BlockInteractionEvent.java deleted file mode 100755 index 4a4d8b7bd..000000000 --- a/src/api/java/buildcraft/api/events/BlockInteractionEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.events; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; - -@Cancelable -public class BlockInteractionEvent extends Event { - public final EntityPlayer player; - public final IBlockState state; - - public BlockInteractionEvent(EntityPlayer player, IBlockState state) { - this.player = player; - this.state = state; - } -} diff --git a/src/api/java/buildcraft/api/events/BlockPlacedDownEvent.java b/src/api/java/buildcraft/api/events/BlockPlacedDownEvent.java deleted file mode 100755 index 22a8a74fa..000000000 --- a/src/api/java/buildcraft/api/events/BlockPlacedDownEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.events; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.math.BlockPos; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; - -@Cancelable -public class BlockPlacedDownEvent extends Event { - public final EntityPlayer player; - public final IBlockState state; - public final BlockPos pos; - - public BlockPlacedDownEvent(EntityPlayer player, BlockPos pos, IBlockState state) { - this.player = player; - this.state = state; - this.pos = pos; - } -} diff --git a/src/api/java/buildcraft/api/events/PipePlacedEvent.java b/src/api/java/buildcraft/api/events/PipePlacedEvent.java deleted file mode 100755 index 3664a57d2..000000000 --- a/src/api/java/buildcraft/api/events/PipePlacedEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.events; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.util.math.BlockPos; - -import net.minecraftforge.fml.common.eventhandler.Event; - -public class PipePlacedEvent extends Event { - public EntityPlayer player; - public Item pipeType; - public BlockPos pos; - - public PipePlacedEvent(EntityPlayer player, Item pipeType, BlockPos pos) { - this.player = player; - this.pipeType = pipeType; - this.pos = pos; - } - -} diff --git a/src/api/java/buildcraft/api/events/RobotEvent.java b/src/api/java/buildcraft/api/events/RobotEvent.java deleted file mode 100755 index 9b12b64d2..000000000 --- a/src/api/java/buildcraft/api/events/RobotEvent.java +++ /dev/null @@ -1,53 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.events; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; - -import buildcraft.api.robots.EntityRobotBase; - -public abstract class RobotEvent extends Event { - public final EntityRobotBase robot; - - public RobotEvent(EntityRobotBase robot) { - this.robot = robot; - } - - @Cancelable - public static class Place extends RobotEvent { - public final EntityPlayer player; - - public Place(EntityRobotBase robot, EntityPlayer player) { - super(robot); - this.player = player; - } - } - - @Cancelable - public static class Interact extends RobotEvent { - public final EntityPlayer player; - public final ItemStack item; - - public Interact(EntityRobotBase robot, EntityPlayer player, ItemStack item) { - super(robot); - this.player = player; - this.item = item; - } - } - - @Cancelable - public static class Dismantle extends RobotEvent { - public final EntityPlayer player; - - public Dismantle(EntityRobotBase robot, EntityPlayer player) { - super(robot); - this.player = player; - } - } -} diff --git a/src/api/java/buildcraft/api/events/RobotPlacementEvent.java b/src/api/java/buildcraft/api/events/RobotPlacementEvent.java deleted file mode 100755 index b0abc44d8..000000000 --- a/src/api/java/buildcraft/api/events/RobotPlacementEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.events; - -import net.minecraft.entity.player.EntityPlayer; - -import net.minecraftforge.fml.common.eventhandler.Cancelable; -import net.minecraftforge.fml.common.eventhandler.Event; - -@Cancelable -public class RobotPlacementEvent extends Event { - public EntityPlayer player; - public String robotProgram; - - public RobotPlacementEvent(EntityPlayer player, String robotProgram) { - this.player = player; - this.robotProgram = robotProgram; - } - -} diff --git a/src/api/java/buildcraft/api/events/package-info.java b/src/api/java/buildcraft/api/events/package-info.java deleted file mode 100755 index 06cd25fea..000000000 --- a/src/api/java/buildcraft/api/events/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|events") -package buildcraft.api.events; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/facades/FacadeAPI.java b/src/api/java/buildcraft/api/facades/FacadeAPI.java deleted file mode 100755 index b3e214ea8..000000000 --- a/src/api/java/buildcraft/api/facades/FacadeAPI.java +++ /dev/null @@ -1,9 +0,0 @@ -package buildcraft.api.facades; - -public final class FacadeAPI { - public static IFacadeItem facadeItem; - - private FacadeAPI() { - - } -} diff --git a/src/api/java/buildcraft/api/facades/FacadeType.java b/src/api/java/buildcraft/api/facades/FacadeType.java deleted file mode 100755 index c88d89ff4..000000000 --- a/src/api/java/buildcraft/api/facades/FacadeType.java +++ /dev/null @@ -1,14 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.facades; - -public enum FacadeType { - Basic, - Phased; - - public static FacadeType fromOrdinal(int ordinal) { - return ordinal == 1 ? Phased : Basic; - } -} diff --git a/src/api/java/buildcraft/api/facades/IFacadeItem.java b/src/api/java/buildcraft/api/facades/IFacadeItem.java deleted file mode 100755 index 1fe981a3b..000000000 --- a/src/api/java/buildcraft/api/facades/IFacadeItem.java +++ /dev/null @@ -1,16 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.facades; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemStack; - -public interface IFacadeItem { - FacadeType getFacadeType(ItemStack facade); - - ItemStack getFacadeForBlock(IBlockState state); - - IBlockState[] getBlockStatesForFacade(ItemStack facade); -} diff --git a/src/api/java/buildcraft/api/facades/package-info.java b/src/api/java/buildcraft/api/facades/package-info.java deleted file mode 100755 index 2c79167b3..000000000 --- a/src/api/java/buildcraft/api/facades/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|facades") -package buildcraft.api.facades; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/filler/FillerManager.java b/src/api/java/buildcraft/api/filler/FillerManager.java deleted file mode 100755 index 03567c45a..000000000 --- a/src/api/java/buildcraft/api/filler/FillerManager.java +++ /dev/null @@ -1,13 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.filler; - -public final class FillerManager { - - public static IFillerRegistry registry; - - /** Deactivate constructor */ - private FillerManager() {} -} diff --git a/src/api/java/buildcraft/api/filler/IFillerPattern.java b/src/api/java/buildcraft/api/filler/IFillerPattern.java deleted file mode 100755 index 7d89469f1..000000000 --- a/src/api/java/buildcraft/api/filler/IFillerPattern.java +++ /dev/null @@ -1,11 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.filler; - -import buildcraft.api.statements.IStatement; - -public interface IFillerPattern extends IStatement { - // Object getBlockOverlay(); -} diff --git a/src/api/java/buildcraft/api/filler/IFillerRegistry.java b/src/api/java/buildcraft/api/filler/IFillerRegistry.java deleted file mode 100755 index f9e588f62..000000000 --- a/src/api/java/buildcraft/api/filler/IFillerRegistry.java +++ /dev/null @@ -1,19 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.filler; - -import java.util.Collection; - -public interface IFillerRegistry { - void addPattern(IFillerPattern pattern); - - IFillerPattern getPattern(String patternName); - - IFillerPattern getNextPattern(IFillerPattern currentPattern); - - IFillerPattern getPreviousPattern(IFillerPattern currentPattern); - - Collection getPatterns(); -} diff --git a/src/api/java/buildcraft/api/filler/package-info.java b/src/api/java/buildcraft/api/filler/package-info.java deleted file mode 100755 index 3e9d907de..000000000 --- a/src/api/java/buildcraft/api/filler/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "4.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|filler") -package buildcraft.api.filler; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/gates/GateExpansionController.java b/src/api/java/buildcraft/api/gates/GateExpansionController.java deleted file mode 100755 index 9ef7f861d..000000000 --- a/src/api/java/buildcraft/api/gates/GateExpansionController.java +++ /dev/null @@ -1,54 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.gates; - -import java.util.Collection; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -import buildcraft.api.statements.IActionInternal; -import buildcraft.api.statements.IStatement; -import buildcraft.api.statements.IStatementParameter; -import buildcraft.api.statements.ITriggerInternal; - -public abstract class GateExpansionController { - - public final IGateExpansion type; - public final TileEntity pipeTile; - - public GateExpansionController(IGateExpansion type, TileEntity pipeTile) { - this.pipeTile = pipeTile; - this.type = type; - } - - public IGateExpansion getType() { - return type; - } - - public boolean isActive() { - return false; - } - - public void tick(IGate gate) {} - - public void startResolution() {} - - public boolean resolveAction(IStatement action, int count) { - return false; - } - - public boolean isTriggerActive(IStatement trigger, IStatementParameter[] parameters) { - return false; - } - - public void addTriggers(Collection list) {} - - public void addActions(Collection list) {} - - public void writeToNBT(NBTTagCompound nbt) {} - - public void readFromNBT(NBTTagCompound nbt) {} -} diff --git a/src/api/java/buildcraft/api/gates/GateExpansionModelKey.java b/src/api/java/buildcraft/api/gates/GateExpansionModelKey.java deleted file mode 100755 index f39402e5c..000000000 --- a/src/api/java/buildcraft/api/gates/GateExpansionModelKey.java +++ /dev/null @@ -1,36 +0,0 @@ -package buildcraft.api.gates; - -import java.util.Arrays; - -import net.minecraft.util.BlockRenderLayer; - -public class GateExpansionModelKey> { - public final BlockRenderLayer layer; - public final IExpansionBaker baker; - private final int hash; - - public GateExpansionModelKey(BlockRenderLayer layer, IExpansionBaker baker) { - if (layer != BlockRenderLayer.CUTOUT && layer != BlockRenderLayer.TRANSLUCENT) { - throw new IllegalArgumentException("Unsuported layer! Was " + layer + ", wanted CUTOUT or TRANSLUCENT"); - } - if (baker == null) throw new NullPointerException("baker"); - this.layer = layer; - this.baker = baker; - hash = Arrays.hashCode(new int[] { layer.hashCode(), System.identityHashCode(baker) }); - } - - @Override - public int hashCode() { - return hash; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; - GateExpansionModelKey other = (GateExpansionModelKey) obj; - if (baker != other.baker) return false; - return true; - } -} diff --git a/src/api/java/buildcraft/api/gates/GateExpansions.java b/src/api/java/buildcraft/api/gates/GateExpansions.java deleted file mode 100755 index eb00ab512..000000000 --- a/src/api/java/buildcraft/api/gates/GateExpansions.java +++ /dev/null @@ -1,57 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.gates; - -import java.util.*; - -import com.google.common.collect.HashBiMap; - -import net.minecraft.item.ItemStack; - -public final class GateExpansions { - private static final Map expansions = new HashMap(); - private static final ArrayList expansionIDs = new ArrayList(); - private static final Map recipes = HashBiMap.create(); - - private GateExpansions() {} - - public static void registerExpansion(IGateExpansion expansion) { - registerExpansion(expansion.getUniqueIdentifier(), expansion); - } - - public static void registerExpansion(String identifier, IGateExpansion expansion) { - expansions.put(identifier, expansion); - expansionIDs.add(expansion); - } - - public static void registerExpansion(IGateExpansion expansion, ItemStack addedRecipe) { - registerExpansion(expansion.getUniqueIdentifier(), expansion); - recipes.put(expansion, addedRecipe); - } - - public static IGateExpansion getExpansion(String identifier) { - return expansions.get(identifier); - } - - public static Set getExpansions() { - Set set = new HashSet(); - set.addAll(expansionIDs); - return set; - } - - public static Map getRecipesForPostInit() { - return recipes; - } - - // The code below is used by networking. - - public static IGateExpansion getExpansionByID(int id) { - return expansionIDs.get(id); - } - - public static int getExpansionID(IGateExpansion expansion) { - return expansionIDs.indexOf(expansion); - } -} diff --git a/src/api/java/buildcraft/api/gates/IExpansionBaker.java b/src/api/java/buildcraft/api/gates/IExpansionBaker.java deleted file mode 100755 index 846cfe598..000000000 --- a/src/api/java/buildcraft/api/gates/IExpansionBaker.java +++ /dev/null @@ -1,13 +0,0 @@ -package buildcraft.api.gates; - -import com.google.common.collect.ImmutableList; - -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.vertex.VertexFormat; - -public interface IExpansionBaker> { - /** @return The vertex format used to generate the quads. */ - VertexFormat getVertexFormat(); - - ImmutableList bake(K key); -} diff --git a/src/api/java/buildcraft/api/gates/IGate.java b/src/api/java/buildcraft/api/gates/IGate.java deleted file mode 100755 index c44400c10..000000000 --- a/src/api/java/buildcraft/api/gates/IGate.java +++ /dev/null @@ -1,33 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.gates; - -import java.util.Collection; -import java.util.List; - -import buildcraft.api.statements.IStatement; -import buildcraft.api.statements.IStatementParameter; -import buildcraft.api.statements.StatementSlot; -import buildcraft.api.statements.containers.ISidedStatementContainer; -import buildcraft.api.transport.IPipe; - -public interface IGate extends ISidedStatementContainer { - @Deprecated - void setPulsing(boolean pulse); - - IPipe getPipe(); - - Collection getExpansions(); - - List getTriggers(); - - List getActions(); - - List getActiveActions(); - - List getTriggerParameters(int slot); - - List getActionParameters(int slot); -} diff --git a/src/api/java/buildcraft/api/gates/IGateExpansion.java b/src/api/java/buildcraft/api/gates/IGateExpansion.java deleted file mode 100755 index 005767855..000000000 --- a/src/api/java/buildcraft/api/gates/IGateExpansion.java +++ /dev/null @@ -1,30 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.gates; - -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public interface IGateExpansion { - - String getUniqueIdentifier(); - - String getDisplayName(); - - GateExpansionController makeController(TileEntity pipeTile); - - @SideOnly(Side.CLIENT) - void textureStitch(TextureMap map); - - @SideOnly(Side.CLIENT) - GateExpansionModelKey getRenderModelKey(BlockRenderLayer layer); - - // FIXME : This is ugly. - boolean canAddToGate(int numTriggerParameters, int numActionParameters); -} diff --git a/src/api/java/buildcraft/api/gates/package-info.java b/src/api/java/buildcraft/api/gates/package-info.java deleted file mode 100755 index b86ad48bd..000000000 --- a/src/api/java/buildcraft/api/gates/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "4.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|gates") -package buildcraft.api.gates; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/library/ILibraryTypeHandler.java b/src/api/java/buildcraft/api/library/ILibraryTypeHandler.java deleted file mode 100755 index 8616d10fe..000000000 --- a/src/api/java/buildcraft/api/library/ILibraryTypeHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public interface ILibraryTypeHandler { - boolean isHandler(ItemStack stack, boolean store); - - String getFileExtension(); - - int getTextColor(); - - String getName(ItemStack stack); - - ItemStack load(ItemStack stack, NBTTagCompound compound); - - boolean store(ItemStack stack, NBTTagCompound compound); -} diff --git a/src/api/java/buildcraft/api/library/LibraryAPI.java b/src/api/java/buildcraft/api/library/LibraryAPI.java deleted file mode 100755 index 92e4bbc6c..000000000 --- a/src/api/java/buildcraft/api/library/LibraryAPI.java +++ /dev/null @@ -1,29 +0,0 @@ -package buildcraft.api.library; - -import java.util.HashSet; -import java.util.Set; - -public final class LibraryAPI { - private static final Set handlers = new HashSet(); - - private LibraryAPI() { - - } - - public static Set getHandlerSet() { - return handlers; - } - - public static void registerHandler(LibraryTypeHandler handler) { - handlers.add(handler); - } - - public static LibraryTypeHandler getHandlerFor(String extension) { - for (LibraryTypeHandler h : handlers) { - if (h.isInputExtension(extension)) { - return h; - } - } - return null; - } -} diff --git a/src/api/java/buildcraft/api/library/LibraryTypeHandler.java b/src/api/java/buildcraft/api/library/LibraryTypeHandler.java deleted file mode 100755 index aa4b3106f..000000000 --- a/src/api/java/buildcraft/api/library/LibraryTypeHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; - -public abstract class LibraryTypeHandler { - public enum HandlerType { - LOAD, - STORE - } - - private final String extension; - - public LibraryTypeHandler(String extension) { - this.extension = extension; - } - - public abstract boolean isHandler(ItemStack stack, HandlerType type); - - public boolean isInputExtension(String ext) { - return extension.equals(ext); - } - - public String getOutputExtension() { - return extension; - } - - public abstract int getTextColor(); - - public abstract String getName(ItemStack stack); -} diff --git a/src/api/java/buildcraft/api/library/LibraryTypeHandlerByteArray.java b/src/api/java/buildcraft/api/library/LibraryTypeHandlerByteArray.java deleted file mode 100755 index c7c5e2317..000000000 --- a/src/api/java/buildcraft/api/library/LibraryTypeHandlerByteArray.java +++ /dev/null @@ -1,13 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; - -public abstract class LibraryTypeHandlerByteArray extends LibraryTypeHandler { - public LibraryTypeHandlerByteArray(String extension) { - super(extension); - } - - public abstract ItemStack load(ItemStack stack, byte[] data); - - public abstract byte[] store(ItemStack stack); -} diff --git a/src/api/java/buildcraft/api/library/LibraryTypeHandlerNBT.java b/src/api/java/buildcraft/api/library/LibraryTypeHandlerNBT.java deleted file mode 100755 index a656ff7c7..000000000 --- a/src/api/java/buildcraft/api/library/LibraryTypeHandlerNBT.java +++ /dev/null @@ -1,14 +0,0 @@ -package buildcraft.api.library; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public abstract class LibraryTypeHandlerNBT extends LibraryTypeHandler { - public LibraryTypeHandlerNBT(String extension) { - super(extension); - } - - public abstract ItemStack load(ItemStack stack, NBTTagCompound nbt); - - public abstract boolean store(ItemStack stack, NBTTagCompound nbt); -} diff --git a/src/api/java/buildcraft/api/library/package-info.java b/src/api/java/buildcraft/api/library/package-info.java deleted file mode 100755 index e41a0dc0f..000000000 --- a/src/api/java/buildcraft/api/library/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|library") -package buildcraft.api.library; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/lists/ListMatchHandler.java b/src/api/java/buildcraft/api/lists/ListMatchHandler.java deleted file mode 100755 index d18710c04..000000000 --- a/src/api/java/buildcraft/api/lists/ListMatchHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -package buildcraft.api.lists; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public abstract class ListMatchHandler { - public enum Type { - TYPE, - MATERIAL, - CLASS - } - - public abstract boolean matches(Type type, ItemStack stack, ItemStack target, boolean precise); - - public abstract boolean isValidSource(Type type, ItemStack stack); - - /** Get custom client examples. - * - * @param type - * @param stack - * @return A List (even empty!) if the examples satisfy this handler, null if iteration and .matches should be used - * instead. */ - public List getClientExamples(Type type, ItemStack stack) { - return null; - } -} diff --git a/src/api/java/buildcraft/api/lists/ListRegistry.java b/src/api/java/buildcraft/api/lists/ListRegistry.java deleted file mode 100755 index 1f3655244..000000000 --- a/src/api/java/buildcraft/api/lists/ListRegistry.java +++ /dev/null @@ -1,26 +0,0 @@ -package buildcraft.api.lists; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.item.Item; - -public final class ListRegistry { - public static final List> itemClassAsType = new ArrayList>(); - private static final List handlers = new ArrayList(); - - private ListRegistry() { - - } - - public static void registerHandler(ListMatchHandler h) { - if (h != null) { - handlers.add(h); - } - } - - public static List getHandlers() { - return Collections.unmodifiableList(handlers); - } -} diff --git a/src/api/java/buildcraft/api/lists/package-info.java b/src/api/java/buildcraft/api/lists/package-info.java deleted file mode 100755 index 603c33587..000000000 --- a/src/api/java/buildcraft/api/lists/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|lists") -package buildcraft.api.lists; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/power/IEngine.java b/src/api/java/buildcraft/api/power/IEngine.java deleted file mode 100755 index 18901747e..000000000 --- a/src/api/java/buildcraft/api/power/IEngine.java +++ /dev/null @@ -1,26 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.power; - -import net.minecraft.util.EnumFacing; - -/** Engines should implement this interface if they want to support BuildCraft's behaviour of passing energy between - * engines without using receiveEnergy() (which has other issues). */ -public interface IEngine { - /** Returns true if the engine wants to receive power from another engine on this side. - * - * @param side - * @return */ - boolean canReceiveFromEngine(EnumFacing side); - - /** Receives energy from an engine. See - * {@link cofh.api.energy.IEnergyHandler#receiveEnergy(EnumFacing, int, boolean)} - * - * @param side The side the engine is receiving energy from. - * @param energy The amount of energy given to the engine. - * @param simulate True if the energy should not actually be added. - * @return The amount of energy used by the engine. */ - int receiveEnergyFromEngine(EnumFacing side, int energy, boolean simulate); -} diff --git a/src/api/java/buildcraft/api/power/ILaserTarget.java b/src/api/java/buildcraft/api/power/ILaserTarget.java deleted file mode 100755 index 3743d22fd..000000000 --- a/src/api/java/buildcraft/api/power/ILaserTarget.java +++ /dev/null @@ -1,26 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.power; - -/** This interface should be defined by any Tile which wants to receive energy from BuildCraft lasers. - * - * The respective Block MUST implement ILaserTargetBlock! */ -public interface ILaserTarget { - - /** Returns true if the target currently needs power. For example, if the Advanced Crafting Table has work to do. - * - * @return true if needs power */ - boolean requiresLaserEnergy(); - - /** Transfers energy from the laser to the target. - * - * @param energy */ - void receiveLaserEnergy(int energy); - - /** Return true if the Tile Entity object is no longer a valid target. For example, if its been invalidated. - * - * @return true if no longer a valid target object */ - boolean isInvalidTarget(); -} diff --git a/src/api/java/buildcraft/api/power/ILaserTargetBlock.java b/src/api/java/buildcraft/api/power/ILaserTargetBlock.java deleted file mode 100755 index 27469605c..000000000 --- a/src/api/java/buildcraft/api/power/ILaserTargetBlock.java +++ /dev/null @@ -1,12 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.power; - -/** This is a marker interface for laser targets. Implement it on your Block. - * - * It is used by BuildCraft Lasers for optimization purposes. */ -public interface ILaserTargetBlock { - -} diff --git a/src/api/java/buildcraft/api/power/IRedstoneEngine.java b/src/api/java/buildcraft/api/power/IRedstoneEngine.java deleted file mode 100755 index 3fc534d45..000000000 --- a/src/api/java/buildcraft/api/power/IRedstoneEngine.java +++ /dev/null @@ -1,7 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.power; - -public interface IRedstoneEngine {} diff --git a/src/api/java/buildcraft/api/power/IRedstoneEngineReceiver.java b/src/api/java/buildcraft/api/power/IRedstoneEngineReceiver.java deleted file mode 100755 index 213d06fe2..000000000 --- a/src/api/java/buildcraft/api/power/IRedstoneEngineReceiver.java +++ /dev/null @@ -1,21 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.power; - -import net.minecraft.util.EnumFacing; - -import cofh.api.energy.IEnergyReceiver; - -/** Implement this on tiles that you wish to be able to receive Redstone Engine (low-power) energy. - * - * Please do not implement it on batteries, pipes or machines which can have their energy extracted from. That could - * lead to exploits and abuse. */ -public interface IRedstoneEngineReceiver extends IEnergyReceiver { - /** This function is queried on every attempt to receive energy from a redstone engine as well. - * - * @param side - * @return */ - boolean canConnectRedstoneEngine(EnumFacing side); -} diff --git a/src/api/java/buildcraft/api/power/package-info.java b/src/api/java/buildcraft/api/power/package-info.java deleted file mode 100755 index c20c3ee4c..000000000 --- a/src/api/java/buildcraft/api/power/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.3", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|power") -package buildcraft.api.power; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/recipes/BuildcraftRecipeRegistry.java b/src/api/java/buildcraft/api/recipes/BuildcraftRecipeRegistry.java deleted file mode 100755 index 72904b5cb..000000000 --- a/src/api/java/buildcraft/api/recipes/BuildcraftRecipeRegistry.java +++ /dev/null @@ -1,16 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -public final class BuildcraftRecipeRegistry { - - public static IAssemblyRecipeManager assemblyTable; - public static IIntegrationRecipeManager integrationTable; - public static IRefineryRecipeManager refinery; - public static IProgrammingRecipeManager programmingTable; - public static IComplexRefineryRecipeManager complexRefinery; - - private BuildcraftRecipeRegistry() {} -} diff --git a/src/api/java/buildcraft/api/recipes/CraftingResult.java b/src/api/java/buildcraft/api/recipes/CraftingResult.java deleted file mode 100755 index 53fde5cf2..000000000 --- a/src/api/java/buildcraft/api/recipes/CraftingResult.java +++ /dev/null @@ -1,21 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -public class CraftingResult { - - public T crafted = null; - public ArrayList usedItems = new ArrayList(); - public ArrayList usedFluids = new ArrayList(); - public int energyCost = 0; - public long craftingTime = 0; - public IFlexibleRecipe recipe; -} diff --git a/src/api/java/buildcraft/api/recipes/IAssemblyRecipeManager.java b/src/api/java/buildcraft/api/recipes/IAssemblyRecipeManager.java deleted file mode 100755 index b9f29ca18..000000000 --- a/src/api/java/buildcraft/api/recipes/IAssemblyRecipeManager.java +++ /dev/null @@ -1,27 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.Collection; - -import net.minecraft.item.ItemStack; - -public interface IAssemblyRecipeManager { - - /** Add an Assembly Table recipe. - * - * @param input Object... containing either an ItemStack, or a paired string and integer(ex: "dyeBlue", 1) - * @param energyCost RF cost to produce - * @param output resulting ItemStack */ - void addRecipe(String id, int energyCost, ItemStack output, Object... input); - - void addRecipe(IFlexibleRecipe recipe); - - void removeRecipe(String id); - - void removeRecipe(IFlexibleRecipe recipe); - - Collection> getRecipes(); -} diff --git a/src/api/java/buildcraft/api/recipes/IComplexRefineryRecipeManager.java b/src/api/java/buildcraft/api/recipes/IComplexRefineryRecipeManager.java deleted file mode 100755 index 5623b5eaa..000000000 --- a/src/api/java/buildcraft/api/recipes/IComplexRefineryRecipeManager.java +++ /dev/null @@ -1,66 +0,0 @@ -package buildcraft.api.recipes; - -import java.util.Set; - -import com.google.common.base.Predicate; - -import net.minecraftforge.fluids.FluidStack; - -public interface IComplexRefineryRecipeManager { - IHeatableRecipe createHeatingRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo, int ticks); - - IHeatableRecipe addHeatableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo, int ticks, boolean replaceExisting); - - ICoolableRecipe createCoolableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo, int ticks); - - ICoolableRecipe addCoolableRecipe(FluidStack in, FluidStack out, int heatFrom, int heatTo, int ticks, boolean replaceExisting); - - IDistilationRecipe createDistilationRecipe(FluidStack in, FluidStack outGas, FluidStack outLiquid, int ticks); - - IDistilationRecipe addDistilationRecipe(FluidStack in, FluidStack outGas, FluidStack outLiquid, int ticks, boolean replaceExisting); - - IComplexRefineryRegistry getHeatableRegistry(); - - IComplexRefineryRegistry getCoolableRegistry(); - - IComplexRefineryRegistry getDistilationRegistry(); - - public interface IComplexRefineryRegistry { - /** @return an unmodifiable set containing all of the distilation recipies that satisfy the given predicate. All - * of the recipe objects are guarenteed to never be null. */ - Set getRecipes(Predicate toReturn); - - /** @return an unmodifiable set containing all of the distilation recipies. */ - Set getAllRecipes(); - - R getRecipeForInput(FluidStack fluid); - - Set removeRecipes(Predicate toRemove); - - R addRecipe(R recipe, boolean replaceExisting); - } - - public interface IComplexRefineryRecipe { - int ticks(); - - FluidStack in(); - } - - public interface IHeatExchangerRecipe extends IComplexRefineryRecipe { - FluidStack out(); - - int heatFrom(); - - int heatTo(); - } - - public interface IHeatableRecipe extends IHeatExchangerRecipe {} - - public interface ICoolableRecipe extends IHeatExchangerRecipe {} - - public interface IDistilationRecipe extends IComplexRefineryRecipe { - FluidStack outGas(); - - FluidStack outLiquid(); - } -} diff --git a/src/api/java/buildcraft/api/recipes/IFlexibleCrafter.java b/src/api/java/buildcraft/api/recipes/IFlexibleCrafter.java deleted file mode 100755 index 3cad0d5d9..000000000 --- a/src/api/java/buildcraft/api/recipes/IFlexibleCrafter.java +++ /dev/null @@ -1,25 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -public interface IFlexibleCrafter { - - int getCraftingItemStackSize(); - - ItemStack getCraftingItemStack(int slotid); - - ItemStack decrCraftingItemStack(int slotid, int val); - - FluidStack getCraftingFluidStack(int tankid); - - FluidStack decrCraftingFluidStack(int tankid, int val); - - int getCraftingFluidStackSize(); - -} diff --git a/src/api/java/buildcraft/api/recipes/IFlexibleRecipe.java b/src/api/java/buildcraft/api/recipes/IFlexibleRecipe.java deleted file mode 100755 index 53565499d..000000000 --- a/src/api/java/buildcraft/api/recipes/IFlexibleRecipe.java +++ /dev/null @@ -1,18 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import net.minecraft.item.ItemStack; - -public interface IFlexibleRecipe { - - boolean canBeCrafted(IFlexibleCrafter crafter); - - CraftingResult craft(IFlexibleCrafter crafter, boolean preview); - - CraftingResult canCraft(ItemStack expectedOutput); - - String getId(); -} diff --git a/src/api/java/buildcraft/api/recipes/IFlexibleRecipeViewable.java b/src/api/java/buildcraft/api/recipes/IFlexibleRecipeViewable.java deleted file mode 100755 index d19170fa0..000000000 --- a/src/api/java/buildcraft/api/recipes/IFlexibleRecipeViewable.java +++ /dev/null @@ -1,25 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.Collection; - -/** This class is intended for mods such as Not Enough Items in order for them to be able to look inside a recipe. - * - * It is intentionally left as a separate interface, so that it remains possible to register a "dynamic" flexible recipe - * which does not have static inputs and outputs. - * - * @author asie */ -public interface IFlexibleRecipeViewable { - Object getOutput(); - - /** With BuildCraft's implementation (as of 6.1.3), this might contain either an ItemStack, a List<ItemStack> - * or a FluidStack. */ - Collection getInputs(); - - long getCraftingTime(); - - int getEnergyCost(); -} diff --git a/src/api/java/buildcraft/api/recipes/IIntegrationRecipe.java b/src/api/java/buildcraft/api/recipes/IIntegrationRecipe.java deleted file mode 100755 index 8aeb25ade..000000000 --- a/src/api/java/buildcraft/api/recipes/IIntegrationRecipe.java +++ /dev/null @@ -1,59 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IIntegrationRecipe { - /** Get the energy cost (in RF) of the recipe. - * - * @return The energy cost of the recipe. */ - int getEnergyCost(); - - /** Get a list of example inputs. This is used for recipe preview. - * - * @return A list of example inputs. */ - List getExampleInput(); - - /** Get a list of example expansions. This is used for recipe preview. If the amount of lists of expansions is - * smaller than the maximum expansion count, the lists will be repeated. - * - * @return A list of every slot's list of example expansions. */ - List> getExampleExpansions(); - - /** Get a list of example outputs. This is used for recipe preview. - * - * @return A list of example outputs. */ - List getExampleOutput(); - - /** Check if an input is valid. - * - * @param input The input. - * @return Whether the input is valid. */ - boolean isValidInput(ItemStack input); - - /** Check if an expansion is valid. - * - * @param input The input currently in. - * @param expansion The expansion. - * @return Whether the expansion can be fitted to a given input. */ - boolean isValidExpansion(ItemStack input, ItemStack expansion); - - /** Craft the recipe. Keep in mind that you need to decrease the amount of expansions yourself - the amount of - * inputs is decreased for you. - * - * @param input The input. - * @param expansions All inserted expansions. - * @param preview If true, do not decrease the amount of expansions. - * @return The output stack. */ - ItemStack craft(ItemStack input, List expansions, boolean preview); - - /** Returns the maximum count of expansions this recipe can have. - * - * @return -1 for no limit, a different number otherwise */ - int getMaximumExpansionCount(ItemStack input); -} diff --git a/src/api/java/buildcraft/api/recipes/IIntegrationRecipeManager.java b/src/api/java/buildcraft/api/recipes/IIntegrationRecipeManager.java deleted file mode 100755 index 7bf51e456..000000000 --- a/src/api/java/buildcraft/api/recipes/IIntegrationRecipeManager.java +++ /dev/null @@ -1,13 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.List; - -public interface IIntegrationRecipeManager { - void addRecipe(IIntegrationRecipe recipe); - - List getRecipes(); -} diff --git a/src/api/java/buildcraft/api/recipes/IProgrammingRecipe.java b/src/api/java/buildcraft/api/recipes/IProgrammingRecipe.java deleted file mode 100755 index 3141196fb..000000000 --- a/src/api/java/buildcraft/api/recipes/IProgrammingRecipe.java +++ /dev/null @@ -1,33 +0,0 @@ -package buildcraft.api.recipes; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IProgrammingRecipe { - String getId(); - - /** Get a list (size at least width*height) of ItemStacks representing options. - * - * @param width The width of the Programming Table panel. - * @param height The height of the Programming Table panel. - * @return */ - List getOptions(int width, int height); - - /** Get the energy cost of a given option ItemStack. - * - * @param option - * @return */ - int getEnergyCost(ItemStack option); - - /** @param input The input stack. - * @return Whether this recipe applies to the given input stack. */ - boolean canCraft(ItemStack input); - - /** Craft the input ItemStack with the given option into an output ItemStack. - * - * @param input - * @param option - * @return The output ItemStack. */ - ItemStack craft(ItemStack input, ItemStack option); -} diff --git a/src/api/java/buildcraft/api/recipes/IProgrammingRecipeManager.java b/src/api/java/buildcraft/api/recipes/IProgrammingRecipeManager.java deleted file mode 100755 index 1ea444631..000000000 --- a/src/api/java/buildcraft/api/recipes/IProgrammingRecipeManager.java +++ /dev/null @@ -1,19 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.Collection; - -public interface IProgrammingRecipeManager { - void addRecipe(IProgrammingRecipe recipe); - - void removeRecipe(String id); - - void removeRecipe(IProgrammingRecipe recipe); - - IProgrammingRecipe getRecipe(String id); - - Collection getRecipes(); -} diff --git a/src/api/java/buildcraft/api/recipes/IRecipeManager.java b/src/api/java/buildcraft/api/recipes/IRecipeManager.java deleted file mode 100755 index fa767734a..000000000 --- a/src/api/java/buildcraft/api/recipes/IRecipeManager.java +++ /dev/null @@ -1,29 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.Collection; - -public interface IRecipeManager { - - /** Add a recipe. - * - * @param input Object... containing either an ItemStack, or a paired string and integer(ex: "dyeBlue", 1) - * @param energyCost RF cost to produce - * @param output resulting ItemStack */ - void addRecipe(String id, int energyCost, T output, Object... input); - - void addRecipe(String id, int energyCost, int craftingDelay, T output, Object... input); - - void addRecipe(IFlexibleRecipe recipe); - - void removeRecipe(String id); - - void removeRecipe(IFlexibleRecipe recipe); - - Collection> getRecipes(); - - IFlexibleRecipe getRecipe(String id); -} diff --git a/src/api/java/buildcraft/api/recipes/IRefineryRecipeManager.java b/src/api/java/buildcraft/api/recipes/IRefineryRecipeManager.java deleted file mode 100755 index b310fe236..000000000 --- a/src/api/java/buildcraft/api/recipes/IRefineryRecipeManager.java +++ /dev/null @@ -1,25 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.recipes; - -import java.util.Collection; - -import net.minecraftforge.fluids.FluidStack; - -public interface IRefineryRecipeManager { - - void addRecipe(String id, FluidStack ingredient, FluidStack result, int energy, int delay); - - void addRecipe(String id, FluidStack ingredient1, FluidStack ingredient2, FluidStack result, int energy, int delay); - - void removeRecipe(String id); - - void removeRecipe(IFlexibleRecipe recipe); - - Collection> getRecipes(); - - IFlexibleRecipe getRecipe(String currentRecipeId); - -} diff --git a/src/api/java/buildcraft/api/recipes/package-info.java b/src/api/java/buildcraft/api/recipes/package-info.java deleted file mode 100755 index f8cc9942a..000000000 --- a/src/api/java/buildcraft/api/recipes/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "3.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|recipes") -package buildcraft.api.recipes; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/robots/AIRobot.java b/src/api/java/buildcraft/api/robots/AIRobot.java deleted file mode 100755 index 8c401d960..000000000 --- a/src/api/java/buildcraft/api/robots/AIRobot.java +++ /dev/null @@ -1,220 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.robots; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class AIRobot { - public EntityRobotBase robot; - - private AIRobot delegateAI; - private AIRobot parentAI; - - private boolean success; - - public AIRobot(EntityRobotBase iRobot) { - robot = iRobot; - success = true; - } - - public void start() { - - } - - public void preempt(AIRobot ai) { - - } - - public void update() { - // Update should always handle terminate. Some AI are not using update - // at all, their code being in start() and end(). In these case, - // calling update is a malfunction, the ai should be terminated. - terminate(); - } - - public void end() { - - } - - /** This gets called when a delegate AI ends work naturally. - * - * @param ai The delegate AI which ended work. */ - public void delegateAIEnded(AIRobot ai) { - - } - - /** This gets called when a delegate AI is forcibly aborted. - * - * @param ai The delegate AI which was aborted. */ - public void delegateAIAborted(AIRobot ai) { - - } - - public void writeSelfToNBT(NBTTagCompound nbt) { - - } - - public void loadSelfFromNBT(NBTTagCompound nbt) { - - } - - public boolean success() { - return success; - } - - protected void setSuccess(boolean iSuccess) { - success = iSuccess; - } - - public int getEnergyCost() { - return 1; - } - - public boolean canLoadFromNBT() { - return false; - } - - /** Tries to receive items in parameters, return items that are left after the operation. */ - public ItemStack receiveItem(ItemStack stack) { - return stack; - } - - public final void terminate() { - abortDelegateAI(); - end(); - - if (parentAI != null) { - parentAI.delegateAI = null; - parentAI.delegateAIEnded(this); - } - } - - public final void abort() { - abortDelegateAI(); - - try { - end(); - - if (parentAI != null) { - parentAI.delegateAI = null; - parentAI.delegateAIAborted(this); - } - } catch (Throwable e) { - e.printStackTrace(); - delegateAI = null; - - if (parentAI != null) { - parentAI.delegateAI = null; - } - } - } - - public final void cycle() { - try { - preempt(delegateAI); - - if (delegateAI != null) { - delegateAI.cycle(); - } else { - robot.getBattery().extractEnergy(getEnergyCost(), false); - update(); - } - } catch (Throwable e) { - e.printStackTrace(); - abort(); - } - } - - public final void startDelegateAI(AIRobot ai) { - abortDelegateAI(); - delegateAI = ai; - ai.parentAI = this; - delegateAI.start(); - } - - public final void abortDelegateAI() { - if (delegateAI != null) { - delegateAI.abort(); - } - } - - public final AIRobot getActiveAI() { - if (delegateAI != null) { - return delegateAI.getActiveAI(); - } else { - return this; - } - } - - public final AIRobot getDelegateAI() { - return delegateAI; - } - - public final void writeToNBT(NBTTagCompound nbt) { - nbt.setString("aiName", RobotManager.getAIRobotName(getClass())); - - NBTTagCompound data = new NBTTagCompound(); - writeSelfToNBT(data); - nbt.setTag("data", data); - - if (delegateAI != null && delegateAI.canLoadFromNBT()) { - NBTTagCompound sub = new NBTTagCompound(); - - delegateAI.writeToNBT(sub); - nbt.setTag("delegateAI", sub); - } - } - - public final void loadFromNBT(NBTTagCompound nbt) { - loadSelfFromNBT(nbt.getCompoundTag("data")); - - if (nbt.hasKey("delegateAI")) { - NBTTagCompound sub = nbt.getCompoundTag("delegateAI"); - - try { - Class aiRobotClass; - if (sub.hasKey("class")) { - // Migration support for 6.4.x - aiRobotClass = RobotManager.getAIRobotByLegacyClassName(sub.getString("class")); - } else { - aiRobotClass = RobotManager.getAIRobotByName(sub.getString("aiName")); - } - if (aiRobotClass != null) { - delegateAI = (AIRobot) aiRobotClass.getConstructor(EntityRobotBase.class).newInstance(robot); - delegateAI.parentAI = this; - - if (delegateAI.canLoadFromNBT()) { - delegateAI.loadFromNBT(sub); - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - } - } - - public static AIRobot loadAI(NBTTagCompound nbt, EntityRobotBase robot) { - AIRobot ai = null; - - try { - Class aiRobotClass; - if (nbt.hasKey("class")) { - // Migration support for 6.4.x - aiRobotClass = RobotManager.getAIRobotByLegacyClassName(nbt.getString("class")); - } else { - aiRobotClass = RobotManager.getAIRobotByName(nbt.getString("aiName")); - } - if (aiRobotClass != null) { - ai = (AIRobot) aiRobotClass.getConstructor(EntityRobotBase.class).newInstance(robot); - ai.loadFromNBT(nbt); - } - } catch (Throwable e) { - e.printStackTrace(); - } - - return ai; - } -} diff --git a/src/api/java/buildcraft/api/robots/DockingStation.java b/src/api/java/buildcraft/api/robots/DockingStation.java deleted file mode 100755 index a1b6a1b89..000000000 --- a/src/api/java/buildcraft/api/robots/DockingStation.java +++ /dev/null @@ -1,225 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team 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.robots; - -import net.minecraft.inventory.IInventory; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import net.minecraftforge.fluids.IFluidHandler; - -import buildcraft.api.core.BCLog; -import buildcraft.api.core.EnumPipePart; -import buildcraft.api.statements.StatementSlot; -import buildcraft.api.transport.IInjectable; - -public abstract class DockingStation { - public EnumFacing side; - public World world; - - private long robotTakingId = EntityRobotBase.NULL_ROBOT_ID; - private EntityRobotBase robotTaking; - - private boolean linkIsMain = false; - - private BlockPos pos; - - public DockingStation(BlockPos iIndex, EnumFacing iSide) { - pos = iIndex; - side = iSide; - } - - public DockingStation() {} - - public boolean isMainStation() { - return linkIsMain; - } - - public BlockPos getPos() { - return pos; - } - - public EnumFacing side() { - return side; - } - - public EntityRobotBase robotTaking() { - if (robotTakingId == EntityRobotBase.NULL_ROBOT_ID) { - return null; - } else if (robotTaking == null) { - robotTaking = RobotManager.registryProvider.getRegistry(world).getLoadedRobot(robotTakingId); - } - - return robotTaking; - } - - public void invalidateRobotTakingEntity() { - robotTaking = null; - } - - public long linkedId() { - return robotTakingId; - } - - public boolean takeAsMain(EntityRobotBase robot) { - if (robotTakingId == EntityRobotBase.NULL_ROBOT_ID) { - IRobotRegistry registry = RobotManager.registryProvider.getRegistry(world); - linkIsMain = true; - robotTaking = robot; - robotTakingId = robot.getRobotId(); - registry.registryMarkDirty(); - robot.setMainStation(this); - registry.take(this, robot.getRobotId()); - - return true; - } else { - return robotTakingId == robot.getRobotId(); - } - } - - public boolean take(EntityRobotBase robot) { - if (robotTaking == null) { - IRobotRegistry registry = RobotManager.registryProvider.getRegistry(world); - linkIsMain = false; - robotTaking = robot; - robotTakingId = robot.getRobotId(); - registry.registryMarkDirty(); - registry.take(this, robot.getRobotId()); - - return true; - } else { - return robot.getRobotId() == robotTakingId; - } - } - - public void release(EntityRobotBase robot) { - if (robotTaking == robot && !linkIsMain) { - IRobotRegistry registry = RobotManager.registryProvider.getRegistry(world); - unsafeRelease(robot); - registry.registryMarkDirty(); - registry.release(this, robot.getRobotId()); - } - } - - /** Same a release but doesn't clear the registry (presumably called from the registry). */ - public void unsafeRelease(EntityRobotBase robot) { - if (robotTaking == robot) { - linkIsMain = false; - robotTaking = null; - robotTakingId = EntityRobotBase.NULL_ROBOT_ID; - } - } - - public void writeToNBT(NBTTagCompound nbt) { - nbt.setIntArray("pos", new int[] { getPos().getX(), getPos().getY(), getPos().getZ() }); - nbt.setByte("side", (byte) side.ordinal()); - nbt.setBoolean("isMain", linkIsMain); - nbt.setLong("robotId", robotTakingId); - } - - public void readFromNBT(NBTTagCompound nbt) { - if (nbt.hasKey("index")) { - // For compatibility with older versions of minecraft and buildcraft - NBTTagCompound indexNBT = nbt.getCompoundTag("index"); - int x = indexNBT.getInteger("i"); - int y = indexNBT.getInteger("j"); - int z = indexNBT.getInteger("k"); - pos = new BlockPos(x, y, z); - } else { - int[] array = nbt.getIntArray("pos"); - if (array.length == 3) { - pos = new BlockPos(array[0], array[1], array[2]); - } else if (array.length != 0) { - BCLog.logger.warn("Found an integer array that wwas not the right length! (" + array + ")"); - } else { - BCLog.logger.warn("Did not find any integer positions! This is a bug!"); - } - } - side = EnumFacing.values()[nbt.getByte("side")]; - linkIsMain = nbt.getBoolean("isMain"); - robotTakingId = nbt.getLong("robotId"); - } - - public boolean isTaken() { - return robotTakingId != EntityRobotBase.NULL_ROBOT_ID; - } - - public long robotIdTaking() { - return robotTakingId; - } - - public BlockPos index() { - return pos; - } - - @Override - public String toString() { - return "{" + pos + ", " + side + " :" + robotTakingId + "}"; - } - - public boolean linkIsDocked() { - if (robotTaking() != null) { - return robotTaking().getDockingStation() == this; - } else { - return false; - } - } - - public boolean canRelease() { - return !isMainStation() && !linkIsDocked(); - } - - public boolean isInitialized() { - return true; - } - - public abstract Iterable getActiveActions(); - - public IInjectable getItemOutput() { - return null; - } - - public EnumPipePart getItemOutputSide() { - return EnumPipePart.CENTER; - } - - public IInventory getItemInput() { - return null; - } - - public EnumPipePart getItemInputSide() { - return EnumPipePart.CENTER; - } - - public IFluidHandler getFluidOutput() { - return null; - } - - public EnumPipePart getFluidOutputSide() { - return EnumPipePart.CENTER; - } - - public IFluidHandler getFluidInput() { - return null; - } - - public EnumPipePart getFluidInputSide() { - return EnumPipePart.CENTER; - } - - public boolean providesPower() { - return false; - } - - public IRequestProvider getRequestProvider() { - return null; - } - - public void onChunkUnload() { - - } -} diff --git a/src/api/java/buildcraft/api/robots/EntityRobotBase.java b/src/api/java/buildcraft/api/robots/EntityRobotBase.java deleted file mode 100755 index 49ffe0999..000000000 --- a/src/api/java/buildcraft/api/robots/EntityRobotBase.java +++ /dev/null @@ -1,84 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.robots; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import net.minecraftforge.fluids.IFluidHandler; - -import cofh.api.energy.IEnergyStorage; - -import buildcraft.api.boards.RedstoneBoardRobot; -import buildcraft.api.core.IZone; - -public abstract class EntityRobotBase extends EntityLiving implements IInventory, IFluidHandler { - - public static final int MAX_ENERGY = 100000; - public static final int SAFETY_ENERGY = MAX_ENERGY / 5; - public static final int SHUTDOWN_ENERGY = 0; - public static final long NULL_ROBOT_ID = Long.MAX_VALUE; - - public EntityRobotBase(World par1World) { - super(par1World); - } - - public abstract void setItemInUse(ItemStack stack); - - public abstract void setItemActive(boolean b); - - public abstract boolean isMoving(); - - public abstract DockingStation getLinkedStation(); - - public abstract RedstoneBoardRobot getBoard(); - - public abstract void aimItemAt(float yaw, float pitch); - - public abstract void aimItemAt(BlockPos pos); - - public abstract float getAimYaw(); - - public abstract float getAimPitch(); - - public abstract int getEnergy(); - - public abstract IEnergyStorage getBattery(); - - public abstract DockingStation getDockingStation(); - - public abstract void dock(DockingStation station); - - public abstract void undock(); - - public abstract IZone getZoneToWork(); - - public abstract IZone getZoneToLoadUnload(); - - public abstract boolean containsItems(); - - public abstract boolean hasFreeSlot(); - - public abstract void unreachableEntityDetected(Entity entity); - - public abstract boolean isKnownUnreachable(Entity entity); - - public abstract long getRobotId(); - - public abstract IRobotRegistry getRegistry(); - - public abstract void releaseResources(); - - public abstract void onChunkUnload(); - - public abstract ItemStack receiveItem(TileEntity tile, ItemStack stack); - - public abstract void setMainStation(DockingStation station); -} diff --git a/src/api/java/buildcraft/api/robots/IDockingStationProvider.java b/src/api/java/buildcraft/api/robots/IDockingStationProvider.java deleted file mode 100755 index 0cbd3c3b8..000000000 --- a/src/api/java/buildcraft/api/robots/IDockingStationProvider.java +++ /dev/null @@ -1,6 +0,0 @@ -package buildcraft.api.robots; - -/** By default, this can be either an IPipePluggable or a TileEntity. */ -public interface IDockingStationProvider { - DockingStation getStation(); -} diff --git a/src/api/java/buildcraft/api/robots/IRequestProvider.java b/src/api/java/buildcraft/api/robots/IRequestProvider.java deleted file mode 100755 index 2e56148a8..000000000 --- a/src/api/java/buildcraft/api/robots/IRequestProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.robots; - -import net.minecraft.item.ItemStack; - -/** Provide requests of items that need to be fulfilled. - * - * Requests are organized as an linear array, where null entries mark slots without a requests. A request in a slot, or - * the amount of slots, is allowed to change before a call to {@link #offerItem(int, ItemStack)}, but it is not - * recommended that this is frequent, since the request delivery won't fail until it is offered the previous request. */ -public interface IRequestProvider { - /** Return the total number of request slots available from this provider. - * - * @return */ - int getRequestsCount(); - - /** Return a stack with the request in the slot. - * - * @param slot - * @return the request in the slot, or null if there's no request. */ - ItemStack getRequest(int slot); - - /** Fulfill the request in slot with the stack given and return any excess. - * - * @param slot - * @param stack - * @return any excess that was not used to fulfill the request. */ - ItemStack offerItem(int slot, ItemStack stack); -} diff --git a/src/api/java/buildcraft/api/robots/IRobotOverlayItem.java b/src/api/java/buildcraft/api/robots/IRobotOverlayItem.java deleted file mode 100755 index fa39ee1a1..000000000 --- a/src/api/java/buildcraft/api/robots/IRobotOverlayItem.java +++ /dev/null @@ -1,14 +0,0 @@ -package buildcraft.api.robots; - -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public interface IRobotOverlayItem { - boolean isValidRobotOverlay(ItemStack stack); - - @SideOnly(Side.CLIENT) - void renderRobotOverlay(ItemStack stack, TextureManager textureManager); -} diff --git a/src/api/java/buildcraft/api/robots/IRobotRegistry.java b/src/api/java/buildcraft/api/robots/IRobotRegistry.java deleted file mode 100755 index 96360f564..000000000 --- a/src/api/java/buildcraft/api/robots/IRobotRegistry.java +++ /dev/null @@ -1,56 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.robots; - -import java.util.Collection; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; - -public interface IRobotRegistry { - - long getNextRobotId(); - - void registerRobot(EntityRobotBase robot); - - void killRobot(EntityRobotBase robot); - - void unloadRobot(EntityRobotBase robot); - - EntityRobotBase getLoadedRobot(long id); - - boolean isTaken(ResourceId resourceId); - - long robotIdTaking(ResourceId resourceId); - - EntityRobotBase robotTaking(ResourceId resourceId); - - boolean take(ResourceId resourceId, EntityRobotBase robot); - - boolean take(ResourceId resourceId, long robotId); - - void release(ResourceId resourceId); - - void releaseResources(EntityRobotBase robot); - - DockingStation getStation(BlockPos pos, EnumFacing side); - - Collection getStations(); - - void registerStation(DockingStation station); - - void removeStation(DockingStation station); - - void take(DockingStation station, long robotId); - - void release(DockingStation station, long robotId); - - void writeToNBT(NBTTagCompound nbt); - - void readFromNBT(NBTTagCompound nbt); - - void registryMarkDirty(); -} diff --git a/src/api/java/buildcraft/api/robots/IRobotRegistryProvider.java b/src/api/java/buildcraft/api/robots/IRobotRegistryProvider.java deleted file mode 100755 index 001249453..000000000 --- a/src/api/java/buildcraft/api/robots/IRobotRegistryProvider.java +++ /dev/null @@ -1,7 +0,0 @@ -package buildcraft.api.robots; - -import net.minecraft.world.World; - -public interface IRobotRegistryProvider { - IRobotRegistry getRegistry(World world); -} diff --git a/src/api/java/buildcraft/api/robots/ResourceId.java b/src/api/java/buildcraft/api/robots/ResourceId.java deleted file mode 100755 index 539503a0f..000000000 --- a/src/api/java/buildcraft/api/robots/ResourceId.java +++ /dev/null @@ -1,39 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.robots; - -import net.minecraft.nbt.NBTTagCompound; - -public abstract class ResourceId { - - protected ResourceId() {} - - public void writeToNBT(NBTTagCompound nbt) { - nbt.setString("resourceName", RobotManager.getResourceIdName(getClass())); - } - - protected void readFromNBT(NBTTagCompound nbt) {} - - public static ResourceId load(NBTTagCompound nbt) { - try { - Class cls; - if (nbt.hasKey("class")) { - // Migration support for 6.4.x - cls = RobotManager.getResourceIdByLegacyClassName(nbt.getString("class")); - } else { - cls = RobotManager.getResourceIdByName(nbt.getString("resourceName")); - } - - ResourceId id = (ResourceId) cls.newInstance(); - id.readFromNBT(nbt); - - return id; - } catch (Throwable e) { - e.printStackTrace(); - } - - return null; - } -} diff --git a/src/api/java/buildcraft/api/robots/ResourceIdBlock.java b/src/api/java/buildcraft/api/robots/ResourceIdBlock.java deleted file mode 100755 index 4e70b1797..000000000 --- a/src/api/java/buildcraft/api/robots/ResourceIdBlock.java +++ /dev/null @@ -1,70 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team 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.robots; - -import org.apache.commons.lang3.builder.HashCodeBuilder; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; - -import buildcraft.api.core.EnumPipePart; - -public class ResourceIdBlock extends ResourceId { - - public BlockPos pos = new BlockPos(0, 0, 0); - public EnumPipePart side = EnumPipePart.CENTER; - - public ResourceIdBlock() { - - } - - public ResourceIdBlock(int x, int y, int z) { - pos = new BlockPos(x, y, z); - } - - public ResourceIdBlock(BlockPos iIndex) { - pos = iIndex; - } - - public ResourceIdBlock(TileEntity tile) { - pos = tile.getPos(); - } - - @Override - public boolean equals(Object obj) { - if (obj == null || obj.getClass() != getClass()) { - return false; - } - - ResourceIdBlock compareId = (ResourceIdBlock) obj; - - return pos.equals(compareId.pos) && side == compareId.side; - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(pos.hashCode()).append(side != null ? side.ordinal() : 0).build(); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - - int[] arr = new int[] { pos.getX(), pos.getY(), pos.getZ() }; - nbt.setIntArray("pos", arr); - - nbt.setTag("side", side.writeToNBT()); - } - - @Override - protected void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - int[] arr = nbt.getIntArray("pos"); - pos = new BlockPos(arr[0], arr[1], arr[2]); - - side = EnumPipePart.readFromNBT(nbt.getTag("side")); - } -} diff --git a/src/api/java/buildcraft/api/robots/ResourceIdRequest.java b/src/api/java/buildcraft/api/robots/ResourceIdRequest.java deleted file mode 100755 index ab37ad2c6..000000000 --- a/src/api/java/buildcraft/api/robots/ResourceIdRequest.java +++ /dev/null @@ -1,53 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team 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.robots; - -import org.apache.commons.lang3.builder.HashCodeBuilder; - -import net.minecraft.nbt.NBTTagCompound; - -import buildcraft.api.core.EnumPipePart; - -public class ResourceIdRequest extends ResourceIdBlock { - - private int slot; - - public ResourceIdRequest() { - - } - - public ResourceIdRequest(DockingStation station, int slot) { - pos = station.index(); - side = EnumPipePart.fromFacing(station.side()); - this.slot = slot; - } - - @Override - public boolean equals(Object obj) { - if (!super.equals(obj)) return false; - ResourceIdRequest compareId = (ResourceIdRequest) obj; - - return slot == compareId.slot; - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(super.hashCode()).append(slot).build(); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - - nbt.setInteger("localId", slot); - } - - @Override - protected void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - - slot = nbt.getInteger("localId"); - } -} diff --git a/src/api/java/buildcraft/api/robots/RobotManager.java b/src/api/java/buildcraft/api/robots/RobotManager.java deleted file mode 100755 index aa59fc4d7..000000000 --- a/src/api/java/buildcraft/api/robots/RobotManager.java +++ /dev/null @@ -1,114 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team 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.robots; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -import buildcraft.api.core.BCLog; - -public abstract class RobotManager { - public static IRobotRegistryProvider registryProvider; - public static ArrayList> aiRobots = new ArrayList>(); - - static { - aiRobotsByNames = new HashMap>(); - aiRobotsNames = new HashMap, String>(); - aiRobotsByLegacyClassNames = new HashMap>(); - resourceIdNames = new HashMap, String>(); - resourceIdByNames = new HashMap>(); - resourceIdLegacyClassNames = new HashMap>(); - dockingStationNames = new HashMap, String>(); - dockingStationByNames = new HashMap>(); - - registerResourceId(ResourceIdBlock.class, "resourceIdBlock", "buildcraft.core.robots.ResourceIdBlock"); - registerResourceId(ResourceIdRequest.class, "resourceIdRequest", "buildcraft.core.robots.ResourceIdRequest"); - } - - private static Map, String> aiRobotsNames; - private static Map> aiRobotsByNames; - private static Map> aiRobotsByLegacyClassNames; - - private static Map, String> resourceIdNames; - private static Map> resourceIdByNames; - private static Map> resourceIdLegacyClassNames; - - private static Map, String> dockingStationNames; - private static Map> dockingStationByNames; - - public static void registerAIRobot(Class aiRobot, String name) { - registerAIRobot(aiRobot, name, null); - } - - public static void registerAIRobot(Class aiRobot, String name, String legacyClassName) { - if (aiRobotsByNames.containsKey(name)) { - BCLog.logger.info("Overriding " + aiRobotsByNames.get(name).getName() + " with " + aiRobot.getName()); - } - - // Check if NBT-load constructor is present - try { - aiRobot.getConstructor(EntityRobotBase.class); - } catch (NoSuchMethodException e) { - throw new RuntimeException("AI class " + aiRobot.getName() + " lacks NBT load construtor! This is a bug!"); - } - - aiRobots.add(aiRobot); - aiRobotsByNames.put(name, aiRobot); - aiRobotsNames.put(aiRobot, name); - if (legacyClassName != null) { - aiRobotsByLegacyClassNames.put(legacyClassName, aiRobot); - } - } - - public static Class getAIRobotByName(String aiRobotName) { - return aiRobotsByNames.get(aiRobotName); - } - - public static String getAIRobotName(Class aiRobotClass) { - return aiRobotsNames.get(aiRobotClass); - } - - public static Class getAIRobotByLegacyClassName(String aiRobotLegacyClassName) { - return aiRobotsByLegacyClassNames.get(aiRobotLegacyClassName); - } - - public static void registerResourceId(Class resourceId, String name) { - registerResourceId(resourceId, name, null); - } - - public static void registerResourceId(Class resourceId, String name, String legacyClassName) { - resourceIdByNames.put(name, resourceId); - resourceIdNames.put(resourceId, name); - if (legacyClassName != null) { - resourceIdLegacyClassNames.put(legacyClassName, resourceId); - } - } - - public static Class getResourceIdByName(String resourceIdName) { - return resourceIdByNames.get(resourceIdName); - } - - public static String getResourceIdName(Class resouceIdClass) { - return resourceIdNames.get(resouceIdClass); - } - - public static Class getResourceIdByLegacyClassName(String resourceIdLegacyClassName) { - return resourceIdLegacyClassNames.get(resourceIdLegacyClassName); - } - - public static void registerDockingStation(Class dockingStation, String name) { - dockingStationByNames.put(name, dockingStation); - dockingStationNames.put(dockingStation, name); - } - - public static Class getDockingStationByName(String dockingStationTypeName) { - return dockingStationByNames.get(dockingStationTypeName); - } - - public static String getDockingStationName(Class dockingStation) { - return dockingStationNames.get(dockingStation); - } -} diff --git a/src/api/java/buildcraft/api/robots/package-info.java b/src/api/java/buildcraft/api/robots/package-info.java deleted file mode 100755 index 4fd622b34..000000000 --- a/src/api/java/buildcraft/api/robots/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "3.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|robotics") -package buildcraft.api.robots; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/statements/ActionState.java b/src/api/java/buildcraft/api/statements/ActionState.java deleted file mode 100755 index 15f547c07..000000000 --- a/src/api/java/buildcraft/api/statements/ActionState.java +++ /dev/null @@ -1,9 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -public class ActionState { - -} diff --git a/src/api/java/buildcraft/api/statements/IActionExternal.java b/src/api/java/buildcraft/api/statements/IActionExternal.java deleted file mode 100755 index 21ffc92c4..000000000 --- a/src/api/java/buildcraft/api/statements/IActionExternal.java +++ /dev/null @@ -1,12 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -public interface IActionExternal extends IStatement { - void actionActivate(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); -} diff --git a/src/api/java/buildcraft/api/statements/IActionInternal.java b/src/api/java/buildcraft/api/statements/IActionInternal.java deleted file mode 100755 index 621c317e8..000000000 --- a/src/api/java/buildcraft/api/statements/IActionInternal.java +++ /dev/null @@ -1,15 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -public interface IActionInternal extends IStatement { - - void actionActivate(IStatementContainer source, IStatementParameter[] parameters); - - public interface IActionInternalSingle extends IActionInternal { - /** @return True if this action should only be fired for the first tick of it being active. */ - boolean singleActionTick(); - } -} diff --git a/src/api/java/buildcraft/api/statements/IActionProvider.java b/src/api/java/buildcraft/api/statements/IActionProvider.java deleted file mode 100755 index 5eb27abc0..000000000 --- a/src/api/java/buildcraft/api/statements/IActionProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import java.util.Collection; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -public interface IActionProvider { - void addInternalActions(Collection actions, IStatementContainer container); - - void addExternalActions(Collection actions, EnumFacing side, TileEntity tile); -} diff --git a/src/api/java/buildcraft/api/statements/IActionReceptor.java b/src/api/java/buildcraft/api/statements/IActionReceptor.java deleted file mode 100755 index 34155b86a..000000000 --- a/src/api/java/buildcraft/api/statements/IActionReceptor.java +++ /dev/null @@ -1,9 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -public interface IActionReceptor { - void actionActivated(IStatement statement, IStatementParameter[] parameters); -} diff --git a/src/api/java/buildcraft/api/statements/IOverrideDefaultStatements.java b/src/api/java/buildcraft/api/statements/IOverrideDefaultStatements.java deleted file mode 100755 index cb2dc78e1..000000000 --- a/src/api/java/buildcraft/api/statements/IOverrideDefaultStatements.java +++ /dev/null @@ -1,13 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import java.util.List; - -public interface IOverrideDefaultStatements { - List overrideTriggers(); - - List overrideActions(); -} diff --git a/src/api/java/buildcraft/api/statements/IStatement.java b/src/api/java/buildcraft/api/statements/IStatement.java deleted file mode 100755 index 123488b09..000000000 --- a/src/api/java/buildcraft/api/statements/IStatement.java +++ /dev/null @@ -1,41 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public interface IStatement { - /** Every statement needs a unique tag, it should be in the format of "<modid>:<name>. - * - * @return the unique id */ - String getUniqueTag(); - - /** Return the maximum number of parameter this statement can have, 0 if none. */ - int maxParameters(); - - /** Return the minimum number of parameter this statement can have, 0 if none. */ - int minParameters(); - - /** Return the statement description in the UI */ - String getDescription(); - - /** Create parameters for the statement. */ - IStatementParameter createParameter(int index); - - /** This returns the statement after a left rotation. Used in particular in blueprints orientation. */ - IStatement rotateLeft(); - - /** This should return the icon for this statement, suitable for rending directly into a GUI. This should refer to a - * texture on the map block texture map. */ - @SideOnly(Side.CLIENT) - TextureAtlasSprite getGuiSprite(); - - @SideOnly(Side.CLIENT) - void registerIcons(TextureMap register); -} diff --git a/src/api/java/buildcraft/api/statements/IStatementContainer.java b/src/api/java/buildcraft/api/statements/IStatementContainer.java deleted file mode 100755 index f4a73465f..000000000 --- a/src/api/java/buildcraft/api/statements/IStatementContainer.java +++ /dev/null @@ -1,12 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import net.minecraft.tileentity.TileEntity; - -/** This is implemented by objects containing Statements, such as Gates and TileEntities. */ -public interface IStatementContainer { - TileEntity getTile(); -} diff --git a/src/api/java/buildcraft/api/statements/IStatementParameter.java b/src/api/java/buildcraft/api/statements/IStatementParameter.java deleted file mode 100755 index d8b73c0ff..000000000 --- a/src/api/java/buildcraft/api/statements/IStatementParameter.java +++ /dev/null @@ -1,41 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public interface IStatementParameter { - - /** Every parameter needs a unique tag, it should be in the format of "<modid>:<name>". - * - * @return the unique id */ - String getUniqueTag(); - - @SideOnly(Side.CLIENT) - TextureAtlasSprite getIcon(); - - ItemStack getItemStack(); - - /** Return the parameter description in the UI */ - String getDescription(); - - void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse); - - void readFromNBT(NBTTagCompound compound); - - void writeToNBT(NBTTagCompound compound); - - /** This returns the parameter after a left rotation. Used in particular in blueprints orientation. */ - IStatementParameter rotateLeft(); - - @SideOnly(Side.CLIENT) - void registerIcons(TextureMap map); -} diff --git a/src/api/java/buildcraft/api/statements/ITriggerExternal.java b/src/api/java/buildcraft/api/statements/ITriggerExternal.java deleted file mode 100755 index 3db589cbc..000000000 --- a/src/api/java/buildcraft/api/statements/ITriggerExternal.java +++ /dev/null @@ -1,14 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -public interface ITriggerExternal extends IStatement { - - boolean isTriggerActive(TileEntity target, EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); - -} diff --git a/src/api/java/buildcraft/api/statements/ITriggerExternalOverride.java b/src/api/java/buildcraft/api/statements/ITriggerExternalOverride.java deleted file mode 100755 index b8628deec..000000000 --- a/src/api/java/buildcraft/api/statements/ITriggerExternalOverride.java +++ /dev/null @@ -1,16 +0,0 @@ -package buildcraft.api.statements; - -import net.minecraft.util.EnumFacing; - -/** This interface can be used by tiles to override external trigger behaviour. - * - * Please use wisely. */ -public interface ITriggerExternalOverride { - public enum Result { - TRUE, - FALSE, - IGNORE - } - - Result override(EnumFacing side, IStatementContainer source, IStatementParameter[] parameters); -} diff --git a/src/api/java/buildcraft/api/statements/ITriggerInternal.java b/src/api/java/buildcraft/api/statements/ITriggerInternal.java deleted file mode 100755 index 610a5728b..000000000 --- a/src/api/java/buildcraft/api/statements/ITriggerInternal.java +++ /dev/null @@ -1,11 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -public interface ITriggerInternal extends IStatement { - - boolean isTriggerActive(IStatementContainer source, IStatementParameter[] parameters); - -} diff --git a/src/api/java/buildcraft/api/statements/ITriggerProvider.java b/src/api/java/buildcraft/api/statements/ITriggerProvider.java deleted file mode 100755 index 847b1a0aa..000000000 --- a/src/api/java/buildcraft/api/statements/ITriggerProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import java.util.Collection; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -public interface ITriggerProvider { - void addInternalTriggers(Collection triggers, IStatementContainer container); - - /** Returns the list of triggers available to a gate next to the given block. */ - void addExternalTriggers(Collection triggers, EnumFacing side, TileEntity tile); -} diff --git a/src/api/java/buildcraft/api/statements/StatementManager.java b/src/api/java/buildcraft/api/statements/StatementManager.java deleted file mode 100755 index c3def1090..000000000 --- a/src/api/java/buildcraft/api/statements/StatementManager.java +++ /dev/null @@ -1,145 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import java.util.*; - -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import buildcraft.api.core.BCLog; - -public final class StatementManager { - - public static Map statements = new HashMap(); - public static Map> parameters = new HashMap>(); - private static List triggerProviders = new LinkedList(); - private static List actionProviders = new LinkedList(); - - /** Deactivate constructor */ - private StatementManager() {} - - public static void registerTriggerProvider(ITriggerProvider provider) { - if (provider != null && !triggerProviders.contains(provider)) { - triggerProviders.add(provider); - } - } - - public static void registerActionProvider(IActionProvider provider) { - if (provider != null && !actionProviders.contains(provider)) { - actionProviders.add(provider); - } - } - - public static void registerStatement(IStatement statement) { - statements.put(statement.getUniqueTag(), statement); - } - - public static void registerParameterClass(Class param) { - parameters.put(createParameter(param).getUniqueTag(), param); - } - - @Deprecated - public static void registerParameterClass(String name, Class param) { - parameters.put(name, param); - } - - public static List getExternalTriggers(EnumFacing side, TileEntity entity) { - if (entity instanceof IOverrideDefaultStatements) { - List result = ((IOverrideDefaultStatements) entity).overrideTriggers(); - if (result != null) { - return result; - } - } - - LinkedHashSet triggers = new LinkedHashSet(); - - for (ITriggerProvider provider : triggerProviders) { - provider.addExternalTriggers(triggers, side, entity); - } - - return new ArrayList(triggers); - } - - public static List getExternalActions(EnumFacing side, TileEntity entity) { - if (entity instanceof IOverrideDefaultStatements) { - List result = ((IOverrideDefaultStatements) entity).overrideActions(); - if (result != null) { - return result; - } - } - - LinkedHashSet actions = new LinkedHashSet(); - - for (IActionProvider provider : actionProviders) { - provider.addExternalActions(actions, side, entity); - } - - return new ArrayList(actions); - } - - public static List getInternalTriggers(IStatementContainer container) { - LinkedHashSet triggers = new LinkedHashSet(); - - for (ITriggerProvider provider : triggerProviders) { - provider.addInternalTriggers(triggers, container); - } - - return new ArrayList(triggers); - } - - public static List getInternalActions(IStatementContainer container) { - LinkedHashSet actions = new LinkedHashSet(); - - for (IActionProvider provider : actionProviders) { - provider.addInternalActions(actions, container); - } - - return new ArrayList(actions); - } - - public static IStatementParameter createParameter(String kind) { - return createParameter(parameters.get(kind)); - } - - private static IStatementParameter createParameter(Class param) { - if (param == null) { - return null; - } - - try { - return param.newInstance(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (Error error) { - BCLog.logErrorAPI(error, IStatementParameter.class); - throw error; - } - - return null; - } - - /** - * Generally, this function should be called by every mod implementing - * the Statements API ***as a container*** (that is, adding its own gates) - * on the client side from a given Item of choice. - */ - @SideOnly(Side.CLIENT) - public static void registerIcons(TextureMap register) { - for (IStatement statement : statements.values()) { - statement.registerIcons(register); - } - - for (Class parameter : parameters.values()) { - createParameter(parameter).registerIcons(register); - } - } -} diff --git a/src/api/java/buildcraft/api/statements/StatementMouseClick.java b/src/api/java/buildcraft/api/statements/StatementMouseClick.java deleted file mode 100755 index c39ed336f..000000000 --- a/src/api/java/buildcraft/api/statements/StatementMouseClick.java +++ /dev/null @@ -1,23 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -public final class StatementMouseClick { - private int button; - private boolean shift; - - public StatementMouseClick(int button, boolean shift) { - this.button = button; - this.shift = shift; - } - - public boolean isShift() { - return shift; - } - - public int getButton() { - return button; - } -} diff --git a/src/api/java/buildcraft/api/statements/StatementParameterItemStack.java b/src/api/java/buildcraft/api/statements/StatementParameterItemStack.java deleted file mode 100755 index 463293854..000000000 --- a/src/api/java/buildcraft/api/statements/StatementParameterItemStack.java +++ /dev/null @@ -1,96 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.statements; - -import java.util.Objects; - -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class StatementParameterItemStack implements IStatementParameter { - - protected ItemStack stack; - - @Override - public TextureAtlasSprite getIcon() { - return null; - } - - @Override - public ItemStack getItemStack() { - return stack; - } - - @Override - public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { - if (stack != null) { - this.stack = stack.copy(); - this.stack.stackSize = 1; - } else { - this.stack = null; - } - } - - @Override - public void writeToNBT(NBTTagCompound compound) { - if (stack != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - stack.writeToNBT(tagCompound); - compound.setTag("stack", tagCompound); - } - } - - @Override - public void readFromNBT(NBTTagCompound compound) { - stack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("stack")); - } - - @Override - public boolean equals(Object object) { - if (object instanceof StatementParameterItemStack) { - StatementParameterItemStack param = (StatementParameterItemStack) object; - - return ItemStack.areItemStacksEqual(stack, param.stack) && ItemStack.areItemStackTagsEqual(stack, param.stack); - } else { - return false; - } - } - - @Override - public int hashCode() { - return Objects.hashCode(stack); - } - - @Override - public String getDescription() { - if (stack != null) { - return stack.getDisplayName(); - } else { - return ""; - } - } - - @Override - public String getUniqueTag() { - return "buildcraft:stack"; - } - - // @Override - // public void registerIcons(TextureAtlasSpriteRegister iconRegister) { - // - // } - - @Override - public IStatementParameter rotateLeft() { - return this; - } - - @Override - public void registerIcons(TextureMap map) { - - } -} diff --git a/src/api/java/buildcraft/api/statements/StatementSlot.java b/src/api/java/buildcraft/api/statements/StatementSlot.java deleted file mode 100755 index 27c0071bb..000000000 --- a/src/api/java/buildcraft/api/statements/StatementSlot.java +++ /dev/null @@ -1,42 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team 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.statements; - -import java.util.Arrays; -import java.util.Objects; - -public class StatementSlot { - public IStatement statement; - public IStatementParameter[] parameters; - - @Override - public boolean equals(Object o) { - if (!(o instanceof StatementSlot)) { - return false; - } - StatementSlot s = (StatementSlot) o; - if (s.statement != statement || parameters.length != s.parameters.length) { - return false; - } - for (int i = 0; i < parameters.length; i++) { - IStatementParameter p1 = parameters[i]; - IStatementParameter p2 = s.parameters[i]; - if (p1 == null) { - if (p2 != null) return false; - continue; - } - if (p2 == null) return false; - if (!(p1.equals(p2))) { - return false; - } - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(statement, Arrays.deepHashCode(parameters)); - } -} diff --git a/src/api/java/buildcraft/api/statements/containers/IRedstoneStatementContainer.java b/src/api/java/buildcraft/api/statements/containers/IRedstoneStatementContainer.java deleted file mode 100755 index 5b34bfd94..000000000 --- a/src/api/java/buildcraft/api/statements/containers/IRedstoneStatementContainer.java +++ /dev/null @@ -1,17 +0,0 @@ -package buildcraft.api.statements.containers; - -import net.minecraft.util.EnumFacing; - -public interface IRedstoneStatementContainer { - /** Get the redstone input from a given side. - * - * @param side The side - use "UNKNOWN" for maximum input. - * @return The redstone input, from 0 to 15. */ - int getRedstoneInput(EnumFacing side); - - /** Set the redstone input for a given side. - * - * @param side The side - use "UNKNOWN" for all sides. - * @return Whether the set was successful. */ - boolean setRedstoneOutput(EnumFacing side, int value); -} diff --git a/src/api/java/buildcraft/api/statements/containers/ISidedStatementContainer.java b/src/api/java/buildcraft/api/statements/containers/ISidedStatementContainer.java deleted file mode 100755 index b65ace45a..000000000 --- a/src/api/java/buildcraft/api/statements/containers/ISidedStatementContainer.java +++ /dev/null @@ -1,10 +0,0 @@ -package buildcraft.api.statements.containers; - -import net.minecraft.util.EnumFacing; - -import buildcraft.api.statements.IStatementContainer; - -/** Created by asie on 3/14/15. */ -public interface ISidedStatementContainer extends IStatementContainer { - EnumFacing getSide(); -} diff --git a/src/api/java/buildcraft/api/statements/package-info.java b/src/api/java/buildcraft/api/statements/package-info.java deleted file mode 100755 index 7dd2c74e6..000000000 --- a/src/api/java/buildcraft/api/statements/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|statements") -package buildcraft.api.statements; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/tablet/ITablet.java b/src/api/java/buildcraft/api/tablet/ITablet.java deleted file mode 100755 index e88a4cf36..000000000 --- a/src/api/java/buildcraft/api/tablet/ITablet.java +++ /dev/null @@ -1,19 +0,0 @@ -package buildcraft.api.tablet; - -import net.minecraft.nbt.NBTTagCompound; - -import net.minecraftforge.fml.relauncher.Side; - -public interface ITablet { - Side getSide(); - - void refreshScreen(TabletBitmap data); - - int getScreenWidth(); - - int getScreenHeight(); - - void launchProgram(String name); - - void sendMessage(NBTTagCompound compound); -} diff --git a/src/api/java/buildcraft/api/tablet/TabletAPI.java b/src/api/java/buildcraft/api/tablet/TabletAPI.java deleted file mode 100755 index 529862790..000000000 --- a/src/api/java/buildcraft/api/tablet/TabletAPI.java +++ /dev/null @@ -1,20 +0,0 @@ -package buildcraft.api.tablet; - -import java.util.HashMap; -import java.util.Map; - -public final class TabletAPI { - private static final Map programs = new HashMap(); - - private TabletAPI() { - - } - - public static void registerProgram(TabletProgramFactory factory) { - programs.put(factory.getName(), factory); - } - - public static TabletProgramFactory getProgram(String name) { - return programs.get(name); - } -} diff --git a/src/api/java/buildcraft/api/tablet/TabletBitmap.java b/src/api/java/buildcraft/api/tablet/TabletBitmap.java deleted file mode 100755 index 82b236b9f..000000000 --- a/src/api/java/buildcraft/api/tablet/TabletBitmap.java +++ /dev/null @@ -1,55 +0,0 @@ -package buildcraft.api.tablet; - -public class TabletBitmap { - public final int width, height; - protected int[] data; - - public TabletBitmap(int width, int height) { - this.width = width; - this.height = height; - this.data = new int[width * height]; - } - - public TabletBitmap(ITablet tablet) { - this(tablet.getScreenWidth(), tablet.getScreenHeight()); - } - - public int[] getData() { - return data; - } - - public int get(int x, int y) { - if (x < 0 || y < 0 || x >= width || y >= height) { - return 0; - } - return data[y * width + x]; - } - - public void set(int x, int y, int shade) { - if (x < 0 || y < 0 || x >= width || y >= height) { - return; - } - data[y * width + x] = shade; - } - - public void set(int x, int y, TabletBitmap bitmap) { - for (int i = 0; i < bitmap.height; i++) { - if (i >= height) { - break; - } - for (int h = 0; h < bitmap.width; h++) { - if (h >= width) { - break; - } - - set(x + h, y + i, bitmap.get(h, i)); - } - } - } - - public TabletBitmap duplicate() { - TabletBitmap cloned = new TabletBitmap(this.width, this.height); - cloned.data = this.data.clone(); - return cloned; - } -} diff --git a/src/api/java/buildcraft/api/tablet/TabletProgram.java b/src/api/java/buildcraft/api/tablet/TabletProgram.java deleted file mode 100755 index ea098f47c..000000000 --- a/src/api/java/buildcraft/api/tablet/TabletProgram.java +++ /dev/null @@ -1,17 +0,0 @@ -package buildcraft.api.tablet; - -import net.minecraft.nbt.NBTTagCompound; - -public abstract class TabletProgram { - public void tick(float time) { - - } - - public boolean hasEnded() { - return false; - } - - public void receiveMessage(NBTTagCompound compound) { - - } -} diff --git a/src/api/java/buildcraft/api/tablet/TabletProgramFactory.java b/src/api/java/buildcraft/api/tablet/TabletProgramFactory.java deleted file mode 100755 index 8f3bb414c..000000000 --- a/src/api/java/buildcraft/api/tablet/TabletProgramFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -package buildcraft.api.tablet; - -public abstract class TabletProgramFactory { - /** Create an instance of the tablet program specified by this Factory. - * - * Both parameters are mutable and can be edited freely; however, the NBTTagCompound will only be synchronized after - * you leave the program. - * - * Please note that the program runs client-side SOLELY. For server-side queries, you must implement a custom - * communications protocol. - * - * @param tablet - * @return An instance of the TabletProgram. */ - public abstract TabletProgram create(ITablet tablet); - - public abstract String getName(); - - public abstract TabletBitmap getIcon(); -} diff --git a/src/api/java/buildcraft/api/tablet/TabletTicker.java b/src/api/java/buildcraft/api/tablet/TabletTicker.java deleted file mode 100755 index 33656fb80..000000000 --- a/src/api/java/buildcraft/api/tablet/TabletTicker.java +++ /dev/null @@ -1,36 +0,0 @@ -package buildcraft.api.tablet; - -/** Utility class for capturing tablet ticks every X seconds. */ -public class TabletTicker { - private final float tickTime; - private float time = 0.0F; - private int ticked = 0; - - public TabletTicker(float tickTime) { - this.tickTime = tickTime; - } - - public void add(float time) { - this.time += time; - - while (this.time >= tickTime) { - this.time -= tickTime; - ticked++; - } - } - - public int getTicks() { - return ticked; - } - - public boolean tick() { - boolean oldTicked = ticked > 0; - ticked = 0; - return oldTicked; - } - - public void reset() { - ticked = 0; - time = 0; - } -} diff --git a/src/api/java/buildcraft/api/tablet/package-info.java b/src/api/java/buildcraft/api/tablet/package-info.java deleted file mode 100755 index cc87d8657..000000000 --- a/src/api/java/buildcraft/api/tablet/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|tablet") -package buildcraft.api.tablet; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/tiles/IControllable.java b/src/api/java/buildcraft/api/tiles/IControllable.java deleted file mode 100755 index 46eff5f12..000000000 --- a/src/api/java/buildcraft/api/tiles/IControllable.java +++ /dev/null @@ -1,34 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.tiles; - -/** This interface should be implemented by any Tile Entity which wishes to have non-redstone automation (for example, - * BuildCraft Gates, but also other mods which implement it, e.g. OpenComputers). */ -public interface IControllable { - public enum Mode { - Unknown, - On, - Off, - Mode, - Loop - } - - /** Get the current control mode of the Tile Entity. - * - * @return */ - Mode getControlMode(); - - /** Set the mode of the Tile Entity. - * - * @param mode */ - void setControlMode(Mode mode); - - /** Check if a given control mode is accepted. If you query IControllable tiles, you MUST check with - * acceptsControlMode first. - * - * @param mode - * @return True if this control mode is accepted. */ - boolean acceptsControlMode(Mode mode); -} diff --git a/src/api/java/buildcraft/api/tiles/IDebuggable.java b/src/api/java/buildcraft/api/tiles/IDebuggable.java deleted file mode 100755 index 4e5cb3d5d..000000000 --- a/src/api/java/buildcraft/api/tiles/IDebuggable.java +++ /dev/null @@ -1,17 +0,0 @@ -package buildcraft.api.tiles; - -import java.util.List; - -import net.minecraft.util.EnumFacing; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public interface IDebuggable { - /** Get the debug information from a tile entity as a list of strings, used for the F3 debug menu. The left and - * right parameters correspond to the sides of the F3 screen. - * - * @param side The side the block was clicked on, may be null if we don't know, or is the "centre" side */ - @SideOnly(Side.CLIENT) - void getDebugInfo(List left, List right, EnumFacing side); -} diff --git a/src/api/java/buildcraft/api/tiles/IHasWork.java b/src/api/java/buildcraft/api/tiles/IHasWork.java deleted file mode 100755 index fa8719644..000000000 --- a/src/api/java/buildcraft/api/tiles/IHasWork.java +++ /dev/null @@ -1,14 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.tiles; - -/** This interface should be implemented by any Tile Entity which carries out work (crafting, ore processing, mining, et - * cetera). */ -public interface IHasWork { - /** Check if the Tile Entity is currently doing any work. - * - * @return True if the Tile Entity is doing work. */ - boolean hasWork(); -} diff --git a/src/api/java/buildcraft/api/tiles/IHeatable.java b/src/api/java/buildcraft/api/tiles/IHeatable.java deleted file mode 100755 index 1af6d6b59..000000000 --- a/src/api/java/buildcraft/api/tiles/IHeatable.java +++ /dev/null @@ -1,26 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.tiles; - -/** This interface should be implemented by Tile Entities which have an internal heat value. */ -public interface IHeatable { - /** @return The minimum heat value, in degrees. */ - double getMinHeatValue(); - - /** @return The preferred heat value, in degrees. */ - double getIdealHeatValue(); - - /** @return The maxmimum heat value, in degrees. */ - double getMaxHeatValue(); - - /** @return The current heat value, in degrees. */ - double getCurrentHeatValue(); - - /** Set the heat of the tile. - * - * @param value Heat value, in degrees. - * @return The heat the tile has after the set. */ - double setHeatValue(double value); -} diff --git a/src/api/java/buildcraft/api/tiles/ITileAreaProvider.java b/src/api/java/buildcraft/api/tiles/ITileAreaProvider.java deleted file mode 100755 index 89a7c1456..000000000 --- a/src/api/java/buildcraft/api/tiles/ITileAreaProvider.java +++ /dev/null @@ -1,10 +0,0 @@ -package buildcraft.api.tiles; - -import net.minecraft.util.math.BlockPos; - -import buildcraft.api.core.IAreaProvider; - -/** Used for more fine-grained control of whether or not a machine connects to the provider here. */ -public interface ITileAreaProvider extends IAreaProvider { - boolean isValidFromLocation(BlockPos pos); -} diff --git a/src/api/java/buildcraft/api/tiles/package-info.java b/src/api/java/buildcraft/api/tiles/package-info.java deleted file mode 100755 index d4c217fc3..000000000 --- a/src/api/java/buildcraft/api/tiles/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.2", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|tiles") -package buildcraft.api.tiles; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/transport/ICustomPipeConnection.java b/src/api/java/buildcraft/api/transport/ICustomPipeConnection.java deleted file mode 100755 index 57c05e70e..000000000 --- a/src/api/java/buildcraft/api/transport/ICustomPipeConnection.java +++ /dev/null @@ -1,12 +0,0 @@ -package buildcraft.api.transport; - -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -public interface ICustomPipeConnection { - /** @return How long the connecting pipe should extend for. Values less than -4/16 indicate that the pipe will not - * connect at all, and will render as it it was not connected. */ - public float getExtension(World world, BlockPos pos, EnumFacing face, IBlockState state); -} diff --git a/src/api/java/buildcraft/api/transport/IInjectable.java b/src/api/java/buildcraft/api/transport/IInjectable.java deleted file mode 100755 index 0de9e2005..000000000 --- a/src/api/java/buildcraft/api/transport/IInjectable.java +++ /dev/null @@ -1,18 +0,0 @@ -package buildcraft.api.transport; - -import net.minecraft.item.EnumDyeColor; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; - -public interface IInjectable { - boolean canInjectItems(EnumFacing from); - - /** Offers an ItemStack for 3addition to the pipe. Will be rejected if the pipe doesn't accept items from that side. - * - * @param stack ItemStack offered for addition. Do not manipulate this! - * @param doAdd If false no actual addition should take place. Implementors should simulate. - * @param from Orientation the ItemStack is offered from. - * @param color The color of the item to be added to the pipe, or null for no color. - * @return Amount of items used from the passed stack. */ - int injectItem(ItemStack stack, boolean doAdd, EnumFacing from, EnumDyeColor color); -} diff --git a/src/api/java/buildcraft/api/transport/IItemPipe.java b/src/api/java/buildcraft/api/transport/IItemPipe.java deleted file mode 100755 index c943a81a6..000000000 --- a/src/api/java/buildcraft/api/transport/IItemPipe.java +++ /dev/null @@ -1,11 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team 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.transport; - -/** To be implemented by the real item pipe in Transport mod, but leaves knowledge for classes that do not have direct - * dependency on transport. */ -public interface IItemPipe { - -} diff --git a/src/api/java/buildcraft/api/transport/IPipe.java b/src/api/java/buildcraft/api/transport/IPipe.java deleted file mode 100755 index 96a7a764c..000000000 --- a/src/api/java/buildcraft/api/transport/IPipe.java +++ /dev/null @@ -1,21 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import net.minecraft.util.EnumFacing; - -import buildcraft.api.gates.IGate; - -public interface IPipe { - IPipeTile getTile(); - - IGate getGate(EnumFacing side); - - boolean hasGate(EnumFacing side); - - boolean isWired(PipeWire wire); - - boolean isWireActive(PipeWire wire); -} diff --git a/src/api/java/buildcraft/api/transport/IPipeConnection.java b/src/api/java/buildcraft/api/transport/IPipeConnection.java deleted file mode 100755 index 0b25ec818..000000000 --- a/src/api/java/buildcraft/api/transport/IPipeConnection.java +++ /dev/null @@ -1,24 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import net.minecraft.util.EnumFacing; - -public interface IPipeConnection { - - enum ConnectOverride { - - CONNECT, - DISCONNECT, - DEFAULT - } - - /** Allows you to override pipe connection logic. - * - * @param type - * @param with - * @return CONNECT to force a connection, DISCONNECT to force no connection, and DEFAULT to let the pipe decide. */ - ConnectOverride overridePipeConnection(IPipeTile.PipeType type, EnumFacing with); -} diff --git a/src/api/java/buildcraft/api/transport/IPipeTile.java b/src/api/java/buildcraft/api/transport/IPipeTile.java deleted file mode 100755 index 357d9011c..000000000 --- a/src/api/java/buildcraft/api/transport/IPipeTile.java +++ /dev/null @@ -1,54 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import buildcraft.api.transport.pluggable.PipePluggable; - -public interface IPipeTile extends IInjectable { - enum PipeType { - ITEM, - FLUID, - POWER, - STRUCTURE - } - - PipeType getPipeType(); - - World getWorldBC(); - - BlockPos getPosBC(); - - /** True if the pipe is connected to the block/pipe in the specific direction - * - * @param with - * @return true if connect */ - boolean isPipeConnected(EnumFacing with); - - Block getNeighborBlock(EnumFacing dir); - - TileEntity getNeighborTile(EnumFacing dir); - - IPipe getNeighborPipe(EnumFacing dir); - - IPipe getPipe(); - - int getPipeColor(); - - PipePluggable getPipePluggable(EnumFacing direction); // Now in IPluggableProvider - - boolean hasPipePluggable(EnumFacing direction); // Now in IPluggableProvider - - boolean hasBlockingPluggable(EnumFacing direction); - - void scheduleNeighborChange(); - - void scheduleRenderUpdate(); -} diff --git a/src/api/java/buildcraft/api/transport/IStripesActivator.java b/src/api/java/buildcraft/api/transport/IStripesActivator.java deleted file mode 100755 index b9a0445a8..000000000 --- a/src/api/java/buildcraft/api/transport/IStripesActivator.java +++ /dev/null @@ -1,14 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; - -public interface IStripesActivator { - boolean sendItem(ItemStack itemStack, EnumFacing direction); - - void dropItem(ItemStack itemStack, EnumFacing direction); -} diff --git a/src/api/java/buildcraft/api/transport/IStripesHandler.java b/src/api/java/buildcraft/api/transport/IStripesHandler.java deleted file mode 100755 index 311589eaa..000000000 --- a/src/api/java/buildcraft/api/transport/IStripesHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -public interface IStripesHandler { - enum StripesHandlerType { - ITEM_USE, - BLOCK_BREAK - } - - StripesHandlerType getType(); - - boolean shouldHandle(ItemStack stack); - - boolean handle(World world, BlockPos pos, EnumFacing direction, ItemStack stack, EntityPlayer player, IStripesActivator activator); -} diff --git a/src/api/java/buildcraft/api/transport/IStripesPipe.java b/src/api/java/buildcraft/api/transport/IStripesPipe.java deleted file mode 100755 index 569c53954..000000000 --- a/src/api/java/buildcraft/api/transport/IStripesPipe.java +++ /dev/null @@ -1,9 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import cofh.api.energy.IEnergyHandler; - -public interface IStripesPipe extends IPipe, IStripesActivator, IEnergyHandler {} diff --git a/src/api/java/buildcraft/api/transport/PipeConnectionAPI.java b/src/api/java/buildcraft/api/transport/PipeConnectionAPI.java deleted file mode 100755 index c5ae04628..000000000 --- a/src/api/java/buildcraft/api/transport/PipeConnectionAPI.java +++ /dev/null @@ -1,48 +0,0 @@ -package buildcraft.api.transport; - -import java.util.Map; - -import com.google.common.collect.Maps; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -/** Use this class to register blocks with custom block sizes so that pipes can connect to them properly. Note that you - * do not need to register a custom pipe connection if your block implements ICustomPipeConnection. The registered - * version does not override your own implementation. */ -public final class PipeConnectionAPI { - private static final Map connections = Maps.newHashMap(); - private static final ICustomPipeConnection NOTHING = new ICustomPipeConnection() { - @Override - public float getExtension(World world, BlockPos pos, EnumFacing face, IBlockState state) { - return 0; - } - }; - - /** Register a block with a custom connection. Useful if you don't own the block class or are adding it for some-one - * - * @param block The block instance - * @param connection The connection instance */ - public static void registerConnection(Block block, ICustomPipeConnection connection) { - connections.put(block, connection); - } - - public static void registerConnectionAsNothing(Block block) { - connections.put(block, NOTHING); - } - - /** Gets the current custom connection that the block uses. Will be null if nothing has been set. */ - public static ICustomPipeConnection getCustomConnection(Block block) { - if (block instanceof ICustomPipeConnection) { - return (ICustomPipeConnection) block; - } - ICustomPipeConnection connection = connections.get(block); - if (connection != null) { - return connection; - } - return null; - } -} diff --git a/src/api/java/buildcraft/api/transport/PipeManager.java b/src/api/java/buildcraft/api/transport/PipeManager.java deleted file mode 100755 index 595b20e24..000000000 --- a/src/api/java/buildcraft/api/transport/PipeManager.java +++ /dev/null @@ -1,66 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import java.util.*; - -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import buildcraft.api.transport.pluggable.PipePluggable; - -public abstract class PipeManager { - - public static List stripesHandlers = new ArrayList(); - public static ArrayList> pipePluggables = new ArrayList>(); - private static Map> pipePluggableNames = new HashMap>(); - private static Map, String> pipePluggableByNames = new HashMap, String>(); - private static Map stripesHandlerPriorities = new HashMap(); - - @Deprecated - public static boolean canExtractItems(Object extractor, World world, BlockPos pos) { - return true; - } - - @Deprecated - public static boolean canExtractFluids(Object extractor, World world, BlockPos pos) { - return true; - } - - @Deprecated - public static void registerStripesHandler(IStripesHandler handler) { - registerStripesHandler(handler, 0); - } - - /** Register a Stripes Pipe handler. - * - * @param handler The handler. - * @param priority The priority - 0 is normal, higher numbers have higher priority. */ - public static void registerStripesHandler(IStripesHandler handler, int priority) { - stripesHandlers.add(handler); - stripesHandlerPriorities.put(handler, priority); - - Collections.sort(stripesHandlers, new Comparator() { - @Override - public int compare(IStripesHandler o1, IStripesHandler o2) { - return stripesHandlerPriorities.get(o2) - stripesHandlerPriorities.get(o1); - } - }); - } - - public static void registerPipePluggable(Class pluggable, String name) { - pipePluggables.add(pluggable); - pipePluggableNames.put(name, pluggable); - pipePluggableByNames.put(pluggable, name); - } - - public static Class getPluggableByName(String pluggableName) { - return pipePluggableNames.get(pluggableName); - } - - public static String getPluggableName(Class aClass) { - return pipePluggableByNames.get(aClass); - } -} diff --git a/src/api/java/buildcraft/api/transport/PipeWire.java b/src/api/java/buildcraft/api/transport/PipeWire.java deleted file mode 100755 index 5864db9c3..000000000 --- a/src/api/java/buildcraft/api/transport/PipeWire.java +++ /dev/null @@ -1,73 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport; - -import java.util.Locale; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public enum PipeWire { - - RED, - BLUE, - GREEN, - YELLOW; - public static Item item; - public static final PipeWire[] VALUES = values(); - - public PipeWire reverse() { - switch (this) { - case RED: - return YELLOW; - case BLUE: - return GREEN; - case GREEN: - return BLUE; - default: - return RED; - } - } - - public String getTag() { - return name().toLowerCase(Locale.ENGLISH) + "PipeWire"; - } - - public String getColor() { - String name = this.toString().toLowerCase(Locale.ENGLISH); - char first = Character.toUpperCase(name.charAt(0)); - return first + name.substring(1); - } - - public ItemStack getStack() { - return getStack(1); - } - - public ItemStack getStack(int qty) { - if (item == null) { - return null; - } else { - return new ItemStack(item, qty, ordinal()); - } - } - - public boolean isPipeWire(ItemStack stack) { - if (stack == null) { - return false; - } else if (stack.getItem() != item) { - return false; - } else { - return stack.getItemDamage() == ordinal(); - } - } - - public static PipeWire fromOrdinal(int ordinal) { - if (ordinal < 0 || ordinal >= VALUES.length) { - return RED; - } else { - return VALUES[ordinal]; - } - } -} diff --git a/src/api/java/buildcraft/api/transport/package-info.java b/src/api/java/buildcraft/api/transport/package-info.java deleted file mode 100755 index 004c271a1..000000000 --- a/src/api/java/buildcraft/api/transport/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "5.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|transport") -package buildcraft.api.transport; - -import net.minecraftforge.fml.common.API; diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/BCPipeEventHandler.java b/src/api/java/buildcraft/api/transport/pipe_bc8/BCPipeEventHandler.java deleted file mode 100755 index bb163b9f0..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/BCPipeEventHandler.java +++ /dev/null @@ -1,12 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(value = ElementType.METHOD) -@Retention(value = RetentionPolicy.RUNTIME) -public @interface BCPipeEventHandler { - // TODO -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/EnumContentsJourneyPart.java b/src/api/java/buildcraft/api/transport/pipe_bc8/EnumContentsJourneyPart.java deleted file mode 100755 index 3bf724a42..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/EnumContentsJourneyPart.java +++ /dev/null @@ -1,7 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -public enum EnumContentsJourneyPart { - JUST_ENTERED, - TO_CENTER, - FROM_CENTER; -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IConnection_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IConnection_BC8.java deleted file mode 100755 index a18140f6b..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IConnection_BC8.java +++ /dev/null @@ -1,35 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; - -import buildcraft.api.transport.pipe_bc8.IExtractionManager.IExtractable_BC8; -import buildcraft.api.transport.pipe_bc8.IInsertionManager.IInsertable_BC8; - -public interface IConnection_BC8 { - Object getOther(); - - /** @return The length of the connection. For connections to another buildcraft pipe or a full block this value will - * be 0.25. Values less than 0 are NOT permitted and returning values less than 0 will introduce crashes or - * errors further down! */ - double getLength(); - - IExtractable_BC8 getExtractor(); - - IInsertable_BC8 getInserter(); - - interface Pipe extends IConnection_BC8 { - @Override - IPipe_BC8 getOther(); - } - - interface MovableEntity extends IConnection_BC8 { - @Override - Entity getOther(); - } - - interface Tile extends IConnection_BC8 { - @Override - TileEntity getOther(); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IExtractionManager.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IExtractionManager.java deleted file mode 100755 index 0983d7d16..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IExtractionManager.java +++ /dev/null @@ -1,46 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.util.EnumFacing; - -import buildcraft.api.core.IFluidFilter; -import buildcraft.api.core.IStackFilter; -import buildcraft.api.transport.pipe_bc8.IInsertionManager.IInsertableFactory; -import buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableFluid; -import buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableItem; - -public interface IExtractionManager { - /** Gets an {@link IExtractable_BC8} interface for a given tile or movable entity. */ - IExtractable_BC8 getExtractableFor(Object obj); - - /** Registers an {@link IInsertableFactory}. Note that if two insertables are registered and have an overlapping - * class child, the most specific one is used. */ - void registerInsertable(Class clazz, IExtractableFactory factory); - - public interface IExtractableFactory { - IExtractable_BC8 createNew(T obj); - } - - public interface IExtractable_BC8 { - /** @param filter The filter to use when determining what can be extracted - * @param extractor The object the the contents are being extracted by - * @param direction The direction the contents will be going in - * @param simulate If true no changes will be made to the target inventory - * @return A pipe contents object if it was successfully extracted, or null if nothing was extracted. */ - IPipeContentsEditableItem tryExtractItems(IStackFilter filter, Object extractor, EnumFacing direction, boolean simulate); - - /** @param filter The filter to use when determining what can be extracted - * @param extractor The object the the contents are being extracted by - * @param direction The direction the contents will be going in - * @param simulate If true no changes will be made to the target tank - * @return A pipe contents object if it was successfully extracted, or null if nothing was extracted. */ - IPipeContentsEditableFluid tryExtractFluid(IFluidFilter filter, Object extractor, EnumFacing direction, boolean simulate); - - /** @return True if {@link #tryExtractItems(IStackFilter, Object, EnumFacing, boolean)} can return a non-null - * value at any future point in time. */ - boolean givesItems(); - - /** @return True if {@link #tryExtractFluid(IFluidFilter, Object, EnumFacing, boolean)} can return a non-null - * value at any future point in time. */ - boolean givesFluids(); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IInsertionManager.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IInsertionManager.java deleted file mode 100755 index 0ae64a68a..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IInsertionManager.java +++ /dev/null @@ -1,35 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.util.EnumFacing; - -import buildcraft.api.core.IFluidFilter; -import buildcraft.api.core.IStackFilter; -import buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableFluid; -import buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableItem; - -public interface IInsertionManager { - /** Gets an {@link IInsertable_BC8} interface for a given tile or movable entity. */ - IInsertable_BC8 getInsertableFor(Object obj); - - /** Registers an {@link IInsertableFactory}. Note that if two insertables are registered and have an overlapping - * class child, the most specific one is used. */ - void registerInsertable(Class clazz, IInsertableFactory factory); - - public interface IInsertableFactory { - IInsertable_BC8 createNew(T obj); - } - - public interface IInsertable_BC8 { - boolean tryInsertItems(IPipeContentsEditableItem contents, Object extractor, EnumFacing direction, boolean simulate); - - boolean tryInsertFluid(IPipeContentsEditableFluid fluid, Object extractor, EnumFacing direction, boolean simulate); - - /** @return True if {@link #tryExtractItems(IStackFilter, Object, EnumFacing, boolean)} can return a non-null - * value at any future point in time. */ - boolean acceptsItems(); - - /** @return True if {@link #tryExtractFluid(IFluidFilter, Object, EnumFacing, boolean)} can return a non-null - * value at any future point in time. */ - boolean acceptsFluids(); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeAddonItem.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeAddonItem.java deleted file mode 100755 index fa98b71df..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeAddonItem.java +++ /dev/null @@ -1,8 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -/** - * - */ -public interface IPipeAddonItem { - -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeBehaviourFactory.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeBehaviourFactory.java deleted file mode 100755 index 8fa7afb23..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeBehaviourFactory.java +++ /dev/null @@ -1,5 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -public interface IPipeBehaviourFactory { - PipeBehaviour_BC8 createNew(IPipe_BC8 pipe); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeContents.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeContents.java deleted file mode 100755 index 23e16eeb2..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeContents.java +++ /dev/null @@ -1,37 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; - -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -/** Provides a simple abstraction for items and fluids. This is intended to be useful for pipes which cover both kinds, - * without having lots of if (item) ... else ... */ -public interface IPipeContents { - EnumContentsJourneyPart getJourneyPart(); - - EnumFacing getDirection(); - - /** This should NEVER return numbers less than or equal to 0! - * - * @return The number of minecraft blocks this contents moves per minecraft ticks */ - double getSpeed(); - - public interface IPipeContentsItem extends IPipeContents { - ItemStack cloneItemStack(); - - IPipePropertyProvider getProperties(); - } - - public interface IPipeContentsFluid extends IPipeContents { - int getAmount(); - - Fluid getFluid(); - - NBTTagCompound getNBT(); - - FluidStack cloneFluidStack(); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeContentsEditable.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeContentsEditable.java deleted file mode 100755 index 789772f12..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeContentsEditable.java +++ /dev/null @@ -1,60 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; - -import net.minecraftforge.fluids.Fluid; - -import buildcraft.api.core.INBTLoadable_BC8; -import buildcraft.api.core.INetworkLoadable_BC8; -import buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyProviderEditable; - -import io.netty.buffer.ByteBuf; - -/** Provides a way to change the contents of a pipe. */ -public interface IPipeContentsEditable extends IPipeContents, INetworkLoadable_BC8, INBTLoadable_BC8 { - IPipeContents asReadOnly(); - - void setJourneyPart(EnumContentsJourneyPart journeyPart); - - void setDirection(EnumFacing direction); - - void setSpeed(double speed); - - public interface IPipeContentsEditableFluid extends IPipeContentsEditable, IPipeContentsFluid { - int setAmount(int newAmount); - - void setFluid(Fluid fluid); - - void setNBT(NBTTagCompound compound); - - void setFluidStack(); - - @Override - IPipeContentsFluid asReadOnly(); - - @Override - IPipeContentsEditableFluid readFromNBT(NBTBase nbt); - - @Override - IPipeContentsEditableFluid readFromByteBuf(ByteBuf buf); - } - - public interface IPipeContentsEditableItem extends IPipeContentsEditable, IPipeContentsItem { - void setStack(ItemStack newStack); - - @Override - IPipePropertyProviderEditable getProperties(); - - @Override - IPipeContentsItem asReadOnly(); - - @Override - IPipeContentsEditableItem readFromNBT(NBTBase nbt); - - @Override - IPipeContentsEditableItem readFromByteBuf(ByteBuf buf); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeHelper.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeHelper.java deleted file mode 100755 index 1d39da2b1..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeHelper.java +++ /dev/null @@ -1,14 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - -import buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableFluid; -import buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableItem; - -public interface IPipeHelper { - IPipeContentsEditableItem getContentsForItem(ItemStack stack); - - IPipeContentsEditableFluid getContentsForFluid(FluidStack fluid); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeHolder_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeHolder_BC8.java deleted file mode 100755 index 1d2abc738..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeHolder_BC8.java +++ /dev/null @@ -1,5 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -public interface IPipeHolder_BC8 { - IPipe_BC8 getPipe(); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListener.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListener.java deleted file mode 100755 index 1533faf59..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListener.java +++ /dev/null @@ -1,9 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import buildcraft.api.core.INBTLoadable_BC8; -import buildcraft.api.core.INetworkLoadable_BC8; - -/** Something that will be saved and loaded from disk and sent across the network to the client world to be added as a - * listener. This class should be registered with {@link PipeAPI_BC8#PIPE_LISTENER_REGISTRY} in order to be successfully - * saved and loaded. */ -public interface IPipeListener extends INBTLoadable_BC8, INetworkLoadable_BC8 {} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListenerFactory.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListenerFactory.java deleted file mode 100755 index d2e96cf3d..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListenerFactory.java +++ /dev/null @@ -1,5 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -public interface IPipeListenerFactory { - IPipeListener createNewListener(IPipe_BC8 pipe); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListenerRegistry.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListenerRegistry.java deleted file mode 100755 index abe78251d..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeListenerRegistry.java +++ /dev/null @@ -1,9 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -public interface IPipeListenerRegistry { - IPipeListenerFactory getFactory(String globalUniqueTag); - - String getGlobalUniqueTag(IPipeListener listener); - - void registerListenerFactory(String modUniqueTag, IPipeListenerFactory factory); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipePropertyProvider.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipePropertyProvider.java deleted file mode 100755 index 5581d82ff..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipePropertyProvider.java +++ /dev/null @@ -1,48 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import java.util.Set; - -import net.minecraft.nbt.NBTBase; - -import buildcraft.api.core.INBTLoadable_BC8; -import buildcraft.api.core.INetworkLoadable_BC8; - -public interface IPipePropertyProvider { - /** This will return either the value of the property (if {@link #hasProperty(IPipeProperty)} returns true) or the - * default value of the property. */ - T getValue(IPipeProperty property); - - boolean hasProperty(IPipeProperty property); - - Set> getPropertySet(); - - /** Defines a property key- this should be stored in a publicly accessible static variable somewhere. */ - public interface IPipeProperty { - String getName(); - - T getDefault(); - } - - /** Defines a pipe property that has its value queried every time it is asked for its value. */ - public interface IPipePropertyImplicit extends IPipeProperty { - T getValue(IPipe_BC8 pipe); - } - - /** Defines a pipe property that has a value explicitly set */ - public interface IPipePropertyValue extends IPipeProperty, INBTLoadable_BC8, INetworkLoadable_BC8 { - T getValue(); - - @Override - T readFromNBT(NBTBase tag); - } - - /** Defines a provider that can have value properties changed and added. */ - public interface IPipePropertyProviderEditable extends IPipePropertyProvider, INBTLoadable_BC8, - INetworkLoadable_BC8 { - void addProperty(IPipePropertyValue property); - - void removeProperty(IPipePropertyValue property); - - IPipePropertyProvider asReadOnly(); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeRegistry.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeRegistry.java deleted file mode 100755 index ca0ec628b..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeRegistry.java +++ /dev/null @@ -1,11 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.item.Item; - -import buildcraft.api.ITripleRegistry; - -public interface IPipeRegistry extends ITripleRegistry { - /** Registers a definition, returning the item associated with it. Note that the item has not been registered, so - * you still need to register it with forge. */ - Item registerDefinition(PipeDefinition_BC8 definition); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeType.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeType.java deleted file mode 100755 index 28deb4eee..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipeType.java +++ /dev/null @@ -1,22 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import java.util.Collections; -import java.util.List; - -public interface IPipeType { - /** Creates all of the default listeners for this pipe. Normally this will be a list with a single object, that will - * normally be a pipe transport. However, you can use this to register any listeners you wish. */ - List createDefaultListeners(IPipe_BC8 pipe); - - enum Void implements IPipeType { - STRUCTURE, - POWER, - FLUID, - ITEM; - - @Override - public List createDefaultListeners(IPipe_BC8 pipe) { - return Collections.emptyList(); - } - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipe_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPipe_BC8.java deleted file mode 100755 index 66dc2037c..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPipe_BC8.java +++ /dev/null @@ -1,50 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import java.util.Map; - -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; - -import buildcraft.api.core.INBTLoadable_BC8; -import buildcraft.api.transport.pipe_bc8.event_bc8.IPipeEvent_BC8; - -/** Represents a pipe in a world. Most older (BC version less than 8.x) events, functions and querys can be called by - * firing the appropriate event, and inspecting the event afterwards. Most functionality has been delegated to */ -/* Note that this does not have a "get pipe tile" method, as pipes are not bound to just tile entities */ -public interface IPipe_BC8 extends INBTLoadable_BC8 { - World getWorld(); - - IPipeHolder_BC8 getHolder(); - - IPipePropertyProvider getProperties(); - - PipeBehaviour_BC8 getBehaviour(); - - Map getConnections(); - - void fireEvent(IPipeEvent_BC8 event); - - /** Adds an event listener that will be saved and sent over the network. - * - * @return True if the listener was added to the listener bus. If this returns false it will usually be todo with - * the listener not being allowed onto the pipe (for example it was a gate and there was already a gate on - * that side, or a facade or something similar to that) */ - boolean addEventListener(IPipeListener list); - - void removeEventListener(IPipeListener list); - - /** Sends all of the network data about this listener to the client. Note that this is called automatically by - * {@link #addEventListener(IPipeListener)}. */ - void sendClientUpdate(IPipeListener listener); - - /** Makes this pipe send a client update at some point in the future. This might send it now, or it might send it - * next tick. */ - void scheduleClientUpdate(IPipeListener listener); - - /** Makes this pipe re-render its static parts. */ - void sendRenderUpdate(); - - /** Makes this pipe send a render update at some point in the future. This might send it now, or it might send it in - * a few ticks time. */ - void scheduleRenderUpdate(); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPluggable_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPluggable_BC8.java deleted file mode 100755 index 414f10458..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPluggable_BC8.java +++ /dev/null @@ -1,8 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import buildcraft.api.core.INBTLoadable_BC8; -import buildcraft.api.core.INetworkLoadable_BC8; - -public interface IPluggable_BC8 extends INetworkLoadable_BC8, INBTLoadable_BC8 { - -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/IPropertyRegistry.java b/src/api/java/buildcraft/api/transport/pipe_bc8/IPropertyRegistry.java deleted file mode 100755 index 5d54e5f94..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/IPropertyRegistry.java +++ /dev/null @@ -1,48 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyImplicit; -import buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyValue; - -public interface IPropertyRegistry { - IPipePropertyValue getValueProperty(String modId, String name); - - IPipePropertyValue registerValueProperty(String name, Class typeClass); - - IPipePropertyImplicit getImplicitProperty(String modId, String uniqueName); - - IPipePropertyImplicit registerSimpleImplicitProperty(String name, Class typeClass); - - IPipePropertyImplicit registerCutomImplicitProperty(String name, IPipePropertyImplicit property); - - // Used in case BuildCraft is not installed - enum Void implements IPropertyRegistry { - INSTANCE; - - // @formatter:off - @Override - public IPipePropertyValue getValueProperty(String a, String b) { - return null; - } - - @Override - public IPipePropertyValue registerValueProperty(String a, Class b) { - return null; - } - - @Override - public IPipePropertyImplicit getImplicitProperty(String a, String b) { - return null; - } - - @Override - public IPipePropertyImplicit registerSimpleImplicitProperty(String a, Class b) { - return null; - } - - @Override - public IPipePropertyImplicit registerCutomImplicitProperty(String a, IPipePropertyImplicit p) { - return p; - } - // @formatter:on - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeAPI_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/PipeAPI_BC8.java deleted file mode 100755 index 80030d459..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeAPI_BC8.java +++ /dev/null @@ -1,58 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.item.EnumDyeColor; - -import buildcraft.api.APIHelper; -import buildcraft.api.transport.pipe_bc8.IExtractionManager.IExtractable_BC8; -import buildcraft.api.transport.pipe_bc8.IInsertionManager.IInsertable_BC8; -import buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyImplicit; -import buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyValue; - -public enum PipeAPI_BC8 { - INSTANCE; - - public static final IPropertyRegistry PROPERTY_REGISTRY; - /** An insertion manager- used to get an instance of {@link IInsertable_BC8} for a given tile entity or movable - * entity. Can also be used to register custom {@link IInsertable_BC8} for custom tiles. */ - public static final IInsertionManager INSERTION_MANAGER; - /** An extraction manager- used to get an instance of {@link IExtractable_BC8} for a given tile entity or movable - * entity. Can also be used to register custom {@link IExtractable_BC8} for custom entities. */ - public static final IExtractionManager EXTRACTION_MANAGER; - - public static final IPipeRegistry PIPE_REGISTRY; - public static final IPipeListenerRegistry PIPE_LISTENER_REGISTRY; - - public static final IPipeHelper PIPE_HELPER; - - public static final IPipeType PIPE_TYPE_STRUCTURE; - public static final IPipeType PIPE_TYPE_POWER; - public static final IPipeType PIPE_TYPE_FLUID; - public static final IPipeType PIPE_TYPE_ITEM; - - public static final IPipePropertyValue ITEM_COLOUR; - public static final IPipePropertyValue ITEM_PAUSED; - - public static final IPipePropertyImplicit ITEM_COUNT; - public static final IPipePropertyImplicit STACK_COUNT; - - static { - PROPERTY_REGISTRY = APIHelper.getInstance("buildcraft.transport.api.impl.PropertyRegistry", IPropertyRegistry.class); - INSERTION_MANAGER = APIHelper.getInstance("buildcraft.transport.api.impl.InsertionManager", IInsertionManager.class); - EXTRACTION_MANAGER = APIHelper.getInstance("buildcraft.transport.api.impl.ExtractionManager", IExtractionManager.class); - - PIPE_REGISTRY = APIHelper.getInstance("buildcraft.transport.api.impl.PipeRegistry", IPipeRegistry.class); - PIPE_LISTENER_REGISTRY = APIHelper.getInstance("buildcraft.transport.api.impl.PipeListenerRegistry", IPipeListenerRegistry.class); - PIPE_HELPER = APIHelper.getInstance("buildcraft.transport.api.impl.PipeHelper", IPipeHelper.class); - - PIPE_TYPE_STRUCTURE = APIHelper.getNamedInstance("buildcraft.transport.api.impl.EnumPipeType", "STRUCTURE", IPipeType.class); - PIPE_TYPE_POWER = APIHelper.getNamedInstance("buildcraft.transport.api.impl.EnumPipeType", "POWER", IPipeType.class); - PIPE_TYPE_FLUID = APIHelper.getNamedInstance("buildcraft.transport.api.impl.EnumPipeType", "FLUID", IPipeType.class); - PIPE_TYPE_ITEM = APIHelper.getNamedInstance("buildcraft.transport.api.impl.EnumPipeType", "ITEM", IPipeType.class); - - ITEM_COLOUR = PROPERTY_REGISTRY.getValueProperty("BuildCraft|Transport", "item_colour"); - ITEM_PAUSED = PROPERTY_REGISTRY.getValueProperty("BuildCraft|Transport", "item_paused"); - - ITEM_COUNT = PROPERTY_REGISTRY.getImplicitProperty("BuildCraft|Transport", "item_count"); - STACK_COUNT = PROPERTY_REGISTRY.getImplicitProperty("BuildCraft|Transport", "stack_count"); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeBehaviour_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/PipeBehaviour_BC8.java deleted file mode 100755 index 41daf25fb..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeBehaviour_BC8.java +++ /dev/null @@ -1,35 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.util.EnumFacing; - -import io.netty.buffer.ByteBuf; - -/** An instance is created by instance of IBehaviourFactory per pipe block in world, and is registered with the pipe - * event bus to listen and respond to events. */ -public abstract class PipeBehaviour_BC8 implements IPipeListener { - public final PipeDefinition_BC8 definition; - public final IPipe_BC8 pipe; - - public PipeBehaviour_BC8(PipeDefinition_BC8 definition, IPipe_BC8 pipe) { - if (definition == null) throw new NullPointerException("definition"); - if (pipe == null) throw new NullPointerException("pipe"); - this.definition = definition; - this.pipe = pipe; - } - - /** @param side The side of which the pipe should be registered - * @return An integer between 0 (inclusive) and definition.maxSprites (exclusive). */ - public abstract int getIconIndex(EnumFacing side); - - /** Return the index for the icon for items. Override this if getIconIndex(null) does NOT return the item icon */ - public int getIconIndexForItem() { - return getIconIndex(null); - } - - @Override - public abstract PipeBehaviour_BC8 readFromByteBuf(ByteBuf buf); - - @Override - public abstract PipeBehaviour_BC8 readFromNBT(NBTBase nbt); -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeConnectionAPI.java b/src/api/java/buildcraft/api/transport/pipe_bc8/PipeConnectionAPI.java deleted file mode 100755 index aa0a46c65..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeConnectionAPI.java +++ /dev/null @@ -1,46 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import java.util.Map; - -import com.google.common.collect.Maps; - -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import buildcraft.api.transport.ICustomPipeConnection; - -/** Use this class to register blocks with custom block sizes so that pipes can connect to them properly. Note that you - * do not need to register a custom pipe connection if your block implements ICustomPipeConnection. The registered - * version also overrides your own implementation. */ -public final class PipeConnectionAPI { - private static final Map connections = Maps.newHashMap(); - private static final ICustomPipeConnection NOTHING = new ICustomPipeConnection() { - @Override - public float getExtension(World world, BlockPos pos, EnumFacing face, IBlockState state) { - return 0; - } - }; - - /** Register a block with a custom connection. Useful if you don't own the block class - * - * @param block The block instance - * @param connection The connection instance */ - public static void registerConnection(Block block, ICustomPipeConnection connection) { - connections.put(block, connection); - } - - /** Gets the current custom connection that the */ - public static ICustomPipeConnection getCustomConnection(Block block) { - ICustomPipeConnection connection = connections.get(block); - if (connection != null) { - return connection; - } - if (block instanceof ICustomPipeConnection) { - return (ICustomPipeConnection) block; - } - return NOTHING; - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeDefinition_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/PipeDefinition_BC8.java deleted file mode 100755 index 909cf8c5a..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/PipeDefinition_BC8.java +++ /dev/null @@ -1,86 +0,0 @@ -package buildcraft.api.transport.pipe_bc8; - -import java.util.Arrays; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.ResourceLocation; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import buildcraft.api.ObjectDefinition; -import buildcraft.api.core.BCLog; - -/** Contains all of the definitions of a pipe. */ -public final class PipeDefinition_BC8 extends ObjectDefinition { - /** The number of sprites to register related to this definition. */ - public final int maxSprites; - /** A string containing the location of the texture of a pipe. The final texture location will be - * {@link #textureLocationStart} + {@link #spriteLocations} */ - public final String textureLocationStart; - /** An array containing the end locations of each pipe texture. This array have a length equal to maxSprites. It is - * up to each indervidual pipe to determine which sprite to use for locations though. By default all of them will be - * initialised to {@link #textureLocationStart}+{@link #modUniqueTag}+{The texture suffixes given to the - * constructor} */ - private final String[] spriteLocations; - /** A factory the creates the behaviour of this definition. */ - public final IPipeBehaviourFactory behaviourFactory; - /** The type of this pipe. This determines how the pipe should be rendered and how the pipe should act. */ - public final IPipeType type; - - /** An array containing the actual sprites, where the positions are determined by {@link #spriteLocations} */ - @SideOnly(Side.CLIENT) - private TextureAtlasSprite[] sprites; - public final int itemSpriteIndex; - - public PipeDefinition_BC8(String tag, IPipeType type, String textureStart, String[] textureSuffixes, IPipeBehaviourFactory behaviour) { - this(tag, type, 0, textureStart, textureSuffixes, behaviour); - } - - /** @param tag A MOD-unique tag for the pipe - * @param type The type of pipe this is - * @param maxSprites The maximum number of sprites - * @param itemSpriteIndex - * @param textureStart - * @param factory */ - public PipeDefinition_BC8(String tag, IPipeType type, int itemSpriteIndex, String textureStart, String[] textureSuffixes, - IPipeBehaviourFactory factory) { - super(tag); - this.type = type; - this.maxSprites = textureSuffixes == null ? 1 : textureSuffixes.length; - this.itemSpriteIndex = itemSpriteIndex; - this.textureLocationStart = textureStart.endsWith("/") ? textureStart : (textureStart + "/"); - this.spriteLocations = new String[maxSprites]; - for (int i = 0; i < maxSprites; i++) { - spriteLocations[i] = textureLocationStart + modUniqueTag + (textureSuffixes == null ? "" : textureSuffixes[i]); - } - this.behaviourFactory = factory; - } - - @SideOnly(Side.CLIENT) - public TextureAtlasSprite getSprite(int index) { - if (sprites == null || index < 0 || index >= sprites.length) { - BCLog.logger.warn("Tried to get the sprite index " + index + " for " + globalUniqueTag); - return Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite(); - } - return sprites[index]; - } - - @SideOnly(Side.CLIENT) - public void registerSprites(TextureMap map) { - sprites = new TextureAtlasSprite[maxSprites]; - for (int i = 0; i < spriteLocations.length; i++) { - String string = spriteLocations[i]; - ResourceLocation location = new ResourceLocation(string); - sprites[i] = map.registerSprite(location); - } - } - - @Override - public String toString() { - return "PipeDefinition [globalUniqueTag=" + globalUniqueTag + ", modUniqueTag=" + modUniqueTag + ", behaviourFactory=" + behaviourFactory - + ", type=" + type + ", spriteLocations=" + Arrays.toString(spriteLocations) + "]"; - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventConnection_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventConnection_BC8.java deleted file mode 100755 index f03e246a8..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventConnection_BC8.java +++ /dev/null @@ -1,88 +0,0 @@ -package buildcraft.api.transport.pipe_bc8.event_bc8; - -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -import buildcraft.api.transport.IPipeConnection; -import buildcraft.api.transport.pipe_bc8.IConnection_BC8; -import buildcraft.api.transport.pipe_bc8.IPipe_BC8; - -public interface IPipeEventConnection_BC8 extends IPipeEvent_BC8 { - /** @return The connection object that is used. */ - IConnection_BC8 getConnection(); - - /** @return The face that this connection is over */ - EnumFacing getFace(); - - public interface AttemptCreate extends IPipeEventConnection_BC8 { - /** Calling this will disallow ANY connection to the pipe, regardless of any previous arguments passed. */ - void disallow(); - - /** Calling this any number of times will allow the connection to the pipe, but only if {@link #disallow()} has - * not been called. If this is never called, and the connection override type is DEFAULT (As specified by - * {@link IPipeConnection}) then there will be no connection. */ - void couldAccept(); - - /** @return The connection object that will be used if this event is not blocked. */ - @Override - IConnection_BC8 getConnection(); - - Object with(); - - public interface Pipe extends AttemptCreate { - @Override - IPipe_BC8 with(); - } - - public interface Tile extends AttemptCreate { - @Override - TileEntity with(); - } - - public interface MovableEntity extends AttemptCreate { - @Override - Entity with(); - } - } - - /** Fired after the connection object has been created and bound in the pipe, such that - * {@link IPipe_BC8#getConnections()} will include {@link #getFace()} mapped to {@link #getConnection()} */ - public interface Create extends IPipeEventConnection_BC8 { - Object with(); - - public interface Pipe extends Create { - @Override - IPipe_BC8 with(); - } - - public interface Tile extends Create { - @Override - TileEntity with(); - } - - public interface MovableEntity extends Create { - @Override - Entity with(); - } - } - - public interface Destroy extends IPipeEventConnection_BC8 { - Object with(); - - public interface Pipe extends Destroy { - @Override - IPipe_BC8 with(); - } - - public interface Tile extends Destroy { - @Override - TileEntity with(); - } - - public interface MovableEntity extends Destroy { - @Override - Entity with(); - } - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventContents_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventContents_BC8.java deleted file mode 100755 index 5b0c1f894..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventContents_BC8.java +++ /dev/null @@ -1,88 +0,0 @@ -package buildcraft.api.transport.pipe_bc8.event_bc8; - -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -import buildcraft.api.transport.pipe_bc8.IPipeContents; -import buildcraft.api.transport.pipe_bc8.IPipeContentsEditable; -import buildcraft.api.transport.pipe_bc8.IPipe_BC8; - -/** In all events, the contents have had the appropriate variables set up as if they were in the pipe at the time the - * event is fired. */ -public interface IPipeEventContents_BC8 extends IPipeEvent_BC8 { - IPipeContents getContents(); - - // Attempts to put in some contents - - /** Checks to make sure all parts of the pipe agree to the insertion. The pipe object will automatically fire this - * if you fire an {@link Enter} event, so most of the time you dod not actually need to check this yourself. */ - public interface AttemptEnter extends IPipeEventContents_BC8 { - void disallow(); - - /** Gets the direction that the contents came from. So if this was a pipe below, and the item was moving - * upwards, this would be {@link EnumFacing#DOWN} */ - EnumFacing getFrom(); - - /** Gets the *thing* that tried to insert to this pipe. Most of the time this will be a tile entity, however it - * might be a robot or anything else an addon can think of. */ - Object getInserter(); - - public interface Pipe extends AttemptEnter { - @Override - IPipe_BC8 getInserter(); - } - - /** Fired whenever a tile entity attempts to insert an item. NOTE: this will NEVER call with a pipe as the - * argument. */ - public interface Tile extends AttemptEnter { - @Override - TileEntity getInserter(); - } - - public interface MovableEntity extends AttemptEnter { - @Override - Entity getInserter(); - } - } - - // Actually puts in the contents - - /** Fired after {@link AttemptEnter}. The contents will be added to the pipe at some time during this event, but the - * contents will NEVER change during the event interval. Also the contents will be the same object as when they have - * been added to the pipe. NOTE: The pipe object will automatically fire {@link AttemptEnter} before firing this - * event, just to check if the contents can be inserted. You do not have to manually fire {@link AttemptEnter} - * yourself. */ - public interface Enter extends IPipeEventContents_BC8 { - @Override - IPipeContentsEditable getContents(); - - /** Gets the direction that the contents came from. So if this was a pipe below, and the item was moving - * upwards, this would be {@link EnumFacing#DOWN} */ - EnumFacing getFrom(); - - /** Call this (while the event is firing) to make {@link #hasBeenHandled()} return true */ - void handle(); - - /** @return If a listener has handled the enter event. (Usually if this returns false after an event was fired - * it means that something went very wrong somewhere, and the contents has NOT been used up.) If this - * does return false you should keep the contents to yourself. */ - boolean hasBeenHandled(); - } - - /** Fired after the contents have been removed from the pipe, but before they have been dropped onto the ground or - * added to a different pipe or inventory. */ - public interface Exit extends IPipeEventContents_BC8 { - @Override - IPipeContentsEditable getContents(); - } - - public interface ChangeSpeed extends IPipeEventContents_BC8 { - /** @return the normalized speed for this contents. For items the actual speed has been multiplied by a constant - * that ensures that this returns 1 if the item is going at normal speed through a cobblestone pipe, and - * 4 if it is going at maximum speed through a gold pipe. */ - double getNormalizedSpeed(); - - void setNormalizedSpeed(double speed); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventInteract_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventInteract_BC8.java deleted file mode 100755 index f007b1b2d..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEventInteract_BC8.java +++ /dev/null @@ -1,29 +0,0 @@ -package buildcraft.api.transport.pipe_bc8.event_bc8; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.AxisAlignedBB; - -import buildcraft.api.tools.IToolWrench; -import buildcraft.api.transport.pipe_bc8.IPipeListener; - -public interface IPipeEventInteract_BC8 extends IPipeEvent_BC8 { - EntityPlayer getPlayer(); - - /** Fired whenever a player selects a pipe. */ - public interface Select extends IPipeEventInteract_BC8 { - /** This should be called for every {@link AxisAlignedBB} that makes up your listener, and with your listener. - * The listener will receive the actual event directly. */ - void testBB(AxisAlignedBB aabb, IPipeListener callback); - } - - public interface Activate extends IPipeEventInteract_BC8 {} - - public interface UseItem extends IPipeEventInteract_BC8 { - ItemStack getItemStack(); - } - - public interface UseWrench extends IPipeEventInteract_BC8 { - IToolWrench getWrench(); - } -} diff --git a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEvent_BC8.java b/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEvent_BC8.java deleted file mode 100755 index 927aa34ed..000000000 --- a/src/api/java/buildcraft/api/transport/pipe_bc8/event_bc8/IPipeEvent_BC8.java +++ /dev/null @@ -1,26 +0,0 @@ -package buildcraft.api.transport.pipe_bc8.event_bc8; - -import buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyImplicit; -import buildcraft.api.transport.pipe_bc8.IPipe_BC8; - -public interface IPipeEvent_BC8 { - IPipe_BC8 getPipe(); - - public interface Tick extends IPipeEvent_BC8 { - long getCurrentTick(); - - public interface Client extends Tick {} - - public interface Server extends Tick {} - } - - public interface PropertyQuery extends IPipeEvent_BC8 { - Class getTypeClass(); - - IPipePropertyImplicit getProperty(); - - T getValue(); - - void setValue(T newValue); - } -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IConnectionMatrix.java b/src/api/java/buildcraft/api/transport/pluggable/IConnectionMatrix.java deleted file mode 100755 index 4bede4d03..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IConnectionMatrix.java +++ /dev/null @@ -1,7 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import net.minecraft.util.EnumFacing; - -public interface IConnectionMatrix { - boolean isConnected(EnumFacing face); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IFacadePluggable.java b/src/api/java/buildcraft/api/transport/pluggable/IFacadePluggable.java deleted file mode 100755 index a3ad9f329..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IFacadePluggable.java +++ /dev/null @@ -1,11 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import net.minecraft.block.state.IBlockState; - -public interface IFacadePluggable { - IBlockState getCurrentState(); - - boolean isTransparent(); - - boolean isHollow(); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableDynamicRenderer.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableDynamicRenderer.java deleted file mode 100755 index 61c69bed4..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableDynamicRenderer.java +++ /dev/null @@ -1,13 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import net.minecraft.util.EnumFacing; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import buildcraft.api.transport.IPipe; - -@SideOnly(Side.CLIENT) -public interface IPipePluggableDynamicRenderer { - void renderDynamicPluggable(IPipe pipe, EnumFacing side, PipePluggable pipePluggable, double x, double y, double z); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableItem.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableItem.java deleted file mode 100755 index b9295e5f0..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableItem.java +++ /dev/null @@ -1,10 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; - -import buildcraft.api.transport.IPipe; - -public interface IPipePluggableItem { - PipePluggable createPipePluggable(IPipe pipe, EnumFacing side, ItemStack stack); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableState.java b/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableState.java deleted file mode 100755 index 7b657dfd0..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IPipePluggableState.java +++ /dev/null @@ -1,9 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import net.minecraft.util.EnumFacing; - -public interface IPipePluggableState { - IConnectionMatrix getPluggableConnections(); - - PipePluggable getPluggable(EnumFacing face); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPipeRenderState.java b/src/api/java/buildcraft/api/transport/pluggable/IPipeRenderState.java deleted file mode 100755 index d923061fd..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IPipeRenderState.java +++ /dev/null @@ -1,5 +0,0 @@ -package buildcraft.api.transport.pluggable; - -public interface IPipeRenderState { - IConnectionMatrix getPipeConnectionMatrix(); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/IPluggableModelBaker.java b/src/api/java/buildcraft/api/transport/pluggable/IPluggableModelBaker.java deleted file mode 100755 index 829eedaa8..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/IPluggableModelBaker.java +++ /dev/null @@ -1,17 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import com.google.common.collect.ImmutableList; - -import net.minecraft.client.renderer.block.model.BakedQuad; -import net.minecraft.client.renderer.vertex.VertexFormat; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public interface IPluggableModelBaker> { - /** @return The vertex format used to generate the quads. */ - VertexFormat getVertexFormat(); - - ImmutableList bake(K key); -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/PipePluggable.java b/src/api/java/buildcraft/api/transport/pluggable/PipePluggable.java deleted file mode 100755 index 2f3db1410..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/PipePluggable.java +++ /dev/null @@ -1,62 +0,0 @@ -/** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com - * - * The BuildCraft API is distributed under the terms of the MIT License. Please check the contents of the license, which - * should be located as "LICENSE.API" in the BuildCraft source code distribution. */ -package buildcraft.api.transport.pluggable; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import buildcraft.api.core.INBTStoreable; -import buildcraft.api.core.ISerializable; -import buildcraft.api.transport.IPipeTile; - -/** An IPipePluggable MUST have an empty constructor for client-side rendering! */ -public abstract class PipePluggable implements INBTStoreable, ISerializable { - public abstract ItemStack[] getDropItems(IPipeTile pipe); - - public void update(IPipeTile pipe, EnumFacing direction) { - - } - - public void onAttachedPipe(IPipeTile pipe, EnumFacing direction) { - validate(pipe, direction); - } - - public void onDetachedPipe(IPipeTile pipe, EnumFacing direction) { - invalidate(); - } - - public abstract boolean isBlocking(IPipeTile pipe, EnumFacing direction); - - public void invalidate() { - - } - - public void validate(IPipeTile pipe, EnumFacing direction) { - - } - - public boolean isSolidOnSide(IPipeTile pipe, EnumFacing direction) { - return false; - } - - public abstract AxisAlignedBB getBoundingBox(EnumFacing side); - - @SideOnly(Side.CLIENT) - public IPipePluggableDynamicRenderer getDynamicRenderer() { - return null; - } - - @SideOnly(Side.CLIENT) - public abstract PluggableModelKey getModelRenderKey(BlockRenderLayer layer, EnumFacing side); - - public boolean requiresRenderUpdate(PipePluggable old) { - return true; - } -} diff --git a/src/api/java/buildcraft/api/transport/pluggable/PluggableModelKey.java b/src/api/java/buildcraft/api/transport/pluggable/PluggableModelKey.java deleted file mode 100755 index 32739e4a6..000000000 --- a/src/api/java/buildcraft/api/transport/pluggable/PluggableModelKey.java +++ /dev/null @@ -1,42 +0,0 @@ -package buildcraft.api.transport.pluggable; - -import java.util.Arrays; -import java.util.Objects; - -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; - -public abstract class PluggableModelKey> { - public final BlockRenderLayer layer; - public final IPluggableModelBaker baker; - public final EnumFacing side; - private final int hash; - - public PluggableModelKey(BlockRenderLayer layer, IPluggableModelBaker baker, EnumFacing side) { - this.layer = layer; - if (layer != BlockRenderLayer.CUTOUT && layer != BlockRenderLayer.TRANSLUCENT) { - throw new IllegalArgumentException("Can only use CUTOUT or TRANSLUCENT at the moment (was " + layer + ")"); - } - if (baker == null) throw new NullPointerException("baker"); - this.baker = baker; - this.side = side; - /* Don't include the block layer in the hash code as there are different caches for cutout and translucent */ - this.hash = Arrays.hashCode(new int[] { System.identityHashCode(baker), Objects.hashCode(side) }); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; - PluggableModelKey other = (PluggableModelKey) obj; - if (baker != other.baker) return false; - if (side != other.side) return false; - return true; - } - - @Override - public int hashCode() { - return hash; - } -}