From 82a708c7b20e0f84b5b714df5a58e2f3511f7bfa Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Tue, 24 Jun 2014 20:33:25 +0100 Subject: [PATCH] =?UTF-8?q?Remove=20bits=20of=20APIs=20that=20are=20unneed?= =?UTF-8?q?ed.=20First=20step=20in=20attempting=20to=20Do=20It=20Right?= =?UTF-8?q?=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/blueprints/BlockSignature.java | 76 --- .../api/blueprints/BlueprintManager.java | 44 -- .../buildcraft/api/blueprints/BptBlock.java | 234 ------- .../api/blueprints/BptBlockUtils.java | 84 --- .../api/blueprints/BptSlotInfo.java | 55 -- .../api/blueprints/IBptContext.java | 47 -- .../api/blueprints/ItemSignature.java | 47 -- .../api/blueprints/package-info.java | 3 - .../buildcraft/api/bptblocks/BptBlockBed.java | 88 --- .../api/bptblocks/BptBlockCustomStack.java | 33 - .../api/bptblocks/BptBlockDelegate.java | 69 -- .../api/bptblocks/BptBlockDirt.java | 42 -- .../api/bptblocks/BptBlockDoor.java | 70 -- .../api/bptblocks/BptBlockFluid.java | 60 -- .../api/bptblocks/BptBlockIgnore.java | 44 -- .../api/bptblocks/BptBlockIgnoreMeta.java | 34 - .../api/bptblocks/BptBlockInventory.java | 37 -- .../api/bptblocks/BptBlockLever.java | 37 -- .../api/bptblocks/BptBlockPiston.java | 28 - .../api/bptblocks/BptBlockPumpkin.java | 53 -- .../bptblocks/BptBlockRedstoneRepeater.java | 49 -- .../bptblocks/BptBlockRotateInventory.java | 35 - .../api/bptblocks/BptBlockRotateMeta.java | 84 --- .../api/bptblocks/BptBlockSign.java | 63 -- .../api/bptblocks/BptBlockStairs.java | 53 -- .../api/bptblocks/BptBlockWallSide.java | 51 -- .../api/bptblocks/package-info.java | 3 - .../buildcraft/api/core/BuildCraftAPI.java | 22 - .../buildcraft/api/core/IAreaProvider.java | 33 - src/main/java/buildcraft/api/core/IBox.java | 29 - .../buildcraft/api/core/IIconProvider.java | 32 - .../java/buildcraft/api/core/LaserKind.java | 13 - .../java/buildcraft/api/core/Position.java | 141 ----- .../buildcraft/api/core/StackWrapper.java | 52 -- .../buildcraft/api/core/package-info.java | 3 - .../buildcraft/api/filler/FillerManager.java | 15 - .../buildcraft/api/filler/IFillerPattern.java | 37 -- .../api/filler/IFillerRegistry.java | 25 - .../api/filler/IPatternIterator.java | 16 - .../buildcraft/api/filler/package-info.java | 3 - .../api/fuels/IronEngineCoolant.java | 91 --- .../buildcraft/api/gates/ActionManager.java | 99 --- .../api/gates/GateExpansionController.java | 58 -- .../buildcraft/api/gates/GateExpansions.java | 65 -- .../java/buildcraft/api/gates/IAction.java | 29 - .../buildcraft/api/gates/IActionProvider.java | 22 - .../buildcraft/api/gates/IActionReceptor.java | 15 - .../buildcraft/api/gates/IGateExpansion.java | 30 - .../api/gates/IOverrideDefaultTriggers.java | 20 - .../buildcraft/api/gates/ITileTrigger.java | 21 - .../java/buildcraft/api/gates/ITrigger.java | 52 -- .../api/gates/ITriggerParameter.java | 27 - .../api/gates/ITriggerProvider.java | 28 - .../api/gates/TriggerParameter.java | 79 --- .../buildcraft/api/gates/package-info.java | 3 - .../api/inventory/ISpecialInventory.java | 45 -- .../api/inventory/package-info.java | 3 - .../buildcraft/api/power/ILaserTarget.java | 41 -- .../api/recipes/BuildcraftRecipes.java | 19 - .../api/recipes/IAssemblyRecipeManager.java | 36 -- .../recipes/IIntegrationRecipeManager.java | 43 -- .../api/recipes/IRefineryRecipeManager.java | 36 -- .../buildcraft/api/recipes/package-info.java | 3 - .../buildcraft/api/tools/IToolPipette.java | 48 -- .../api/transport/IExtractionHandler.java | 29 - .../api/transport/IPipeConnection.java | 30 - .../api/transport/IPipeDefinition.java | 26 - .../api/transport/PipeBehavior.java | 47 -- .../buildcraft/api/transport/PipeManager.java | 44 -- src/main/java/cofh/api/block/IBlockDebug.java | 36 -- src/main/java/cofh/api/block/IBlockInfo.java | 42 -- .../java/cofh/api/block/IDismantleable.java | 25 - src/main/java/cofh/api/core/IInitializer.java | 17 - .../java/cofh/api/energy/EnergyStorage.java | 158 ----- .../java/cofh/api/energy/IEnergyStorage.java | 45 -- .../cofh/api/energy/ItemEnergyContainer.java | 110 ---- .../cofh/api/energy/TileEnergyHandler.java | 62 -- .../java/cofh/api/energy/package-info.java | 9 + .../java/cofh/api/item/IEmpowerableItem.java | 41 -- .../cofh/api/item/IInventoryConnection.java | 20 - .../api/item/IInventoryContainerItem.java | 78 --- .../java/cofh/api/item/IInventoryHandler.java | 82 --- src/main/java/cofh/api/item/ISecureItem.java | 26 - .../java/cofh/api/item/ITinkerableItem.java | 33 - src/main/java/cofh/api/package-info.java | 9 + .../cofh/api/tileentity/IAugmentableTile.java | 28 - .../java/cofh/api/tileentity/IEnergyInfo.java | 33 - .../api/tileentity/IReconfigurableFacing.java | 39 -- .../api/tileentity/IReconfigurableSides.java | 54 -- .../cofh/api/tileentity/IRedstoneCache.java | 17 - .../cofh/api/tileentity/IRedstoneControl.java | 57 -- .../java/cofh/api/tileentity/ISecureTile.java | 56 -- .../cofh/api/tileentity/ISidedTexture.java | 25 - .../java/cofh/api/tileentity/ITileDebug.java | 27 - .../java/cofh/api/tileentity/ITileInfo.java | 33 - .../cofh/api/transport/IEnderAttuned.java | 13 - .../api/transport/IEnderEnergyHandler.java | 35 - .../api/transport/IEnderFluidHandler.java | 37 -- .../cofh/api/transport/IEnderItemHandler.java | 38 -- .../java/cofh/api/transport/IItemDuct.java | 26 - .../cofh/api/world/IFeatureGenerator.java | 39 -- .../java/cofh/api/world/IFeatureHandler.java | 22 - src/main/java/ic2/api/crops/BaseSeed.java | 56 -- src/main/java/ic2/api/crops/CropCard.java | 374 ----------- src/main/java/ic2/api/crops/Crops.java | 117 ---- src/main/java/ic2/api/crops/ICropTile.java | 253 -------- src/main/java/ic2/api/crops/package-info.java | 4 - src/main/java/ic2/api/energy/EnergyNet.java | 18 - src/main/java/ic2/api/energy/IEnergyNet.java | 64 -- .../java/ic2/api/energy/prefab/BasicSink.java | 375 ----------- .../ic2/api/energy/prefab/BasicSource.java | 375 ----------- .../ic2/api/energy/prefab/package-info.java | 4 - .../ic2/api/energy/tile/IEnergyConductor.java | 53 -- .../ic2/api/energy/tile/IMetaDelegate.java | 34 - src/main/java/ic2/api/event/LaserEvent.java | 114 ---- src/main/java/ic2/api/event/PaintEvent.java | 32 - .../java/ic2/api/event/RetextureEvent.java | 37 -- src/main/java/ic2/api/event/package-info.java | 4 - src/main/java/ic2/api/item/IBoxable.java | 14 - src/main/java/ic2/api/item/IC2Items.java | 599 ------------------ .../ic2/api/item/ICustomElectricItem.java | 67 -- src/main/java/ic2/api/item/IDebuggable.java | 23 - src/main/java/ic2/api/item/IItemHudInfo.java | 26 - src/main/java/ic2/api/item/IMetalArmor.java | 20 - .../java/ic2/api/item/ITerraformingBP.java | 35 - src/main/java/ic2/api/item/ItemWrapper.java | 50 -- ...INetworkClientTileEntityEventListener.java | 17 - .../ic2/api/network/INetworkDataProvider.java | 18 - .../network/INetworkItemEventListener.java | 19 - .../INetworkTileEntityEventListener.java | 14 - .../api/network/INetworkUpdateListener.java | 14 - .../java/ic2/api/network/NetworkHelper.java | 194 ------ .../java/ic2/api/network/package-info.java | 4 - src/main/java/ic2/api/reactor/IC2Reactor.java | 34 - src/main/java/ic2/api/reactor/IReactor.java | 138 ---- .../java/ic2/api/reactor/IReactorChamber.java | 13 - .../ic2/api/reactor/IReactorComponent.java | 99 --- .../java/ic2/api/reactor/package-info.java | 4 - .../java/ic2/api/tile/ExplosionWhitelist.java | 47 -- src/main/java/ic2/api/util/IKeyboard.java | 14 - src/main/java/ic2/api/util/Keys.java | 6 - src/main/java/ic2/api/util/package-info.java | 4 - 142 files changed, 18 insertions(+), 7774 deletions(-) delete mode 100644 src/main/java/buildcraft/api/blueprints/BlockSignature.java delete mode 100644 src/main/java/buildcraft/api/blueprints/BlueprintManager.java delete mode 100644 src/main/java/buildcraft/api/blueprints/BptBlock.java delete mode 100644 src/main/java/buildcraft/api/blueprints/BptBlockUtils.java delete mode 100644 src/main/java/buildcraft/api/blueprints/BptSlotInfo.java delete mode 100644 src/main/java/buildcraft/api/blueprints/IBptContext.java delete mode 100644 src/main/java/buildcraft/api/blueprints/ItemSignature.java delete mode 100644 src/main/java/buildcraft/api/blueprints/package-info.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockBed.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockCustomStack.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockDelegate.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockDirt.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockDoor.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockFluid.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockIgnore.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockInventory.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockLever.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockPiston.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockPumpkin.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockRotateInventory.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockRotateMeta.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockSign.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockStairs.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/BptBlockWallSide.java delete mode 100644 src/main/java/buildcraft/api/bptblocks/package-info.java delete mode 100644 src/main/java/buildcraft/api/core/BuildCraftAPI.java delete mode 100644 src/main/java/buildcraft/api/core/IAreaProvider.java delete mode 100644 src/main/java/buildcraft/api/core/IBox.java delete mode 100644 src/main/java/buildcraft/api/core/IIconProvider.java delete mode 100644 src/main/java/buildcraft/api/core/LaserKind.java delete mode 100644 src/main/java/buildcraft/api/core/Position.java delete mode 100644 src/main/java/buildcraft/api/core/StackWrapper.java delete mode 100644 src/main/java/buildcraft/api/core/package-info.java delete mode 100644 src/main/java/buildcraft/api/filler/FillerManager.java delete mode 100644 src/main/java/buildcraft/api/filler/IFillerPattern.java delete mode 100644 src/main/java/buildcraft/api/filler/IFillerRegistry.java delete mode 100644 src/main/java/buildcraft/api/filler/IPatternIterator.java delete mode 100644 src/main/java/buildcraft/api/filler/package-info.java delete mode 100644 src/main/java/buildcraft/api/fuels/IronEngineCoolant.java delete mode 100644 src/main/java/buildcraft/api/gates/ActionManager.java delete mode 100644 src/main/java/buildcraft/api/gates/GateExpansionController.java delete mode 100644 src/main/java/buildcraft/api/gates/GateExpansions.java delete mode 100644 src/main/java/buildcraft/api/gates/IAction.java delete mode 100644 src/main/java/buildcraft/api/gates/IActionProvider.java delete mode 100644 src/main/java/buildcraft/api/gates/IActionReceptor.java delete mode 100644 src/main/java/buildcraft/api/gates/IGateExpansion.java delete mode 100644 src/main/java/buildcraft/api/gates/IOverrideDefaultTriggers.java delete mode 100644 src/main/java/buildcraft/api/gates/ITileTrigger.java delete mode 100644 src/main/java/buildcraft/api/gates/ITrigger.java delete mode 100644 src/main/java/buildcraft/api/gates/ITriggerParameter.java delete mode 100644 src/main/java/buildcraft/api/gates/ITriggerProvider.java delete mode 100644 src/main/java/buildcraft/api/gates/TriggerParameter.java delete mode 100644 src/main/java/buildcraft/api/gates/package-info.java delete mode 100644 src/main/java/buildcraft/api/inventory/ISpecialInventory.java delete mode 100644 src/main/java/buildcraft/api/inventory/package-info.java delete mode 100644 src/main/java/buildcraft/api/power/ILaserTarget.java delete mode 100644 src/main/java/buildcraft/api/recipes/BuildcraftRecipes.java delete mode 100644 src/main/java/buildcraft/api/recipes/IAssemblyRecipeManager.java delete mode 100644 src/main/java/buildcraft/api/recipes/IIntegrationRecipeManager.java delete mode 100644 src/main/java/buildcraft/api/recipes/IRefineryRecipeManager.java delete mode 100644 src/main/java/buildcraft/api/recipes/package-info.java delete mode 100644 src/main/java/buildcraft/api/tools/IToolPipette.java delete mode 100644 src/main/java/buildcraft/api/transport/IExtractionHandler.java delete mode 100644 src/main/java/buildcraft/api/transport/IPipeConnection.java delete mode 100644 src/main/java/buildcraft/api/transport/IPipeDefinition.java delete mode 100644 src/main/java/buildcraft/api/transport/PipeBehavior.java delete mode 100644 src/main/java/buildcraft/api/transport/PipeManager.java delete mode 100644 src/main/java/cofh/api/block/IBlockDebug.java delete mode 100644 src/main/java/cofh/api/block/IBlockInfo.java delete mode 100644 src/main/java/cofh/api/block/IDismantleable.java delete mode 100644 src/main/java/cofh/api/core/IInitializer.java delete mode 100644 src/main/java/cofh/api/energy/EnergyStorage.java delete mode 100644 src/main/java/cofh/api/energy/IEnergyStorage.java delete mode 100644 src/main/java/cofh/api/energy/ItemEnergyContainer.java delete mode 100644 src/main/java/cofh/api/energy/TileEnergyHandler.java create mode 100644 src/main/java/cofh/api/energy/package-info.java delete mode 100644 src/main/java/cofh/api/item/IEmpowerableItem.java delete mode 100644 src/main/java/cofh/api/item/IInventoryConnection.java delete mode 100644 src/main/java/cofh/api/item/IInventoryContainerItem.java delete mode 100644 src/main/java/cofh/api/item/IInventoryHandler.java delete mode 100644 src/main/java/cofh/api/item/ISecureItem.java delete mode 100644 src/main/java/cofh/api/item/ITinkerableItem.java create mode 100644 src/main/java/cofh/api/package-info.java delete mode 100644 src/main/java/cofh/api/tileentity/IAugmentableTile.java delete mode 100644 src/main/java/cofh/api/tileentity/IEnergyInfo.java delete mode 100644 src/main/java/cofh/api/tileentity/IReconfigurableFacing.java delete mode 100644 src/main/java/cofh/api/tileentity/IReconfigurableSides.java delete mode 100644 src/main/java/cofh/api/tileentity/IRedstoneCache.java delete mode 100644 src/main/java/cofh/api/tileentity/IRedstoneControl.java delete mode 100644 src/main/java/cofh/api/tileentity/ISecureTile.java delete mode 100644 src/main/java/cofh/api/tileentity/ISidedTexture.java delete mode 100644 src/main/java/cofh/api/tileentity/ITileDebug.java delete mode 100644 src/main/java/cofh/api/tileentity/ITileInfo.java delete mode 100644 src/main/java/cofh/api/transport/IEnderAttuned.java delete mode 100644 src/main/java/cofh/api/transport/IEnderEnergyHandler.java delete mode 100644 src/main/java/cofh/api/transport/IEnderFluidHandler.java delete mode 100644 src/main/java/cofh/api/transport/IEnderItemHandler.java delete mode 100644 src/main/java/cofh/api/transport/IItemDuct.java delete mode 100644 src/main/java/cofh/api/world/IFeatureGenerator.java delete mode 100644 src/main/java/cofh/api/world/IFeatureHandler.java delete mode 100644 src/main/java/ic2/api/crops/BaseSeed.java delete mode 100644 src/main/java/ic2/api/crops/CropCard.java delete mode 100644 src/main/java/ic2/api/crops/Crops.java delete mode 100644 src/main/java/ic2/api/crops/ICropTile.java delete mode 100644 src/main/java/ic2/api/crops/package-info.java delete mode 100644 src/main/java/ic2/api/energy/EnergyNet.java delete mode 100644 src/main/java/ic2/api/energy/IEnergyNet.java delete mode 100644 src/main/java/ic2/api/energy/prefab/BasicSink.java delete mode 100644 src/main/java/ic2/api/energy/prefab/BasicSource.java delete mode 100644 src/main/java/ic2/api/energy/prefab/package-info.java delete mode 100644 src/main/java/ic2/api/energy/tile/IEnergyConductor.java delete mode 100644 src/main/java/ic2/api/energy/tile/IMetaDelegate.java delete mode 100644 src/main/java/ic2/api/event/LaserEvent.java delete mode 100644 src/main/java/ic2/api/event/PaintEvent.java delete mode 100644 src/main/java/ic2/api/event/RetextureEvent.java delete mode 100644 src/main/java/ic2/api/event/package-info.java delete mode 100644 src/main/java/ic2/api/item/IBoxable.java delete mode 100644 src/main/java/ic2/api/item/IC2Items.java delete mode 100644 src/main/java/ic2/api/item/ICustomElectricItem.java delete mode 100644 src/main/java/ic2/api/item/IDebuggable.java delete mode 100644 src/main/java/ic2/api/item/IItemHudInfo.java delete mode 100644 src/main/java/ic2/api/item/IMetalArmor.java delete mode 100644 src/main/java/ic2/api/item/ITerraformingBP.java delete mode 100644 src/main/java/ic2/api/item/ItemWrapper.java delete mode 100644 src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java delete mode 100644 src/main/java/ic2/api/network/INetworkDataProvider.java delete mode 100644 src/main/java/ic2/api/network/INetworkItemEventListener.java delete mode 100644 src/main/java/ic2/api/network/INetworkTileEntityEventListener.java delete mode 100644 src/main/java/ic2/api/network/INetworkUpdateListener.java delete mode 100644 src/main/java/ic2/api/network/NetworkHelper.java delete mode 100644 src/main/java/ic2/api/network/package-info.java delete mode 100644 src/main/java/ic2/api/reactor/IC2Reactor.java delete mode 100644 src/main/java/ic2/api/reactor/IReactor.java delete mode 100644 src/main/java/ic2/api/reactor/IReactorChamber.java delete mode 100644 src/main/java/ic2/api/reactor/IReactorComponent.java delete mode 100644 src/main/java/ic2/api/reactor/package-info.java delete mode 100644 src/main/java/ic2/api/tile/ExplosionWhitelist.java delete mode 100644 src/main/java/ic2/api/util/IKeyboard.java delete mode 100644 src/main/java/ic2/api/util/Keys.java delete mode 100644 src/main/java/ic2/api/util/package-info.java diff --git a/src/main/java/buildcraft/api/blueprints/BlockSignature.java b/src/main/java/buildcraft/api/blueprints/BlockSignature.java deleted file mode 100644 index 519ce016a..000000000 --- a/src/main/java/buildcraft/api/blueprints/BlockSignature.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.blueprints; - -public class BlockSignature { - - public String blockClassName; - public String tileClassName; - public String blockName; - public String mod; - public String modVersion; - public String customField; - - public BlockSignature(String str) { - String[] values = str.split("/"); - - int i = 0; - - if (values[0].equals("#B")) { - i++; - } - - blockClassName = values[i]; - tileClassName = values[i + 1]; - blockName = values[i + 2]; - mod = values[i + 3]; - modVersion = values[i + 4]; - customField = values[i + 5]; - - replaceNullWithStar(); - - } - - public BlockSignature() { - replaceNullWithStar(); - } - - @Override - public String toString() { - replaceNullWithStar(); - - return "#B/" + blockClassName + "/" + tileClassName + "/" + blockName + "/" + mod + "/" + modVersion + "/" + customField; - } - - public void replaceNullWithStar() { - if (blockClassName == null) { - blockClassName = "*"; - } - - if (tileClassName == null) { - tileClassName = "*"; - } - - if (blockName == null) { - blockName = "*"; - } - - if (mod == null) { - mod = "*"; - } - - if (modVersion == null) { - modVersion = "*"; - } - - if (customField == null) { - customField = "*"; - } - } -} diff --git a/src/main/java/buildcraft/api/blueprints/BlueprintManager.java b/src/main/java/buildcraft/api/blueprints/BlueprintManager.java deleted file mode 100644 index 07df78d51..000000000 --- a/src/main/java/buildcraft/api/blueprints/BlueprintManager.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.blueprints; - -import buildcraft.api.core.BuildCraftAPI; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BlueprintManager { - - //public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length]; - - public static ItemSignature getItemSignature(Item item) { - ItemSignature sig = new ItemSignature(); - - //if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) { - // sig.itemClassName = item.getClass().getSimpleName(); - //} - - sig.itemName = item.getUnlocalizedName(new ItemStack(item)); - - return sig; - } - - public static BlockSignature getBlockSignature(Block block) { - //return BlueprintManager.blockBptProps[0].getSignature(block); - return null; - } - - static { - // Initialize defaults for block properties. - //for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) { - // new BptBlock(i); - //} - } -} diff --git a/src/main/java/buildcraft/api/blueprints/BptBlock.java b/src/main/java/buildcraft/api/blueprints/BptBlock.java deleted file mode 100644 index 305cdee40..000000000 --- a/src/main/java/buildcraft/api/blueprints/BptBlock.java +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.blueprints; - -import buildcraft.api.core.BuildCraftAPI; -import java.util.ArrayList; -import java.util.LinkedList; -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -/** - * This class allow to specify specific behavior for blocks stored in blueprints: - * - * - what items needs to be used to create that block - how the block has to be built on the world - how to rotate the block - what extra data to store / load - * in the blueprint - * - * Default implementations of this can be seen in the package buildcraft.api.bptblocks. The class BptBlockUtils provide some additional utilities. - * - * Blueprints perform "id translation" in case the block ids between a blueprint and the world installation are different. In order to translate block ids, - * blocks needs to be uniquely identified. By default, this identification is done by: - * - * - the block simple class name - the tile simple class name (if any) - the block name - * - * In certain circumstances, the above is not enough (e.g. if several blocks share the same class and the same name, with no tile). In this case, additional - * data may be provided by children of this class: - * - * - mod name - custom signature - * - * At blueprint load time, BuildCraft will check that each block id of the blueprint corresponds to the block id in the installation. If not, it will perform a - * search through the block list, and upon matching signature, it will translate all blocks ids of the blueprint to the installation ones. If no such block id - * is found, BuildCraft will assume that the block is not installed and will not load the blueprint. - */ - -@Deprecated -public class BptBlock { - - public final int blockId; - - public BptBlock(int blockId) { - this.blockId = blockId; - - //BlueprintManager.blockBptProps[blockId] = this; - } - - /** - * Returns the requirements needed to build this block. When the requirements are met, they will be removed all at once from the builder, before calling - * buildBlock. - */ - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if (slot.block != null) { - if (slot.storedRequirements.size() != 0) { - requirements.addAll(slot.storedRequirements); - } else { - // requirements.add(new ItemStack(slot.blockId, 1, slot.meta)); - } - } - } - - /** - * This is called each time an item matches a reqquirement, that is: (req id == stack id) for damageable items (req id == stack id && req dmg == stack dmg) - * for other items by default, it will increase damage of damageable items by the amount of damage of the requirement, and remove the intended amount of non - * damageable item. - * - * Client may override this behavior for default items. Note that this subprogram may be called twice with the same parameters, once with a copy of - * requirements and stack to check if the entire requirements can be fullfilled, and once with the real inventory. Implementer is responsible for updating - * req (with the remaining requirements if any) and stack (after usage) - * - * returns: what was used (similer to req, but created from stack, so that any NBT based differences are drawn from the correct source) - */ - public ItemStack useItem(BptSlotInfo slot, IBptContext context, ItemStack req, ItemStack stack) { - ItemStack result = stack.copy(); - if (stack.isItemStackDamageable()) { - if (req.getItemDamage() + stack.getItemDamage() <= stack.getMaxDamage()) { - stack.setItemDamage(req.getItemDamage() + stack.getItemDamage()); - result.setItemDamage(req.getItemDamage()); - req.stackSize = 0; - } - - if (stack.getItemDamage() >= stack.getMaxDamage()) { - stack.stackSize = 0; - } - } else { - if (stack.stackSize >= req.stackSize) { - result.stackSize = req.stackSize; - stack.stackSize -= req.stackSize; - req.stackSize = 0; - } else { - req.stackSize -= stack.stackSize; - stack.stackSize = 0; - } - } - - if (stack.stackSize == 0 && stack.getItem().getContainerItem() != null) { - Item container = stack.getItem().getContainerItem(); - - //stack.itemID = container.itemID; - stack.stackSize = 1; - stack.setItemDamage(0); - } - return result; - } - - /** - * Return true if the block on the world correspond to the block stored in the blueprint at the location given by the slot. By default, this subprogram is - * permissive and doesn't take into account metadata. - * - * Added metadata sensitivity //Krapht - */ - public boolean isValid(BptSlotInfo slot, IBptContext context) { - //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && slot.meta == context.world().getBlockMetadata(slot.x, slot.y, slot.z); - return false; - } - - /** - * Perform a 90 degree rotation to the slot. - */ - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - /** - * Places the block in the world, at the location specified in the slot. - */ - public void buildBlock(BptSlotInfo slot, IBptContext context) { - // Meta needs to be specified twice, depending on the block behavior - context.world().setBlock(slot.x, slot.y, slot.z, slot.block, slot.meta, 0); - //context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,3); - - if (slot.block instanceof BlockContainer) { - TileEntity tile = context.world().getTileEntity(slot.x, slot.y, slot.z); - - //slot.cpt.setInteger("x", slot.x); - //slot.cpt.setInteger("y", slot.y); - //slot.cpt.setInteger("z", slot.z); - - //if (tile != null) { - // tile.readFromNBT(slot.cpt); - //} - } - } - - /** - * Return true if the block should not be placed to the world. Requirements will not be asked on such a block, and building will not be called. - */ - public boolean ignoreBuilding(BptSlotInfo slot) { - return false; - } - - /** - * Initializes a slot from the blueprint according to an objet placed on {x, y, z} on the world. This typically means adding entries in slot.cpt. Note that - * "id" and "meta" will be set automatically, corresponding to the block id and meta. - * - * By default, if the block is a BlockContainer, tile information will be to save / load the block. - */ - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { - /*if (Block.blocksList[slot.blockId] instanceof BlockContainer) { - TileEntity tile = context.world().getTileEntity(x, y, z); - - if (tile != null) { - tile.writeToNBT(slot.cpt); - } - } - - if (Block.blocksList[slot.blockId] != null) { - ArrayList req = Block.blocksList[slot.blockId].getBlockDropped(context.world(), x, y, z, context.world().getBlockMetadata(x, y, z), 0); - - if (req != null) { - slot.storedRequirements.addAll(req); - } - }*/ - } - - /** - * Called on a block when the blueprint has finished to place all the blocks. This may be useful to adjust variable depending on surrounding blocks that may - * not be there already at initial building. - */ - public void postProcessing(BptSlotInfo slot, IBptContext context) { - - } - - /** - * By default, block class name, block tile name and block name are used to define block signature. Overriding this subprogram may allow to replace some of - * these with stars, specify the mod that this block kind is coming from or add custom data to the signature. - */ - public BlockSignature getSignature(Block block) { - BlockSignature sig = new BlockSignature(); - - /*if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) { - sig.blockClassName = block.getClass().getSimpleName(); - - if (block instanceof BlockContainer) { - // TODO: Try to see if we can get a world instance to call with instead of null - TileEntity tile = ((BlockContainer) block).createNewTileEntity(null); - - if (tile != null) { - sig.tileClassName = tile.getClass().getSimpleName(); - } - } - }*/ - - sig.blockName = block.getUnlocalizedName(); - sig.replaceNullWithStar(); - - return sig; - } - - /** - * By default, block name, block and tile classes, mod name and custom signature are matched to verify if a blueprint block corresponds to the installation - * block - except for the default blocks which don't check for classes. For any value, * means match with anything. For compatibilty and evolution reasons, - * mods may want to write a different policy, allowing to migrate one format to the other. - */ - public boolean match(Block block, BlockSignature sig) { - if (block == null) - return false; - - BlockSignature inst = BlueprintManager.getBlockSignature(block); - - return starMatch(sig.blockName, inst.blockName) && starMatch(sig.blockClassName, inst.blockClassName) - && starMatch(sig.tileClassName, inst.tileClassName) && starMatch(sig.customField, inst.customField) && starMatch(sig.mod, inst.mod); - } - - private boolean starMatch(String s1, String s2) { - return s1.equals("*") || s2.equals("*") || s1.equals(s2); - } -} diff --git a/src/main/java/buildcraft/api/blueprints/BptBlockUtils.java b/src/main/java/buildcraft/api/blueprints/BptBlockUtils.java deleted file mode 100644 index e5dfac7e3..000000000 --- a/src/main/java/buildcraft/api/blueprints/BptBlockUtils.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.blueprints; - -import java.util.LinkedList; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -@Deprecated -public class BptBlockUtils { - - public static void requestInventoryContents(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - ItemStack[] stacks = getItemStacks(slot, context); - - for (ItemStack stack : stacks) { - if (stack != null) { - requirements.add(stack); - } - } - } - - public static void initializeInventoryContents(BptSlotInfo slot, IBptContext context, IInventory inventory) { - ItemStack[] stacks = new ItemStack[inventory.getSizeInventory()]; - - for (int i = 0; i < inventory.getSizeInventory(); ++i) { - stacks[i] = inventory.getStackInSlot(i); - } - - setItemStacks(slot, context, stacks); - } - - public static void buildInventoryContents(BptSlotInfo slot, IBptContext context, IInventory inventory) { - ItemStack[] stacks = getItemStacks(slot, context); - - for (int i = 0; i < stacks.length; ++i) { - inventory.setInventorySlotContents(i, stacks[i]); - } - } - - public static ItemStack[] getItemStacks(BptSlotInfo slot, IBptContext context) { - NBTTagList list = (NBTTagList) slot.cpt.getTag("inv"); - - if (list == null) - return new ItemStack[0]; - - ItemStack stacks[] = new ItemStack[list.tagCount()]; - - for (int i = 0; i < list.tagCount(); ++i) { - //ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) list.tagAt(i)); - - //if (stack != null && stack.itemID != 0 && stack.stackSize > 0) { - // stacks[i] = context.mapItemStack(stack); - //} - } - - return stacks; - } - - public static void setItemStacks(BptSlotInfo slot, IBptContext context, ItemStack[] stacks) { - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < stacks.length; ++i) { - NBTTagCompound cpt = new NBTTagCompound(); - nbttaglist.appendTag(cpt); - ItemStack stack = stacks[i]; - - if (stack != null && stack.stackSize != 0) { - stack.writeToNBT(cpt); - //context.storeId(stack.itemID); - } - } - - slot.cpt.setTag("inv", nbttaglist); - } - -} diff --git a/src/main/java/buildcraft/api/blueprints/BptSlotInfo.java b/src/main/java/buildcraft/api/blueprints/BptSlotInfo.java deleted file mode 100644 index afa741566..000000000 --- a/src/main/java/buildcraft/api/blueprints/BptSlotInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.blueprints; - -import java.util.LinkedList; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -/** - * This class records a slot, either from a blueprint or from a block placed in the world. - */ - -@Deprecated -public class BptSlotInfo { - - public Block block = null; - public int meta = 0; - public int x; - public int y; - public int z; - - /** - * This field contains requirements for a given block when stored in the blueprint. Modders can either rely on this list or compute their own int BptBlock. - */ - public LinkedList storedRequirements = new LinkedList(); - - /** - * This tree contains additional data to be stored in the blueprint. By default, it will be initialized from BptBlock.initializeFromWorld with the standard - * readNBT function of the corresponding tile (if any) and will be loaded from BptBlock.buildBlock using the standard writeNBT function. - */ - public NBTTagCompound cpt = new NBTTagCompound(); - - @Override - public BptSlotInfo clone() { - BptSlotInfo obj = new BptSlotInfo(); - - obj.x = x; - obj.y = y; - obj.z = z; - obj.block = block; - obj.meta = meta; - obj.cpt = (NBTTagCompound) cpt.copy(); - - return obj; - } - -} diff --git a/src/main/java/buildcraft/api/blueprints/IBptContext.java b/src/main/java/buildcraft/api/blueprints/IBptContext.java deleted file mode 100644 index d785722b8..000000000 --- a/src/main/java/buildcraft/api/blueprints/IBptContext.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.blueprints; - -import buildcraft.api.core.IBox; -import buildcraft.api.core.Position; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * This interface provide contextual information when building or initializing blueprint slots. - */ - -@Deprecated -public interface IBptContext { - - /** - * If bptItemStack is an ItemStack extracted from the blueprint containing this mapping, this will return an item stack with the id of the current world - */ - public ItemStack mapItemStack(ItemStack bptItemStack); - - /** - * Blueprints may be created in a world with a given id setting, and then ported to a world with different ids. Heuristics are used to retreive these new - * ids automatically. This interface provide services to map ids from a blueprints to current ids in the world, and should be used whenever storing block - * numbers or item stacks in blueprints.. - */ - public int mapWorldId(int bptWorldId); - - /** - * This asks the id mapping to store a mapping from this Id, which may be either an itemId or a blockId. In effect, the blueprint will record it and make it - * available upon blueprint load. Note that block present in the blueprint are automatically stored upon blueprint save, so this is really only needed when - * writing ids that are e.g. in inventory stacks. - */ - public void storeId(int worldId); - - public Position rotatePositionLeft(Position pos); - - public IBox surroundingBox(); - - public World world(); -} diff --git a/src/main/java/buildcraft/api/blueprints/ItemSignature.java b/src/main/java/buildcraft/api/blueprints/ItemSignature.java deleted file mode 100644 index b3fa20653..000000000 --- a/src/main/java/buildcraft/api/blueprints/ItemSignature.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.blueprints; - -@Deprecated -public class ItemSignature { - - public String itemClassName; - public String itemName; - - public ItemSignature(String str) { - String[] values = str.split("/"); - - itemClassName = values[1]; - itemName = values[2]; - - replaceNullWithStar(); - - } - - public ItemSignature() { - replaceNullWithStar(); - } - - @Override - public String toString() { - replaceNullWithStar(); - - return "#I/" + itemClassName + "/" + itemName; - } - - public void replaceNullWithStar() { - if (itemClassName == null) { - itemClassName = "*"; - } - - if (itemName == null) { - itemName = "*"; - } - } -} diff --git a/src/main/java/buildcraft/api/blueprints/package-info.java b/src/main/java/buildcraft/api/blueprints/package-info.java deleted file mode 100644 index 0604277f3..000000000 --- a/src/main/java/buildcraft/api/blueprints/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|blueprints") -package buildcraft.api.blueprints; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockBed.java b/src/main/java/buildcraft/api/bptblocks/BptBlockBed.java deleted file mode 100644 index e2f22e0c0..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockBed.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import java.util.LinkedList; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockBed extends BptBlock { - - public BptBlockBed(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if ((slot.meta & 8) == 0) { - requirements.add(new ItemStack(Items.bed)); - } - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int orientation = (slot.meta & 7); - int others = slot.meta - orientation; - - switch (orientation) { - case 0: - slot.meta = 1 + others; - break; - case 1: - slot.meta = 2 + others; - break; - case 2: - slot.meta = 3 + others; - break; - case 3: - slot.meta = 0 + others; - break; - } - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - if ((slot.meta & 8) != 0) - return; - - //context.world().setBlock(slot.x, slot.y, slot.z, slot.block, slot.meta,1); - - int x2 = slot.x; - int z2 = slot.z; - - switch (slot.meta) { - case 0: - z2++; - break; - case 1: - x2--; - break; - case 2: - z2--; - break; - case 3: - x2++; - break; - } - - //context.world().setBlock(x2, slot.y, z2, slot.block, slot.meta + 8,1); - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return (slot.meta & 8) != 0; - } -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockCustomStack.java b/src/main/java/buildcraft/api/bptblocks/BptBlockCustomStack.java deleted file mode 100644 index 1087520f2..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockCustomStack.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockCustomStack extends BptBlock { - - final ItemStack customStack; - - public BptBlockCustomStack(int blockId, ItemStack customStack) { - super(blockId); - - this.customStack = customStack; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(customStack.copy()); - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockDelegate.java b/src/main/java/buildcraft/api/bptblocks/BptBlockDelegate.java deleted file mode 100644 index 45c4891ec..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockDelegate.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BlueprintManager; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import java.util.LinkedList; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockDelegate extends BptBlock { - - final Block delegateTo; - - public BptBlockDelegate(int blockId, Block delegateTo) { - super(blockId); - - this.delegateTo = delegateTo; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - BptSlotInfo newSlot = slot.clone(); - slot.block = delegateTo; - - //if (BlueprintManager.blockBptProps[delegateTo] != null) { - // BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements); - //} else { - // super.addRequirements(newSlot, context, requirements); - //} - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - BptSlotInfo newSlot = slot.clone(); - slot.block = delegateTo; - - //if (BlueprintManager.blockBptProps[delegateTo] != null) - // return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context); - //else - // return super.isValid(newSlot, context); - - return false; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - BptSlotInfo newSlot = slot.clone(); - slot.block = delegateTo; - - //if (BlueprintManager.blockBptProps[delegateTo] != null) { - // BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context); - //} else { - // super.rotateLeft(newSlot, context); - //} - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockDirt.java b/src/main/java/buildcraft/api/bptblocks/BptBlockDirt.java deleted file mode 100644 index 12720bf34..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockDirt.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockDirt extends BptBlock { - - public BptBlockDirt(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(Block.dirt)); - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - //context.world().setBlock(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta,1); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - //int id = context.world().getBlockId(slot.x, slot.y, slot.z); - - //return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID; - return false; - } -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockDoor.java b/src/main/java/buildcraft/api/bptblocks/BptBlockDoor.java deleted file mode 100644 index dedb75e84..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockDoor.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockDoor extends BptBlock { - - final ItemStack stack; - - public BptBlockDoor(int blockId, ItemStack stack) { - super(blockId); - - this.stack = stack; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if ((slot.meta & 8) == 0) { - requirements.add(stack.copy()); - } - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int orientation = (slot.meta & 3); - int others = slot.meta - orientation; - - switch (orientation) { - case 0: - slot.meta = 1 + others; - break; - case 1: - slot.meta = 2 + others; - break; - case 2: - slot.meta = 3 + others; - break; - case 3: - slot.meta = 0 + others; - break; - } - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return (slot.meta & 8) != 0; - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - //context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1); - //context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1); - - context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8,1); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1); - - } -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockFluid.java b/src/main/java/buildcraft/api/bptblocks/BptBlockFluid.java deleted file mode 100644 index dc5cd3250..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockFluid.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockFluid extends BptBlock { - - private final ItemStack bucketStack; - - public BptBlockFluid(int blockId, ItemStack bucketStack) { - super(blockId); - - this.bucketStack = bucketStack; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if (slot.meta == 0) { - requirements.add(bucketStack.copy()); - } - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - //if (slot.meta == 0) - // return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0; - //else - return true; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return slot.meta != 0; - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - //if (slot.meta == 0) { - // context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, 0,1); - //} - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockIgnore.java b/src/main/java/buildcraft/api/bptblocks/BptBlockIgnore.java deleted file mode 100644 index 465143ca5..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockIgnore.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockIgnore extends BptBlock { - - public BptBlockIgnore(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(slot.blockId, 0, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return true; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return true; - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java b/src/main/java/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java deleted file mode 100644 index 4f60fb2f4..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockIgnoreMeta extends BptBlock { - - public BptBlockIgnoreMeta(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - return false; - } -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockInventory.java b/src/main/java/buildcraft/api/bptblocks/BptBlockInventory.java deleted file mode 100644 index e307eb18a..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockInventory.java +++ /dev/null @@ -1,37 +0,0 @@ - -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import net.minecraft.inventory.IInventory; - -@Deprecated -public class BptBlockInventory extends BptBlock { - - public BptBlockInventory(int blockId) { - super(blockId); - - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - super.buildBlock(slot, context); - - IInventory inv = (IInventory) context.world().getTileEntity(slot.x, slot.y, slot.z); - - for (int i = 0; i < inv.getSizeInventory(); ++i) { - inv.setInventorySlotContents(i, null); - } - - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockLever.java b/src/main/java/buildcraft/api/bptblocks/BptBlockLever.java deleted file mode 100644 index d731c2381..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockLever.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockLever extends BptBlockWallSide { - - public BptBlockLever(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int status = slot.meta - (slot.meta & 7); - - slot.meta -= status; - super.rotateLeft(slot, context); - slot.meta += status; - - } -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockPiston.java b/src/main/java/buildcraft/api/bptblocks/BptBlockPiston.java deleted file mode 100644 index 8e3950cb7..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockPiston.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -@Deprecated -public class BptBlockPiston extends BptBlockRotateMeta { - - public BptBlockPiston(int blockId) { - super(blockId, new int[] { 2, 5, 3, 4 }, true); - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - int meta = slot.meta & 7; - - //context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, meta,1); - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockPumpkin.java b/src/main/java/buildcraft/api/bptblocks/BptBlockPumpkin.java deleted file mode 100644 index 4eff9e4cf..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockPumpkin.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockPumpkin extends BptBlock { - - public BptBlockPumpkin(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - return false; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - switch (slot.meta) { - case 0: - slot.meta = 1; - break; - case 1: - slot.meta = 2; - break; - case 2: - slot.meta = 3; - break; - case 3: - slot.meta = 0; - break; - } - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java b/src/main/java/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java deleted file mode 100644 index 8852cb980..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockRedstoneRepeater extends BptBlock { - - public BptBlockRedstoneRepeater(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(Item.redstoneRepeater)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int step = slot.meta - (slot.meta & 3); - - switch (slot.meta - step) { - case 0: - slot.meta = 1 + step; - break; - case 1: - slot.meta = 2 + step; - break; - case 2: - slot.meta = 3 + step; - break; - case 3: - slot.meta = 0 + step; - break; - } - } -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockRotateInventory.java b/src/main/java/buildcraft/api/bptblocks/BptBlockRotateInventory.java deleted file mode 100644 index e0b9bd677..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockRotateInventory.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import net.minecraft.inventory.IInventory; - -@Deprecated -public class BptBlockRotateInventory extends BptBlockRotateMeta { - - public BptBlockRotateInventory(int blockId, int[] rotations, boolean rotateForward) { - super(blockId, rotations, rotateForward); - - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - super.buildBlock(slot, context); - - IInventory inv = (IInventory) context.world().getTileEntity(slot.x, slot.y, slot.z); - - for (int i = 0; i < inv.getSizeInventory(); ++i) { - inv.setInventorySlotContents(i, null); - } - - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockRotateMeta.java b/src/main/java/buildcraft/api/bptblocks/BptBlockRotateMeta.java deleted file mode 100644 index 9066ee62a..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockRotateMeta.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockRotateMeta extends BptBlock { - - int[] rot; - boolean rotateForward; - - int infoMask = 0; - - public BptBlockRotateMeta(int blockId, int[] rotations, boolean rotateForward) { - super(blockId); - - rot = rotations; - - for (int i = 0; i < rot.length; ++i) { - if (rot[i] < 4) { - infoMask = (infoMask < 3 ? 3 : infoMask); - } else if (rot[i] < 8) { - infoMask = (infoMask < 7 ? 7 : infoMask); - } else if (rot[i] < 16) { - infoMask = (infoMask < 15 ? 15 : infoMask); - } - } - - this.rotateForward = rotateForward; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - return false; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int pos = slot.meta & infoMask; - int others = slot.meta - pos; - - if (rotateForward) { - if (pos == rot[0]) { - pos = rot[1]; - } else if (pos == rot[1]) { - pos = rot[2]; - } else if (pos == rot[2]) { - pos = rot[3]; - } else if (pos == rot[3]) { - pos = rot[0]; - } - } else { - if (pos == rot[0]) { - pos = rot[3]; - } else if (pos == rot[1]) { - pos = rot[2]; - } else if (pos == rot[2]) { - pos = rot[0]; - } else if (pos == rot[3]) { - pos = rot[1]; - } - } - - slot.meta = pos + others; - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockSign.java b/src/main/java/buildcraft/api/bptblocks/BptBlockSign.java deleted file mode 100644 index 29af85d42..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockSign.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BlockSignature; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockSign extends BptBlock { - - boolean isWall; - - public BptBlockSign(int blockId, boolean isWall) { - super(blockId); - - this.isWall = isWall; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(Item.sign)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - if (!isWall) { - double angle = ((slot.meta) * 360.0) / 16.0; - angle += 90.0; - if (angle >= 360) { - angle -= 360; - } - slot.meta = (int) (angle / 360.0 * 16.0); - } else { - // slot.meta = ForgeDirection.values()[slot.meta].rotateLeft().ordinal(); - } - } - - @Override - public BlockSignature getSignature(Block block) { - BlockSignature sig = super.getSignature(block); - - if (isWall) { - sig.customField = "wall"; - } else { - sig.customField = "floor"; - } - - return sig; - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockStairs.java b/src/main/java/buildcraft/api/bptblocks/BptBlockStairs.java deleted file mode 100644 index 391112c98..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockStairs.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockStairs extends BptBlock { - - public BptBlockStairs(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - //return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - return false; - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - switch (slot.meta) { - case 0: - slot.meta = 2; - break; - case 1: - slot.meta = 3; - break; - case 2: - slot.meta = 1; - break; - case 3: - slot.meta = 0; - break; - } - } - -} diff --git a/src/main/java/buildcraft/api/bptblocks/BptBlockWallSide.java b/src/main/java/buildcraft/api/bptblocks/BptBlockWallSide.java deleted file mode 100644 index ac0d8adad..000000000 --- a/src/main/java/buildcraft/api/bptblocks/BptBlockWallSide.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import java.util.LinkedList; -import net.minecraft.item.ItemStack; - -@Deprecated -public class BptBlockWallSide extends BptBlock { - - public BptBlockWallSide(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - //requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - final int XPos = 2; - final int XNeg = 1; - final int ZPos = 4; - final int ZNeg = 3; - - switch (slot.meta) { - case XPos: - slot.meta = ZPos; - break; - case ZNeg: - slot.meta = XPos; - break; - case XNeg: - slot.meta = ZNeg; - break; - case ZPos: - slot.meta = XNeg; - break; - } - } -} diff --git a/src/main/java/buildcraft/api/bptblocks/package-info.java b/src/main/java/buildcraft/api/bptblocks/package-info.java deleted file mode 100644 index 227914c4e..000000000 --- a/src/main/java/buildcraft/api/bptblocks/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="1.0",owner="BuildCraftAPI|blueprints",provides="BuildCraftAPI|bptblocks") -package buildcraft.api.bptblocks; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/buildcraft/api/core/BuildCraftAPI.java b/src/main/java/buildcraft/api/core/BuildCraftAPI.java deleted file mode 100644 index 4dadfae9d..000000000 --- a/src/main/java/buildcraft/api/core/BuildCraftAPI.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.core; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.block.Block; - -public class BuildCraftAPI { - - public static final int LAST_ORIGINAL_BLOCK = 122; - public static final int LAST_ORIGINAL_ITEM = 126; - - public static final Set softBlocks = new HashSet(); -} diff --git a/src/main/java/buildcraft/api/core/IAreaProvider.java b/src/main/java/buildcraft/api/core/IAreaProvider.java deleted file mode 100644 index 2338e0c71..000000000 --- a/src/main/java/buildcraft/api/core/IAreaProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.core; - -/** - * To be implemented by TileEntities able to provide a square area on the world, typically BuildCraft markers. - */ -public interface IAreaProvider { - - public int xMin(); - - public int yMin(); - - public int zMin(); - - public int xMax(); - - public int yMax(); - - public int zMax(); - - /** - * Remove from the world all objects used to define the area. - */ - public void removeFromWorld(); - -} diff --git a/src/main/java/buildcraft/api/core/IBox.java b/src/main/java/buildcraft/api/core/IBox.java deleted file mode 100644 index bfcafe6c9..000000000 --- a/src/main/java/buildcraft/api/core/IBox.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.core; - -import net.minecraft.world.World; - -public interface IBox { - - public void expand(int amount); - - public void contract(int amount); - - public boolean contains(int x, int y, int z); - - public Position pMin(); - - public Position pMax(); - - public void createLasers(World world, LaserKind kind); - - public void deleteLasers(); - -} diff --git a/src/main/java/buildcraft/api/core/IIconProvider.java b/src/main/java/buildcraft/api/core/IIconProvider.java deleted file mode 100644 index 3df0b6d90..000000000 --- a/src/main/java/buildcraft/api/core/IIconProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.core; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - -public interface IIconProvider { - - /** - * @param iconIndex - * @return - */ - @SideOnly(Side.CLIENT) - public IIcon getIcon(int iconIndex); - - /** - * A call for the provider to register its Icons. This may be called multiple times but should only be executed once per provider - * @param iconRegister - */ - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister); - -} diff --git a/src/main/java/buildcraft/api/core/LaserKind.java b/src/main/java/buildcraft/api/core/LaserKind.java deleted file mode 100644 index 85f5ce8ed..000000000 --- a/src/main/java/buildcraft/api/core/LaserKind.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.core; - -public enum LaserKind { - Red, Blue, Stripes -} diff --git a/src/main/java/buildcraft/api/core/Position.java b/src/main/java/buildcraft/api/core/Position.java deleted file mode 100644 index 3ea1a7311..000000000 --- a/src/main/java/buildcraft/api/core/Position.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.core; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class Position { - - public double x, y, z; - public ForgeDirection orientation; - - public Position(double ci, double cj, double ck) { - x = ci; - y = cj; - z = ck; - orientation = ForgeDirection.UNKNOWN; - } - - public Position(double ci, double cj, double ck, ForgeDirection corientation) { - x = ci; - y = cj; - z = ck; - orientation = corientation; - } - - public Position(Position p) { - x = p.x; - y = p.y; - z = p.z; - orientation = p.orientation; - } - - public Position(NBTTagCompound nbttagcompound) { - x = nbttagcompound.getDouble("i"); - y = nbttagcompound.getDouble("j"); - z = nbttagcompound.getDouble("k"); - - orientation = ForgeDirection.UNKNOWN; - } - - public Position(TileEntity tile) { - x = tile.xCoord; - y = tile.yCoord; - z = tile.zCoord; - } - - public void moveRight(double step) { - switch (orientation) { - case SOUTH: - x = x - step; - break; - case NORTH: - x = x + step; - break; - case EAST: - z = z + step; - break; - case WEST: - z = z - step; - break; - default: - } - } - - public void moveLeft(double step) { - moveRight(-step); - } - - public void moveForwards(double step) { - switch (orientation) { - case UP: - y = y + step; - break; - case DOWN: - y = y - step; - break; - case SOUTH: - z = z + step; - break; - case NORTH: - z = z - step; - break; - case EAST: - x = x + step; - break; - case WEST: - x = x - step; - break; - default: - } - } - - public void moveBackwards(double step) { - moveForwards(-step); - } - - public void moveUp(double step) { - switch (orientation) { - case SOUTH: - case NORTH: - case EAST: - case WEST: - y = y + step; - break; - default: - } - - } - - public void moveDown(double step) { - moveUp(-step); - } - - public void writeToNBT(NBTTagCompound nbttagcompound) { - nbttagcompound.setDouble("i", x); - nbttagcompound.setDouble("j", y); - nbttagcompound.setDouble("k", z); - } - - @Override - public String toString() { - return "{" + x + ", " + y + ", " + z + "}"; - } - - public Position min(Position p) { - return new Position(p.x > x ? x : p.x, p.y > y ? y : p.y, p.z > z ? z : p.z); - } - - public Position max(Position p) { - return new Position(p.x < x ? x : p.x, p.y < y ? y : p.y, p.z < z ? z : p.z); - } - -} diff --git a/src/main/java/buildcraft/api/core/StackWrapper.java b/src/main/java/buildcraft/api/core/StackWrapper.java deleted file mode 100644 index a155c1cdc..000000000 --- a/src/main/java/buildcraft/api/core/StackWrapper.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.core; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class StackWrapper { - - public final ItemStack stack; - - public StackWrapper(ItemStack stack) { - this.stack = stack; - } - - @Override - public int hashCode() { - int hash = 5; - - hash = 67 * hash + stack.getItem().hashCode(); - - hash = 67 * hash + stack.getItemDamage(); - - if (stack.stackTagCompound != null) { - hash = 67 * hash + stack.stackTagCompound.hashCode(); - } - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final StackWrapper other = (StackWrapper) obj; - if (stack.getItem() != other.stack.getItem()) - return false; - if (stack.getHasSubtypes() && stack.getItemDamage() != other.stack.getItemDamage()) - return false; - if (stack.stackTagCompound != null && !stack.stackTagCompound.equals(other.stack.stackTagCompound)) - return false; - return true; - } -} diff --git a/src/main/java/buildcraft/api/core/package-info.java b/src/main/java/buildcraft/api/core/package-info.java deleted file mode 100644 index bb494d538..000000000 --- a/src/main/java/buildcraft/api/core/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="1.0",owner="BuildCraft|Core",provides="BuildCraftAPI|core") -package buildcraft.api.core; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/buildcraft/api/filler/FillerManager.java b/src/main/java/buildcraft/api/filler/FillerManager.java deleted file mode 100644 index cd774d464..000000000 --- a/src/main/java/buildcraft/api/filler/FillerManager.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.filler; - -public class FillerManager { - - public static IFillerRegistry registry; - -} diff --git a/src/main/java/buildcraft/api/filler/IFillerPattern.java b/src/main/java/buildcraft/api/filler/IFillerPattern.java deleted file mode 100644 index 6c1c41829..000000000 --- a/src/main/java/buildcraft/api/filler/IFillerPattern.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.filler; - -import buildcraft.api.core.IBox; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.util.ForgeDirection; - -public interface IFillerPattern { - - public String getUniqueTag(); - - /** - * Creates the object that does the pattern iteration. This object may be - * state-full and will be used until the pattern is done or changes. - * - * @param tile the Filler - * @param box the area to fill - * @param orientation not currently used, but may be in the future (the filler needs some orientation code) - * @return - */ - public IPatternIterator createPatternIterator(TileEntity tile, IBox box, ForgeDirection orientation); - - @SideOnly(Side.CLIENT) - public IIcon getIcon(); - - public String getDisplayName(); -} diff --git a/src/main/java/buildcraft/api/filler/IFillerRegistry.java b/src/main/java/buildcraft/api/filler/IFillerRegistry.java deleted file mode 100644 index ec9bf29f1..000000000 --- a/src/main/java/buildcraft/api/filler/IFillerRegistry.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.filler; - -import buildcraft.api.gates.IAction; -import java.util.Set; - -public interface IFillerRegistry { - - public void addPattern(IFillerPattern pattern); - - public IFillerPattern getPattern(String patternName); - - public IFillerPattern getNextPattern(IFillerPattern currentPattern); - - public IFillerPattern getPreviousPattern(IFillerPattern currentPattern); - - public Set getActions(); -} diff --git a/src/main/java/buildcraft/api/filler/IPatternIterator.java b/src/main/java/buildcraft/api/filler/IPatternIterator.java deleted file mode 100644 index efce4c43e..000000000 --- a/src/main/java/buildcraft/api/filler/IPatternIterator.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.filler; - -import net.minecraft.item.ItemStack; - -public interface IPatternIterator { - - public boolean iteratePattern(ItemStack stackToPlace); -} diff --git a/src/main/java/buildcraft/api/filler/package-info.java b/src/main/java/buildcraft/api/filler/package-info.java deleted file mode 100644 index ee52b3209..000000000 --- a/src/main/java/buildcraft/api/filler/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="2.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|filler") -package buildcraft.api.filler; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/buildcraft/api/fuels/IronEngineCoolant.java b/src/main/java/buildcraft/api/fuels/IronEngineCoolant.java deleted file mode 100644 index 3e1de9542..000000000 --- a/src/main/java/buildcraft/api/fuels/IronEngineCoolant.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.fuels; - -import buildcraft.api.core.StackWrapper; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -public final class IronEngineCoolant { - - public static Map liquidCoolants = new HashMap(); - public static Map solidCoolants = new HashMap(); - - public static FluidStack getFluidCoolant(ItemStack stack) { - return solidCoolants.get(new StackWrapper(stack)); - } - - public static Coolant getCoolant(ItemStack stack) { - return getCoolant(getFluidCoolant(stack)); - } - - public static Coolant getCoolant(FluidStack fluidStack) { - return fluidStack != null && fluidStack.getFluid() != null ? liquidCoolants.get(fluidStack.getFluid().getName()) : null; - } - - private IronEngineCoolant() { - } - - public static interface Coolant { - - float getDegreesCoolingPerMB(float currentHeat); - } - - public static void addCoolant(final Fluid fluid, final float degreesCoolingPerMB) { - if (fluid != null) { - liquidCoolants.put(fluid.getName(), new Coolant() { - @Override - public float getDegreesCoolingPerMB(float currentHeat) { - return degreesCoolingPerMB; - } - }); - } - } - - /** - * Adds a solid coolant like Ice Blocks. The FluidStack must contain a registered - * Coolant Fluid or nothing will happen. You do not need to call this for - * Fluid Containers. - * - * @param stack - * @param coolant - */ - public static void addCoolant(final ItemStack stack, final FluidStack coolant) { - if (stack != null && stack.getItem() != null && coolant != null) { - solidCoolants.put(new StackWrapper(stack), coolant); - } - } - - /** - * Adds a solid coolant like Ice Blocks. The FluidStack must contain a registered - * Coolant Fluid or nothing will happen. You do not need to call this for - * Fluid Containers. - * - * @param stack - * @param coolant - */ - public static void addCoolant(final Item item, final int metadata, final FluidStack coolant) { - addCoolant(new ItemStack(item, 1, metadata), coolant); - } - - public static void addCoolant(final Block block, final int metadata, final FluidStack coolant) { - addCoolant(new ItemStack(block, 1, metadata), coolant); - } - - public static boolean isCoolant(Fluid fluid) { - return liquidCoolants.containsKey(fluid.getName()); - } -} diff --git a/src/main/java/buildcraft/api/gates/ActionManager.java b/src/main/java/buildcraft/api/gates/ActionManager.java deleted file mode 100644 index 44e4b741f..000000000 --- a/src/main/java/buildcraft/api/gates/ActionManager.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import buildcraft.api.transport.IPipeTile; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; - -public class ActionManager { - - public static Map triggers = new HashMap(); - public static Map actions = new HashMap(); - private static List triggerProviders = new LinkedList(); - private static List actionProviders = new LinkedList(); - - public static void registerTriggerProvider(ITriggerProvider provider) { - if (provider != null && !triggerProviders.contains(provider)) { - triggerProviders.add(provider); - } - } - - public static void registerTrigger(ITrigger trigger) { - triggers.put(trigger.getUniqueTag(), trigger); - } - - public static void registerAction(IAction action) { - actions.put(action.getUniqueTag(), action); - } - - public static List getNeighborTriggers(Block block, TileEntity entity) { - List triggers = new LinkedList(); - - for (ITriggerProvider provider : triggerProviders) { - List toAdd = provider.getNeighborTriggers(block, entity); - - if (toAdd != null) { - for (ITrigger t : toAdd) { - if (!triggers.contains(t)) { - triggers.add(t); - } - } - } - } - - return triggers; - } - - public static void registerActionProvider(IActionProvider provider) { - if (provider != null && !actionProviders.contains(provider)) { - actionProviders.add(provider); - } - } - - public static List getNeighborActions(Block block, TileEntity entity) { - List actions = new LinkedList(); - - for (IActionProvider provider : actionProviders) { - List toAdd = provider.getNeighborActions(block, entity); - - if (toAdd != null) { - for (IAction t : toAdd) { - if (!actions.contains(t)) { - actions.add(t); - } - } - } - } - - return actions; - } - - public static List getPipeTriggers(IPipeTile pipe) { - List triggers = new LinkedList(); - - for (ITriggerProvider provider : triggerProviders) { - List toAdd = provider.getPipeTriggers(pipe); - - if (toAdd != null) { - for (ITrigger t : toAdd) { - if (!triggers.contains(t)) { - triggers.add(t); - } - } - } - } - - return triggers; - } -} diff --git a/src/main/java/buildcraft/api/gates/GateExpansionController.java b/src/main/java/buildcraft/api/gates/GateExpansionController.java deleted file mode 100644 index 20f387137..000000000 --- a/src/main/java/buildcraft/api/gates/GateExpansionController.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import java.util.List; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -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() { - } - - public void startResolution() { - } - - public boolean resolveAction(IAction action, int count) { - return false; - } - - public boolean isTriggerActive(ITrigger trigger, ITriggerParameter parameter) { - return false; - } - - public void addTriggers(List list) { - } - - public void addActions(List list) { - } - - public void writeToNBT(NBTTagCompound nbt) { - } - - public void readFromNBT(NBTTagCompound nbt) { - } -} diff --git a/src/main/java/buildcraft/api/gates/GateExpansions.java b/src/main/java/buildcraft/api/gates/GateExpansions.java deleted file mode 100644 index b87324421..000000000 --- a/src/main/java/buildcraft/api/gates/GateExpansions.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -public final class GateExpansions { - - private static final Map expansions = new HashMap(); - private static final BiMap serverIDMap = HashBiMap.create(); - private static final BiMap clientIDMap = HashBiMap.create(); - private static byte nextID = 0; - - private GateExpansions() { - } - - public static void registerExpansion(IGateExpansion expansion) { - registerExpansion(expansion.getUniqueIdentifier(), expansion); - } - - public static void registerExpansion(String identifier, IGateExpansion expansion) { - expansions.put(identifier, expansion); - serverIDMap.put(nextID++, identifier); - } - - public static IGateExpansion getExpansion(String identifier) { - return expansions.get(identifier); - } - - public static IGateExpansion getExpansionClient(int id) { - if (id < 0 || id >= 128) - return null; - return expansions.get(clientIDMap.get((byte) id)); - } - - public static byte getServerExpansionID(String identifier) { - return serverIDMap.inverse().get(identifier); - } - - public static Set getExpansions() { - Set set = new HashSet(); - set.addAll(expansions.values()); - return set; - } - - public static BiMap getServerMap() { - return serverIDMap; - } - - public static void setClientMap(BiMap map) { - clientIDMap.clear(); - clientIDMap.putAll(map); - } -} diff --git a/src/main/java/buildcraft/api/gates/IAction.java b/src/main/java/buildcraft/api/gates/IAction.java deleted file mode 100644 index 38f134eb6..000000000 --- a/src/main/java/buildcraft/api/gates/IAction.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - -public interface IAction { - - String getUniqueTag(); - - @SideOnly(Side.CLIENT) - IIcon getIcon(); - - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister iconRegister); - - boolean hasParameter(); - - String getDescription(); -} diff --git a/src/main/java/buildcraft/api/gates/IActionProvider.java b/src/main/java/buildcraft/api/gates/IActionProvider.java deleted file mode 100644 index 6712ca6f6..000000000 --- a/src/main/java/buildcraft/api/gates/IActionProvider.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import java.util.LinkedList; -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; - -public interface IActionProvider { - - /** - * Returns the list of actions available to a gate next to the given block. - */ - public abstract LinkedList getNeighborActions(Block block, TileEntity tile); - -} diff --git a/src/main/java/buildcraft/api/gates/IActionReceptor.java b/src/main/java/buildcraft/api/gates/IActionReceptor.java deleted file mode 100644 index 869162982..000000000 --- a/src/main/java/buildcraft/api/gates/IActionReceptor.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -public interface IActionReceptor { - - public void actionActivated(IAction action); - -} diff --git a/src/main/java/buildcraft/api/gates/IGateExpansion.java b/src/main/java/buildcraft/api/gates/IGateExpansion.java deleted file mode 100644 index 361f0a4dd..000000000 --- a/src/main/java/buildcraft/api/gates/IGateExpansion.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - -public interface IGateExpansion { - - String getUniqueIdentifier(); - - String getDisplayName(); - - GateExpansionController makeController(TileEntity pipeTile); - - void registerBlockOverlay(IIconRegister iconRegister); - - void registerItemOverlay(IIconRegister iconRegister); - - IIcon getOverlayBlock(); - - IIcon getOverlayItem(); -} diff --git a/src/main/java/buildcraft/api/gates/IOverrideDefaultTriggers.java b/src/main/java/buildcraft/api/gates/IOverrideDefaultTriggers.java deleted file mode 100644 index a105f52d1..000000000 --- a/src/main/java/buildcraft/api/gates/IOverrideDefaultTriggers.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import java.util.LinkedList; - -/** - * This interface has to be implemented by a TileEntity or a Pipe that wants to provide triggers different from the ones installed by default with BuildCraft. - */ -public interface IOverrideDefaultTriggers { - - LinkedList getTriggers(); - -} diff --git a/src/main/java/buildcraft/api/gates/ITileTrigger.java b/src/main/java/buildcraft/api/gates/ITileTrigger.java deleted file mode 100644 index 93c84e019..000000000 --- a/src/main/java/buildcraft/api/gates/ITileTrigger.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public interface ITileTrigger extends ITrigger { - - /** - * Return true if the tile given in parameter activates the trigger, given - * the parameters. - */ - boolean isTriggerActive(ForgeDirection side, TileEntity tile, ITriggerParameter parameter); -} diff --git a/src/main/java/buildcraft/api/gates/ITrigger.java b/src/main/java/buildcraft/api/gates/ITrigger.java deleted file mode 100644 index affc418b4..000000000 --- a/src/main/java/buildcraft/api/gates/ITrigger.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - -public interface ITrigger { - - /** - * Every trigger needs a unique tag, it should be in the format of - * ":". - * - * @return the unique id - */ - String getUniqueTag(); - - @SideOnly(Side.CLIENT) - IIcon getIcon(); - - @SideOnly(Side.CLIENT) - void registerIcons(IIconRegister iconRegister); - - /** - * Return true if this trigger can accept parameters - */ - boolean hasParameter(); - - /** - * Return true if this trigger requires a parameter - */ - boolean requiresParameter(); - - /** - * Return the trigger description in the UI - */ - String getDescription(); - - /** - * Create parameters for the trigger. As for now, there is only one kind of - * trigger parameter available so this subprogram is final. - */ - ITriggerParameter createParameter(); -} diff --git a/src/main/java/buildcraft/api/gates/ITriggerParameter.java b/src/main/java/buildcraft/api/gates/ITriggerParameter.java deleted file mode 100644 index 8570cf0fb..000000000 --- a/src/main/java/buildcraft/api/gates/ITriggerParameter.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public interface ITriggerParameter { - - public abstract ItemStack getItemStack(); - - public abstract void set(ItemStack stack); - - public abstract void writeToNBT(NBTTagCompound compound); - - public abstract void readFromNBT(NBTTagCompound compound); - - @Deprecated - public abstract ItemStack getItem(); - -} diff --git a/src/main/java/buildcraft/api/gates/ITriggerProvider.java b/src/main/java/buildcraft/api/gates/ITriggerProvider.java deleted file mode 100644 index 1966e73bb..000000000 --- a/src/main/java/buildcraft/api/gates/ITriggerProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import buildcraft.api.transport.IPipeTile; -import java.util.LinkedList; -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; - -public interface ITriggerProvider { - - /** - * Returns the list of triggers that are available from the pipe holding the gate. - */ - public abstract LinkedList getPipeTriggers(IPipeTile pipe); - - /** - * Returns the list of triggers available to a gate next to the given block. - */ - public abstract LinkedList getNeighborTriggers(Block block, TileEntity tile); - -} diff --git a/src/main/java/buildcraft/api/gates/TriggerParameter.java b/src/main/java/buildcraft/api/gates/TriggerParameter.java deleted file mode 100644 index 46336c157..000000000 --- a/src/main/java/buildcraft/api/gates/TriggerParameter.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.gates; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class TriggerParameter implements ITriggerParameter { - - protected ItemStack stack; - - /* - * (non-Javadoc) - * - * @see net.minecraft.src.buildcraft.api.gates.ITriggerParameter#getItemStack() - */ - @Override - public ItemStack getItemStack() { - return stack; - } - - /* - * (non-Javadoc) - * - * @see net.minecraft.src.buildcraft.api.gates.ITriggerParameter#set(net.minecraft.src.ItemStack) - */ - @Override - public void set(ItemStack stack) { - if (stack != null) { - this.stack = stack.copy(); - this.stack.stackSize = 1; - } - } - - /* - * (non-Javadoc) - * - * @see net.minecraft.src.buildcraft.api.gates.ITriggerParameter#writeToNBT(net.minecraft.src.NBTTagCompound) - */ - @Override - public void writeToNBT(NBTTagCompound compound) { - if (stack != null) { - NBTTagCompound tagCompound = new NBTTagCompound(); - stack.writeToNBT(tagCompound); - compound.setTag("stack", tagCompound); - } - } - - /* - * (non-Javadoc) - * - * @see net.minecraft.src.buildcraft.api.gates.ITriggerParameter#readFromNBT(net.minecraft.src.NBTTagCompound) - */ - @Override - public void readFromNBT(NBTTagCompound compound) { - // Legacy code to prevent existing gates from losing their contents - int itemID = compound.getInteger("itemID"); - if (itemID != 0) { - stack = new ItemStack((Item) Item.itemRegistry.getObject(itemID), 1, compound.getInteger("itemDMG")); - return; - } - - stack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("stack")); - } - - @Override - @Deprecated - public ItemStack getItem() { - return stack; - } - -} diff --git a/src/main/java/buildcraft/api/gates/package-info.java b/src/main/java/buildcraft/api/gates/package-info.java deleted file mode 100644 index 01c1a66ad..000000000 --- a/src/main/java/buildcraft/api/gates/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="2.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|gates") -package buildcraft.api.gates; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/buildcraft/api/inventory/ISpecialInventory.java b/src/main/java/buildcraft/api/inventory/ISpecialInventory.java deleted file mode 100644 index 827a7a7d0..000000000 --- a/src/main/java/buildcraft/api/inventory/ISpecialInventory.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.inventory; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -@Deprecated -public interface ISpecialInventory extends IInventory { - - /** - * Offers an ItemStack for addition to the inventory. - * - * @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. - * @return Amount of items used from the passed stack. - */ - int addItem(ItemStack stack, boolean doAdd, ForgeDirection from); - - /** - * Requests items to be extracted from the inventory - * - * @param doRemove - * If false no actual extraction may occur. Implementors should simulate. - * Can be used to "peek" at what the result would be - * @param from - * Orientation the ItemStack is requested from. - * @param maxItemCount - * Maximum amount of items to extract (spread over all returned item stacks) - * @return Array of item stacks that were/would be extracted from the inventory - */ - ItemStack[] extractItem(boolean doRemove, ForgeDirection from, int maxItemCount); - -} diff --git a/src/main/java/buildcraft/api/inventory/package-info.java b/src/main/java/buildcraft/api/inventory/package-info.java deleted file mode 100644 index 5335e4110..000000000 --- a/src/main/java/buildcraft/api/inventory/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|inventory") -package buildcraft.api.inventory; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/buildcraft/api/power/ILaserTarget.java b/src/main/java/buildcraft/api/power/ILaserTarget.java deleted file mode 100644 index 8f859158c..000000000 --- a/src/main/java/buildcraft/api/power/ILaserTarget.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.power; - -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(double 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(); - - int getXCoord(); - - int getYCoord(); - - int getZCoord(); -} diff --git a/src/main/java/buildcraft/api/recipes/BuildcraftRecipes.java b/src/main/java/buildcraft/api/recipes/BuildcraftRecipes.java deleted file mode 100644 index 0454944d2..000000000 --- a/src/main/java/buildcraft/api/recipes/BuildcraftRecipes.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.recipes; - -public final class BuildcraftRecipes { - - public static IAssemblyRecipeManager assemblyTable; - public static IIntegrationRecipeManager integrationTable; - public static IRefineryRecipeManager refinery; - - private BuildcraftRecipes() { - } -} diff --git a/src/main/java/buildcraft/api/recipes/IAssemblyRecipeManager.java b/src/main/java/buildcraft/api/recipes/IAssemblyRecipeManager.java deleted file mode 100644 index 305309196..000000000 --- a/src/main/java/buildcraft/api/recipes/IAssemblyRecipeManager.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.recipes; - -import java.util.List; -import net.minecraft.item.ItemStack; - -public interface IAssemblyRecipeManager { - - public static interface IAssemblyRecipe { - - ItemStack getOutput(); - - Object[] getInputs(); - - double getEnergyCost(); - } - - /** - * Add an Assembly Table recipe. - * - * @param input Object... containing either an ItemStack, or a paired string - * and integer(ex: "dyeBlue", 1) - * @param energy MJ cost to produce - * @param output resulting ItemStack - */ - void addRecipe(double energyCost, ItemStack output, Object... input); - - List getRecipes(); -} diff --git a/src/main/java/buildcraft/api/recipes/IIntegrationRecipeManager.java b/src/main/java/buildcraft/api/recipes/IIntegrationRecipeManager.java deleted file mode 100644 index 8b03055f7..000000000 --- a/src/main/java/buildcraft/api/recipes/IIntegrationRecipeManager.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.recipes; - -import java.util.List; -import net.minecraft.item.ItemStack; - -/** - * The Integration Table's primary purpose is to modify an input item's NBT - * data. As such its not a "traditional" type of recipe. Rather than predefined - * inputs and outputs, it takes an input and transforms it. - */ -public interface IIntegrationRecipeManager { - - public static interface IIntegrationRecipe { - - double getEnergyCost(); - - boolean isValidInputA(ItemStack inputA); - - boolean isValidInputB(ItemStack inputB); - - ItemStack getOutputForInputs(ItemStack inputA, ItemStack inputB); - - ItemStack[] getExampleInputsA(); - - ItemStack[] getExampleInputsB(); - } - - /** - * Add an Integration Table recipe. - * - */ - void addRecipe(IIntegrationRecipe recipe); - - List getRecipes(); -} diff --git a/src/main/java/buildcraft/api/recipes/IRefineryRecipeManager.java b/src/main/java/buildcraft/api/recipes/IRefineryRecipeManager.java deleted file mode 100644 index 5e353a11e..000000000 --- a/src/main/java/buildcraft/api/recipes/IRefineryRecipeManager.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.recipes; - -import java.util.SortedSet; -import net.minecraftforge.fluids.FluidStack; - -public interface IRefineryRecipeManager { - - void addRecipe(FluidStack ingredient, FluidStack result, int energy, int delay); - - void addRecipe(FluidStack ingredient1, FluidStack ingredient2, FluidStack result, int energy, int delay); - - SortedSet getRecipes(); - - IRefineryRecipe findRefineryRecipe(FluidStack ingredient1, FluidStack ingredient2); - - public static interface IRefineryRecipe { - - FluidStack getIngredient1(); - - FluidStack getIngredient2(); - - FluidStack getResult(); - - int getEnergyCost(); - - int getTimeRequired(); - } -} diff --git a/src/main/java/buildcraft/api/recipes/package-info.java b/src/main/java/buildcraft/api/recipes/package-info.java deleted file mode 100644 index 3e41173c0..000000000 --- a/src/main/java/buildcraft/api/recipes/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -@API(apiVersion="2.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|recipes") -package buildcraft.api.recipes; -import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/buildcraft/api/tools/IToolPipette.java b/src/main/java/buildcraft/api/tools/IToolPipette.java deleted file mode 100644 index bca9d2676..000000000 --- a/src/main/java/buildcraft/api/tools/IToolPipette.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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.tools; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -public interface IToolPipette { - - /** - * @param pipette - * ItemStack of the pipette. - * @return Capacity of the pipette. - */ - int getCapacity(ItemStack pipette); - - /** - * @param pipette - * @return true if the pipette can pipette. - */ - boolean canPipette(ItemStack pipette); - - /** - * Fills the pipette with the given liquid stack. - * - * @param pipette - * @param liquid - * @param doFill - * @return Amount of liquid used in filling the pipette. - */ - int fill(ItemStack pipette, FluidStack liquid, boolean doFill); - - /** - * Drains liquid from the pipette - * - * @param pipette - * @param maxDrain - * @param doDrain - * @return Fluid stack representing the liquid and amount drained from the pipette. - */ - FluidStack drain(ItemStack pipette, int maxDrain, boolean doDrain); -} diff --git a/src/main/java/buildcraft/api/transport/IExtractionHandler.java b/src/main/java/buildcraft/api/transport/IExtractionHandler.java deleted file mode 100644 index 4d56659ed..000000000 --- a/src/main/java/buildcraft/api/transport/IExtractionHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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; - -import net.minecraft.world.World; - -/** - * Implement and register with the PipeManager if you want to suppress connections from wooden pipes. - */ -public interface IExtractionHandler { - - /** - * Can this pipe extract items from the block located at these coordinates? - * param extractor can be null - */ - boolean canExtractItems(Object extractor, World world, int i, int j, int k); - - /** - * Can this pipe extract liquids from the block located at these coordinates? - * param extractor can be null - */ - boolean canExtractFluids(Object extractor, World world, int i, int j, int k); -} diff --git a/src/main/java/buildcraft/api/transport/IPipeConnection.java b/src/main/java/buildcraft/api/transport/IPipeConnection.java deleted file mode 100644 index 39f14ee94..000000000 --- a/src/main/java/buildcraft/api/transport/IPipeConnection.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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; - -import buildcraft.api.transport.IPipeTile.PipeType; -import net.minecraftforge.common.util.ForgeDirection; - -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. - */ - public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with); -} diff --git a/src/main/java/buildcraft/api/transport/IPipeDefinition.java b/src/main/java/buildcraft/api/transport/IPipeDefinition.java deleted file mode 100644 index 73a1c8909..000000000 --- a/src/main/java/buildcraft/api/transport/IPipeDefinition.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; - -public interface IPipeDefinition { - - String getUniqueTag(); - - void registerIcons(IIconRegister iconRegister); - - IIcon getIcon(int index); - - IIcon getItemIcon(); - - PipeBehavior makePipeBehavior(TileEntity tile); -} diff --git a/src/main/java/buildcraft/api/transport/PipeBehavior.java b/src/main/java/buildcraft/api/transport/PipeBehavior.java deleted file mode 100644 index 66c528cb5..000000000 --- a/src/main/java/buildcraft/api/transport/PipeBehavior.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public abstract class PipeBehavior { - - public final TileEntity tile; - - public PipeBehavior(TileEntity tile) { - this.tile = tile; - } - - public void tick() { - } - - public int getIconIndex(ForgeDirection side) { - return 0; - } - - public void writeToNBT(NBTTagCompound nbt) { - } - - public void readFromNBT(NBTTagCompound nbt) { - } - - public boolean canPipeConnect(TileEntity tile, ForgeDirection side) { - return true; - } - - public boolean blockActivated(EntityPlayer player) { - return false; - } - - public void onNeighborBlockChange(int blockId) { - } -} diff --git a/src/main/java/buildcraft/api/transport/PipeManager.java b/src/main/java/buildcraft/api/transport/PipeManager.java deleted file mode 100644 index ae7bd918a..000000000 --- a/src/main/java/buildcraft/api/transport/PipeManager.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2011-2014, 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; - -import java.util.ArrayList; -import java.util.List; -import net.minecraft.world.World; - -public abstract class PipeManager { - - public static List extractionHandlers = new ArrayList(); - - public static void registerExtractionHandler(IExtractionHandler handler) { - extractionHandlers.add(handler); - } - - /** - * param extractor can be null - */ - public static boolean canExtractItems(Object extractor, World world, int i, int j, int k) { - for (IExtractionHandler handler : extractionHandlers) - if (!handler.canExtractItems(extractor, world, i, j, k)) - return false; - - return true; - } - - /** - * param extractor can be null - */ - public static boolean canExtractFluids(Object extractor, World world, int i, int j, int k) { - for (IExtractionHandler handler : extractionHandlers) - if (!handler.canExtractFluids(extractor, world, i, j, k)) - return false; - - return true; - } -} diff --git a/src/main/java/cofh/api/block/IBlockDebug.java b/src/main/java/cofh/api/block/IBlockDebug.java deleted file mode 100644 index 03254b2ed..000000000 --- a/src/main/java/cofh/api/block/IBlockDebug.java +++ /dev/null @@ -1,36 +0,0 @@ -package cofh.api.block; - -import cofh.api.tileentity.ITileDebug; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on blocks which have some debug method which can be activated via a tool or other means. If the block contains Tile Entities, then - * it is recommended that this function serve as a passthrough for {@link ITileDebug}. - * - * @author King Lemming - * - */ -public interface IBlockDebug { - - /** - * This function debugs a block. - * - * @param world - * Reference to the world. - * @param x - * X coordinate of the block. - * @param y - * Y coordinate of the block. - * @param z - * Z coordinate of the block. - * @param side - * The side of the block. - * @param player - * Player doing the debugging. - */ - void debugBlock(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player); - -} diff --git a/src/main/java/cofh/api/block/IBlockInfo.java b/src/main/java/cofh/api/block/IBlockInfo.java deleted file mode 100644 index 0c102f552..000000000 --- a/src/main/java/cofh/api/block/IBlockInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -package cofh.api.block; - -import cofh.api.tileentity.ITileInfo; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on blocks which can provide information about themselves. If the block contains Tile Entities, then it is recommended that this - * function serve as a passthrough for {@link ITileInfo}. - * - * @author King Lemming - * - */ -public interface IBlockInfo { - - /** - * This function appends information to a list provided to it. - * - * @param world - * Reference to the world. - * @param x - * X coordinate of the block. - * @param y - * Y coordinate of the block. - * @param z - * Z coordinate of the block. - * @param side - * The side of the block that is being queried. - * @param player - * Player doing the querying - this can be NULL. - * @param info - * The list that the information should be appended to. - * @param debug - * If true, the block should return "debug" information. - */ - void getBlockInfo(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player, List info, boolean debug); - -} diff --git a/src/main/java/cofh/api/block/IDismantleable.java b/src/main/java/cofh/api/block/IDismantleable.java deleted file mode 100644 index 70f888a44..000000000 --- a/src/main/java/cofh/api/block/IDismantleable.java +++ /dev/null @@ -1,25 +0,0 @@ -package cofh.api.block; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Implemented on Blocks which have some method of being instantly dismantled. - * - * @author King Lemming - * - */ -public interface IDismantleable { - - /** - * Dismantles the block. If returnBlock is true, the drop(s) should be placed into the player's inventory. - */ - ItemStack dismantleBlock(EntityPlayer player, World world, int x, int y, int z, boolean returnBlock); - - /** - * Return true if the block can be dismantled. The criteria for this is entirely up to the block. - */ - boolean canDismantle(EntityPlayer player, World world, int x, int y, int z); - -} diff --git a/src/main/java/cofh/api/core/IInitializer.java b/src/main/java/cofh/api/core/IInitializer.java deleted file mode 100644 index 87b64b02a..000000000 --- a/src/main/java/cofh/api/core/IInitializer.java +++ /dev/null @@ -1,17 +0,0 @@ -package cofh.api.core; - -/** - * Interface which can be put on just about anything to allow for iteration during initialization. - * - * @author King Lemming - * - */ -public interface IInitializer { - - boolean preInit(); - - boolean initialize(); - - boolean postInit(); - -} diff --git a/src/main/java/cofh/api/energy/EnergyStorage.java b/src/main/java/cofh/api/energy/EnergyStorage.java deleted file mode 100644 index b3383aebe..000000000 --- a/src/main/java/cofh/api/energy/EnergyStorage.java +++ /dev/null @@ -1,158 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class EnergyStorage implements IEnergyStorage { - - protected int energy; - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public EnergyStorage(int capacity) { - - this(capacity, capacity, capacity); - } - - public EnergyStorage(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public EnergyStorage(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public EnergyStorage readFromNBT(NBTTagCompound nbt) { - - this.energy = nbt.getInteger("Energy"); - - if (energy > capacity) { - energy = capacity; - } - return this; - } - - public NBTTagCompound writeToNBT(NBTTagCompound nbt) { - - if (energy < 0) { - energy = 0; - } - nbt.setInteger("Energy", energy); - return nbt; - } - - public void setCapacity(int capacity) { - - this.capacity = capacity; - - if (energy > capacity) { - energy = capacity; - } - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - public int getMaxReceive() { - - return maxReceive; - } - - public int getMaxExtract() { - - return maxExtract; - } - - /** - * This function is included to allow for server -> client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers are - * guaranteed to have it. - * - * @param energy - */ - public void setEnergyStored(int energy) { - - this.energy = energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /** - * This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this - * externally, as not all IEnergyHandlers are guaranteed to have it. - * - * @param energy - */ - public void modifyEnergyStored(int energy) { - - this.energy += energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /* IEnergyStorage */ - @Override - public int receiveEnergy(int maxReceive, boolean simulate) { - - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - } - return energyReceived; - } - - @Override - public int extractEnergy(int maxExtract, boolean simulate) { - - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - } - return energyExtracted; - } - - @Override - public int getEnergyStored() { - - return energy; - } - - @Override - public int getMaxEnergyStored() { - - return capacity; - } - -} diff --git a/src/main/java/cofh/api/energy/IEnergyStorage.java b/src/main/java/cofh/api/energy/IEnergyStorage.java deleted file mode 100644 index 1e84bc221..000000000 --- a/src/main/java/cofh/api/energy/IEnergyStorage.java +++ /dev/null @@ -1,45 +0,0 @@ -package cofh.api.energy; - -/** - * An energy storage is the unit of interaction with Energy inventories. - * - * A reference implementation can be found at {@link EnergyStorage}. - * - * @author King Lemming - * - */ -public interface IEnergyStorage { - - /** - * Adds energy to the storage. Returns quantity of energy that was accepted. - * - * @param maxReceive - * Maximum amount of energy to be inserted. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) accepted by the storage. - */ - int receiveEnergy(int maxReceive, boolean simulate); - - /** - * Removes energy from the storage. Returns quantity of energy that was removed. - * - * @param maxExtract - * Maximum amount of energy to be extracted. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the storage. - */ - int extractEnergy(int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(); - -} diff --git a/src/main/java/cofh/api/energy/ItemEnergyContainer.java b/src/main/java/cofh/api/energy/ItemEnergyContainer.java deleted file mode 100644 index 055ae45bc..000000000 --- a/src/main/java/cofh/api/energy/ItemEnergyContainer.java +++ /dev/null @@ -1,110 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class ItemEnergyContainer extends Item implements IEnergyContainerItem { - - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public ItemEnergyContainer() { - - } - - public ItemEnergyContainer(int capacity) { - - this(capacity, capacity, capacity); - } - - public ItemEnergyContainer(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public ItemEnergyContainer(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public ItemEnergyContainer setCapacity(int capacity) { - - this.capacity = capacity; - return this; - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - /* IEnergyContainerItem */ - @Override - public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { - - if (container.stackTagCompound == null) { - container.stackTagCompound = new NBTTagCompound(); - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyReceived; - } - - @Override - public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyExtracted; - } - - @Override - public int getEnergyStored(ItemStack container) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - return container.stackTagCompound.getInteger("Energy"); - } - - @Override - public int getMaxEnergyStored(ItemStack container) { - - return capacity; - } - -} diff --git a/src/main/java/cofh/api/energy/TileEnergyHandler.java b/src/main/java/cofh/api/energy/TileEnergyHandler.java deleted file mode 100644 index a7fabeb77..000000000 --- a/src/main/java/cofh/api/energy/TileEnergyHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class TileEnergyHandler extends TileEntity implements IEnergyHandler { - - protected EnergyStorage storage = new EnergyStorage(32000); - - @Override - public void readFromNBT(NBTTagCompound nbt) { - - super.readFromNBT(nbt); - storage.readFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - - super.writeToNBT(nbt); - storage.writeToNBT(nbt); - } - - /* IEnergyHandler */ - @Override - public boolean canConnectEnergy(ForgeDirection from) { - - return true; - } - - @Override - public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { - - return storage.receiveEnergy(maxReceive, simulate); - } - - @Override - public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { - - return storage.extractEnergy(maxExtract, simulate); - } - - @Override - public int getEnergyStored(ForgeDirection from) { - - return storage.getEnergyStored(); - } - - @Override - public int getMaxEnergyStored(ForgeDirection from) { - - return storage.getMaxEnergyStored(); - } - -} diff --git a/src/main/java/cofh/api/energy/package-info.java b/src/main/java/cofh/api/energy/package-info.java new file mode 100644 index 000000000..a2b937f52 --- /dev/null +++ b/src/main/java/cofh/api/energy/package-info.java @@ -0,0 +1,9 @@ +/** + * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub + * http://www.teamcofh.com + */ +@API(apiVersion = "1.0", owner = "CoFHCore", provides = "CoFHAPI|energy") +package cofh.api.energy; + +import cpw.mods.fml.common.API; + diff --git a/src/main/java/cofh/api/item/IEmpowerableItem.java b/src/main/java/cofh/api/item/IEmpowerableItem.java deleted file mode 100644 index f77c71f6a..000000000 --- a/src/main/java/cofh/api/item/IEmpowerableItem.java +++ /dev/null @@ -1,41 +0,0 @@ -package cofh.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes which may be "Empowered" - what that means is completely up to you. This just provides a uniform way of dealing with - * them. - * - * @author King Lemming - * - */ -public interface IEmpowerableItem { - - /** - * Check whether or not a given item is currently in an empowered state. - */ - boolean isEmpowered(ItemStack stack); - - /** - * Attempt to set the empowered state of the item. - * - * @param stack - * ItemStack to be empowered/disempowered. - * @param state - * Desired state. - * @return TRUE if the operation was successful, FALSE if it was not. - */ - boolean setEmpoweredState(ItemStack stack, boolean state); - - /** - * Callback method for reacting to a state change. Useful in KeyBinding handlers. - * - * @param player - * Player holding the item, if applicable. - * @param stack - * The item being held. - */ - void onStateChange(EntityPlayer player, ItemStack stack); - -} diff --git a/src/main/java/cofh/api/item/IInventoryConnection.java b/src/main/java/cofh/api/item/IInventoryConnection.java deleted file mode 100644 index d0ad117b3..000000000 --- a/src/main/java/cofh/api/item/IInventoryConnection.java +++ /dev/null @@ -1,20 +0,0 @@ -package cofh.api.item; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should connect to item transportation blocks. - * - * Note that {@link IInventoryHandler} is an extension of this. - * - * @author King Lemming - * - */ -public interface IInventoryConnection { - - /** - * Returns TRUE if the TileEntity can connect on a given side. - */ - boolean canConnectInventory(ForgeDirection from); - -} diff --git a/src/main/java/cofh/api/item/IInventoryContainerItem.java b/src/main/java/cofh/api/item/IInventoryContainerItem.java deleted file mode 100644 index 91c051083..000000000 --- a/src/main/java/cofh/api/item/IInventoryContainerItem.java +++ /dev/null @@ -1,78 +0,0 @@ -package cofh.api.item; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes that are themselves inventories. - * - * A reference implementation is provided {@link ItemInventoryContainer}. - * - * @author King Lemming - * - */ -public interface IInventoryContainerItem { - - /** - * Add an ItemStack to the inventory of this container item. This returns what is remaining of the original stack - a null return means that the entire - * stack was accepted! - * - * @param container - * ItemStack with the inventory. - * @param item - * ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return An ItemStack representing how much is remaining after the item was inserted (or would have been, if simulated) into the container inventory. - */ - ItemStack insertItem(ItemStack container, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from the inventory of this container item. This returns the resulting stack - a null return means that nothing was extracted! - * - * @param container - * ItemStack with the inventory. - * @param item - * ItemStack to be extracted. The size of this stack corresponds to the maximum amount to extract. If this is null, then a null ItemStack should - * immediately be returned. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ItemStack container, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from the inventory of this container item. This returns the resulting stack - a null return means that nothing was extracted! - * - * @param container - * ItemStack with the inventory. - * @param maxExtract - * Maximum number of items to extract. (The returned ItemStack should have a stackSize no higher than this.) - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ItemStack container, int maxExtract, boolean simulate); - - /** - * Get the contents of the container item's inventory. This should only return non-null ItemStacks, and an empty List if the inventory has nothing. - */ - List getInventoryContents(ItemStack container); - - /** - * Get the size of this inventory of this container item. - */ - int getSizeInventory(ItemStack container); - - /** - * Returns whether or not the container item's inventory is empty. - */ - boolean isEmpty(ItemStack container); - - /** - * Returns whether or not the container item's inventory is full. - */ - boolean isFull(ItemStack container); - -} diff --git a/src/main/java/cofh/api/item/IInventoryHandler.java b/src/main/java/cofh/api/item/IInventoryHandler.java deleted file mode 100644 index 4340e5f36..000000000 --- a/src/main/java/cofh/api/item/IInventoryHandler.java +++ /dev/null @@ -1,82 +0,0 @@ -package cofh.api.item; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should handle items. - * - * A reference implementation is provided {@link TileInventoryHandler}. - * - * @author King Lemming - * - */ -public interface IInventoryHandler extends IInventoryConnection { - - /** - * Insert an ItemStack into the IInventoryHandler, internal distribution is left entirely to the IInventoryHandler. This returns what is remaining of the - * original stack - a null return means that the entire stack was accepted! - * - * @param from - * Orientation the item is inserted from. - * @param item - * ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return An ItemStack representing how much is remaining after the item was inserted (or would have been, if simulated) into the container inventory. - */ - ItemStack insertItem(ForgeDirection from, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from an IInventoryHandler, internal distribution is left entirely to the IInventoryHandler. This returns the resulting stack - a - * null return means that nothing was extracted! - * - * @param from - * Orientation the item is extracted from. - * @param item - * ItemStack to be extracted. The size of this stack corresponds to the maximum amount to extract. If this is null, then a null ItemStack should - * immediately be returned. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ForgeDirection from, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from an IInventoryHandler, internal distribution is left entirely to the IInventoryHandler. This returns the resulting stack - a - * null return means that nothing was extracted! - * - * @param from - * Orientation the item is extracted from. - * @param maxExtract - * Maximum number of items to extract. (The returned ItemStack should have a stackSize no higher than this.) - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ForgeDirection from, int maxExtract, boolean simulate); - - /** - * Get the contents of the IInventoryHandler's inventory. This returns a COPY. This should only return non-null ItemStacks, and an empty List if the - * inventory has nothing. - */ - List getInventoryContents(ForgeDirection from); - - /** - * Get the size (number of internal slots) of the IInventoryHandler's inventory. - */ - int getSizeInventory(ForgeDirection from); - - /** - * Returns whether or not the IInventoryHandler's inventory is empty (for a given side). - */ - boolean isEmpty(ForgeDirection from); - - /** - * Returns whether or not the IInventoryHandler's inventory is full (for a given side). - */ - boolean isFull(ForgeDirection from); - -} diff --git a/src/main/java/cofh/api/item/ISecureItem.java b/src/main/java/cofh/api/item/ISecureItem.java deleted file mode 100644 index 6e4731afb..000000000 --- a/src/main/java/cofh/api/item/ISecureItem.java +++ /dev/null @@ -1,26 +0,0 @@ -package cofh.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes which are Secure - linked to a specific player or group of players. - * - * Obviously, this relies on people using this interface properly. The Wheaton Rule is in effect here - don't be a jerk. - * - * @author King Lemming - * - */ -public interface ISecureItem { - - /** - * Check whether or not a given player can use this item. - */ - boolean canPlayerAccess(ItemStack stack, EntityPlayer player); - - /** - * Get the Owner of this item. This function is intentionally nebulous and is not guaranteed to be a player name. - */ - String getOwnerString(); - -} diff --git a/src/main/java/cofh/api/item/ITinkerableItem.java b/src/main/java/cofh/api/item/ITinkerableItem.java deleted file mode 100644 index cb1185daf..000000000 --- a/src/main/java/cofh/api/item/ITinkerableItem.java +++ /dev/null @@ -1,33 +0,0 @@ -package cofh.api.item; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes which can be externally modified through tinkering. - * - * Basically a catch all for "upgrading" a given ItemStack, which may represent an Item or a Block. - * - * @author King Lemming - * - */ -public interface ITinkerableItem { - - /** - * Returns a list of valid ItemStacks which may be used to upgrade this Tinkerable. - */ - List getValidTinkers(ItemStack container); - - /** - * Applies a tinker to this item. - * - * @param container - * The ItemStack (Tinkerable) to which the tinker is being applied. - * @param tinker - * The ItemStack representing the upgrade. - * @return True if the application was successful, false if it was not. - */ - boolean applyTinker(ItemStack container, ItemStack tinker); - -} diff --git a/src/main/java/cofh/api/package-info.java b/src/main/java/cofh/api/package-info.java new file mode 100644 index 000000000..13a02b261 --- /dev/null +++ b/src/main/java/cofh/api/package-info.java @@ -0,0 +1,9 @@ +/** + * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub + * http://www.teamcofh.com + */ +@API(apiVersion = "1.0", owner = "CoFHCore", provides = "CoFHAPI") +package cofh.api; + +import cpw.mods.fml.common.API; + diff --git a/src/main/java/cofh/api/tileentity/IAugmentableTile.java b/src/main/java/cofh/api/tileentity/IAugmentableTile.java deleted file mode 100644 index 8e4431de4..000000000 --- a/src/main/java/cofh/api/tileentity/IAugmentableTile.java +++ /dev/null @@ -1,28 +0,0 @@ -package cofh.api.tileentity; - -import net.minecraft.item.ItemStack; - -/** - * Implemented on TileEntities which support Augments. - * - * @author King Lemming - * - */ -public interface IAugmentableTile { - - /** - * Attempt to reconfigure the tile based on the Augmentations present. Return TRUE if it was successful; FALSE if a condition was not met. - */ - boolean augmentTile(); - - /** - * Returns an array of the Augment slots for this Tile Entity. - */ - ItemStack[] getAugmentSlots(); - - /** - * Returns a status array for the Augmentations installed in the Tile Entity. - */ - boolean[] getAugmentStatus(); - -} diff --git a/src/main/java/cofh/api/tileentity/IEnergyInfo.java b/src/main/java/cofh/api/tileentity/IEnergyInfo.java deleted file mode 100644 index 9648de39b..000000000 --- a/src/main/java/cofh/api/tileentity/IEnergyInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which can report information about their energy usage. - * - * This is used for reporting purposes - Energy transactions are handled through IEnergyHandler! - * - * @author King Lemming - * - */ -public interface IEnergyInfo { - - /** - * Returns energy usage/generation per tick (RF/t). - */ - int getInfoEnergyPerTick(); - - /** - * Returns maximum energy usage/generation per tick (RF/t). - */ - int getInfoMaxEnergyPerTick(); - - /** - * Returns energy stored (RF). - */ - int getInfoEnergyStored(); - - /** - * Returns maximum energy stored (RF). - */ - int getInfoMaxEnergyStored(); - -} diff --git a/src/main/java/cofh/api/tileentity/IReconfigurableFacing.java b/src/main/java/cofh/api/tileentity/IReconfigurableFacing.java deleted file mode 100644 index 40efe7c35..000000000 --- a/src/main/java/cofh/api/tileentity/IReconfigurableFacing.java +++ /dev/null @@ -1,39 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which allow for reconfiguration of their facing. - * - * Coordination with the containing block is required. - * - * @author King Lemming - * - */ -public interface IReconfigurableFacing { - - /** - * Returns the current facing of the block. - */ - int getFacing(); - - /** - * Returns whether or not the block's face can be aligned with the Y Axis. - */ - boolean allowYAxisFacing(); - - /** - * Attempt to rotate the block. Arbitrary based on implementation. - * - * @return True if rotation was successful, false otherwise. - */ - boolean rotateBlock(); - - /** - * Set the facing of the block. - * - * @param side - * The side to set the facing to. - * @return True if the facing was set, false otherwise. - */ - boolean setFacing(int side); - -} diff --git a/src/main/java/cofh/api/tileentity/IReconfigurableSides.java b/src/main/java/cofh/api/tileentity/IReconfigurableSides.java deleted file mode 100644 index 79c0f5bcc..000000000 --- a/src/main/java/cofh/api/tileentity/IReconfigurableSides.java +++ /dev/null @@ -1,54 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which allow for reconfiguration of their sides. - * - * Coordination with the containing block is required. - * - * @author King Lemming - * - */ -public interface IReconfigurableSides { - - /** - * Decrement the config for a given side. - * - * @param side - * The side to decrement. - * @return True if config was changed, false otherwise. - */ - boolean decrSide(int side); - - /** - * Increment the config for a given side. - * - * @param side - * The side to decrement. - * @return True if config was changed, false otherwise. - */ - boolean incrSide(int side); - - /** - * Set the config for a given side. - * - * @param side - * The side to set. - * @param config - * The config value to use. - * @return True of config was set, false otherwise. - */ - boolean setSide(int side, int config); - - /** - * Reset configs on all sides to their base values. - * - * @return True if reset was successful, false otherwise. - */ - boolean resetSides(); - - /** - * Returns the number of possible config settings for a given side. - */ - int getNumConfig(int side); - -} diff --git a/src/main/java/cofh/api/tileentity/IRedstoneCache.java b/src/main/java/cofh/api/tileentity/IRedstoneCache.java deleted file mode 100644 index f1254d8dc..000000000 --- a/src/main/java/cofh/api/tileentity/IRedstoneCache.java +++ /dev/null @@ -1,17 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which cache their redstone status. - * - * Note that {@link IRedstoneControl} is an extension of this. - * - * @author King Lemming - * - */ -public interface IRedstoneCache { - - void setPowered(boolean isPowered); - - boolean isPowered(); - -} diff --git a/src/main/java/cofh/api/tileentity/IRedstoneControl.java b/src/main/java/cofh/api/tileentity/IRedstoneControl.java deleted file mode 100644 index 11060325d..000000000 --- a/src/main/java/cofh/api/tileentity/IRedstoneControl.java +++ /dev/null @@ -1,57 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which have Redstone Control functionality. This means that a tile can be set to ignore redstone entirely, or - * respond to a low or high redstone state. - * - * @author King Lemming - * - */ -public interface IRedstoneControl extends IRedstoneCache { - - public static enum ControlMode { - DISABLED(true), LOW(false), HIGH(true); - - private final boolean state; - - private ControlMode(boolean state) { - - this.state = state; - } - - public boolean isDisabled() { - - return this == DISABLED; - } - - public boolean isLow() { - - return this == LOW; - } - - public boolean isHigh() { - - return this == HIGH; - } - - public boolean getState() { - - return state; - } - - public static ControlMode stepForward(ControlMode curControl) { - - return curControl == DISABLED ? LOW : curControl == HIGH ? DISABLED : HIGH; - } - - public static ControlMode stepBackward(ControlMode curControl) { - - return curControl == DISABLED ? HIGH : curControl == HIGH ? LOW : DISABLED; - } - } - - void setControl(ControlMode control); - - ControlMode getControl(); - -} diff --git a/src/main/java/cofh/api/tileentity/ISecureTile.java b/src/main/java/cofh/api/tileentity/ISecureTile.java deleted file mode 100644 index 4d4c4d260..000000000 --- a/src/main/java/cofh/api/tileentity/ISecureTile.java +++ /dev/null @@ -1,56 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which have access restrictions. - * - * @author King Lemming - * - */ -public interface ISecureTile { - - /** - * Enum for Access Modes - Restricted is Friends Only, Private is Owner only. - * - * @author King Lemming - * - */ - public static enum AccessMode { - PUBLIC, RESTRICTED, PRIVATE; - - public boolean isPublic() { - - return this == PUBLIC; - } - - public boolean isRestricted() { - - return this == RESTRICTED; - } - - public boolean isPrivate() { - - return this == PRIVATE; - } - - public static AccessMode stepForward(AccessMode curAccess) { - - return curAccess == PUBLIC ? RESTRICTED : curAccess == PRIVATE ? PUBLIC : PRIVATE; - } - - public static AccessMode stepBackward(AccessMode curAccess) { - - return curAccess == PUBLIC ? PRIVATE : curAccess == PRIVATE ? RESTRICTED : PUBLIC; - } - } - - boolean setAccess(AccessMode access); - - boolean setOwnerName(String name); - - AccessMode getAccess(); - - String getOwnerName(); - - boolean canPlayerAccess(String name); - -} diff --git a/src/main/java/cofh/api/tileentity/ISidedTexture.java b/src/main/java/cofh/api/tileentity/ISidedTexture.java deleted file mode 100644 index 1d5884f4a..000000000 --- a/src/main/java/cofh/api/tileentity/ISidedTexture.java +++ /dev/null @@ -1,25 +0,0 @@ -package cofh.api.tileentity; - -import net.minecraft.util.IIcon; - -/** - * Implement this interface on Tile Entities which can change their block's texture based on the current render pass. The block must defer the call to its Tile - * Entity. - * - * @author Zeldo Kavira - * - */ -public interface ISidedTexture { - - /** - * Returns the icon to use for a given side and render pass. - * - * @param side - * Block side to get the texture for. - * @param pass - * Render pass. - * @return The icon to use. - */ - IIcon getTexture(int side, int pass); - -} diff --git a/src/main/java/cofh/api/tileentity/ITileDebug.java b/src/main/java/cofh/api/tileentity/ITileDebug.java deleted file mode 100644 index 62faa22c4..000000000 --- a/src/main/java/cofh/api/tileentity/ITileDebug.java +++ /dev/null @@ -1,27 +0,0 @@ -package cofh.api.tileentity; - -import cofh.api.block.IBlockDebug; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which can be debugged via some in-game method, such as a tool. The containing block should be an instance of - * {@link IBlockDebug} and defer the call to the tile. - * - * @author King Lemming - * - */ -public interface ITileDebug { - - /** - * This function debugs a tile entity. - * - * @param side - * The side of the block. - * @param player - * Player doing the debugging. - */ - void debugTile(ForgeDirection side, EntityPlayer player); - -} diff --git a/src/main/java/cofh/api/tileentity/ITileInfo.java b/src/main/java/cofh/api/tileentity/ITileInfo.java deleted file mode 100644 index a0b4b8770..000000000 --- a/src/main/java/cofh/api/tileentity/ITileInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package cofh.api.tileentity; - -import cofh.api.block.IBlockInfo; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on Tile Entities which can provide information about themselves. The containing block should be an instance of {@link IBlockInfo} - * and defer the call to the tile. - * - * @author King Lemming - * - */ -public interface ITileInfo { - - /** - * This function appends information to a list provided to it. - * - * @param info - * The list that the information should be appended to. - * @param side - * The side of the block that is being queried. - * @param player - * Player doing the querying - this can be NULL. - * @param debug - * If true, the tile should return "debug" information. - */ - void getTileInfo(List info, ForgeDirection side, EntityPlayer player, boolean debug); - -} diff --git a/src/main/java/cofh/api/transport/IEnderAttuned.java b/src/main/java/cofh/api/transport/IEnderAttuned.java deleted file mode 100644 index 744943876..000000000 --- a/src/main/java/cofh/api/transport/IEnderAttuned.java +++ /dev/null @@ -1,13 +0,0 @@ -package cofh.api.transport; - -interface IEnderAttuned { - - public String getOwnerString(); - - public int getFrequency(); - - public boolean setFrequency(int frequency); - - public boolean clearFrequency(); - -} diff --git a/src/main/java/cofh/api/transport/IEnderEnergyHandler.java b/src/main/java/cofh/api/transport/IEnderEnergyHandler.java deleted file mode 100644 index 0886be766..000000000 --- a/src/main/java/cofh/api/transport/IEnderEnergyHandler.java +++ /dev/null @@ -1,35 +0,0 @@ -package cofh.api.transport; - -/** - * This interface is implemented on Ender Attuned objects which can receive Energy (Redstone Flux). - * - * @author King Lemming - * - */ -public interface IEnderEnergyHandler extends IEnderAttuned { - - /** - * Return whether or not the Ender Attuned object can currently send energy (Redstone Flux). - */ - boolean canSendEnergy(); - - /** - * This should be checked to see if the Ender Attuned object can currently receive energy (Redstone Flux). - * - * Note: In practice, this can (and should) be used to ensure that something does not send to itself. - */ - boolean canReceiveEnergy(); - - /** - * This tells the Ender Attuned object to receive energy. This returns the amount remaining, *not* the amount received - a return of 0 means that all energy - * was received! - * - * @param energy - * Amount of energy to be received. - * @param simulate - * If TRUE, the result will only be simulated. - * @return Amount of energy that is remaining (or would be remaining, if simulated). - */ - int receiveEnergy(int energy, boolean simulate); - -} diff --git a/src/main/java/cofh/api/transport/IEnderFluidHandler.java b/src/main/java/cofh/api/transport/IEnderFluidHandler.java deleted file mode 100644 index 3927fe1bc..000000000 --- a/src/main/java/cofh/api/transport/IEnderFluidHandler.java +++ /dev/null @@ -1,37 +0,0 @@ -package cofh.api.transport; - -import net.minecraftforge.fluids.FluidStack; - -/** - * This interface is implemented on Ender Attuned objects which can receive Fluid. - * - * @author King Lemming - * - */ -public interface IEnderFluidHandler extends IEnderAttuned { - - /** - * Return whether or not the Ender Attuned object can currently send FluidStacks. - */ - boolean canSendFluid(); - - /** - * This should be checked to see if the Ender Attuned object can currently receive a FluidStack. - * - * Note: In practice, this can (and should) be used to ensure that something does not send to itself. - */ - boolean canReceiveFluid(); - - /** - * This tells the Ender Attuned object to receive a FluidStack. This returns what remains of the original stack, *not* the amount received - a null return - * means that the entire stack was received! - * - * @param fluid - * FluidStack to be received. - * @param simulate - * If TRUE, the result will only be simulated. - * @return FluidStack representing how much fluid is remaining (or would be remaining, if simulated). - */ - FluidStack receiveFluid(FluidStack fluid, boolean simulate); - -} diff --git a/src/main/java/cofh/api/transport/IEnderItemHandler.java b/src/main/java/cofh/api/transport/IEnderItemHandler.java deleted file mode 100644 index 2944a0016..000000000 --- a/src/main/java/cofh/api/transport/IEnderItemHandler.java +++ /dev/null @@ -1,38 +0,0 @@ -package cofh.api.transport; - -import net.minecraft.item.ItemStack; - -/** - * This interface is implemented on Ender Attuned objects which can receive Items. - * - * @author King Lemming - * - */ -public interface IEnderItemHandler extends IEnderAttuned { - - /** - * Return whether or not the Ender Attuned object can currently send ItemStacks. - */ - boolean canSendItems(); - - /** - * This should be checked to see if the Ender Attuned object can currently receive an ItemStack. - * - * Note: In practice, this can (and should) be used to ensure that something does not send to itself. - */ - boolean canReceiveItems(); - - /** - * This tells the Ender Attuned object to receive an ItemStack. This returns what remains of the original stack, *not* the amount received - a null return - * means that the entire stack was received! - * - * This function does not support simulation because Inventory manipulation in Minecraft is an absolute mess and it would be a computational liability to do - * so. - * - * @param item - * ItemStack to be received. - * @return An ItemStack representing how much is remaining. - */ - ItemStack receiveItem(ItemStack item); - -} diff --git a/src/main/java/cofh/api/transport/IItemDuct.java b/src/main/java/cofh/api/transport/IItemDuct.java deleted file mode 100644 index 4c50c8560..000000000 --- a/src/main/java/cofh/api/transport/IItemDuct.java +++ /dev/null @@ -1,26 +0,0 @@ -package cofh.api.transport; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * This interface is implemented on ItemDucts. Use it to attempt to eject items into an entry point. - * - * @author Zeldo Kavira, King Lemming - * - */ -public interface IItemDuct { - - /** - * Insert an ItemStack into the IItemDuct. Will only accept items if there is a valid destination. This returns what is remaining of the original stack - a - * null return means that the entire stack was accepted/routed! - * - * @param from - * Orientation the item is inserted from. - * @param item - * ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert. - * @return An ItemStack representing how much is remaining after the item was inserted into the Duct. - */ - public ItemStack insertItem(ForgeDirection from, ItemStack item); - -} diff --git a/src/main/java/cofh/api/world/IFeatureGenerator.java b/src/main/java/cofh/api/world/IFeatureGenerator.java deleted file mode 100644 index f0d732f33..000000000 --- a/src/main/java/cofh/api/world/IFeatureGenerator.java +++ /dev/null @@ -1,39 +0,0 @@ -package cofh.api.world; - -import java.util.Random; - -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; - -/** - * This interface should be implemented on classes which define a world feature to be generated in a {@link IFeatureHandler}. It is essentially a more robust - * version of {@link WorldGenerator}, and may include one or more WorldGenerators should you wish. - * - * @author King Lemming - * - */ -public interface IFeatureGenerator { - - /** - * Returns the name of the feature, used for displaying in the World.cfg file. - */ - public String getFeatureName(); - - /** - * Generates the world feature. - * - * @param random - * Random derived from the world seed. - * @param chunkX - * Minimum X chunk-coordinate of the chunk. (x16 for block coordinate) - * @param chunkZ - * Minimum Z chunk-coordinate of the chunk. (x16 for block coordinate) - * @param world - * The world to generate in. - * @param newGen - * True on initial generation, false on retrogen. - * @return True if generation happened, false otherwise. - */ - public boolean generateFeature(Random random, int chunkX, int chunkZ, World world, boolean newGen); - -} diff --git a/src/main/java/cofh/api/world/IFeatureHandler.java b/src/main/java/cofh/api/world/IFeatureHandler.java deleted file mode 100644 index eea078ce8..000000000 --- a/src/main/java/cofh/api/world/IFeatureHandler.java +++ /dev/null @@ -1,22 +0,0 @@ -package cofh.api.world; - -/** - * Provides an interface to allow for the addition of Features to world generation. - * - * See {@link IFeatureGenerator}. - * - * @author King Lemming - * - */ -public interface IFeatureHandler { - - /** - * Register a feature with an IFeatureHandler. - * - * @param feature - * The feature to register. - * @return True if the registration was successful, false if a feature with that name existed. - */ - public boolean registerFeature(IFeatureGenerator feature); - -} diff --git a/src/main/java/ic2/api/crops/BaseSeed.java b/src/main/java/ic2/api/crops/BaseSeed.java deleted file mode 100644 index de6296b39..000000000 --- a/src/main/java/ic2/api/crops/BaseSeed.java +++ /dev/null @@ -1,56 +0,0 @@ -package ic2.api.crops; - -/** - * Base agriculture seed. Used to determine the state of a plant once it is planted from an item. - */ -public class BaseSeed { - /** - * Plant ID. - */ - public int id; - - /** - * Plant size. - */ - public int size; - - /** - * Plant growth stat. - */ - public int statGrowth; - - /** - * Plant gain stat. - */ - public int statGain; - - /** - * Plant resistance stat. - */ - public int statResistance; - - /** - * For internal usage only. - */ - public int stackSize; - - /** - * Create a BaseSeed object. - * - * @param id1 plant ID - * @param size1 plant size - * @param statGrowth1 plant growth stat - * @param statGain1 plant gain stat - * @param statResistance1 plant resistance stat - * @param stackSize1 for internal usage only - */ - public BaseSeed(int id1, int size1, int statGrowth1, int statGain1, int statResistance1, int stackSize1) { - super(); - this.id = id1; - this.size = size1; - this.statGrowth = statGrowth1; - this.statGain = statGain1; - this.statResistance = statResistance1; - this.stackSize = stackSize1; - } -} diff --git a/src/main/java/ic2/api/crops/CropCard.java b/src/main/java/ic2/api/crops/CropCard.java deleted file mode 100644 index 31c79d94a..000000000 --- a/src/main/java/ic2/api/crops/CropCard.java +++ /dev/null @@ -1,374 +0,0 @@ -package ic2.api.crops; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Base agriculture crop. - * - * Any crop extending this can be registered using registerCrop to be added into the game. - */ -public abstract class CropCard -{ - /** - * Plant name. Will be displayed to the player. - * - * @return Plant name - */ - public abstract String name(); - - /** - * Your name here, will be shown in "Discovered by:" when analyzing seeds. - * - * @return Your name - */ - public String discoveredBy() {return "Alblaka";} - - /** - * Description of your plant. Keep it short, a few characters per line for up to two lines. - * Default is showing attributes of your plant, 2 per line. - * - * @param i line to get, starting from 0 - * @return The line - */ - public String desc(int i) - { - String[] att = attributes(); - if (att == null || att.length==0) return ""; - if (i == 0) - { - String s = att[0]; - if (att.length >= 2) - { - s+=", "+att[1]; - if (att.length >= 3) s+=","; - } - return s; - } - if (att.length < 3) return ""; - String s = att[2]; - if (att.length >= 4) s+=", "+att[3]; - return s; - } - - /** - * Tier of the plant. Ranges from 1 to 16, 0 is Weed. - * Valuable and powerful crops have higher tiers, useless and weak ones have lower tiers. - * - * @return Tier - */ - public abstract int tier(); - - /** - * Describe the plant through a set of stats, influencing breeding. - * Plants sharing stats and attributes will tend to cross-breed more often. - * - * Stats: - * - 0: Chemistry (Industrial uses based on chemical plant components) - * - 1: Consumable (Food, potion ingredients, stuff meant to be eaten or similarly used) - * - 2: Defensive (Plants with defense capabilities (damaging, explosive, chemical) or special abilities in general) - * - 3: Colorful (How colorful/aesthetically/beautiful is the plant, like dye-plants or plants without actual effects) - * - 4: Weed (Is this plant weed-like and rather unwanted/quick-spreading? Rare super-breed plants should have low values here) - * - * @param n index of the requested stat - * @return The requested value of the stats - */ - public abstract int stat(int n); - - /** - * Additional attributes of the plant, also influencing breeding. - * Plants sharing stats and attributes will tend to cross-breed more often. - * - * @return Attributes as an array of strings - */ - public abstract String[] attributes(); - - /** - * Determine the max crop size. - * - * Currently only used for texture allocation. - */ - public abstract int maxSize(); - - /** - * Instantiate your Icons here. - * - * This method will get called by IC2, don't call it yourself. - */ - @SideOnly(Side.CLIENT) - public void registerSprites(IIconRegister iconRegister) { - textures = new IIcon[maxSize()]; - - for (int i = 1; i <= textures.length; i++) { - textures[i-1] = iconRegister.registerIcon("ic2:crop/blockCrop."+name()+"."+i); - } - } - - /** - * Sprite the crop is meant to be rendered with. - * - * @param crop reference to ICropTile - * @return 0-255, representing the sprite index on the crop's spritesheet. - */ - @SideOnly(Side.CLIENT) - public IIcon getSprite(ICropTile crop) { - if (crop.getSize() <= 0 || crop.getSize() > textures.length) return null; - - return textures[crop.getSize() - 1]; - } - - /** - * Get the crop's spritesheet. - * Per default crops_0.png of ic2-sprites - * @return Texture file path - */ - public String getTextureFile() { - return "/ic2/sprites/crops_0.png"; - } - - /** - * Amount of growth points needed to increase the plant's size. - * Default is 200 * tier. - */ - public int growthDuration(ICropTile crop) - { - return tier()*200; - } - - /** - * Check whether the plant can grow further. - * - * Consider: - * - Humidity, nutrients and air quality - * - Current size - * - Light level - * - Special biomes or conditions, accessible through crop.worldObj - * - * This method will be called upon empty upgraded crops to check whether a neighboring plant can cross onto it! Don't check if the size is greater than 0 and if the ID is real. - * - * @param crop reference to ICropTile - * @return Whether the crop can grow - */ - public abstract boolean canGrow(ICropTile crop); - - /** - * Calculate the influence for the plant to grow based on humidity, nutrients and air. - * Normal behavior is rating the three stats "normal", with each of them ranging from 0-30. - * Basic rule: Assume everything returns 10. All together must equal 30. Add the factors to your likings, for example (humidity*0.7)+(nutrients*0.9)+(air*1.4) - * - * Default is humidity + nutrients + air (no factors). - * - * @param crop reference to ICropTile - * @param humidity ground humidity, influenced by hydration - * @param nutrients nutrient quality in ground, based on fertilizers - * @param air air quality, influences by open gardens and less crops surrounding this one - * @return 0-30 - */ - public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) - { - return (int) (humidity+nutrients+air); - } - - /** - * Used to determine whether the plant can crossbreed with another crop. - * Default is allow crossbreeding if the size is greater or equal than 3. - * - * @param crop crop to crossbreed with - */ - public boolean canCross(ICropTile crop) - { - return crop.getSize() >= 3; - } - - - /** - * Called when the plant is rightclicked by a player. - * Default action is harvesting. - * - * Only called Serverside. - * - * @param crop reference to ICropTile - * @param player player rightclicking the crop - * @return Whether the plant has changed - */ - public boolean rightclick(ICropTile crop, EntityPlayer player) - { - return crop.harvest(true); - } - - /** - * Check whether the crop can be harvested. - * - * @param crop reference to ICropTile - * @return Whether the crop can be harvested in its current state. - */ - public abstract boolean canBeHarvested(ICropTile crop); - - /** - * Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops. - * Default is 0.95^tier. - * - * @return Chance to drop the gains - */ - public float dropGainChance() - { - float base = 1F; - for (int i = 0; i < tier(); i++) {base*=0.95;} - return base; - } - - /** - * Item obtained from harvesting the plant. - * - * @param crop reference to ICropTile - * @return Item obtained - */ - public abstract ItemStack getGain(ICropTile crop); - - /** - * Get the size of the plant after harvesting. - * Default is 1. - * - * @param crop reference to ICropTile - * @return Plant size after harvesting - */ - public byte getSizeAfterHarvest(ICropTile crop) {return 1;} - - - /** - * Called when the plant is leftclicked by a player. - * Default action is picking the plant. - * - * Only called Serverside. - * - * @param crop reference to ICropTile - * @param player player leftclicked the crop - * @return Whether the plant has changed - */ - public boolean leftclick(ICropTile crop, EntityPlayer player) - { - return crop.pick(true); - } - - /** - * Base chance for dropping seeds when the plant is picked. - * Default is 0.5*0.8^tier with a bigger chance for sizes greater than 2 and absolutely no chance for size 0. - * - * @param crop reference to ICropTile - * @return Chance to drop the seeds - */ - public float dropSeedChance(ICropTile crop) - { - if (crop.getSize() == 1) return 0; - float base = 0.5F; - if (crop.getSize() == 2) base/=2F; - for (int i = 0; i < tier(); i++) {base*=0.8;} - return base; - } - - /** - * Obtain seeds dropped when the plant is picked. - * Multiple drops of the returned ItemStack can occur. - * Default action is generating a seed from this crop. - * - * @param crop reference to ICropTile - * @return Seeds - */ - public ItemStack getSeeds(ICropTile crop) - { - return crop.generateSeeds(crop.getID(), crop.getGrowth(), crop.getGain(), crop.getResistance(), crop.getScanLevel()); - } - - /** - * Called when a neighbor block to the crop has changed. - * - * @param crop reference to ICropTile - */ - public void onNeighbourChange(ICropTile crop){ - // - } - - /** - * Check if the crop should emit redstone. - * - * @return Whether the crop should emit redstone - */ - public int emitRedstone(ICropTile crop){return 0;} - - /** - * Called when the crop is destroyed. - * - * @param crop reference to ICropTile - */ - public void onBlockDestroyed(ICropTile crop){ - // - } - - /** - * Get the light value emitted by the plant. - * - * @param crop reference to ICropTile - * @return Light value emitted - */ - public int getEmittedLight(ICropTile crop) {return 0;} - - /** - * Default is true if the entity is an EntityLiving in jumping or sprinting state. - * - * @param crop reference to ICropTile - * @param entity entity colliding - * @return Whether trampling calculation should happen, return false if the plant is no longer valid. - */ - public boolean onEntityCollision(ICropTile crop, Entity entity) - { - if (entity instanceof EntityLivingBase) - { - return ((EntityLivingBase)entity).isSprinting(); - } - return false; - } - - - /** - * Called every time the crop ticks. - * Should be called every 256 ticks or around 13 seconds. - * - * @param crop reference to ICropTile - */ - public void tick(ICropTile crop) { - // - } - - /** - * Check whether this plant spreads weed to surrounding tiles. - * Default is true if the plant has a high growth stat (or is weeds) and size greater or equal than 2. - * - * @param crop reference to ICropTile - * @return Whether the plant spreads weed - */ - public boolean isWeed(ICropTile crop) - { - return crop.getSize()>=2 && (crop.getID()==0 || crop.getGrowth()>=24); - } - - - /** - * Get this plant's ID. - * - * @return ID of this CropCard or -1 if it's not registered - */ - public final int getId() - { - return Crops.instance.getIdFor(this); - } - - @SideOnly(Side.CLIENT) - protected IIcon textures[]; -} diff --git a/src/main/java/ic2/api/crops/Crops.java b/src/main/java/ic2/api/crops/Crops.java deleted file mode 100644 index 53cc3239f..000000000 --- a/src/main/java/ic2/api/crops/Crops.java +++ /dev/null @@ -1,117 +0,0 @@ -package ic2.api.crops; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraftforge.common.BiomeDictionary.Type; - -/** - * General management of the crop system. - */ -public abstract class Crops { - public static Crops instance; - - /** - * Adds a crop humidity and nutrient biome bonus. - * - * 0 indicates no bonus and negative values indicate a penalty. - * - * @param biome Biome to apply the bonus in - * @param humidityBonus Humidity stat bonus - * @param nutrientsBonus Nutrient stat bonus - */ - public abstract void addBiomeBonus(BiomeGenBase biome, int humidityBonus, int nutrientsBonus); - - /** - * Adds a crop humidity and nutrient biome bonus. - * - * 0 indicates no bonus and negative values indicate a penalty. - * - * @param type Forge biome type to apply the bonus in - * @param humidityBonus Humidity stat bonus - * @param nutrientsBonus Nutrient stat bonus - */ - public abstract void addBiomeBonus(Type type, int humidityBonus, int nutrientsBonus); - - /** - * Gets the humidity bonus for a biome. - * - * @param biome Biome to check - * @return Humidity bonus or 0 if none - */ - public abstract int getHumidityBiomeBonus(BiomeGenBase biome); - - /** - * Gets the nutrient bonus for a biome. - * - * @param biome Biome to check - * @return Nutrient bonus or 0 if none - */ - public abstract int getNutrientBiomeBonus(BiomeGenBase biome); - - /** - * Returns the list of registered crops. - * - * @return Registered crops by ID - */ - public abstract CropCard[] getCropList(); - - /** - * Auto-assign an ID to a plant and register it. - * Usage of this method is not recommended! Other plants could take your IDs and cause your plants to turn into other plants. - * - * @param crop plant to register - * @return The ID assigned to the plant - */ - public abstract short registerCrop(CropCard crop); - - /** - * Attempt to register a plant to an ID. - * If the ID is taken, the crop will not be registered and a console print will notify the user. - * - * @param crop plant to register - * @param i ID to register the plant to - * @return Whether the crop was registered - */ - public abstract boolean registerCrop(CropCard crop, int i); - - /** - * Registers a base seed, an item used to plant a crop. - * - * @param stack item - * @param id plant ID - * @param size initial size - * @param growth initial growth stat - * @param gain initial gain stat - * @param resistance initial resistance stat - * @return True if successful - */ - public abstract boolean registerBaseSeed(ItemStack stack, int id, int size, int growth, int gain, int resistance); - - /** - * Finds a base seed from the given item. - * - * @return Base seed or null if none found - */ - public abstract BaseSeed getBaseSeed(ItemStack stack); - - /** - * Execute registerSprites for all registered crop cards. - * - * This method will get called by IC2, don't call it yourself. - */ - @SideOnly(Side.CLIENT) - public abstract void startSpriteRegistration(IIconRegister iconRegister); - - /** - * Returns the ID for the given crop. - * - * @param crop Crop to look up - * @return ID, or -1 if not found - */ - public abstract int getIdFor(CropCard crop); -} diff --git a/src/main/java/ic2/api/crops/ICropTile.java b/src/main/java/ic2/api/crops/ICropTile.java deleted file mode 100644 index 4084c5007..000000000 --- a/src/main/java/ic2/api/crops/ICropTile.java +++ /dev/null @@ -1,253 +0,0 @@ -package ic2.api.crops; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -/** - * Interface implemented by the crop tile entity. - */ -public interface ICropTile { - /** - * Get the crop's plant ID. - * - * @return Plant ID, or -1 if there is no plant currently on the crop - */ - public short getID(); - - /** - * Set the crop's plant ID. - * - * @param id Plant ID, or -1 for no plant - */ - public void setID(short id); - - /** - * Get the crop's plant size. - * - * @return Plant size, starting with 1 and maximum varies depending on plant - */ - public byte getSize(); - - /** - * Set the crop's plant size. - * - * @param size Plant size - */ - public void setSize(byte size); - - /** - * Get the crop's plant growth stat. - * Higher values indicate faster growth. - * - * @return Plant growth stat - */ - public byte getGrowth(); - - /** - * Set the crop's plant growth stat. - * - * @param growth Plant growth stat - */ - public void setGrowth(byte growth); - - /** - * Get the crop's plant gain stat. - * Higher values indicate more drops. - * - * @return Plant gain stat - */ - public byte getGain(); - - /** - * Set the crop's plant gain stat. - * - * @param gain Plant gain stat - */ - public void setGain(byte gain); - - /** - * Get the crop's plant resistance stat. - * Higher values indicate more resistance against trampling. - * - * @return Plant resistance stat - */ - public byte getResistance(); - - /** - * Set the crop's plant resistance stat. - * - * @param resistance Plant resistance stat - */ - public void setResistance(byte resistance); - - /** - * Get the crop's plant scan level. - * Increases every time the seed is analyzed. - * - * @return Plant scan level - */ - public byte getScanLevel(); - - /** - * Set the crop's plant scan level. - * - * @param scanLevel Plant scan level - */ - public void setScanLevel(byte scanLevel); - - /** - * Get the crop's plant custom data, stored alongside the crop. - * Can be modified in place. - * - * @return Plant custom data - */ - public NBTTagCompound getCustomData(); - - /** - * Get the crop's nutrient storage. - * Ranges from 0 to 100. - * - * @return Crop nutrient storage - */ - public int getNutrientStorage(); - - /** - * Set the crop's nutrient storage. - * - * @param nutrientStorage Crop nutrient storage - */ - public void setNutrientStorage(int nutrientStorage); - - /** - * Get the crop's hydration storage. - * 0 indicates nothing, 1-10 indicate water hydration and 11-100 for hydration cells. - * - * @return Crop hydration storage - */ - public int getHydrationStorage(); - - /** - * Set the crop's hydration storage. - * - * @param hydrationStorage Crop hydration storage - */ - public void setHydrationStorage(int hydrationStorage); - - /** - * Get the crop's Weed-Ex storage. - * - * @return Crop Weed-Ex storage - */ - public int getWeedExStorage(); - - /** - * Set the crop's Weed-Ex storage. - * - * @param weedExStorage Crop Weed-Ex storage - */ - public void setWeedExStorage(int weedExStorage); - - /** - * Get the crop's humidity. - * Ranges from 0 (dry) to 10 (humid). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop humidity level - */ - public byte getHumidity(); - - /** - * Get the crop's nutrient level. - * Ranges from 0 (empty) to 10 (full). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop nutrient level - */ - public byte getNutrients(); - - /** - * Get the crop's air quality. - * Ranges from 0 (cluttered) to 10 (fresh). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop air quality - */ - public byte getAirQuality(); - - /** - * Get the crop's world. - * - * @return Crop world - */ - public World getWorld(); - - /** - * Get the crop's location. - * - * @return Crop location - */ - public ChunkCoordinates getLocation(); - - /** - * Get the crop's light level. - * - * @return Crop light level - */ - public int getLightLevel(); - - /** - * Pick the crop, removing and giving seeds for the plant. - * - * @param manual whether it was done by hand (not automated) - * @return true if successfully picked - */ - public boolean pick(boolean manual); - - /** - * Harvest the crop, turning it into gain and resetting its size. - * - * @param manual whether it one by hand (not automated) - * @return true if successfully harvested - */ - public boolean harvest(boolean manual); - - /** - * Fully clears the crop without dropping anything. - */ - public void reset(); - - /** - * Request a texture and lighting update. - */ - public void updateState(); - - /** - * Check if a block is under the farmland containing the crop. - * Searches up to 2 blocks below the farmland or an air space, whichever appears first. - * - * @param block block to search - * @return Whether the block was found - */ - public boolean isBlockBelow(Block block); - - /** - * Generate plant seeds with the given parameters. - * - * @param plant plant ID - * @param growth plant growth stat - * @param gain plant gain stat - * @param resis plant resistance stat - * @param scan plant scan level - * @return Plant seed item - */ - public ItemStack generateSeeds(short plant, byte growth, byte gain, byte resis, byte scan); -} diff --git a/src/main/java/ic2/api/crops/package-info.java b/src/main/java/ic2/api/crops/package-info.java deleted file mode 100644 index 04b825392..000000000 --- a/src/main/java/ic2/api/crops/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.crops; -import cpw.mods.fml.common.API; - diff --git a/src/main/java/ic2/api/energy/EnergyNet.java b/src/main/java/ic2/api/energy/EnergyNet.java deleted file mode 100644 index 822bfc297..000000000 --- a/src/main/java/ic2/api/energy/EnergyNet.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api.energy; - - -/** - * Provides access to the energy network. - * - * The old EnergyNet methods missing in IEnergyNet have been migrated to events (load, unload) or - * removed (tiles no longer emit energy actively, the energy net implementation requests it). - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public final class EnergyNet { - /** - * Instance of the global EnergyNet class. - */ - public static IEnergyNet instance; -} - diff --git a/src/main/java/ic2/api/energy/IEnergyNet.java b/src/main/java/ic2/api/energy/IEnergyNet.java deleted file mode 100644 index 871b466d0..000000000 --- a/src/main/java/ic2/api/energy/IEnergyNet.java +++ /dev/null @@ -1,64 +0,0 @@ -package ic2.api.energy; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Interface representing the methods provided by the global EnergyNet class. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergyNet { - /** - * Get the EnergyNet-registered tile entity at the specified position. - * - * This is not the same as World.getTileEntity(), it's possible to register delegate tile - * entities with the energy net which are different from what's actually in the world. Those - * delegates allow to use separate TileEntity objects just for the EnergyNet interfaces, - * simplifying cross-mod dependencies and multi-blocks. - * - * @param world World containing the tile entity - * @param x x-coordinate - * @param y y-coordinate - * @param z z-coordinate - * @return tile entity registered to the energy net or null if none is registered - */ - TileEntity getTileEntity(World world, int x, int y, int z); - - /** - * Get the EnergyNet-registered neighbor tile entity at the specified position. - * - * @param te TileEntity indicating the world and position to search from - * @param dir direction the neighbor is to be found - * @return neighbor tile entity registered to the energy net or null if none is registered - */ - TileEntity getNeighbor(TileEntity te, ForgeDirection dir); - - /** - * determine how much energy has been emitted by the EnergyEmitter specified - * - * @note call this twice with x ticks delay to get the avg. emitted power p = (call2 - call1) / x EU/tick - * - * @param tileEntity energy emitter - */ - long getTotalEnergyEmitted(TileEntity tileEntity); - - /** - * determine how much energy has been sunken by the EnergySink specified - * - * @note call this twice with x ticks delay to get the avg. sunken power p = (call2 - call1) / x EU/tick - * - * @param tileEntity energy emitter - */ - long getTotalEnergySunken(TileEntity tileEntity); - - /** - * Determine the typical power used by the specific tier, e.g. 128 eu/t for tier 2. - * - * @param tier tier - * @return power in eu/t - */ - int getPowerFromTier(int tier); -} diff --git a/src/main/java/ic2/api/energy/prefab/BasicSink.java b/src/main/java/ic2/api/energy/prefab/BasicSink.java deleted file mode 100644 index 9ef13398a..000000000 --- a/src/main/java/ic2/api/energy/prefab/BasicSink.java +++ /dev/null @@ -1,375 +0,0 @@ -package ic2.api.energy.prefab; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -import cpw.mods.fml.common.FMLCommonHandler; - -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - -import ic2.api.energy.EnergyNet; -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySink; -import ic2.api.info.Info; -import ic2.api.item.ElectricItem; - -/** - * BasicSink is a simple adapter to provide an ic2 energy sink. - * - * It's designed to be attached to a tile entity as a delegate. Functionally BasicSink acts as a - * one-time configurable input energy buffer, thus providing a common use case for machines. - * - * Sub-classing BasicSink instead of using it as a delegate works as well, but isn't recommended. - * The delegate can be extended with additional functionality through a sub class though. - * - * The constraints set by BasicSink like the strict tank-like energy buffering should provide a - * more easy to use and stable interface than using IEnergySink directly while aiming for - * optimal performance. - * - * Using BasicSink involves the following steps: - * - create a BasicSink instance in your TileEntity, typically in a field - * - forward invalidate, onChunkUnload, readFromNBT, writeToNBT and updateEntity to the BasicSink - * instance. - * If you have other means of determining when the tile entity is fully loaded, notify onLoaded - * that way instead of forwarding updateEntity. - * - call useEnergy whenever appropriate. canUseEnergy determines if enough energy is available - * without consuming the energy. - * - optionally use getEnergyStored to display the output buffer charge level - * - optionally use setEnergyStored to sync the stored energy to the client (e.g. in the Container) - * - * Example implementation code: - * @code{.java} - * public class SomeTileEntity extends TileEntity { - * // new basic energy sink, 1000 EU buffer, tier 1 (32 EU/t, LV) - * private BasicSink ic2EnergySink = new BasicSink(this, 1000, 1); - * - * @Override - * public void invalidate() { - * ic2EnergySink.invalidate(); // notify the energy sink - * ... - * super.invalidate(); // this is important for mc! - * } - * - * @Override - * public void onChunkUnload() { - * ic2EnergySink.onChunkUnload(); // notify the energy sink - * ... - * } - * - * @Override - * public void readFromNBT(NBTTagCompound tag) { - * super.readFromNBT(tag); - * - * ic2EnergySink.readFromNBT(tag); - * ... - * } - * - * @Override - * public void writeToNBT(NBTTagCompound tag) { - * super.writeToNBT(tag); - * - * ic2EnergySink.writeToNBT(tag); - * ... - * } - * - * @Override - * public void updateEntity() { - * ic2EnergySink.updateEntity(); // notify the energy sink - * ... - * if (ic2EnergySink.useEnergy(5)) { // use 5 eu from the sink's buffer this tick - * ... // do something with the energy - * } - * ... - * } - * - * ... - * } - * @endcode - */ -public class BasicSink extends TileEntity implements IEnergySink { - - // ********************************** - // *** Methods for use by the mod *** - // ********************************** - - /** - * Constructor for a new BasicSink delegate. - * - * @param parent1 TileEntity represented by this energy sink. - * @param capacity1 Maximum amount of eu to store. - * @param tier1 IC2 tier, 1=LV, 2=MV, ... - */ - public BasicSink(TileEntity parent1, int capacity1, int tier1) { - this.parent = parent1; - this.capacity = capacity1; - this.tier = tier1; - } - - // in-world te forwards >> - - /** - * Forward for the base TileEntity's updateEntity(), used for creating the energy net link. - * Either updateEntity or onLoaded have to be used. - */ - @Override - public void updateEntity() { - if (!addedToEnet) onLoaded(); - } - - /** - * Notification that the base TileEntity finished loaded, for advanced uses. - * Either updateEntity or onLoaded have to be used. - */ - public void onLoaded() { - if (!addedToEnet && - !FMLCommonHandler.instance().getEffectiveSide().isClient() && - Info.isIc2Available()) { - worldObj = parent.getWorldObj(); - xCoord = parent.xCoord; - yCoord = parent.yCoord; - zCoord = parent.zCoord; - - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - - addedToEnet = true; - } - } - - /** - * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void invalidate() { - super.invalidate(); - - onChunkUnload(); - } - - /** - * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void onChunkUnload() { - if (addedToEnet && - Info.isIc2Available()) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - - addedToEnet = false; - } - } - - /** - * Forward for the base TileEntity's readFromNBT(), used for loading the state. - * - * @param tag Compound tag as supplied by TileEntity.readFromNBT() - */ - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - - NBTTagCompound data = tag.getCompoundTag("IC2BasicSink"); - - energyStored = data.getDouble("energy"); - } - - /** - * Forward for the base TileEntity's writeToNBT(), used for saving the state. - * - * @param tag Compound tag as supplied by TileEntity.writeToNBT() - */ - @Override - public void writeToNBT(NBTTagCompound tag) { - try { - super.writeToNBT(tag); - } catch (RuntimeException e) { - // happens if this is a delegate, ignore - } - - NBTTagCompound data = new NBTTagCompound(); - - data.setDouble("energy", energyStored); - - tag.setTag("IC2BasicSink", data); - } - - // << in-world te forwards - // methods for using this adapter >> - - /** - * Get the maximum amount of energy this sink can hold in its buffer. - * - * @return Capacity in EU. - */ - public int getCapacity() { - return capacity; - } - - /** - * Set the maximum amount of energy this sink can hold in its buffer. - * - * @param capacity1 Capacity in EU. - */ - public void setCapacity(int capacity1) { - this.capacity = capacity1; - } - - /** - * Get the IC2 energy tier for this sink. - * - * @return IC2 Tier. - */ - public int getTier() { - return tier; - } - - /** - * Set the IC2 energy tier for this sink. - * - * @param tier1 IC2 Tier. - */ - public void setTier(int tier1) { - this.tier = tier1; - } - - /** - * Determine the energy stored in the sink's input buffer. - * - * @return amount in EU, may be above capacity - */ - public double getEnergyStored() { - return energyStored; - } - - /** - * Set the stored energy to the specified amount. - * - * This is intended for server -> client synchronization, e.g. to display the stored energy in - * a GUI through getEnergyStored(). - * - * @param amount - */ - public void setEnergyStored(double amount) { - energyStored = amount; - } - - /** - * Determine if the specified amount of energy is available. - * - * @param amount in EU - * @return true if the amount is available - */ - public boolean canUseEnergy(double amount) { - return energyStored >= amount; - } - - /** - * Use the specified amount of energy, if available. - * - * @param amount amount to use - * @return true if the amount was available - */ - public boolean useEnergy(double amount) { - if (canUseEnergy(amount) && !FMLCommonHandler.instance().getEffectiveSide().isClient()) { - energyStored -= amount; - - return true; - } - return false; - } - - /** - * Discharge the supplied ItemStack into this sink's energy buffer. - * - * @param stack ItemStack to discharge (null is ignored) - * @param limit Transfer limit, values <= 0 will use the battery's limit - * @return true if energy was transferred - */ - public boolean discharge(ItemStack stack, int limit) { - if (stack == null || !Info.isIc2Available()) return false; - - int amount = (int) Math.floor(capacity - energyStored); - if (amount <= 0) return false; - - if (limit > 0 && limit < amount) amount = limit; - - amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, false); - - energyStored += amount; - - return amount > 0; - } - - // << methods for using this adapter - - // backwards compatibility (ignore these) >> - - @Deprecated - public void onUpdateEntity() { - updateEntity(); - } - - @Deprecated - public void onInvalidate() { - invalidate(); - } - - @Deprecated - public void onOnChunkUnload() { - onChunkUnload(); - } - - @Deprecated - public void onReadFromNbt(NBTTagCompound tag) { - readFromNBT(tag); - } - - @Deprecated - public void onWriteToNbt(NBTTagCompound tag) { - writeToNBT(tag); - } - - // << backwards compatibility - - // ****************************** - // *** Methods for use by ic2 *** - // ****************************** - - // energy net interface >> - - @Override - public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { - return true; - } - - @Override - public double demandedEnergyUnits() { - return Math.max(0, capacity - energyStored); - } - - @Override - public double injectEnergyUnits(ForgeDirection directionFrom, double amount) { - energyStored += amount; - - return 0; - } - - @Override - public int getMaxSafeInput() { - return EnergyNet.instance.getPowerFromTier(tier); - } - - // << energy net interface - - - public final TileEntity parent; - - protected int capacity; - protected int tier; - protected double energyStored; - protected boolean addedToEnet; -} diff --git a/src/main/java/ic2/api/energy/prefab/BasicSource.java b/src/main/java/ic2/api/energy/prefab/BasicSource.java deleted file mode 100644 index 5829d8e3f..000000000 --- a/src/main/java/ic2/api/energy/prefab/BasicSource.java +++ /dev/null @@ -1,375 +0,0 @@ -package ic2.api.energy.prefab; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -import cpw.mods.fml.common.FMLCommonHandler; - -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - -import ic2.api.energy.EnergyNet; -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySource; -import ic2.api.info.Info; -import ic2.api.item.ElectricItem; - -/** - * BasicSource is a simple adapter to provide an ic2 energy source. - * - * It's designed to be attached to a tile entity as a delegate. Functionally BasicSource acts as a - * one-time configurable output energy buffer, thus providing a common use case for generators. - * - * Sub-classing BasicSource instead of using it as a delegate works as well, but isn't recommended. - * The delegate can be extended with additional functionality through a sub class though. - * - * The constraints set by BasicSource like the strict tank-like energy buffering should provide a - * more easy to use and stable interface than using IEnergySource directly while aiming for - * optimal performance. - * - * Using BasicSource involves the following steps: - * - create a BasicSource instance in your TileEntity, typically in a field - * - forward invalidate, onChunkUnload, readFromNBT, writeToNBT and updateEntity to the BasicSource - * instance. - * If you have other means of determining when the tile entity is fully loaded, notify onLoaded - * that way instead of forwarding updateEntity. - * - call addEnergy whenever appropriate, using getFreeCapacity may determine if e.g. the generator - * should run - * - optionally use getEnergyStored to display the output buffer charge level - * - optionally use setEnergyStored to sync the stored energy to the client (e.g. in the Container) - * - * Example implementation code: - * @code{.java} - * public class SomeTileEntity extends TileEntity { - * // new basic energy source, 1000 EU buffer, tier 1 (32 EU/t, LV) - * private BasicSource ic2EnergySource = new BasicSource(this, 1000, 1); - * - * @Override - * public void invalidate() { - * ic2EnergySource.invalidate(); // notify the energy source - * ... - * super.invalidate(); // this is important for mc! - * } - * - * @Override - * public void onChunkUnload() { - * ic2EnergySource.onChunkUnload(); // notify the energy source - * ... - * } - * - * @Override - * public void readFromNBT(NBTTagCompound tag) { - * super.readFromNBT(tag); - * - * ic2EnergySource.readFromNBT(tag); - * ... - * } - * - * @Override - * public void writeToNBT(NBTTagCompound tag) { - * super.writeToNBT(tag); - * - * ic2EnergySource.writeToNBT(tag); - * ... - * } - * - * @Override - * public void updateEntity() { - * ic2EnergySource.updateEntity(); // notify the energy source - * ... - * ic2EnergySource.addEnergy(5); // add 5 eu to the source's buffer this tick - * ... - * } - * - * ... - * } - * @endcode - */ -public class BasicSource extends TileEntity implements IEnergySource { - - // ********************************** - // *** Methods for use by the mod *** - // ********************************** - - /** - * Constructor for a new BasicSource delegate. - * - * @param parent1 Base TileEntity represented by this energy source. - * @param capacity1 Maximum amount of eu to store. - * @param tier1 IC2 tier, 1=LV, 2=MV, ... - */ - public BasicSource(TileEntity parent1, int capacity1, int tier1) { - int power = EnergyNet.instance.getPowerFromTier(tier1); - - this.parent = parent1; - this.capacity = capacity1 < power ? power : capacity1; - this.tier = tier1; - } - - // in-world te forwards >> - - /** - * Forward for the base TileEntity's updateEntity(), used for creating the energy net link. - * Either updateEntity or onLoaded have to be used. - */ - @Override - public void updateEntity() { - if (!addedToEnet) onLoaded(); - } - - /** - * Notification that the base TileEntity finished loading, for advanced uses. - * Either updateEntity or onLoaded have to be used. - */ - public void onLoaded() { - if (!addedToEnet && - !FMLCommonHandler.instance().getEffectiveSide().isClient() && - Info.isIc2Available()) { - worldObj = parent.getWorldObj(); - xCoord = parent.xCoord; - yCoord = parent.yCoord; - zCoord = parent.zCoord; - - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - - addedToEnet = true; - } - } - - /** - * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void invalidate() { - super.invalidate(); - - onChunkUnload(); - } - - /** - * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void onChunkUnload() { - if (addedToEnet && - Info.isIc2Available()) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - - addedToEnet = false; - } - } - - /** - * Forward for the base TileEntity's readFromNBT(), used for loading the state. - * - * @param tag Compound tag as supplied by TileEntity.readFromNBT() - */ - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - - NBTTagCompound data = tag.getCompoundTag("IC2BasicSource"); - - energyStored = data.getDouble("energy"); - } - - /** - * Forward for the base TileEntity's writeToNBT(), used for saving the state. - * - * @param tag Compound tag as supplied by TileEntity.writeToNBT() - */ - @Override - public void writeToNBT(NBTTagCompound tag) { - try { - super.writeToNBT(tag); - } catch (RuntimeException e) { - // happens if this is a delegate, ignore - } - - NBTTagCompound data = new NBTTagCompound(); - - data.setDouble("energy", energyStored); - - tag.setTag("IC2BasicSource", data); - } - - // << in-world te forwards - // methods for using this adapter >> - - /** - * Get the maximum amount of energy this source can hold in its buffer. - * - * @return Capacity in EU. - */ - public int getCapacity() { - return capacity; - } - - /** - * Set the maximum amount of energy this source can hold in its buffer. - * - * @param capacity1 Capacity in EU. - */ - public void setCapacity(int capacity1) { - int power = EnergyNet.instance.getPowerFromTier(tier); - - if (capacity1 < power) capacity1 = power; - - this.capacity = capacity1; - } - - /** - * Get the IC2 energy tier for this source. - * - * @return IC2 Tier. - */ - public int getTier() { - return tier; - } - - /** - * Set the IC2 energy tier for this source. - * - * @param tier1 IC2 Tier. - */ - public void setTier(int tier1) { - int power = EnergyNet.instance.getPowerFromTier(tier1); - - if (capacity < power) capacity = power; - - this.tier = tier1; - } - - - /** - * Determine the energy stored in the source's output buffer. - * - * @return amount in EU - */ - public double getEnergyStored() { - return energyStored; - } - - /** - * Set the stored energy to the specified amount. - * - * This is intended for server -> client synchronization, e.g. to display the stored energy in - * a GUI through getEnergyStored(). - * - * @param amount - */ - public void setEnergyStored(double amount) { - energyStored = amount; - } - - /** - * Determine the free capacity in the source's output buffer. - * - * @return amount in EU - */ - public double getFreeCapacity() { - return capacity - energyStored; - } - - /** - * Add some energy to the output buffer. - * - * @param amount maximum amount of energy to add - * @return amount added/used, NOT remaining - */ - public double addEnergy(double amount) { - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return 0; - if (amount > capacity - energyStored) amount = capacity - energyStored; - - energyStored += amount; - - return amount; - } - - /** - * Charge the supplied ItemStack from this source's energy buffer. - * - * @param stack ItemStack to charge (null is ignored) - * @return true if energy was transferred - */ - public boolean charge(ItemStack stack) { - if (stack == null || !Info.isIc2Available()) return false; - - int amount = ElectricItem.manager.charge(stack, (int) energyStored, tier, false, false); - - energyStored -= amount; - - return amount > 0; - } - - // << methods for using this adapter - - // backwards compatibility (ignore these) >> - - @Deprecated - public void onUpdateEntity() { - updateEntity(); - } - - @Deprecated - public void onInvalidate() { - invalidate(); - } - - @Deprecated - public void onOnChunkUnload() { - onChunkUnload(); - } - - @Deprecated - public void onReadFromNbt(NBTTagCompound tag) { - readFromNBT(tag); - } - - @Deprecated - public void onWriteToNbt(NBTTagCompound tag) { - writeToNBT(tag); - } - - // << backwards compatibility - - // ****************************** - // *** Methods for use by ic2 *** - // ****************************** - - // energy net interface >> - - @Override - public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) { - return true; - } - - @Override - public double getOfferedEnergy() { - int power = EnergyNet.instance.getPowerFromTier(tier); - - if (energyStored >= power) { - return power; - } - return 0; - } - - @Override - public void drawEnergy(double amount) { - energyStored -= amount; - } - - // << energy net interface - - - public final TileEntity parent; - - protected int capacity; - protected int tier; - protected double energyStored; - protected boolean addedToEnet; -} diff --git a/src/main/java/ic2/api/energy/prefab/package-info.java b/src/main/java/ic2/api/energy/prefab/package-info.java deleted file mode 100644 index c38f7e0e6..000000000 --- a/src/main/java/ic2/api/energy/prefab/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.energy.prefab; -import cpw.mods.fml.common.API; - diff --git a/src/main/java/ic2/api/energy/tile/IEnergyConductor.java b/src/main/java/ic2/api/energy/tile/IEnergyConductor.java deleted file mode 100644 index 16965afe1..000000000 --- a/src/main/java/ic2/api/energy/tile/IEnergyConductor.java +++ /dev/null @@ -1,53 +0,0 @@ -package ic2.api.energy.tile; - -/** - * Tile entities which conduct energy pulses without buffering (mostly cables) have to implement this - * interface. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IEnergyConductor extends IEnergyAcceptor, IEnergyEmitter { - /** - * Energy loss for the conductor in EU per block. - * - * @return Energy loss - */ - double getConductionLoss(); - - /** - * Amount of energy the insulation will handle before shocking nearby players and mobs. - * - * @return Insulation energy absorption in EU - */ - int getInsulationEnergyAbsorption(); - - /** - * Amount of energy the insulation will handle before it is destroyed. - * Ensure that this value is greater than the insulation energy absorption + 64. - * - * @return Insulation-destroying energy in EU - */ - int getInsulationBreakdownEnergy(); - - /** - * Amount of energy the conductor will handle before it melts. - * - * @return Conductor-destroying energy in EU - */ - int getConductorBreakdownEnergy(); - - /** - * Remove the conductor's insulation if the insulation breakdown energy was exceeded. - * - * @see #getInsulationBreakdownEnergy() - */ - void removeInsulation(); - - /** - * Remove the conductor if the conductor breakdown energy was exceeded. - * - * @see #getConductorBreakdownEnergy() - */ - void removeConductor(); -} - diff --git a/src/main/java/ic2/api/energy/tile/IMetaDelegate.java b/src/main/java/ic2/api/energy/tile/IMetaDelegate.java deleted file mode 100644 index 8f4e830c8..000000000 --- a/src/main/java/ic2/api/energy/tile/IMetaDelegate.java +++ /dev/null @@ -1,34 +0,0 @@ -package ic2.api.energy.tile; - -import java.util.List; - -import net.minecraft.tileentity.TileEntity; - -/** - * Interface for grouping multi-block structures to a single energy net delegate. - * - * The energy net uses TileEntity to refer to a specific xyz+world position. If multiple of those - * positions should belong to the same functional structure, i.e. they consume or produce energy - * only once for the whole multi-block instead of once per every single block, this interface - * allows to do so. - * - * The tile entity implementing IMetaDelegate has to be added/removed to/from the energy net - * instead of every single sub-TileEntity. The energy net interaction will be handled by the - * IMetaDelegate TileEntity as well. - * - * The sub tile array TileEntity[] just provides optional connectivity (IEnergyAcceptor, - * IEnergyEmitter) and mandatory position (x, y, z, World) data. - * If the connectivity data on the sub tile is missing, the meta delegate is queried instead. - * - * See ic2/api/energy/usage.txt for an overall description of the energy net api. - */ -public interface IMetaDelegate extends IEnergyTile { - /** - * Get the sub-TileEntities belonging to this Meta TileEntity. - * - * @note the list has to be consistent between the EnergyNet Load and Unload events. - * - * @return sub-TileEntity array - */ - List getSubTiles(); -} diff --git a/src/main/java/ic2/api/event/LaserEvent.java b/src/main/java/ic2/api/event/LaserEvent.java deleted file mode 100644 index 6d5ea2804..000000000 --- a/src/main/java/ic2/api/event/LaserEvent.java +++ /dev/null @@ -1,114 +0,0 @@ -package ic2.api.event; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import cpw.mods.fml.common.eventhandler.Cancelable; - -import net.minecraftforge.event.world.WorldEvent; - -/** - * A bunch of Events to handle the power of the Mining Laser. - */ -@Cancelable -public class LaserEvent extends WorldEvent { - // the Laser Entity - public final Entity lasershot; - - // the following variables can be changed and the Laser will adjust to them - - // the Player firing the Laser. If the Laser gets "reflected" the Player could change. - public EntityLivingBase owner; - // Range of the Laser Shot. Determine the amount of broken blocks, as well, as each broken block will subtract ~1F from range. - public float range, power; - public int blockBreaks; - // Determines whether the laser will explode upon hitting something - public boolean explosive, smelt; - - public LaserEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1) { - super(world1); - this.lasershot = lasershot1; - this.owner = owner1; - this.range = range1; - this.power = power1; - this.blockBreaks = blockBreaks1; - this.explosive = explosive1; - this.smelt = smelt1; - } - - /** - * Event when the Laser is getting shot by a Player. - * - * The Item is the Laser Gun which the "Player" has shot - */ - public static class LaserShootEvent extends LaserEvent { - ItemStack laseritem; - - public LaserShootEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, ItemStack laseritem1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.laseritem = laseritem1; - } - } - - /** - * Event when the Laser is exploding for some Reason. - * - * The Laser will no longer exist after this Event is posted as it either Explodes or despawns after the Event is fired. - */ - public static class LaserExplodesEvent extends LaserEvent { - // explosion strength, even that can be changed! - public float explosionpower, explosiondroprate, explosionentitydamage; - - public LaserExplodesEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, float explosionpower1, float explosiondroprate1, float explosionentitydamage1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.explosionpower = explosionpower1; - this.explosiondroprate = explosiondroprate1; - this.explosionentitydamage = explosionentitydamage1; - } - } - - /** - * Event when the Laser is hitting a Block - * x, y and z are the Coords of the Block. - * - * Canceling this Event stops the Laser from attempting to break the Block, what is very useful for Glass. - * Use lasershot.setDead() to remove the Shot entirely. - */ - public static class LaserHitsBlockEvent extends LaserEvent { - // targeted block, even that can be changed! - public int x, y, z; - public int side; - // removeBlock determines if the Block will be removed. dropBlock determines if the Block should drop something. - public boolean removeBlock, dropBlock; - public float dropChance; - - public LaserHitsBlockEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, int x1, int y1, int z1, int side1, float dropChance1, boolean removeBlock1, boolean dropBlock1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.x = x1; - this.y = y1; - this.z = z1; - this.side = side1; - this.removeBlock = removeBlock1; - this.dropBlock = dropBlock1; - this.dropChance = dropChance1; - } - } - - /** - * Event when the Laser is getting at a Living Entity - * - * Canceling this Event ignores the Entity - * Use lasershot.setDead() to remove the Shot entirely. - */ - public static class LaserHitsEntityEvent extends LaserEvent { - // the Entity which the Laser has shot at, even the target can be changed! - public Entity hitentity; - - public LaserHitsEntityEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, Entity hitentity1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.hitentity = hitentity1; - } - } -} diff --git a/src/main/java/ic2/api/event/PaintEvent.java b/src/main/java/ic2/api/event/PaintEvent.java deleted file mode 100644 index c6565c229..000000000 --- a/src/main/java/ic2/api/event/PaintEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -package ic2.api.event; - -import net.minecraft.world.World; - -import cpw.mods.fml.common.eventhandler.Cancelable; - -import net.minecraftforge.event.world.WorldEvent; - -@Cancelable -public class PaintEvent extends WorldEvent { - // target block - public final int x; - public final int y; - public final int z; - public final int side; - - // color to paint the block - public final int color; - - // set to true to confirm the operation - public boolean painted = false; - - public PaintEvent(World world1, int x1, int y1, int z1, int side1, int color1) { - super(world1); - - this.x = x1; - this.y = y1; - this.z = z1; - this.side = side1; - this.color = color1; - } -} diff --git a/src/main/java/ic2/api/event/RetextureEvent.java b/src/main/java/ic2/api/event/RetextureEvent.java deleted file mode 100644 index d530578c8..000000000 --- a/src/main/java/ic2/api/event/RetextureEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -package ic2.api.event; - -import net.minecraft.block.Block; -import net.minecraft.world.World; - -import cpw.mods.fml.common.eventhandler.Cancelable; - -import net.minecraftforge.event.world.WorldEvent; - -@Cancelable -public class RetextureEvent extends WorldEvent { - // target block - public final int x; - public final int y; - public final int z; - public final int side; - - // referenced block (to grab the texture from) - public final Block referencedBlock; - public final int referencedMeta; - public final int referencedSide; - - // set to true to confirm the operation - public boolean applied = false; - - public RetextureEvent(World world1, int x1, int y1, int z1, int side1, Block referencedBlock, int referencedMeta1, int referencedSide1) { - super(world1); - - this.x = x1; - this.y = y1; - this.z = z1; - this.side = side1; - this.referencedBlock = referencedBlock; - this.referencedMeta = referencedMeta1; - this.referencedSide = referencedSide1; - } -} diff --git a/src/main/java/ic2/api/event/package-info.java b/src/main/java/ic2/api/event/package-info.java deleted file mode 100644 index d331b924d..000000000 --- a/src/main/java/ic2/api/event/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.event; -import cpw.mods.fml.common.API; - diff --git a/src/main/java/ic2/api/item/IBoxable.java b/src/main/java/ic2/api/item/IBoxable.java deleted file mode 100644 index bca2cc0dc..000000000 --- a/src/main/java/ic2/api/item/IBoxable.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - - -public interface IBoxable { - /** - * Determine whether an item can be stored in a toolbox or not. - * - * @param itemstack item to be stored - * @return Whether to store the item in the toolbox or not - */ - public abstract boolean canBeStoredInToolbox(ItemStack itemstack); -} diff --git a/src/main/java/ic2/api/item/IC2Items.java b/src/main/java/ic2/api/item/IC2Items.java deleted file mode 100644 index 67d9f757f..000000000 --- a/src/main/java/ic2/api/item/IC2Items.java +++ /dev/null @@ -1,599 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - -/** - * Provides access to IC2 blocks and items. - * - * Some items can be acquired through the ore dictionary which is the recommended way. - * The items are initialized while IC2 is being loaded - try to use ModsLoaded() or load your mod after IC2. - * Some blocks/items can be disabled by a config setting, so it's recommended to check if they're null first. - * - * Getting the associated Block/Item for an ItemStack x: - * Blocks: Block.blocksList[x.itemID] - * Items: x.getItem() - */ -public final class IC2Items { - /** - * Get an ItemStack for a specific item name, example: Items.getItem("resin") - * See the list below for item names. - * Make sure to copy() the ItemStack if you want to modify it. - * - * @param name item name - * @return The item or null if the item does not exist or an error occurred - */ - public static ItemStack getItem(String name) { - try { - if (Ic2Items == null) Ic2Items = Class.forName(getPackage() + ".core.Ic2Items"); - - Object ret = Ic2Items.getField(name).get(null); - - if (ret instanceof ItemStack) { - return (ItemStack) ret; - } - return null; - } catch (Exception e) { - System.out.println("IC2 API: Call getItem failed for "+name); - - return null; - } - } - - /* Possible values: - - // ores - copperOre; // Copper Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreCopper, null with enableWorldGenOreCopper=false - tinOre; // Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreTin, null with enableWorldGenOreTin=false - uraniumOre; // Tin Ore block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreUranium, null with enableWorldGenOreUranium=false - leadOre; // Lead Ore Block, currently not meta sensitive, meta in ItemStack set to 0, ore dictionary: oreLead, null with enableWorldGenOreLead=false - - // rubber related - - Rubber wood block, meta reflects the state, meta in ItemStack set to 0, ore dictionary: woodRubber (with meta 0), null with enableWorldGenTreeRubber=false - dropped (as an item) -> metadata 0 - block, no resin spot -> metadata 0 or 1 - block, wet resin spot -> metadata 2-5 (according to the side) - block, dry resin spot -> metadata 8-11 (wet state + 6) - - rubberWood; - rubberLeaves; // Rubber Leaves block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false - rubberSapling; // Rubber Sapling block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber=false - resinSheet; // Resin Sheet block, currently not meta sensitive - rubberTrampoline; // Rubber Trampoline block, meta reflects internal state, meta in ItemStack set to 0 - - // building/storage - ironFence; // Iron Fence block, currently not meta sensitive - - reinforcedStone; // Reinforced Stone block, currently not meta sensitive - reinforcedGlass; // Reinforced Glass block, currently not meta sensitive - reinforcedDoorBlock; // Reinforced Door block, meta reflects the state (see vanilla doors), meta in ItemStack set to 0 - - constructionreinforcedFoam; // Construction Reinforced Foam block, currently not meta sensitive - constructionFoam; // Construction Foam block, currently not meta sensitive - constructionFoamWall; // Construction Foam Wall block, meta = color, implements IPaintableBlock - scaffold; // Scaffold block, meta reflects internal physical model data - ironScaffold; // Scaffold block, meta reflects internal physical model data - - bronzeBlock; // Bronze block, meta sensitive - copperBlock; // Copper block, meta sensitive - tinBlock; // Tin block, meta sensitive - uraniumBlock; // Uranium block, meta sensitive - leadBlock; // Uranium block, meta sensitive - - // cables (when placed as a block, inventory items are different; TE implements IEnergyConductor) - - copperCableBlock; // Copper Cable block, meta sensitive - insulatedCopperCableBlock; // Insulated Copper Cable block, meta sensitive - - goldCableBlock; // Gold Cable block, meta sensitive - insulatedGoldCableBlock; // Insulated Gold Cable block, meta sensitive - doubleInsulatedGoldCableBlock; // Double Insulated Gold Cable block, meta sensitive - - ironCableBlock; // Iron Cable block, meta sensitive - insulatedIronCableBlock; // Insulated Iron Cable block, meta sensitive - doubleInsulatedIronCableBlock; // Double Insulated Iron Cable block, meta sensitive - trippleInsulatedIronCableBlock; // Tripple Insulated Iron Cable block, meta sensitive - - glassFiberCableBlock; // Glass Fiber Cable block, meta sensitive - - tinCableBlock; // Tin Cable block, meta sensitive - insulatedtinCableBlock; // Insulated Tin Cable item, meta sensitive - detectorCableBlock; // Detector Cable block, meta sensitive - splitterCableBlock; // Splitter Cable block, meta sensitive - - // generators + related (TE implements IEnergySource ex. reactorChamber) - - generator; // Generator block, meta sensitive - geothermalGenerator; // Geothermal Generator block, meta sensitive - waterMill; // Water Mill block, meta sensitive - solarPanel; // Solar Panel block, meta sensitive - windMill; // Wind Mill block, meta sensitive - nuclearReactor; // Nuclear Reactor block, meta sensitive - reactorChamber; // Reactor Chamber block, currently not meta sensitive - RTGenerator; // Radioisotope Thermoelectric Generator block, meta sensitive - semifluidGenerator; // Semifluid Generator block, meta sensitive - - - // energy storages (TE implements IEnergySource and IEnergyConductor) - - batBox; // BatBox block, meta sensitive - cesuUnit; // CESU Unit block, meta sensitive - mfeUnit; // MFE Unit block, meta sensitive - mfsUnit; // MFS Unit block, meta sensitive - - // transformers (TE implements IEnergySource and IEnergyConductor) - - lvTransformer; // LV Transformer block, meta sensitive - mvTransformer; // MV Transformer block, meta sensitive - hvTransformer; // HV Transformer block, meta sensitive - evTransformer; // EV Transformer block, meta sensitive - - // machines + related (TE implements IEnergySink ex. machine, miningPipe, miningPipeTip) - - machine; // Machine block, meta sensitive - advancedMachine; // Advanced Machine block, meta sensitive - - ironFurnace; // Iron Furnace block, meta sensitive - electroFurnace; // Electro Furnace block, meta sensitive - macerator; // Macerator block, meta sensitive - extractor; // Extractor block, meta sensitive - compressor; // Compressor block, meta sensitive - canner; // Canner block, meta sensitive - miner; // Miner block, meta sensitive - pump; // Pump block, meta sensitive - magnetizer; // Magnetizer block, meta sensitive - electrolyzer; // Electrolyzer block, meta sensitive - recycler; // Recycler block, meta sensitive - inductionFurnace; // Induction Furnace block, meta sensitive - massFabricator; // Mass Fabricator block, meta sensitive - terraformer; // Terraformer block, meta sensitive - teleporter; // Teleporter block, meta sensitive - teslaCoil; // Tesla Coil block, meta sensitive - luminator; // Passive (dark) Luminator block, meta = facing - activeLuminator; // Active (bright) Luminator block, meta = facing - centrifuge; // Centrifuge block, meta sensitive - metalformer; // MetalFormer block ,meta sensitive - orewashingplant; // Ore Wasching Plant,Meta sensitive - patternstorage; // Pattern Storage,Meta sensitive - scanner; // Scanner,Meta sensitive - replicator; // Replicator,Meta sensitive - - miningPipe; // Mining Pipe block, currently not meta sensitive, meta in ItemStack set to 0 - miningPipeTip; // Mining Pipe Tip block, currently not meta sensitive, meta in ItemStack set to 0 - - - // personal blocks - - personalSafe; // Personal Safe block, meta sensitive - tradeOMat; // Trade-O-Mat block, meta sensitive - energyOMat; // Energy-O-Mat block, meta sensitive - - // explosives - - industrialTnt; // Industrial TNT block, currently not meta sensitive - nuke; // Nuke block, currently not meta sensitive - dynamiteStick; // Dynamite Stick block, meta = placement, meta in ItemStack set to 0 - dynamiteStickWithRemote; // Dynamite Stick with Remote block, meta = placement, meta in ItemStack set to 0 - - // Agriculture Stuff - - crop; // Crop Block, empty, not meta sensitive - cropmatron; // Cropmatron machien block, meta sensititve - - // ----- items ----- - - // rubber + related - resin; // Resin item, currently not meta sensitive - rubber; // Rubber item, currently not meta sensitive, ore dictionary: itemRubber - - FluidCell; - - // Lithium -> Tritium - - reactorLithiumCell; // LithiumCell use in Reaktor, , meta = damage value - TritiumCell; // Tritium, currently not meta sensitive - - // Nuclear Fuel - - UranFuel; // , currently not meta sensitive - MOXFuel; // , currently not meta sensitive - Plutonium; // , currently not meta sensitive - smallPlutonium; // , currently not meta sensitive - Uran235; // , currently not meta sensitive - smallUran235; // , currently not meta sensitive - Uran238; // , currently not meta sensitive - - reactorDepletedUraniumSimple; // Depleted Uranium Cell items, currently not meta sensitive - reactorDepletedUraniumDual; - reactorDepletedUraniumQuad; - reactorDepletedMOXSimple; // Depleted MOX Cell items, currently not meta sensitive - reactorDepletedMOXDual; - reactorDepletedMOXQuad; - reactorMOXSimple; // Depleted MOX Cell items, currently not meta sensitive - reactorMOXDual; - reactorMOXQuad; - RTGPellets; - - - // Recipe Parts - - coil; // Coil, meta sensitive - elemotor; // electric motor, meta sensitive - powerunit; // Item Power Unit, meta sensitive - powerunitsmall; // Item Power Unit, meta sensitive - - - // ItemCasing - - casingcopper; // Copper ItemCasing, meta sensitive - casingtin; // Tin ItemCasing, meta sensitive - casingbronze; // Bronze ItemCasing, meta sensitive - casinggold; // Gold ItemCasing, meta sensitive - casingiron; // Iron ItemCasing, meta sensitive - @Deprecated - casingadviron; // Refined Iron ItemCasing, meta sensitive - casinglead; // Lead ItemCasing, meta sensitive - - // Crushed Ore - crushedIronOre; // Crushed Iron Ore, meta sensitive - crushedCopperOre; // Crushed Copper Ore, meta sensitive - crushedGoldOre; // Crushed Gold Ore, meta sensitive - crushedTinOre; // Crushed Tin Ore, meta sensitive - crushedUraniumOre; // Crushed Uranium Ore, meta sensitive - crushedSilverOre; // Crushed Silver Ore, meta sensitive - crushedLeadOre; // Crushed Lead Ore, meta sensitive - - - //Purify Crushed Ore - purifiedCrushedIronOre; // Purify Crushed Iron Ore, meta sensitive - purifiedCrushedCopperOre; // Purify Crushed Copper Ore, meta sensitive - purifiedCrushedGoldOre; // Purify Crushed Gold Ore, meta sensitive - purifiedCrushedTinOre; // Purify Crushed Tin Ore, meta sensitive - purifiedCrushedUraniumOre; // Purify Crushed Uranium Ore, meta sensitive - purifiedCrushedSilverOre; // Purify Crushed Silver Ore, meta sensitive - purifiedCrushedLeadOre; // Purify Crushed Lead Ore, meta sensitive - - // dusts - stoneDust; - bronzeDust; // Bronze Dust item, meta sensitive, ore dictionary: dustBronze - clayDust; // Clay Dust item, meta sensitive, ore dictionary: dustClay - coalDust; // Coal Dust item, meta sensitive, ore dictionary: dustCoal - copperDust; // Copper Dust item, meta sensitive, ore dictionary: dustCopper - goldDust; // Gold Dust item, meta sensitive, ore dictionary: dustGold - ironDust; // Iron Dust item, meta sensitive, ore dictionary: dustIron - silverDust; // Silver Dust item, meta sensitive, ore dictionary: dustSilver - tinDust; // Tin Dust item, meta sensitive, ore dictionary: dustTin - hydratedCoalDust; // Hydrated Coal Dust item, meta sensitive - leadDust; // Lead Dust item, meta sensitive, ore dictionary: dustLead - obsidianDust; // Obsidian Dust item, meta sensitive, ore dictionary: dustObsidian - lapiDust; // Lapi Dust item, meta sensitive, ore dictionary: dustLapi - sulfurDust; // Sulfur Dust item, meta sensitive, ore dictionary: dustSulfur - lithiumDust; // Lithium dust, meta sensitive, ore dictionary: dustLithium - - // small dusts - - smallIronDust; // Small Iron Dust item, meta sensitive - smallCopperDust; // Small Copper Dust item, meta sensitive - smallGoldDust; // Small Gold Dust item, meta sensitive - smallTinDust; // Small Tin Dust item, meta sensitive - smallSilverDust; // Small Silver Dust item, meta sensitive - smallLeadDust; // Small Lead Dust item, meta sensitive - smallSulfurDust; // Small Sulfur Dust item, meta sensitive - smallLithiumDust; // Small Lithium Dust item, meta sensitive - - - // ingots - @Deprecated - refinedIronIngot; // Refined Iron Ingot item, currently not meta sensitive, ore dictionary: ingotRefinedIron - copperIngot; // Copper Ingot item, currently not meta sensitive, ore dictionary: ingotCopper - tinIngot; // Tin Ingot item, currently not meta sensitive, ore dictionary: ingotTin - bronzeIngot; // Bronze Ingot item, currently not meta sensitive, ore dictionary: ingotBronze - mixedMetalIngot; // Mixed Metal Ingot item, currently not meta sensitive - leadIngot; // Lead Ingot item, currently not meta sensitive - - - // tools/weapons (without electric tools) - treetap; // Treetap item, meta = damage value - wrench; // Wrench item, meta = damage value - cutter; // Insulation Cutter item, meta = damage value - constructionFoamSprayer; // Construction Foam Sprayer item, meta = charges (as of v1.45) - - bronzePickaxe; // Bronze Pickaxe item, meta = damage value - bronzeAxe; // Bronze Axe item, meta = damage value - bronzeSword; // Bronze Sword item, meta = damage value - bronzeShovel; // Bronze Shovel item, meta = damage value - bronzeHoe; // Bronze Hoe item, meta = damage value - - ForgeHammer; // Refine Iron Hammer item, meta = damage value - - // el. tools/devices/weapons - miningDrill; // Mining Drill item, meta = damage value for charge level - diamondDrill; // Diamond Tipped Mining Drill item, meta = damage value for charge level - iridiumDrill; // Iridium Tipped Mining Drill item, meta = damage value for charge level - chainsaw; // Chainsaw item, meta = damage value for charge level - electricWrench; // Electric Wrench item, meta = damage value for charge level - electricTreetap; // Electric Treetap item, meta = damage value for charge level - miningLaser; // Mining Laser item, meta = damage value for charge level - - ecMeter; // EC-Mater item, meta = itemdata db index (as of v1.45) - odScanner; // Ore Density Scanner item, meta = damage value for charge level - ovScanner; // Ore Value Scanner item, meta = damage value for charge level - obscurator; // Obscurator item, meta = damage value for charge level - - frequencyTransmitter; // Frequency Transmitter item, meta = itemdata db index (as of v1.45) - - nanoSaber; // Idle Nano Saber item, meta = damage value for charge level - enabledNanoSaber; // Enabled Nano Saber item, meta = damage value for charge level - - toolbox; // Open/Empty toolbox, meta = Open (0) / Closed (1) - - // armor/wearable - hazmatHelmet; // Hazmat Helmet item, meta = damage value - hazmatChestplate; // Hazmat Chestplate item, meta = damage value - hazmatLeggings; // Hazmat Leggings item, meta = damage value - hazmatBoots; // Hazmat Boots item, meta = damage value - - bronzeHelmet; // Bronze Helmet Armor item, meta = damage value - bronzeChestplate; // Bronze Chestplate Armor item, meta = damage value - bronzeLeggings; // Bronze Leggings Armor item, meta = damage value - bronzeBoots; // Bronze Boots Armor item, meta = damage value - - compositeArmor; // Composite Armor item, meta = damage value for charge level - - nanoHelmet; // Nano Helmet Armor item, meta = damage value for charge level - nanoBodyarmor; // Nano Bodyarmor item, meta = damage value for charge level - nanoLeggings; // Nano Leggings Armor item, meta = damage value for charge level - nanoBoots; // Nano Boots Armor item, meta = damage value for charge level - - quantumHelmet; // Quantum Helmet Armor item, meta = damage value for charge level - quantumBodyarmor; // Quantum Bodyarmor item, meta = damage value for charge level - quantumLeggings; // Quantum Leggings Armor item, meta = damage value for charge level - quantumBoots; // Quantum Boots Armor item, meta = damage value for charge level - - jetpack; // Jetpack item, meta = damage value for fuel level - electricJetpack; // Electric Jetpack item, meta = damage value for charge level - - batPack; // BatPack item, meta = damage value for charge level - advbatPack; // Adv.BatPack item, meta = damage value for charge level - lapPack; // LapPack item, meta = damage value for charge level - energyPack; // EnergyPack item, meta = damage value for charge level - - cfPack; // CF Pack item, meta = charges (as of v1.45) - solarHelmet; // Solar Helmet, currently not meta sensitive - staticBoots; // Static Boots, currently not meta sensitive - nightvisionGoggles; // Nightvision Goggles, meta = damage value for charge level - - // batteries - reBattery; // Empty RE Battery item, currently not meta sensitive - chargedReBattery; // RE Battery item, meta = damage value for charge level - advBattery; // Adv Batteryitem, meta = damage value for charge level - energyCrystal; // Energy Crystal item, meta = damage value for charge level - lapotronCrystal; // Lapotron Crystal item, meta = damage value for charge level - suBattery; // SU Battery item, meta = damage value for charge level - - // cables - copperCableItem; // Copper Cable item, meta sensitive - insulatedCopperCableItem; // Insulated Copper Cable item, meta sensitive - - goldCableItem; // Gold Cable item, meta sensitive - insulatedGoldCableItem; // Insulated Gold Cable item, meta sensitive - - @Deprecated - doubleInsulatedGoldCableItem; // Double Insulated Gold Cable item, meta sensitive - - ironCableItem; // Iron Cable item, meta sensitive - insulatedIronCableItem; // Insulated Iron Cable item, meta sensitive - - @Deprecated - doubleInsulatedIronCableItem; // Double Insulated Iron Cable item, meta sensitive - @Deprecated - trippleInsulatedIronCableItem; // Tripple Insulated Iron Cable item, meta sensitive - insulatedTinCableItem; - glassFiberCableItem; // Glass Fiber Cable item, meta sensitive - tinCableItem; // Tin Cable item, meta sensitive - - - detectorCableItem; // Detector Cable item, meta sensitive - splitterCableItem; // Splitter Cable item, meta sensitive - - // cells/containers (without reactor components) - - cell; // Empty Cell item, meta sensitive - lavaCell; // Lava Cell item, meta sensitive - waterCell; // Water Cell item, meta sensitive - UuMatterCell; // UUMatter Cell item, meta sensitive - CFCell; // constructionFoam Cell item, meta sensitive - - - fuelRod; // Empy Fuel Rod item, currently not meta sensitive - hydratedCoalCell; // Hydrated Coal Cell item, currently not meta sensitive - bioCell; // Bio Cell item, currently not meta sensitive - coalfuelCell; // Coalfuel Cell item, currently not meta sensitive - biofuelCell; // Biofuel Cell item, currently not meta sensitive - electrolyzedWaterCell; // Electrolyzed Water Cell item, currently not meta sensitive - airCell; // Compressed Air item, currently not meta sensitive - - fuelCan; // Empty Fuel Can item, currently not meta sensitive - filledFuelCan; // Fuel Can item, meta = fuel value (as of v1.45) - - tinCan; // Empty Tin Can item, currently not meta sensitive - filledTinCan; // Filled Tin Can item, currently not meta sensitive - - // reactor components - reactorUraniumSimple; // Uranium Cell items, meta = consumed uranium ticks - reactorUraniumDual; - reactorUraniumQuad; - - reactorCoolantSimple; - reactorCoolantTriple ; // Coolant Cell item, NBT for heat-storage, meta is 0-10000 for display - reactorCoolantSix; - - reactorPlating; // Integrated Reactor Plating item, currently not meta sensitive - reactorPlatingHeat; - reactorPlatingExplosive; - - reactorHeatSwitch; // Integrated Heat Disperser item, NBT for heat-storage, meta is 0-10000 for display - reactorHeatSwitchCore; - reactorHeatSwitchSpread; - reactorHeatSwitchDiamond; - - reactorVent; // Heat Venting component, NBT for heat-storage, meta is 0-10000 for display - reactorVentCore; - reactorVentGold; - reactorVentSpread;// Special: Does not store heat - reactorVentDiamond; - - reactorReflector; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display - reactorReflectorThick; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display - reactorCondensator; // Consumes redstone to absorb heat, NBT for storage, meta is 0-10000 for display - reactorCondensatorLap; // Consumes redstone/lapis to absorb heat, mNBT for storage, meta is 0-10000 for display - - // terraformer blueprints - terraformerBlueprint; // Empty Terraformer Blueprint item, currently not meta sensitive - cultivationTerraformerBlueprint; // Cultivation Terraformer Blueprint item, currently not meta sensitive - irrigationTerraformerBlueprint; // Irrigation Terraformer Blueprint item, currently not meta sensitive - chillingTerraformerBlueprint; // Chilling Terraformer Blueprint item, currently not meta sensitive - desertificationTerraformerBlueprint; // Desertification Terraformer Blueprint item, currently not meta sensitive - flatificatorTerraformerBlueprint; // Flatificator Terraformer Blueprint item, currently not meta sensitive - mushroomTerraformerBlueprint; // Mushroom Terraformer Blueprint item, currently not meta sensitive - - // diamond chain - coalBall; // Coal Ball item, currently not meta sensitive - compressedCoalBall; // Compressed Coal Ball item, currently not meta sensitive - coalChunk; // Coal Chunk item, currently not meta sensitive - industrialDiamond; // Industrial Diamond item, currently not meta sensitive, DEPRECATED - - // recycler chain - scrap; // Scrap item, currently not meta sensitive - scrapBox; // Scrap Box item, currently not meta sensitive - - // fuel production chain - hydratedCoalClump; // Hydrated Coal Clump item, currently not meta sensitive - plantBall; // Plant Ball item, currently not meta sensitive - compressedPlantBall; // Compressed Plant Ball item, currently not meta sensitive - - // painting - painter; // Painter item, currently not meta sensitive - - blackPainter; // Black Painter item, meta = damage value - redPainter; // Red Painter item, meta = damage value - greenPainter; // Green Painter item, meta = damage value - brownPainter; // Brown Painter item, meta = damage value - bluePainter; // Blue Painter item, meta = damage value - purplePainter; // Purple Painter item, meta = damage value - cyanPainter; // Cyan Painter item, meta = damage value - lightGreyPainter; // Light Grey Painter item, meta = damage value - darkGreyPainter; // Dark Grey Painter item, meta = damage value - pinkPainter; // Pink Painter item, meta = damage value - limePainter; // Lime Painter item, meta = damage value - yellowPainter; // Yellow Painter item, meta = damage value - cloudPainter; // Cloud Painter item, meta = damage value - magentaPainter; // Magenta Painter item, meta = damage value - orangePainter; // Orange Painter item, meta = damage value - whitePainter; // White Painter item, meta = damage value - - // explosives + related - dynamite; // Throwable Dynamite item, currently not meta sensitive - stickyDynamite; // Throwable Sticky Dynamite item, currently not meta sensitive - - remote; // Dynamite Remote item, currently not meta sensitive - - // misc intermediate recipe ingredients - electronicCircuit; // Electronic Circuit item, currently not meta sensitive - advancedCircuit; // Advanced Circuit item, currently not meta sensitive - - advancedAlloy; // Advanced Alloy item, currently not meta sensitive - - carbonFiber; // Raw Carbon Fiber item, currently not meta sensitive - carbonMesh; // Raw Carbon Mesh item, currently not meta sensitive - carbonPlate; // Carbon Plate item, currently not meta sensitive - - matter; // UUA item, currently not meta sensitive - iridiumOre; // Iridium Ore item, currently not meta sensitive - iridiumPlate; // Iridium Plate item, currently not meta sensitive - - - // Metal Plates - - platecopper; // Metal plate item, meta sensitive - platetin; // Metal plate item, meta sensitive - platebronze; // Metal plate item, meta sensitive - plategold; // Metal plate item, meta sensitive - plateiron; // Metal plate item, meta sensitive - platelead; // Metal plate item, meta sensitive - platelapi; // Metal plate item, meta sensitive - plateobsidian; // Metal plate item, meta sensitive - plateadviron; // Metal plate item, meta sensitive - - // Metal Dense Plates - denseplatecopper; // Metal dense plate item, meta sensitive - denseplatetin; // Metal dense plate item, meta sensitive - denseplatebronze; // Metal dense plate item, meta sensitive - denseplategold; // Metal dense plate item, meta sensitive - denseplateiron; // Metal dense plate item, meta sensitive - @Deprecated - denseplateadviron; // Metal dense plate item, meta sensitive - denseplatelead; // Metal dense plate item, meta sensitive - denseplatelapi; // Metal dense plate item, meta sensitive - denseplateobsidian; // Metal dense plate item, meta sensitive - - - - // upgrade modules - overclockerUpgrade; // overclocker upgrade item, meta sensitive - transformerUpgrade; // transformer upgrade item, meta sensitive - energyStorageUpgrade; // energy storage upgrade item, meta sensitive - ejectorUpgrade; // ejector upgrade item, meta sensitive - - // misc - coin; // Coin item, currently not meta sensitive - reinforcedDoor; // Reinforced Door item, currently not meta sensitive - constructionFoamPowder; // Construction Foam Powder item, currently not meta sensitive - grinPowder; // Poisonous ingrident, currently not meta sensitive - debug; // Debug item, currently not meta sensitive - boatCarbon; // Carbon Fiber Canoe item, meta sensitive - boatRubber; // Rubber Dinghy item, meta sensitive - boatRubberBroken; // Damaged Rubber Dinghy item, meta sensitive - boatElectric; // Electric Boat item, meta sensitive - - //Agriculture - cropSeed; // Crop seeds, stuff stored in NBT, don't use for crafting recipes! - cropnalyzer; // Cropnalyzer handheld device - fertilizer; // Basic IC2Item, used to provide nutrients toCropBlocks - hydratingCell; // Cell used to hydrate Crops, meta = Content, 0= Full, 9999 = Near empty - electricHoe; // Electric Hoe, Metadata indicates charge level - terraWart; // Mystic opposite of NEtherWart, cures StatusEffects, simply consumeable - weedEx; // Spraying can of WEED-EX, meta indicates usages left - - //Boozeception - mugEmpty; // Simple stone mug - coffeeBeans; // Harvested CoffeeBeans - coffeePowder; // Processed Coffee Beans, used to craft drinkable Coffee - mugCoffee; // Mug of Coffee, Meta indicates status 0 = cold, 1 = Normal, 2 = Sugar'd - hops; // Hops, harvested freshly from crop - barrel; // Carried Barrel, metadata encrypts the information about the liquid inside - blockBarrel; // Unobtainable "placed barrel", TileEntity controlling the Fermentation process - mugBooze; // Mug filled with booze, metadata encrypts the information about the liquid inside - - */ - - /** - * Get the base IC2 package name, used internally. - * - * @return IC2 package name, if unable to be determined defaults to ic2 - */ - private static String getPackage() { - Package pkg = IC2Items.class.getPackage(); - - if (pkg != null) { - String packageName = pkg.getName(); - - return packageName.substring(0, packageName.length() - ".api.item".length()); - } - - return "ic2"; - } - - private static Class Ic2Items; -} - diff --git a/src/main/java/ic2/api/item/ICustomElectricItem.java b/src/main/java/ic2/api/item/ICustomElectricItem.java deleted file mode 100644 index 9f4b1a684..000000000 --- a/src/main/java/ic2/api/item/ICustomElectricItem.java +++ /dev/null @@ -1,67 +0,0 @@ -package ic2.api.item; - -import net.minecraft.item.ItemStack; - -/** - * Provides the ability to store energy on the implementing item. - * - * This interface is a special version of IElectricItem which delegates the implementation of - * charge(), discharge() and canUse() to the implementing Item. - * - * The default implementation (when not using ICustomElectricItem) does the following: - * - store and retrieve the charge - * - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account - * - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId()) - * - update and manage the damage value for the visual charge indicator - * - * @note ICustomElectricItem must not call the ElectricItem methods charge, discharge or canUse - * - * @deprecated Use ISpecialElectricItem instead. - */ -@Deprecated -public interface ICustomElectricItem extends IElectricItem { - /** - * Charge an item with a specified amount of energy - * - * @param itemStack electric item's stack - * @param amount amount of energy to charge in EU - * @param tier tier of the charging device, has to be at least as high as the item to charge - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param simulate don't actually change the item, just determine the return value - * @return Energy transferred into the electric item - */ - public int charge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate); - - /** - * Discharge an item by a specified amount of energy - * - * @param itemStack electric item's stack - * @param amount amount of energy to charge in EU - * @param tier tier of the discharging device, has to be at least as high as the item to discharge - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param simulate don't actually discharge the item, just determine the return value - * @return Energy retrieved from the electric item - */ - public int discharge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate); - - /** - * Determine if the specified electric item has at least a specific amount of EU. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * BatPacks are not taken into account. - * - * @param itemStack electric item's stack - * @param amount minimum amount of energy required - * @return true if there's enough energy - */ - public boolean canUse(ItemStack itemStack, int amount); - - /** - * Determine whether to show the charge tool tip with NEI or other means. - * - * Return false if IC2's handler is incompatible, you want to implement your own or you don't - * want to display the charge at all. - * - * @return true to show the tool tip (x/y EU) - */ - public boolean canShowChargeToolTip(ItemStack itemStack); -} diff --git a/src/main/java/ic2/api/item/IDebuggable.java b/src/main/java/ic2/api/item/IDebuggable.java deleted file mode 100644 index b1fa66bc3..000000000 --- a/src/main/java/ic2/api/item/IDebuggable.java +++ /dev/null @@ -1,23 +0,0 @@ -package ic2.api.item; - - - -/** - * Allows a tile entity to output a debug message when the debugItem is used on it. - * Suggestions by Myrathi - */ -public abstract interface IDebuggable { - /** - * Checks if the tile entity is in a state that can be debugged. - * - * @return True if the tile entity can be debugged - */ - public abstract boolean isDebuggable(); - - /** - * Gets the debug text for the tile entity. - * - * @return The text that the debugItem should show - */ - public abstract String getDebugText(); -} diff --git a/src/main/java/ic2/api/item/IItemHudInfo.java b/src/main/java/ic2/api/item/IItemHudInfo.java deleted file mode 100644 index fe6ec0f97..000000000 --- a/src/main/java/ic2/api/item/IItemHudInfo.java +++ /dev/null @@ -1,26 +0,0 @@ -package ic2.api.item; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -public interface IItemHudInfo { - - /* - Add Info to Nano- and Quantum-Suit Helm Hud - for itemStack - - @Override - public List getHudInfo(ItemStack itemStack) { - List info = new LinkedList(); - info.add("i am a Cool Item"); - info.add("and have Cool info"); - return info; - } - - - */ - - public List getHudInfo(ItemStack itemStack); - -} diff --git a/src/main/java/ic2/api/item/IMetalArmor.java b/src/main/java/ic2/api/item/IMetalArmor.java deleted file mode 100644 index 16ffd24e5..000000000 --- a/src/main/java/ic2/api/item/IMetalArmor.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * Armor items implementing this can be considered metal armor. - * - * Currently used for determining which boots can be used to slide up a magnetic pole. - */ -public interface IMetalArmor { - /** - * Determine if the given armor piece is metal armor. - * - * @param itemstack Armor piece as worn by the player - * @param player The player - * @return Whether the armor piece is metal armor - */ - public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player); -} diff --git a/src/main/java/ic2/api/item/ITerraformingBP.java b/src/main/java/ic2/api/item/ITerraformingBP.java deleted file mode 100644 index 58f7e2fe7..000000000 --- a/src/main/java/ic2/api/item/ITerraformingBP.java +++ /dev/null @@ -1,35 +0,0 @@ -package ic2.api.item; - -import net.minecraft.world.World; - -/** - * Allows an item to act as a terraformer blueprint. - */ -public interface ITerraformingBP -{ - /** - * Get the energy consumption per operation of the blueprint. - * - * @return Energy consumption in EU - */ - public abstract int getConsume(); - - /** - * Get the maximum range of the blueprint. - * Should be a divisor of 5. - * - * @return Maximum range in blocks - */ - public abstract int getRange(); - - /** - * Perform the terraforming operation. - * - * @param world world to terraform - * @param x X position to terraform - * @param z Z position to terraform - * @param yCoord Y position of the terraformer - * @return Whether the operation was successful and the terraformer should consume energy. - */ - public abstract boolean terraform(World world, int x, int z, int yCoord); -} diff --git a/src/main/java/ic2/api/item/ItemWrapper.java b/src/main/java/ic2/api/item/ItemWrapper.java deleted file mode 100644 index 58f807340..000000000 --- a/src/main/java/ic2/api/item/ItemWrapper.java +++ /dev/null @@ -1,50 +0,0 @@ -package ic2.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; - -/** - * Wrapper for inserting interfaces into items you don't own. - * - * @author Richard - */ -public class ItemWrapper { - private static final Multimap boxableItems = ArrayListMultimap.create(); - private static final Multimap metalArmorItems = ArrayListMultimap.create(); - - public static void registerBoxable(Item item, IBoxable boxable) { - boxableItems.put(item, boxable); - } - - public static boolean canBeStoredInToolbox(ItemStack stack) { - Item item = stack.getItem(); - // use customs first to allow for overriding behavior - for (IBoxable boxable : boxableItems.get(item)) { - if (boxable.canBeStoredInToolbox(stack)) return true; - } - - if (item instanceof IBoxable && ((IBoxable) item).canBeStoredInToolbox(stack)) return true; - - return false; - } - - public static void registerMetalArmor(Item item, IMetalArmor armor) { - metalArmorItems.put(item, armor); - } - - public static boolean isMetalArmor(ItemStack stack, EntityPlayer player) { - Item item = stack.getItem(); - // use customs first to allow for overriding behavior - for (IMetalArmor metalArmor : metalArmorItems.get(item)) { - if (metalArmor.isMetalArmor(stack, player)) return true; - } - - if (item instanceof IMetalArmor && ((IMetalArmor) item).isMetalArmor(stack, player)) return true; - - return false; - } -} diff --git a/src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java b/src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java deleted file mode 100644 index ed3ea38fe..000000000 --- a/src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package ic2.api.network; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Allows a tile entity to receive network events received from clients. - */ -public interface INetworkClientTileEntityEventListener { - /** - * Called when a network event is received. - * - * @param player client which sent the event - * @param event event ID - */ - void onNetworkEvent(EntityPlayer player, int event); -} - diff --git a/src/main/java/ic2/api/network/INetworkDataProvider.java b/src/main/java/ic2/api/network/INetworkDataProvider.java deleted file mode 100644 index c3f283e5f..000000000 --- a/src/main/java/ic2/api/network/INetworkDataProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api.network; - -import java.util.List; - -/** - * Tile entities which want to synchronized specific fields between client and server have to implement this. - * - * The fields don't update themselves, a field update must be sent every time a synchronized field changes. - */ -public interface INetworkDataProvider { - /** - * Get the list of synchronized fields. - * - * @return Names of the synchronized fields - */ - List getNetworkedFields(); -} - diff --git a/src/main/java/ic2/api/network/INetworkItemEventListener.java b/src/main/java/ic2/api/network/INetworkItemEventListener.java deleted file mode 100644 index 5f3228cec..000000000 --- a/src/main/java/ic2/api/network/INetworkItemEventListener.java +++ /dev/null @@ -1,19 +0,0 @@ -package ic2.api.network; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * Allows an item to receive network events received from the server. - */ -public interface INetworkItemEventListener { - /** - * Called when a network event is received. - * - * @param itemStack item stack - * @param player player containing the item - * @param event event ID - */ - void onNetworkEvent(ItemStack stack, EntityPlayer player, int event); -} - diff --git a/src/main/java/ic2/api/network/INetworkTileEntityEventListener.java b/src/main/java/ic2/api/network/INetworkTileEntityEventListener.java deleted file mode 100644 index fbb4753c5..000000000 --- a/src/main/java/ic2/api/network/INetworkTileEntityEventListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.network; - -/** - * Allows a tile entity to receive network events received from the server. - */ -public interface INetworkTileEntityEventListener { - /** - * Called when a network event is received. - * - * @param event Event ID - */ - void onNetworkEvent(int event); -} - diff --git a/src/main/java/ic2/api/network/INetworkUpdateListener.java b/src/main/java/ic2/api/network/INetworkUpdateListener.java deleted file mode 100644 index 09414ae38..000000000 --- a/src/main/java/ic2/api/network/INetworkUpdateListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.network; - -/** - * Allows a tile entity to receive field sync updates received from the server. - */ -public interface INetworkUpdateListener { - /** - * Called when a field is synchronized. - * - * @param field field synchronized - */ - void onNetworkUpdate(String field); -} - diff --git a/src/main/java/ic2/api/network/NetworkHelper.java b/src/main/java/ic2/api/network/NetworkHelper.java deleted file mode 100644 index 5f9138d30..000000000 --- a/src/main/java/ic2/api/network/NetworkHelper.java +++ /dev/null @@ -1,194 +0,0 @@ -package ic2.api.network; - -import java.lang.reflect.Method; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -/** - * Provides methods to initiate events and synchronize tile entity fields in SMP. - * - * The methods are transparent between singleplayer and multiplayer - if a method is called in - * singleplayer, the associated callback will be locally executed. The implementation is different - * between the client and server versions of IC2. - * - * You'll usually want to use the server->client methods defined here to synchronize information - * which is needed by the clients outside the GUI, such as rendering the block, playing sounds or - * producing effects. Anything which is only visible inside the GUI should be synchronized through - * the Container class associated to the GUI in Container.updateProgressBar(). - */ -public final class NetworkHelper { - // server -> client - - - /** - * Schedule a TileEntity's field to be updated to the clients in range. - * - * The updater will query the field's value during the next update, updates happen usually - * every 2 ticks. If low latency is important use initiateTileEntityEvent instead. - * - * IC2's network updates have to get triggered every time, it doesn't continuously poll/send - * the field value. Just call updateTileEntityField after every change to a field which needs - * network synchronization. - * - * The following field data types are currently supported: - * - int, int[], short, short[], byte, byte[], long, long[] - * - float, float[], double, double[] - * - boolean, boolean[] - * - String, String[] - * - ItemStack - * - NBTBase (includes NBTTagCompound) - * - Block, Item, Achievement, Potion, Enchantment - * - ChunkCoordinates, ChunkCoordIntPair - * - TileEntity (does not sync the actual tile entity, instead looks up the tile entity by its position in the client world) - * - World (does not sync the actual world, instead looks up the world by its dimension ID) - * - * Once the update has been processed by the client, it'll call onNetworkUpdate on the client- - * side TileEntity if it implements INetworkUpdateListener. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkUpdateListener.onNetworkUpdate (if implemented by the te). - * - * @param te TileEntity to update - * @param field Name of the field to update - */ - public static void updateTileEntityField(TileEntity te, String field) { - try { - if (NetworkManager_updateTileEntityField == null) NetworkManager_updateTileEntityField = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("updateTileEntityField", TileEntity.class, String.class); - if (instance == null) instance = getInstance(); - - NetworkManager_updateTileEntityField.invoke(instance, te, field); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Immediately send an event for the specified TileEntity to the clients in range. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkTileEntityEventListener.onNetworkEvent (if implemented by the te). - * - * @param te TileEntity to notify, should implement INetworkTileEntityEventListener - * @param event Arbitrary integer to represent the event, choosing the values is up to you - * @param limitRange Limit the notification range to (currently) 20 blocks instead of the - * tracking distance if true - */ - public static void initiateTileEntityEvent(TileEntity te, int event, boolean limitRange) { - try { - if (NetworkManager_initiateTileEntityEvent == null) NetworkManager_initiateTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateTileEntityEvent", TileEntity.class, Integer.TYPE, Boolean.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateTileEntityEvent.invoke(instance, te, event, limitRange); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Immediately send an event for the specified Item to the clients in range. - * - * The item should implement INetworkItemEventListener to receive the event. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkItemEventListener.onNetworkEvent (if implemented by the item). - * - * @param player EntityPlayer holding the item - * @param itemStack ItemStack containing the item - * @param event Arbitrary integer to represent the event, choosing the values is up to you - * @param limitRange Limit the notification range to (currently) 20 blocks instead of the - * tracking distance if true - */ - public static void initiateItemEvent(EntityPlayer player, ItemStack itemStack, int event, boolean limitRange) { - try { - if (NetworkManager_initiateItemEvent == null) NetworkManager_initiateItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateItemEvent", EntityPlayer.class, ItemStack.class, Integer.TYPE, Boolean.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateItemEvent.invoke(instance, player, itemStack, event, limitRange); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - - // client -> server - - /** - * Immediately send an event for the specified TileEntity to the server. - * - * This method doesn't do anything if executed on the server. - * - * @param te TileEntity to notify, should implement INetworkClientTileEntityEventListener - * @param event Arbitrary integer to represent the event, choosing the values is up to you - */ - public static void initiateClientTileEntityEvent(TileEntity te, int event) { - try { - if (NetworkManager_initiateClientTileEntityEvent == null) NetworkManager_initiateClientTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientTileEntityEvent", TileEntity.class, Integer.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateClientTileEntityEvent.invoke(instance, te, event); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Immediately send an event for the specified Item to the clients in range. - * - * The item should implement INetworkItemEventListener to receive the event. - * - * This method doesn't do anything if executed on the server. - * - * @param itemStack ItemStack containing the item - * @param event Arbitrary integer to represent the event, choosing the values is up to you - */ - public static void initiateClientItemEvent(ItemStack itemStack, int event) { - try { - if (NetworkManager_initiateClientItemEvent == null) NetworkManager_initiateClientItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientItemEvent", ItemStack.class, Integer.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateClientItemEvent.invoke(instance, itemStack, event); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Get the base IC2 package name, used internally. - * - * @return IC2 package name, if unable to be determined defaults to ic2 - */ - private static String getPackage() { - Package pkg = NetworkHelper.class.getPackage(); - - if (pkg != null) { - String packageName = pkg.getName(); - - return packageName.substring(0, packageName.length() - ".api.network".length()); - } - - return "ic2"; - } - - /** - * Get the NetworkManager instance, used internally. - * - * @return NetworkManager instance - */ - private static Object getInstance() { - try { - return Class.forName(getPackage() + ".core.IC2").getDeclaredField("network").get(null); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - private static Object instance; - private static Method NetworkManager_updateTileEntityField; - private static Method NetworkManager_initiateTileEntityEvent; - private static Method NetworkManager_initiateItemEvent; - private static Method NetworkManager_initiateClientTileEntityEvent; - private static Method NetworkManager_initiateClientItemEvent; -} - diff --git a/src/main/java/ic2/api/network/package-info.java b/src/main/java/ic2/api/network/package-info.java deleted file mode 100644 index 25ea29e1e..000000000 --- a/src/main/java/ic2/api/network/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.network; -import cpw.mods.fml.common.API; - diff --git a/src/main/java/ic2/api/reactor/IC2Reactor.java b/src/main/java/ic2/api/reactor/IC2Reactor.java deleted file mode 100644 index 512c4ff02..000000000 --- a/src/main/java/ic2/api/reactor/IC2Reactor.java +++ /dev/null @@ -1,34 +0,0 @@ -package ic2.api.reactor; - -import java.lang.reflect.Field; - -public class IC2Reactor { - private static Field energyGeneratorNuclear; - - public static int getEUOutput() { - try { - if (energyGeneratorNuclear == null) energyGeneratorNuclear = Class.forName(getPackage() + ".core.IC2").getDeclaredField("energyGeneratorNuclear"); - - return energyGeneratorNuclear.getInt(null); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - /** - * Get the base IC2 package name, used internally. - * - * @return IC2 package name, if unable to be determined defaults to ic2 - */ - private static String getPackage() { - Package pkg = IC2Reactor.class.getPackage(); - - if (pkg != null) { - String packageName = pkg.getName(); - - return packageName.substring(0, packageName.length() - ".api.reactor".length()); - } - - return "ic2"; - } -} diff --git a/src/main/java/ic2/api/reactor/IReactor.java b/src/main/java/ic2/api/reactor/IReactor.java deleted file mode 100644 index f1d21a750..000000000 --- a/src/main/java/ic2/api/reactor/IReactor.java +++ /dev/null @@ -1,138 +0,0 @@ -package ic2.api.reactor; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -/** - * Interface implemented by the tile entity of nuclear reactors. - */ -public interface IReactor { - /** - * Get the reactor's position in the world. - * - * @return Position of the reactor - */ - public ChunkCoordinates getPosition(); - - /** - * Get the reactor's corresponding world. - * - * @return The reactor's world - */ - public World getWorld(); - - /** - * Get the reactor's heat. - * - * @return The reactor's heat - */ - public int getHeat(); - - /** - * Set the reactor's heat. - * - * @param heat reactor heat - */ - public void setHeat(int heat); - - /** - * Increase the reactor's heat. - * - * Use negative values to decrease. - * - * @param amount amount of heat to add - * @return The reactor's heat after adding the specified amount - */ - public int addHeat(int amount); - - /** - * Get the reactor's maximum heat before exploding. - * - * @return Maximum heat value - */ - public int getMaxHeat(); - - /** - * Set the reactor's stored maxHeat variable. - * Used by plating to increase the reactors MaxHeat capacity. - * Needs to be called during each cycle process. - */ - public void setMaxHeat(int newMaxHeat); - - /** - * add Heat to a EmitHeat Buffer - * for use in Reactor operation.. need to be use - * for all Componetents with self-cooling - * no more magic heat disappear - */ - - - public void addEmitHeat(int heat); - - /** - * Get's the reactor's HEM (Heat Effect Modifier) - * Basic value is 1.0F. - * Reducing the value causes a weakening/reduction of the heat-based sideeffects of reactors - * (F.e. water evaporation, melting, damaging entitys, etc) - * - * @return HEM - */ - public float getHeatEffectModifier(); - - /** - * Set's the reactor's HEM - * Needs to be called during each cycle process. - */ - public void setHeatEffectModifier(float newHEM); - - /** - * Get the reactor's energy output. - * - * @return Energy output, not multiplied by the base EU/t value - */ - public float getReactorEnergyOutput(); - - /** - * Add's the given amount of energy to the Reactor's output. - * - * @return Energy output after adding the value, not multiplied by the base EU/t value - */ - public float addOutput(float energy); - - /** - * Get the item at the specified grid coordinates. - * - * @param x X position of the item, out of bounds returns null - * @param y Y position of the item, out of bounds returns null - * @return The item or null if there is no item - */ - public ItemStack getItemAt(int x, int y); - - /** - * Set the item at the specified grid coordinates. - * - * @param x X position of the item, out of bounds is a no-op - * @param y Y position of the item, out of bounds is a no-op - * @param item The item to set. - */ - public void setItemAt(int x, int y, ItemStack item); - - /** - * Explode the reactor. - */ - public void explode(); - - /** - * Get the reactor's tick rate (game ticks per reactor tick). - * - * @return Tick rate - */ - public int getTickRate(); - - /** - * Get whether the reactor is active and supposed to produce energy - * @return Whether the reactor is active - */ - public boolean produceEnergy(); -} diff --git a/src/main/java/ic2/api/reactor/IReactorChamber.java b/src/main/java/ic2/api/reactor/IReactorChamber.java deleted file mode 100644 index 1b9f2c9f1..000000000 --- a/src/main/java/ic2/api/reactor/IReactorChamber.java +++ /dev/null @@ -1,13 +0,0 @@ -package ic2.api.reactor; - -/** - * Interface implemented by the reactor chamber tile entity. - */ -public interface IReactorChamber { - /** - * Get the chamber's reactor. - * - * @return The reactor - */ - public IReactor getReactor(); -} diff --git a/src/main/java/ic2/api/reactor/IReactorComponent.java b/src/main/java/ic2/api/reactor/IReactorComponent.java deleted file mode 100644 index 77fbacdde..000000000 --- a/src/main/java/ic2/api/reactor/IReactorComponent.java +++ /dev/null @@ -1,99 +0,0 @@ -package ic2.api.reactor; - -import net.minecraft.item.ItemStack; - -/** - * Design custom Reactor components by implementing this Interface - * Items implementing the interface will not be ejected from Reactors in their clean-up - * and can/will be interacted with by other elements, f.e. Uranium Cells. - * - * All IC2 ReactorComponents implement and use this Interface - * - */ -public interface IReactorComponent -{ - /** - * Called by reactor upon iterating through it's inventory (every cycle). - * Perform all necessary calculation/interaction here - * - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @param heatrun every Stack will cycle 2 time (true,false) first run for heat, sec for Eu calculation - */ - public void processChamber(IReactor reactor, ItemStack yourStack, int x, int y,boolean heatrun); - - /** - * Can be called by Uranium-Components who attempt to generate energy by pulsing to other components. - * Uranium-Uranium interaction (f.e.) uses this method. - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of called ItemStack - * @param pulsingStack Reference to the specific instance of pulsing ItemStack - * @param youX X-coordinate of your stack in the grid - * @param youY Y-coordinate of your stack in the grid - * @param pulseX X-coordinate of pulsing stack in the grid - * @param pulseY Y-coordinate of pulsing stack in the grid - * @param heatrun true for only create heat not EU, false for only EU not heat - * @return true if this component reacts to the pulse (and pulse is therefore meant to produce heat) - */ - public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY,boolean heatrun); - - /** - * Called by components to determine whether your component can be heated. - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return true if your component can take heat - */ - public boolean canStoreHeat(IReactor reactor, ItemStack yourStack, int x, int y); - - /** - * Called by heat-switches to determine how much heat to distribute into which direction. - * Please return the maximum capacity of your heat-containing component here. - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return Maximum heat - */ - public int getMaxHeat(IReactor reactor, ItemStack yourStack, int x, int y); - - /** - * Called by heat-switches to determine how much heat to distribute into which direction. - * Please return the current amount of heat stored in this component - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return Current Heat - */ - public int getCurrentHeat(IReactor reactor, ItemStack yourStack, int x, int y); - - /** - * Called by components to distribute heat to your component. - * Perform heating-calculations and increase your heat (dmg) level accordingly. - * This method will as well be called to REDUCE heat, by providing a negative amount. - * - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @param heat Amount of heat to be added (may be negative to subtract heat) - * @return 0 if the 'order' was accepted, return >0 to indicate the 'remaining' heat which couldn't be absorbed (and vice versa for <0) - */ - public int alterHeat(IReactor reactor, ItemStack yourStack, int x, int y, int heat); - - /** - * Called upon reactor explosion - * Alter the explosion size. - * Returning a float 0 < f < 1 will be counted as multiplier. - * Anything else will be counted as a flat addition (in case of <0 = reduction). - * - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @return your explosion modifier - */ - public float influenceExplosion(IReactor reactor, ItemStack yourStack); -} diff --git a/src/main/java/ic2/api/reactor/package-info.java b/src/main/java/ic2/api/reactor/package-info.java deleted file mode 100644 index 5194aee03..000000000 --- a/src/main/java/ic2/api/reactor/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.reactor; -import cpw.mods.fml.common.API; - diff --git a/src/main/java/ic2/api/tile/ExplosionWhitelist.java b/src/main/java/ic2/api/tile/ExplosionWhitelist.java deleted file mode 100644 index fa4a474a5..000000000 --- a/src/main/java/ic2/api/tile/ExplosionWhitelist.java +++ /dev/null @@ -1,47 +0,0 @@ -package ic2.api.tile; - -import java.util.HashSet; -import java.util.Set; - -import net.minecraft.block.Block; - -/** - * Blocks on this whitelist will not resist an explosion but won't be destroyed. - * - * The explosion code by default ignores blocks which absorb more than 1000 explosion power to - * prevent abusing personal safes, Trade-O-Mats and other blocks to serve as a cheap and - * invulnerable reactor chambers. Said blocks will not shield the explosion and won't get - * destroyed. - */ -public final class ExplosionWhitelist { - /** - * Add a block to the whitelist. - * - * @param block block to add - */ - public static void addWhitelistedBlock(Block block) { - whitelist.add(block); - } - - /** - * Remove a block from the whitelist. - * - * @param block block to remove - */ - public static void removeWhitelistedBlock(Block block) { - whitelist.remove(block); - } - - /** - * Check if a block is on the whitelist. - * - * @param block block to check if whitelisted - * @return Whether the block is whitelisted - */ - public static boolean isBlockWhitelisted(Block block) { - return whitelist.contains(block); - } - - private static Set whitelist = new HashSet(); -} - diff --git a/src/main/java/ic2/api/util/IKeyboard.java b/src/main/java/ic2/api/util/IKeyboard.java deleted file mode 100644 index ff6eaea5e..000000000 --- a/src/main/java/ic2/api/util/IKeyboard.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api.util; - -import net.minecraft.entity.player.EntityPlayer; - -public interface IKeyboard { - boolean isAltKeyDown(EntityPlayer player); - boolean isBoostKeyDown(EntityPlayer player); - boolean isForwardKeyDown(EntityPlayer player); - boolean isJumpKeyDown(EntityPlayer player); - boolean isModeSwitchKeyDown(EntityPlayer player); - boolean isSideinventoryKeyDown(EntityPlayer player); - boolean isHudModeKeyDown(EntityPlayer player); - boolean isSneakKeyDown(EntityPlayer player); -} diff --git a/src/main/java/ic2/api/util/Keys.java b/src/main/java/ic2/api/util/Keys.java deleted file mode 100644 index 84d175676..000000000 --- a/src/main/java/ic2/api/util/Keys.java +++ /dev/null @@ -1,6 +0,0 @@ -package ic2.api.util; - - -public class Keys { - public static IKeyboard instance; -} \ No newline at end of file diff --git a/src/main/java/ic2/api/util/package-info.java b/src/main/java/ic2/api/util/package-info.java deleted file mode 100644 index 4dd2d93b1..000000000 --- a/src/main/java/ic2/api/util/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.util; -import cpw.mods.fml.common.API; -