From 4efea54c7435078c1da17f0453fb7a34b64127cc Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Wed, 28 Nov 2012 10:33:34 -0500 Subject: [PATCH] v5 Pre-Release #4 *Removed extenal APIs from repo, as Mekanism no longer works in a Jenkins-based build system. *Removed Oxygen and Hydrogen tank -- made a single Storage Tank that can store any type of gas. *Updated javadocs in IStorageTank to match it's new universal state. *Fixed Gas Tank GUI not opening. *Removed Power Units and Energy Cubes/Tablets/Orbs. *Added Energy Cubes -- blocks that work as batteries when in their item form, and when placed, have all the data they had in an item form. --- .../mekanism/gui/GuiElectrolyticSeparator.png | Bin 4284 -> 4264 bytes .../resources/mekanism/textures/items.png | Bin 27353 -> 14426 bytes .../resources/mekanism/textures/terrain.png | Bin 18905 -> 19510 bytes .../api/blueprints/BlockSignature.java | 77 --- .../api/blueprints/BlueprintManager.java | 34 -- .../buildcraft/api/blueprints/BptBlock.java | 266 ---------- .../api/blueprints/BptBlockUtils.java | 87 ---- .../api/blueprints/BptSlotInfo.java | 58 --- .../api/blueprints/IBptContext.java | 53 -- .../api/blueprints/ItemSignature.java | 47 -- .../buildcraft/api/bptblocks/BptBlockBed.java | 88 ---- .../api/bptblocks/BptBlockCustomStack.java | 35 -- .../api/bptblocks/BptBlockDelegate.java | 67 --- .../api/bptblocks/BptBlockDirt.java | 43 -- .../api/bptblocks/BptBlockDoor.java | 72 --- .../api/bptblocks/BptBlockIgnore.java | 46 -- .../api/bptblocks/BptBlockIgnoreMeta.java | 35 -- .../api/bptblocks/BptBlockInventory.java | 27 - .../api/bptblocks/BptBlockLever.java | 39 -- .../api/bptblocks/BptBlockLiquid.java | 64 --- .../api/bptblocks/BptBlockPiston.java | 28 -- .../api/bptblocks/BptBlockPumpkin.java | 54 -- .../bptblocks/BptBlockRedstoneRepeater.java | 51 -- .../bptblocks/BptBlockRotateInventory.java | 26 - .../api/bptblocks/BptBlockRotateMeta.java | 85 ---- .../api/bptblocks/BptBlockSign.java | 65 --- .../api/bptblocks/BptBlockStairs.java | 54 -- .../api/bptblocks/BptBlockWallSide.java | 53 -- .../buildcraft/api/core/BuildCraftAPI.java | 48 -- .../buildcraft/api/core/IAreaProvider.java | 35 -- src/common/buildcraft/api/core/IBox.java | 30 -- src/common/buildcraft/api/core/LaserKind.java | 14 - src/common/buildcraft/api/core/Position.java | 142 ------ .../buildcraft/api/core/SafeTimeTracker.java | 44 -- .../buildcraft/api/filler/FillerManager.java | 7 - .../buildcraft/api/filler/IFillerPattern.java | 21 - .../api/filler/IFillerRegistry.java | 15 - .../api/fuels/IronEngineCoolant.java | 34 -- .../buildcraft/api/fuels/IronEngineFuel.java | 48 -- src/common/buildcraft/api/gates/Action.java | 44 -- .../buildcraft/api/gates/ActionManager.java | 85 ---- src/common/buildcraft/api/gates/IAction.java | 11 - .../buildcraft/api/gates/IActionProvider.java | 24 - .../buildcraft/api/gates/IActionReceptor.java | 17 - .../api/gates/IOverrideDefaultTriggers.java | 24 - src/common/buildcraft/api/gates/ITrigger.java | 41 -- .../api/gates/ITriggerParameter.java | 18 - .../api/gates/ITriggerProvider.java | 32 -- src/common/buildcraft/api/gates/Trigger.java | 84 ---- .../api/gates/TriggerParameter.java | 69 --- .../api/inventory/ISecuredInventory.java | 20 - .../api/inventory/ISelectiveInventory.java | 17 - .../api/inventory/ISpecialInventory.java | 26 - .../buildcraft/api/power/IPowerProvider.java | 41 -- .../buildcraft/api/power/IPowerReceptor.java | 23 - .../buildcraft/api/power/PowerFramework.java | 56 --- .../buildcraft/api/power/PowerProvider.java | 162 ------ .../api/recipes/AssemblyRecipe.java | 46 -- .../api/recipes/RefineryRecipe.java | 156 ------ .../buildcraft/api/tools/IToolPipette.java | 34 -- .../buildcraft/api/tools/IToolWrench.java | 35 -- .../api/transport/FacadeManager.java | 20 - .../api/transport/IExtractionHandler.java | 19 - .../transport/IPassiveItemContribution.java | 20 - .../buildcraft/api/transport/IPipe.java | 45 -- .../api/transport/IPipeConnection.java | 17 - .../buildcraft/api/transport/IPipeEntry.java | 25 - .../buildcraft/api/transport/IPipeTile.java | 17 - .../buildcraft/api/transport/IPipedItem.java | 104 ---- .../buildcraft/api/transport/PipeManager.java | 48 -- .../dan200/computer/api/IComputerAccess.java | 131 ----- .../dan200/computer/api/IPeripheral.java | 103 ---- .../dan200/turtle/api/ITurtleAccess.java | 144 ------ .../turtle/api/ITurtleCommandHandler.java | 20 - .../dan200/turtle/api/ITurtlePeripheral.java | 22 - .../dan200/turtle/api/ITurtleUpgrade.java | 97 ---- src/common/dan200/turtle/api/TurtleAPI.java | 73 --- src/common/dan200/turtle/api/TurtleSide.java | 18 - .../dan200/turtle/api/TurtleUpgradeType.java | 22 - src/common/dan200/turtle/api/TurtleVerb.java | 21 - src/common/ic2/api/BaseSeed.java | 56 --- src/common/ic2/api/CropCard.java | 475 ------------------ src/common/ic2/api/Crops.java | 47 -- src/common/ic2/api/Direction.java | 107 ---- src/common/ic2/api/ElectricItem.java | 128 ----- src/common/ic2/api/EnergyNet.java | 119 ----- src/common/ic2/api/ExplosionWhitelist.java | 46 -- src/common/ic2/api/IBoxable.java | 18 - src/common/ic2/api/IC2Reactor.java | 28 -- src/common/ic2/api/IElectricItem.java | 52 -- src/common/ic2/api/IEnergyAcceptor.java | 20 - src/common/ic2/api/IEnergyConductor.java | 51 -- src/common/ic2/api/IEnergyEmitter.java | 21 - src/common/ic2/api/IEnergySink.java | 23 - src/common/ic2/api/IEnergySource.java | 15 - src/common/ic2/api/IEnergyStorage.java | 27 - src/common/ic2/api/IEnergyTile.java | 18 - src/common/ic2/api/IMetalArmor.java | 20 - ...INetworkClientTileEntityEventListener.java | 17 - src/common/ic2/api/INetworkDataProvider.java | 18 - .../ic2/api/INetworkItemEventListener.java | 18 - .../api/INetworkTileEntityEventListener.java | 14 - .../ic2/api/INetworkUpdateListener.java | 14 - src/common/ic2/api/IPaintableBlock.java | 21 - src/common/ic2/api/IReactor.java | 134 ----- src/common/ic2/api/IReactorChamber.java | 13 - src/common/ic2/api/IReactorComponent.java | 97 ---- src/common/ic2/api/ITerraformingBP.java | 35 -- src/common/ic2/api/IWrenchable.java | 50 -- src/common/ic2/api/Ic2Recipes.java | 358 ------------- src/common/ic2/api/Items.java | 401 --------------- src/common/ic2/api/NetworkHelper.java | 237 --------- src/common/ic2/api/TECrop.java | 161 ------ src/common/mekanism/api/IEnergyCube.java | 43 ++ src/common/mekanism/api/IStorageTank.java | 63 ++- ...ockPowerUnit.java => BlockEnergyCube.java} | 102 ++-- src/common/mekanism/common/BlockGasTank.java | 2 +- src/common/mekanism/common/CommonProxy.java | 4 +- ...owerUnit.java => ContainerEnergyCube.java} | 6 +- .../mekanism/common/ItemBlockEnergyCube.java | 106 ++-- .../mekanism/common/ItemBlockPowerUnit.java | 53 -- .../mekanism/common/ItemHydrogenTank.java | 17 - .../mekanism/common/ItemOxygenTank.java | 17 - .../mekanism/common/ItemStorageTank.java | 122 ++++- src/common/mekanism/common/Mekanism.java | 83 ++- src/common/mekanism/common/MekanismUtils.java | 26 +- .../mekanism/common/SlotStorageTank.java | 2 +- .../TileEntityAdvancedElectricMachine.java | 2 +- .../common/TileEntityAdvancedPowerUnit.java | 9 - .../common/TileEntityBasicMachine.java | 2 +- .../common/TileEntityElectricMachine.java | 4 +- ...werUnit.java => TileEntityEnergyCube.java} | 65 ++- .../mekanism/common/TileEntityGasTank.java | 18 +- .../generators/common/BlockBioGenerator.java | 154 ------ .../generators/common/BlockGenerator.java | 34 +- .../ContainerElectrolyticSeparator.java | 14 +- .../common/ContainerHydrogenGenerator.java | 2 +- .../common/GeneratorsCommonProxy.java | 4 +- .../generators/common/ItemBlockGenerator.java | 37 ++ .../generators/common/MekanismGenerators.java | 1 + .../common/TileEntityBioGenerator.java | 4 +- .../TileEntityElectrolyticSeparator.java | 18 +- .../common/TileEntityGenerator.java | 19 +- .../common/TileEntityHeatGenerator.java | 4 +- .../common/TileEntityHydrogenGenerator.java | 10 +- .../common/TileEntitySolarGenerator.java | 4 +- .../tools/common/ToolsCommonProxy.java | 10 - .../railcraft/common/api/carts/CartBase.java | 118 ----- .../railcraft/common/api/carts/CartTools.java | 364 -------------- .../api/carts/ICartRenderInterface.java | 24 - .../common/api/carts/IEnergyTransfer.java | 82 --- .../common/api/carts/IExplosiveCart.java | 56 --- .../common/api/carts/IItemTransfer.java | 65 --- .../common/api/carts/ILinkableCart.java | 77 --- .../common/api/carts/ILinkageManager.java | 102 ---- .../common/api/carts/ILiquidTransfer.java | 54 -- .../railcraft/common/api/carts/IMinecart.java | 52 -- .../common/api/carts/TransferCartBase.java | 252 ---------- .../common/api/carts/bore/IBoreHead.java | 37 -- .../common/api/carts/bore/IMineable.java | 36 -- .../common/api/core/INetworkedObject.java | 16 - .../common/api/core/IPostConnection.java | 27 - .../common/api/core/WorldCoordinate.java | 78 --- .../common/api/core/items/ICrowbar.java | 14 - .../common/api/core/items/IItemType.java | 23 - .../common/api/core/items/IMinecartItem.java | 39 -- .../common/api/core/items/ITrackItem.java | 46 -- .../common/api/core/items/ItemRegistry.java | 94 ---- .../IBlastFurnaceCraftingManager.java | 25 - .../api/crafting/IBlastFurnaceRecipe.java | 21 - .../crafting/ICokeOvenCraftingManager.java | 24 - .../common/api/crafting/ICokeOvenRecipe.java | 20 - .../crafting/IRockCrusherCraftingManager.java | 35 -- .../api/crafting/IRockCrusherRecipe.java | 37 -- .../IRollingMachineCraftingManager.java | 24 - .../crafting/RailcraftCraftingManager.java | 16 - .../common/api/fuel/FuelManager.java | 35 -- .../common/api/signals/EnumSignalAspect.java | 155 ------ .../common/api/signals/IBlockSignal.java | 47 -- .../common/api/signals/ISignalController.java | 45 -- .../common/api/signals/ISignalReceiver.java | 43 -- .../common/api/signals/SignalTools.java | 159 ------ .../common/api/tracks/ITrackCustomPlaced.java | 29 -- .../common/api/tracks/ITrackCustomShape.java | 24 - .../common/api/tracks/ITrackEmitter.java | 22 - .../common/api/tracks/ITrackInstance.java | 123 ----- .../common/api/tracks/ITrackLockdown.java | 18 - .../common/api/tracks/ITrackPowered.java | 24 - .../common/api/tracks/ITrackReversable.java | 17 - .../common/api/tracks/ITrackSwitch.java | 21 - .../common/api/tracks/ITrackTile.java | 13 - .../common/api/tracks/RailTools.java | 175 ------- .../common/api/tracks/TrackInstanceBase.java | 385 -------------- .../common/api/tracks/TrackRegistry.java | 62 --- .../common/api/tracks/TrackSpec.java | 85 ---- .../universalelectricity/core/UEConfig.java | 50 -- .../universalelectricity/core/UELoader.java | 69 --- .../core/electricity/ElectricInfo.java | 203 -------- .../electricity/ElectricityManagerTicker.java | 45 -- .../core/electricity/ElectricityNetwork.java | 122 ----- .../core/implement/IConductor.java | 71 --- .../core/implement/IConnector.java | 21 - .../core/implement/IDisableable.java | 26 - .../core/implement/IElectricityProducer.java | 12 - .../core/implement/IItemElectric.java | 32 -- .../core/implement/IVoltage.java | 17 - .../core/vector/Region2.java | 34 -- .../core/vector/Region3.java | 129 ----- .../prefab/BlockConductor.java | 54 -- .../prefab/ItemElectric.java | 205 -------- .../prefab/RecipeHelper.java | 188 ------- .../prefab/SlotElectricItem.java | 29 -- .../prefab/UEDamageSource.java | 57 --- .../universalelectricity/prefab/UETab.java | 34 -- .../prefab/implement/IRedstoneProvider.java | 16 - .../prefab/implement/IRedstoneReceptor.java | 21 - .../prefab/implement/IRotatable.java | 33 -- .../prefab/implement/ITier.java | 25 - .../prefab/multiblock/BlockMulti.java | 98 ---- .../prefab/multiblock/IBlockActivate.java | 17 - .../prefab/multiblock/IMultiBlock.java | 30 -- .../prefab/multiblock/TileEntityMulti.java | 120 ----- .../prefab/network/ConnectionHandler.java | 88 ---- .../prefab/network/IPacketReceiver.java | 15 - .../network/ISimpleConnectionHandler.java | 13 - .../prefab/ore/OreGenBase.java | 104 ---- .../prefab/ore/OreGenReplace.java | 132 ----- .../prefab/ore/OreGenReplaceStone.java | 18 - .../prefab/ore/OreGenerator.java | 75 --- .../prefab/potion/CustomPotion.java | 41 -- .../prefab/potion/CustomPotionEffect.java | 41 -- .../prefab/tile/TileEntityAdvanced.java | 60 --- .../prefab/tile/TileEntityConductor.java | 167 ------ .../prefab/tile/TileEntityDisableable.java | 46 -- .../tile/TileEntityElectricityReceiver.java | 35 -- .../mekanism/client/ClientProxy.java | 13 +- .../{GuiPowerUnit.java => GuiEnergyCube.java} | 16 +- .../mekanism/client/ItemRenderingHandler.java | 93 ++++ .../client/BlockRenderingHandler.java | 67 ++- .../client/GeneratorsClientProxy.java | 4 +- .../tools/client/ToolsClientProxy.java | 10 +- 241 files changed, 684 insertions(+), 13395 deletions(-) delete mode 100644 src/common/buildcraft/api/blueprints/BlockSignature.java delete mode 100644 src/common/buildcraft/api/blueprints/BlueprintManager.java delete mode 100644 src/common/buildcraft/api/blueprints/BptBlock.java delete mode 100644 src/common/buildcraft/api/blueprints/BptBlockUtils.java delete mode 100644 src/common/buildcraft/api/blueprints/BptSlotInfo.java delete mode 100644 src/common/buildcraft/api/blueprints/IBptContext.java delete mode 100644 src/common/buildcraft/api/blueprints/ItemSignature.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockBed.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockCustomStack.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockDelegate.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockDirt.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockDoor.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockIgnore.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockInventory.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockLever.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockLiquid.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockPiston.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockPumpkin.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockSign.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockStairs.java delete mode 100644 src/common/buildcraft/api/bptblocks/BptBlockWallSide.java delete mode 100644 src/common/buildcraft/api/core/BuildCraftAPI.java delete mode 100644 src/common/buildcraft/api/core/IAreaProvider.java delete mode 100644 src/common/buildcraft/api/core/IBox.java delete mode 100644 src/common/buildcraft/api/core/LaserKind.java delete mode 100644 src/common/buildcraft/api/core/Position.java delete mode 100644 src/common/buildcraft/api/core/SafeTimeTracker.java delete mode 100644 src/common/buildcraft/api/filler/FillerManager.java delete mode 100644 src/common/buildcraft/api/filler/IFillerPattern.java delete mode 100644 src/common/buildcraft/api/filler/IFillerRegistry.java delete mode 100644 src/common/buildcraft/api/fuels/IronEngineCoolant.java delete mode 100644 src/common/buildcraft/api/fuels/IronEngineFuel.java delete mode 100644 src/common/buildcraft/api/gates/Action.java delete mode 100644 src/common/buildcraft/api/gates/ActionManager.java delete mode 100644 src/common/buildcraft/api/gates/IAction.java delete mode 100644 src/common/buildcraft/api/gates/IActionProvider.java delete mode 100644 src/common/buildcraft/api/gates/IActionReceptor.java delete mode 100644 src/common/buildcraft/api/gates/IOverrideDefaultTriggers.java delete mode 100644 src/common/buildcraft/api/gates/ITrigger.java delete mode 100644 src/common/buildcraft/api/gates/ITriggerParameter.java delete mode 100644 src/common/buildcraft/api/gates/ITriggerProvider.java delete mode 100644 src/common/buildcraft/api/gates/Trigger.java delete mode 100644 src/common/buildcraft/api/gates/TriggerParameter.java delete mode 100644 src/common/buildcraft/api/inventory/ISecuredInventory.java delete mode 100644 src/common/buildcraft/api/inventory/ISelectiveInventory.java delete mode 100644 src/common/buildcraft/api/inventory/ISpecialInventory.java delete mode 100644 src/common/buildcraft/api/power/IPowerProvider.java delete mode 100644 src/common/buildcraft/api/power/IPowerReceptor.java delete mode 100644 src/common/buildcraft/api/power/PowerFramework.java delete mode 100644 src/common/buildcraft/api/power/PowerProvider.java delete mode 100644 src/common/buildcraft/api/recipes/AssemblyRecipe.java delete mode 100644 src/common/buildcraft/api/recipes/RefineryRecipe.java delete mode 100644 src/common/buildcraft/api/tools/IToolPipette.java delete mode 100644 src/common/buildcraft/api/tools/IToolWrench.java delete mode 100644 src/common/buildcraft/api/transport/FacadeManager.java delete mode 100644 src/common/buildcraft/api/transport/IExtractionHandler.java delete mode 100644 src/common/buildcraft/api/transport/IPassiveItemContribution.java delete mode 100644 src/common/buildcraft/api/transport/IPipe.java delete mode 100644 src/common/buildcraft/api/transport/IPipeConnection.java delete mode 100644 src/common/buildcraft/api/transport/IPipeEntry.java delete mode 100644 src/common/buildcraft/api/transport/IPipeTile.java delete mode 100644 src/common/buildcraft/api/transport/IPipedItem.java delete mode 100644 src/common/buildcraft/api/transport/PipeManager.java delete mode 100644 src/common/dan200/computer/api/IComputerAccess.java delete mode 100644 src/common/dan200/computer/api/IPeripheral.java delete mode 100644 src/common/dan200/turtle/api/ITurtleAccess.java delete mode 100644 src/common/dan200/turtle/api/ITurtleCommandHandler.java delete mode 100644 src/common/dan200/turtle/api/ITurtlePeripheral.java delete mode 100644 src/common/dan200/turtle/api/ITurtleUpgrade.java delete mode 100644 src/common/dan200/turtle/api/TurtleAPI.java delete mode 100644 src/common/dan200/turtle/api/TurtleSide.java delete mode 100644 src/common/dan200/turtle/api/TurtleUpgradeType.java delete mode 100644 src/common/dan200/turtle/api/TurtleVerb.java delete mode 100644 src/common/ic2/api/BaseSeed.java delete mode 100644 src/common/ic2/api/CropCard.java delete mode 100644 src/common/ic2/api/Crops.java delete mode 100644 src/common/ic2/api/Direction.java delete mode 100644 src/common/ic2/api/ElectricItem.java delete mode 100644 src/common/ic2/api/EnergyNet.java delete mode 100644 src/common/ic2/api/ExplosionWhitelist.java delete mode 100644 src/common/ic2/api/IBoxable.java delete mode 100644 src/common/ic2/api/IC2Reactor.java delete mode 100644 src/common/ic2/api/IElectricItem.java delete mode 100644 src/common/ic2/api/IEnergyAcceptor.java delete mode 100644 src/common/ic2/api/IEnergyConductor.java delete mode 100644 src/common/ic2/api/IEnergyEmitter.java delete mode 100644 src/common/ic2/api/IEnergySink.java delete mode 100644 src/common/ic2/api/IEnergySource.java delete mode 100644 src/common/ic2/api/IEnergyStorage.java delete mode 100644 src/common/ic2/api/IEnergyTile.java delete mode 100644 src/common/ic2/api/IMetalArmor.java delete mode 100644 src/common/ic2/api/INetworkClientTileEntityEventListener.java delete mode 100644 src/common/ic2/api/INetworkDataProvider.java delete mode 100644 src/common/ic2/api/INetworkItemEventListener.java delete mode 100644 src/common/ic2/api/INetworkTileEntityEventListener.java delete mode 100644 src/common/ic2/api/INetworkUpdateListener.java delete mode 100644 src/common/ic2/api/IPaintableBlock.java delete mode 100644 src/common/ic2/api/IReactor.java delete mode 100644 src/common/ic2/api/IReactorChamber.java delete mode 100644 src/common/ic2/api/IReactorComponent.java delete mode 100644 src/common/ic2/api/ITerraformingBP.java delete mode 100644 src/common/ic2/api/IWrenchable.java delete mode 100644 src/common/ic2/api/Ic2Recipes.java delete mode 100644 src/common/ic2/api/Items.java delete mode 100644 src/common/ic2/api/NetworkHelper.java delete mode 100644 src/common/ic2/api/TECrop.java create mode 100644 src/common/mekanism/api/IEnergyCube.java rename src/common/mekanism/common/{BlockPowerUnit.java => BlockEnergyCube.java} (78%) rename src/common/mekanism/common/{ContainerPowerUnit.java => ContainerEnergyCube.java} (94%) delete mode 100644 src/common/mekanism/common/ItemBlockPowerUnit.java delete mode 100644 src/common/mekanism/common/ItemHydrogenTank.java delete mode 100644 src/common/mekanism/common/ItemOxygenTank.java delete mode 100644 src/common/mekanism/common/TileEntityAdvancedPowerUnit.java rename src/common/mekanism/common/{TileEntityPowerUnit.java => TileEntityEnergyCube.java} (82%) delete mode 100644 src/common/mekanism/generators/common/BlockBioGenerator.java delete mode 100644 src/common/railcraft/common/api/carts/CartBase.java delete mode 100644 src/common/railcraft/common/api/carts/CartTools.java delete mode 100644 src/common/railcraft/common/api/carts/ICartRenderInterface.java delete mode 100644 src/common/railcraft/common/api/carts/IEnergyTransfer.java delete mode 100644 src/common/railcraft/common/api/carts/IExplosiveCart.java delete mode 100644 src/common/railcraft/common/api/carts/IItemTransfer.java delete mode 100644 src/common/railcraft/common/api/carts/ILinkableCart.java delete mode 100644 src/common/railcraft/common/api/carts/ILinkageManager.java delete mode 100644 src/common/railcraft/common/api/carts/ILiquidTransfer.java delete mode 100644 src/common/railcraft/common/api/carts/IMinecart.java delete mode 100644 src/common/railcraft/common/api/carts/TransferCartBase.java delete mode 100644 src/common/railcraft/common/api/carts/bore/IBoreHead.java delete mode 100644 src/common/railcraft/common/api/carts/bore/IMineable.java delete mode 100644 src/common/railcraft/common/api/core/INetworkedObject.java delete mode 100644 src/common/railcraft/common/api/core/IPostConnection.java delete mode 100644 src/common/railcraft/common/api/core/WorldCoordinate.java delete mode 100644 src/common/railcraft/common/api/core/items/ICrowbar.java delete mode 100644 src/common/railcraft/common/api/core/items/IItemType.java delete mode 100644 src/common/railcraft/common/api/core/items/IMinecartItem.java delete mode 100644 src/common/railcraft/common/api/core/items/ITrackItem.java delete mode 100644 src/common/railcraft/common/api/core/items/ItemRegistry.java delete mode 100644 src/common/railcraft/common/api/crafting/IBlastFurnaceCraftingManager.java delete mode 100644 src/common/railcraft/common/api/crafting/IBlastFurnaceRecipe.java delete mode 100644 src/common/railcraft/common/api/crafting/ICokeOvenCraftingManager.java delete mode 100644 src/common/railcraft/common/api/crafting/ICokeOvenRecipe.java delete mode 100644 src/common/railcraft/common/api/crafting/IRockCrusherCraftingManager.java delete mode 100644 src/common/railcraft/common/api/crafting/IRockCrusherRecipe.java delete mode 100644 src/common/railcraft/common/api/crafting/IRollingMachineCraftingManager.java delete mode 100644 src/common/railcraft/common/api/crafting/RailcraftCraftingManager.java delete mode 100644 src/common/railcraft/common/api/fuel/FuelManager.java delete mode 100644 src/common/railcraft/common/api/signals/EnumSignalAspect.java delete mode 100644 src/common/railcraft/common/api/signals/IBlockSignal.java delete mode 100644 src/common/railcraft/common/api/signals/ISignalController.java delete mode 100644 src/common/railcraft/common/api/signals/ISignalReceiver.java delete mode 100644 src/common/railcraft/common/api/signals/SignalTools.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackCustomPlaced.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackCustomShape.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackEmitter.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackInstance.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackLockdown.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackPowered.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackReversable.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackSwitch.java delete mode 100644 src/common/railcraft/common/api/tracks/ITrackTile.java delete mode 100644 src/common/railcraft/common/api/tracks/RailTools.java delete mode 100644 src/common/railcraft/common/api/tracks/TrackInstanceBase.java delete mode 100644 src/common/railcraft/common/api/tracks/TrackRegistry.java delete mode 100644 src/common/railcraft/common/api/tracks/TrackSpec.java delete mode 100644 src/common/universalelectricity/core/UEConfig.java delete mode 100644 src/common/universalelectricity/core/UELoader.java delete mode 100644 src/common/universalelectricity/core/electricity/ElectricInfo.java delete mode 100644 src/common/universalelectricity/core/electricity/ElectricityManagerTicker.java delete mode 100644 src/common/universalelectricity/core/electricity/ElectricityNetwork.java delete mode 100644 src/common/universalelectricity/core/implement/IConductor.java delete mode 100644 src/common/universalelectricity/core/implement/IConnector.java delete mode 100644 src/common/universalelectricity/core/implement/IDisableable.java delete mode 100644 src/common/universalelectricity/core/implement/IElectricityProducer.java delete mode 100644 src/common/universalelectricity/core/implement/IItemElectric.java delete mode 100644 src/common/universalelectricity/core/implement/IVoltage.java delete mode 100644 src/common/universalelectricity/core/vector/Region2.java delete mode 100644 src/common/universalelectricity/core/vector/Region3.java delete mode 100644 src/common/universalelectricity/prefab/BlockConductor.java delete mode 100644 src/common/universalelectricity/prefab/ItemElectric.java delete mode 100644 src/common/universalelectricity/prefab/RecipeHelper.java delete mode 100644 src/common/universalelectricity/prefab/SlotElectricItem.java delete mode 100644 src/common/universalelectricity/prefab/UEDamageSource.java delete mode 100644 src/common/universalelectricity/prefab/UETab.java delete mode 100644 src/common/universalelectricity/prefab/implement/IRedstoneProvider.java delete mode 100644 src/common/universalelectricity/prefab/implement/IRedstoneReceptor.java delete mode 100644 src/common/universalelectricity/prefab/implement/IRotatable.java delete mode 100644 src/common/universalelectricity/prefab/implement/ITier.java delete mode 100644 src/common/universalelectricity/prefab/multiblock/BlockMulti.java delete mode 100644 src/common/universalelectricity/prefab/multiblock/IBlockActivate.java delete mode 100644 src/common/universalelectricity/prefab/multiblock/IMultiBlock.java delete mode 100644 src/common/universalelectricity/prefab/multiblock/TileEntityMulti.java delete mode 100644 src/common/universalelectricity/prefab/network/ConnectionHandler.java delete mode 100644 src/common/universalelectricity/prefab/network/IPacketReceiver.java delete mode 100644 src/common/universalelectricity/prefab/network/ISimpleConnectionHandler.java delete mode 100644 src/common/universalelectricity/prefab/ore/OreGenBase.java delete mode 100644 src/common/universalelectricity/prefab/ore/OreGenReplace.java delete mode 100644 src/common/universalelectricity/prefab/ore/OreGenReplaceStone.java delete mode 100644 src/common/universalelectricity/prefab/ore/OreGenerator.java delete mode 100644 src/common/universalelectricity/prefab/potion/CustomPotion.java delete mode 100644 src/common/universalelectricity/prefab/potion/CustomPotionEffect.java delete mode 100644 src/common/universalelectricity/prefab/tile/TileEntityAdvanced.java delete mode 100644 src/common/universalelectricity/prefab/tile/TileEntityConductor.java delete mode 100644 src/common/universalelectricity/prefab/tile/TileEntityDisableable.java delete mode 100644 src/common/universalelectricity/prefab/tile/TileEntityElectricityReceiver.java rename src/minecraft/mekanism/client/{GuiPowerUnit.java => GuiEnergyCube.java} (76%) create mode 100644 src/minecraft/mekanism/client/ItemRenderingHandler.java diff --git a/bin/minecraft/resources/mekanism/gui/GuiElectrolyticSeparator.png b/bin/minecraft/resources/mekanism/g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W^27v@V7M>4Z~HP8ob+Y@e&_tYI{n;-nD;jTT=)6_ diff --git a/bin/minecraft/resources/mekanism/textures/items.png b/bin/minecraft/resources/mekanism/textures/items.png index d8b68eb147ed51c12dbe25d3086b6a0201b77c02..63b445fdcf9a055225b7bad2a445a672dba33298 100644 GIT binary patch literal 14426 zcmeHuc{r4P^!J#oZ9<{MC`!9%5gOxpDk?=Kk-a>qY!OB?#?XeyJRU-XN+H{j7~2?? zQifz5+nBO5X2v#Vzwh^^_xH#9|9f5Ub-h>rn3?;0=f2N5-|so+^Eqe4Ua+=Yw|dKJ z7!0=V%;}StU@$oJ77mk_gFlCoY^haYFk-P=MD>Ur!k9n9@T#M!>-3 zjb^a{mtL!)v>hy?AAcs=**aBgY$^UCdnV}(>#XXVsop)hqb5eNZ#CowrYZ|;uu(>` zVkz^!Rf?yNZ(ApO9ox6m@cxW#^qzt_TwW_Od%6fkywN?4RhfTci%wL+1<*BSh zHekJ^L&3xiw#RO_Y4G2qiQCLyd$FalC5J)lr6%S;D zEY7&xcMv^)Q|(cu7(29g>2iH6idM0>b=IoXjaYr=8eWD^5O##a!w?r2-~NXS9-6Rp zb1U9BBs(O7ZNHtj=Dg@uhyix1dRaSn2Q%%f&M{huw{rPwwMfnt{`+2!$;AAxwl{xX z`}yH4uHczldf=7u2Xtz=u$f=ryr9M)b%x?FE>+F&wgp2+KDgr!gwq7_sY~}srCPxP4Acq zmQ}yoi>foxAD7)a;L>&JdSy<7<>bkeI@YTDuXn#aYx?>^mSJ)u+2ZK&9fn^YJp4qx zX0Y9+L)n*p*O)NU^dSD78hQV#i*HPuh_@-<${bL(eNtk?_41j68r~|eOO1LnX5_6t zn0#0-vpUGnWYeBb+%E1yolVGPRTJwA^I~({u9%D8`#4*Ktpwmvda2dkMID4!A;#U zk5gVY&xU?f2-DF-I!kr#SjP5bX5QPQ2@LG-umae z<*RiuOm98dY?`Z!+k@LH*@e@?=}XQ%4!&BmU83vqv_A2GjBzc8oV}wLOLV)YLVxU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q?V6!0a>%`u0oXT zjt$Rrf;XTH{%`8eq&4TMKc54hHQ_Tj;FT^B)*Q;IEO!M9zh$xgBPu~R zxCHfSI6~1=#DkklnYNy|sG%bU3m3(3cgeGTsps z9@+I(oAo4za|J<<`2aL+wjo7k&BjJRm3M0mp&UU)&Ai!IYb@J%$4M>tlLPbj492%U zc5ZN3_niZ(86RPDZGnKyqwcx7Ld)+)FIgHc~kWQtjB70Q9h;3#ljH*)8B zN)A1sCvb;8I-A$`*E#~C_uriz+CM?Plc^vTtigv)V)1-R_g}<(m;~ucK7cqaOM9)3 zE##_=&aE=Z`Bg&cBO|&rI5#64kS)0#t@K%^!o1JB0xw>ld!-63jkO#gjtl}P#KK5 z3;6LT5X(0GS)~@hz^3Hd$Omze?+^LYMxS4-RUNOB$?XT+_aFK!3sPuMzu;ajj8m+P z+uDv3xb9aT9vo*EGFeu&MI61&o4wsb84P@EM$Tnsjd<8mK9(Kbe>7HoC$<3SSEwCQ z=xs)$y})T0P@W%jj{jWqdN7Ir9|E%)GI?D_&FZiPmm{Bp4X9Ut&;Bv3y=?6zwef+T zOwZDb&C7|SZ5iLeKXpF%)~}Ni z3~@i}C%=APtlF|&>6uCp@6n`sp)_XagVXyhS3mvM+{Nfw8!J0OfjhGf*Bp_rltH)D zh^$LFUIm0v4Jy|qEaYkqV{X;kg23i;yAWf~oR1#<8QBoXA1lurp~)8cx(jSi$8TC{ b>*bzvg&pFg`|u~L5XX+5I#P1z{LTLZNAm}` diff --git a/bin/minecraft/resources/mekanism/textures/terrain.png b/bin/minecraft/resources/mekanism/textures/terrain.png index 5f300ca90e6e42f976f5ae891e7ed99160efde03..9297cfd947d8626504b8bc75f3464e444eba70ea 100755 GIT binary patch literal 19510 zcmeIadpOho`v<`+l$fnrpMyeLtV~^M2g-^YOT^MOj;#ZrQYZ z69@#_Vs`n$H4sQj@~0GN!+OaJC#YKh0!bhAG%>L@Gci%Oe&Tc2^MN}EbY@$)9mQwJ zcE{N$pKBRPFm(sh$mn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src/common/buildcraft/api/blueprints/BlockSignature.java b/src/common/buildcraft/api/blueprints/BlockSignature.java deleted file mode 100644 index 80bcef49c..000000000 --- a/src/common/buildcraft/api/blueprints/BlockSignature.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.blueprints; - -public class BlockSignature { - - public String blockClassName; - public String tileClassName; - public String blockName; - public String mod; - public String modVersion; - public String customField; - - public BlockSignature(String str) { - String[] values = str.split("/"); - - int i = 0; - - if (values[0].equals("#B")) { - i++; - } - - blockClassName = values[i]; - tileClassName = values[i + 1]; - blockName = values[i + 2]; - mod = values[i + 3]; - modVersion = values[i + 4]; - customField = values[i + 5]; - - replaceNullWithStar(); - - } - - public BlockSignature() { - replaceNullWithStar(); - } - - @Override - public String toString() { - replaceNullWithStar(); - - return "#B/" + blockClassName + "/" + tileClassName + "/" + blockName + "/" + mod + "/" + modVersion + "/" + customField; - } - - public void replaceNullWithStar() { - if (blockClassName == null) { - blockClassName = "*"; - } - - if (tileClassName == null) { - tileClassName = "*"; - } - - if (blockName == null) { - blockName = "*"; - } - - if (mod == null) { - mod = "*"; - } - - if (modVersion == null) { - modVersion = "*"; - } - - if (customField == null) { - customField = "*"; - } - } -} \ No newline at end of file diff --git a/src/common/buildcraft/api/blueprints/BlueprintManager.java b/src/common/buildcraft/api/blueprints/BlueprintManager.java deleted file mode 100644 index 134c20e78..000000000 --- a/src/common/buildcraft/api/blueprints/BlueprintManager.java +++ /dev/null @@ -1,34 +0,0 @@ -package buildcraft.api.blueprints; - -import buildcraft.api.core.BuildCraftAPI; -import net.minecraft.src.Block; -import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; - -public class BlueprintManager { - - public static BptBlock[] blockBptProps = new BptBlock[Block.blocksList.length]; - - public static ItemSignature getItemSignature(Item item) { - ItemSignature sig = new ItemSignature(); - - if (item.shiftedIndex >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) { - sig.itemClassName = item.getClass().getSimpleName(); - } - - sig.itemName = item.getItemNameIS(new ItemStack(item)); - - return sig; - } - - public static BlockSignature getBlockSignature(Block block) { - return BlueprintManager.blockBptProps[0].getSignature(block); - } - - static { - // Initialize defaults for block properties. - for (int i = 0; i < BlueprintManager.blockBptProps.length; ++i) { - new BptBlock(i); - } - } -} diff --git a/src/common/buildcraft/api/blueprints/BptBlock.java b/src/common/buildcraft/api/blueprints/BptBlock.java deleted file mode 100644 index d813b087a..000000000 --- a/src/common/buildcraft/api/blueprints/BptBlock.java +++ /dev/null @@ -1,266 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.blueprints; - -import java.util.ArrayList; -import java.util.LinkedList; - -import buildcraft.api.core.BuildCraftAPI; - -import net.minecraft.src.Block; -import net.minecraft.src.BlockContainer; -import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; -import net.minecraft.src.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. - */ -public class BptBlock { - - public final int blockId; - - public BptBlock(int blockId) { - this.blockId = blockId; - - BlueprintManager.blockBptProps[blockId] = this; - } - - /** - * Returns the requirements needed to build this block. When the - * requirements are met, they will be removed all at once from the builder, - * before calling buildBlock. - */ - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if (slot.blockId != 0) { - if (slot.storedRequirements.size() != 0) { - requirements.addAll(slot.storedRequirements); - } else { - requirements.add(new ItemStack(slot.blockId, 1, slot.meta)); - } - } - } - - /** - * This is called each time an item matches a reqquirement, that is: (req id - * == stack id) for damageable items (req id == stack id && req dmg == stack - * dmg) for other items by default, it will increase damage of damageable - * items by the amount of damage of the requirement, and remove the intended - * amount of non damageable item. - * - * Client may override this behavior for default items. Note that this - * subprogram may be called twice with the same parameters, once with a copy - * of requirements and stack to check if the entire requirements can be - * fullfilled, and once with the real inventory. Implementer is responsible - * for updating req (with the remaining requirements if any) and stack - * (after usage) - * - * returns: what was used (similer to req, but created from stack, so that any NBT based differences are drawn from the correct source) - */ - public ItemStack useItem(BptSlotInfo slot, IBptContext context, ItemStack req, ItemStack stack) { - ItemStack result = stack.copy(); - if (stack.isItemStackDamageable()) { - if (req.getItemDamage() + stack.getItemDamage() <= stack.getMaxDamage()) { - stack.setItemDamage(req.getItemDamage() + stack.getItemDamage()); - result.setItemDamage(req.getItemDamage()); - req.stackSize = 0; - } - - if (stack.getItemDamage() >= stack.getMaxDamage()) { - stack.stackSize = 0; - } - } else { - if (stack.stackSize >= req.stackSize) { - result.stackSize = req.stackSize; - stack.stackSize -= req.stackSize; - req.stackSize = 0; - } else { - req.stackSize -= stack.stackSize; - stack.stackSize = 0; - } - } - - if (stack.stackSize == 0 && stack.getItem().getContainerItem() != null) { - Item container = stack.getItem().getContainerItem(); - - stack.itemID = container.shiftedIndex; - stack.stackSize = 1; - stack.setItemDamage(0); - } - return result; - } - - /** - * Return true if the block on the world correspond to the block stored in - * the blueprint at the location given by the slot. By default, this - * subprogram is permissive and doesn't take into account metadata. - * - * Added metadata sensitivity //Krapht - */ - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) - && slot.meta == context.world().getBlockMetadata(slot.x, slot.y, slot.z); - } - - /** - * Perform a 90 degree rotation to the slot. - */ - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - /** - * Places the block in the world, at the location specified in the slot. - */ - public void buildBlock(BptSlotInfo slot, IBptContext context) { - // Meta needs to be specified twice, depending on the block behavior - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta); - - if (Block.blocksList[slot.blockId] instanceof BlockContainer) { - TileEntity tile = context.world().getBlockTileEntity(slot.x, slot.y, slot.z); - - slot.cpt.setInteger("x", slot.x); - slot.cpt.setInteger("y", slot.y); - slot.cpt.setInteger("z", slot.z); - - if (tile != null) { - tile.readFromNBT(slot.cpt); - } - } - } - - /** - * Return true if the block should not be placed to the world. Requirements - * will not be asked on such a block, and building will not be called. - */ - public boolean ignoreBuilding(BptSlotInfo slot) { - return false; - } - - /** - * Initializes a slot from the blueprint according to an objet placed on {x, - * y, z} on the world. This typically means adding entries in slot.cpt. Note - * that "id" and "meta" will be set automatically, corresponding to the - * block id and meta. - * - * By default, if the block is a BlockContainer, tile information will be to - * save / load the block. - */ - public void initializeFromWorld(BptSlotInfo slot, IBptContext context, int x, int y, int z) { - if (Block.blocksList[slot.blockId] instanceof BlockContainer) { - TileEntity tile = context.world().getBlockTileEntity(x, y, z); - - if (tile != null) { - tile.writeToNBT(slot.cpt); - } - } - - if (Block.blocksList[slot.blockId] != null) { - ArrayList req = Block.blocksList[slot.blockId].getBlockDropped(context.world(), x, y, z, context.world() - .getBlockMetadata(x, y, z), 0); - - if (req != null) { - slot.storedRequirements.addAll(req); - } - } - } - - /** - * Called on a block when the blueprint has finished to place all the - * blocks. This may be useful to adjust variable depending on surrounding - * blocks that may not be there already at initial building. - */ - public void postProcessing(BptSlotInfo slot, IBptContext context) { - - } - - /** - * By default, block class name, block tile name and block name are used to - * define block signature. Overriding this subprogram may allow to replace - * some of these with stars, specify the mod that this block kind is coming - * from or add custom data to the signature. - */ - public BlockSignature getSignature(Block block) { - BlockSignature sig = new BlockSignature(); - - if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) { - sig.blockClassName = block.getClass().getSimpleName(); - - if (block instanceof BlockContainer) { - //TODO: Try to see if we can get a world instance to call with instead of null - TileEntity tile = ((BlockContainer) block).createNewTileEntity(null); - - if (tile != null) { - sig.tileClassName = tile.getClass().getSimpleName(); - } - } - } - - sig.blockName = block.getBlockName(); - 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/common/buildcraft/api/blueprints/BptBlockUtils.java b/src/common/buildcraft/api/blueprints/BptBlockUtils.java deleted file mode 100644 index eed623371..000000000 --- a/src/common/buildcraft/api/blueprints/BptBlockUtils.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.blueprints; - -import java.util.LinkedList; - - -import net.minecraft.src.IInventory; -import net.minecraft.src.ItemStack; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.NBTTagList; - -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); - } - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/blueprints/BptSlotInfo.java b/src/common/buildcraft/api/blueprints/BptSlotInfo.java deleted file mode 100644 index 8841003d4..000000000 --- a/src/common/buildcraft/api/blueprints/BptSlotInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.blueprints; - -import java.util.LinkedList; - -import net.minecraft.src.ItemStack; -import net.minecraft.src.NBTTagCompound; - -/** - * This class records a slot, either from a blueprint or from a block placed in - * the world. - */ -public class BptSlotInfo { - - public int blockId = 0; - public int meta = 0; - public int x; - public int y; - public int z; - - /** - * This field contains requirements for a given block when stored in the - * blueprint. Modders can either rely on this list or compute their own int - * BptBlock. - */ - public LinkedList storedRequirements = new LinkedList(); - - /** - * This tree contains additional data to be stored in the blueprint. By - * default, it will be initialized from BptBlock.initializeFromWorld with - * the standard readNBT function of the corresponding tile (if any) and will - * be loaded from BptBlock.buildBlock using the standard writeNBT function. - */ - public NBTTagCompound cpt = new NBTTagCompound(); - - @Override - public BptSlotInfo clone() { - BptSlotInfo obj = new BptSlotInfo(); - - obj.x = x; - obj.y = y; - obj.z = z; - obj.blockId = blockId; - obj.meta = meta; - obj.cpt = (NBTTagCompound) cpt.copy(); - - return obj; - } - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/blueprints/IBptContext.java b/src/common/buildcraft/api/blueprints/IBptContext.java deleted file mode 100644 index 65e553f89..000000000 --- a/src/common/buildcraft/api/blueprints/IBptContext.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.blueprints; - -import buildcraft.api.core.IBox; -import buildcraft.api.core.Position; -import net.minecraft.src.ItemStack; -import net.minecraft.src.World; - -/** - * This interface provide contextual information when building or initializing - * blueprint slots. - */ -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/common/buildcraft/api/blueprints/ItemSignature.java b/src/common/buildcraft/api/blueprints/ItemSignature.java deleted file mode 100644 index 8de52fa2d..000000000 --- a/src/common/buildcraft/api/blueprints/ItemSignature.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.blueprints; - -public class 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 = "*"; - } - } -} \ No newline at end of file diff --git a/src/common/buildcraft/api/bptblocks/BptBlockBed.java b/src/common/buildcraft/api/bptblocks/BptBlockBed.java deleted file mode 100644 index 0c5236ab1..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockBed.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; - -public class BptBlockBed extends BptBlock { - - public BptBlockBed(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if ((slot.meta & 8) == 0) { - requirements.add(new ItemStack(Item.bed)); - } - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int orientation = (slot.meta & 7); - int others = slot.meta - orientation; - - switch (orientation) { - case 0: - slot.meta = 1 + others; - break; - case 1: - slot.meta = 2 + others; - break; - case 2: - slot.meta = 3 + others; - break; - case 3: - slot.meta = 0 + others; - break; - } - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - if ((slot.meta & 8) != 0) { - return; - } - - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); - - 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().setBlockAndMetadataWithNotify(x2, slot.y, z2, slot.blockId, slot.meta + 8); - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return (slot.meta & 8) != 0; - } -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockCustomStack.java b/src/common/buildcraft/api/bptblocks/BptBlockCustomStack.java deleted file mode 100644 index 49aef191b..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockCustomStack.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -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/common/buildcraft/api/bptblocks/BptBlockDelegate.java b/src/common/buildcraft/api/bptblocks/BptBlockDelegate.java deleted file mode 100644 index b103b221b..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockDelegate.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BlueprintManager; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -public class BptBlockDelegate extends BptBlock { - - final int delegateTo; - - public BptBlockDelegate(int blockId, int delegateTo) { - super(blockId); - - this.delegateTo = delegateTo; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - BptSlotInfo newSlot = slot.clone(); - slot.blockId = delegateTo; - - if (BlueprintManager.blockBptProps[delegateTo] != null) { - BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements); - } else { - super.addRequirements(newSlot, context, requirements); - } - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - BptSlotInfo newSlot = slot.clone(); - slot.blockId = delegateTo; - - if (BlueprintManager.blockBptProps[delegateTo] != null) { - return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context); - } else { - return super.isValid(newSlot, context); - } - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - BptSlotInfo newSlot = slot.clone(); - slot.blockId = delegateTo; - - if (BlueprintManager.blockBptProps[delegateTo] != null) { - BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context); - } else { - super.rotateLeft(newSlot, context); - } - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockDirt.java b/src/common/buildcraft/api/bptblocks/BptBlockDirt.java deleted file mode 100644 index f79e89f70..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockDirt.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.Block; -import net.minecraft.src.ItemStack; - -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().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, Block.dirt.blockID, slot.meta); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - int id = context.world().getBlockId(slot.x, slot.y, slot.z); - - return id == Block.dirt.blockID || id == Block.grass.blockID || id == Block.tilledField.blockID; - } -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockDoor.java b/src/common/buildcraft/api/bptblocks/BptBlockDoor.java deleted file mode 100644 index f1618f377..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockDoor.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -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().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, slot.meta); - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8); - - context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8); - context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta); - - } -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockIgnore.java b/src/common/buildcraft/api/bptblocks/BptBlockIgnore.java deleted file mode 100644 index 3a7eeacef..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockIgnore.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -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/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java b/src/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java deleted file mode 100644 index e7ceda167..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockIgnoreMeta.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -public class BptBlockIgnoreMeta extends BptBlock { - - public BptBlockIgnoreMeta(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockInventory.java b/src/common/buildcraft/api/bptblocks/BptBlockInventory.java deleted file mode 100644 index 56dfae583..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockInventory.java +++ /dev/null @@ -1,27 +0,0 @@ -package buildcraft.api.bptblocks; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import net.minecraft.src.IInventory; - -public class BptBlockInventory extends BptBlock { - - public BptBlockInventory(int blockId) { - super(blockId); - - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - super.buildBlock(slot, context); - - IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); - - for (int i = 0; i < inv.getSizeInventory(); ++i) { - inv.setInventorySlotContents(i, null); - } - - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockLever.java b/src/common/buildcraft/api/bptblocks/BptBlockLever.java deleted file mode 100644 index 40c541f09..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockLever.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -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/common/buildcraft/api/bptblocks/BptBlockLiquid.java b/src/common/buildcraft/api/bptblocks/BptBlockLiquid.java deleted file mode 100644 index 9095619c2..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockLiquid.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -public class BptBlockLiquid extends BptBlock { - - private final ItemStack bucketStack; - - public BptBlockLiquid(int blockId, ItemStack bucketStack) { - super(blockId); - - this.bucketStack = bucketStack; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - if (slot.meta == 0) { - requirements.add(bucketStack.copy()); - } - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - if (slot.meta == 0) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z) - && context.world().getBlockMetadata(slot.x, slot.y, slot.z) == 0; - } else { - return true; - } - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - - } - - @Override - public boolean ignoreBuilding(BptSlotInfo slot) { - return slot.meta != 0; - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - if (slot.meta == 0) { - context.world().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, 0); - } - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockPiston.java b/src/common/buildcraft/api/bptblocks/BptBlockPiston.java deleted file mode 100644 index f9021a35d..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockPiston.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -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().setBlockAndMetadataWithNotify(slot.x, slot.y, slot.z, slot.blockId, meta); - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockPumpkin.java b/src/common/buildcraft/api/bptblocks/BptBlockPumpkin.java deleted file mode 100644 index 1d4329052..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockPumpkin.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -public class BptBlockPumpkin extends BptBlock { - - public BptBlockPumpkin(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - switch (slot.meta) { - case 0: - slot.meta = 1; - break; - case 1: - slot.meta = 2; - break; - case 2: - slot.meta = 3; - break; - case 3: - slot.meta = 0; - break; - } - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java b/src/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java deleted file mode 100644 index 647629cd6..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockRedstoneRepeater.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; - -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/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java b/src/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java deleted file mode 100644 index 22aec6af2..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockRotateInventory.java +++ /dev/null @@ -1,26 +0,0 @@ -package buildcraft.api.bptblocks; - -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; -import net.minecraft.src.IInventory; - -public class BptBlockRotateInventory extends BptBlockRotateMeta { - - public BptBlockRotateInventory(int blockId, int[] rotations, boolean rotateForward) { - super(blockId, rotations, rotateForward); - - } - - @Override - public void buildBlock(BptSlotInfo slot, IBptContext context) { - super.buildBlock(slot, context); - - IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z); - - for (int i = 0; i < inv.getSizeInventory(); ++i) { - inv.setInventorySlotContents(i, null); - } - - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java b/src/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java deleted file mode 100644 index 85bb4cdb9..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockRotateMeta.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -public class BptBlockRotateMeta extends BptBlock { - - int[] rot; - boolean rotateForward; - - int infoMask = 0; - - public BptBlockRotateMeta(int blockId, int[] rotations, boolean rotateForward) { - super(blockId); - - rot = rotations; - - for (int i = 0; i < rot.length; ++i) { - if (rot[i] < 4) { - infoMask = (infoMask < 3 ? 3 : infoMask); - } else if (rot[i] < 8) { - infoMask = (infoMask < 7 ? 7 : infoMask); - } else if (rot[i] < 16) { - infoMask = (infoMask < 15 ? 15 : infoMask); - } - } - - this.rotateForward = rotateForward; - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - int pos = slot.meta & infoMask; - int others = slot.meta - pos; - - if (rotateForward) { - if (pos == rot[0]) { - pos = rot[1]; - } else if (pos == rot[1]) { - pos = rot[2]; - } else if (pos == rot[2]) { - pos = rot[3]; - } else if (pos == rot[3]) { - pos = rot[0]; - } - } else { - if (pos == rot[0]) { - pos = rot[3]; - } else if (pos == rot[1]) { - pos = rot[2]; - } else if (pos == rot[2]) { - pos = rot[0]; - } else if (pos == rot[3]) { - pos = rot[1]; - } - } - - slot.meta = pos + others; - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockSign.java b/src/common/buildcraft/api/bptblocks/BptBlockSign.java deleted file mode 100644 index 9cf80e3b3..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockSign.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BlockSignature; -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.Block; -import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; - -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; - } - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/bptblocks/BptBlockStairs.java b/src/common/buildcraft/api/bptblocks/BptBlockStairs.java deleted file mode 100644 index 89c3016de..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockStairs.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -public class BptBlockStairs extends BptBlock { - - public BptBlockStairs(int blockId) { - super(blockId); - } - - @Override - public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList requirements) { - requirements.add(new ItemStack(slot.blockId, 1, 0)); - } - - @Override - public boolean isValid(BptSlotInfo slot, IBptContext context) { - return slot.blockId == context.world().getBlockId(slot.x, slot.y, slot.z); - } - - @Override - public void rotateLeft(BptSlotInfo slot, IBptContext context) { - switch (slot.meta) { - case 0: - slot.meta = 2; - break; - case 1: - slot.meta = 3; - break; - case 2: - slot.meta = 1; - break; - case 3: - slot.meta = 0; - break; - } - } - -} diff --git a/src/common/buildcraft/api/bptblocks/BptBlockWallSide.java b/src/common/buildcraft/api/bptblocks/BptBlockWallSide.java deleted file mode 100644 index b85a70f93..000000000 --- a/src/common/buildcraft/api/bptblocks/BptBlockWallSide.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.bptblocks; - -import java.util.LinkedList; - -import buildcraft.api.blueprints.BptBlock; -import buildcraft.api.blueprints.BptSlotInfo; -import buildcraft.api.blueprints.IBptContext; - -import net.minecraft.src.ItemStack; - -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/common/buildcraft/api/core/BuildCraftAPI.java b/src/common/buildcraft/api/core/BuildCraftAPI.java deleted file mode 100644 index 28655581d..000000000 --- a/src/common/buildcraft/api/core/BuildCraftAPI.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.core; - -import net.minecraft.src.Block; -import net.minecraft.src.World; - -public class BuildCraftAPI { - - @Deprecated - // To be removed, see LiquidContainerRegistry - public static final int BUCKET_VOLUME = 1000; - public static final int LAST_ORIGINAL_BLOCK = 122; - public static final int LAST_ORIGINAL_ITEM = 126; - - public static final boolean[] softBlocks = new boolean[Block.blocksList.length]; - - @Deprecated - // To be removed - public static boolean softBlock(int blockId) { - return blockId == 0 || softBlocks[blockId] || Block.blocksList[blockId] == null; - } - - @Deprecated - // To be removed - public static boolean unbreakableBlock(int blockId) { - return blockId == Block.bedrock.blockID || blockId == Block.lavaStill.blockID || blockId == Block.lavaMoving.blockID; - } - - @Deprecated - // To be removed - public static void breakBlock(World world, int x, int y, int z) { - int blockId = world.getBlockId(x, y, z); - - if (blockId != 0) { - Block.blocksList[blockId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); - } - - world.setBlockWithNotify(x, y, z, 0); - } -} diff --git a/src/common/buildcraft/api/core/IAreaProvider.java b/src/common/buildcraft/api/core/IAreaProvider.java deleted file mode 100644 index 71dbb760e..000000000 --- a/src/common/buildcraft/api/core/IAreaProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.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/common/buildcraft/api/core/IBox.java b/src/common/buildcraft/api/core/IBox.java deleted file mode 100644 index 1fd80511a..000000000 --- a/src/common/buildcraft/api/core/IBox.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.core; - -import net.minecraft.src.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/common/buildcraft/api/core/LaserKind.java b/src/common/buildcraft/api/core/LaserKind.java deleted file mode 100644 index 24e66dba1..000000000 --- a/src/common/buildcraft/api/core/LaserKind.java +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.core; - -public enum LaserKind { - Red, Blue, Stripes -} diff --git a/src/common/buildcraft/api/core/Position.java b/src/common/buildcraft/api/core/Position.java deleted file mode 100644 index 7b22d81c7..000000000 --- a/src/common/buildcraft/api/core/Position.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.core; - -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.TileEntity; -import net.minecraftforge.common.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); - } - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/core/SafeTimeTracker.java b/src/common/buildcraft/api/core/SafeTimeTracker.java deleted file mode 100644 index b5cf26494..000000000 --- a/src/common/buildcraft/api/core/SafeTimeTracker.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.core; - -import net.minecraft.src.World; - -public class SafeTimeTracker { - - private long lastMark = 0; - - /** - * Return true if a given delay has passed since last time marked was called - * successfully. - */ - public boolean markTimeIfDelay(World world, long delay) { - if (world == null) { - return false; - } - - long currentTime = world.getWorldTime(); - - if (currentTime < lastMark) { - lastMark = currentTime; - return false; - } else if (lastMark + delay <= currentTime) { - lastMark = world.getWorldTime(); - return true; - } else { - return false; - } - - } - - public void markTime(World world) { - lastMark = world.getWorldTime(); - } -} diff --git a/src/common/buildcraft/api/filler/FillerManager.java b/src/common/buildcraft/api/filler/FillerManager.java deleted file mode 100644 index ae104c59d..000000000 --- a/src/common/buildcraft/api/filler/FillerManager.java +++ /dev/null @@ -1,7 +0,0 @@ -package buildcraft.api.filler; - -public class FillerManager { - - public static IFillerRegistry registry; - -} diff --git a/src/common/buildcraft/api/filler/IFillerPattern.java b/src/common/buildcraft/api/filler/IFillerPattern.java deleted file mode 100644 index f3e5e7c48..000000000 --- a/src/common/buildcraft/api/filler/IFillerPattern.java +++ /dev/null @@ -1,21 +0,0 @@ -package buildcraft.api.filler; - -import buildcraft.api.core.IBox; -import net.minecraft.src.ItemStack; -import net.minecraft.src.TileEntity; - -public interface IFillerPattern { - - public int getId(); - - public void setId(int id); - - public boolean iteratePattern(TileEntity tile, IBox box, ItemStack stackToPlace); - - public String getTextureFile(); - - public int getTextureIndex(); - - public String getName(); - -} diff --git a/src/common/buildcraft/api/filler/IFillerRegistry.java b/src/common/buildcraft/api/filler/IFillerRegistry.java deleted file mode 100644 index f54908b12..000000000 --- a/src/common/buildcraft/api/filler/IFillerRegistry.java +++ /dev/null @@ -1,15 +0,0 @@ -package buildcraft.api.filler; - -import net.minecraft.src.IInventory; - -public interface IFillerRegistry { - - public void addRecipe(IFillerPattern pattern, Object aobj[]); - - public IFillerPattern findMatchingRecipe(IInventory inventorycrafting); - - public int getPatternNumber(IFillerPattern pattern); - - public IFillerPattern getPattern(int n); - -} diff --git a/src/common/buildcraft/api/fuels/IronEngineCoolant.java b/src/common/buildcraft/api/fuels/IronEngineCoolant.java deleted file mode 100644 index 0675a2d48..000000000 --- a/src/common/buildcraft/api/fuels/IronEngineCoolant.java +++ /dev/null @@ -1,34 +0,0 @@ -package buildcraft.api.fuels; - -import java.util.LinkedList; - -import net.minecraftforge.liquids.LiquidStack; - - - -public class IronEngineCoolant { - - public static LinkedList coolants = new LinkedList(); - - public static IronEngineCoolant getCoolantForLiquid(LiquidStack liquid) { - if(liquid == null) - return null; - if(liquid.itemID <= 0) - return null; - - for(IronEngineCoolant coolant : coolants) - if(coolant.liquid.isLiquidEqual(liquid)) - return coolant; - - return null; - } - - public final LiquidStack liquid; - public final float coolingPerUnit; - - public IronEngineCoolant(LiquidStack liquid, float coolingPerUnit) { - this.liquid = liquid; - this.coolingPerUnit = coolingPerUnit; - } - -} diff --git a/src/common/buildcraft/api/fuels/IronEngineFuel.java b/src/common/buildcraft/api/fuels/IronEngineFuel.java deleted file mode 100644 index 1bf333fc5..000000000 --- a/src/common/buildcraft/api/fuels/IronEngineFuel.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.fuels; - -import java.util.LinkedList; - -import net.minecraftforge.liquids.LiquidContainerRegistry; -import net.minecraftforge.liquids.LiquidStack; - - - -public class IronEngineFuel { - - public static LinkedList fuels = new LinkedList(); - - public static IronEngineFuel getFuelForLiquid(LiquidStack liquid) { - if(liquid == null) - return null; - if(liquid.itemID <= 0) - return null; - - for(IronEngineFuel fuel : fuels) - if(fuel.liquid.isLiquidEqual(liquid)) - return fuel; - - return null; - } - - public final LiquidStack liquid; - public final float powerPerCycle; - public final int totalBurningTime; - - public IronEngineFuel(int liquidId, float powerPerCycle, int totalBurningTime) { - this(new LiquidStack(liquidId, LiquidContainerRegistry.BUCKET_VOLUME, 0), powerPerCycle, totalBurningTime); - } - public IronEngineFuel(LiquidStack liquid, float powerPerCycle, int totalBurningTime) { - this.liquid = liquid; - this.powerPerCycle = powerPerCycle; - this.totalBurningTime = totalBurningTime; - } -} diff --git a/src/common/buildcraft/api/gates/Action.java b/src/common/buildcraft/api/gates/Action.java deleted file mode 100644 index 78adc3c5a..000000000 --- a/src/common/buildcraft/api/gates/Action.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.gates; - - -public abstract class Action implements IAction { - - protected int id; - - public Action(int id) { - this.id = id; - ActionManager.actions[id] = this; - } - - @Override - public int getId() { - return this.id; - } - - @Override - public abstract String getTexture(); - - @Override - public int getIndexInTexture() { - return 0; - } - - @Override - public boolean hasParameter() { - return false; - } - - @Override - public String getDescription() { - return ""; - } -} diff --git a/src/common/buildcraft/api/gates/ActionManager.java b/src/common/buildcraft/api/gates/ActionManager.java deleted file mode 100644 index 14ae48110..000000000 --- a/src/common/buildcraft/api/gates/ActionManager.java +++ /dev/null @@ -1,85 +0,0 @@ -package buildcraft.api.gates; - -import java.util.LinkedList; - -import buildcraft.api.transport.IPipe; - -import net.minecraft.src.Block; -import net.minecraft.src.TileEntity; - -public class ActionManager { - - public static Trigger[] triggers = new Trigger[1024]; - public static Action[] actions = new Action[1024]; - - private static LinkedList triggerProviders = new LinkedList(); - private static LinkedList actionProviders = new LinkedList(); - - public static void registerTriggerProvider(ITriggerProvider provider) { - if (provider != null && !triggerProviders.contains(provider)) { - triggerProviders.add(provider); - } - } - - public static LinkedList getNeighborTriggers(Block block, TileEntity entity) { - LinkedList triggers = new LinkedList(); - - for (ITriggerProvider provider : triggerProviders) { - LinkedList 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 LinkedList getNeighborActions(Block block, TileEntity entity) { - LinkedList actions = new LinkedList(); - - for (IActionProvider provider : actionProviders) { - LinkedList toAdd = provider.getNeighborActions(block, entity); - - if (toAdd != null) { - for (IAction t : toAdd) { - if (!actions.contains(t)) { - actions.add(t); - } - } - } - } - - return actions; - } - - public static LinkedList getPipeTriggers(IPipe pipe) { - LinkedList triggers = new LinkedList(); - - for (ITriggerProvider provider : triggerProviders) { - LinkedList toAdd = provider.getPipeTriggers(pipe); - - if (toAdd != null) { - for (ITrigger t : toAdd) { - if (!triggers.contains(t)) { - triggers.add(t); - } - } - } - } - - return triggers; - } - - -} diff --git a/src/common/buildcraft/api/gates/IAction.java b/src/common/buildcraft/api/gates/IAction.java deleted file mode 100644 index 395a8e6ce..000000000 --- a/src/common/buildcraft/api/gates/IAction.java +++ /dev/null @@ -1,11 +0,0 @@ -package buildcraft.api.gates; - -public interface IAction { - - int getId(); - String getTexture(); - int getIndexInTexture(); - boolean hasParameter(); - String getDescription(); - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/gates/IActionProvider.java b/src/common/buildcraft/api/gates/IActionProvider.java deleted file mode 100644 index ddf55d2c6..000000000 --- a/src/common/buildcraft/api/gates/IActionProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.gates; - -import java.util.LinkedList; - -import net.minecraft.src.Block; -import net.minecraft.src.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/common/buildcraft/api/gates/IActionReceptor.java b/src/common/buildcraft/api/gates/IActionReceptor.java deleted file mode 100644 index bcd5ce83d..000000000 --- a/src/common/buildcraft/api/gates/IActionReceptor.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2012 - * 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/common/buildcraft/api/gates/IOverrideDefaultTriggers.java b/src/common/buildcraft/api/gates/IOverrideDefaultTriggers.java deleted file mode 100644 index a49989149..000000000 --- a/src/common/buildcraft/api/gates/IOverrideDefaultTriggers.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.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/common/buildcraft/api/gates/ITrigger.java b/src/common/buildcraft/api/gates/ITrigger.java deleted file mode 100644 index b803da47b..000000000 --- a/src/common/buildcraft/api/gates/ITrigger.java +++ /dev/null @@ -1,41 +0,0 @@ -package buildcraft.api.gates; - -import net.minecraft.src.TileEntity; - -public interface ITrigger { - - public abstract int getId(); - - /** - * Return the texture file for this trigger icon - */ - public abstract String getTextureFile(); - - /** - * Return the icon id in the texture file - */ - public abstract int getIndexInTexture(); - - /** - * Return true if this trigger can accept parameters - */ - public abstract boolean hasParameter(); - - /** - * Return the trigger description in the UI - */ - public abstract String getDescription(); - - /** - * Return true if the tile given in parameter activates the trigger, given - * the parameters. - */ - public abstract boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter); - - /** - * Create parameters for the trigger. As for now, there is only one kind of - * trigger parameter available so this subprogram is final. - */ - public abstract ITriggerParameter createParameter(); - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/gates/ITriggerParameter.java b/src/common/buildcraft/api/gates/ITriggerParameter.java deleted file mode 100644 index b3b215dc3..000000000 --- a/src/common/buildcraft/api/gates/ITriggerParameter.java +++ /dev/null @@ -1,18 +0,0 @@ -package buildcraft.api.gates; - -import net.minecraft.src.ItemStack; -import net.minecraft.src.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); - - public abstract ItemStack getItem(); - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/gates/ITriggerProvider.java b/src/common/buildcraft/api/gates/ITriggerProvider.java deleted file mode 100644 index e305097d0..000000000 --- a/src/common/buildcraft/api/gates/ITriggerProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.gates; - -import java.util.LinkedList; - -import buildcraft.api.transport.IPipe; - -import net.minecraft.src.Block; -import net.minecraft.src.TileEntity; - -public interface ITriggerProvider { - - /** - * Returns the list of triggers that are available from the pipe holding the - * gate. - */ - public abstract LinkedList getPipeTriggers(IPipe 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/common/buildcraft/api/gates/Trigger.java b/src/common/buildcraft/api/gates/Trigger.java deleted file mode 100644 index 092ae3177..000000000 --- a/src/common/buildcraft/api/gates/Trigger.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.gates; - -import net.minecraft.src.TileEntity; - -/** - * This class has to be implemented to create new triggers kinds to BuildCraft - * gates. There is an instance per kind, which will get called wherever the - * trigger can be active. - */ -public abstract class Trigger implements ITrigger { - - protected int id; - - /** - * Creates a new triggers, and stores it in the trigger list - */ - public Trigger(int id) { - this.id = id; - ActionManager.triggers[id] = this; - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getId() - */ - @Override - public int getId() { - return this.id; - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getTextureFile() - */ - @Override - public abstract String getTextureFile(); - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getIndexInTexture() - */ - @Override - public int getIndexInTexture() { - return 0; - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITrigger#hasParameter() - */ - @Override - public boolean hasParameter() { - return false; - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITrigger#getDescription() - */ - @Override - public String getDescription() { - return ""; - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITrigger#isTriggerActive(net.minecraft.src.TileEntity, net.minecraft.src.buildcraft.api.gates.TriggerParameter) - */ - @Override - public boolean isTriggerActive(TileEntity tile, ITriggerParameter parameter) { - return false; - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITrigger#createParameter() - */ - @Override - public final ITriggerParameter createParameter() { - return new TriggerParameter(); - } -} diff --git a/src/common/buildcraft/api/gates/TriggerParameter.java b/src/common/buildcraft/api/gates/TriggerParameter.java deleted file mode 100644 index e310cc3c5..000000000 --- a/src/common/buildcraft/api/gates/TriggerParameter.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.gates; - -import net.minecraft.src.ItemStack; -import net.minecraft.src.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) { - compound.setInteger("itemID", stack.itemID); - compound.setInteger("itemDMG", stack.getItemDamage()); - } - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITriggerParameter#readFromNBT(net.minecraft.src.NBTTagCompound) - */ - @Override - public void readFromNBT(NBTTagCompound compound) { - int itemID = compound.getInteger("itemID"); - - if (itemID != 0) { - stack = new ItemStack(itemID, 1, compound.getInteger("itemDMG")); - } - } - - /* (non-Javadoc) - * @see net.minecraft.src.buildcraft.api.gates.ITriggerParameter#getItem() - */ - @Override - public ItemStack getItem() { - return stack; - } - -} diff --git a/src/common/buildcraft/api/inventory/ISecuredInventory.java b/src/common/buildcraft/api/inventory/ISecuredInventory.java deleted file mode 100644 index 8cc854185..000000000 --- a/src/common/buildcraft/api/inventory/ISecuredInventory.java +++ /dev/null @@ -1,20 +0,0 @@ -package buildcraft.api.inventory; - -import net.minecraftforge.common.ForgeDirection; - -public interface ISecuredInventory { - - /** - * @param name - * @return true if the user/player with the given name has access permissions on this machine. - */ - boolean canAccess(String name); - - /** - * Informs the inventory with whose permissions the next item or liquid transaction will be performed. It is up to the inventory to determine the effect. - * @param orientation Orientation the transaction will be performed from. - * @param name Name of the user/player who owns the transaction. - */ - void prepareTransaction(ForgeDirection orientation, String name); - -} diff --git a/src/common/buildcraft/api/inventory/ISelectiveInventory.java b/src/common/buildcraft/api/inventory/ISelectiveInventory.java deleted file mode 100644 index 243676344..000000000 --- a/src/common/buildcraft/api/inventory/ISelectiveInventory.java +++ /dev/null @@ -1,17 +0,0 @@ -package buildcraft.api.inventory; - -import net.minecraftforge.common.ForgeDirection; -import net.minecraft.src.ItemStack; - -public interface ISelectiveInventory extends ISpecialInventory { - /** - * Requests specified items to be extracted from the inventory - * @param desired Array which can contain ItemStacks, Items, or classes describing the type of item accepted or excluded. - * @param exclusion If true desired items are not eligible for returning. - * @param doRemove If false no actual extraction may occur. - * @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 extracted from the inventory - */ - ItemStack[] extractItem(Object[] desired, boolean exclusion, boolean doRemove, ForgeDirection from, int maxItemCount); -} diff --git a/src/common/buildcraft/api/inventory/ISpecialInventory.java b/src/common/buildcraft/api/inventory/ISpecialInventory.java deleted file mode 100644 index 658de50ff..000000000 --- a/src/common/buildcraft/api/inventory/ISpecialInventory.java +++ /dev/null @@ -1,26 +0,0 @@ -package buildcraft.api.inventory; - -import net.minecraftforge.common.ForgeDirection; -import net.minecraft.src.IInventory; -import net.minecraft.src.ItemStack; - -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. - * @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. - * @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 extracted from the inventory - */ - ItemStack[] extractItem(boolean doRemove, ForgeDirection from, int maxItemCount); - -} diff --git a/src/common/buildcraft/api/power/IPowerProvider.java b/src/common/buildcraft/api/power/IPowerProvider.java deleted file mode 100644 index ae74209e5..000000000 --- a/src/common/buildcraft/api/power/IPowerProvider.java +++ /dev/null @@ -1,41 +0,0 @@ -package buildcraft.api.power; - -import net.minecraftforge.common.ForgeDirection; -import buildcraft.api.core.SafeTimeTracker; -import net.minecraft.src.NBTTagCompound; - -public interface IPowerProvider { - - int getLatency(); - - int getMinEnergyReceived(); - - int getMaxEnergyReceived(); - - int getMaxEnergyStored(); - - int getActivationEnergy(); - - float getEnergyStored(); - - void configure(int latency, int minEnergyReceived, int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy); - - void configurePowerPerdition(int powerLoss, int powerLossRegularity); - - boolean update(IPowerReceptor receptor); - - boolean preConditions(IPowerReceptor receptor); - - float useEnergy(float min, float max, boolean doUse); - - void readFromNBT(NBTTagCompound nbttagcompound); - - void writeToNBT(NBTTagCompound nbttagcompound); - - void receiveEnergy(float quantity, ForgeDirection from); - - boolean isPowerSource(ForgeDirection from); - - SafeTimeTracker getTimeTracker(); - -} diff --git a/src/common/buildcraft/api/power/IPowerReceptor.java b/src/common/buildcraft/api/power/IPowerReceptor.java deleted file mode 100644 index f61504800..000000000 --- a/src/common/buildcraft/api/power/IPowerReceptor.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.power; - - -public interface IPowerReceptor { - - public void setPowerProvider(IPowerProvider provider); - - public IPowerProvider getPowerProvider(); - - public void doWork(); - - public int powerRequest(); - -} diff --git a/src/common/buildcraft/api/power/PowerFramework.java b/src/common/buildcraft/api/power/PowerFramework.java deleted file mode 100644 index 26cc4e4fc..000000000 --- a/src/common/buildcraft/api/power/PowerFramework.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.power; - -import net.minecraft.src.NBTTagCompound; - -public abstract class PowerFramework { - - static private String baseNBTName = "net.minecraft.src.buildcarft.Power"; - - public static PowerFramework currentFramework; - - public abstract IPowerProvider createPowerProvider(); - - public void loadPowerProvider(IPowerReceptor receptor, NBTTagCompound compound) { - - IPowerProvider provider = createPowerProvider(); - - if (compound.hasKey(baseNBTName)) { - NBTTagCompound cpt = compound.getCompoundTag(baseNBTName); - if (cpt.getString("class").equals(this.getClass().getName())) { - provider.readFromNBT(cpt.getCompoundTag("contents")); - } - } - - receptor.setPowerProvider(provider); - } - - public void savePowerProvider(IPowerReceptor receptor, NBTTagCompound compound) { - - IPowerProvider provider = receptor.getPowerProvider(); - - if (provider == null) { - return; - } - - NBTTagCompound cpt = new NBTTagCompound(); - - cpt.setString("class", this.getClass().getName()); - - NBTTagCompound contents = new NBTTagCompound(); - - provider.writeToNBT(contents); - - cpt.setTag("contents", contents); - compound.setTag(baseNBTName, cpt); - } - -} diff --git a/src/common/buildcraft/api/power/PowerProvider.java b/src/common/buildcraft/api/power/PowerProvider.java deleted file mode 100644 index 6f359f73a..000000000 --- a/src/common/buildcraft/api/power/PowerProvider.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.power; - -import net.minecraftforge.common.ForgeDirection; -import buildcraft.api.core.SafeTimeTracker; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.TileEntity; - -public abstract class PowerProvider implements IPowerProvider { - - protected int latency; - protected int minEnergyReceived; - protected int maxEnergyReceived; - protected int maxEnergyStored; - protected int minActivationEnergy; - protected float energyStored = 0; - - protected int powerLoss = 1; - protected int powerLossRegularity = 100; - - public SafeTimeTracker timeTracker = new SafeTimeTracker(); - public SafeTimeTracker energyLossTracker = new SafeTimeTracker(); - - public int[] powerSources = { 0, 0, 0, 0, 0, 0 }; - - @Override public SafeTimeTracker getTimeTracker() { return this.timeTracker; } - - @Override public int getLatency() { return this.latency; } - @Override public int getMinEnergyReceived() { return this.minEnergyReceived; } - @Override public int getMaxEnergyReceived() { return this.maxEnergyReceived; } - @Override public int getMaxEnergyStored() { return this.maxEnergyStored; } - @Override public int getActivationEnergy() { return this.minActivationEnergy; } - @Override public float getEnergyStored() { return this.energyStored; } - - @Override - public void configure(int latency, int minEnergyReceived, int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy) { - this.latency = latency; - this.minEnergyReceived = minEnergyReceived; - this.maxEnergyReceived = maxEnergyReceived; - this.maxEnergyStored = maxStoredEnergy; - this.minActivationEnergy = minActivationEnergy; - } - - @Override - public void configurePowerPerdition(int powerLoss, int powerLossRegularity) { - this.powerLoss = powerLoss; - this.powerLossRegularity = powerLossRegularity; - } - - @Override - public boolean update(IPowerReceptor receptor) { - if (!preConditions(receptor)) { - return false; - } - - TileEntity tile = (TileEntity) receptor; - boolean result = false; - - if (energyStored >= minActivationEnergy) { - if (latency == 0) { - receptor.doWork(); - result = true; - } else { - if (timeTracker.markTimeIfDelay(tile.worldObj, latency)) { - receptor.doWork(); - result = true; - } - } - } - - if (powerLoss > 0 && energyLossTracker.markTimeIfDelay(tile.worldObj, powerLossRegularity)) { - - energyStored -= powerLoss; - if (energyStored < 0) { - energyStored = 0; - } - } - - for (int i = 0; i < 6; ++i) { - if (powerSources[i] > 0) { - powerSources[i]--; - } - } - - return result; - } - - @Override - public boolean preConditions(IPowerReceptor receptor) { - return true; - } - - @Override - public float useEnergy(float min, float max, boolean doUse) { - float result = 0; - - if (energyStored >= min) { - if (energyStored <= max) { - result = energyStored; - if (doUse) { - energyStored = 0; - } - } else { - result = max; - if (doUse) { - energyStored -= max; - } - } - } - - return result; - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - latency = nbttagcompound.getInteger("latency"); - minEnergyReceived = nbttagcompound.getInteger("minEnergyReceived"); - maxEnergyReceived = nbttagcompound.getInteger("maxEnergyReceived"); - maxEnergyStored = nbttagcompound.getInteger("maxStoreEnergy"); - minActivationEnergy = nbttagcompound.getInteger("minActivationEnergy"); - - try { - energyStored = nbttagcompound.getFloat("storedEnergy"); - } catch (Throwable c) { - energyStored = 0; - } - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - nbttagcompound.setInteger("latency", latency); - nbttagcompound.setInteger("minEnergyReceived", minEnergyReceived); - nbttagcompound.setInteger("maxEnergyReceived", maxEnergyReceived); - nbttagcompound.setInteger("maxStoreEnergy", maxEnergyStored); - nbttagcompound.setInteger("minActivationEnergy", minActivationEnergy); - nbttagcompound.setFloat("storedEnergy", energyStored); - } - - @Override - public void receiveEnergy(float quantity, ForgeDirection from) { - powerSources[from.ordinal()] = 2; - - energyStored += quantity; - - if (energyStored > maxEnergyStored) { - energyStored = maxEnergyStored; - } - } - - @Override - public boolean isPowerSource(ForgeDirection from) { - return powerSources[from.ordinal()] != 0; - } -} diff --git a/src/common/buildcraft/api/recipes/AssemblyRecipe.java b/src/common/buildcraft/api/recipes/AssemblyRecipe.java deleted file mode 100644 index bdaee7291..000000000 --- a/src/common/buildcraft/api/recipes/AssemblyRecipe.java +++ /dev/null @@ -1,46 +0,0 @@ -package buildcraft.api.recipes; - -import java.util.LinkedList; - -import net.minecraft.src.ItemStack; - -public class AssemblyRecipe { - - public static LinkedList assemblyRecipes = new LinkedList(); - - public final ItemStack[] input; - public final ItemStack output; - public final float energy; - - public AssemblyRecipe(ItemStack[] input, int energy, ItemStack output) { - this.input = input; - this.output = output; - this.energy = energy; - } - - public boolean canBeDone(ItemStack[] items) { - - for (ItemStack in : input) { - - if (in == null) - continue; - - int found = 0; // Amount of ingredient found in inventory - - for (ItemStack item : items) { - if (item == null) - continue; - - if (item.isItemEqual(in)) - found += item.stackSize; // Adds quantity of stack to amount - // found - } - - if (found < in.stackSize) - return false; // Return false if the amount of ingredient found - // is not enough - } - - return true; - } -} diff --git a/src/common/buildcraft/api/recipes/RefineryRecipe.java b/src/common/buildcraft/api/recipes/RefineryRecipe.java deleted file mode 100644 index 3b9caa982..000000000 --- a/src/common/buildcraft/api/recipes/RefineryRecipe.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.recipes; - -import java.util.SortedSet; -import java.util.TreeSet; - -import net.minecraftforge.liquids.LiquidStack; - - - -public class RefineryRecipe implements Comparable { - - private static SortedSet recipes = new TreeSet(); - - public static void registerRefineryRecipe(RefineryRecipe recipe) { - if (!recipes.contains(recipe)) { - recipes.add(recipe); - } - } - - public static RefineryRecipe findRefineryRecipe(LiquidStack liquid1, LiquidStack liquid2) { - for(RefineryRecipe recipe : recipes) - if(recipe.matches(liquid1, liquid2)) - return recipe; - - return null; - } - - public final LiquidStack ingredient1; - public final LiquidStack ingredient2; - public final LiquidStack result; - - public final int energy; - public final int delay; - - public RefineryRecipe(int ingredientId1, int ingredientQty1, int ingredientId2, int ingredientQty2, int resultId, int resultQty, - int energy, int delay) { - this(new LiquidStack(ingredientId1, ingredientQty1, 0), new LiquidStack(ingredientId2, ingredientQty2, 0), new LiquidStack(resultId, resultQty, 0), energy, delay); - } - public RefineryRecipe(LiquidStack ingredient1, LiquidStack ingredient2, LiquidStack result, int energy, int delay) { - - // Sort starting materials. - if(ingredient1 != null && ingredient2 != null) { - if( (ingredient1.itemID > ingredient2.itemID) || (ingredient1.itemID == ingredient2.itemID && ingredient1.itemMeta > ingredient2.itemMeta) ) { - this.ingredient1 = ingredient2; - this.ingredient2 = ingredient1; - } else { - this.ingredient1 = ingredient1; - this.ingredient2 = ingredient2; - } - } else if(ingredient2 != null) { - this.ingredient1 = ingredient2; - this.ingredient2 = ingredient1; - } else { - this.ingredient1 = ingredient1; - this.ingredient2 = ingredient2; - } - - this.result = result; - this.energy = energy; - this.delay = delay; - } - - public boolean matches(LiquidStack liquid1, LiquidStack liquid2) { - - // No inputs, return. - if(liquid1 == null && liquid2 == null) - return false; - - // Return if two ingredients are required but only one was supplied. - if((ingredient1 != null && ingredient2 != null) - && (liquid1 == null || liquid2 == null)) - return false; - - if(ingredient1 != null) { - - if(ingredient2 == null) - return ingredient1.isLiquidEqual(liquid1) || ingredient1.isLiquidEqual(liquid2); - else - return (ingredient1.isLiquidEqual(liquid1) && ingredient2.isLiquidEqual(liquid2)) - || (ingredient2.isLiquidEqual(liquid1) && ingredient1.isLiquidEqual(liquid2)); - - } else if(ingredient2 != null) - return ingredient2.isLiquidEqual(liquid1) || ingredient2.isLiquidEqual(liquid2); - else - return false; - - } - - // Compares to only the types of source materials. - // We consider non-null < null in order that one-ingredient recipe is checked after - // the failure of matching two-ingredient recipes which include that liquid. - @Override - public int compareTo(RefineryRecipe other) { - - if(other == null) { - return -1; - } else if (ingredient1 == null) { - if(other.ingredient1 == null) { - return 0; - } else { - return 1; - } - } else if(other.ingredient1 == null) { - return -1; - } else if(ingredient1.itemID != other.ingredient1.itemID) { - return ingredient1.itemID - other.ingredient1.itemID; - } else if(ingredient1.itemMeta != other.ingredient1.itemMeta) { - return ingredient1.itemMeta - other.ingredient1.itemMeta; - } else if(ingredient2 == null) { - if(other.ingredient2 == null) { - return 0; - } else { - return 1; - } - } else if(other.ingredient2 == null) { - return -1; - } else if(ingredient2.itemID != other.ingredient2.itemID) { - return ingredient2.itemID - other.ingredient2.itemID; - } else if(ingredient2.itemMeta != other.ingredient2.itemMeta) { - return ingredient2.itemMeta - other.ingredient2.itemMeta; - } - - return 0; - } - - - // equals() should be consistent with compareTo(). - @Override - public boolean equals(Object obj) { - if(obj != null && obj instanceof RefineryRecipe) { - return this.compareTo((RefineryRecipe)obj) == 0; - } - return false; - } - - // hashCode() should be overridden because equals() was overridden. - @Override - public int hashCode() { - if(ingredient1 == null) { - return 0; - } else if(ingredient2 == null) { - return ingredient1.itemID ^ ingredient1.itemMeta; - } - - return ingredient1.itemID ^ ingredient1.itemMeta ^ ingredient2.itemID ^ ingredient2.itemMeta; - } -} diff --git a/src/common/buildcraft/api/tools/IToolPipette.java b/src/common/buildcraft/api/tools/IToolPipette.java deleted file mode 100644 index 0dd54b9ed..000000000 --- a/src/common/buildcraft/api/tools/IToolPipette.java +++ /dev/null @@ -1,34 +0,0 @@ -package buildcraft.api.tools; - -import net.minecraft.src.ItemStack; -import net.minecraftforge.liquids.LiquidStack; - -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, LiquidStack liquid, boolean doFill); - /** - * Drains liquid from the pipette - * @param pipette - * @param maxDrain - * @param doDrain - * @return Liquid stack representing the liquid and amount drained from the pipette. - */ - LiquidStack drain(ItemStack pipette, int maxDrain, boolean doDrain); -} diff --git a/src/common/buildcraft/api/tools/IToolWrench.java b/src/common/buildcraft/api/tools/IToolWrench.java deleted file mode 100644 index f9a90f872..000000000 --- a/src/common/buildcraft/api/tools/IToolWrench.java +++ /dev/null @@ -1,35 +0,0 @@ -package buildcraft.api.tools; - -import net.minecraft.src.EntityPlayer; - -/*** - * Implement this interface on subclasses of Item to have that item work as a - * wrench for buildcraft - */ -public interface IToolWrench { - - /*** - * Called to ensure that the wrench can be used. To get the ItemStack that - * is used, check player.inventory.getCurrentItem() - * - * @param player - * - The player doing the wrenching - * @param x - * ,y,z - The coordinates for the block being wrenched - * - * @return true if wrenching is allowed, false if not - */ - public boolean canWrench(EntityPlayer player, int x, int y, int z); - - /*** - * Callback after the wrench has been used. This can be used to decrease - * durability or for other purposes. To get the ItemStack that was used, - * check player.inventory.getCurrentItem() - * - * @param player - * - The player doing the wrenching - * @param x - * ,y,z - The coordinates of the block being wrenched - */ - public void wrenchUsed(EntityPlayer player, int x, int y, int z); -} diff --git a/src/common/buildcraft/api/transport/FacadeManager.java b/src/common/buildcraft/api/transport/FacadeManager.java deleted file mode 100644 index 67b5f3d5e..000000000 --- a/src/common/buildcraft/api/transport/FacadeManager.java +++ /dev/null @@ -1,20 +0,0 @@ -package buildcraft.api.transport; - -import java.lang.reflect.Method; -import net.minecraft.src.ItemStack; - -public class FacadeManager -{ - private static Method addFacade; - - public static void addFacade(ItemStack is) { - try { - if(addFacade == null) { - Class facade = Class.forName("buildcraft.transport.ItemFacade"); - addFacade = facade.getMethod("addFacade", ItemStack.class); - } - addFacade.invoke(null, is); - } catch(Exception ex) { - } - } -} diff --git a/src/common/buildcraft/api/transport/IExtractionHandler.java b/src/common/buildcraft/api/transport/IExtractionHandler.java deleted file mode 100644 index 3caf80493..000000000 --- a/src/common/buildcraft/api/transport/IExtractionHandler.java +++ /dev/null @@ -1,19 +0,0 @@ -package buildcraft.api.transport; - -import net.minecraft.src.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? - */ - boolean canExtractItems(IPipe pipe, World world, int i, int j, int k); - - /** - * Can this pipe extract liquids from the block located at these coordinates? - */ - boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k); -} diff --git a/src/common/buildcraft/api/transport/IPassiveItemContribution.java b/src/common/buildcraft/api/transport/IPassiveItemContribution.java deleted file mode 100644 index b935f0356..000000000 --- a/src/common/buildcraft/api/transport/IPassiveItemContribution.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2012 - * 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.src.NBTTagCompound; - -public interface IPassiveItemContribution { - - public void readFromNBT(NBTTagCompound nbttagcompound); - - public void writeToNBT(NBTTagCompound nbttagcompound); - -} diff --git a/src/common/buildcraft/api/transport/IPipe.java b/src/common/buildcraft/api/transport/IPipe.java deleted file mode 100644 index 61ea16c38..000000000 --- a/src/common/buildcraft/api/transport/IPipe.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.transport; - -import net.minecraft.src.TileEntity; - -public interface IPipe { - - enum DrawingState { - DrawingPipe, DrawingRedWire, DrawingBlueWire, DrawingGreenWire, DrawingYellowWire, DrawingGate - } - - enum WireColor { - Red, Blue, Green, Yellow; - - public WireColor reverse() { - switch (this) { - case Red: - return Yellow; - case Blue: - return Green; - case Green: - return Blue; - default: - return Red; - } - } - } - - public boolean isWired(WireColor color); - - public boolean hasInterface(); - - public TileEntity getContainer(); - - public boolean isWireConnectedTo(TileEntity tile, WireColor color); - -} diff --git a/src/common/buildcraft/api/transport/IPipeConnection.java b/src/common/buildcraft/api/transport/IPipeConnection.java deleted file mode 100644 index 1e78ea26e..000000000 --- a/src/common/buildcraft/api/transport/IPipeConnection.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.transport; - -import net.minecraftforge.common.ForgeDirection; - -public interface IPipeConnection { - - public boolean isPipeConnected(ForgeDirection with); -} diff --git a/src/common/buildcraft/api/transport/IPipeEntry.java b/src/common/buildcraft/api/transport/IPipeEntry.java deleted file mode 100644 index 0ae0c8fdf..000000000 --- a/src/common/buildcraft/api/transport/IPipeEntry.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.transport; - -import net.minecraft.src.ItemStack; -import net.minecraftforge.common.ForgeDirection; - -/** - * Interface used to put objects into pipes, implemented by pipe tile entities. - */ -public interface IPipeEntry { - - void entityEntering(ItemStack payload, ForgeDirection orientation); - void entityEntering(IPipedItem item, ForgeDirection orientation); - - boolean acceptItems(); - -} diff --git a/src/common/buildcraft/api/transport/IPipeTile.java b/src/common/buildcraft/api/transport/IPipeTile.java deleted file mode 100644 index 261ceed40..000000000 --- a/src/common/buildcraft/api/transport/IPipeTile.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) SpaceToad, 2011 - * http://www.mod-buildcraft.com - * - * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ - -package buildcraft.api.transport; - -public interface IPipeTile { - - IPipe getPipe(); - - boolean isInitialized(); -} diff --git a/src/common/buildcraft/api/transport/IPipedItem.java b/src/common/buildcraft/api/transport/IPipedItem.java deleted file mode 100644 index fb3b3045f..000000000 --- a/src/common/buildcraft/api/transport/IPipedItem.java +++ /dev/null @@ -1,104 +0,0 @@ -package buildcraft.api.transport; - -import net.minecraftforge.common.ForgeDirection; -import buildcraft.api.core.Position; -import buildcraft.api.core.SafeTimeTracker; -import net.minecraft.src.EntityItem; -import net.minecraft.src.ItemStack; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; - -public interface IPipedItem { - - public abstract void remove(); - - /* GETTING & SETTING */ - public abstract void setWorld(World world); - - public abstract Position getPosition(); - - public abstract void setPosition(double x, double y, double z); - - /** - * @return the speed - */ - public abstract float getSpeed(); - - /** - * @param speed the speed to set - */ - public abstract void setSpeed(float speed); - - /** - * @return the item - */ - public abstract ItemStack getItemStack(); - - /** - * @param item the item to set - */ - public abstract void setItemStack(ItemStack item); - - /** - * @return the container - */ - public abstract TileEntity getContainer(); - - /** - * @param container the container to set - */ - public abstract void setContainer(TileEntity container); - - /** - * @return the synchroTracker - */ - @Deprecated - public abstract SafeTimeTracker getSynchroTracker(); - - /** - * @param synchroTracker the synchroTracker to set - */ - @Deprecated - public abstract void setSynchroTracker(SafeTimeTracker synchroTracker); - - /** - * @return the deterministicRandomization - */ - @Deprecated - public abstract int getDeterministicRandomization(); - - /** - * @param deterministicRandomization the deterministicRandomization to set - */ - @Deprecated - public abstract void setDeterministicRandomization(int deterministicRandomization); - - /** - * @return the entityId - */ - public abstract int getEntityId(); - - /** - * @param entityId the entityId to set - */ - public abstract void setEntityId(int entityId); - - /* SAVING & LOADING */ - public abstract void readFromNBT(NBTTagCompound nbttagcompound); - - public abstract void writeToNBT(NBTTagCompound nbttagcompound); - - public abstract EntityItem toEntityItem(ForgeDirection dir); - - public abstract float getEntityBrightness(float f); - - public abstract boolean isCorrupted(); - - public abstract void addContribution(String key, IPassiveItemContribution contribution); - - public abstract IPassiveItemContribution getContribution(String key); - - public abstract boolean hasContributions(); - -} \ No newline at end of file diff --git a/src/common/buildcraft/api/transport/PipeManager.java b/src/common/buildcraft/api/transport/PipeManager.java deleted file mode 100644 index 92e3dbac2..000000000 --- a/src/common/buildcraft/api/transport/PipeManager.java +++ /dev/null @@ -1,48 +0,0 @@ -package buildcraft.api.transport; - -import java.util.TreeMap; -import java.util.ArrayList; -import java.util.List; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Side; - -import net.minecraft.src.World; - -public abstract class PipeManager { - - @Deprecated - private static TreeMap allServerEntities = new TreeMap(); - @Deprecated - private static TreeMap allClientEntities = new TreeMap(); - - public static List extractionHandlers = new ArrayList(); - - public static void registerExtractionHandler(IExtractionHandler handler) { - extractionHandlers.add(handler); - } - - public static boolean canExtractItems(IPipe pipe, World world, int i, int j, int k) { - for(IExtractionHandler handler : extractionHandlers) - if(!handler.canExtractItems(pipe, world, i, j, k)) - return false; - - return true; - } - - public static boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k) { - for(IExtractionHandler handler : extractionHandlers) - if(!handler.canExtractLiquids(pipe, world, i, j, k)) - return false; - - return true; - } - - @Deprecated - public static TreeMap getAllEntities(){ - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) { - return allClientEntities; - } - return allServerEntities; - } -} diff --git a/src/common/dan200/computer/api/IComputerAccess.java b/src/common/dan200/computer/api/IComputerAccess.java deleted file mode 100644 index 52a034e22..000000000 --- a/src/common/dan200/computer/api/IComputerAccess.java +++ /dev/null @@ -1,131 +0,0 @@ - -package dan200.computer.api; - -/** - * The interface passed to peripherals by computers or turtles, providing methods - * that they can call. This should not be implemented by your classes. Do not interact - * with computers except via this interface. - */ -public interface IComputerAccess -{ - /** - * Creates a new numbered directory in a subPath of the users game save, and return that number. To be used with mountSaveDir.
- * For example: n = createNewSaveDir( "computer/cdrom" ), will create a new - * numbered folder in the "computer/cdrom" subdirectory of the users save file, and return that number. - * mountSaveDir( "computer/rom", n ) could then be used to mount that folder onto the computers directory - * structure, and the value n could be saved out and used again in future to give the peripheral - * persistant storage. - * @param subPath A relative file path from the users world save, where the directory should be located. - * @return The numeric represenation of the name of the folder created. Will be positive. - * @see #mountSaveDir(String, String, int, boolean, long) - */ - public int createNewSaveDir( String subPath ); - - /** - * Equivalent to mountSaveDir( String desiredLocation, String subPath, int id, boolean readOnly, long spaceLimit ) with no space limit. - * Mounts created with this method will have unlimited capacity. - * @see #mountSaveDir(String, String, int, boolean, long) - */ - public String mountSaveDir( String desiredLocation, String subPath, int id, boolean readOnly ); - - /** - * Mounts a directory into the computers file system, from a real directory a subPath of the users game save, - * with a numerical name. To be used with createNewSaveDir.
- * For example: n = createNewSaveDir( "computer/cdrom" ), will create a new - * numbered folder in the "computer/cdrom" subdirectory of the users save file, and return that number. - * mountSaveDir( "computer/rom", n ) could then be used to mount that folder onto the computers directory - * structure, and the value n can be saved out by the peripheral and used again, to give the peripheral - * persistant storage.
- * When a directory is mounted, it will appear in the computers file system, and the user will be - * able to use file operation to read from and write to the directory (unless readOnly, then only writes will be allowed). - * @param desiredLocation The desired location in the computers file system where you would like the directory to appear. - * If this location already exists, a number will be appended until a free name is found, and the - * actual location will be returned. eg: "cdrom" can become "cdrom2" if two peripherals attempt to - * mount "cdrom", or a "cdrom" folder already exists. - * @param subPath The real relative file path from the users world save, where the directory to mount can be located. - * @param id The numerical name of the folder to mount from the subPath: ex: mountSaveDir( "cdrom", "computer/cdrom", 7 ) - * will mount the directory "computer/cdrom/7". Use createNewSaveDir to obtain a unique directory id. - * @param readOnly Whether the computer will be disallowed from making changes to the mounted directory and modifing or creating files therin. - * @param spaceLimit The size limit of the mount, in bytes. - * @return The location in the computers file system where the directory was mounted. This may differ from "desiredLocation", so the - * return value should be kept track of so the folder can be unmounted later. - * @see #createNewSaveDir(String) - * @see #mountFixedDir(String, String, boolean, long) - * @see #unmount(String) - */ - public String mountSaveDir( String desiredLocation, String subPath, int id, boolean readOnly, long spaceLimit ); - - /** - * Equivalent to mountFixedDir( String desiredLocation, String path, boolean readOnly, long spaceLimit ) with no space limit. - * Mounts created with this method will have unlimited capacity. - * @see #mountFixedDir(String, String, boolean, long) - */ - public String mountFixedDir( String desiredLocation, String path, boolean readOnly ); - - /** - * Mounts a directory into the computers file system, from a real directory in the Minecraft install folder.
- * For example: mountFixedDir( "stuff", "mods/mymod/lua/stuff", true ), will mount the "lua/stuff" folder from - * your mod's directory into the computers filesystem at the location "stuff", with readonly permission, giving the - * computer access to those files.
- * When a directory is mounted, it will appear in the computers file system, and the user will be - * able to use file operation to read from and write to the directory (unless readOnly, then only writes will be allowed).
- * mountFixedDir can also be used to mount files, for example: mountFixedDir( "rom/apis/myapi", "mods/mymod/lua/myapi.lua", true ) can - * be used to have the peripheral install an API onto the computer it attaches to. - * @param desiredLocation The desired location in the computers file system where you would like the directory to appear. - * If this location already exists, a number will be appended until a free name is found, and the - * actual location will be returned. eg: "cdrom" can become "cdrom2" if two peripherals attempt to - * mount "cdrom", or a "cdrom" folder already exists. - * @param subPath The real relative file path from the minecraft install root, where the directory to mount can be located. - * @param readOnly Whether the computer will be disallowed from making changes to the mounted directory and modifing or creating files therin. - * @param spaceLimit The size limit of the mount, in bytes. - * @return The location in the computers file system where the directory was mounted. This may differ from "desiredLocation", so the - * return value should be kept track of so the folder can be unmounted later. - * @see #mountSaveDir(String, String, int, boolean, long) - * @see #unmount(String) - */ - public String mountFixedDir( String desiredLocation, String path, boolean readOnly, long spaceLimit ); - - /** - * Unmounts a directory previously mounted onto the computers file system by mountSaveDir or mountFixedDir.
- * When a directory is unmounted, it will disappear from the computers file system, and the user will no longer be able to - * access it. All directories mounted by a mountFixedDir or mountSaveDir are automatically unmounted when the peripheral - * is attached if they have not been explicitly unmounted. - * @param location The desired location in the computers file system of the directory to unmount. - * This must be the location of a directory previously mounted by mountFixedDir() or mountSaveDir(), as - * indicated by their return value. - * @see #mountSaveDir(String, String, int, boolean, long) - * @see #mountFixedDir(String, String, boolean, long) - */ - public void unmount( String location ); - - /** - * Returns the numerical ID of this computer.
- * This is the same number obtained by calling os.getComputerID() or running the "id" program from lua, - * and is guarunteed unique. This number will be positive. - * @return The identifier. - */ - public int getID(); - - /** - * Equivalent to queueEvent( String event, Object[] arguments ) with an empty arguments array. - * @see #queueEvent(String, Object[]) - */ - public void queueEvent( String event ); - - /** - * Causes an event to be raised on this computer, which the computer can respond to by calling - * os.pullEvent(). This can be used to notify the computer when things happen in the world or to - * this peripheral. - * @param event A string identifying the type of event that has occurred, this will be - * returned as the first value from os.pullEvent(). It is recommended that you - * you choose a name that is unique, and recognisable as originating from your - * peripheral. eg: If your peripheral type is "button", a suitable event would be - * "button_pressed". - * @param arguments In addition to a name, you may pass an array of extra arguments to the event, that will - * be supplied as extra return values to os.pullEvent(). Objects in the array will be converted - * to lua data types in the same fashion as the return values of IPeripheral.callMethod().
- * You may supply null to indicate that no arguments are to be supplied. - * @see IPeripheral#callMethod - */ - public void queueEvent( String event, Object[] arguments ); -} diff --git a/src/common/dan200/computer/api/IPeripheral.java b/src/common/dan200/computer/api/IPeripheral.java deleted file mode 100644 index 8dfeb8dce..000000000 --- a/src/common/dan200/computer/api/IPeripheral.java +++ /dev/null @@ -1,103 +0,0 @@ - -package dan200.computer.api; - -/** - * The interface that defines a peripheral. This should be implemented by the - * TileEntity of any block that you wish to be interacted with by - * computer or turtle. - */ -public interface IPeripheral -{ - /** - * Should return a string that uniquely identifies this type of peripheral. - * This can be queried from lua by calling peripheral.getType() - * @return A string identifying the type of peripheral. - */ - public String getType(); - - /** - * Should return an array of strings that identify the methods that this - * peripheral exposes to Lua. This will be called once before each attachment, - * and should not change when called multiple times. - * @return An array of strings representing method names. - * @see #callMethod - */ - public String[] getMethodNames(); - - /** - * This is called when a lua program on an attached computer calls peripheral.call() with - * one of the methods exposed by getMethodNames().
- *
- * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe - * when interacting with minecraft objects. - * @param computer The interface to the computer that is making the call. Remember that multiple - * computers can be attached to a peripheral at once. - * @param method An integer identifying which of the methods from getMethodNames() the computer - * wishes to call. The integer indicates the index into the getMethodNames() table - * that corresponds to the string passed into peripheral.call() - * @param arguments An array of objects, representing the arguments passed into peripheral.call().
- * Lua values of type "string" will be represented by Object type String.
- * Lua values of type "number" will be represented by Object type Double.
- * Lua values of type "boolean" will be represented by Object type Boolean.
- * Lua values of any other type will be represented by a null object.
- * This array will be empty if no arguments are passed. - * @return An array of objects, representing values you wish to return to the lua program.
- * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.
- * All other types will be converted to nil.
- * You may return null to indicate no values should be returned. - * @throws Exception If you throw any exception from this function, a lua error will be raised with the - * same message as your exception. Use this to throw appropriate errors if the wrong - * arguments are supplied to your method. - * @see #getMethodNames - */ - public Object[] callMethod( IComputerAccess computer, int method, Object[] arguments ) throws Exception; - - /** - * Is called before the computer attempts to attach to the peripheral, and should return whether to allow - * the attachment. Use this to restrict the number of computers that can attach, or to limit attachments to - * certain world directions.
- * If true is returned, attach() will be called shortly afterwards, and the computer will be able to make method calls. - * If false is returned, attach() will not be called, and the peripheral will be invisible to the computer. - * @param side The world direction (0=bottom, 1=top, etc) that the computer lies relative to the peripheral. - * @return Whether to allow the attachment, as a boolean. - * @see #attach - */ - public boolean canAttachToSide( int side ); - - /** - * Is called when canAttachToSide has returned true, and a computer is attaching to the peripheral. - * This will occur when a peripheral is placed next to an active computer, when a computer is turned on next to a peripheral, - * or when a turtle travels into a square next to a peripheral. - * Between calls to attach() and detach(), the attached computer can make method calls on the peripheral using peripheral.call(). - * This method can be used to keep track of which computers are attached to the peripheral, or to take action when attachment - * occurs.
- *
- * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe - * when interacting with minecraft objects. - * @param computer The interface to the computer that is being attached. Remember that multiple - * computers can be attached to a peripheral at once. - * @param computerSide A string indicating which "side" of the computer the peripheral is attaching, - * relative to the computers orientation. This value will be one of "top", "bottom", - * "left", "right", "front" or "back". This can be used to uniquely identify the - * peripheral when raising events or returning values to the computer. - * @see #canAttachToSide - * @see #detach - */ - public void attach( IComputerAccess computer, String computerSide ); - - /** - * Is called when a computer is detaching from the peripheral. - * This will occur when a computer shuts down, when the peripheral is removed while attached to computers, - * or when a turtle moves away from a square attached to a peripheral. - * This method can be used to keep track of which computers are attached to the peripheral, or to take action when detachment - * occurs.
- *
- * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe - * when interacting with minecraft objects. - * @param computer The interface to the computer that is being detached. Remember that multiple - * computers can be attached to a peripheral at once. - * @see #canAttachToSide - * @see #detach - */ - public void detach( IComputerAccess computer ); -} diff --git a/src/common/dan200/turtle/api/ITurtleAccess.java b/src/common/dan200/turtle/api/ITurtleAccess.java deleted file mode 100644 index e60327251..000000000 --- a/src/common/dan200/turtle/api/ITurtleAccess.java +++ /dev/null @@ -1,144 +0,0 @@ - -package dan200.turtle.api; - -/** - * The interface passed to upgrades by turtles, providing methods that they can call. - * This should not be implemented by your classes. Do not interact with turtles except via this interface and ITurtleUpgrade. - */ -public interface ITurtleAccess -{ - /** - * Returns the world in which the turtle resides. - * @return the world in which the turtle resides. - */ - public net.minecraft.src.World getWorld(); - - /** - * Returns a vector containing the integer block co-ordinates at which the turtle resides. - * @return a vector containing the integer block co-ordinates at which the turtle resides. - */ - public net.minecraft.src.Vec3 getPosition(); - - /** - * Returns the world direction the turtle is currently facing. - * @return the world direction the turtle is currently facing. - */ - public int getFacingDir(); - - /** - * Returns the size of the turtles inventory, in number of slots. This will currently always be 16. - * @return the size of the turtles inventory, in number of slots. This will currently always be 16. - */ - public int getInventorySize(); - - /** - * Returns which slot the turtle currently has selected in its inventory using turtle.select(). - * Unlike the 1-based lua representation, this will be between 0 and getInventorySize() - 1. - * @return which slot the turtle currently has selected in its inventory - */ - public int getSelectedSlot(); - - /** - * Returns the item stack that the turtle has in one of its inventory slots. - * @param index which inventory slot to retreive, should be between 0 and getInventorySize() - 1 - * @return the item stack that the turtle has in one of its inventory slots. May be null. - */ - public net.minecraft.src.ItemStack getSlotContents( int index ); - - /** - * Changes the item stack that the turtle has in one of its inventory slots. - * @param index which inventory slot to change, should be between 0 and getInventorySize() - 1 - * @param stack an item stack to put in the slot. May be null. - */ - public void setSlotContents( int index, net.minecraft.src.ItemStack stack ); - - /** - * Tries to store an item stack into the turtles current inventory, starting from the turtles - * currently selected inventory slot. - * @param stack The item stack to try and store. - * @return true if the stack was completely stored in the inventory, false if - * it was only partially stored, or could not fit at all. If false is returned - * and the stack was partially stored, the ItemStack passed into "stack" will now - * represent the stack of items that is left over. - */ - public boolean storeItemStack( net.minecraft.src.ItemStack stack ); - - /** - * Drops an item stack from the turtle onto the floor, or into an inventory is there is one - * adjacent to the turtle in the direction specified. - * @param stack The item stack to drop. - * @param dir The world direction to drop the item - * @return true if the stack was dropped, or completely stored in the adjacent inventory, false if - * it was only partially stored in the adjacent inventory, or could not fit at all. If false is returned - * and the stack was partially stored, the ItemStack passed into "stack" will now - * represent the stack of items that is left over. - */ - public boolean dropItemStack( net.minecraft.src.ItemStack stack, int dir ); - - /** - * "Deploys" an item stack in the direction specified. This simulates a player right clicking, and calls onItemUse() on the Item class. - * Will return true if some kind of deployment happened, and may modify the item stack. For block item types, this can be - * used to place blocks. Some kinds of items (such as shears when facing a sheep) may modify the turtles inventory during this call. - * @param stack The item stack to deploy - * @param dir The world direction to deploy the item - * @return true if the stack was deployed, false if it was not. - */ - public boolean deployWithItemStack( net.minecraft.src.ItemStack stack, int dir ); - - /** - * Tries to "attack" entities with an item stack in the direction specified. This simulates a player left clicking, but will - * not affect blocks. If an entity is attacked and killed during this call, its dropped items will end up in the turtles - * inventory. - * @param stack The item stack to attack with - * @param dir The world direction to attack with the item - * @return true if something was attacked, false if it was not - */ - public boolean attackWithItemStack( net.minecraft.src.ItemStack stack, int dir, float damageMultiplier ); - - /** - * Returns the current fuel level of the turtle, this is the same integer returned by turtle.getFuelLevel(), - * that decreases by 1 every time the turtle moves. Can be used to have your tool or peripheral require or supply - * fuel to the turtle. - * @return the fuel level - */ - public int getFuelLevel(); - - /** - * Tries to increase the fuel level of a turtle by burning an item stack. If the item passed in is a fuel source, fuel - * will increase and true will be returned. Otherwise, nothing will happen and false will be returned. - * @param stack The stack to try to refuel with - * @return Whether the turtle was refueled - */ - public boolean refuelWithItemStack( net.minecraft.src.ItemStack stack ); - - /** - * Removes some fuel from the turtles fuel supply. Negative numbers can be passed in to INCREASE the fuel level of the turtle. - * @return Whether the turtle was able to consume the ammount of fuel specified. Will return false if you supply a number - * greater than the current fuel level of the turtle. - */ - public boolean consumeFuel( int fuel ); - - /** - * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed - * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up - * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will - * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the - * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. - * @param handler an object which will execute the custom command when its point in the queue is reached - * @return the unique command identifier described above - * @see ITurtleCommandHandler - */ - public int issueCommand( ITurtleCommandHandler handler ); - - /** - * Returns the upgrade on the specified side of the turtle, if there is one. - * @return the upgrade on the specified side of the turtle, if there is one. - */ - public ITurtleUpgrade getUpgrade( TurtleSide side ); - - /** - * Returns the peripheral created by the upgrade on the specified side of the turtle, if there is one. - * @return the peripheral created by the upgrade on the specified side of the turtle, if there is one. - */ - public ITurtlePeripheral getPeripheral( TurtleSide side ); -} diff --git a/src/common/dan200/turtle/api/ITurtleCommandHandler.java b/src/common/dan200/turtle/api/ITurtleCommandHandler.java deleted file mode 100644 index 5d397c875..000000000 --- a/src/common/dan200/turtle/api/ITurtleCommandHandler.java +++ /dev/null @@ -1,20 +0,0 @@ - -package dan200.turtle.api; - -/** - * An interface for objects executing custom turtle commands, used with ITurtleAccess.issueCommand - * @see ITurtleAccess#issueCommand( ITurtleCommandHandler ) - */ -public interface ITurtleCommandHandler -{ - /** - * Will be called by the turtle on the main thread when it is time to execute the custom command. - * The handler should either perform the work of the command, and return true for success, or return - * false to indicate failure if the command cannot be executed at this time. - * @param turtle access to the turtle for whom the command was issued - * @return true for success, false for failure. If true is returned, the turtle will wait 0.4 seconds - * before executing the next command in its queue, as it does for the standard turtle commands. - * @see ITurtleAccess#issueCommand( ITurtleCommandHandler ) - */ - public boolean handleCommand( ITurtleAccess turtle ); -} diff --git a/src/common/dan200/turtle/api/ITurtlePeripheral.java b/src/common/dan200/turtle/api/ITurtlePeripheral.java deleted file mode 100644 index 6d56ee90d..000000000 --- a/src/common/dan200/turtle/api/ITurtlePeripheral.java +++ /dev/null @@ -1,22 +0,0 @@ - -package dan200.turtle.api; -import dan200.computer.api.IPeripheral; - -/** - * A subclass of IPeripheral specifically for peripherals - * created by ITurtleUpgrade's of type Peripheral. When an - * ITurtlePeripheral is created, its IPeripheral methods will be called - * just as if the peripheral was a seperate adjacent block in the world, - * and update() will be called once per tick. - * @see ITurtleUpgrade - */ -public interface ITurtlePeripheral extends IPeripheral -{ - /** - * A method called on each created turtle peripheral once per tick, - * over the lifetime of the turtle. May be used to update the state - * of the peripheral, and may interact with IComputerAccess or ITurtleAccess - * however it likes at this time. - */ - public void update(); -} diff --git a/src/common/dan200/turtle/api/ITurtleUpgrade.java b/src/common/dan200/turtle/api/ITurtleUpgrade.java deleted file mode 100644 index aff9c448c..000000000 --- a/src/common/dan200/turtle/api/ITurtleUpgrade.java +++ /dev/null @@ -1,97 +0,0 @@ - -package dan200.turtle.api; - -/** - * The primary interface for defining an upgrade for Turtles. A turtle upgrade - * can either be a new tool, or a new peripheral. - * @see TurtleAPI#registerUpgrade( ITurtleUpgrade ) - */ -public interface ITurtleUpgrade -{ - /** - * Gets a unique numerical identifier representing this type of turtle upgrade. - * Like Minecraft block and item IDs, you should strive to make this number unique - * among all turtle upgrades that have been released for ComputerCraft. - * The ID must be in the range 64 to 255, as the ID is stored as an 8-bit value, - * and 0-64 is reserved for future use by ComputerCraft. The upgrade will - * fail registration if an already used ID is specified. - * @see TurtleAPI#registerUpgrade( ITurtleUpgrade ) - */ - public int getUpgradeID(); - - /** - * Return a String to describe this type of upgrade in turtle item names. - * Examples of built-in adjectives are "Wireless", "Mining" and "Crafty". - */ - public String getAdjective(); - - /** - * Return whether this upgrade adds a tool or a peripheral to the turtle. - * Currently, turtle crafting is restricted to one tool & one peripheral per turtle. - * @see TurtleUpgradeType for the differences between the two. - */ - public TurtleUpgradeType getType(); - - /** - * Return an item stack representing the type of item that a turtle must be crafted - * with to create a turtle which holds this upgrade. - * Currently, turtle crafting is restricted to one tool & one peripheral per turtle. - */ - public net.minecraft.src.ItemStack getCraftingItem(); - - /** - * Return whether this turtle upgrade is an easter egg, and should be attempted to be hidden - * from the creative mode inventory and recipe book plugins. - */ - public boolean isSecret(); - - /** - * Return which texture file should be used to render this upgrade when rendering a turtle - * in the world or as an item. - * @param turtle Access to the turtle that is being rendered, this will be null when - * the method is being called to render the turtle as an Item. For turtles in the world, - * this can be used to have the upgrade change appearance based on state. - * @param side Which side of the turtle (left or right) that the upgrade being rendered resides on. - * @see #getIconIndex - */ - public String getIconTexture( ITurtleAccess turtle, TurtleSide side ); - - /** - * Return which icon index should be used to render this upgrade when rendering a turtle - * in the world or as an item. - * @param turtle Access to the turtle that is being rendered, this will be null when - * the method is being called to render the turtle as an Item. For turtles in the world, - * this can be used to have the upgrade change appearance based on state. - * @param side Which side of the turtle (left or right) that the upgrade being rendered resides on. - * @see #getIconTexture - */ - public int getIconIndex( ITurtleAccess turtle, TurtleSide side ); - - /** - * Will only be called for Peripheral upgrades. Creates a peripheral for a turtle - * being placed using this upgrade. The peripheral created will be stored - * for the lifetime of the turtle, will have update() called once-per-tick, and will be - * attach'd detach'd and have methods called in the same manner as a Computer peripheral. - * @param turtle Access to the turtle that the peripheral is being created for. - * @param side Which side of the turtle (left or right) that the upgrade resides on. - * @returns The newly created peripheral. You may return null if this upgrade is a Tool - * and this method is not expected to be called. - */ - public ITurtlePeripheral createPeripheral( ITurtleAccess turtle, TurtleSide side ); - - /** - * Will only be called for Tool upgrades. Called when turtle.dig() or turtle.attack() is called - * by the turtle, and the tool is required to do some work. - * @param turtle Access to the turtle that the tool resides on. - * @param side Which side of the turtle (left or right) the tool resides on. - * @param verb Which action (dig or attack) the turtle is being called on to perform. - * @param direction Which world direction the action should be performed in, relative to the turtles - * position. This will either be up, down, or the direction the turtle is facing, depending on - * whether dig, digUp or digDown was called. - * @return Whether the turtle was able to perform the action, and hence whether the turtle.dig() - * or turtle.attack() lua method should return true. If true is returned, the tool will perform - * a swinging animation. You may return false if this upgrade is a Peripheral - * and this method is not expected to be called. - */ - public boolean useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, int direction ); -} diff --git a/src/common/dan200/turtle/api/TurtleAPI.java b/src/common/dan200/turtle/api/TurtleAPI.java deleted file mode 100644 index ab4264e8a..000000000 --- a/src/common/dan200/turtle/api/TurtleAPI.java +++ /dev/null @@ -1,73 +0,0 @@ - -package dan200.turtle.api; -import java.lang.reflect.Method; - -/** - * The static entry point to the ComputerCraft Turtle Upgrade API. - * Members in this class must be called after mod_CCTurtle has been initialised, - * but may be called before it is loaded. - */ -public class TurtleAPI -{ - /** - * Registers a new turtle upgrade for use in the ComputerCraft. After calling this, - * users should be able to craft Turtles with your new upgrade. It is recommended to call - * this during the load() method of your mod. - * @throws Exception if you try to register an upgrade with an already used or reserved upgradeID - * @see ITurtleUpgrade - */ - public static void registerUpgrade( ITurtleUpgrade upgrade ) - { - if( upgrade != null ) - { - findCCTurtle(); - if( ccTurtle_registerTurtleUpgrade != null ) - { - try { - ccTurtle_registerTurtleUpgrade.invoke( null, new Object[]{ upgrade } ); - } catch( Exception e ) { - // It failed - } - } - } - } - - // The functions below here are private, and are used to interface with the non-API ComputerCraft classes. - // Reflection is used here so you can develop your mod in MCP without decompiling ComputerCraft and including - // it in your solution. - - private static void findCCTurtle() - { - if( !ccTurtleSearched ) { - // Search for CCTurtle - try { - ccTurtle = Class.forName( "dan200.turtle.shared.CCTurtle" ); - ccTurtle_registerTurtleUpgrade = findCCTurtleMethod( "registerTurtleUpgrade", new Class[] { - ITurtleUpgrade.class - } ); - - } catch( ClassNotFoundException e ) { - System.out.println("ComputerCraft: CCTurtle not found."); - - } finally { - ccTurtleSearched = true; - - } - } - } - - private static Method findCCTurtleMethod( String name, Class[] args ) - { - try { - return ccTurtle.getMethod( name, args ); - - } catch( NoSuchMethodException e ) { - System.out.println("ComputerCraft: CCTurtle method " + name + " not found."); - return null; - } - } - - private static boolean ccTurtleSearched = false; - private static Class ccTurtle = null; - private static Method ccTurtle_registerTurtleUpgrade = null; -} diff --git a/src/common/dan200/turtle/api/TurtleSide.java b/src/common/dan200/turtle/api/TurtleSide.java deleted file mode 100644 index bc64f7110..000000000 --- a/src/common/dan200/turtle/api/TurtleSide.java +++ /dev/null @@ -1,18 +0,0 @@ - -package dan200.turtle.api; - -/** - * An enum representing the two sides of the turtle that a turtle upgrade might reside. - */ -public enum TurtleSide -{ - /** - * The turtles left side (where the pickaxe usually is on a Wireless Mining Turtle) - */ - Left, - - /** - * The turtles right side (where the modem usually is on a Wireless Mining Turtle) - */ - Right, -} diff --git a/src/common/dan200/turtle/api/TurtleUpgradeType.java b/src/common/dan200/turtle/api/TurtleUpgradeType.java deleted file mode 100644 index d1b694999..000000000 --- a/src/common/dan200/turtle/api/TurtleUpgradeType.java +++ /dev/null @@ -1,22 +0,0 @@ - -package dan200.turtle.api; - -/** - * An enum representing the two different types of upgrades that an ITurtleUpgrade - * implementation can add to a turtle. - * @see ITurtleUpgrade - */ -public enum TurtleUpgradeType -{ - /** - * A tool is rendered as an item on the side of the turtle, and responds to the turtle.dig() - * and turtle.attack() methods (Such as pickaxe or sword on Mining and Melee turtles). - */ - Tool, - - /** - * A peripheral adds a special peripheral which is attached to the side of the turtle, - * and can be interacted with the peripheral API (Such as the modem on Wireless Turtles). - */ - Peripheral, -} diff --git a/src/common/dan200/turtle/api/TurtleVerb.java b/src/common/dan200/turtle/api/TurtleVerb.java deleted file mode 100644 index 4da83c6cf..000000000 --- a/src/common/dan200/turtle/api/TurtleVerb.java +++ /dev/null @@ -1,21 +0,0 @@ - -package dan200.turtle.api; - -/** - * An enum representing the two different actions that an ITurtleUpgrade of type - * Tool may be called on to perform by a turtle. - * @see ITurtleUpgrade - * @see ITurtleUpgrade#useTool - */ -public enum TurtleVerb -{ - /** - * The turtle called turtle.dig(), turtle.digUp() or turtle.digDown() - */ - Dig, - - /** - * The turtle called turtle.attack(), turtle.attackUp() or turtle.attackDown() - */ - Attack, -} diff --git a/src/common/ic2/api/BaseSeed.java b/src/common/ic2/api/BaseSeed.java deleted file mode 100644 index bcc37a04b..000000000 --- a/src/common/ic2/api/BaseSeed.java +++ /dev/null @@ -1,56 +0,0 @@ -package ic2.api; - -/** - * 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 id plant ID - * @param size plant size - * @param statGrowth plant growth stat - * @param statGain plant gain stat - * @param statResistance plant resistance stat - * @param stackSize for internal usage only - */ - public BaseSeed(int id, int size, int statGrowth, int statGain, int statResistance, int stackSize) { - super(); - this.id = id; - this.size = size; - this.statGrowth = statGrowth; - this.statGain = statGain; - this.statResistance = statResistance; - this.stackSize = stackSize; - } -} diff --git a/src/common/ic2/api/CropCard.java b/src/common/ic2/api/CropCard.java deleted file mode 100644 index c1c558571..000000000 --- a/src/common/ic2/api/CropCard.java +++ /dev/null @@ -1,475 +0,0 @@ -package ic2.api; - -import java.util.HashMap; - -import net.minecraft.src.Entity; -import net.minecraft.src.EntityLiving; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemStack; - -/** - * 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; - } - else - { - 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(); - - /** - * Sprite index the crop is meant to be rendered with. - * - * @param crop reference to TECrop - * @return 0-255, representing the sprite index on the crop's spritesheet. - */ - public abstract int getSpriteIndex(TECrop crop); - - /** - * 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(TECrop 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 TECrop - * @return Whether the crop can grow - */ - public abstract boolean canGrow(TECrop 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 TECrop - * @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(TECrop 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(TECrop crop) - { - return crop.size >= 3; - } - - - /** - * Called when the plant is rightclicked by a player. - * Default action is harvesting. - * - * @param crop reference to TECrop - * @param player player rightclicking the crop - * @return Whether the plant has changed - */ - public boolean rightclick(TECrop crop, EntityPlayer player) - { - return crop.harvest(true); - } - - /** - * Check whether the crop can be harvested. - * - * @param crop reference to TECrop - * @return Whether the crop can be harvested in its current state. - */ - public abstract boolean canBeHarvested(TECrop 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 TECrop - * @return Item obtained - */ - public abstract ItemStack getGain(TECrop crop); - - /** - * Get the size of the plant after harvesting. - * Default is 1. - * - * @param crop reference to TECrop - * @return Plant size after harvesting - */ - public byte getSizeAfterHarvest(TECrop crop) {return 1;} - - - /** - * Called when the plant is leftclicked by a player. - * Default action is picking the plant. - * - * @param crop reference to TECrop - * @param player player leftclicked the crop - * @return Whether the plant has changed - */ - public boolean leftclick(TECrop 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 TECrop - * @return Chance to drop the seeds - */ - public float dropSeedChance(TECrop crop) - { - if (crop.size == 1) return 0; - float base = 0.5F; - if (crop.size == 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 TECrop - * @return Seeds - */ - public ItemStack getSeeds(TECrop crop) - { - return crop.generateSeeds(crop.id, crop.statGrowth, crop.statGain, crop.statResistance, crop.scanLevel); - } - - /** - * Called when a neighbor block to the crop has changed. - * - * @param crop reference to TECrop - */ - public void onNeighbourChange(TECrop crop){} - - /** - * Check if the crop should emit redstone. - * - * @return Whether the crop should emit redstone - */ - public boolean emitRedstone(TECrop crop){return false;} - - /** - * Called when the crop is destroyed. - * - * @param crop reference to TECrop - */ - public void onBlockDestroyed(TECrop crop){} - - /** - * Get the light value emitted by the plant. - * - * @param crop reference to TECrop - * @return Light value emitted - */ - public int getEmittedLight(TECrop crop) {return 0;} - - /** - * Default is true if the entity is an EntityLiving in jumping or sprinting state. - * - * @param crop reference to TECrop - * @param entity entity colliding - * @return Whether trampling calculation should happen, return false if the plant is no longer valid. - */ - public boolean onEntityCollision(TECrop crop, Entity entity) - { - if (entity instanceof EntityLiving) - { - return ((EntityLiving)entity).isSprinting(); - } - return false; - } - - - /** - * Called every time the crop ticks. - * Should be called every 256 ticks or around 13 seconds. - * - * @param crop reference to TECrop - */ - public void tick(TECrop 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 TECrop - * @return Whether the plant spreads weed - */ - public boolean isWeed(TECrop crop) - { - return crop.size>=2 && (crop.id==0 || crop.statGrowth>=24); - } - - - /** - * Get this plant's ID. - * - * @return ID of this CropCard or -1 if it's not registered - */ - public final int getId() - { - for (int i = 0; i < cropCardList.length; i++) - { - if (this == cropCardList[i]) - { - return i; - } - } - return -1; - } - - private static final CropCard[] cropCardList = new CropCard[256]; - - /** - * Get the size of the plant list. - * - * @return Plant list size - */ - public static int cropCardListLength() {return cropCardList.length;} - - /** - * Return the CropCard assigned to the given ID. - * If the ID is out of bounds, weed should be returned. If the ID is not registered, weed should be returned and a console print will notify. - * - * @param id plant ID - * @return Plant class - */ - public static final CropCard getCrop(int id) - { - if (id < 0 || id >= cropCardList.length) - {// Out of bounds - return cropCardList[0]; - } - if (cropCardList[id]==null) - {// Out of bounds - System.out.println("[IndustrialCraft] Something tried to access non-existant cropID #"+id+"!!!"); - return cropCardList[0]; - } - - return cropCardList[id]; - } - - /** - * Check whether the specified plant ID is already assigned. - * @param id ID to be checked - * @return true if the the given id is inbounds and the registered slot is not null - */ - public static final boolean idExists(int id) - { - return !(id < 0 || id >= cropCardList.length || cropCardList[id]==null); - } - - /** - * 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 static final short registerCrop(CropCard crop) - { - for (short x = 0; x < cropCardList.length; x++) - {// Iterate through list - if (cropCardList[x]==null) - {// Found empty slot, add crop here - cropCardList[x]=crop; - nameReference.addLocal("item.cropSeed"+x+".name", crop.name()+" Seeds"); - return x; - } - } - //No free slot avaible - return -1; - } - - /** - * 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 static final boolean registerCrop(CropCard crop, int i) - { - if (i < 0 || i >= cropCardList.length) - {// Out of bounds - return false; - } - if (cropCardList[i]==null) - { - cropCardList[i]=crop; - nameReference.addLocal("item.cropSeed"+i+".name", crop.name()+" Seeds"); - return true; - } - System.out.println("[IndustrialCraft] Cannot add crop:"+crop.name()+" on ID #"+i+", slot already occupied by crop:"+cropCardList[i].name()); - return false; - } - - /** - * For internal usage only. - */ - public static TECrop nameReference; - - private static HashMap baseseeds = new HashMap(); - - /** - * 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 static boolean registerBaseSeed(ItemStack stack, int id, int size, int growth, int gain, int resistance) - { - for (ItemStack key : baseseeds.keySet()) - if (key.itemID==stack.itemID && key.getItemDamage()==stack.getItemDamage()) return false; - - baseseeds.put(stack, new BaseSeed(id, size, growth, gain, resistance, stack.stackSize)); - return true; - } - - /** - * Finds a base seed from the given item. - * - * @return Base seed or null if none found - */ - public static BaseSeed getBaseSeed(ItemStack stack) - { - if (stack == null) return null; - for (ItemStack key : baseseeds.keySet()) - { - if (key.itemID == stack.itemID && - (key.getItemDamage() == -1 || key.getItemDamage() == stack.getItemDamage())) - { - return baseseeds.get(key); - } - } - return null; - } -} diff --git a/src/common/ic2/api/Crops.java b/src/common/ic2/api/Crops.java deleted file mode 100644 index e2fbe1aa1..000000000 --- a/src/common/ic2/api/Crops.java +++ /dev/null @@ -1,47 +0,0 @@ -package ic2.api; - -import java.util.HashMap; - -import net.minecraft.src.BiomeGenBase; - -/** - * General management of the crop system. All crop management methods will be moved here in the 2.00 update. - */ -public class Crops { - private static final HashMap humidityBiomeBonus = new HashMap(); - private static final HashMap nutrientBiomeBonus = new HashMap(); - - /** - * Add 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 static void addBiomeBonus(BiomeGenBase biome, int humidityBonus, int nutrientsBonus) { - humidityBiomeBonus.put(biome, humidityBonus); - nutrientBiomeBonus.put(biome, nutrientsBonus); - } - - /** - * Get the humidity bonus for a biome. - * - * @param biome biome to check - * @return Humidity bonus or 0 if none - */ - public static int getHumidityBiomeBonus(BiomeGenBase biome) { - return humidityBiomeBonus.containsKey(biome) ? humidityBiomeBonus.get(biome) : 0; - } - - /** - * Get the nutrient bonus for a biome. - * - * @param biome biome to check - * @return Nutrient bonus or 0 if none - */ - public static int getNutrientBiomeBonus(BiomeGenBase biome) { - return nutrientBiomeBonus.containsKey(biome) ? nutrientBiomeBonus.get(biome) : 0; - } -} diff --git a/src/common/ic2/api/Direction.java b/src/common/ic2/api/Direction.java deleted file mode 100644 index 6d708ad48..000000000 --- a/src/common/ic2/api/Direction.java +++ /dev/null @@ -1,107 +0,0 @@ -package ic2.api; - -import net.minecraft.src.TileEntity; -import net.minecraftforge.common.ForgeDirection; - -/** - * Represents the 6 possible directions along the axis of a block. - */ -public enum Direction { - /** - * -X - */ - XN(0), - /** - * +X - */ - XP(1), - - /** - * -Y - */ - YN(2), //MC-Code starts with 0 here - /** - * +Y - */ - YP(3), // 1... - - /** - * -Z - */ - ZN(4), - /** - * +Z - */ - ZP(5); - - Direction(int dir) { - this.dir = dir; - } - - /*public CoordinateTuple ApplyToCoordinates(CoordinateTuple coordinates) { - CoordinateTuple ret = new CoordinateTuple(coordinates); - - ret.coords[dir/2] += GetSign(); - - return ret; - }*/ - - /** - * Get the tile entity next to a tile entity following this direction. - * - * @param tileEntity tile entity to check - * @return Adjacent tile entity or null if none exists - */ - public TileEntity applyToTileEntity(TileEntity tileEntity) { - int coords[] = { tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord }; - - coords[dir/2] += getSign(); - - if (tileEntity.worldObj != null && tileEntity.worldObj.blockExists(coords[0], coords[1], coords[2])) { - return tileEntity.worldObj.getBlockTileEntity(coords[0], coords[1], coords[2]); - } else { - return null; - } - } - - /** - * Get the inverse of this direction (XN -> XP, XP -> XN, etc.) - * - * @return Inverse direction - */ - public Direction getInverse() { - int inverseDir = dir - getSign(); - - for (Direction direction : directions) { - if (direction.dir == inverseDir) return direction; - } - - return this; - } - - /** - * Convert this direction to a Minecraft side value. - * - * @return Minecraft side value - */ - public int toSideValue() { - return (dir + 4) % 6; - } - - /** - * Determine direction sign (N for negative or P for positive). - * - * @return -1 if the direction is negative, +1 if the direction is positive - */ - private int getSign() { - return (dir % 2) * 2 - 1; - } - - public ForgeDirection toForgeDirection() { - return ForgeDirection.getOrientation(toSideValue()); - } - - private int dir; - private static final Direction[] directions = Direction.values(); -} - diff --git a/src/common/ic2/api/ElectricItem.java b/src/common/ic2/api/ElectricItem.java deleted file mode 100644 index 3f4a4972e..000000000 --- a/src/common/ic2/api/ElectricItem.java +++ /dev/null @@ -1,128 +0,0 @@ -package ic2.api; - -import java.lang.reflect.Method; - -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemStack; - -/** - * Allows for charging, discharging and using electric items (IElectricItem). - * - * The charge or remaining capacity of an item can be determined by calling charge/discharge with - * ignoreTransferLimit and simulate set to true. - */ -public final class ElectricItem { - /** - * 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 static int charge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate) { - try { - if (ElectricItem_charge == null) ElectricItem_charge = Class.forName(getPackage() + ".common.ElectricItem").getMethod("charge", ItemStack.class, Integer.TYPE, Integer.TYPE, Boolean.TYPE, Boolean.TYPE); - - return (Integer) ElectricItem_charge.invoke(null, itemStack, amount, tier, ignoreTransferLimit, simulate); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * 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 static int discharge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate) { - try { - if (ElectricItem_discharge == null) ElectricItem_discharge = Class.forName(getPackage() + ".common.ElectricItem").getMethod("discharge", ItemStack.class, Integer.TYPE, Integer.TYPE, Boolean.TYPE, Boolean.TYPE); - - return (Integer) ElectricItem_discharge.invoke(null, itemStack, amount, tier, ignoreTransferLimit, simulate); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * 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 static boolean canUse(ItemStack itemStack, int amount) { - try { - if (ElectricItem_canUse == null) ElectricItem_canUse = Class.forName(getPackage() + ".common.ElectricItem").getMethod("canUse", ItemStack.class, Integer.TYPE); - - return (Boolean) ElectricItem_canUse.invoke(null, itemStack, amount); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * - * @param itemStack electric item's stack - * @param amount amount of energy to discharge in EU - * @param player player holding the item - * @return true if the operation succeeded - */ - public static boolean use(ItemStack itemStack, int amount, EntityPlayer player) { - try { - if (ElectricItem_use == null) ElectricItem_use = Class.forName(getPackage() + ".common.ElectricItem").getMethod("use", ItemStack.class, Integer.TYPE, EntityPlayer.class); - - return (Boolean) ElectricItem_use.invoke(null, itemStack, amount, player); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Charge an item from the BatPack a player is wearing. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * use() already contains this functionality. - * - * @param itemStack electric item's stack - * @param player player holding the item - */ - public static void chargeFromArmor(ItemStack itemStack, EntityPlayer player) { - try { - if (ElectricItem_chargeFromArmor == null) ElectricItem_chargeFromArmor = Class.forName(getPackage() + ".common.ElectricItem").getMethod("chargeFromArmor", ItemStack.class, EntityPlayer.class); - - ElectricItem_chargeFromArmor.invoke(null, itemStack, player); - } 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 = ElectricItem.class.getPackage(); - if (pkg != null) return pkg.getName().substring(0, pkg.getName().lastIndexOf('.')); - else return "ic2"; - } - - private static Method ElectricItem_charge; - private static Method ElectricItem_discharge; - private static Method ElectricItem_canUse; - private static Method ElectricItem_use; - private static Method ElectricItem_chargeFromArmor; -} - diff --git a/src/common/ic2/api/EnergyNet.java b/src/common/ic2/api/EnergyNet.java deleted file mode 100644 index 2e98537e9..000000000 --- a/src/common/ic2/api/EnergyNet.java +++ /dev/null @@ -1,119 +0,0 @@ -package ic2.api; - -import java.lang.reflect.Method; - -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; - -/** - * Provides access to the energy network. - */ -public final class EnergyNet { - /** - * Gets the EnergyNet instance for the specified world. - * - * @param world world - * @return EnergyNet instance for the world - */ - public static EnergyNet getForWorld(World world) { - try { - if (EnergyNet_getForWorld == null) EnergyNet_getForWorld = Class.forName(getPackage() + ".common.EnergyNet").getMethod("getForWorld", World.class); - - return new EnergyNet(EnergyNet_getForWorld.invoke(null, world)); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private EnergyNet(Object energyNetInstance) { - this.energyNetInstance = energyNetInstance; - } - - /** - * Add a tile entity to the energy network. - * The tile entity has to be valid and initialized. - * - * @param addedTileEntity tile entity to add - */ - public void addTileEntity(TileEntity addedTileEntity) { - try { - if (EnergyNet_addTileEntity == null) EnergyNet_addTileEntity = Class.forName(getPackage() + ".common.EnergyNet").getMethod("addTileEntity", TileEntity.class); - - EnergyNet_addTileEntity.invoke(energyNetInstance, addedTileEntity); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Removes a tile entity from the energy network. - * The tile entity has to be still valid. - * - * @param removedTileEntity tile entity to remove - */ - public void removeTileEntity(TileEntity removedTileEntity) { - try { - if (EnergyNet_removeTileEntity == null) EnergyNet_removeTileEntity = Class.forName(getPackage() + ".common.EnergyNet").getMethod("removeTileEntity", TileEntity.class); - - EnergyNet_removeTileEntity.invoke(energyNetInstance, removedTileEntity); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Emit energy from an energy source to the energy network. - * - * @param energySource energy source to emit energy from - * @param amount amount of energy to emit in EU - * @return Leftover (unused) power - */ - public int emitEnergyFrom(IEnergySource energySource, int amount) { - try { - if (EnergyNet_emitEnergyFrom == null) EnergyNet_emitEnergyFrom = Class.forName(getPackage() + ".common.EnergyNet").getMethod("emitEnergyFrom", IEnergySource.class, Integer.TYPE); - - return ((Integer) EnergyNet_emitEnergyFrom.invoke(energyNetInstance, energySource, amount)).intValue(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Get the amount of energy currently being conducted by a conductor. - * Call this twice with a delay to get the average conducted power by doing (call2 - call1) / 2. - * - * @param tileEntity conductor - */ - public long getTotalEnergyConducted(TileEntity tileEntity) { - try { - if (EnergyNet_getTotalEnergyConducted == null) EnergyNet_getTotalEnergyConducted = Class.forName(getPackage() + ".common.EnergyNet").getMethod("getTotalEnergyConducted", TileEntity.class); - - return ((Long) EnergyNet_getTotalEnergyConducted.invoke(energyNetInstance, tileEntity)).longValue(); - } 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 = EnergyNet.class.getPackage(); - if (pkg != null) return pkg.getName().substring(0, pkg.getName().lastIndexOf('.')); - else return "ic2"; - } - - /** - * Instance of the energy network. - */ - Object energyNetInstance; - - private static Method EnergyNet_getForWorld; - private static Method EnergyNet_addTileEntity; - private static Method EnergyNet_removeTileEntity; - private static Method EnergyNet_emitEnergyFrom; - private static Method EnergyNet_getTotalEnergyConducted; -} - diff --git a/src/common/ic2/api/ExplosionWhitelist.java b/src/common/ic2/api/ExplosionWhitelist.java deleted file mode 100644 index d36ccc362..000000000 --- a/src/common/ic2/api/ExplosionWhitelist.java +++ /dev/null @@ -1,46 +0,0 @@ -package ic2.api; - -import java.util.*; - -import net.minecraft.src.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/common/ic2/api/IBoxable.java b/src/common/ic2/api/IBoxable.java deleted file mode 100644 index 9125954a8..000000000 --- a/src/common/ic2/api/IBoxable.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api; - -import net.minecraft.src.ItemStack; - -/** - * Provides custom toolbox storage behavior for items. - * - * The normal condition for storing an item in a toolbox is having a maximum stack size of 1. - */ -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/common/ic2/api/IC2Reactor.java b/src/common/ic2/api/IC2Reactor.java deleted file mode 100644 index 2faa2dd72..000000000 --- a/src/common/ic2/api/IC2Reactor.java +++ /dev/null @@ -1,28 +0,0 @@ -package ic2.api; - -import java.lang.reflect.Field; - -public class IC2Reactor { - private static Field energyGeneratorNuclear; - - public int getEUOutput() { - try { - if (energyGeneratorNuclear == null) energyGeneratorNuclear = Class.forName(getPackage() + ".common.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 = NetworkHelper.class.getPackage(); - if (pkg != null) return pkg.getName().substring(0, pkg.getName().lastIndexOf('.')); - else return "ic2"; - } -} diff --git a/src/common/ic2/api/IElectricItem.java b/src/common/ic2/api/IElectricItem.java deleted file mode 100644 index 20a19e477..000000000 --- a/src/common/ic2/api/IElectricItem.java +++ /dev/null @@ -1,52 +0,0 @@ -package ic2.api; - -/** - * Provides the ability to store energy on the implementing item. - * - * The item should have a maximum damage of 13. - */ -public interface IElectricItem { - /** - * Determine if the item can be used in a machine to supply energy. - * - * @return Whether the item can supply energy - */ - boolean canProvideEnergy(); - - /** - * Get the item ID to use for a charge energy greater than 0. - * - * @return Item ID to use - */ - int getChargedItemId(); - - /** - * Get the item ID to use for a charge energy of 0. - * - * @return Item ID to use - */ - int getEmptyItemId(); - - /** - * Get the item's maximum charge energy in EU. - * - * @return Maximum charge energy - */ - int getMaxCharge(); - - /** - * Get the item's tier, lower tiers can't send energy to higher ones. - * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3. - * - * @return Item's tier - */ - int getTier(); - - /** - * Get the item's transfer limit in EU per transfer operation. - * - * @return Transfer limit - */ - int getTransferLimit(); -} - diff --git a/src/common/ic2/api/IEnergyAcceptor.java b/src/common/ic2/api/IEnergyAcceptor.java deleted file mode 100644 index 4b0019238..000000000 --- a/src/common/ic2/api/IEnergyAcceptor.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api; - -import net.minecraft.src.TileEntity; - -/** - * For internal usage only. - * - * @see IEnergySink - * @see IEnergyConductor - */ -public interface IEnergyAcceptor extends IEnergyTile { - /** - * Determine if this acceptor can accept current from an adjacent emitter in a direction. - * - * @param emitter energy emitter - * @param direction direction the energy is being received from - */ - boolean acceptsEnergyFrom(TileEntity emitter, Direction direction); -} - diff --git a/src/common/ic2/api/IEnergyConductor.java b/src/common/ic2/api/IEnergyConductor.java deleted file mode 100644 index 3d755404f..000000000 --- a/src/common/ic2/api/IEnergyConductor.java +++ /dev/null @@ -1,51 +0,0 @@ -package ic2.api; - -/** - * Tile entities which conduct energy pulses without buffering (mostly cables) have to implement this - * interface. - */ -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/common/ic2/api/IEnergyEmitter.java b/src/common/ic2/api/IEnergyEmitter.java deleted file mode 100644 index 94699b9a5..000000000 --- a/src/common/ic2/api/IEnergyEmitter.java +++ /dev/null @@ -1,21 +0,0 @@ -package ic2.api; - -import net.minecraft.src.TileEntity; - -/** - * For internal usage only. - * - * @see IEnergySource - * @see IEnergyConductor - */ -public interface IEnergyEmitter extends IEnergyTile { - /** - * Determine if this emitter can emit energy to an adjacent receiver. - * - * @param receiver receiver - * @param direction direction the receiver is from the emitter - * @return Whether energy should be emitted - */ - boolean emitsEnergyTo(TileEntity receiver, Direction direction); -} - diff --git a/src/common/ic2/api/IEnergySink.java b/src/common/ic2/api/IEnergySink.java deleted file mode 100644 index a0ed9a55a..000000000 --- a/src/common/ic2/api/IEnergySink.java +++ /dev/null @@ -1,23 +0,0 @@ -package ic2.api; - -/** - * Allows a tile entity (mostly a machine) to receive energy. - */ -public interface IEnergySink extends IEnergyAcceptor { - /** - * Determine whether the sink requires energy. - * - * @return Whether the sink is requiring energy - */ - boolean demandsEnergy(); - - /** - * Transfer energy to the sink. - * - * @param directionFrom direction from which the energy comes from - * @param amount energy to be transferred - * @return Energy not consumed (leftover) - */ - int injectEnergy(Direction directionFrom, int amount); -} - diff --git a/src/common/ic2/api/IEnergySource.java b/src/common/ic2/api/IEnergySource.java deleted file mode 100644 index 39d14a20d..000000000 --- a/src/common/ic2/api/IEnergySource.java +++ /dev/null @@ -1,15 +0,0 @@ -package ic2.api; - -/** - * Allows a tile entity (mostly a generator) to emit energy. - */ -public interface IEnergySource extends IEnergyEmitter { - /** - * Maximum energy output provided by the source. - * If unsure, use Integer.MAX_VALUE. - * - * @return Maximum energy output - */ - int getMaxEnergyOutput(); -} - diff --git a/src/common/ic2/api/IEnergyStorage.java b/src/common/ic2/api/IEnergyStorage.java deleted file mode 100644 index a89bd7dcd..000000000 --- a/src/common/ic2/api/IEnergyStorage.java +++ /dev/null @@ -1,27 +0,0 @@ -package ic2.api; - -/** - * Interface implemented by the tile entity of energy storage blocks. - */ -public interface IEnergyStorage { - /** - * Get the amount of energy currently stored in the block. - * - * @return Energy stored in the block - */ - public int getStored(); - - /** - * Get the maximum amount of energy the block can store. - * - * @return Maximum energy stored - */ - public int getCapacity(); - - /** - * Get the block's energy output. - * - * @return Energy output in EU/t - */ - public int getOutput(); -} diff --git a/src/common/ic2/api/IEnergyTile.java b/src/common/ic2/api/IEnergyTile.java deleted file mode 100644 index 10445432a..000000000 --- a/src/common/ic2/api/IEnergyTile.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api; - -/** - * For internal usage only. - * - * @see IEnergySink - * @see IEnergySource - * @see IEnergyConductor - */ -public interface IEnergyTile { - /** - * Determine if this tile entity has been added to the energy network - * - * @return Whether the tile entity has been added - */ - boolean isAddedToEnergyNet(); -} - diff --git a/src/common/ic2/api/IMetalArmor.java b/src/common/ic2/api/IMetalArmor.java deleted file mode 100644 index fe8db2edf..000000000 --- a/src/common/ic2/api/IMetalArmor.java +++ /dev/null @@ -1,20 +0,0 @@ -package ic2.api; - -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.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/common/ic2/api/INetworkClientTileEntityEventListener.java b/src/common/ic2/api/INetworkClientTileEntityEventListener.java deleted file mode 100644 index 594f1d7f8..000000000 --- a/src/common/ic2/api/INetworkClientTileEntityEventListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package ic2.api; - -import net.minecraft.src.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/common/ic2/api/INetworkDataProvider.java b/src/common/ic2/api/INetworkDataProvider.java deleted file mode 100644 index da393868f..000000000 --- a/src/common/ic2/api/INetworkDataProvider.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api; - -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/common/ic2/api/INetworkItemEventListener.java b/src/common/ic2/api/INetworkItemEventListener.java deleted file mode 100644 index a0126b399..000000000 --- a/src/common/ic2/api/INetworkItemEventListener.java +++ /dev/null @@ -1,18 +0,0 @@ -package ic2.api; - -import net.minecraft.src.EntityPlayer; - -/** - * Allows an item to receive network events received from the server. - */ -public interface INetworkItemEventListener { - /** - * Called when a network event is received. - * - * @param metaData item metadata - * @param player player containing the item - * @param event event ID - */ - void onNetworkEvent(int metaData, EntityPlayer player, int event); -} - diff --git a/src/common/ic2/api/INetworkTileEntityEventListener.java b/src/common/ic2/api/INetworkTileEntityEventListener.java deleted file mode 100644 index 4433cb898..000000000 --- a/src/common/ic2/api/INetworkTileEntityEventListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api; - -/** - * 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/common/ic2/api/INetworkUpdateListener.java b/src/common/ic2/api/INetworkUpdateListener.java deleted file mode 100644 index be2adb881..000000000 --- a/src/common/ic2/api/INetworkUpdateListener.java +++ /dev/null @@ -1,14 +0,0 @@ -package ic2.api; - -/** - * 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/common/ic2/api/IPaintableBlock.java b/src/common/ic2/api/IPaintableBlock.java deleted file mode 100644 index fb579cd2a..000000000 --- a/src/common/ic2/api/IPaintableBlock.java +++ /dev/null @@ -1,21 +0,0 @@ -package ic2.api; - -import net.minecraft.src.World; - -/** - * Allows a block to be painted by a Painter. - */ -public interface IPaintableBlock -{ - /** - * Color the block. - * - * @param world block's world - * @param x block X position - * @param y block Y position - * @param z block Z position - * @param color painter color, same as dye metadata values - * @return Whether the block was painted and the painter should be damaged - */ - public boolean colorBlock(World world, int x, int y, int z, int color); -} diff --git a/src/common/ic2/api/IReactor.java b/src/common/ic2/api/IReactor.java deleted file mode 100644 index 674b2d4dd..000000000 --- a/src/common/ic2/api/IReactor.java +++ /dev/null @@ -1,134 +0,0 @@ -package ic2.api; - -import net.minecraft.src.ChunkCoordinates; -import net.minecraft.src.ItemStack; -import net.minecraft.src.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); - - /** - * 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 in EU/t - */ - public int getOutput(); - - /** - * Add's the given amount of energy to the Reactor's output. - * - * @return Energy output after adding the value, in EU/t - */ - public int addOutput(int energy); - - /** - * Replaced by IC2Reactor.getEUOutput() - stays at the universal output value of 1 for compatibility - */ - @Deprecated - public int getPulsePower(); - - /** - * Get the item at the specified grid coordinates. - * - * @param x X position of the item - * @param y Y position of the item - * @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 - * @param y Y position of the item - * @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/common/ic2/api/IReactorChamber.java b/src/common/ic2/api/IReactorChamber.java deleted file mode 100644 index fad40c275..000000000 --- a/src/common/ic2/api/IReactorChamber.java +++ /dev/null @@ -1,13 +0,0 @@ -package ic2.api; - -/** - * 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/common/ic2/api/IReactorComponent.java b/src/common/ic2/api/IReactorComponent.java deleted file mode 100644 index 26de8f2c2..000000000 --- a/src/common/ic2/api/IReactorComponent.java +++ /dev/null @@ -1,97 +0,0 @@ -package ic2.api; - -import net.minecraft.src.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 - */ - public void processChamber(IReactor reactor, ItemStack yourStack, int x, int y); - - /** - * 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 - * @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); - - /** - * 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/common/ic2/api/ITerraformingBP.java b/src/common/ic2/api/ITerraformingBP.java deleted file mode 100644 index 490d4ee2e..000000000 --- a/src/common/ic2/api/ITerraformingBP.java +++ /dev/null @@ -1,35 +0,0 @@ -package ic2.api; - -import net.minecraft.src.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/common/ic2/api/IWrenchable.java b/src/common/ic2/api/IWrenchable.java deleted file mode 100644 index f29253617..000000000 --- a/src/common/ic2/api/IWrenchable.java +++ /dev/null @@ -1,50 +0,0 @@ -package ic2.api; - -import net.minecraft.src.EntityPlayer; - -/** - * Allows a tile entity to make use of the wrench's removal and rotation functions. - */ -public interface IWrenchable { - /** - * Determine if the wrench can be used to set the block's facing. - * Called before wrenchCanRemove(). - * - * @param entityPlayer player using the wrench - * @param side block's side the wrench was clicked on - * @return Whether the wrenching was done and the wrench should be damaged - */ - boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side); - - /** - * Get the block's facing. - * - * @return Block facing - */ - short getFacing(); - - /** - * Set the block's facing - * - * @param facing facing to set the block to - */ - void setFacing(short facing); - - /** - * Determine if the wrench can be used to remove the block. - * Called if wrenchSetFacing fails. - * - * @param entityPlayer player using the wrench - * @return Whether the wrenching was done and the wrench should be damaged - */ - boolean wrenchCanRemove(EntityPlayer entityPlayer); - - /** - * Determine the probability to drop the block as it is. - * The first entry in getBlockDropped will be replaced by blockid:meta if the drop is successful. - * - * @return Probability from 0 to 1 - */ - float getWrenchDropRate(); -} - diff --git a/src/common/ic2/api/Ic2Recipes.java b/src/common/ic2/api/Ic2Recipes.java deleted file mode 100644 index 6d286cb16..000000000 --- a/src/common/ic2/api/Ic2Recipes.java +++ /dev/null @@ -1,358 +0,0 @@ -package ic2.api; - -import java.lang.reflect.Array; -import java.util.AbstractMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.src.Block; -import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; - -/** - * Provides access to Compressor, Extractor and Macerator recipes, as well as charge-aware recipes - * and the Recycler blacklist. - * - * The recipes are only valid after IC2 has been loaded and are metadata and stack size sensitive, - * for example you can create a recipe to compress 3 wooden planks into 2 sticks. - */ -public final class Ic2Recipes { - /** - * Add a charge-aware shaped crafting recipe. - */ - public static void addCraftingRecipe(ItemStack result, Object... args) { - try { - Class.forName(getPackage() + ".common.AdvRecipe").getMethod("addAndRegister", ItemStack.class, Array.newInstance(Object.class, 0).getClass()).invoke(null, result, args); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Add a charge-aware shapeless crafting recipe. - */ - public static void addShapelessCraftingRecipe(ItemStack result, Object... args) { - try { - Class.forName(getPackage() + ".common.AdvShapelessRecipe").getMethod("addAndRegister", ItemStack.class, Array.newInstance(Object.class, 0).getClass()).invoke(null, result, args); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Retrieve the registered Compressor recipes. - * - * @return Recipe list as a list of map entries, the key is the input and the value is the output - */ - public static List > getCompressorRecipes() { - if (TileEntityCompressor_recipes == null) { - try { - TileEntityCompressor_recipes = (List >) Class.forName(getPackage() + ".common.TileEntityCompressor").getField("recipes").get(null); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - return TileEntityCompressor_recipes; - } - - /** - * Add a Compressor recipe. - * - * @param input Input - * @param output Output - */ - public static void addCompressorRecipe(ItemStack input, ItemStack output) { - getCompressorRecipes().add(new AbstractMap.SimpleEntry(input, output)); - } - - - /** - * Get the Compressor output for an input item. - * - * @param input input item - * @param adjustInput remove the processing requirements from input - * @return Output item as an independent stack - */ - public static ItemStack getCompressorOutputFor(ItemStack input, boolean adjustInput) { - return getOutputFor(input, adjustInput, getCompressorRecipes()); - } - - /** - * Retrieve the registered Extractor recipes. - * - * @return Recipe list as a list of map entries, the key is the input and the value is the output - */ - public static List > getExtractorRecipes() { - if (TileEntityExtractor_recipes == null) { - try { - TileEntityExtractor_recipes = (List >) Class.forName(getPackage() + ".common.TileEntityExtractor").getField("recipes").get(null); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - return TileEntityExtractor_recipes; - } - - /** - * Add a Extractor recipe. - * - * @param input Input - * @param output Output - */ - public static void addExtractorRecipe(ItemStack input, ItemStack output) { - getExtractorRecipes().add(new AbstractMap.SimpleEntry(input, output)); - } - - - /** - * Get the Extractor output for an input item. - * - * @param input input item - * @param adjustInput remove the processing requirements from input - * @return Output item as an independent stack - */ - public static ItemStack getExtractorOutputFor(ItemStack input, boolean adjustInput) { - return getOutputFor(input, adjustInput, getExtractorRecipes()); - } - - /** - * Retrieve the registered Macerator recipes. - * - * @return Recipe list as a list of map entries, the key is the input and the value is the output - */ - public static List > getMaceratorRecipes() { - if (TileEntityMacerator_recipes == null) { - try { - TileEntityMacerator_recipes = (List >) Class.forName(getPackage() + ".common.TileEntityMacerator").getField("recipes").get(null); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - return TileEntityMacerator_recipes; - } - - /** - * Add a Macerator recipe. - * - * @param input Input - * @param output Output - */ - public static void addMaceratorRecipe(ItemStack input, ItemStack output) { - getMaceratorRecipes().add(new AbstractMap.SimpleEntry(input, output)); - } - - - /** - * Get the Macerator output for an input item. - * - * @param input input item - * @param adjustInput remove the processing requirements from input - * @return Output item as an independent stack - */ - public static ItemStack getMaceratorOutputFor(ItemStack input, boolean adjustInput) { - return getOutputFor(input, adjustInput, getMaceratorRecipes()); - } - - - private static ItemStack getOutputFor(ItemStack input, boolean adjustInput, List > recipeList) { - assert input != null; - - for (Map.Entry entry: recipeList) { - if (entry.getKey().isItemEqual(input) && input.stackSize >= entry.getKey().stackSize) { - if (adjustInput) input.stackSize -= entry.getKey().stackSize; - - return entry.getValue().copy(); - } - } - - return null; - } - - - /** - * Retrieve the registered Recycler blacklist items. - * - * @return Blacklist - */ - public static List getRecyclerBlacklist() { - if (TileEntityRecycler_blacklist == null) { - try { - TileEntityRecycler_blacklist = (List) Class.forName(getPackage() + ".common.TileEntityRecycler").getField("blacklist").get(null); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - return TileEntityRecycler_blacklist; - } - - /** - * Add an item stack to the Recycler blacklist. - * - * @param newBlacklistedItem item stack to add - */ - public static void addRecyclerBlacklistItem(ItemStack newBlacklistedItem) { - getRecyclerBlacklist().add(newBlacklistedItem); - } - - /** - * Add an item to the Recycler blacklist. - * - * @param newBlacklistedItem item to add - */ - public static void addRecyclerBlacklistItem(Item newBlacklistedItem) { - addRecyclerBlacklistItem(new ItemStack(newBlacklistedItem, 1, -1)); - } - - /** - * Add a block to the Recycler blacklist. - * - * @param newBlacklistedBlock block to add - */ - public static void addRecyclerBlacklistItem(Block newBlacklistedBlock) { - addRecyclerBlacklistItem(new ItemStack(newBlacklistedBlock, 1, -1)); - } - - - /** - * Determine if an item is in the Recycler blacklist. - * - * @param itemStack item to check - * @return Whether the item is blacklisted or not - */ - public static boolean isRecyclerInputBlacklisted(ItemStack itemStack) { - for (ItemStack blackItem: getRecyclerBlacklist()) { - if (itemStack.isItemEqual(blackItem)) return true; - } - - return false; - } - - /** - * Retrieve the registered Scrap Box drops. - * - * @return Drops as a list of item stack and float (chance) pairs - */ - public static List> getScrapboxDrops() { - try { - return (List>) Class.forName(getPackage() + ".common.ItemScrapbox").getMethod("getDropList").invoke(null); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /* - * Reference scrap box chance values: - * - * 0.1: Diamond - * 0.5: Cake, Gold Helmet, Iron Ore, Gold Ore - * 1.0: Wooden tools, Soul Sand, Sign, Leather, Feather, Bone - * 1.5: Apple, Bread - * 2.0: Netherrack, Rotten Flesh - * 3.0: Grass, Gravel - * 4.0: Stick - * 5.0: Dirt, Wooden Hoe - */ - - /** - * Add an item stack to the Scrap Box drops. - * - * @param dropItem item stack to add - * @param chance chance for the item to drop, see the code comments for reference values - */ - public static void addScrapboxDrop(ItemStack dropItem, float chance) { - try { - Class.forName(getPackage() + ".common.ItemScrapbox").getMethod("addDrop", ItemStack.class, float.class).invoke(null, dropItem, chance); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Add an item to the Scrap Box drops. - * - * @param dropItem item to add - * @param chance chance for the item to drop, see the code comments for reference values - */ - public static void addScrapboxDrop(Item dropItem, float chance) { - addScrapboxDrop(new ItemStack(dropItem, 1), chance); - } - - /** - * Add a block to the Scrap Box drops. - * - * @param dropItem item to add - * @param chance chance for the item to drop, see the code comments for reference values - */ - public static void addScrapboxDrop(Block dropItem, float chance) { - addScrapboxDrop(new ItemStack(dropItem), chance); - } - - /** - * Retrieve the registered Mass Fabricator amplifiers. - * - * @return Amplifiers as a list of item stack and integer (amplifier value) pairs - */ - public static List > getMatterAmplifiers() { - if (TileEntityMatter_amplifiers == null) { - try { - TileEntityMatter_amplifiers = (List >) Class.forName(getPackage() + ".common.TileEntityMatter").getField("amplifiers").get(null); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - return TileEntityMatter_amplifiers; - } - - /** - * Add an item stack to the Mass Fabricator amplifiers. - * - * @param amplifierItem item stack to add - * @param value amplifier value for the item, scrap is 5000 - */ - public static void addMatterAmplifier(ItemStack amplifierItem, int value) { - getMatterAmplifiers().add(new AbstractMap.SimpleEntry(amplifierItem, value)); - } - - /** - * Add an item to the Mass Fabricator amplifiers. - * - * @param amplifierItem item to add - * @param value amplifier value for the item, scrap is 5000 - */ - public static void addMatterAmplifier(Item amplifierItem, int value) { - addMatterAmplifier(new ItemStack(amplifierItem, 1, -1), value); - } - - /** - * Add a block to the Mass Fabricator amplifiers. - * - * @param amplifierItem item to add - * @param value amplifier value for the item, scrap is 5000 - */ - public static void addMatterAmplifier(Block amplifierItem, int value) { - addMatterAmplifier(new ItemStack(amplifierItem, 1, -1), value); - } - - /** - * 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 = Ic2Recipes.class.getPackage(); - if (pkg != null) return pkg.getName().substring(0, pkg.getName().lastIndexOf('.')); - else return "ic2"; - } - - private static List > TileEntityCompressor_recipes; - private static List > TileEntityExtractor_recipes; - private static List > TileEntityMacerator_recipes; - private static List TileEntityRecycler_blacklist; - private static List > TileEntityMatter_amplifiers; -} - diff --git a/src/common/ic2/api/Items.java b/src/common/ic2/api/Items.java deleted file mode 100644 index 5835eb5dd..000000000 --- a/src/common/ic2/api/Items.java +++ /dev/null @@ -1,401 +0,0 @@ -package ic2.api; - -import net.minecraft.src.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 Items { - /** - * 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() + ".common.Ic2Items"); - - Object ret = Ic2Items.getField(name).get(null); - - if (ret instanceof ItemStack) { - return (ItemStack) ret; - } else { - return null; - } - } catch (Exception e) { - System.out.println("IC2 API: Call getItem failed for "+name); - - return null; - } - } - - /* Possible values: - - ----- blocks ----- - - 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 - - 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 - - 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 - - bronzeBlock Bronze block, meta sensitive - copperBlock Copper block, meta sensitive - tinBlock Tin block, meta sensitive - uraniumBlock 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 - - 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 - - energy storages (TE implements IEnergySource and IEnergyConductor) - batBox BatBox 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 - - 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 - - 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 - - - ----- items ----- - - rubber + related - resin Resin item, currently not meta sensitive - rubber Rubber item, currently not meta sensitive, ore dictionary: itemRubber - - ore drops - uraniumDrop Uranium Drop item, currently not meta sensitive, ore dictionary: itemDropUranium - - dusts - bronzeDust Bronze Dust item, currently not meta sensitive - clayDust Clay Dust item, currently not meta sensitive - coalDust Coal Dust item, currently not meta sensitive - copperDust Copper Dust item, currently not meta sensitive - goldDust Gold Dust item, currently not meta sensitive - ironDust Iron Dust item, currently not meta sensitive - silverDust Silver Dust item, currently not meta sensitive - smallIronDust Small Iron Dust item, currently not meta sensitive - tinDust Tin Dust item, currently not meta sensitive - hydratedCoalDust Hydrated Coal Dust item, currently not meta sensitive - - ingots - 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 - uraniumIngot Uranium Ingot item, currently not meta sensitive, ore dictionary: ingotUranium - - 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 - - el. tools/devices/weapons - miningDrill Mining Drill item, meta = visual charge indicator, implements IElectricItem - diamondDrill Diamond Tipped Mining Drill item, meta = visual charge indicator, implements IElectricItem - chainsaw Chainsaw item, meta = visual charge indicator, implements IElectricItem - electricWrench Electric Wrench item, meta = visual charge indicator, implements IElectricItem - electricTreetap Electric Treetap item, meta = visual charge indicator, implements IElectricItem - miningLaser Mining Laser item, meta = visual charge indicator, implements IElectricItem - - ecMeter EC-Mater item, currently not meta sensitive - odScanner Ore Density Scanner item, meta = damage value for charge level, implements IElectricItem - ovScanner Ore Value Scanner item, meta = visual charge indicator, implements IElectricItem - - frequencyTransmitter Frequency Transmitter item, currently not meta sensitive - - nanoSaber Idle Nano Saber item, meta = visual charge indicator, implements IElectricItem - enabledNanoSaber Enabled Nano Saber item, meta = visual charge indicator, implements IElectricItem - - armor/wearable - rubberBoots Rubber 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 = visual charge indicator, implements IElectricItem - nanoBodyarmor Nano Bodyarmor item, meta = visual charge indicator, implements IElectricItem - nanoLeggings Nano Leggings Armor item, meta = visual charge indicator, implements IElectricItem - nanoBoots Nano Boots Armor item, meta = visual charge indicator, implements IElectricItem - - quantumHelmet Quantum Helmet Armor item, meta = visual charge indicator, implements IElectricItem - quantumBodyarmor Quantum Bodyarmor item, meta = visual charge indicator, implements IElectricItem - quantumLeggings Quantum Leggings Armor item, meta = visual charge indicator, implements IElectricItem - quantumBoots Quantum Boots Armor item, meta = visual charge indicator, implements IElectricItem - - jetpack Jetpack item, meta = damage value for fuel level - electricJetpack Electric Jetpack item, meta = visual charge indicator, implements IElectricItem - - batPack BatPack item, meta = visual charge indicator, implements IElectricItem, can provide energy - lapPack LapPack item, meta = visual charge indicator, implements IElectricItem, can provide energy - - cfPack CF Pack item, meta = charges (as of v1.45) - - solarHelmet Solar Helmet item, currently not meta sensitive - staticBoots Static Boots item, currently not meta sensitive - - batteries - reBattery Empty RE Battery item, currently not meta sensitive, implements IElectricItem - chargedReBattery RE Battery item, meta = visual charge indicator, implements IElectricItem, can provide energy - energyCrystal Energy Crystal item, meta = visual charge indicator, implements IElectricItem, can provide energy - lapotronCrystal Lapotron Crystal item, meta = visual charge indicator, implements IElectricItem, can provide energy - suBattery SU Battery item, currently not meta sensitive - - 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 - doubleInsulatedGoldCableItem Double Insulated Gold Cable item, meta sensitive - - ironCableItem Iron Cable item, meta sensitive - insulatedIronCableItem Insulated Iron Cable item, meta sensitive - doubleInsulatedIronCableItem Double Insulated Iron Cable item, meta sensitive - trippleInsulatedIronCableItem Tripple Insulated Iron Cable item, meta sensitive - - 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, currently not meta sensitive - lavaCell Lava Cell 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 - waterCell Water Cell item, currently not meta sensitive - electrolyzedWaterCell Electrolyzed Water Cell 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 - uraniumCell Uranium Cell item, meta = damage value - coolingCell Cooling Cell item, meta = damage value - - depletedIsotopeCell Depleted Isotope Cell item, meta = damage value - reEnrichedUraniumCell Re-Enriched Uranium Cell item, currently not meta sensitive - nearDepletedUraniumCell Near-Depleted Uranium Cell item, currently not meta sensitive - - integratedReactorPlating Integrated Reactor Plating item, meta = damage value - integratedHeatDisperser Integrated Heat Disperser item, meta = damage value - - 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 UU-Matter item, currently not meta sensitive - iridiumOre Iridium Ore item, currently not meta sensitive - iridiumPlate Iridium Plate item, currently not meta sensitive - - upgrade modules - overclockerUpgrade overclocker upgrade item, meta sensitive - transformerUpgrade transformer upgrade item, meta sensitive - energyStorageUpgrade energy storage upgrade item, meta sensitive - - misc - coin Coin item, currently not meta sensitive - reinforcedDoor Reinforced Door item, currently not meta sensitive - constructionFoamPellet Construction Foam Pellet item, currently not meta sensitive - 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, meta = charge level - solarHelmet Solar Helmet item, currently not meta sensitive - terraWart Terra Wart item, cures potion effects - weedEx Weed-EX can, meta = uses left - - */ - - /** - * 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 = Items.class.getPackage(); - if (pkg != null) return pkg.getName().substring(0, pkg.getName().lastIndexOf('.')); - else return "ic2"; - } - - private static Class Ic2Items; -} - diff --git a/src/common/ic2/api/NetworkHelper.java b/src/common/ic2/api/NetworkHelper.java deleted file mode 100644 index df0247b0e..000000000 --- a/src/common/ic2/api/NetworkHelper.java +++ /dev/null @@ -1,237 +0,0 @@ -package ic2.api; - -import java.lang.reflect.Method; - -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemStack; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; - -/** - * 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() + ".common.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() + ".common.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() + ".common.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); - } - } - - /** - * Schedule a block update (re-render) on the clients in range. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just trigger the - * block update locally. - * - * @param world World containing the block - * @param x The block's x coordinate - * @param y The block's y coordinate - * @param z The block's z coordinate - */ - public static void announceBlockUpdate(World world, int x, int y, int z) { - try { - if (NetworkManager_announceBlockUpdate == null) NetworkManager_announceBlockUpdate = Class.forName(getPackage() + ".common.NetworkManager").getMethod("announceBlockUpdate", World.class, Integer.TYPE, Integer.TYPE, Integer.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_announceBlockUpdate.invoke(instance, world, x, y, z); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - - // client -> server - - - /** - * Ask the server to send the values of the fields specified. - * - * See updateTileEntityField for the supported field types. - * - * The implementation is currently limited to TileEntitys as data providers. The tile entity - * has to be fully initialized when executing this method (i.e. valid worldObj+coords). - * - * This method doesn't do anything if executed on the server. - * - * @param dataProvider Object implementing the INetworkDataProvider interface - */ - public static void requestInitialData(INetworkDataProvider dataProvider) { - try { - if (NetworkManager_requestInitialData == null) NetworkManager_requestInitialData = Class.forName(getPackage() + ".common.NetworkManager").getMethod("requestInitialData", INetworkDataProvider.class); - if (instance == null) instance = getInstance(); - - NetworkManager_requestInitialData.invoke(instance, dataProvider); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * 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() + ".common.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() + ".common.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) return pkg.getName().substring(0, pkg.getName().lastIndexOf('.')); - else return "ic2"; - } - - /** - * Get the NetworkManager instance, used internally. - * - * @return NetworkManager instance - */ - private static Object getInstance() { - try { - return Class.forName(getPackage() + ".common.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_announceBlockUpdate; - private static Method NetworkManager_requestInitialData; - private static Method NetworkManager_initiateClientTileEntityEvent; - private static Method NetworkManager_initiateClientItemEvent; -} - diff --git a/src/common/ic2/api/TECrop.java b/src/common/ic2/api/TECrop.java deleted file mode 100644 index c341d0325..000000000 --- a/src/common/ic2/api/TECrop.java +++ /dev/null @@ -1,161 +0,0 @@ -package ic2.api; - -import net.minecraft.src.Block; -import net.minecraft.src.ItemStack; -import net.minecraft.src.TileEntity; - -/** - * Provides access to a crop tile entity. Contains all methods and fields you can access from your CropCard. - */ -public abstract class TECrop extends TileEntity -{ - /** - * ID of the plant currently on the crop. - * -1 if there is no plant currently on the crop. - */ - public short id = -1; - - /** - * Current size of the plant. - * 1 is the starting size and the maximum size varies from plant to plant. - */ - public byte size = 0; - - /** - * Growth ability of a plant. - * Higher values give faster growth. - */ - public byte statGrowth = 0; - /** - * Chances and amount of gain and seeds from harvested crops. - * Higher values give more drops. - */ - public byte statGain = 0; - /** - * Ability for the plant to resist trampling. - * Higher values give more resistance against trampling. - */ - public byte statResistance = 0; - - /** - * Scan level, increases each time a seed goes through analysis. - */ - public byte scanLevel = 0; - - /** - * Custom data stored along a TECrop. - */ - public short[] custumData = new short[16]; - - /** - * Crop nutrients. - * Ranges from 0 (empty) to 100 (full). - */ - public int nutrientStorage = 0; - /** - * Crop hydration. - * Values are: - * - 0 for nothing - * - 1-10 for water hydration - * - 11-100 for distilled water (hydration cell) hydration - */ - public int waterStorage = 0; - /** - * Remaining duration of WeedEX - * PRevents weed from growing and protects against (unimplemented) insects or similar stuff - */ - public int exStorage = 0; - - /** - * Crop humidity. - * Ranges from 0 (dry) to 10 (humid). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - */ - public abstract 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() - */ - public abstract 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 abstract byte getAirQuality(); - - /** - * Get the crop's light level. - * - * @return Crop light level - */ - public int getLightLevel() - { - return worldObj.getBlockLightValue(xCoord, yCoord, zCoord); - } - - - /** - * 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 abstract 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 abstract boolean harvest(boolean manual); - - /** - * Fully clears the crop without dropping anything. - */ - public abstract void reset(); - - /** - * Request a texture and lighting update. - */ - public abstract 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 abstract 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 abstract ItemStack generateSeeds(short plant, byte growth, byte gain, byte resis, byte scan); - - /** - * For internal usage only. - */ - public abstract void addLocal(String s1, String s2); - -} diff --git a/src/common/mekanism/api/IEnergyCube.java b/src/common/mekanism/api/IEnergyCube.java new file mode 100644 index 000000000..2a63e9292 --- /dev/null +++ b/src/common/mekanism/api/IEnergyCube.java @@ -0,0 +1,43 @@ +package mekanism.api; + +import net.minecraft.src.*; + +public interface IEnergyCube +{ + public EnumTier getTier(ItemStack itemstack); + + public void setTier(ItemStack itemstack, EnumTier tier); + + public static enum EnumTier + { + BASIC("Basic", 1000000, 10000), + ADVANCED("Advanced", 2500000, 25000), + ULTIMATE("Ultimate", 5000000, 50000); + + public double MAX_ELECTRICITY; + public double VOLTAGE; + public int DIVIDER; + public String name; + + public static EnumTier getFromName(String gasName) + { + for(EnumTier tier : values()) + { + if(gasName.contains(tier.name)) + { + return tier; + } + } + + System.out.println("[Mekanism] Invalid tier identifier when retrieving with name."); + return BASIC; + } + + private EnumTier(String s, double maxEnergy, int divider) + { + name = s; + MAX_ELECTRICITY = maxEnergy; + DIVIDER = divider; + } + } +} diff --git a/src/common/mekanism/api/IStorageTank.java b/src/common/mekanism/api/IStorageTank.java index 6444c585a..a4acaad68 100644 --- a/src/common/mekanism/api/IStorageTank.java +++ b/src/common/mekanism/api/IStorageTank.java @@ -3,7 +3,7 @@ package mekanism.api; import net.minecraft.src.*; /** - * Implement this in your item class if it can store or transfer hydrogen. + * Implement this in your item class if it can store or transfer certain gasses. * @author AidanBrady * */ @@ -12,16 +12,17 @@ public interface IStorageTank /** * Gets the amount of gas the item has from NBT storage. * @param itemstack - * @return amount of hydrogen + * @return amount of gas */ public int getGas(ItemStack itemstack); /** - * Sets the hydrogen the item has with NBT. - * @param itemstack - * @param energy + * Sets the gas the item has stored in it's NBTTagCompound. + * @param itemstack - itemstack of a Storage Tank to set the gas of + * @param type - the type of gas to set + * @param amount - the amount of gas to set */ - public void setGas(ItemStack itemstack, int hydrogen); + public void setGas(ItemStack itemstack, EnumGas type, int amount); /** * Gets the maximum amount of hydrogen this item can hold. @@ -36,20 +37,22 @@ public interface IStorageTank public int getRate(); /** - * Charges the item with the defined amount of hydrogen. - * @param itemstack - * @param amount - * @return leftover hydrogen + * Adds a defined about of a certain gas to a Storage Tank. + * @param itemstack - the itemstack of a Storage Tank to add gas to + * @param type - the type of gas to add + * @param amount - the amount of gas to add + * @return leftover gas */ - public int addGas(ItemStack itemstack, int amount); + public int addGas(ItemStack itemstack, EnumGas type, int amount); /** - * Removes the defined amount of hydrogen from the item. - * @param itemstack - * @param amount - * @return hydrogen discharged + * Removes the defined amount of a certain gas from the item. + * @param itemstack - the itemstack of a Storage Tank to remove gas from + * @param type - the type of gas to remove + * @param amount - the amount of gas to remove + * @return how much gas was used by this item */ - public int removeGas(ItemStack itemstack, int amount); + public int removeGas(ItemStack itemstack, EnumGas type, int amount); /** * Gets the divider that gets that returns the max damage as 100. @@ -58,16 +61,32 @@ public interface IStorageTank public int getDivider(); /** - * Whether or not this energized item be given hydrogen. + * Whether or not this storage tank be given a specific gas. + * @param itemstack - the itemstack to check + * @param type - the type of gas the tank can possibly receive * @return if the item be charged */ - public boolean canReceiveGas(); + public boolean canReceiveGas(ItemStack itemstack, EnumGas type); /** - * Whether or not this energized item can give a hydrogen receiver hydrogen. - * @return if the item can charge + * Whether or not this energized item can give a gas receiver a certain amount of gas. + * @param itemstack - the itemstack to check + * @param type - the type of gas the tank can possibly provide + * @return if the item can provide gas */ - public boolean canProvideGas(); + public boolean canProvideGas(ItemStack itemstack, EnumGas type); - public EnumGas gasType(); + /** + * Gets this storage tank's current stored gas. + * @param itemstack - the itemstack of a Storage Tank to check. + * @return which gas the tank is holding + */ + public EnumGas getGasType(ItemStack itemstack); + + /** + * Sets a storage tank's current stored gas. + * @param itemstack - the itemstack of a Storage Tank to set. + * @param type - the type of gas to change to + */ + public void setGasType(ItemStack itemstack, EnumGas type); } diff --git a/src/common/mekanism/common/BlockPowerUnit.java b/src/common/mekanism/common/BlockEnergyCube.java similarity index 78% rename from src/common/mekanism/common/BlockPowerUnit.java rename to src/common/mekanism/common/BlockEnergyCube.java index 58c665444..9a0beada2 100644 --- a/src/common/mekanism/common/BlockPowerUnit.java +++ b/src/common/mekanism/common/BlockEnergyCube.java @@ -7,6 +7,7 @@ import java.util.Random; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; +import mekanism.api.IEnergyCube.EnumTier; import net.minecraft.src.*; import net.minecraftforge.common.ForgeDirection; @@ -18,17 +19,23 @@ import net.minecraftforge.common.ForgeDirection; * @author AidanBrady * */ -public class BlockPowerUnit extends BlockContainer +public class BlockEnergyCube extends BlockContainer { private Random powerRand = new Random(); - public BlockPowerUnit(int id) + public BlockEnergyCube(int id) { super(id, Material.iron); setHardness(2F); setResistance(4F); setCreativeTab(Mekanism.tabMekanism); - setRequiresSelfNotify(); + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + @Override + public void setBlockBoundsForItemRender() + { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } @Override @@ -38,22 +45,32 @@ public class BlockPowerUnit extends BlockContainer { if(side == 3) { - return 23; + return 4; } else { - return 24; + return 21; } } else if(meta == 1) { if(side == 3) { - return 21; + return 38; } else { return 22; } } + else if(meta == 2) + { + if(side == 3) + { + return 24; + } + else { + return 23; + } + } return 0; } @@ -85,55 +102,51 @@ public class BlockPowerUnit extends BlockContainer tileEntity.setFacing((short)change); } - - @Override - public int damageDropped(int i) - { - return i; - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(int i, CreativeTabs creativetabs, List list) - { - list.add(new ItemStack(i, 1, 0)); - list.add(new ItemStack(i, 1, 1)); - } @Override @SideOnly(Side.CLIENT) public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) { int metadata = world.getBlockMetadata(x, y, z); - TileEntityPowerUnit tileEntity = (TileEntityPowerUnit)world.getBlockTileEntity(x, y, z); + TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getBlockTileEntity(x, y, z); - if(metadata == 0) + if(tileEntity.tier == EnumTier.BASIC) { if(side == tileEntity.facing) { - return 23; + return 4; } else { - return 24; + return 21; } } - else if(metadata == 1) + else if(tileEntity.tier == EnumTier.ADVANCED) { if(side == tileEntity.facing) { - return 21; + return 38; } else { return 22; } } + else if(tileEntity.tier == EnumTier.ULTIMATE) + { + if(side == tileEntity.facing) + { + return 24; + } + else { + return 23; + } + } return 0; } @Override public void breakBlock(World world, int par2, int par3, int par4, int i1, int i2) { - TileEntityPowerUnit var5 = (TileEntityPowerUnit)world.getBlockTileEntity(par2, par3, par4); + TileEntityEnergyCube var5 = (TileEntityEnergyCube)world.getBlockTileEntity(par2, par3, par4); if (var5 != null) { @@ -182,6 +195,23 @@ public class BlockPowerUnit extends BlockContainer super.breakBlock(world, par2, par3, par4, i1, i2); } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(int i, CreativeTabs creativetabs, List list) + { + for(EnumTier tier : EnumTier.values()) + { + ItemStack discharged = new ItemStack(this); + discharged.setItemDamage(100); + ((ItemBlockEnergyCube)discharged.getItem()).setTier(discharged, tier); + list.add(discharged); + ItemStack charged = new ItemStack(this); + ((ItemBlockEnergyCube)charged.getItem()).setTier(charged, tier); + ((ItemBlockEnergyCube)charged.getItem()).setJoules(tier.MAX_ELECTRICITY, charged); + list.add(charged); + }; + } + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3) { @@ -190,7 +220,7 @@ public class BlockPowerUnit extends BlockContainer return true; } else { - TileEntityPowerUnit tileEntity = (TileEntityPowerUnit)world.getBlockTileEntity(x, y, z); + TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getBlockTileEntity(x, y, z); int metadata = world.getBlockMetadata(x, y, z); if (tileEntity != null) @@ -210,24 +240,10 @@ public class BlockPowerUnit extends BlockContainer { return "/resources/mekanism/textures/terrain.png"; } - - @Override - public TileEntity createNewTileEntity(World world, int metadata) - { - if(metadata == 0) - { - return new TileEntityPowerUnit(); - } - else if(metadata == 1) - { - return new TileEntityAdvancedPowerUnit(); - } - return null; - } @Override public TileEntity createNewTileEntity(World world) { - return null; + return new TileEntityEnergyCube(); } } diff --git a/src/common/mekanism/common/BlockGasTank.java b/src/common/mekanism/common/BlockGasTank.java index 8efac7883..a28e6a6e9 100644 --- a/src/common/mekanism/common/BlockGasTank.java +++ b/src/common/mekanism/common/BlockGasTank.java @@ -135,7 +135,7 @@ public class BlockGasTank extends BlockContainer { if(!entityplayer.isSneaking()) { - entityplayer.openGui(Mekanism.instance, 15, world, x, y, z); + entityplayer.openGui(Mekanism.instance, 10, world, x, y, z); return true; } } diff --git a/src/common/mekanism/common/CommonProxy.java b/src/common/mekanism/common/CommonProxy.java index 71eb08634..a6ffe98be 100644 --- a/src/common/mekanism/common/CommonProxy.java +++ b/src/common/mekanism/common/CommonProxy.java @@ -58,7 +58,7 @@ public class CommonProxy Mekanism.machineBlockID = Mekanism.configuration.getBlock("MachineBlock", 3001).getInt(); Mekanism.oreBlockID = Mekanism.configuration.getBlock("OreBlock", 3002).getInt(); Mekanism.obsidianTNTID = Mekanism.configuration.getBlock("ObsidianTNT", 3003).getInt(); - Mekanism.powerUnitID = Mekanism.configuration.getBlock("PowerUnit", 3004).getInt(); + Mekanism.energyCubeID = Mekanism.configuration.getBlock("EnergyCube", 3004).getInt(); Mekanism.nullRenderID = Mekanism.configuration.getBlock("NullRender", 3007).getInt(); Mekanism.gasTankID = Mekanism.configuration.getBlock("GasTank", 3009).getInt(); Mekanism.extrasEnabled = Mekanism.configuration.get("ExtrasEnabled", Configuration.CATEGORY_GENERAL, true).getBoolean(true); @@ -123,7 +123,7 @@ public class CommonProxy case 7: return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity); case 8: - return new ContainerPowerUnit(player.inventory, (TileEntityPowerUnit)tileEntity); + return new ContainerEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity); case 10: return new ContainerGasTank(player.inventory, (TileEntityGasTank)tileEntity); } diff --git a/src/common/mekanism/common/ContainerPowerUnit.java b/src/common/mekanism/common/ContainerEnergyCube.java similarity index 94% rename from src/common/mekanism/common/ContainerPowerUnit.java rename to src/common/mekanism/common/ContainerEnergyCube.java index c25aca239..d37021b04 100644 --- a/src/common/mekanism/common/ContainerPowerUnit.java +++ b/src/common/mekanism/common/ContainerEnergyCube.java @@ -5,11 +5,11 @@ import universalelectricity.core.implement.IItemElectric; import mekanism.api.*; import net.minecraft.src.*; -public class ContainerPowerUnit extends Container +public class ContainerEnergyCube extends Container { - private TileEntityPowerUnit tileEntity; + private TileEntityEnergyCube tileEntity; - public ContainerPowerUnit(InventoryPlayer inventory, TileEntityPowerUnit unit) + public ContainerEnergyCube(InventoryPlayer inventory, TileEntityEnergyCube unit) { tileEntity = unit; addSlotToContainer(new SlotEnergy(unit, 0, 8, 8)); diff --git a/src/common/mekanism/common/ItemBlockEnergyCube.java b/src/common/mekanism/common/ItemBlockEnergyCube.java index 0dedeebb6..177f080da 100644 --- a/src/common/mekanism/common/ItemBlockEnergyCube.java +++ b/src/common/mekanism/common/ItemBlockEnergyCube.java @@ -5,25 +5,17 @@ import java.util.List; import universalelectricity.core.electricity.ElectricInfo; import universalelectricity.core.electricity.ElectricInfo.ElectricUnit; import universalelectricity.core.implement.IItemElectric; +import mekanism.api.IEnergyCube; import net.minecraft.src.*; -public class ItemBlockEnergyCube extends ItemBlock implements IItemElectric +public class ItemBlockEnergyCube extends ItemBlock implements IItemElectric, IEnergyCube { - /** The maximum amount of energy this item can hold. */ - public double MAX_ELECTRICITY; + public Block metaBlock; - /** How fast this item can transfer energy. */ - public double VOLTAGE; - - /** The number that, when the max amount of energy is divided by, will make it equal 100. */ - public int DIVIDER; - - public ItemBlockEnergyCube(int id, double maxElectricity, double voltage, int divider) + public ItemBlockEnergyCube(int id, Block block) { super(id); - DIVIDER = divider; - MAX_ELECTRICITY = maxElectricity; - VOLTAGE = voltage; + metaBlock = block; setMaxStackSize(1); setMaxDamage(100); setNoRepair(); @@ -38,36 +30,20 @@ public class ItemBlockEnergyCube extends ItemBlock implements IItemElectric list.add("Stored Energy: " + ElectricInfo.getDisplayShort(energy, ElectricUnit.JOULES)); } - @Override - public void onCreated(ItemStack itemstack, World world, EntityPlayer entityplayer) - { - itemstack = getUnchargedItem(); - } - @Override public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { - ItemEnergized item = ((ItemEnergized)itemstack.getItem()); + ItemBlockEnergyCube item = ((ItemBlockEnergyCube)itemstack.getItem()); item.setJoules(item.getJoules(itemstack), itemstack); + item.setTier(itemstack, item.getTier(itemstack)); } - public ItemStack getUnchargedItem() + public ItemStack getUnchargedItem(EnumTier tier) { ItemStack charged = new ItemStack(this); charged.setItemDamage(100); return charged; } - - @Override - public void getSubItems(int i, CreativeTabs tabs, List list) - { - ItemStack discharged = new ItemStack(this); - discharged.setItemDamage(100); - list.add(discharged); - ItemStack charged = new ItemStack(this); - setJoules(((IItemElectric)charged.getItem()).getMaxJoules(), charged); - list.add(charged); - } @Override public double getJoules(Object... data) @@ -92,7 +68,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IItemElectric electricityStored = itemStack.stackTagCompound.getDouble("electricity"); } - itemStack.setItemDamage((int)(MAX_ELECTRICITY - electricityStored)/DIVIDER); + itemStack.setItemDamage((int)(getTier(itemStack).MAX_ELECTRICITY - electricityStored)/getTier(itemStack).DIVIDER); return electricityStored; } @@ -111,28 +87,34 @@ public class ItemBlockEnergyCube extends ItemBlock implements IItemElectric itemStack.setTagCompound(new NBTTagCompound()); } - double electricityStored = Math.max(Math.min(wattHours, getMaxJoules()), 0); + double electricityStored = Math.max(Math.min(wattHours, getMaxJoules(itemStack)), 0); itemStack.stackTagCompound.setDouble("electricity", electricityStored); - itemStack.setItemDamage((int)(MAX_ELECTRICITY - electricityStored)/DIVIDER); + itemStack.setItemDamage((int)(getTier(itemStack).MAX_ELECTRICITY - electricityStored)/getTier(itemStack).DIVIDER); } } @Override public double getMaxJoules(Object... data) { - return MAX_ELECTRICITY; + if(data[0] instanceof ItemStack) + { + ItemStack itemstack = (ItemStack)data[0]; + + return getTier(itemstack).MAX_ELECTRICITY; + } + return EnumTier.BASIC.MAX_ELECTRICITY; } @Override public double getVoltage() { - return VOLTAGE; + return 120; } @Override public double onReceive(double amps, double voltage, ItemStack itemStack) { - double rejectedElectricity = Math.max((getJoules(itemStack) + ElectricInfo.getJoules(amps, voltage, 1)) - getMaxJoules(), 0); + double rejectedElectricity = Math.max((getJoules(itemStack) + ElectricInfo.getJoules(amps, voltage, 1)) - getMaxJoules(itemStack), 0); setJoules(getJoules(itemStack) + ElectricInfo.getJoules(amps, voltage, 1) - rejectedElectricity, itemStack); return rejectedElectricity; } @@ -156,4 +138,52 @@ public class ItemBlockEnergyCube extends ItemBlock implements IItemElectric { return true; } + + @Override + public String getItemNameIS(ItemStack itemstack) + { + return getItemName() + "." + getTier(itemstack).name; + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + boolean place = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); + + if (place) + { + TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getBlockTileEntity(x, y, z); + tileEntity.tier = ((IEnergyCube)stack.getItem()).getTier(stack); + tileEntity.electricityStored = getJoules(stack); + } + + return place; + } + + @Override + public EnumTier getTier(ItemStack itemstack) + { + if(itemstack.stackTagCompound == null) + { + return EnumTier.BASIC; + } + + if(itemstack.stackTagCompound.getString("tier") == null) + { + return EnumTier.BASIC; + } + + return EnumTier.getFromName(itemstack.stackTagCompound.getString("tier")); + } + + @Override + public void setTier(ItemStack itemstack, EnumTier tier) + { + if (itemstack.stackTagCompound == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.stackTagCompound.setString("tier", tier.name); + } } diff --git a/src/common/mekanism/common/ItemBlockPowerUnit.java b/src/common/mekanism/common/ItemBlockPowerUnit.java deleted file mode 100644 index ee282d78d..000000000 --- a/src/common/mekanism/common/ItemBlockPowerUnit.java +++ /dev/null @@ -1,53 +0,0 @@ -package mekanism.common; - -import net.minecraft.src.*; - -/** - * Item class for handling multiple power unit block IDs. - * 0: Power Unit - * 1: Advanced Power Unit - * @author AidanBrady - * - */ -public class ItemBlockPowerUnit extends ItemBlock -{ - public Block metaBlock; - - public ItemBlockPowerUnit(int id, Block block) - { - super(id); - metaBlock = block; - setHasSubtypes(true); - } - - @Override - public int getMetadata(int i) - { - return i; - } - - @Override - public int getIconFromDamage(int i) - { - return metaBlock.getBlockTextureFromSideAndMetadata(2, i); - } - - @Override - public String getItemNameIS(ItemStack itemstack) - { - String name = ""; - switch(itemstack.getItemDamage()) - { - case 0: - name = "PowerUnit"; - break; - case 1: - name = "AdvancedPowerUnit"; - break; - default: - name = "Unknown"; - break; - } - return getItemName() + "." + name; - } -} diff --git a/src/common/mekanism/common/ItemHydrogenTank.java b/src/common/mekanism/common/ItemHydrogenTank.java deleted file mode 100644 index bde3ca786..000000000 --- a/src/common/mekanism/common/ItemHydrogenTank.java +++ /dev/null @@ -1,17 +0,0 @@ -package mekanism.common; - -import mekanism.api.EnumGas; -import net.minecraft.src.*; - -public class ItemHydrogenTank extends ItemStorageTank -{ - public ItemHydrogenTank(int id) - { - super(id, 1600, 16, 16); - } - - public EnumGas gasType() - { - return EnumGas.HYDROGEN; - } -} diff --git a/src/common/mekanism/common/ItemOxygenTank.java b/src/common/mekanism/common/ItemOxygenTank.java deleted file mode 100644 index b5997025c..000000000 --- a/src/common/mekanism/common/ItemOxygenTank.java +++ /dev/null @@ -1,17 +0,0 @@ -package mekanism.common; - -import mekanism.api.EnumGas; -import net.minecraft.src.*; - -public class ItemOxygenTank extends ItemStorageTank -{ - public ItemOxygenTank(int id) - { - super(id, 1600, 16, 16); - } - - public EnumGas gasType() - { - return EnumGas.OXYGEN; - } -} diff --git a/src/common/mekanism/common/ItemStorageTank.java b/src/common/mekanism/common/ItemStorageTank.java index afa119f6b..b11bff0c9 100644 --- a/src/common/mekanism/common/ItemStorageTank.java +++ b/src/common/mekanism/common/ItemStorageTank.java @@ -3,10 +3,12 @@ package mekanism.common; import java.util.List; import ic2.api.IElectricItem; +import mekanism.api.EnumGas; import mekanism.api.IStorageTank; +import mekanism.api.IEnergyCube.EnumTier; import net.minecraft.src.*; -public abstract class ItemStorageTank extends ItemMekanism implements IStorageTank +public class ItemStorageTank extends ItemMekanism implements IStorageTank { /** The maximum amount of gas this tank can hold. */ public int MAX_GAS; @@ -17,12 +19,12 @@ public abstract class ItemStorageTank extends ItemMekanism implements IStorageTa /** The number that, when the max amount of gas is divided by, will make it equal 100. */ public int DIVIDER; - public ItemStorageTank(int id, int gas, int rate, int divide) + public ItemStorageTank(int id, int maxGas, int transferRate, int divide) { super(id); DIVIDER = divide; - MAX_GAS = gas; - TRANSFER_RATE = rate; + MAX_GAS = maxGas; + TRANSFER_RATE = transferRate; setMaxStackSize(1); setMaxDamage(100); setNoRepair(); @@ -34,7 +36,13 @@ public abstract class ItemStorageTank extends ItemMekanism implements IStorageTa { int gas = getGas(itemstack); - list.add("Stored " + gasType().name + ": " + gas); + if(getGasType(itemstack) == EnumGas.NONE) + { + list.add("No gas stored."); + } + else { + list.add("Stored " + getGasType(itemstack).name + ": " + gas); + } } @Override @@ -47,7 +55,13 @@ public abstract class ItemStorageTank extends ItemMekanism implements IStorageTa public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) { ItemStorageTank item = ((ItemStorageTank)itemstack.getItem()); - item.setGas(itemstack, item.getGas(itemstack)); + item.setGas(itemstack, item.getGasType(itemstack), item.getGas(itemstack)); + item.setGasType(itemstack, item.getGasType(itemstack)); + + if(item.getGas(itemstack) == 0) + { + item.setGasType(itemstack, EnumGas.NONE); + } } @Override @@ -70,22 +84,36 @@ public abstract class ItemStorageTank extends ItemMekanism implements IStorageTa } @Override - public void setGas(ItemStack itemstack, int hydrogen) + public void setGas(ItemStack itemstack, EnumGas type, int hydrogen) { if(itemstack.stackTagCompound == null) { itemstack.setTagCompound(new NBTTagCompound()); } - int stored = Math.max(Math.min(hydrogen, MAX_GAS), 0); - itemstack.stackTagCompound.setInteger("gas", stored); - itemstack.setItemDamage((MAX_GAS - stored)/DIVIDER); + if(getGasType(itemstack) == EnumGas.NONE) + { + setGasType(itemstack, type); + } + + if(getGasType(itemstack) == type) + { + int stored = Math.max(Math.min(hydrogen, MAX_GAS), 0); + itemstack.stackTagCompound.setInteger("gas", stored); + itemstack.setItemDamage((MAX_GAS - stored)/DIVIDER); + } + + if(getGas(itemstack) == 0) + { + setGasType(itemstack, EnumGas.NONE); + } } public ItemStack getEmptyItem() { ItemStack empty = new ItemStack(this); empty.setItemDamage(100); + setGasType(empty, EnumGas.NONE); return empty; } @@ -95,9 +123,17 @@ public abstract class ItemStorageTank extends ItemMekanism implements IStorageTa ItemStack empty = new ItemStack(this); empty.setItemDamage(100); list.add(empty); - ItemStack charged = new ItemStack(this); - setGas(charged, ((IStorageTank)charged.getItem()).getMaxGas()); - list.add(charged); + + for(EnumGas type : EnumGas.values()) + { + if(type != EnumGas.NONE) + { + ItemStack charged = new ItemStack(this); + setGasType(charged, type); + setGas(charged, type, ((IStorageTank)charged.getItem()).getMaxGas()); + list.add(charged); + } + } } @Override @@ -113,19 +149,28 @@ public abstract class ItemStorageTank extends ItemMekanism implements IStorageTa } @Override - public int addGas(ItemStack itemstack, int amount) + public int addGas(ItemStack itemstack, EnumGas type, int amount) { - int rejects = Math.max((getGas(itemstack) + amount) - MAX_GAS, 0); - setGas(itemstack, getGas(itemstack) + amount - rejects); - return rejects; + if(getGasType(itemstack) == type || getGasType(itemstack) == EnumGas.NONE) + { + int rejects = Math.max((getGas(itemstack) + amount) - MAX_GAS, 0); + setGas(itemstack, type, getGas(itemstack) + amount - rejects); + return rejects; + } + return amount; } @Override - public int removeGas(ItemStack itemstack, int amount) + public int removeGas(ItemStack itemstack, EnumGas type, int amount) { - int hydrogenToUse = Math.min(getGas(itemstack), amount); - setGas(itemstack, getGas(itemstack) - hydrogenToUse); - return hydrogenToUse; + if(getGasType(itemstack) == type) + { + int hydrogenToUse = Math.min(getGas(itemstack), amount); + setGas(itemstack, type, getGas(itemstack) - hydrogenToUse); + return hydrogenToUse; + } + + return 0; } @Override @@ -135,14 +180,41 @@ public abstract class ItemStorageTank extends ItemMekanism implements IStorageTa } @Override - public boolean canReceiveGas() + public boolean canReceiveGas(ItemStack itemstack, EnumGas type) { - return true; + return getGasType(itemstack) == type || getGasType(itemstack) == EnumGas.NONE; } @Override - public boolean canProvideGas() + public boolean canProvideGas(ItemStack itemstack, EnumGas type) { - return true; + return getGasType(itemstack) == type; + } + + @Override + public EnumGas getGasType(ItemStack itemstack) + { + if(itemstack.stackTagCompound == null) + { + return EnumGas.NONE; + } + + if(itemstack.stackTagCompound.getString("type") == null) + { + return EnumGas.NONE; + } + + return EnumGas.getFromName(itemstack.stackTagCompound.getString("gasType")); + } + + @Override + public void setGasType(ItemStack itemstack, EnumGas type) + { + if(itemstack.stackTagCompound == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.stackTagCompound.setString("gasType", type.name); } } diff --git a/src/common/mekanism/common/Mekanism.java b/src/common/mekanism/common/Mekanism.java index 90be7b5ca..b40fc4185 100644 --- a/src/common/mekanism/common/Mekanism.java +++ b/src/common/mekanism/common/Mekanism.java @@ -97,10 +97,11 @@ public class Mekanism public static int machineBlockID = 3001; public static int oreBlockID = 3002; public static int obsidianTNTID = 3003; - public static int powerUnitID = 3004; + public static int energyCubeID = 3004; public static int nullRenderID = 3007; public static int gasTankID = 3009; + //Extra Items public static ItemElectricBow ElectricBow; public static Item LightningRod; @@ -109,21 +110,20 @@ public class Mekanism public static Item EnrichedAlloy; public static ItemEnergized EnergyTablet; public static ItemEnergized EnergyOrb; - public static ItemEnergized EnergyCube; + public static ItemEnergized EnergyCubeX; public static Item SpeedUpgrade; public static Item EnergyUpgrade; public static Item UltimateUpgrade; public static ItemAtomicDisassembler AtomicDisassembler; public static Item AtomicCore; - public static ItemStorageTank HydrogenTank; - public static ItemStorageTank OxygenTank; + public static ItemStorageTank StorageTank; //Extra Blocks public static Block BasicBlock; public static Block MachineBlock; public static Block OreBlock; public static Block ObsidianTNT; - public static Block PowerUnit; + public static Block EnergyCube; public static BlockMulti NullRender; public static Block GasTank; @@ -186,22 +186,22 @@ public class Mekanism "***", "XXX", "***", Character.valueOf('*'), Block.obsidian, Character.valueOf('X'), Block.tnt })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ElectricBow.getUnchargedItem(), new Object[] { - " AB", "E B", " AB", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('B'), Item.silk, Character.valueOf('E'), EnergyCube.getUnchargedItem() + " AB", "E B", " AB", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('B'), Item.silk, Character.valueOf('E'), EnergyCubeX.getUnchargedItem() })); - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(EnergyCube.getUnchargedItem(), new Object[] { + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(EnergyCubeX.getUnchargedItem(), new Object[] { "RAR", "APA", "RAR", Character.valueOf('R'), Item.redstone, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('P'), "dustPlatinum" })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(EnergyTablet.getUnchargedItem(), new Object[] { - "RCR", "ECE", "RCR", Character.valueOf('C'), EnergyCube.getUnchargedItem(), Character.valueOf('R'), Item.redstone, Character.valueOf('E'), EnrichedAlloy + "RCR", "ECE", "RCR", Character.valueOf('C'), EnergyCubeX.getUnchargedItem(), Character.valueOf('R'), Item.redstone, Character.valueOf('E'), EnrichedAlloy })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(EnergyOrb.getUnchargedItem(), new Object[] { - "ECE", "CCC", "ECE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), EnergyCube.getUnchargedItem() + "ECE", "CCC", "ECE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), EnergyCubeX.getUnchargedItem() })); - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(PowerUnit, 1, 0), new Object[] { - "CEC", "EPE", "CEC", Character.valueOf('C'), EnergyCube.getUnchargedItem(), Character.valueOf('E'), EnrichedAlloy, Character.valueOf('P'), new ItemStack(BasicBlock, 1, 0) + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(EnergyCube, 1, 0), new Object[] { + "CEC", "EPE", "CEC", Character.valueOf('C'), EnergyCubeX.getUnchargedItem(), Character.valueOf('E'), EnrichedAlloy, Character.valueOf('P'), new ItemStack(BasicBlock, 1, 0) })); - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(PowerUnit, 1, 1), new Object[] { - "ECE", "CPC", "ECE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), EnergyCube.getUnchargedItem(), Character.valueOf('P'), new ItemStack(PowerUnit, 1, 0) + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(EnergyCube, 1, 1), new Object[] { + "ECE", "CPC", "ECE", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), EnergyCubeX.getUnchargedItem(), Character.valueOf('P'), new ItemStack(EnergyCube, 1, 0) })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(MachineBlock, 1, 0), new Object[] { "***", "*R*", "***", Character.valueOf('*'), "ingotPlatinum", Character.valueOf('R'), Item.redstone @@ -219,7 +219,7 @@ public class Mekanism "PAP", "AEA", "PAP", Character.valueOf('P'), "dustPlatinum", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), Item.emerald })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(EnergyUpgrade), new Object[] { - "RAR", "AEA", "RAR", Character.valueOf('R'), Item.redstone, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyCube.getUnchargedItem() + "RAR", "AEA", "RAR", Character.valueOf('R'), Item.redstone, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyCubeX.getUnchargedItem() })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(UltimateUpgrade), new Object[] { "ERA", "RDR", "ARS", Character.valueOf('E'), EnergyUpgrade, Character.valueOf('R'), Item.redstone, Character.valueOf('A'), EnrichedAlloy, Character.valueOf('D'), Item.diamond, Character.valueOf('S'), SpeedUpgrade @@ -236,12 +236,9 @@ public class Mekanism CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(BasicBlock, 1, 5), new Object[] { "PAP", "AIA", "PAP", Character.valueOf('P'), "ingotPlatinum", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('I'), Block.blockSteel })); - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(HydrogenTank.getEmptyItem(), new Object[] { + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(StorageTank.getEmptyItem(), new Object[] { "III", "IDI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('D'), "dustIron" })); - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(OxygenTank.getEmptyItem(), new Object[] { - "III", "IGI", "III", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), "dustGold" - })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(GasTank, new Object[] { "PPP", "P P", "PPP", Character.valueOf('P'), "ingotPlatinum" })); @@ -312,17 +309,17 @@ public class Mekanism LanguageRegistry.addName(EnergyTablet, "Energy Tablet"); LanguageRegistry.addName(EnergyOrb, "Energy Orb"); - LanguageRegistry.addName(EnergyCube, "Energy Cube"); + LanguageRegistry.addName(EnergyCubeX, "Energy Cube"); LanguageRegistry.addName(SpeedUpgrade, "Speed Upgrade"); LanguageRegistry.addName(EnergyUpgrade, "Energy Upgrade"); LanguageRegistry.addName(UltimateUpgrade, "Ultimate Upgrade"); LanguageRegistry.addName(AtomicDisassembler, "Nuclear Disassembler"); LanguageRegistry.addName(AtomicCore, "Nuclear Core"); LanguageRegistry.addName(ElectricBow, "Electric Bow"); - LanguageRegistry.addName(HydrogenTank, "Hydrogen Tank"); - LanguageRegistry.addName(OxygenTank, "Oxygen Tank"); + LanguageRegistry.addName(StorageTank, "Hydrogen Tank"); LanguageRegistry.addName(NullRender, "Null Render"); LanguageRegistry.addName(GasTank, "Gas Tank"); + LanguageRegistry.addName(StorageTank, "Storage Tank"); //Localization for MultiBlock LanguageRegistry.instance().addStringLocalization("tile.BasicBlock.PlatinumBlock.name", "Platinum Block"); @@ -343,9 +340,10 @@ public class Mekanism //Localization for OreBlock LanguageRegistry.instance().addStringLocalization("tile.OreBlock.PlatinumOre.name", "Platinum Ore"); - //Localization for PowerUnit - LanguageRegistry.instance().addStringLocalization("tile.PowerUnit.PowerUnit.name", "Power Unit"); - LanguageRegistry.instance().addStringLocalization("tile.PowerUnit.AdvancedPowerUnit.name", "Advanced Power Unit"); + //Localization for EnergyCube + LanguageRegistry.instance().addStringLocalization("tile.EnergyCube.Basic.name", "Basic Energy Cube"); + LanguageRegistry.instance().addStringLocalization("tile.EnergyCube.Advanced.name", "Advanced Energy Cube"); + LanguageRegistry.instance().addStringLocalization("tile.EnergyCube.Ultimate.name", "Ultimate Energy Cube"); //Localization for Dust LanguageRegistry.instance().addStringLocalization("item.ironDust.name", "Iron Dust"); @@ -376,15 +374,14 @@ public class Mekanism EnergyTablet.setIconIndex(228); EnergyOrb.setIconIndex(229); - EnergyCube.setIconIndex(230); + EnergyCubeX.setIconIndex(230); SpeedUpgrade.setIconIndex(232); EnergyUpgrade.setIconIndex(231); UltimateUpgrade.setIconIndex(233); AtomicDisassembler.setIconIndex(253); AtomicCore.setIconIndex(254); ElectricBow.setIconIndex(252); - HydrogenTank.setIconIndex(251); - OxygenTank.setIconIndex(239); + StorageTank.setIconIndex(255); } /** @@ -403,15 +400,14 @@ public class Mekanism Ingot = new ItemIngot(11294-256); EnergyTablet = (ItemEnergized) new ItemEnergized(11306, 2500000, 512, 25000).setItemName("EnergyTablet"); EnergyOrb = (ItemEnergized) new ItemEnergized(11307, 5000000, 512, 50000).setItemName("EnergyOrb"); - EnergyCube = (ItemEnergized) new ItemEnergized(11308, 1000000, 512, 10000).setItemName("EnergyCube"); + EnergyCubeX = (ItemEnergized) new ItemEnergized(11308, 1000000, 512, 10000).setItemName("EnergyCube"); SpeedUpgrade = new ItemMachineUpgrade(11309, 0, 150).setItemName("SpeedUpgrade"); EnergyUpgrade = new ItemMachineUpgrade(11310, 1000, 0).setItemName("EnergyUpgrade"); UltimateUpgrade = new ItemMachineUpgrade(11311, 2500, 180).setItemName("UltimateUpgrade"); AtomicDisassembler = (ItemAtomicDisassembler) new ItemAtomicDisassembler(11312).setItemName("AtomicDisassembler"); AtomicCore = new ItemMekanism(11313).setItemName("AtomicCore"); EnrichedAlloy = new ItemMekanism(11315).setItemName("EnrichedAlloy"); - HydrogenTank = (ItemHydrogenTank) new ItemHydrogenTank(11316).setItemName("HydrogenTank"); - OxygenTank = (ItemOxygenTank) new ItemOxygenTank(11317).setItemName("OxygenTank"); + StorageTank = (ItemStorageTank) new ItemStorageTank(11316, 1600, 16, 16).setItemName("StorageTank"); } /** @@ -423,7 +419,7 @@ public class Mekanism BasicBlock = new BlockBasic(basicBlockID).setBlockName("BasicBlock"); MachineBlock = new BlockMachine(machineBlockID).setBlockName("MachineBlock"); OreBlock = new BlockOre(oreBlockID).setBlockName("OreBlock"); - PowerUnit = new BlockPowerUnit(powerUnitID).setBlockName("PowerUnit"); + EnergyCube = new BlockEnergyCube(energyCubeID).setBlockName("EnergyCube"); ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setBlockName("ObsidianTNT").setCreativeTab(tabMekanism); NullRender = (BlockMulti) new BlockMulti(nullRenderID).setBlockName("NullRender"); GasTank = new BlockGasTank(gasTankID).setBlockName("GasTank"); @@ -437,7 +433,7 @@ public class Mekanism Item.itemsList[basicBlockID] = new ItemBlockBasic(basicBlockID - 256, BasicBlock).setItemName("BasicBlock"); Item.itemsList[machineBlockID] = new ItemBlockMachine(machineBlockID - 256, MachineBlock).setItemName("MachineBlock"); Item.itemsList[oreBlockID] = new ItemBlockOre(oreBlockID - 256, OreBlock).setItemName("OreBlock"); - Item.itemsList[powerUnitID] = new ItemBlockPowerUnit(powerUnitID - 256, PowerUnit).setItemName("PowerUnit"); + Item.itemsList[energyCubeID] = new ItemBlockEnergyCube(energyCubeID - 256, EnergyCube).setItemName("EnergyCube"); } /** @@ -496,8 +492,7 @@ public class Mekanism GameRegistry.registerTileEntity(TileEntityCombiner.class, "Combiner"); GameRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher"); GameRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer"); - GameRegistry.registerTileEntity(TileEntityPowerUnit.class, "PowerUnit"); - GameRegistry.registerTileEntity(TileEntityAdvancedPowerUnit.class, "AdvancedPowerUnit"); + GameRegistry.registerTileEntity(TileEntityEnergyCube.class, "EnergyCube"); GameRegistry.registerTileEntity(TileEntityMulti.class, "Multi"); GameRegistry.registerTileEntity(TileEntityControlPanel.class, "ControlPanel"); GameRegistry.registerTileEntity(TileEntityGasTank.class, "GasTank"); @@ -559,29 +554,15 @@ public class Mekanism registerServerCommands(); } catch(NoSuchMethodError e) {} - //Add all items + //Load this module addItems(); - System.out.println("[Mekanism] Items loaded."); - - //Add all blocks addBlocks(); - System.out.println("[Mekanism] Blocks loaded."); - - //Set item and block names addNames(); - System.out.println("[Mekanism] Names loaded."); - - //Set item and block textures addTextures(); - System.out.println("[Mekanism] Textures loaded."); - - //Set item and block recipes addRecipes(); - System.out.println("[Mekanism] Recipes loaded."); - - //Set up entities to run on SSP and SMP addEntities(); - System.out.println("[Mekanism] Entities loaded."); + + System.out.println("[Mekanism] Loading complete."); //Success message logger.info("[Mekanism] Mod loaded."); diff --git a/src/common/mekanism/common/MekanismUtils.java b/src/common/mekanism/common/MekanismUtils.java index c5b34f6f6..94b2abc1c 100644 --- a/src/common/mekanism/common/MekanismUtils.java +++ b/src/common/mekanism/common/MekanismUtils.java @@ -16,6 +16,8 @@ import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.server.FMLServerHandler; +import mekanism.api.IEnergyCube; +import mekanism.api.IEnergyCube.EnumTier; import mekanism.client.ThreadSendData; import net.minecraft.src.*; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -185,9 +187,8 @@ public class MekanismUtils */ public static ItemStack getStackWithSize(ItemStack itemstack, int size) { - ItemStack tempStack = itemstack.copy(); - tempStack.stackSize = size; - return tempStack; + itemstack.stackSize = size; + return itemstack; } /** @@ -199,4 +200,23 @@ public class MekanismUtils { CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, params)); } + + public static ItemStack getEnergyCubeWithTier(EnumTier tier) + { + ItemStack itemstack = new ItemStack(Mekanism.EnergyCube); + + if(!(itemstack.getItem() instanceof IEnergyCube)) + { + System.out.println("[Mekanism] Attempted to add tier to an invalid item."); + return itemstack; + } + + if(itemstack.stackTagCompound == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.stackTagCompound.setString("tier", tier.name); + return itemstack; + } } diff --git a/src/common/mekanism/common/SlotStorageTank.java b/src/common/mekanism/common/SlotStorageTank.java index b7045ad94..cfc477c04 100644 --- a/src/common/mekanism/common/SlotStorageTank.java +++ b/src/common/mekanism/common/SlotStorageTank.java @@ -27,7 +27,7 @@ public class SlotStorageTank extends Slot if(itemstack.getItem() instanceof IStorageTank) { - return ((IStorageTank)itemstack.getItem()).gasType() == type; + return ((IStorageTank)itemstack.getItem()).getGasType(itemstack) == type || ((IStorageTank)itemstack.getItem()).getGasType(itemstack) == EnumGas.NONE; } return false; } diff --git a/src/common/mekanism/common/TileEntityAdvancedElectricMachine.java b/src/common/mekanism/common/TileEntityAdvancedElectricMachine.java index b203414c3..464ce49b4 100644 --- a/src/common/mekanism/common/TileEntityAdvancedElectricMachine.java +++ b/src/common/mekanism/common/TileEntityAdvancedElectricMachine.java @@ -81,7 +81,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM if (electricItem.canProduceElectricity()) { - double joulesReceived = electricItem.onUse(electricItem.getMaxJoules() * 0.005, inventory[3]); + double joulesReceived = electricItem.onUse(electricItem.getMaxJoules(inventory[3]) * 0.005, inventory[3]); setJoules(electricityStored + joulesReceived); } } diff --git a/src/common/mekanism/common/TileEntityAdvancedPowerUnit.java b/src/common/mekanism/common/TileEntityAdvancedPowerUnit.java deleted file mode 100644 index 886fcd5d5..000000000 --- a/src/common/mekanism/common/TileEntityAdvancedPowerUnit.java +++ /dev/null @@ -1,9 +0,0 @@ -package mekanism.common; - -public class TileEntityAdvancedPowerUnit extends TileEntityPowerUnit -{ - public TileEntityAdvancedPowerUnit() - { - super("Advanced Power Unit", 50000000, 1024); - } -} diff --git a/src/common/mekanism/common/TileEntityBasicMachine.java b/src/common/mekanism/common/TileEntityBasicMachine.java index f4f2312cb..22e96272f 100644 --- a/src/common/mekanism/common/TileEntityBasicMachine.java +++ b/src/common/mekanism/common/TileEntityBasicMachine.java @@ -253,7 +253,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp } @Override - public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) + public void onReceive(Object sender, double amps, double voltage, ForgeDirection side) { double electricityToReceive = ElectricInfo.getJoules(amps, voltage); double electricityNeeded = MAX_ELECTRICITY - electricityStored; diff --git a/src/common/mekanism/common/TileEntityElectricMachine.java b/src/common/mekanism/common/TileEntityElectricMachine.java index 49b7b2325..6c02b73b9 100644 --- a/src/common/mekanism/common/TileEntityElectricMachine.java +++ b/src/common/mekanism/common/TileEntityElectricMachine.java @@ -55,11 +55,11 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine { if(inventory[1].getItem() instanceof IItemElectric) { - IItemElectric electricItem = (IItemElectric) inventory[1].getItem(); + IItemElectric electricItem = (IItemElectric)inventory[1].getItem(); if (electricItem.canProduceElectricity()) { - double joulesReceived = electricItem.onUse(electricItem.getMaxJoules() * 0.005, inventory[1]); + double joulesReceived = electricItem.onUse(electricItem.getMaxJoules(inventory[1]) * 0.005, inventory[1]); setJoules(electricityStored + joulesReceived); } } diff --git a/src/common/mekanism/common/TileEntityPowerUnit.java b/src/common/mekanism/common/TileEntityEnergyCube.java similarity index 82% rename from src/common/mekanism/common/TileEntityPowerUnit.java rename to src/common/mekanism/common/TileEntityEnergyCube.java index 3241e427c..24890a4fc 100644 --- a/src/common/mekanism/common/TileEntityPowerUnit.java +++ b/src/common/mekanism/common/TileEntityEnergyCube.java @@ -32,13 +32,17 @@ import ic2.api.IEnergySource; import ic2.api.IEnergyStorage; import ic2.api.IWrenchable; import ic2.api.IElectricItem; +import mekanism.api.IEnergyCube.EnumTier; +import mekanism.api.EnumGas; import mekanism.api.ITileNetwork; import net.minecraft.src.*; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ISidedInventory; -public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEnergySink, IEnergySource, IEnergyStorage, IPowerReceptor, IJouleStorage, IElectricityReceiver, IPeripheral +public class TileEntityEnergyCube extends TileEntityElectricBlock implements IEnergySink, IEnergySource, IEnergyStorage, IPowerReceptor, IJouleStorage, IElectricityReceiver, IPeripheral { + public EnumTier tier = EnumTier.BASIC; + /** Output per tick this machine can transfer. */ public int output; @@ -48,9 +52,9 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne /** * A block used to store and transfer electricity. */ - public TileEntityPowerUnit() + public TileEntityEnergyCube() { - this("Power Unit", 500000, 256); + this("Energy Cube", 0, 256); } /** @@ -58,7 +62,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne * @param energy - maximum energy this block can hold. * @param i - output per tick this block can handle. */ - public TileEntityPowerUnit(String name, int maxEnergy, int i) + public TileEntityEnergyCube(String name, int maxEnergy, int i) { super(name, maxEnergy); inventory = new ItemStack[2]; @@ -66,7 +70,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne if(PowerFramework.currentFramework != null) { powerProvider = PowerFramework.currentFramework.createPowerProvider(); - powerProvider.configure(0, 2, 2000, 1, (int)(MAX_ELECTRICITY*UniversalElectricity.TO_BC_RATIO)); + powerProvider.configure(0, 2, 2000, 1, (int)(tier.MAX_ELECTRICITY*UniversalElectricity.TO_BC_RATIO)); } } @@ -83,8 +87,8 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne { if(inventory[0].getItem() instanceof IItemElectric) { - IItemElectric electricItem = (IItemElectric) inventory[0].getItem(); - double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules() * 0.005, getVoltage()), electricityStored); + IItemElectric electricItem = (IItemElectric)inventory[0].getItem(); + double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules(inventory[0]) * 0.005, getVoltage()), electricityStored); double joules = electricItem.onReceive(ampsToGive, getVoltage(), inventory[0]); setJoules(electricityStored - (ElectricInfo.getJoules(ampsToGive, getVoltage(), 1) - joules)); } @@ -95,7 +99,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne } } - if(inventory[1] != null && electricityStored < MAX_ELECTRICITY) + if(inventory[1] != null && electricityStored < tier.MAX_ELECTRICITY) { if(inventory[1].getItem() instanceof IItemElectric) { @@ -103,7 +107,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne if (electricItem.canProduceElectricity()) { - double joulesReceived = electricItem.onUse(electricItem.getMaxJoules() * 0.005, inventory[1]); + double joulesReceived = electricItem.onUse(electricItem.getMaxJoules(inventory[1]) * 0.005, inventory[1]); setJoules(electricityStored + joulesReceived); } } @@ -112,7 +116,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne IElectricItem item = (IElectricItem)inventory[1].getItem(); if(item.canProvideEnergy()) { - double gain = ElectricItem.discharge(inventory[1], (int)((MAX_ELECTRICITY - electricityStored)*UniversalElectricity.TO_IC2_RATIO), 3, false, false)*UniversalElectricity.IC2_RATIO; + double gain = ElectricItem.discharge(inventory[1], (int)((tier.MAX_ELECTRICITY - electricityStored)*UniversalElectricity.TO_IC2_RATIO), 3, false, false)*UniversalElectricity.IC2_RATIO; setJoules(electricityStored + gain); } } @@ -179,7 +183,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne @Override public int getCapacity() { - return (int)(MAX_ELECTRICITY*UniversalElectricity.IC2_RATIO); + return (int)(tier.MAX_ELECTRICITY*UniversalElectricity.IC2_RATIO); } @Override @@ -191,14 +195,14 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne @Override public boolean demandsEnergy() { - return electricityStored < MAX_ELECTRICITY; + return electricityStored < tier.MAX_ELECTRICITY; } @Override public int injectEnergy(Direction direction, int i) { double rejects = 0; - double neededEnergy = MAX_ELECTRICITY-electricityStored; + double neededEnergy = tier.MAX_ELECTRICITY-electricityStored; if(i <= neededEnergy) { electricityStored += i; @@ -227,7 +231,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne @Override public double getJoules(Object... data) { - return electricityStored*UniversalElectricity.IC2_RATIO; + return electricityStored; } @Override @@ -239,7 +243,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne @Override public double getMaxJoules(Object... data) { - return MAX_ELECTRICITY*UniversalElectricity.IC2_RATIO; + return tier.MAX_ELECTRICITY; } @Override @@ -292,10 +296,10 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne } @Override - public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) + public void onReceive(Object sender, double amps, double voltage, ForgeDirection side) { double electricityToReceive = ElectricInfo.getJoules(amps, voltage); - double electricityNeeded = MAX_ELECTRICITY - electricityStored; + double electricityNeeded = tier.MAX_ELECTRICITY - electricityStored; double electricityToStore = 0; if(electricityToReceive <= electricityNeeded) @@ -312,7 +316,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne @Override public double wattRequest() { - return ElectricInfo.getWatts(MAX_ELECTRICITY) - ElectricInfo.getWatts(electricityStored); + return ElectricInfo.getWatts(tier.MAX_ELECTRICITY) - ElectricInfo.getWatts(electricityStored); } @Override @@ -343,9 +347,9 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne case 1: return new Object[] {output}; case 2: - return new Object[] {MAX_ELECTRICITY}; + return new Object[] {tier.MAX_ELECTRICITY}; case 3: - return new Object[] {(MAX_ELECTRICITY-electricityStored)}; + return new Object[] {(tier.MAX_ELECTRICITY-electricityStored)}; default: System.err.println("[Mekanism] Attempted to call unknown method with computer ID " + computer.getID()); return null; @@ -370,6 +374,7 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne try { facing = dataStream.readInt(); electricityStored = dataStream.readDouble(); + tier = EnumTier.getFromName(dataStream.readUTF()); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); } catch (Exception e) { @@ -378,15 +383,31 @@ public class TileEntityPowerUnit extends TileEntityElectricBlock implements IEne } } + @Override + public void readFromNBT(NBTTagCompound nbtTags) + { + super.readFromNBT(nbtTags); + + tier = EnumTier.getFromName(nbtTags.getString("tier")); + } + + @Override + public void writeToNBT(NBTTagCompound nbtTags) + { + super.writeToNBT(nbtTags); + + nbtTags.setString("tier", tier.name); + } + @Override public void sendPacket() { - PacketHandler.sendTileEntityPacketToClients(this, 0, facing, electricityStored); + PacketHandler.sendTileEntityPacketToClients(this, 0, facing, electricityStored, tier.name); } @Override public void sendPacketWithRange() { - PacketHandler.sendTileEntityPacketToClients(this, 50, facing, electricityStored); + PacketHandler.sendTileEntityPacketToClients(this, 50, facing, electricityStored, tier.name); } } diff --git a/src/common/mekanism/common/TileEntityGasTank.java b/src/common/mekanism/common/TileEntityGasTank.java index 5f542ed64..2bd64c028 100644 --- a/src/common/mekanism/common/TileEntityGasTank.java +++ b/src/common/mekanism/common/TileEntityGasTank.java @@ -39,14 +39,14 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS { if(inventory[0].getItem() instanceof IStorageTank) { - if(((IStorageTank)inventory[0].getItem()).gasType() == gasType || gasType == EnumGas.NONE) + if(((IStorageTank)inventory[0].getItem()).getGasType(inventory[0]) == gasType || ((IStorageTank)inventory[0].getItem()).getGasType(inventory[0]) == EnumGas.NONE) { IStorageTank item = (IStorageTank)inventory[0].getItem(); if(gasType == EnumGas.NONE) - gasType = item.gasType(); + gasType = item.getGasType(inventory[0]); - if(item.canReceiveGas()) + if(item.canReceiveGas(inventory[0], gasType)) { int sendingGas = 0; @@ -59,7 +59,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS sendingGas = gasStored; } - int rejects = item.addGas(inventory[0], sendingGas); + int rejects = item.addGas(inventory[0], gasType, sendingGas); setGas(gasType, gasStored - (sendingGas - rejects)); } } @@ -70,24 +70,24 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS { if(inventory[1].getItem() instanceof IStorageTank) { - if(((IStorageTank)inventory[1].getItem()).gasType() == gasType || gasType == EnumGas.NONE) + if(((IStorageTank)inventory[1].getItem()).getGasType(inventory[1]) == gasType || gasType == EnumGas.NONE) { IStorageTank item = (IStorageTank)inventory[1].getItem(); if(gasType == EnumGas.NONE) - gasType = item.gasType(); + gasType = item.getGasType(inventory[1]); - if(item.canProvideGas()) + if(item.canProvideGas(inventory[1], gasType)) { int received = 0; int gasNeeded = MAX_GAS - gasStored; if(item.getRate() <= gasNeeded) { - received = item.removeGas(inventory[1], item.getRate()); + received = item.removeGas(inventory[1], gasType, item.getRate()); } else if(item.getRate() > gasNeeded) { - received = item.removeGas(inventory[1], gasNeeded); + received = item.removeGas(inventory[1], gasType, gasNeeded); } setGas(gasType, gasStored + received); diff --git a/src/common/mekanism/generators/common/BlockBioGenerator.java b/src/common/mekanism/generators/common/BlockBioGenerator.java deleted file mode 100644 index ac1682d29..000000000 --- a/src/common/mekanism/generators/common/BlockBioGenerator.java +++ /dev/null @@ -1,154 +0,0 @@ -package mekanism.generators.common; - -import java.util.List; -import java.util.Random; - -import cpw.mods.fml.common.Side; -import cpw.mods.fml.common.asm.SideOnly; -import mekanism.common.Mekanism; -import mekanism.common.TileEntityBasicBlock; -import mekanism.common.TileEntityElectricBlock; -import mekanism.common.BlockMachine.MachineType; -import mekanism.generators.client.GeneratorsClientProxy; -import net.minecraft.src.*; -import net.minecraftforge.common.ForgeDirection; - -public class BlockBioGenerator extends BlockContainer -{ - public Random machineRand = new Random(); - - public BlockBioGenerator(int id) - { - super(id, Material.iron); - setHardness(3.5F); - setResistance(8F); - setCreativeTab(Mekanism.tabMekanism); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving) - { - TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getBlockTileEntity(x, y, z); - - int side = MathHelper.floor_double((double)(entityliving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int change = 3; - - switch(side) - { - case 0: change = 2; break; - case 1: change = 5; break; - case 2: change = 3; break; - case 3: change = 4; break; - } - - tileEntity.setFacing((short)change); - } - - @Override - public void breakBlock(World world, int x, int y, int z, int i1, int i2) - { - TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - for (int i = 0; i < tileEntity.getSizeInventory(); ++i) - { - ItemStack slotStack = tileEntity.getStackInSlot(i); - - if (slotStack != null) - { - float xRandom = machineRand.nextFloat() * 0.8F + 0.1F; - float yRandom = machineRand.nextFloat() * 0.8F + 0.1F; - float zRandom = machineRand.nextFloat() * 0.8F + 0.1F; - - while (slotStack.stackSize > 0) - { - int j = machineRand.nextInt(21) + 10; - - if (j > slotStack.stackSize) - { - j = slotStack.stackSize; - } - - slotStack.stackSize -= j; - EntityItem item = new EntityItem(world, (double)((float)x + xRandom), (double)((float)y + yRandom), (double)((float)z + zRandom), new ItemStack(slotStack.itemID, j, slotStack.getItemDamage())); - - if (slotStack.hasTagCompound()) - { - item.item.setTagCompound((NBTTagCompound)slotStack.getTagCompound().copy()); - } - - float k = 0.05F; - item.motionX = (double)((float)machineRand.nextGaussian() * k); - item.motionY = (double)((float)machineRand.nextGaussian() * k + 0.2F); - item.motionZ = (double)((float)machineRand.nextGaussian() * k); - world.spawnEntityInWorld(item); - } - } - } - - tileEntity.invalidate(); - } - - super.breakBlock(world, x, y, z, i1, i2); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ) - { - if(world.isRemote) - { - return true; - } - - TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - if(!entityplayer.isSneaking()) - { - entityplayer.openGui(MekanismGenerators.instance, 4, world, x, y, z); - return true; - } - } - return false; - } - - @Override - public String getTextureFile() - { - return "/resources/mekanism/textures/terrain.png"; - } - - @Override - public TileEntity createNewTileEntity(World world, int metadata) - { - return new TileEntityBioGenerator(); - } - - /*This method is not used, metadata manipulation is required to create a Tile Entity.*/ - @Override - public TileEntity createNewTileEntity(World world) - { - return null; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderType() - { - return GeneratorsClientProxy.RENDER_ID; - } -} diff --git a/src/common/mekanism/generators/common/BlockGenerator.java b/src/common/mekanism/generators/common/BlockGenerator.java index 822b8806a..66ac9eedf 100644 --- a/src/common/mekanism/generators/common/BlockGenerator.java +++ b/src/common/mekanism/generators/common/BlockGenerator.java @@ -234,6 +234,8 @@ public class BlockGenerator extends BlockContainer list.add(new ItemStack(i, 1, 1)); list.add(new ItemStack(i, 1, 2)); list.add(new ItemStack(i, 1, 3)); + list.add(new ItemStack(i, 1, 4)); + list.add(new ItemStack(i, 1, 5)); } @Override @@ -304,6 +306,14 @@ public class BlockGenerator extends BlockContainer } } + EntityItem entityItem = new EntityItem(world, x, y, z, new ItemStack(MekanismGenerators.Generator, 1, world.getBlockMetadata(x, y, z))); + + float motion = 0.05F; + entityItem.motionX = machineRand.nextGaussian() * motion; + entityItem.motionY = machineRand.nextGaussian() * motion + 0.2F; + entityItem.motionZ = machineRand.nextGaussian() * motion; + world.spawnEntityInWorld(entityItem); + if(tileEntity instanceof IMultiBlock) { ((IMultiBlock)tileEntity).onDestroy(tileEntity); @@ -352,6 +362,12 @@ public class BlockGenerator extends BlockContainer return "/resources/mekanism/textures/generators/terrain.png"; } + @Override + public int quantityDropped(Random random) + { + return 0; + } + @Override public TileEntity createNewTileEntity(World world, int metadata) { @@ -409,6 +425,20 @@ public class BlockGenerator extends BlockContainer { return null; } + + /*@Override + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + int metadata = world.getBlockMetadata(x, y, z); + + if(metadata == GeneratorType.SOLAR_GENERATOR.meta) + { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.4F, 1.0F); + } + else { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + }*/ public static enum GeneratorType { @@ -419,8 +449,8 @@ public class BlockGenerator extends BlockContainer BIO_GENERATOR(4, 4), ADVANCED_SOLAR_GENERATOR(5, 1); - private int meta; - private int guiId; + public int meta; + public int guiId; private GeneratorType(int i, int j) { diff --git a/src/common/mekanism/generators/common/ContainerElectrolyticSeparator.java b/src/common/mekanism/generators/common/ContainerElectrolyticSeparator.java index 1eb9fa419..b6abf5caa 100644 --- a/src/common/mekanism/generators/common/ContainerElectrolyticSeparator.java +++ b/src/common/mekanism/generators/common/ContainerElectrolyticSeparator.java @@ -72,20 +72,30 @@ public class ContainerElectrolyticSeparator extends Container } else if(slotStack.getItem() instanceof IStorageTank) { - if(((IStorageTank)slotStack.getItem()).gasType() == EnumGas.HYDROGEN) + if(((IStorageTank)slotStack.getItem()).getGasType(slotStack) == EnumGas.HYDROGEN) { if(!mergeItemStack(slotStack, 1, 2, false)) { return null; } } - else if(((IStorageTank)slotStack.getItem()).gasType() == EnumGas.OXYGEN) + else if(((IStorageTank)slotStack.getItem()).getGasType(slotStack) == EnumGas.OXYGEN) { if(!mergeItemStack(slotStack, 2, 3, false)) { return null; } } + else if(((IStorageTank)slotStack.getItem()).getGasType(slotStack) == EnumGas.NONE) + { + if(!mergeItemStack(slotStack, 1, 2, false)) + { + if(!mergeItemStack(slotStack, 2, 3, false)) + { + return null; + } + } + } } else if(slotStack.getItem() instanceof IItemElectric || slotStack.getItem() instanceof IElectricItem) { diff --git a/src/common/mekanism/generators/common/ContainerHydrogenGenerator.java b/src/common/mekanism/generators/common/ContainerHydrogenGenerator.java index 48373ae8e..11c9d5187 100644 --- a/src/common/mekanism/generators/common/ContainerHydrogenGenerator.java +++ b/src/common/mekanism/generators/common/ContainerHydrogenGenerator.java @@ -79,7 +79,7 @@ public class ContainerHydrogenGenerator extends Container { if(slotID != 0 && slotID != 1) { - if(((IStorageTank)slotStack.getItem()).gasType() == EnumGas.HYDROGEN) + if(((IStorageTank)slotStack.getItem()).getGasType(slotStack) == EnumGas.HYDROGEN) { if (!mergeItemStack(slotStack, 0, 1, false)) { diff --git a/src/common/mekanism/generators/common/GeneratorsCommonProxy.java b/src/common/mekanism/generators/common/GeneratorsCommonProxy.java index a016ac20a..1d50b87ed 100644 --- a/src/common/mekanism/generators/common/GeneratorsCommonProxy.java +++ b/src/common/mekanism/generators/common/GeneratorsCommonProxy.java @@ -4,12 +4,12 @@ import cpw.mods.fml.common.registry.GameRegistry; import mekanism.common.ContainerAdvancedElectricMachine; import mekanism.common.ContainerElectricMachine; import mekanism.common.ContainerGasTank; -import mekanism.common.ContainerPowerUnit; +import mekanism.common.ContainerEnergyCube; import mekanism.common.Mekanism; import mekanism.common.TileEntityAdvancedElectricMachine; import mekanism.common.TileEntityElectricMachine; import mekanism.common.TileEntityGasTank; -import mekanism.common.TileEntityPowerUnit; +import mekanism.common.TileEntityEnergyCube; import net.minecraft.src.*; /** diff --git a/src/common/mekanism/generators/common/ItemBlockGenerator.java b/src/common/mekanism/generators/common/ItemBlockGenerator.java index e43fe8a09..f291bb00a 100644 --- a/src/common/mekanism/generators/common/ItemBlockGenerator.java +++ b/src/common/mekanism/generators/common/ItemBlockGenerator.java @@ -1,5 +1,6 @@ package mekanism.generators.common; +import mekanism.generators.common.BlockGenerator.GeneratorType; import net.minecraft.src.*; /** @@ -9,6 +10,7 @@ import net.minecraft.src.*; * 2: Electrolytic Separator * 3: Hydrogen Generator * 4: Bio-Generator + * 5: Advanced Solar Generator * @author AidanBrady * */ @@ -35,6 +37,41 @@ public class ItemBlockGenerator extends ItemBlock return metaBlock.getBlockTextureFromSideAndMetadata(2, i); } + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + if(stack.getItemDamage() == GeneratorType.ADVANCED_SOLAR_GENERATOR.meta) + { + boolean canPlace = true; + + if(world.getBlockId(x, y, z) != Block.tallGrass.blockID && world.getBlockId(x, y, z) != 0) + canPlace = false; + + if(world.getBlockId(x, y, z) != 0) + { + if(Block.blocksList[world.getBlockId(x, y, z)].isBlockReplaceable(world, x, y, z)) + canPlace = true; + } + + for(int xPos=-1;xPos<=2;xPos++) + { + for(int zPos=-1;zPos<=2;zPos++) + { + if(world.getBlockId(x+xPos, y+2, z+zPos) != 0) + canPlace = false; + } + } + + if(canPlace) + { + return super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); + } + return false; + } + + return super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); + } + @Override public String getItemNameIS(ItemStack itemstack) { diff --git a/src/common/mekanism/generators/common/MekanismGenerators.java b/src/common/mekanism/generators/common/MekanismGenerators.java index 2c49fc026..f675db087 100644 --- a/src/common/mekanism/generators/common/MekanismGenerators.java +++ b/src/common/mekanism/generators/common/MekanismGenerators.java @@ -54,6 +54,7 @@ public class MekanismGenerators NetworkRegistry.instance().registerGuiHandler(this, new GeneratorsGuiHandler()); //Load the proxy + proxy.loadConfiguration(); proxy.registerSpecialTileEntities(); proxy.registerRenderInformation(); diff --git a/src/common/mekanism/generators/common/TileEntityBioGenerator.java b/src/common/mekanism/generators/common/TileEntityBioGenerator.java index b1c07394d..d01f04f16 100644 --- a/src/common/mekanism/generators/common/TileEntityBioGenerator.java +++ b/src/common/mekanism/generators/common/TileEntityBioGenerator.java @@ -39,8 +39,8 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank { if(inventory[1].getItem() instanceof IItemElectric) { - IItemElectric electricItem = (IItemElectric) inventory[1].getItem(); - double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules() * 0.005, getVoltage()), electricityStored); + IItemElectric electricItem = (IItemElectric)inventory[1].getItem(); + double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules(inventory[1]) * 0.005, getVoltage()), electricityStored); double joules = electricItem.onReceive(ampsToGive, getVoltage(), inventory[1]); setJoules(electricityStored - (ElectricInfo.getJoules(ampsToGive, getVoltage(), 1) - joules)); } diff --git a/src/common/mekanism/generators/common/TileEntityElectrolyticSeparator.java b/src/common/mekanism/generators/common/TileEntityElectrolyticSeparator.java index 0e1f76345..5ad681bac 100644 --- a/src/common/mekanism/generators/common/TileEntityElectrolyticSeparator.java +++ b/src/common/mekanism/generators/common/TileEntityElectrolyticSeparator.java @@ -73,11 +73,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp { if(inventory[3].getItem() instanceof IItemElectric) { - IItemElectric electricItem = (IItemElectric) inventory[3].getItem(); + IItemElectric electricItem = (IItemElectric)inventory[3].getItem(); if (electricItem.canProduceElectricity()) { - double joulesReceived = electricItem.onUse(electricItem.getMaxJoules() * 0.005, inventory[3]); + double joulesReceived = electricItem.onUse(electricItem.getMaxJoules(inventory[3]) * 0.005, inventory[3]); setJoules(electricityStored + joulesReceived); } } @@ -107,11 +107,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp { if(inventory[1].getItem() instanceof IStorageTank) { - if(((IStorageTank)inventory[1].getItem()).gasType() == EnumGas.HYDROGEN) + if(((IStorageTank)inventory[1].getItem()).getGasType(inventory[1]) == EnumGas.HYDROGEN || ((IStorageTank)inventory[1].getItem()).getGasType(inventory[1]) == EnumGas.NONE) { IStorageTank item = (IStorageTank)inventory[1].getItem(); - if(item.canReceiveGas()) + if(item.canReceiveGas(inventory[1], EnumGas.HYDROGEN)) { int sendingGas = 0; @@ -124,7 +124,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp sendingGas = hydrogenStored; } - int rejects = item.addGas(inventory[1], sendingGas); + int rejects = item.addGas(inventory[1], EnumGas.HYDROGEN, sendingGas); setGas(EnumGas.HYDROGEN, hydrogenStored - (sendingGas - rejects)); } } @@ -135,11 +135,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp { if(inventory[2].getItem() instanceof IStorageTank) { - if(((IStorageTank)inventory[2].getItem()).gasType() == EnumGas.OXYGEN) + if(((IStorageTank)inventory[2].getItem()).getGasType(inventory[2]) == EnumGas.OXYGEN || ((IStorageTank)inventory[2].getItem()).getGasType(inventory[2]) == EnumGas.NONE) { IStorageTank item = (IStorageTank)inventory[2].getItem(); - if(item.canReceiveGas()) + if(item.canReceiveGas(inventory[2], EnumGas.OXYGEN)) { int sendingGas = 0; @@ -152,7 +152,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp sendingGas = oxygenStored; } - int rejects = item.addGas(inventory[2], sendingGas); + int rejects = item.addGas(inventory[2], EnumGas.OXYGEN, sendingGas); setGas(EnumGas.OXYGEN, oxygenStored - (sendingGas - rejects)); } } @@ -356,7 +356,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } @Override - public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) + public void onReceive(Object sender, double amps, double voltage, ForgeDirection side) { double electricityToReceive = ElectricInfo.getJoules(amps, voltage); double electricityNeeded = MAX_ELECTRICITY - electricityStored; diff --git a/src/common/mekanism/generators/common/TileEntityGenerator.java b/src/common/mekanism/generators/common/TileEntityGenerator.java index c51b33cd1..98ab78247 100644 --- a/src/common/mekanism/generators/common/TileEntityGenerator.java +++ b/src/common/mekanism/generators/common/TileEntityGenerator.java @@ -20,7 +20,7 @@ import universalelectricity.core.UniversalElectricity; import universalelectricity.core.electricity.ElectricInfo; import universalelectricity.core.electricity.ElectricityManager; import universalelectricity.core.implement.IConductor; -import universalelectricity.core.implement.IElectricityReceiver; +import universalelectricity.core.implement.IElectricityProducer; import universalelectricity.core.implement.IJouleStorage; import universalelectricity.core.vector.Vector3; import universalelectricity.prefab.tile.TileEntityConductor; @@ -29,7 +29,7 @@ import mekanism.common.TileEntityElectricBlock; import net.minecraft.src.*; import net.minecraftforge.common.ForgeDirection; -public abstract class TileEntityGenerator extends TileEntityElectricBlock implements IEnergySource, IEnergyStorage, IPowerReceptor, IJouleStorage, IElectricityReceiver, IPeripheral +public abstract class TileEntityGenerator extends TileEntityElectricBlock implements IEnergySource, IEnergyStorage, IPowerReceptor, IJouleStorage, IElectricityProducer, IPeripheral { /** Output per tick this generator can transfer. */ public int output; @@ -255,21 +255,6 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem return side == ForgeDirection.getOrientation(facing); } - @Override - public void onReceive(TileEntity sender, double amps, double voltage, ForgeDirection side) {} - - @Override - public double wattRequest() - { - return 0; - } - - @Override - public boolean canReceiveFromSide(ForgeDirection side) - { - return false; - } - @Override public void readFromNBT(NBTTagCompound nbtTags) { diff --git a/src/common/mekanism/generators/common/TileEntityHeatGenerator.java b/src/common/mekanism/generators/common/TileEntityHeatGenerator.java index 9a96f7343..0b1908236 100644 --- a/src/common/mekanism/generators/common/TileEntityHeatGenerator.java +++ b/src/common/mekanism/generators/common/TileEntityHeatGenerator.java @@ -43,8 +43,8 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan { if(inventory[1].getItem() instanceof IItemElectric) { - IItemElectric electricItem = (IItemElectric) inventory[1].getItem(); - double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules() * 0.005, getVoltage()), electricityStored); + IItemElectric electricItem = (IItemElectric)inventory[1].getItem(); + double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules(inventory[1]) * 0.005, getVoltage()), electricityStored); double joules = electricItem.onReceive(ampsToGive, getVoltage(), inventory[1]); setJoules(electricityStored - (ElectricInfo.getJoules(ampsToGive, getVoltage(), 1) - joules)); } diff --git a/src/common/mekanism/generators/common/TileEntityHydrogenGenerator.java b/src/common/mekanism/generators/common/TileEntityHydrogenGenerator.java index 1cb29bfde..10c3d9491 100644 --- a/src/common/mekanism/generators/common/TileEntityHydrogenGenerator.java +++ b/src/common/mekanism/generators/common/TileEntityHydrogenGenerator.java @@ -39,8 +39,8 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements { if(inventory[1].getItem() instanceof IItemElectric) { - IItemElectric electricItem = (IItemElectric) inventory[1].getItem(); - double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules() * 0.005, getVoltage()), electricityStored); + IItemElectric electricItem = (IItemElectric)inventory[1].getItem(); + double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules(inventory[1]) * 0.005, getVoltage()), electricityStored); double joules = electricItem.onReceive(ampsToGive, getVoltage(), inventory[1]); setJoules(electricityStored - (ElectricInfo.getJoules(ampsToGive, getVoltage(), 1) - joules)); } @@ -57,17 +57,17 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements { IStorageTank item = (IStorageTank)inventory[0].getItem(); - if(item.canProvideGas() && item.gasType() == EnumGas.HYDROGEN) + if(item.canProvideGas(inventory[0], EnumGas.HYDROGEN) && item.getGasType(inventory[0]) == EnumGas.HYDROGEN) { int received = 0; int hydrogenNeeded = MAX_HYDROGEN - hydrogenStored; if(item.getRate() <= hydrogenNeeded) { - received = item.removeGas(inventory[0], item.getRate()); + received = item.removeGas(inventory[0], EnumGas.HYDROGEN, item.getRate()); } else if(item.getRate() > hydrogenNeeded) { - received = item.removeGas(inventory[0], hydrogenNeeded); + received = item.removeGas(inventory[0], EnumGas.HYDROGEN, hydrogenNeeded); } setGas(EnumGas.HYDROGEN, hydrogenStored + received); diff --git a/src/common/mekanism/generators/common/TileEntitySolarGenerator.java b/src/common/mekanism/generators/common/TileEntitySolarGenerator.java index a1a233026..e1ece4123 100644 --- a/src/common/mekanism/generators/common/TileEntitySolarGenerator.java +++ b/src/common/mekanism/generators/common/TileEntitySolarGenerator.java @@ -43,8 +43,8 @@ public class TileEntitySolarGenerator extends TileEntityGenerator { if(inventory[0].getItem() instanceof IItemElectric) { - IItemElectric electricItem = (IItemElectric) inventory[0].getItem(); - double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules() * 0.005, getVoltage()), electricityStored); + IItemElectric electricItem = (IItemElectric)inventory[0].getItem(); + double ampsToGive = Math.min(ElectricInfo.getAmps(electricItem.getMaxJoules(inventory[0]) * 0.005, getVoltage()), electricityStored); double joules = electricItem.onReceive(ampsToGive, getVoltage(), inventory[0]); setJoules(electricityStored - (ElectricInfo.getJoules(ampsToGive, getVoltage(), 1) - joules)); } diff --git a/src/common/mekanism/tools/common/ToolsCommonProxy.java b/src/common/mekanism/tools/common/ToolsCommonProxy.java index 321614286..5ef4d1bfb 100644 --- a/src/common/mekanism/tools/common/ToolsCommonProxy.java +++ b/src/common/mekanism/tools/common/ToolsCommonProxy.java @@ -14,16 +14,6 @@ public class ToolsCommonProxy */ public void registerRenderInformation() {} - /** - * Gets the armor index number from ClientProxy. - * @param armor indicator - * @return armor index number - */ - public int getArmorIndex(String string) - { - return 0; - } - /** * Set and load the mod's common configuration properties. */ diff --git a/src/common/railcraft/common/api/carts/CartBase.java b/src/common/railcraft/common/api/carts/CartBase.java deleted file mode 100644 index d3403ba14..000000000 --- a/src/common/railcraft/common/api/carts/CartBase.java +++ /dev/null @@ -1,118 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraft.src.EntityItem; -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemStack; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.minecart.MinecartInteractEvent; - -/** - * Generally minecarts should extend this class or there will be - * oddities if a user links two carts with different max speeds. - * - * It also contains some generic code that most carts will find useful. - * - * @author CovertJaguar - */ -public abstract class CartBase extends EntityMinecart implements IMinecart -{ - - private float trainSpeed = 1.2f; - - public CartBase(World world) - { - super(world); - CartTools.setCartOwner(this, "[Railcraft]"); - } - - public World getWorld() - { - return worldObj; - } - - @Override - public final float getMaxSpeedRail() - { - return Math.min(getCartMaxSpeed(), trainSpeed); - } - - @Override - public float getCartMaxSpeed() - { - return 1.2f; - } - - @Override - public final void setTrainSpeed(float speed) - { - this.trainSpeed = speed; - } - - @Override - public final boolean interact(EntityPlayer player) - { - if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, player))) { - return true; - } - if(CartTools.getCartOwner(this).equals("[Railcraft]")) { - CartTools.setCartOwner(this, player); - } - return doInteract(player); - } - - public boolean doInteract(EntityPlayer player) - { - return super.interact(player); - } - - @Override - public boolean doesCartMatchFilter(ItemStack stack, EntityMinecart cart) - { - if(stack == null || cart == null) { - return false; - } - ItemStack cartItem = cart.getCartItem(); - return cartItem != null && stack.isItemEqual(cartItem); - } - - @Override - public void setDead() - { - for(int var1 = 0; var1 < this.getSizeInventory(); ++var1) { - ItemStack var2 = this.getStackInSlot(var1); - this.setInventorySlotContents(var1, null); - - if(!worldObj.isRemote && var2 != null) { - float var3 = this.rand.nextFloat() * 0.8F + 0.1F; - float var4 = this.rand.nextFloat() * 0.8F + 0.1F; - float var5 = this.rand.nextFloat() * 0.8F + 0.1F; - - while(var2.stackSize > 0) { - int var6 = this.rand.nextInt(21) + 10; - - if(var6 > var2.stackSize) { - var6 = var2.stackSize; - } - - var2.stackSize -= var6; - EntityItem var7 = new EntityItem(this.worldObj, this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, new ItemStack(var2.itemID, var6, var2.getItemDamage())); - - if(var2.hasTagCompound()) { - var7.item.setTagCompound((NBTTagCompound)var2.getTagCompound().copy()); - } - - float var8 = 0.05F; - var7.motionX = (double)((float)this.rand.nextGaussian() * var8); - var7.motionY = (double)((float)this.rand.nextGaussian() * var8 + 0.2F); - var7.motionZ = (double)((float)this.rand.nextGaussian() * var8); - this.worldObj.spawnEntityInWorld(var7); - } - } - } - - super.setDead(); - } -} diff --git a/src/common/railcraft/common/api/carts/CartTools.java b/src/common/railcraft/common/api/carts/CartTools.java deleted file mode 100644 index 22ee3fd36..000000000 --- a/src/common/railcraft/common/api/carts/CartTools.java +++ /dev/null @@ -1,364 +0,0 @@ -package railcraft.common.api.carts; - -import cpw.mods.fml.common.registry.EntityRegistry; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.src.AxisAlignedBB; -import net.minecraft.src.BlockRail; -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemMinecart; -import net.minecraft.src.ItemStack; -import net.minecraft.src.World; -import net.minecraftforge.common.ForgeDirection; -import railcraft.common.api.core.items.IMinecartItem; - -public abstract class CartTools -{ - - public static ILinkageManager serverLinkageManager; - - /** - * Registers a subclass of EntityMinecart with the game engine. - * - * This is just a convenience function, it is not required to call this function - * if you call ModLoader.registerEntityID() and MinecraftForge.registerEntity() - * elsewhere. - * - * @param mod The mod doing the registration - * @param type The class of the cart - * @param tag The String identifier - * @param internalId The mods internal entity id - */ - public static void registerMinecart(Object mod, Class type, String tag, int internalId) { - EntityRegistry.registerModEntity(type, tag, internalId, mod, 80, 3, true); - } - - /** - * Returns an instance of ILinkageManager. - * - * Will return null if Railcraft is not installed. - * - * @param world The World, may be required in the future - * @return an instance of ILinkageManager - */ - public static ILinkageManager getLinkageManager(World world) { - return serverLinkageManager; - } - - /** - * Sets a carts owner. - * - * The is really only needed by the bukkit ports. - * - * @param owner - */ - public static void setCartOwner(EntityMinecart cart, EntityPlayer owner) { - cart.getEntityData().setString("owner", owner.username); - } - - /** - * Sets a carts owner. - * - * The is really only needed by the bukkit ports. - * - * @param owner - */ - public static void setCartOwner(EntityMinecart cart, String owner) { - cart.getEntityData().setString("owner", owner); - } - - /** - * Gets a carts owner. (player.username) - * - * The is really only needed by the bukkit ports. - * - * @param owner - */ - public static String getCartOwner(EntityMinecart cart) { - return cart.getEntityData().getString("owner"); - } - - /** - * Will return true if the cart matches the provided filter item. - * - * @param stack the Filter - * @param cart the Cart - * @return true if the item matches the cart - * @see IMinecart - */ - public static boolean doesCartMatchFilter(ItemStack stack, EntityMinecart cart) { - if(stack == null) { - return false; - } - if(cart instanceof IMinecart) { - return ((IMinecart)cart).doesCartMatchFilter(stack, cart); - } - ItemStack cartItem = cart.getCartItem(); - return cartItem != null && isItemEqual(stack, cartItem); - } - - private static boolean isItemEqual(ItemStack a, ItemStack b) { - if(a == null || b == null) { - return false; - } - if(a.itemID != b.itemID) { - return false; - } - if(a.stackTagCompound != null && !a.stackTagCompound.equals(b.stackTagCompound)) { - return false; - } - if(a.getHasSubtypes() && (a.getItemDamage() == -1 || b.getItemDamage() == -1)) { - return true; - } - if(a.getHasSubtypes() && a.getItemDamage() != b.getItemDamage()) { - return false; - } - return true; - } - - /** - * Spawns a new cart entity using the provided item. - * - * The backing item must implement IMinecartItem - * and/or extend ItemMinecart. - * - * Generally Forge requires all cart items to extend ItemMinecart. - * - * @param owner The player name that should used as the owner - * @param cart An ItemStack containing a cart item, will not be changed by the function - * @param world The World object - * @param i x-Coord - * @param j y-Coord - * @param k z-Coord - * @return the cart placed or null if failed - * @see IMinecartItem, ItemMinecart - */ - public static EntityMinecart placeCart(String owner, ItemStack cart, World world, int i, int j, int k) { - if(cart == null) { - return null; - } - cart = cart.copy(); - if(cart.getItem() instanceof IMinecartItem) { - IMinecartItem mi = (IMinecartItem)cart.getItem(); - return mi.placeCart(owner, cart, world, i, j, k); - } else if(cart.getItem() instanceof ItemMinecart) { - try { - boolean placed = cart.getItem().onItemUse(cart, null, world, i, j, k, 0, 0, 0, 0); - if(placed) { - List carts = getMinecartsAt(world, i, j, k, 0.3f); - if(carts.size() > 0) { - setCartOwner(carts.get(0), owner); - return carts.get(0); - } - } - } catch (Exception e) { - return null; - } - } - - return null; - } - - /** - * Offers an item stack to linked carts or drops it if no one wants it. - * @param cart - * @param stack - */ - public static void offerOrDropItem(EntityMinecart cart, ItemStack stack) { - EntityMinecart link_A = getLinkageManager(cart.worldObj).getLinkedCartA(cart); - EntityMinecart link_B = getLinkageManager(cart.worldObj).getLinkedCartB(cart); - - if(stack != null && stack.stackSize > 0 && link_A instanceof IItemTransfer) { - stack = ((IItemTransfer)link_A).offerItem(cart, stack); - } - if(stack != null && stack.stackSize > 0 && link_B instanceof IItemTransfer) { - stack = ((IItemTransfer)link_B).offerItem(cart, stack); - } - - if(stack != null && stack.stackSize > 0) { - cart.entityDropItem(stack, 1); - } - } - - public static boolean isMinecartOnRailAt(World world, int i, int j, int k, float sensitivity) { - return isMinecartOnRailAt(world, i, j, k, sensitivity, null, true); - } - - public static boolean isMinecartOnRailAt(World world, int i, int j, int k, float sensitivity, Class type, boolean subclass) { - if(BlockRail.isRailBlockAt(world, i, j, k)) { - return isMinecartAt(world, i, j, k, sensitivity, type, subclass); - } - return false; - } - - public static boolean isMinecartOnAnySide(World world, int i, int j, int k, float sensitivity) { - return isMinecartOnAnySide(world, i, j, k, sensitivity, null, true); - } - - public static boolean isMinecartOnAnySide(World world, int i, int j, int k, float sensitivity, Class type, boolean subclass) { - List list = new ArrayList(); - for(int side = 0; side < 6; side++) { - list.addAll(getMinecartsOnSide(world, i, j, k, sensitivity, ForgeDirection.getOrientation(side))); - } - - if(type == null) { - return !list.isEmpty(); - } else { - for(EntityMinecart cart : list) { - if((subclass && type.isInstance(cart)) || cart.getClass() == type) { - return true; - } - } - } - return false; - } - - public static boolean isMinecartAt(World world, int i, int j, int k, float sensitivity) { - return isMinecartAt(world, i, j, k, sensitivity, null, true); - } - - public static boolean isMinecartAt(World world, int i, int j, int k, float sensitivity, Class type, boolean subclass) { - List list = getMinecartsAt(world, i, j, k, sensitivity); - - if(type == null) { - return !list.isEmpty(); - } else { - for(EntityMinecart cart : list) { - if((subclass && type.isInstance(cart)) || cart.getClass() == type) { - return true; - } - } - } - return false; - } - - public static List getMinecartsOnAllSides(World world, int i, int j, int k, float sensitivity) { - List carts = new ArrayList(); - for(int side = 0; side < 6; side++) { - carts.addAll(getMinecartsOnSide(world, i, j, k, sensitivity, ForgeDirection.getOrientation(side))); - } - - return carts; - } - - public static List getMinecartsOnAllSides(World world, int i, int j, int k, float sensitivity, Class type, boolean subclass) { - List list = new ArrayList(); - List carts = new ArrayList(); - for(int side = 0; side < 6; side++) { - list.addAll(getMinecartsOnSide(world, i, j, k, sensitivity, ForgeDirection.getOrientation(side))); - } - - for(EntityMinecart cart : list) { - if((subclass && type.isInstance(cart)) || cart.getClass() == type) { - carts.add(cart); - } - } - return carts; - } - - private static int getYOnSide(int y, ForgeDirection side) { - switch (side) { - case UP: - return y + 1; - case DOWN: - return y - 1; - default: - return y; - } - } - - private static int getXOnSide(int x, ForgeDirection side) { - switch (side) { - case EAST: - return x + 1; - case WEST: - return x - 1; - default: - return x; - } - } - - private static int getZOnSide(int z, ForgeDirection side) { - switch (side) { - case NORTH: - return z - 1; - case SOUTH: - return z + 1; - default: - return z; - } - } - - public static List getMinecartsOnSide(World world, int i, int j, int k, float sensitivity, ForgeDirection side) { - return getMinecartsAt(world, getXOnSide(i, side), getYOnSide(j, side), getZOnSide(k, side), sensitivity); - } - - public static boolean isMinecartOnSide(World world, int i, int j, int k, float sensitivity, ForgeDirection side) { - return getMinecartOnSide(world, i, j, k, sensitivity, side) != null; - } - - public static EntityMinecart getMinecartOnSide(World world, int i, int j, int k, float sensitivity, ForgeDirection side) { - for(EntityMinecart cart : getMinecartsOnSide(world, i, j, k, sensitivity, side)) { - return cart; - } - return null; - } - - public static boolean isMinecartOnSide(World world, int i, int j, int k, float sensitivity, ForgeDirection side, Class type, boolean subclass) { - return getMinecartOnSide(world, i, j, k, sensitivity, side, type, subclass) != null; - } - - public static EntityMinecart getMinecartOnSide(World world, int i, int j, int k, float sensitivity, ForgeDirection side, Class type, boolean subclass) { - for(EntityMinecart cart : getMinecartsOnSide(world, i, j, k, sensitivity, side)) { - if(type == null || (subclass && type.isInstance(cart)) || cart.getClass() == type) { - return cart; - } - } - return null; - } - - /** - * - * @param world - * @param i - * @param j - * @param k - * @param sensitivity Controls the size of the search box, ranges from (-inf, 0.49]. - * @return - */ - public static List getMinecartsAt(World world, int i, int j, int k, float sensitivity) { - sensitivity = Math.min(sensitivity, 0.49f); - List entities = world.getEntitiesWithinAABB(net.minecraft.src.EntityMinecart.class, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(i + sensitivity, j + sensitivity, k + sensitivity, i + 1 - sensitivity, j + 1 - sensitivity, k + 1 - sensitivity)); - List carts = new ArrayList(); - for(Object o : entities) { - carts.add((EntityMinecart)o); - } - return carts; - } - - public static List getMinecartsIn(World world, int i1, int j1, int k1, int i2, int j2, int k2) { - List entities = world.getEntitiesWithinAABB(net.minecraft.src.EntityMinecart.class, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(i1, j1, k1, i2, j2, k2)); - List carts = new ArrayList(); - for(Object o : entities) { - carts.add((EntityMinecart)o); - } - return carts; - } - - /** - * Returns the cart's "speed". It is not capped by the carts max speed, - * it instead returns the cart's "potential" speed. - * Used by collision and linkage logic. - * Do not use this to determine how fast a cart is currently moving. - * @param cart - * @return speed - */ - public static double getCartSpeedUncapped(EntityMinecart cart) { - return Math.sqrt(cart.motionX * cart.motionX + cart.motionZ * cart.motionZ); - } - - public static boolean cartVelocityIsLessThan(EntityMinecart cart, float vel) { - return Math.abs(cart.motionX) < vel && Math.abs(cart.motionZ) < vel; - } -} diff --git a/src/common/railcraft/common/api/carts/ICartRenderInterface.java b/src/common/railcraft/common/api/carts/ICartRenderInterface.java deleted file mode 100644 index 4fcb413f9..000000000 --- a/src/common/railcraft/common/api/carts/ICartRenderInterface.java +++ /dev/null @@ -1,24 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraft.src.Block; - -/** - * Used by the renderer to renders blocks in carts. - * @author CovertJaguar - */ -public interface ICartRenderInterface -{ - - /** - * Return the block that should be rendered in the cart. - * @return The Block to render - */ - public Block getBlock(); - - /** - * Return the metadata for the block - * that should be rendered in the cart. - * @return metadata - */ - public int getBlockMetadata(); -} diff --git a/src/common/railcraft/common/api/carts/IEnergyTransfer.java b/src/common/railcraft/common/api/carts/IEnergyTransfer.java deleted file mode 100644 index 49fee703a..000000000 --- a/src/common/railcraft/common/api/carts/IEnergyTransfer.java +++ /dev/null @@ -1,82 +0,0 @@ -package railcraft.common.api.carts; - -/** - * This interface is implemented by the Energy Cart - * and is used by the Energy Loaders to charge/discharge carts. - * It is roughly equivalent to the IItemTransfer interface - * and based on ElectricItem and IElectricItem. - * - * @author CovertJaguar - * @see IItemTransfer - */ -public interface IEnergyTransfer -{ - - /** - * Injects the specified amount of EU into the device. - * - * The function returns the remainder of the EU after - * any EU used is subtracted. - * - * @param source Object initiating the transfer, should be an Entity or Tile Entity - * @param amount amount of energy to transfer in EU - * @param tier tier of the source device, has to be at least as high as the target device - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param simulate don't actually change the item, just determine the return value - * @return The amount of EU not used - */ - public int injectEnergy(Object source, int amount, int tier, boolean ignoreTransferLimit, boolean simulate, boolean passAlong); - - /** - * Requests a certain amount of EU from the device. - * - * The is function will subtract EU from the device's store of power - * and return a portion up to, but not exceeding, the amount of EU requested. - * - * @param source Object initiating the transfer, should be an Entity or Tile Entity - * @param amount amount of energy to transfer in EU - * @param tier tier of the source device, has to be at least as high as the target device - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param simulate don't actually change the item, just determine the return value - * @param passAlong whether neighboring carts should be asked to provide any missing power. - * @return The amount of EU transferred - */ - public int extractEnergy(Object source, int amount, int tier, boolean ignoreTransferLimit, boolean simulate, boolean passAlong); - - /** - * Return true if energy can be injected into this device. - * - * @return true if can inject energy - */ - public boolean canInjectEnergy(); - - /** - * Return true if energy can be extracted from this device. - * - * @return true if can extract energy - */ - public boolean canExtractEnergy(); - - /** - * The max capacity of the device. - * - * @return max capacity - */ - public int getCapacity(); - - /** - * Returns the current energy contained in the device. - * - * @return current energy - */ - public int getEnergy(); - - public int getTier(); - - /** - * The device's transfer rate in EU/t. - * - * @return the transfer rate - */ - public int getTransferLimit(); -} diff --git a/src/common/railcraft/common/api/carts/IExplosiveCart.java b/src/common/railcraft/common/api/carts/IExplosiveCart.java deleted file mode 100644 index c9f860222..000000000 --- a/src/common/railcraft/common/api/carts/IExplosiveCart.java +++ /dev/null @@ -1,56 +0,0 @@ -package railcraft.common.api.carts; - -public interface IExplosiveCart -{ - - /** - * If set to true the cart should explode after - * whatever fuse duration is set. - * - * @param primed - */ - public void setPrimed(boolean primed); - - /** - * Returns whether the cart is primed to explode. - * - * @return primed - */ - public boolean isPrimed(); - - /** - * Returns the length of the current fuse. - * - * @return fuse length in ticks - */ - public int getFuse(); - - /** - * Optional function to allow setting the fuse duration. - * - * Used by the Priming Track. - * - * @param fuse in ticks - */ - public void setFuse(int fuse); - - /** - * Returns the blast radius, but I don't think anything currently uses this. - * - * @return blast radius - */ - public float getBlastRadius(); - - /** - * Optional function to allow setting the blast radius. - * - * @param radius - */ - public void setBlastRadius(float radius); - - /** - * Causes the cart to explode immediately. - * - */ - public void explode(); -} diff --git a/src/common/railcraft/common/api/carts/IItemTransfer.java b/src/common/railcraft/common/api/carts/IItemTransfer.java deleted file mode 100644 index 1876ad389..000000000 --- a/src/common/railcraft/common/api/carts/IItemTransfer.java +++ /dev/null @@ -1,65 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraft.src.ItemStack; -import railcraft.common.api.core.items.IItemType; - -/** - * This interface allows items to be passed around with out needing - * to know anything about the underlying implementation of the inventories. - * - * @author CovertJaguar - */ -public interface IItemTransfer -{ - - /** - * Offers an ItemStack to the object implementing this interface. - * This function will return null if the item is accepted in full, - * otherwise it will return whatever is rejected. - * - * @param source The Object offering the item - * @param offer The ItemStack being offered - * @return Unused or unwanted portions of offer - */ - public ItemStack offerItem(Object source, ItemStack offer); - - /** - * Requests an ItemStack from the object implementing this interface. - * It is up to the object implementing this interface to determine which - * ItemStack to return, or none at all. - * - * @param source The Object submitting the request - * @return An ItemStack to fulfill the request or null if refused. - */ - public ItemStack requestItem(Object source); - - /** - * Requests an ItemStack from the object implementing this interface - * that matches the request parameter. - * It is up to the object implementing this interface to - * determine which ItemStack to return, or none at all. - * However, if the return value is not null - * it should fulfill the following condition:
- * InventoryTools.isItemEqual(it.requestItem(this,request), request) == true - * - * @param source The Object submitting the request - * @param request The type of item requested - * @return An ItemStack to fulfill the request or null if refused. - */ - public ItemStack requestItem(Object source, ItemStack request); - - /** - * Requests an ItemStack from the object implementing this interface - * that matches the request parameter. - * It is up to the object implementing this interface to - * determine which ItemStack to return, or none at all. - * However, if the return value is not null - * it should fulfill the following condition:
- * IItemType.isItemType(it.requestItem(this,request), request) == true - * - * @param source The Object submitting the request - * @param request The type of item requested - * @return An ItemStack to fulfill the request or null if refused. - */ - public ItemStack requestItem(Object source, IItemType request); -} diff --git a/src/common/railcraft/common/api/carts/ILinkableCart.java b/src/common/railcraft/common/api/carts/ILinkableCart.java deleted file mode 100644 index d87386d9d..000000000 --- a/src/common/railcraft/common/api/carts/ILinkableCart.java +++ /dev/null @@ -1,77 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraft.src.EntityMinecart; - -/** - * This interface should be implemented by any minecart that wishes - * to change the default linkage behavior. - * It is NOT required to be able to link a cart, - * it merely gives you more control over the process. - * @author CovertJaguar - */ -public interface ILinkableCart -{ - - /** - * To disable linking altogether, return false here. - * @return True if this cart is linkable. - */ - public boolean isLinkable(); - - /** - * Check called when attempting to link carts. - * @param cart The cart that we are attempting to link with. - * @return True if we can link with this cart. - */ - public boolean canLinkWithCart(EntityMinecart cart); - - /** - * Returns true if this cart has two links - * or false if it can only link with one cart. - * @return True if two links - */ - public boolean hasTwoLinks(); - - /** - * Gets the distance at which this cart can be linked. - * This is called on both carts and added together to determine - * how close two carts need to be for a successful link. - * Default = LinkageManager.LINKAGE_DISTANCE - * @param cart The cart that you are attempting to link with. - * @return The linkage distance - */ - public float getLinkageDistance(EntityMinecart cart); - - /** - * Gets the optimal distance between linked carts. - * This is called on both carts and added together to determine - * the optimal rest distance between linked carts. - * The LinkageManager will attempt to maintain this distance - * between linked carts at all times. - * Default = LinkageManager.OPTIMAL_DISTANCE - * @param cart The cart that you are linked with. - * @return The optimal rest distance - */ - public float getOptimalDistance(EntityMinecart cart); - - /** - * Return false if linked carts have no effect on the velocity of this cart. - * Use carefully, if you link two carts that can't be adjusted, - * it will behave as if they are not linked. - * @param cart The cart doing the adjusting. - * @return Whether the cart can have its velocity adjusted. - */ - public boolean canBeAdjusted(EntityMinecart cart); - - /** - * Called upon successful link creation. - * @param cart The cart we linked with. - */ - public void onLinkCreated(EntityMinecart cart); - - /** - * Called when a link is broken (usually). - * @param cart The cart we were linked with. - */ - public void onLinkBroken(EntityMinecart cart); -} diff --git a/src/common/railcraft/common/api/carts/ILinkageManager.java b/src/common/railcraft/common/api/carts/ILinkageManager.java deleted file mode 100644 index e3080968f..000000000 --- a/src/common/railcraft/common/api/carts/ILinkageManager.java +++ /dev/null @@ -1,102 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraft.src.EntityMinecart; - -/** - * The LinkageManager contains all the functions needed to link and interact - * with linked carts. - * - * To obtain an instance of this interface, call CartTools.getLinkageManager(). - * - * Each cart can up to two links. They are called Link A and Link B. - * Some carts will have only Link A, for example the Tunnel Bore. - * - * @author CovertJaguar - * @see CartTools, ILinkableCart - */ -public interface ILinkageManager -{ - - /** - * The default max distance at which carts can be linked, divided by 2. - */ - public static final float LINKAGE_DISTANCE = 1.25f; - /** - * The default distance at which linked carts are maintained, divided by 2. - */ - public static final float OPTIMAL_DISTANCE = 0.78f; - - /** - * Creates a link between two carts, - * but only if there is nothing preventing such a link. - * - * @param cart1 - * @param cart2 - * @return True if the link succeeded. - */ - public boolean createLink(EntityMinecart cart1, EntityMinecart cart2); - - /** - * Returns the cart linked to Link A or null if nothing is currently - * occupying Link A. - * - * @param cart The cart for which to get the link - * @return The linked cart or null - */ - public EntityMinecart getLinkedCartA(EntityMinecart cart); - - /** - * Returns the cart linked to Link B or null if nothing is currently - * occupying Link B. - * - * @param cart The cart for which to get the link - * @return The linked cart or null - */ - public EntityMinecart getLinkedCartB(EntityMinecart cart); - - /** - * Returns true if the two carts are linked to each other. - * - * @param cart1 - * @param cart2 - * @return True if linked - */ - public boolean areLinked(EntityMinecart cart1, EntityMinecart cart2); - - /** - * Breaks a link between two carts, if any link exists. - * - * @param cart1 - * @param cart2 - */ - public void breakLink(EntityMinecart cart1, EntityMinecart cart2); - - /** - * Breaks all links the cart has. - * - * @param cart - */ - public void breakLinks(EntityMinecart cart); - - /** - * Break only link A. - * - * @param cart - */ - public void breakLinkA(EntityMinecart cart); - - /** - * Break only link B. - * - * @param cart - */ - public void breakLinkB(EntityMinecart cart); - - /** - * Counts how many carts are in the train. - * - * @param cart Any cart in the train - * @return The number of carts in the train - */ - public int countCartsInTrain(EntityMinecart cart); -} diff --git a/src/common/railcraft/common/api/carts/ILiquidTransfer.java b/src/common/railcraft/common/api/carts/ILiquidTransfer.java deleted file mode 100644 index b587ddd52..000000000 --- a/src/common/railcraft/common/api/carts/ILiquidTransfer.java +++ /dev/null @@ -1,54 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraftforge.liquids.LiquidStack; - -/** - * This interface allows carts to transfer liquid between each other as well as - * adding a couple other functions related to liquids. - * - * @author CovertJaguar - */ -public interface ILiquidTransfer { - - /** - * Offers liquid to this object. - * - * Is not used by the Liquid Loader to load carts, the traditional - * ILiquidContainer is used for that. - * - * @param source The Object offering the liquid, used to prevent request - * loops in trains - * @param quantity The quantity offered - * @param id The liquid id offered - * @return the liquid used - */ - public int offerLiquid(Object source, LiquidStack offer); - - /** - * Requests liquid from this object. - * - * Is not used by the Liquid Unloader to drain carts, the traditional - * ILiquidContainer is used for that. - * - * @param source The Object requesting the liquid, used to prevent request - * loops in trains - * @param quantity The quantity requested - * @param id The liquid type requested - * @return the liquid provided - */ - public int requestLiquid(Object source, LiquidStack request); - - /** - * Set by the Liquid Loader while filling, primarily used for rendering a - * visible change while being filled. - * - * @param filling - */ - public void setFilling(boolean filling); - - /** - * - * @return true if being filled - */ - public boolean isFilling(); -} diff --git a/src/common/railcraft/common/api/carts/IMinecart.java b/src/common/railcraft/common/api/carts/IMinecart.java deleted file mode 100644 index 7707a20e7..000000000 --- a/src/common/railcraft/common/api/carts/IMinecart.java +++ /dev/null @@ -1,52 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.ItemStack; - -/** - * Some helper functions to make interacting with carts simpler. - * - * This interface is implemented by CartBase. - * - * @author CovertJaguar - * @see CartBase - */ -public interface IMinecart -{ - - /** - * Returns true if the Minecart matches the item provided. - * Generally just stack.isItemEqual(cart.getCartItem()), - * but some carts may need more control (the Tank Cart for example). - * - * @param stack the Filter - * @param cart the Cart - * @return true if the item matches the cart - */ - public boolean doesCartMatchFilter(ItemStack stack, EntityMinecart cart); - - /** - * Unlike EntityMinecart.getMaxSpeedRail(), - * this function is independent of the actual max speed of the cart. - * - * It should represent the max possible speed at this point in time - * before any modifiers due to linked carts, etc are applied. - * - * This is really only used for Train speed calculations. - * Which ever cart in the train returns the lowest value here will be the max speed of the entire train. - * - * @return - */ - public float getCartMaxSpeed(); - - /** - * Sets the max speed of a train. - * - * This should be used to limit the return value for EntityMinecart.getMaxSpeedRail(). - * - * @param speed - * @see CartBase - */ - public void setTrainSpeed(float speed); - -} diff --git a/src/common/railcraft/common/api/carts/TransferCartBase.java b/src/common/railcraft/common/api/carts/TransferCartBase.java deleted file mode 100644 index 6577ca495..000000000 --- a/src/common/railcraft/common/api/carts/TransferCartBase.java +++ /dev/null @@ -1,252 +0,0 @@ -package railcraft.common.api.carts; - -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.IInventory; -import net.minecraft.src.ItemStack; -import net.minecraft.src.World; -import railcraft.common.api.core.items.IItemType; - -/** - * Abstract minecart class that implements the IItemTransfer - * interface for convenience and as example for others who wish - * to create carts that implements IItemTransfer. - * This particular implementation assumes a simple inventory - * and will attempt to pass along offers and requests to linked carts - * if it cannot fulfill them itself. - *
- *
- * Classes that extend this class:
- * EntityCartChest
- * EntityCartAnchor
- * - * @author CovertJaguar - */ -public abstract class TransferCartBase extends CartBase implements IItemTransfer -{ - - /** - * If passThrough == true, this cart will only pass requests along, it wont attempt to fulfill them. - */ - protected boolean passThrough = false; - - public TransferCartBase(World world) - { - super(world); - } - - @Override - public ItemStack offerItem(Object source, ItemStack offer) - { - if(!passThrough && getSizeInventory() > 0) { - offer = moveItemStack(offer, this); - if(offer == null) { - return null; - } - } - - ILinkageManager lm = CartTools.getLinkageManager(worldObj); - - EntityMinecart linkedCart = lm.getLinkedCartA(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - offer = ((IItemTransfer)linkedCart).offerItem(this, offer); - } - - if(offer == null) { - return null; - } - - linkedCart = lm.getLinkedCartB(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - offer = ((IItemTransfer)linkedCart).offerItem(this, offer); - } - - return offer; - } - - @Override - public ItemStack requestItem(Object source) - { - ItemStack result = null; - if(!passThrough && getSizeInventory() > 0) { - result = removeOneItem(this); - if(result != null) { - return result; - } - } - - ILinkageManager lm = CartTools.getLinkageManager(worldObj); - - EntityMinecart linkedCart = lm.getLinkedCartA(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - result = ((IItemTransfer)linkedCart).requestItem(this); - } - - if(result != null) { - return result; - } - - linkedCart = lm.getLinkedCartB(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - result = ((IItemTransfer)linkedCart).requestItem(this); - } - - return result; - } - - @Override - public ItemStack requestItem(Object source, ItemStack request) - { - ItemStack result = null; - if(!passThrough && getSizeInventory() > 0) { - result = removeOneItem(this, request); - if(result != null) { - return result; - } - } - - ILinkageManager lm = CartTools.getLinkageManager(worldObj); - - EntityMinecart linkedCart = lm.getLinkedCartA(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - result = ((IItemTransfer)linkedCart).requestItem(this, request); - } - - if(result != null) { - return result; - } - - linkedCart = lm.getLinkedCartB(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - result = ((IItemTransfer)linkedCart).requestItem(this, request); - } - - return result; - } - - @Override - public ItemStack requestItem(Object source, IItemType request) - { - ItemStack result = null; - if(!passThrough && getSizeInventory() > 0) { - result = removeOneItem(this, request); - if(result != null) { - return result; - } - } - - ILinkageManager lm = CartTools.getLinkageManager(worldObj); - - EntityMinecart linkedCart = lm.getLinkedCartA(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - result = ((IItemTransfer)linkedCart).requestItem(this, request); - } - - if(result != null) { - return result; - } - - linkedCart = lm.getLinkedCartB(this); - if(linkedCart != source && linkedCart instanceof IItemTransfer) { - result = ((IItemTransfer)linkedCart).requestItem(this, request); - } - - return result; - } - - /** - * Removes and returns a single item from the inventory. - * @param inv The inventory - * @return An ItemStack - */ - protected final ItemStack removeOneItem(IInventory inv) - { - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack slot = inv.getStackInSlot(i); - if(slot != null) { - return inv.decrStackSize(i, 1); - } - } - return null; - } - - /** - * Removes and returns a single item from the inventory that matches the filter. - * @param inv The inventory - * @param filter ItemStack to match against - * @return An ItemStack - */ - protected final ItemStack removeOneItem(IInventory inv, ItemStack filter) - { - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack slot = inv.getStackInSlot(i); - if(slot != null && filter != null && slot.isItemEqual(filter)) { - return inv.decrStackSize(i, 1); - } - } - return null; - } - - /** - * Removes and returns a single item from the inventory that matches the filter. - * @param inv The inventory - * @param filter EnumItemType to match against - * @return An ItemStack - */ - protected final ItemStack removeOneItem(IInventory inv, IItemType filter) - { - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack slot = inv.getStackInSlot(i); - if(slot != null && filter.isItemType(slot)) { - return inv.decrStackSize(i, 1); - } - } - return null; - } - - protected final ItemStack moveItemStack(ItemStack stack, IInventory dest) - { - if(stack == null) { - return null; - } - stack = stack.copy(); - if(dest == null) { - return stack; - } - boolean movedItem = false; - do { - movedItem = false; - ItemStack destStack = null; - for(int ii = 0; ii < dest.getSizeInventory(); ii++) { - destStack = dest.getStackInSlot(ii); - if(destStack != null && destStack.isItemEqual(stack)) { - int maxStack = Math.min(destStack.getMaxStackSize(), dest.getInventoryStackLimit()); - int room = maxStack - destStack.stackSize; - if(room > 0) { - int move = Math.min(room, stack.stackSize); - destStack.stackSize += move; - stack.stackSize -= move; - if(stack.stackSize <= 0) { - return null; - } - movedItem = true; - } - } - } - if(!movedItem) { - for(int ii = 0; ii < dest.getSizeInventory(); ii++) { - destStack = dest.getStackInSlot(ii); - if(destStack == null) { - if(stack.stackSize > dest.getInventoryStackLimit()) { - dest.setInventorySlotContents(ii, stack.splitStack(dest.getInventoryStackLimit())); - } else { - dest.setInventorySlotContents(ii, stack); - return null; - } - movedItem = true; - } - } - } - } while(movedItem); - return stack; - } -} diff --git a/src/common/railcraft/common/api/carts/bore/IBoreHead.java b/src/common/railcraft/common/api/carts/bore/IBoreHead.java deleted file mode 100644 index 3d5410394..000000000 --- a/src/common/railcraft/common/api/carts/bore/IBoreHead.java +++ /dev/null @@ -1,37 +0,0 @@ -package railcraft.common.api.carts.bore; - -/** - * This interface it used to define an item that can - * be used as a bore head for the Tunnel Bore. - * @author CovertJaguar - */ -public interface IBoreHead -{ - - /** - * Return the texture file used for this bore head. - * @return The texture file path - */ - public String getBoreTexture(); - - /** - * Return the harvest level of this bore head. - * - * This value is compared against the tool classes - * "pickaxe", "axe", and "shovel" to determine if the - * block is harvestable by the bore head. - * - * @return The harvest level - */ - public int getHarvestLevel(); - - /** - * Return the dig speed modifier of this bore head. - * - * This value controls how much faster or slow this bore head - * mines each layer compared to the default time. - * - * @return The dig speed modifier - */ - public float getDigModifier(); -} diff --git a/src/common/railcraft/common/api/carts/bore/IMineable.java b/src/common/railcraft/common/api/carts/bore/IMineable.java deleted file mode 100644 index 185d0b65d..000000000 --- a/src/common/railcraft/common/api/carts/bore/IMineable.java +++ /dev/null @@ -1,36 +0,0 @@ -package railcraft.common.api.carts.bore; - -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.ItemStack; -import net.minecraft.src.World; - -/** - * This interface can be implemented by a block class to control whether a block can be - * mined by the bore without having to force the user to edit the configuration file. - * - * If the block is found to implement this class, any setting in the configuration - * is ignored for that block. - * - * Generally, the reason blocks are not minable by default is to prevent you - * from intentionally or accidentally boring through your base. - * - * @author CovertJaguar - */ -public interface IMineable -{ - - /** - * Called when the Bore attempts to mine the block. If it returns false, - * the Bore will halt operation. - * - * @param world The World - * @param i x-Coord - * @param j y-Coord - * @param k z-Coord - * @param bore The Bore entity - * @param head The BoreHead, item implements IBoreHead. - * @return true if mineable - * @see IBoreHead - */ - public boolean canMineBlock(World world, int i, int j, int k, EntityMinecart bore, ItemStack head); -} diff --git a/src/common/railcraft/common/api/core/INetworkedObject.java b/src/common/railcraft/common/api/core/INetworkedObject.java deleted file mode 100644 index c09438608..000000000 --- a/src/common/railcraft/common/api/core/INetworkedObject.java +++ /dev/null @@ -1,16 +0,0 @@ -package railcraft.common.api.core; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import net.minecraft.src.World; - -public interface INetworkedObject -{ - - public World getWorld(); - - public void writePacketData(DataOutputStream data) throws IOException; - - public void readPacketData(DataInputStream data) throws IOException; -} diff --git a/src/common/railcraft/common/api/core/IPostConnection.java b/src/common/railcraft/common/api/core/IPostConnection.java deleted file mode 100644 index 12a13c4e2..000000000 --- a/src/common/railcraft/common/api/core/IPostConnection.java +++ /dev/null @@ -1,27 +0,0 @@ -package railcraft.common.api.core; - -import net.minecraft.src.World; -import net.minecraftforge.common.ForgeDirection; - -/** - * If you want your block to connect (or not connect) to posts, - * implement this interface. - * - * The result takes priority over any other rules. - * - * @author CovertJaguar - */ -public interface IPostConnection -{ - - /** - * Return true if the block at this location should connect to a post. - * @param world The World - * @param i x-Coord - * @param j y-Coord - * @param k z-Coord - * @param side Side to connect to - * @return true if connect - */ - public boolean connectsAt(World world, int i, int j, int k, ForgeDirection side); -} diff --git a/src/common/railcraft/common/api/core/WorldCoordinate.java b/src/common/railcraft/common/api/core/WorldCoordinate.java deleted file mode 100644 index 3037e8009..000000000 --- a/src/common/railcraft/common/api/core/WorldCoordinate.java +++ /dev/null @@ -1,78 +0,0 @@ -package railcraft.common.api.core; - -/** - * This immutable class represents a point in the Minecraft world, - * while taking into account the possibility of coordinates in different dimensions. - * @author CovertJaguar - */ -public class WorldCoordinate -{ - - /** - * The dimension - */ - public final int dimension; - /** - * x-Coord - */ - public final int x; - /** - * y-Coord - */ - public final int y; - /** - * z-Coord - */ - public final int z; - - /** - * Creates a new WorldCoordinate - * @param dimension - * @param i - * @param j - * @param k - */ - public WorldCoordinate(int dimension, int i, int j, int k) - { - this.dimension = dimension; - x = i; - y = j; - z = k; - } - - @Override - public boolean equals(Object obj) - { - if(obj == null) { - return false; - } - if(getClass() != obj.getClass()) { - return false; - } - final WorldCoordinate other = (WorldCoordinate)obj; - if(this.dimension != other.dimension) { - return false; - } - if(this.x != other.x) { - return false; - } - if(this.y != other.y) { - return false; - } - if(this.z != other.z) { - return false; - } - return true; - } - - @Override - public int hashCode() - { - int hash = 3; - hash = 13 * hash + this.dimension; - hash = 13 * hash + this.x; - hash = 13 * hash + this.y; - hash = 13 * hash + this.z; - return hash; - } -} diff --git a/src/common/railcraft/common/api/core/items/ICrowbar.java b/src/common/railcraft/common/api/core/items/ICrowbar.java deleted file mode 100644 index 3a058b289..000000000 --- a/src/common/railcraft/common/api/core/items/ICrowbar.java +++ /dev/null @@ -1,14 +0,0 @@ -package railcraft.common.api.core.items; - -/** - * Any item that performs the same function as a crowbar should implement this interface. - * Making a new crowbar item is as simple as implementing this empty interface. - * Doing so will make all the blocks, tracks, and entities aware of that the item - * should be treated identically to a crowbar. - * - * @author CovertJaguar - */ -public interface ICrowbar -{ - -} diff --git a/src/common/railcraft/common/api/core/items/IItemType.java b/src/common/railcraft/common/api/core/items/IItemType.java deleted file mode 100644 index 5b1ca29b5..000000000 --- a/src/common/railcraft/common/api/core/items/IItemType.java +++ /dev/null @@ -1,23 +0,0 @@ -package railcraft.common.api.core.items; - -import java.util.HashMap; -import java.util.Map; -import net.minecraft.src.ItemStack; - -/** - * This interface is used with several of the functions in IItemTransfer - * to provide a convenient means of dealing with entire classes of items without - * having to specify each item individually. - * @author CovertJaguar - */ -public interface IItemType -{ - /** - * Railcraft adds the following IItemTypes during preInit: FUEL, TRACK, MINECART, BALLAST, FEED - * - * Feel free to grab them from here or define your own. - */ - public static final Map types = new HashMap(); - - public boolean isItemType(ItemStack stack); -} diff --git a/src/common/railcraft/common/api/core/items/IMinecartItem.java b/src/common/railcraft/common/api/core/items/IMinecartItem.java deleted file mode 100644 index 22d513b8d..000000000 --- a/src/common/railcraft/common/api/core/items/IMinecartItem.java +++ /dev/null @@ -1,39 +0,0 @@ -package railcraft.common.api.core.items; - -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.ItemStack; -import net.minecraft.src.World; - -/** - * This interface should be implemented by any cart item, - * but it is generally optional. - * - * @author CovertJaguar - */ -public interface IMinecartItem -{ - - /** - * Controls whether this cart item can be placed by the Cart and Train Dispensers. - * - * Generally, you can ignore the placeCart() function if this returns false. - * - * @return true if it can be placed, false otherwise - */ - public boolean canBePlacedByNonPlayer(ItemStack cart); - - /** - * Places a cart at the specified location. - * - * Implementing this function is optional. - * - * @param owner the name of the player placing the cart or "[MyMod]" with the brackets - * @param cart An ItemStack that contains the cart - * @param world The World - * @param i x-Coord - * @param j y-Coord - * @param k z-Coord - * @return the cart placed or null if failed - */ - public EntityMinecart placeCart(String owner, ItemStack cart, World world, int i, int j, int k); -} diff --git a/src/common/railcraft/common/api/core/items/ITrackItem.java b/src/common/railcraft/common/api/core/items/ITrackItem.java deleted file mode 100644 index 1c4cd72f0..000000000 --- a/src/common/railcraft/common/api/core/items/ITrackItem.java +++ /dev/null @@ -1,46 +0,0 @@ -package railcraft.common.api.core.items; - -import net.minecraft.src.ItemStack; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; - -/** - * Should be implemented by any rail item class that wishes to have - * it's rails placed by for example the Tunnel Bore or Track Relayer. - * - * If you defined your rails with a TrackSpec, you don't need to worry about this. - * - * @author CovertJaguar - */ -public interface ITrackItem -{ - - /** - * Attempts to place a track. - * - * @param world The World object - * @param i x-Coord - * @param j y-Coord - * @param k z-Coord - * @return true if successful - */ - public boolean placeTrack(ItemStack stack, World world, int i, int j, int k); - - /** - * Return the block id of a placed track. - * - * @return the blockId - */ - public int getPlacedBlockId(); - - /** - * Return true if the given tile entity corresponds to this Track item. - * - * If the track has no tile entity, return true on null. - * - * @param stack - * @param tile - * @return - */ - public boolean isPlacedTileEntity(ItemStack stack, TileEntity tile); -} diff --git a/src/common/railcraft/common/api/core/items/ItemRegistry.java b/src/common/railcraft/common/api/core/items/ItemRegistry.java deleted file mode 100644 index 20303394e..000000000 --- a/src/common/railcraft/common/api/core/items/ItemRegistry.java +++ /dev/null @@ -1,94 +0,0 @@ -package railcraft.common.api.core.items; - -import java.util.Map; -import java.util.TreeMap; -import net.minecraft.src.ItemStack; - -/** - * This class contains a registry of all currently active Railcraft items. - * Which items are registered depends on the user's settings in "railcraft.cfg", - * so the available items may vary from one installation to the next. - * - * Initialization of the registry will occur during the BaseMod.load() - * function. It is strongly recommended you wait until the BaseMod.modsLoaded() - * function to reference the registry. - * - * @author CovertJaguar - */ -public final class ItemRegistry -{ - - private static final Map registry = new TreeMap(); - - private ItemRegistry() - { - } - - /** - * This function will return an ItemStack containing the item that - * corresponds to the provided tag. - * - * Generally item tags will correspond to the tags used in "railcraft.cfg", - * but there will be some exceptions. - * - * This function can and will return null for just about every item - * if the item is disabled via the configuration files. - * You must test the return value for safety. - * - * For list of available tags see the printItemTags() function. - * - * @param tag The item tag - * @param qty The stackSize of the returned item - * @return The ItemStack or null if no item exists for that tag - */ - public static ItemStack getItem(String tag, int qty) - { - ItemStack stack = registry.get(tag); - if(stack != null) { - stack = stack.copy(); - stack.stackSize = qty; - } - return stack; - } - - /** - * Registers a new item with the Registry. - * - * This should generally only be called by Railcraft itself - * while the mod is initializing during the mod_Railcraft.load() call. - * - * @param tag The tag name - * @param item The item - */ - public static void registerItem(String tag, ItemStack item) - { - tag = tag.replace("rc.", ""); - registry.put(tag, item); - } - - /** - * This function will print a list of all currently registered items - * to the console. - * - * Use this for development purposes. - */ - public static void printItemTags() - { - System.out.println(); - System.out.println("Printing all registered Railcraft items:"); - for(String tag : registry.keySet()) { - System.out.println(tag); - } - System.out.println(); - } - - /** - * Returns the entire mapping of items. - * - * @return - */ - public static Map getItems() - { - return registry; - } -} diff --git a/src/common/railcraft/common/api/crafting/IBlastFurnaceCraftingManager.java b/src/common/railcraft/common/api/crafting/IBlastFurnaceCraftingManager.java deleted file mode 100644 index e92381c36..000000000 --- a/src/common/railcraft/common/api/crafting/IBlastFurnaceCraftingManager.java +++ /dev/null @@ -1,25 +0,0 @@ -package railcraft.common.api.crafting; - -import java.util.List; -import net.minecraft.src.ItemStack; - -/** - * - * @author CovertJaguar - */ -public interface IBlastFurnaceCraftingManager -{ - - void addRecipe(int inputId, int inputDamage, int cookTime, ItemStack output); - - void addRecipe(int inputId, int cookTime, ItemStack output); - - List getFuels(); - - IBlastFurnaceRecipe getRecipe(int inputId, int inputDamage); - - IBlastFurnaceRecipe getRecipe(ItemStack stack); - - List getRecipes(); - -} diff --git a/src/common/railcraft/common/api/crafting/IBlastFurnaceRecipe.java b/src/common/railcraft/common/api/crafting/IBlastFurnaceRecipe.java deleted file mode 100644 index 6c6a71818..000000000 --- a/src/common/railcraft/common/api/crafting/IBlastFurnaceRecipe.java +++ /dev/null @@ -1,21 +0,0 @@ -package railcraft.common.api.crafting; - -import net.minecraft.src.ItemStack; - -/** - * - * @author CovertJaguar - */ -public interface IBlastFurnaceRecipe -{ - - public int getCookTime(); - - public ItemStack getInput(); - - public ItemStack getOutput(); - - int getOutputStackSize(); - - boolean isRoomForOutput(ItemStack out); -} diff --git a/src/common/railcraft/common/api/crafting/ICokeOvenCraftingManager.java b/src/common/railcraft/common/api/crafting/ICokeOvenCraftingManager.java deleted file mode 100644 index 0c2d810ff..000000000 --- a/src/common/railcraft/common/api/crafting/ICokeOvenCraftingManager.java +++ /dev/null @@ -1,24 +0,0 @@ -package railcraft.common.api.crafting; - -import java.util.List; -import net.minecraft.src.ItemStack; -import net.minecraftforge.liquids.LiquidStack; - -/** - * - * @author CovertJaguar - */ -public interface ICokeOvenCraftingManager { - - void addRecipe(ItemStack input, ItemStack output, LiquidStack liquidOutput, int cookTime); - - void addRecipe(int inputId, int inputDamage, ItemStack output, LiquidStack liquidOutput, int cookTime); - - void addRecipe(int inputId, ItemStack output, LiquidStack liquidOutput, int cookTime); - - ICokeOvenRecipe getRecipe(ItemStack stack); - - ICokeOvenRecipe getRecipe(int inputId, int inputDamage); - - List getRecipes(); -} diff --git a/src/common/railcraft/common/api/crafting/ICokeOvenRecipe.java b/src/common/railcraft/common/api/crafting/ICokeOvenRecipe.java deleted file mode 100644 index 844c24256..000000000 --- a/src/common/railcraft/common/api/crafting/ICokeOvenRecipe.java +++ /dev/null @@ -1,20 +0,0 @@ -package railcraft.common.api.crafting; - -import net.minecraft.src.ItemStack; -import net.minecraftforge.liquids.LiquidStack; - -/** - * - * @author CovertJaguar - */ -public interface ICokeOvenRecipe -{ - - public int getCookTime(); - - public ItemStack getInput(); - - public LiquidStack getLiquidOutput(); - - public ItemStack getOutput(); -} diff --git a/src/common/railcraft/common/api/crafting/IRockCrusherCraftingManager.java b/src/common/railcraft/common/api/crafting/IRockCrusherCraftingManager.java deleted file mode 100644 index 52dd8839d..000000000 --- a/src/common/railcraft/common/api/crafting/IRockCrusherCraftingManager.java +++ /dev/null @@ -1,35 +0,0 @@ -package railcraft.common.api.crafting; - -import java.util.HashMap; -import java.util.List; -import net.minecraft.src.ItemStack; - -/** - * - * @author CovertJaguar - */ -public interface IRockCrusherCraftingManager -{ - - /** - * - * @param inputId - * @param inputDamage metadata or -1 for wildcard - * @param output A map of outputs and chances. If more than 9 types of items, there will be unexpected behavior. - */ - void addRecipe(int inputId, int inputDamage, HashMap output); - - /** - * - * @param input - * @param output A map of outputs and chances. If more than 9 types of items, there will be unexpected behavior. - */ - void addRecipe(ItemStack input, HashMap output); - - IRockCrusherRecipe getRecipe(ItemStack input); - - IRockCrusherRecipe getRecipe(int inputId, int inputDamage); - - List getRecipes(); - -} diff --git a/src/common/railcraft/common/api/crafting/IRockCrusherRecipe.java b/src/common/railcraft/common/api/crafting/IRockCrusherRecipe.java deleted file mode 100644 index 75b2d8114..000000000 --- a/src/common/railcraft/common/api/crafting/IRockCrusherRecipe.java +++ /dev/null @@ -1,37 +0,0 @@ -package railcraft.common.api.crafting; - -import java.util.List; -import java.util.Map; -import net.minecraft.src.ItemStack; - -/** - * - * @author CovertJaguar - */ -public interface IRockCrusherRecipe -{ - - public ItemStack getInput(); - - /** - * Returns a map containing each output entry and its chance of being included. - * - * @return - */ - public Map getOutputs(); - - /** - * Returns a list of all possible outputs. - * This is basically a condensed version of getOutputs().keySet(). - * - * @return - */ - public List getPossibleOuput(); - - /** - * Returns a list of outputs after it has passed through the randomizer. - * - * @return - */ - public List getRandomizedOuput(); -} diff --git a/src/common/railcraft/common/api/crafting/IRollingMachineCraftingManager.java b/src/common/railcraft/common/api/crafting/IRollingMachineCraftingManager.java deleted file mode 100644 index e9275efb5..000000000 --- a/src/common/railcraft/common/api/crafting/IRollingMachineCraftingManager.java +++ /dev/null @@ -1,24 +0,0 @@ -package railcraft.common.api.crafting; - -import java.util.List; -import net.minecraft.src.IRecipe; -import net.minecraft.src.InventoryCrafting; -import net.minecraft.src.ItemStack; -import net.minecraft.src.World; - -/** - * - * @author CovertJaguar - */ -public interface IRollingMachineCraftingManager -{ - - void addRecipe(ItemStack output, Object[] components); - - void addShapelessRecipe(ItemStack output, Object[] compenents); - - ItemStack findMatchingRecipe(InventoryCrafting inventorycrafting, World world); - - List getRecipeList(); - -} diff --git a/src/common/railcraft/common/api/crafting/RailcraftCraftingManager.java b/src/common/railcraft/common/api/crafting/RailcraftCraftingManager.java deleted file mode 100644 index 27608b221..000000000 --- a/src/common/railcraft/common/api/crafting/RailcraftCraftingManager.java +++ /dev/null @@ -1,16 +0,0 @@ -package railcraft.common.api.crafting; - -/** - * These variables are defined during the pre-init phase. - * Do not attempt to access them during pre-init. - * - * @author CovertJaguar - */ -public abstract class RailcraftCraftingManager -{ - - public static ICokeOvenCraftingManager cokeOven; - public static IBlastFurnaceCraftingManager blastFurnace; - public static IRockCrusherCraftingManager rockCrusher; - public static IRollingMachineCraftingManager rollingMachine; -} diff --git a/src/common/railcraft/common/api/fuel/FuelManager.java b/src/common/railcraft/common/api/fuel/FuelManager.java deleted file mode 100644 index aa4246adf..000000000 --- a/src/common/railcraft/common/api/fuel/FuelManager.java +++ /dev/null @@ -1,35 +0,0 @@ -package railcraft.common.api.fuel; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import net.minecraftforge.liquids.LiquidStack; - -/** - * - * @author CovertJaguar - */ -public class FuelManager -{ - - public static final Map boilerFuel = new HashMap(); - - /** - * Register the amount of heat in a bucket of liquid fuel. - * - * @param liquid - * @param heatValuePerBucket - */ - public static void addBoilerFuel(LiquidStack liquid, int heatValuePerBucket) { - boilerFuel.put(liquid, heatValuePerBucket); - } - - public static int getBoilerFuelValue(LiquidStack liquid) { - for(Entry entry : boilerFuel.entrySet()) { - if(entry.getKey().isLiquidEqual(liquid)) { - return entry.getValue(); - } - } - return 0; - } -} diff --git a/src/common/railcraft/common/api/signals/EnumSignalAspect.java b/src/common/railcraft/common/api/signals/EnumSignalAspect.java deleted file mode 100644 index 8a71e40df..000000000 --- a/src/common/railcraft/common/api/signals/EnumSignalAspect.java +++ /dev/null @@ -1,155 +0,0 @@ -package railcraft.common.api.signals; - -/** - * Represents a Signal state. - * @author CovertJaguar - */ -public enum EnumSignalAspect -{ - - /** - * The All Clear. - */ - GREEN(0), - /** - * Typically means pairing in progress. - */ - BLINK_YELLOW(1), - /** - * Caution, cart heading away. - */ - YELLOW(1), - /** - * Maintenance warning, the signal is malfunctioning. - */ - BLINK_RED(2), - /** - * Stop! - */ - RED(2), - /** - * Can't happen, really it can't (or shouldn't). - * Only used when rendering blink states (for the texture offset). - */ - OFF(3); - private final byte id; - private final int textureOffset; - private static byte nextId = 0; - private static boolean blinkState; - - private EnumSignalAspect(int textureOffset) - { - this.textureOffset = textureOffset; - id = getNextId(); - } - - /** - * Returns the aspect id, used mainly for saving and network communication. - * @return id - */ - public byte getId() - { - return id; - } - - /** - * Returns the texture offset for this specific aspect. - * @return offset - */ - public int getTextureOffset() - { - return textureOffset; - } - - /** - * Returns true if the aspect is one of the blink states. - * @return true if blinks - */ - public boolean isBlinkAspect() - { - if(this == BLINK_YELLOW || this == BLINK_RED) { - return true; - } - return false; - } - - /** - * Return true if the light is currently off. - * @return true if the light is currently off. - */ - public static boolean isBlinkOn() - { - return blinkState; - } - - /** - * Don't call this, its used to change blink states by Railcraft. - */ - public static void invertBlinkState() - { - blinkState = !blinkState; - } - - /** - * Takes an id and returns an Aspect. - * @param id - * @return - */ - public static EnumSignalAspect fromId(int id) - { - for(EnumSignalAspect a : EnumSignalAspect.values()) { - if(a.getId() == id) { - return a; - } - } - return RED; - } - - /** - * Tests two Aspects and determines which is more restrictive. - * The concept of "most restrictive" refers to which aspect enforces the - * most limitations of movement to a train. - * - * In Railcraft the primary use is in Signal Box logic. - * - * @param first - * @param second - * @return The most restrictive Aspect - */ - public static EnumSignalAspect mostRestrictive(EnumSignalAspect first, EnumSignalAspect second) - { - if(first == null && second != null) { - return second; - } else if(first != null && second == null) { - return first; - } else if(first == null && second == null) { - return RED; - } - if(first == OFF || second == OFF) { - return RED; - } - if(first.getId() > second.getId()) { - return first; - } - return second; - } - - private static byte getNextId() - { - byte i = nextId; - nextId++; - return i; - } - - @Override - public String toString() - { - String[] sa = name().split("_"); - String out = ""; - for(String s : sa) { - out = out + s.substring(0, 1) + s.substring(1).toLowerCase() + " "; - } - out = out.trim(); - return out; - } -} diff --git a/src/common/railcraft/common/api/signals/IBlockSignal.java b/src/common/railcraft/common/api/signals/IBlockSignal.java deleted file mode 100644 index a115423c8..000000000 --- a/src/common/railcraft/common/api/signals/IBlockSignal.java +++ /dev/null @@ -1,47 +0,0 @@ -package railcraft.common.api.signals; - -/** - * This is not documented and needs some reworking to simplify usage. - * @author CovertJaguar - */ -public interface IBlockSignal -{ - - public void startSignalBlockPairing(); - - public void endSignalBlockPairing(); - - public boolean locateRail(); - - public boolean attemptToPair(IBlockSignal other); - - public void clearSignalBlockPairing(String reason, Object... args); - - public boolean isSignalBlockBeingPaired(); - - public boolean isSignalBlockPaired(); - - public IBlockSignal getSignalBlockPair(); - - public int getSignalBlockPairX(); - - public int getSignalBlockPairY(); - - public int getSignalBlockPairZ(); - - public int getRailX(); - - public int getRailY(); - - public int getRailZ(); - - public int getX(); - - public int getY(); - - public int getZ(); - - public int getDimension(); - - public String getDescription(); -} diff --git a/src/common/railcraft/common/api/signals/ISignalController.java b/src/common/railcraft/common/api/signals/ISignalController.java deleted file mode 100644 index a3160d7ab..000000000 --- a/src/common/railcraft/common/api/signals/ISignalController.java +++ /dev/null @@ -1,45 +0,0 @@ -package railcraft.common.api.signals; - -import net.minecraft.src.World; - -/** - * This is not documented and needs some reworking to simplify usage. - * @author CovertJaguar - */ -public interface ISignalController -{ - - public EnumSignalAspect getSignalAspect(); - - public boolean attemptToPairWithReceiver(ISignalReceiver receiver); - - public void startReceiverPairing(); - - public void endReceiverPairing(); - - public void clearPairedReceiver(); - - public boolean isPairedWithReceiver(); - - public ISignalReceiver getReceiver(); - - public int getReceiverX(); - - public int getReceiverY(); - - public int getReceiverZ(); - - public int getX(); - - public int getY(); - - public int getZ(); - - public int getDimension(); - - public World getWorld(); - - public String getDescription(); - - public boolean isInvalid(); -} diff --git a/src/common/railcraft/common/api/signals/ISignalReceiver.java b/src/common/railcraft/common/api/signals/ISignalReceiver.java deleted file mode 100644 index 00de2b0cb..000000000 --- a/src/common/railcraft/common/api/signals/ISignalReceiver.java +++ /dev/null @@ -1,43 +0,0 @@ -package railcraft.common.api.signals; - -import net.minecraft.src.World; - -/** - * This is not documented and needs some reworking to simplify usage. - * @author CovertJaguar - */ -public interface ISignalReceiver -{ - - public boolean doesActionOnAspect(EnumSignalAspect aspect); - - public void doActionOnAspect(EnumSignalAspect aspect, boolean trigger); - - public boolean attemptToPairWithController(ISignalController controller); - - public void clearPairedController(); - - public boolean isPairedWithController(); - - public ISignalController getController(); - - public int getControllerX(); - - public int getControllerY(); - - public int getControllerZ(); - - public int getX(); - - public int getY(); - - public int getZ(); - - public int getDimension(); - - public World getWorld(); - - public boolean isInvalid(); - - public String getDescription(); -} diff --git a/src/common/railcraft/common/api/signals/SignalTools.java b/src/common/railcraft/common/api/signals/SignalTools.java deleted file mode 100644 index 46b689d24..000000000 --- a/src/common/railcraft/common/api/signals/SignalTools.java +++ /dev/null @@ -1,159 +0,0 @@ -package railcraft.common.api.signals; - -import java.util.HashMap; -import java.util.Map; -import java.util.Random; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemStack; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import railcraft.common.api.core.WorldCoordinate; -import railcraft.common.api.tracks.RailTools; - -/** - * This is not documented and needs some reworking to simplify usage. - * @author CovertJaguar - */ -public abstract class SignalTools -{ - - private static Map signalBlockPairingMap = new HashMap(); - private static Map controllerReceiverPairingMap = new HashMap(); - - public static boolean isSignalBlockSectionValid(World world, IBlockSignal first, IBlockSignal second) { - return RailTools.areDistantRailsConnectedAlongAxis(world, first.getRailX(), first.getRailY(), first.getRailZ(), second.getRailX(), second.getRailY(), second.getRailZ()); - } - - public static boolean isControllerInRangeOfReceiver(ISignalController c, ISignalReceiver r, int range) { - int distX = c.getX() - r.getX(); - int distY = c.getY() - r.getY(); - int distZ = c.getZ() - r.getZ(); - int distance = (int)Math.sqrt(distX * distX + distY * distY + distZ * distZ); - return distance <= range; - } - - public static void startSignalBlockPairing(EntityPlayer player, ItemStack device, IBlockSignal first) { - endSignalBlockPairing(player, device); - int id = new Random().nextInt(Short.MAX_VALUE); - device.setItemDamage(id); - first.startSignalBlockPairing(); - signalBlockPairingMap.put(new PairingKey(player.username, device.getItemDamage()), new WorldCoordinate(first.getDimension(), first.getX(), first.getY(), first.getZ())); - } - - public static WorldCoordinate getSignalBlockPair(EntityPlayer player, ItemStack device) { - return signalBlockPairingMap.get(new PairingKey(player.username, device.getItemDamage())); - } - - public static void endSignalBlockPairing(EntityPlayer player, ItemStack device) { - WorldCoordinate pos = signalBlockPairingMap.remove(new PairingKey(player.username, device.getItemDamage())); - if(pos != null) { - TileEntity t = player.worldObj.getBlockTileEntity(pos.x, pos.y, pos.z); - if(t instanceof IBlockSignal) { - ((IBlockSignal)t).endSignalBlockPairing(); - } - } - } - - public static void startControllerReceiverPairing(EntityPlayer player, ItemStack device, ISignalController controller) { - endControllerReceiverPairing(player, device); - int id = new Random().nextInt(Short.MAX_VALUE); - device.setItemDamage(id); - controller.startReceiverPairing(); - controllerReceiverPairingMap.put(new PairingKey(player.username, device.getItemDamage()), new WorldCoordinate(controller.getDimension(), controller.getX(), controller.getY(), controller.getZ())); - } - - public static WorldCoordinate getSavedController(EntityPlayer player, ItemStack device) { - return controllerReceiverPairingMap.get(new PairingKey(player.username, device.getItemDamage())); - } - - public static void endControllerReceiverPairing(EntityPlayer player, ItemStack device) { - WorldCoordinate pos = controllerReceiverPairingMap.remove(new PairingKey(player.username, device.getItemDamage())); - if(pos != null) { - TileEntity t = player.worldObj.getBlockTileEntity(pos.x, pos.y, pos.z); - if(t instanceof ISignalController) { - ((ISignalController)t).endReceiverPairing(); - } - } - } - - public static ISignalReceiver getReceiverFor(ISignalController con) { - World world = con.getWorld(); - if(world == null || con.getReceiverY() < 0) { - return null; - } - int i = con.getReceiverX(); - int j = con.getReceiverY(); - int k = con.getReceiverZ(); - if(!world.blockExists(i, j, k)) { - return null; - } - TileEntity pair = world.getBlockTileEntity(i, j, k); - if(pair instanceof ISignalReceiver) { - return (ISignalReceiver)pair; - } else { - con.clearPairedReceiver(); - } - return null; - } - - public static ISignalController getControllerFor(ISignalReceiver rec) { - if(rec.getControllerY() < 0) { - return null; - } - World world = rec.getWorld(); - if(world == null) { - return null; - } - int i = rec.getControllerX(); - int j = rec.getControllerY(); - int k = rec.getControllerZ(); - if(!world.blockExists(i, j, k)) { - return null; - } - TileEntity pair = world.getBlockTileEntity(i, j, k); - if(pair instanceof ISignalController) { - return (ISignalController)pair; - } else { - rec.clearPairedController(); - } - return null; - } - - private static class PairingKey - { - - protected String username; - protected int id; - - public PairingKey(String username, int id) { - this.username = username; - this.id = id; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 59 * hash + (this.username != null ? this.username.hashCode() : 0); - hash = 59 * hash + this.id; - return hash; - } - - @Override - public boolean equals(Object obj) { - if(obj == null) { - return false; - } - if(getClass() != obj.getClass()) { - return false; - } - final PairingKey other = (PairingKey)obj; - if((this.username == null) ? (other.username != null) : !this.username.equals(other.username)) { - return false; - } - if(this.id != other.id) { - return false; - } - return true; - } - } -} diff --git a/src/common/railcraft/common/api/tracks/ITrackCustomPlaced.java b/src/common/railcraft/common/api/tracks/ITrackCustomPlaced.java deleted file mode 100644 index 0354d1a6e..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackCustomPlaced.java +++ /dev/null @@ -1,29 +0,0 @@ -package railcraft.common.api.tracks; - -import net.minecraft.src.World; - -/** - * Have your ITrackInstance implement this to override normal track placement. - * - * Used by tracks such as the Suspended Track. - * - * @author CovertJaguar - */ -public interface ITrackCustomPlaced extends ITrackInstance -{ - - /** - * Used to override normal track placement. - * - * Used by tracks such as the Suspended Track. - * - * Warning: This is called before the TileEntity is set. - * - * @param world The World - * @param i x-Coord - * @param j y-Coord - * @param k z-Coord - * @return true if the rail can placed at the specified location, false to prevent placement - */ - public boolean canPlaceRailAt(World world, int i, int j, int k); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackCustomShape.java b/src/common/railcraft/common/api/tracks/ITrackCustomShape.java deleted file mode 100644 index 35fd7e43a..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackCustomShape.java +++ /dev/null @@ -1,24 +0,0 @@ -package railcraft.common.api.tracks; - -import net.minecraft.src.AxisAlignedBB; -import net.minecraft.src.MovingObjectPosition; -import net.minecraft.src.Vec3; - -/** - * Used by rails that modify the bounding boxes. - * - * For example, the Gated Rails. - * - * Not very useful since there is no system in place to insert custom render code. - * - * @author CovertJaguar - */ -public interface ITrackCustomShape extends ITrackInstance -{ - - public AxisAlignedBB getCollisionBoundingBoxFromPool(); - - public AxisAlignedBB getSelectedBoundingBoxFromPool(); - - public MovingObjectPosition collisionRayTrace(Vec3 vec3d, Vec3 vec3d1); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackEmitter.java b/src/common/railcraft/common/api/tracks/ITrackEmitter.java deleted file mode 100644 index bec74732a..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackEmitter.java +++ /dev/null @@ -1,22 +0,0 @@ -package railcraft.common.api.tracks; - -/** - * Tracks that can emit a redstone signal should implement - * this interface. - * - * For example a detector track. - * - * A track cannot implement both ITrackPowered and ITrackEmitter. - * - * @author CovertJaguar - */ -public interface ITrackEmitter extends ITrackInstance -{ - - /** - * Return true if the track is producing a redstone signal. - * - * @return true if powered - */ - public boolean isTrackPowering(); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackInstance.java b/src/common/railcraft/common/api/tracks/ITrackInstance.java deleted file mode 100644 index b3a3f5efd..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackInstance.java +++ /dev/null @@ -1,123 +0,0 @@ -package railcraft.common.api.tracks; - -import net.minecraft.src.Entity; -import net.minecraft.src.EntityLiving; -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.TileEntity; -import railcraft.common.api.core.INetworkedObject; - -/** - * This interface defines a track. - * - * Basically all block and tile entity functions for Tracks are delegated to an - * ITrackInstance. - * - * Instead of implementing this interface directly, you should probably - * extend TrackInstanceBase. It will simplify your life. - * - * All packet manipulation is handled by Railcraft's code, - * you just need to implement the functions in INetworkedObject - * to pass data from the server to the client. - * - * @author CovertJaguar - * @see TrackInstanceBase - */ -public interface ITrackInstance extends INetworkedObject -{ - - public TrackSpec getTrackSpec(); - - /** - * Return the rail's metadata (without the power bit if the rail uses one). - * Can be used to make the cart think the rail something other than it is, - * for example when making diamond junctions or switches. - * - * Valid rail metadata is defined as follows: - * 0x0: flat track going North-South - * 0x1: flat track going West-East - * 0x2: track ascending to the East - * 0x3: track ascending to the West - * 0x4: track ascending to the North - * 0x5: track ascending to the South - * 0x6: WestNorth corner (connecting East and South) - * 0x7: EastNorth corner (connecting West and South) - * 0x8: EastSouth corner (connecting West and North) - * 0x9: WestSouth corner (connecting East and North) - * - * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart. - * @return The metadata. - */ - public int getBasicRailMetadata(EntityMinecart cart); - - /** - * This function is called by any minecart that passes over this rail. - * It is called once per update tick that the minecart is on the rail. - * @param cart The cart on the rail. - */ - public void onMinecartPass(EntityMinecart cart); - - /** - * Return the block texture to be used. - * - * @return - */ - public int getTextureIndex(); - - public void writeToNBT(NBTTagCompound data); - - public void readFromNBT(NBTTagCompound data); - - /** - * Return true if this track requires update ticks. - * @return - */ - public boolean canUpdate(); - - public void updateEntity(); - - public boolean blockActivated(EntityPlayer player); - - public void onBlockPlaced(); - - public void onBlockPlacedBy(EntityLiving entity); - - public void onNeighborBlockChange(int id); - - /** - * Internal function that sets the Track's TileEntity so it can - * be referenced for position information, etc... - * @param tile - */ - public void setTile(TileEntity tile); - - public int getX(); - - public int getY(); - - public int getZ(); - - public float getExplosionResistance(double srcX, double srcY, double srcZ, Entity exploder); - - /** - * Return true if the rail can make corners. - * Used by placement logic. - * @return true if the rail can make corners. - */ - public boolean isFlexibleRail(); - - /** - * Returns true if the rail can make up and down slopes. - * Used by placement logic. - * @return true if the rail can make slopes. - */ - public boolean canMakeSlopes(); - - /** - * Returns the max speed of the rail. - * @param cart The cart on the rail, may be null. - * @return The max speed of the current rail. - */ - public float getRailMaxSpeed(EntityMinecart cart); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackLockdown.java b/src/common/railcraft/common/api/tracks/ITrackLockdown.java deleted file mode 100644 index c9c287b45..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackLockdown.java +++ /dev/null @@ -1,18 +0,0 @@ -package railcraft.common.api.tracks; - -import net.minecraft.src.EntityMinecart; - -/** - * Any rail tile entity that can completely halt - * all cart movement should implement this interface. - * (Used in collision handling) - * - * @author CovertJaguar - */ -public interface ITrackLockdown extends ITrackInstance -{ - - public boolean isCartLockedDown(EntityMinecart cart); - - public void releaseCart(); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackPowered.java b/src/common/railcraft/common/api/tracks/ITrackPowered.java deleted file mode 100644 index 66a9c434e..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackPowered.java +++ /dev/null @@ -1,24 +0,0 @@ -package railcraft.common.api.tracks; - -/** - * Implementing this interface will allow your track to be - * powered via Redstone. - * - * And so long as you inherit from TrackInstanceBase, all the code for updating - * the power state is already in place (including propagation). - * - * @author CovertJaguar - */ -public interface ITrackPowered extends ITrackInstance -{ - - public boolean isPowered(); - - public void setPowered(boolean powered); - - /** - * The distance that a redstone signal will be passed along from track to track. - * @return int - */ - public int getPowerPropagation(); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackReversable.java b/src/common/railcraft/common/api/tracks/ITrackReversable.java deleted file mode 100644 index c44bff8de..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackReversable.java +++ /dev/null @@ -1,17 +0,0 @@ -package railcraft.common.api.tracks; - -/** - * Implementing this interface will allow your track to be direction specific. - * - * And so long as you inherit from TrackInstanceBase it will automatically be - * reversable via the Crowbar. - * - * @author CovertJaguar - */ -public interface ITrackReversable extends ITrackInstance -{ - - public boolean isReversed(); - - public void setReversed(boolean reversed); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackSwitch.java b/src/common/railcraft/common/api/tracks/ITrackSwitch.java deleted file mode 100644 index 735bd8cf8..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackSwitch.java +++ /dev/null @@ -1,21 +0,0 @@ -package railcraft.common.api.tracks; - -public interface ITrackSwitch extends ITrackInstance -{ - - enum ArrowDirection - { - - NORTH, SOUTH, EAST, WEST, NORTH_SOUTH, EAST_WEST - }; - - public boolean isSwitched(); - - public void setSwitched(boolean switched); - - public boolean isMirrored(); - - public ArrowDirection getRedSignDirection(); - - public ArrowDirection getWhiteSignDirection(); -} diff --git a/src/common/railcraft/common/api/tracks/ITrackTile.java b/src/common/railcraft/common/api/tracks/ITrackTile.java deleted file mode 100644 index 54140bc98..000000000 --- a/src/common/railcraft/common/api/tracks/ITrackTile.java +++ /dev/null @@ -1,13 +0,0 @@ -package railcraft.common.api.tracks; - -/** - * Don't use this, its an interface that allows other API code - * access to internal functions of the code. - * - * @author CovertJaguar - */ -public interface ITrackTile -{ - - public ITrackInstance getTrackInstance(); -} diff --git a/src/common/railcraft/common/api/tracks/RailTools.java b/src/common/railcraft/common/api/tracks/RailTools.java deleted file mode 100644 index c6ad39555..000000000 --- a/src/common/railcraft/common/api/tracks/RailTools.java +++ /dev/null @@ -1,175 +0,0 @@ -package railcraft.common.api.tracks; - -import net.minecraft.src.Block; -import net.minecraft.src.BlockRail; -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.ItemBlock; -import net.minecraft.src.ItemStack; -import net.minecraft.src.MathHelper; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import railcraft.common.api.core.items.ITrackItem; - -/** - * A number of utility functions related to rails. - * @author CovertJaguar - */ -public abstract class RailTools -{ - - /** - * Attempts to place a rail of the type provided. - * There is no need to verify that the ItemStack contains a valid rail - * prior to calling this function. - * - * The function takes care of that and will return false if the ItemStack - * is not a valid ITrackItem or an ItemBlock who's id - * will return true when passed to BlockRail.isRailBlock(itemID). - * - * That means this function can place any Railcraft or vanilla rail - * and has at least a decent chance of being able to place - * most third party rails. - * - * @param stack The ItemStack containing the rail - * @param world The World object - * @param i x-Coord - * @param j y-Coord - * @param k z-Coord - * @return true if successful - * @see ITrackItem - */ - public static boolean placeRailAt(ItemStack stack, World world, int i, int j, int k) - { - if(stack == null) { - return false; - } - if(stack.getItem() instanceof ITrackItem) { - return ((ITrackItem)stack.getItem()).placeTrack(stack.copy(), world, i, j, k); - } - if(stack.getItem() instanceof ItemBlock && stack.itemID < Block.blocksList.length && BlockRail.isRailBlock(stack.itemID)) { - boolean success = world.setBlockWithNotify(i, j, k, stack.itemID); - if(success) { - world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, Block.rail.stepSound.getStepSound(), (Block.rail.stepSound.getVolume() + 1.0F) / 2.0F, Block.rail.stepSound.getPitch() * 0.8F); - } - return success; - } - return false; - } - - /** - * Returns true if the ItemStack contains a valid Railcraft Track item. - * - * Will return false is passed a vanilla rail. - * - * @param stack The ItemStack to test - * @return true if rail - * @see ITrackItem - */ - public static boolean isTrackItem(ItemStack stack) - { - return stack != null && stack.getItem() instanceof ITrackItem; - } - - /** - * Checks to see if a cart is being held by a ITrackLockdown. - * @param cart The cart to check - * @return True if being held - */ - public static boolean isCartLockedDown(EntityMinecart cart) - { - int x = MathHelper.floor_double(cart.posX); - int y = MathHelper.floor_double(cart.posY); - int z = MathHelper.floor_double(cart.posZ); - - if(BlockRail.isRailBlockAt(cart.worldObj, x, y - 1, z)) { - y--; - } - - TileEntity tile = cart.worldObj.getBlockTileEntity(x, y, z); - if(tile instanceof ITrackTile) { - ITrackInstance track = ((ITrackTile)tile).getTrackInstance(); - return track instanceof ITrackLockdown && ((ITrackLockdown)track).isCartLockedDown(cart); - } - return false; - } - - /** - * Verifies that two rails are connected to each other - * along a straight line with no gaps or wanderings. - * @param world The World object - * @param i1 x-Coord of Rail #1 - * @param j1 y-Coord of Rail #1 - * @param k1 z-Coord of Rail #1 - * @param i2 x-Coord of Rail #2 - * @param j2 y-Coord of Rail #2 - * @param k2 z-Coord of Rail #2 - * @return true if they are connected - */ - public static boolean areDistantRailsConnectedAlongAxis(World world, int i1, int j1, int k1, int i2, int j2, int k2) - { - if(j1 < 0 || j2 < 0) { - return false; - } - if(i1 != i2 && k1 != k2) { - return false; - } - if(i1 != i2) { - int min = 0; - int max = 0; - int jj = 0; - if(i1 < i2) { - min = i1; - max = i2; - jj = j1; - } else { - min = i2; - max = i1; - jj = j2; - } - for(int ii = min; ii <= max; ii++) { - if(world.blockExists(ii, jj, k1)) { - if(BlockRail.isRailBlockAt(world, ii, jj, k1)) { - continue; - } else if(BlockRail.isRailBlockAt(world, ii, jj - 1, k1)) { - jj--; - continue; - } else if(BlockRail.isRailBlockAt(world, ii, jj + 1, k1)) { - jj++; - continue; - } else { - return false; - } - } - } - } else if(k1 != k2) { - int min = 0; - int max = 0; - int jj = 0; - if(k1 < k2) { - min = k1; - max = k2; - jj = j1; - } else { - min = k2; - max = k1; - jj = j2; - } - for(int kk = min; kk <= max; kk++) { - if(world.blockExists(i1, jj, kk)) { - if(BlockRail.isRailBlockAt(world, i1, jj, kk)) { - continue; - } else if(BlockRail.isRailBlockAt(world, i1, jj - 1, kk)) { - jj--; - continue; - } else if(BlockRail.isRailBlockAt(world, i1, jj + 1, kk)) { - jj++; - continue; - } else { - return false; - } - } - } - } - return true; - } -} diff --git a/src/common/railcraft/common/api/tracks/TrackInstanceBase.java b/src/common/railcraft/common/api/tracks/TrackInstanceBase.java deleted file mode 100644 index 74d6dc6ee..000000000 --- a/src/common/railcraft/common/api/tracks/TrackInstanceBase.java +++ /dev/null @@ -1,385 +0,0 @@ -package railcraft.common.api.tracks; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import net.minecraft.src.Block; -import net.minecraft.src.BlockRail; -import net.minecraft.src.Entity; -import net.minecraft.src.EntityLiving; -import net.minecraft.src.EntityMinecart; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemStack; -import net.minecraft.src.MathHelper; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.RailLogic; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import net.minecraftforge.common.ForgeDirection; -import railcraft.common.api.core.items.ICrowbar; - -/** - * All ITrackInstances should extend this class. It contains a number of - * default functions and standard behavior for Tracks that should - * greatly simplify implementing new Tracks when using this API. - * - * @author CovertJaguar - * @see ITrackInstance - * @see TrackRegistry - * @see TrackSpec - */ -public abstract class TrackInstanceBase implements ITrackInstance -{ - - private Block block; - public TileEntity tileEntity; - - private Block getBlock() - { - if(block == null) { - int id = getWorld().getBlockId(getX(), getY(), getZ()); - block = Block.blocksList[id]; - } - return block; - } - - @Override - public void setTile(TileEntity tile) - { - tileEntity = tile; - } - - @Override - public int getBasicRailMetadata(EntityMinecart cart) - { - return tileEntity.getBlockMetadata(); - } - - @Override - public void onMinecartPass(EntityMinecart cart) - { - } - - @Override - public boolean blockActivated(EntityPlayer player) - { - if(this instanceof ITrackReversable) { - ItemStack current = player.getCurrentEquippedItem(); - if(current != null && current.getItem() instanceof ICrowbar) { - ITrackReversable track = (ITrackReversable)this; - track.setReversed(!track.isReversed()); - markBlockNeedsUpdate(); - if(current.isItemStackDamageable()) { - current.damageItem(1, player); - } - return true; - } - } - return false; - } - - @Override - public void onBlockPlaced() - { - switchTrack(true); - testPower(); - markBlockNeedsUpdate(); - } - - @Override - public void onBlockPlacedBy(EntityLiving entityliving) - { - if(entityliving == null) { - return; - } - if(this instanceof ITrackReversable) { - int dir = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3; - ((ITrackReversable)this).setReversed(dir == 0 || dir == 1); - } - markBlockNeedsUpdate(); - } - - public void markBlockNeedsUpdate() - { - getWorld().markBlockForRenderUpdate(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); - } - - protected boolean isRailValid(World world, int i, int j, int k, int meta) - { - boolean valid = true; - if(!world.isBlockSolidOnSide(i, j - 1, k, ForgeDirection.UP)) { - valid = false; - } - if(meta == 2 && !world.isBlockSolidOnSide(i + 1, j, k, ForgeDirection.UP)) { - valid = false; - } else if(meta == 3 && !world.isBlockSolidOnSide(i - 1, j, k, ForgeDirection.UP)) { - valid = false; - } else if(meta == 4 && !world.isBlockSolidOnSide(i, j, k - 1, ForgeDirection.UP)) { - valid = false; - } else if(meta == 5 && !world.isBlockSolidOnSide(i, j, k + 1, ForgeDirection.UP)) { - valid = false; - } - return valid; - } - - @Override - public void onNeighborBlockChange(int id) - { - int meta = tileEntity.getBlockMetadata(); - boolean valid = isRailValid(getWorld(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, meta); - if(!valid) { - Block blockTrack = getBlock(); - blockTrack.dropBlockAsItem(getWorld(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, 0, 0); - getWorld().setBlockWithNotify(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, 0); - return; - } - - BlockRail blockTrack = (BlockRail)getBlock(); - if(id > 0 && Block.blocksList[id].canProvidePower() && isFlexibleRail() && RailLogic.getAdjacentTracks(new RailLogic(blockTrack, getWorld(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord)) == 3) { - switchTrack(false); - } - testPower(); - } - - protected void switchTrack(boolean flag) - { - int i = tileEntity.xCoord; - int j = tileEntity.yCoord; - int k = tileEntity.zCoord; - BlockRail blockTrack = (BlockRail)getBlock(); - (new RailLogic(blockTrack, getWorld(), i, j, k)).refreshTrackShape(getWorld().isBlockIndirectlyGettingPowered(i, j, k), flag); - } - - protected void testPower() - { - if(!(this instanceof ITrackPowered)) { - return; - } - int i = tileEntity.xCoord; - int j = tileEntity.yCoord; - int k = tileEntity.zCoord; - ITrackPowered r = (ITrackPowered)this; - int meta = tileEntity.getBlockMetadata(); - boolean powered = getWorld().isBlockIndirectlyGettingPowered(i, j, k) || getWorld().isBlockIndirectlyGettingPowered(i, j + 1, k) || testPowerPropagation(getWorld(), i, j, k, getTrackSpec(), meta, r.getPowerPropagation()); - if(powered != r.isPowered()) { - r.setPowered(powered); - Block blockTrack = getBlock(); - getWorld().notifyBlocksOfNeighborChange(i, j, k, blockTrack.blockID); - getWorld().notifyBlocksOfNeighborChange(i, j - 1, k, blockTrack.blockID); - if(meta == 2 || meta == 3 || meta == 4 || meta == 5) { - getWorld().notifyBlocksOfNeighborChange(i, j + 1, k, blockTrack.blockID); - } - markBlockNeedsUpdate(); - // System.out.println("Setting power [" + i + ", " + j + ", " + k + "]"); - } - } - - protected boolean testPowerPropagation(World world, int i, int j, int k, TrackSpec spec, int meta, int maxDist) - { - return isConnectedRailPowered(world, i, j, k, spec, meta, true, 0, maxDist) || isConnectedRailPowered(world, i, j, k, spec, meta, false, 0, maxDist); - } - - protected boolean isConnectedRailPowered(World world, int i, int j, int k, TrackSpec spec, int meta, boolean dir, int dist, int maxDist) - { - if(dist >= maxDist) { - return false; - } - boolean powered = true; - switch (meta) { - case 0: // '\0' - if(dir) { - k++; - } else { - k--; - } - break; - - case 1: // '\001' - if(dir) { - i--; - } else { - i++; - } - break; - - case 2: // '\002' - if(dir) { - i--; - } else { - i++; - j++; - powered = false; - } - meta = 1; - break; - - case 3: // '\003' - if(dir) { - i--; - j++; - powered = false; - } else { - i++; - } - meta = 1; - break; - - case 4: // '\004' - if(dir) { - k++; - } else { - k--; - j++; - powered = false; - } - meta = 0; - break; - - case 5: // '\005' - if(dir) { - k++; - j++; - powered = false; - } else { - k--; - } - meta = 0; - break; - } - if(testPowered(world, i, j, k, spec, dir, dist, maxDist, meta)) { - return true; - } - return powered && testPowered(world, i, j - 1, k, spec, dir, dist, maxDist, meta); - } - - protected boolean testPowered(World world, int i, int j, int k, TrackSpec spec, boolean dir, int dist, int maxDist, int orientation) - { - // System.out.println("Testing Power at <" + i + ", " + j + ", " + k + ">"); - int id = world.getBlockId(i, j, k); - Block blockTrack = getBlock(); - if(id == blockTrack.blockID) { - int meta = world.getBlockMetadata(i, j, k); - TileEntity tile = world.getBlockTileEntity(i, j, k); - if(tile instanceof ITrackTile) { - ITrackInstance track = ((ITrackTile)tile).getTrackInstance(); - if(!(track instanceof ITrackPowered) || track.getTrackSpec() != spec) { - return false; - } - if(orientation == 1 && (meta == 0 || meta == 4 || meta == 5)) { - return false; - } - if(orientation == 0 && (meta == 1 || meta == 2 || meta == 3)) { - return false; - } - if(((ITrackPowered)track).isPowered()) { - if(world.isBlockIndirectlyGettingPowered(i, j, k) || world.isBlockIndirectlyGettingPowered(i, j + 1, k)) { - return true; - } else { - return isConnectedRailPowered(world, i, j, k, spec, meta, dir, dist + 1, maxDist); - } - } - } - } - return false; - } - - @Override - public int getTextureIndex() - { - return getTrackSpec().getTextureIndex(); - } - - @Override - public void writeToNBT(NBTTagCompound data) - { - } - - @Override - public void readFromNBT(NBTTagCompound data) - { - } - - @Override - public boolean canUpdate() - { - return false; - } - - @Override - public void updateEntity() - { - } - - @Override - public float getExplosionResistance(double srcX, double srcY, double srcZ, Entity exploder) - { - return 3.5f; - } - - @Override - public void writePacketData(DataOutputStream data) throws IOException - { - } - - @Override - public void readPacketData(DataInputStream data) throws IOException - { - } - - @Override - public World getWorld() - { - return tileEntity.worldObj; - } - - @Override - public int getX() - { - return tileEntity.xCoord; - } - - @Override - public int getY() - { - return tileEntity.yCoord; - } - - @Override - public int getZ() - { - return tileEntity.zCoord; - } - - /** - * Return true if the rail can make corners. - * Used by placement logic. - * @return true if the rail can make corners. - */ - @Override - public boolean isFlexibleRail() - { - return false; - } - - /** - * Returns true if the rail can make up and down slopes. - * Used by placement logic. - * @return true if the rail can make slopes. - */ - @Override - public boolean canMakeSlopes() - { - return true; - } - - /** - * Returns the max speed of the rail. - * @param cart The cart on the rail, may be null. - * @return The max speed of the current rail. - */ - @Override - public float getRailMaxSpeed(EntityMinecart cart) - { - return 0.4f; - } -} diff --git a/src/common/railcraft/common/api/tracks/TrackRegistry.java b/src/common/railcraft/common/api/tracks/TrackRegistry.java deleted file mode 100644 index 017dd31f6..000000000 --- a/src/common/railcraft/common/api/tracks/TrackRegistry.java +++ /dev/null @@ -1,62 +0,0 @@ -package railcraft.common.api.tracks; - -import cpw.mods.fml.common.FMLCommonHandler; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; - -/** - * The TrackRegistry is part of a system that allows 3rd party addons to simply, - * quickly, and easily define new Tracks with unique behaviors without requiring - * that any additional block ids be used. - * - * All the tracks in RailcraftProxy are implemented using this system 100% - * (except for Gated Tracks and Switch Tracks which have some custom render code). - * - * To define a new track, you need to define a TrackSpec and create a ITrackInstance. - * - * The TrackSpec contains basic constant information about the Track, while the TrackInstace - * controls how an individual Track block interact with the world. - * - * @author CovertJaguar - * @see TrackSpec - * @see ITrackInstance - * @see TrackInstanceBase - */ -public class TrackRegistry -{ - - private static Map trackSpecs = new HashMap(); - - public static void registerTrackSpec(TrackSpec trackSpec) - { - if(trackSpecs.put(trackSpec.getTrackId(), trackSpec) != null) { - throw new RuntimeException("TrackId conflict detected, please adjust your config or contact the author of the " + trackSpec.getTrackTag()); - } - } - - /** - * Returns a cached copy of a TrackSpec object. - * - * @param trackId - * @return - */ - public static TrackSpec getTrackSpec(int trackId) - { - TrackSpec spec = trackSpecs.get((short)trackId); - if(spec == null) { - FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "[Railcraft] Unknown Track Spec ID({0}), reverting to normal track", trackId); - spec = trackSpecs.get(-1); - } - return spec; - } - - /** - * Returns all Registered TrackSpecs. - * @return list of TrackSpecs - */ - public static Map getTrackSpecs() - { - return trackSpecs; - } -} diff --git a/src/common/railcraft/common/api/tracks/TrackSpec.java b/src/common/railcraft/common/api/tracks/TrackSpec.java deleted file mode 100644 index 1997c315b..000000000 --- a/src/common/railcraft/common/api/tracks/TrackSpec.java +++ /dev/null @@ -1,85 +0,0 @@ -package railcraft.common.api.tracks; - -import net.minecraft.src.ItemStack; - -/** - * Each type of Track has a single instance of TrackSpec - * that corresponds with it. - * - * Each Track block in the world has a ITrackInstance that - * corresponds with it. - * - * Take note of the difference (similar to block classes and tile entities classes). - * - * TrackSpecs must be registered with the TrackRegistry. - * - * Track Items can be acquired with the ItemRegistry. - * - * @see TrackRegistry - * @see ITrackInstance - * - * @author CovertJaguar - */ -public final class TrackSpec -{ - - public static int blockID = 0; - private final String tag; - private final String textureFile; - private final short trackId; - private final int textureId; - private final Class instanceClass; - - /** - * Defines a new track spec. - * - * @param trackId A unique identifier for the track type. 0-512 are reserved for Railcraft. Capped at Short.MAX_VALUE - * @param tag A unique internal string identifier (ex. "track.speed.transition") - * @param textureFile See ITextureProvider - * @param textureId The texture index used by the track's item - * @param instanceClass The ITrackInstance class that corresponds to this TrackSpec - * @see ITextureProvider - */ - public TrackSpec(short trackId, String tag, String textureFile, int textureId, Class instanceClass) { - this.trackId = trackId; - this.tag = tag; - this.textureFile = textureFile; - this.textureId = textureId; - this.instanceClass = instanceClass; - } - - public String getTrackTag() { - return tag; - } - - public short getTrackId() { - return trackId; - } - - public ItemStack getItem() { - return getItem(1); - } - - public ItemStack getItem(int qty) { - if(blockID <= 0) { - return null; - } - return new ItemStack(blockID, qty, getTrackId()); - } - - public ITrackInstance createInstanceFromSpec() { - try { - return (ITrackInstance)instanceClass.newInstance(); - } catch (Exception ex) { - throw new RuntimeException("Improper Track Instance Constructor"); - } - } - - public String getTextureFile() { - return textureFile; - } - - public int getTextureIndex() { - return textureId; - } -} diff --git a/src/common/universalelectricity/core/UEConfig.java b/src/common/universalelectricity/core/UEConfig.java deleted file mode 100644 index 4be1e4d17..000000000 --- a/src/common/universalelectricity/core/UEConfig.java +++ /dev/null @@ -1,50 +0,0 @@ -package universalelectricity.core; - -import net.minecraftforge.common.Configuration; - -public class UEConfig -{ - public static int getConfigData(Configuration configuration, String name, int defaultInt) - { - configuration.load(); - int returnInt = defaultInt; - returnInt = Integer.parseInt(configuration.get(name, Configuration.CATEGORY_GENERAL, defaultInt).value); - configuration.save(); - return returnInt; - } - - public static boolean getConfigData(Configuration configuration, String name, boolean defaultBoolean) - { - configuration.load(); - boolean returnBoolean = defaultBoolean; - returnBoolean = Boolean.parseBoolean(configuration.get(name, Configuration.CATEGORY_GENERAL, defaultBoolean).value); - configuration.save(); - return returnBoolean; - } - - public static int getBlockConfigID(Configuration configuration, String name, int defaultID) - { - configuration.load(); - int id = defaultID; - - id = Integer.parseInt(configuration.getBlock(name, defaultID).value); - - if (id <= 136) { return defaultID; } - - configuration.save(); - return id; - } - - public static int getItemConfigID(Configuration configuration, String name, int defaultID) - { - configuration.load(); - int id = defaultID; - - id = Integer.parseInt(configuration.getItem(name, Configuration.CATEGORY_ITEM, defaultID).value); - - if (id < 256) { return defaultID; } - - configuration.save(); - return id; - } -} diff --git a/src/common/universalelectricity/core/UELoader.java b/src/common/universalelectricity/core/UELoader.java deleted file mode 100644 index dc3d6415a..000000000 --- a/src/common/universalelectricity/core/UELoader.java +++ /dev/null @@ -1,69 +0,0 @@ -package universalelectricity.core; - -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.world.WorldEvent.Load; -import net.minecraftforge.event.world.WorldEvent.Unload; -import universalelectricity.core.electricity.ElectricityManager; -import universalelectricity.core.electricity.ElectricityManagerTicker; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Side; -import cpw.mods.fml.common.registry.TickRegistry; - -/** - * A class used to load Universal Electricity and make it work. - * - * @author Calclavia - * - */ -public class UELoader -{ - public static final UELoader INSTANCE = new UELoader(); - - public static boolean isInitialized = false; - - public void initiate() - { - if (!isInitialized) - { - TickRegistry.registerTickHandler(new ElectricityManagerTicker(), Side.SERVER); - ElectricityManager.instance = new ElectricityManager(); - MinecraftForge.EVENT_BUS.register(this); - - if (UniversalElectricity.BC3_RATIO <= 0 || !Loader.isModLoaded("BuildCraft|Core")) - { - FMLLog.fine("Disabled Buildcraft electricity conversion!"); - } - else - { - FMLLog.fine("Buildcraft conversion ratio: " + UniversalElectricity.BC3_RATIO); - } - - if (UniversalElectricity.IC2_RATIO <= 0 || !Loader.isModLoaded("IC2")) - { - FMLLog.fine("Disabled Industrialcraft electricity conversion!"); - } - else - { - FMLLog.fine("IC2 conversion ratio: " + UniversalElectricity.IC2_RATIO); - } - - FMLLog.finest("Universal Electricity v" + UniversalElectricity.VERSION + " successfully loaded!"); - - isInitialized = true; - } - } - - @ForgeSubscribe - public void onWorldLoad(Load event) - { - ElectricityManagerTicker.inGameTicks = 0; - } - - @ForgeSubscribe - public void onWorldUnload(Unload event) - { - ElectricityManager.instance = new ElectricityManager(); - } -} diff --git a/src/common/universalelectricity/core/electricity/ElectricInfo.java b/src/common/universalelectricity/core/electricity/ElectricInfo.java deleted file mode 100644 index 94ea3c28a..000000000 --- a/src/common/universalelectricity/core/electricity/ElectricInfo.java +++ /dev/null @@ -1,203 +0,0 @@ -package universalelectricity.core.electricity; - -/** - * An easy way to display information on electricity. - * - * @author Calclavia - */ - -public class ElectricInfo -{ - public static enum ElectricUnit - { - AMPERE("Amp", "I"), AMP_HOUR("Amp Hour", "Ah"), VOLTAGE("Volt", "V"), WATT("Watt", "W"), WATT_HOUR("Watt Hour", "Wh"), RESISTANCE("Ohm", "R"), CONDUCTANCE("Siemen", "S"), JOULES("Joule", "J"); - - public String name; - public String symbol; - - private ElectricUnit(String name, String symbol) - { - this.name = name; - this.symbol = symbol; - } - - public String getPlural() - { - return this.name + "s"; - } - } - - public static enum MeasurementUnit - { - MICRO("Micro", "mi", 0.000001), MILLI("Milli", "m", 0.001), KILO("Kilo", "k", 1000), MEGA("Mega", "M", 1000000); - - public String name; - public String symbol; - public double process; - - private MeasurementUnit(String name, String symbol, double process) - { - this.name = name; - this.symbol = symbol; - this.process = process; - } - - public String getName(boolean isSymbol) - { - if (isSymbol) - { - return symbol; - } - else - { - return name; - } - } - - public double process(double value) - { - return value / this.process; - } - } - - public static double getJoules(double watts, double seconds) - { - return watts * seconds; - } - - public static double getJoules(double amps, double voltage, double seconds) - { - return amps * voltage * seconds; - } - - public static double getWattsFromJoules(double joules, double seconds) - { - return joules / seconds; - } - - public static double getAmps(double watts, double voltage) - { - return watts / voltage; - } - - public static double getAmps(double ampHours) - { - return ampHours * 3600; - } - - public static double getAmpsFromWattHours(double wattHours, double voltage) - { - return getWatts(wattHours) / voltage; - } - - public static double getWattHoursFromAmpHours(double ampHours, double voltage) - { - return ampHours * voltage; - } - - public static double getAmpHours(double amps) - { - return amps / 3600; - } - - public static double getWatts(double amps, double voltage) - { - return amps * voltage; - } - - public static double getWatts(double wattHours) - { - return wattHours * 3600; - } - - public static double getWattHours(double watts) - { - return watts / 3600; - } - - public static double getWattHours(double amps, double voltage) - { - return getWattHours(getWatts(amps, voltage)); - } - - public static double getResistance(double amps, double voltage) - { - return voltage / amps; - } - - public static double getConductance(double amps, double voltage) - { - return amps / voltage; - } - - /** - * Displays the unit as text. Works only for positive numbers. - */ - public static String getDisplay(double value, ElectricUnit unit, int significantFigures, boolean isShort) - { - String unitName = unit.name; - - if (isShort) - { - unitName = unit.symbol; - } - else if (value > 1) - { - unitName = unit.getPlural(); - } - - if (value == 0) { return value + " " + unitName; } - - if (value <= MeasurementUnit.MILLI.process) { return roundDecimals(MeasurementUnit.MICRO.process(value), significantFigures) + " " + MeasurementUnit.MICRO.getName(isShort) + unitName; } - - if (value < 1) { return roundDecimals(MeasurementUnit.MILLI.process(value), significantFigures) + " " + MeasurementUnit.MILLI.getName(isShort) + unitName; } - - if (value > MeasurementUnit.KILO.process) { return roundDecimals(MeasurementUnit.KILO.process(value), significantFigures) + " " + MeasurementUnit.KILO.getName(isShort) + unitName; } - - if (value > MeasurementUnit.MEGA.process) { return roundDecimals(MeasurementUnit.MEGA.process(value), significantFigures) + " " + MeasurementUnit.MEGA.getName(isShort) + unitName; } - - return roundDecimals(value, significantFigures) + " " + unitName; - } - - public static String getDisplayShort(double value, ElectricUnit unit) - { - return getDisplay(value, unit, 2, true); - } - - public static String getDisplay(double value, ElectricUnit unit) - { - return getDisplay(value, unit, 2, false); - } - - public static String getDisplaySimple(double value, ElectricUnit unit, int significantFigures) - { - if (value > 1) - { - if (significantFigures < 1) { return (int) value + " " + unit.getPlural(); } - - return roundDecimals(value, significantFigures) + " " + unit.getPlural(); - } - - if (significantFigures < 1) { return (int) value + " " + unit.name; } - - return roundDecimals(value, significantFigures) + " " + unit.name; - } - - /** - * Rounds a number to a specific number place places - * - * @param The - * number - * @return The rounded number - */ - public static double roundDecimals(double d, int significantFigures) - { - int j = (int) (d * Math.pow(10, significantFigures)); - return j / (double) Math.pow(10, significantFigures); - } - - public static double roundDecimals(double d) - { - return roundDecimals(d, 2); - } -} diff --git a/src/common/universalelectricity/core/electricity/ElectricityManagerTicker.java b/src/common/universalelectricity/core/electricity/ElectricityManagerTicker.java deleted file mode 100644 index 14dff7740..000000000 --- a/src/common/universalelectricity/core/electricity/ElectricityManagerTicker.java +++ /dev/null @@ -1,45 +0,0 @@ -package universalelectricity.core.electricity; - -import java.util.EnumSet; - -import cpw.mods.fml.common.ITickHandler; -import cpw.mods.fml.common.TickType; - -public class ElectricityManagerTicker implements ITickHandler -{ - public static long inGameTicks = 0; - - @Override - public void tickStart(EnumSet type, Object... tickData) - { - if (ElectricityManager.instance != null) - { - ElectricityManager.instance.onTick(type, tickData); - } - - inGameTicks++; - - if (inGameTicks >= Long.MAX_VALUE) - { - inGameTicks = 0; - } - } - - @Override - public void tickEnd(EnumSet type, Object... tickData) - { - - } - - @Override - public EnumSet ticks() - { - return EnumSet.of(TickType.WORLD, TickType.WORLDLOAD, TickType.SERVER); - } - - @Override - public String getLabel() - { - return "Electricity Manager"; - } -} diff --git a/src/common/universalelectricity/core/electricity/ElectricityNetwork.java b/src/common/universalelectricity/core/electricity/ElectricityNetwork.java deleted file mode 100644 index 2c6e194bf..000000000 --- a/src/common/universalelectricity/core/electricity/ElectricityNetwork.java +++ /dev/null @@ -1,122 +0,0 @@ -package universalelectricity.core.electricity; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.src.TileEntity; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.implement.IConductor; -import universalelectricity.core.implement.IElectricityReceiver; - -public class ElectricityNetwork -{ - public List conductors = new ArrayList(); - - public ElectricityNetwork(IConductor conductor) - { - this.addConductor(conductor); - } - - public void addConductor(IConductor newConductor) - { - this.cleanUpArray(); - - if (!conductors.contains(newConductor)) - { - conductors.add(newConductor); - newConductor.setNetwork(this); - } - } - - /** - * Get only the electric units that can receive electricity from the given side. - */ - public List getConnectedReceivers() - { - this.cleanUpArray(); - List returnArray = new ArrayList(); - - for (IConductor conductor : conductors) - { - for (byte i = 0; i < conductor.getConnectedBlocks().length; i++) - { - TileEntity tileEntity = conductor.getConnectedBlocks()[i]; - - if (tileEntity != null) - { - if (tileEntity instanceof IElectricityReceiver) - { - if (!returnArray.contains((IElectricityReceiver) tileEntity) && ((IElectricityReceiver) tileEntity).canReceiveFromSide(ForgeDirection.getOrientation(i).getOpposite())) - { - returnArray.add((IElectricityReceiver) tileEntity); - } - } - } - } - } - - return returnArray; - } - - public void cleanUpArray() - { - for (int i = 0; i < conductors.size(); i++) - { - if (conductors.get(i) == null) - { - conductors.remove(i); - } - else if (((TileEntity) conductors.get(i)).isInvalid()) - { - conductors.remove(i); - } - } - } - - public void setNetwork() - { - this.cleanUpArray(); - - for (IConductor conductor : this.conductors) - { - conductor.setNetwork(this); - } - } - - public void onOverCharge() - { - this.cleanUpArray(); - - for (int i = 0; i < conductors.size(); i++) - { - conductors.get(i).onOverCharge(); - } - } - - public double getLowestAmpConductor() - { - double lowestAmp = 0; - - for (IConductor conductor : conductors) - { - if (lowestAmp == 0 || conductor.getMaxAmps() < lowestAmp) - { - lowestAmp = conductor.getMaxAmps(); - } - } - - return lowestAmp; - } - - /** - * This function is called to refresh all conductors in this network - */ - public void refreshConductors() - { - for (int j = 0; j < this.conductors.size(); j++) - { - IConductor conductor = this.conductors.get(j); - conductor.refreshConnectedBlocks(); - } - } -} diff --git a/src/common/universalelectricity/core/implement/IConductor.java b/src/common/universalelectricity/core/implement/IConductor.java deleted file mode 100644 index 6ec514c18..000000000 --- a/src/common/universalelectricity/core/implement/IConductor.java +++ /dev/null @@ -1,71 +0,0 @@ -package universalelectricity.core.implement; - -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.electricity.ElectricityNetwork; - -/** - * Must be applied to all tile entities that are conductors. - * - * @author Calclavia - * - */ -public interface IConductor extends IConnector -{ - /** - * The electrical network this conductor is on. - */ - public ElectricityNetwork getNetwork(); - - public void setNetwork(ElectricityNetwork network); - - /** - * The UE tile entities that this conductor is connected to. - * - * @return - */ - public TileEntity[] getConnectedBlocks(); - - /** - * Gets the resistance of the conductor. Used to calculate energy loss. A higher resistance - * means a higher energy loss. - * - * @return The amount of Ohm's of resistance. - */ - public double getResistance(); - - /** - * The maximum amount of amps this conductor can handle before melting down. This is calculating - * PER TICK! - * - * @return The amount of amps in volts - */ - public double getMaxAmps(); - - /** - * Called when the electricity passing through exceeds the maximum voltage. - */ - public void onOverCharge(); - - /** - * Resets the conductor and recalculate connection IDs again - */ - public void reset(); - - public World getWorld(); - - /** - * Adds a connection between this conductor and a UE unit - * - * @param tileEntity - * - Must be either a producer, consumer or a conductor - * @param side - * - side in which the connection is coming from - */ - public void updateConnection(TileEntity tileEntity, ForgeDirection side); - - public void updateConnectionWithoutSplit(TileEntity connectorFromSide, ForgeDirection orientation); - - public void refreshConnectedBlocks(); -} diff --git a/src/common/universalelectricity/core/implement/IConnector.java b/src/common/universalelectricity/core/implement/IConnector.java deleted file mode 100644 index ed1e841da..000000000 --- a/src/common/universalelectricity/core/implement/IConnector.java +++ /dev/null @@ -1,21 +0,0 @@ -package universalelectricity.core.implement; - -import net.minecraftforge.common.ForgeDirection; - -/** - * Applied to a TileEntity that can connect to UE wires. - * - * @author Calclavia - * - */ -public interface IConnector -{ - /** - * Can this TileEntity visually connect to a wire on this specific side? - * - * @param side - * - The side in which the connection is coming from. - * @return - True if so. - */ - public boolean canConnect(ForgeDirection side); -} diff --git a/src/common/universalelectricity/core/implement/IDisableable.java b/src/common/universalelectricity/core/implement/IDisableable.java deleted file mode 100644 index 5ab627c0c..000000000 --- a/src/common/universalelectricity/core/implement/IDisableable.java +++ /dev/null @@ -1,26 +0,0 @@ -package universalelectricity.core.implement; - -/** - * This class should be applied to all tile entities (mainly machines) that can be disabled (by - * things like EMP, short circuit etc.). - * - * @author Calclavia - * - */ -public interface IDisableable -{ - /** - * This is called when the tile entity is to be disabled. - * - * @param duration - * - The duration of the disable in ticks. - */ - public void onDisable(int duration); - - /** - * Called to see if this tile entity is disabled. - * - * @return True if the tile entity is disabled. - */ - public boolean isDisabled(); -} diff --git a/src/common/universalelectricity/core/implement/IElectricityProducer.java b/src/common/universalelectricity/core/implement/IElectricityProducer.java deleted file mode 100644 index ec81951c4..000000000 --- a/src/common/universalelectricity/core/implement/IElectricityProducer.java +++ /dev/null @@ -1,12 +0,0 @@ -package universalelectricity.core.implement; - -/** - * Applied to TileEntities that can produces electricity. Of course, you will still need to call - * ElectricityManager.instance.produce() to actually output the electricity. - * - * @author Calclavia - */ -public interface IElectricityProducer extends IConnector, IDisableable, IVoltage -{ - -} diff --git a/src/common/universalelectricity/core/implement/IItemElectric.java b/src/common/universalelectricity/core/implement/IItemElectric.java deleted file mode 100644 index 95d70e153..000000000 --- a/src/common/universalelectricity/core/implement/IItemElectric.java +++ /dev/null @@ -1,32 +0,0 @@ -package universalelectricity.core.implement; - -import net.minecraft.src.ItemStack; - -public interface IItemElectric extends IJouleStorage, IVoltage -{ - /** - * Called when this item receives electricity. - */ - public double onReceive(double amps, double voltage, ItemStack itemStack); - - /** - * Called when something requests electricity from this item. - * - * @return - The amount of given joules - */ - public double onUse(double joulesNeeded, ItemStack itemStack); - - /** - * @return Returns true or false if this consumer can receive electricity at this given tick or - * moment. - */ - public boolean canReceiveElectricity(); - - /** - * Can this item give out electricity when placed in an tile entity? Electric items like - * batteries should be able to produce electricity (if they are rechargeable). - * - * @return - True or False. - */ - public boolean canProduceElectricity(); -} diff --git a/src/common/universalelectricity/core/implement/IVoltage.java b/src/common/universalelectricity/core/implement/IVoltage.java deleted file mode 100644 index 95981d016..000000000 --- a/src/common/universalelectricity/core/implement/IVoltage.java +++ /dev/null @@ -1,17 +0,0 @@ -package universalelectricity.core.implement; - -/** - * Applies to all objects that has a voltage. - * - * @author Calclavia - * - */ -public interface IVoltage -{ - /** - * Gets the voltage of this object. - * - * @return The amount of volts. E.g 120v or 240v - */ - public double getVoltage(); -} diff --git a/src/common/universalelectricity/core/vector/Region2.java b/src/common/universalelectricity/core/vector/Region2.java deleted file mode 100644 index 6e0d54c89..000000000 --- a/src/common/universalelectricity/core/vector/Region2.java +++ /dev/null @@ -1,34 +0,0 @@ -package universalelectricity.core.vector; - -public class Region2 -{ - public Vector2 min; - public Vector2 max; - - public Region2() - { - this(new Vector2(), new Vector2()); - } - - public Region2(Vector2 min, Vector2 max) - { - this.min = min; - this.max = max; - } - - /** - * Checks if a point is located inside a region - */ - public boolean isIn(Vector2 point) - { - return (point.x > this.min.x && point.x < this.max.x) && (point.y > this.min.y && point.y < this.max.y); - } - - /** - * Returns whether the given region intersects with this one. - */ - public boolean isIn(Region2 region) - { - return region.max.x > this.min.x && region.min.x < this.max.x ? (region.max.y > this.min.y && region.min.y < this.max.y ? true : false) : false; - } -} diff --git a/src/common/universalelectricity/core/vector/Region3.java b/src/common/universalelectricity/core/vector/Region3.java deleted file mode 100644 index e23596215..000000000 --- a/src/common/universalelectricity/core/vector/Region3.java +++ /dev/null @@ -1,129 +0,0 @@ -package universalelectricity.core.vector; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.src.AxisAlignedBB; -import net.minecraft.src.Entity; -import net.minecraft.src.World; - -/** - * A cubical region class. - * - * @author Calclavia - */ -public class Region3 -{ - public Vector3 min; - public Vector3 max; - - public Region3() - { - this(new Vector3(), new Vector3()); - } - - public Region3(Vector3 min, Vector3 max) - { - this.min = min; - this.max = max; - } - - public Region3 get(AxisAlignedBB aabb) - { - return new Region3(new Vector3(aabb.minX, aabb.minY, aabb.minZ), new Vector3(aabb.maxX, aabb.maxY, aabb.maxZ)); - } - - public AxisAlignedBB toAABB() - { - return AxisAlignedBB.getBoundingBox(this.min.x, this.min.y, this.min.z, this.max.x, this.max.y, this.max.z); - } - - public Region2 toRegion2() - { - return new Region2(this.min.toVector2(), this.max.toVector2()); - } - - /** - * Checks if a point is located inside a region - */ - public boolean isIn(Vector3 point) - { - return (point.x > this.min.x && point.x < this.max.x) && (point.y > this.min.y && point.y < this.max.y) && (point.z > this.min.z && point.z < this.max.z); - } - - /** - * Returns whether the given region intersects with this one. - */ - public boolean isIn(Region3 region) - { - return region.max.x > this.min.x && region.min.x < this.max.x ? (region.max.y > this.min.y && region.min.y < this.max.y ? region.max.z > this.min.z && region.min.z < this.max.z : false) : false; - } - - public void expand(Vector3 difference) - { - this.min.subtract(difference); - this.max.add(difference); - } - - /** - * @return List of vectors within this region. - */ - public List getVectors() - { - List vectors = new ArrayList(); - - for (int x = this.min.intX(); x < this.max.intX(); x++) - { - for (int y = this.min.intY(); x < this.max.intY(); y++) - { - for (int z = this.min.intZ(); x < this.max.intZ(); z++) - { - vectors.add(new Vector3(x, y, z)); - } - } - } - - return vectors; - } - - public List getVectors(Vector3 center, int radius) - { - List vectors = new ArrayList(); - - for (int x = this.min.intX(); x < this.max.intX(); x++) - { - for (int y = this.min.intY(); x < this.max.intY(); y++) - { - for (int z = this.min.intZ(); x < this.max.intZ(); z++) - { - Vector3 vector3 = new Vector3(x, y, z); - - if (center.distanceTo(vector3) <= radius) - { - vectors.add(vector3); - } - } - } - } - - return vectors; - } - - /** - * Returns all entities in this region. - */ - public List getEntities(World world, Class entityClass) - { - return world.getEntitiesWithinAABB(entityClass, this.toAABB()); - } - - public List getEntitiesExlude(World world, Entity entity) - { - return world.getEntitiesWithinAABBExcludingEntity(entity, this.toAABB()); - } - - public List getEntities(World world) - { - return this.getEntities(world, Entity.class); - } -} diff --git a/src/common/universalelectricity/prefab/BlockConductor.java b/src/common/universalelectricity/prefab/BlockConductor.java deleted file mode 100644 index c4a5daf94..000000000 --- a/src/common/universalelectricity/prefab/BlockConductor.java +++ /dev/null @@ -1,54 +0,0 @@ -package universalelectricity.prefab; - -import net.minecraft.src.BlockContainer; -import net.minecraft.src.Material; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import universalelectricity.core.implement.IConductor; - -public abstract class BlockConductor extends BlockContainer -{ - public BlockConductor(int id, Material material) - { - super(id, material); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World world, int x, int y, int z) - { - super.onBlockAdded(world, x, y, z); - - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - if (tileEntity instanceof IConductor) - { - ((IConductor) tileEntity).refreshConnectedBlocks(); - } - } - } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed - * (coordinates passed are their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, int blockID) - { - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity != null) - { - if (tileEntity instanceof IConductor) - { - ((IConductor) tileEntity).refreshConnectedBlocks(); - } - } - - world.markBlockForUpdate(x, y, z); - } -} diff --git a/src/common/universalelectricity/prefab/ItemElectric.java b/src/common/universalelectricity/prefab/ItemElectric.java deleted file mode 100644 index b29786920..000000000 --- a/src/common/universalelectricity/prefab/ItemElectric.java +++ /dev/null @@ -1,205 +0,0 @@ -package universalelectricity.prefab; - -import java.util.List; - -import net.minecraft.src.CreativeTabs; -import net.minecraft.src.Entity; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.Item; -import net.minecraft.src.ItemStack; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.NBTTagFloat; -import net.minecraft.src.World; -import universalelectricity.core.electricity.ElectricInfo; -import universalelectricity.core.electricity.ElectricInfo.ElectricUnit; -import universalelectricity.core.implement.IItemElectric; - -/** - * Extend from this class if your item requires electricity or to be charged. Optionally, you can - * implement IItemElectric instead. - * - * @author Calclavia - * - */ -public abstract class ItemElectric extends Item implements IItemElectric -{ - public ItemElectric(int id) - { - super(id); - this.setMaxStackSize(1); - this.setMaxDamage((int) this.getMaxJoules()); - this.setNoRepair(); - } - - /** - * Allows items to add custom lines of information to the mouseover description. If you want to - * add more information to your item, you can super.addInformation() to keep the electiricty - * info in the item info bar. - */ - @Override - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - String color = ""; - double joules = this.getJoules(par1ItemStack); - - if (joules <= this.getMaxJoules() / 3) - { - color = "\u00a74"; - } - else if (joules > this.getMaxJoules() * 2 / 3) - { - color = "\u00a72"; - } - else - { - color = "\u00a76"; - } - - par3List.add(color + ElectricInfo.getDisplay(joules, ElectricUnit.JOULES) + " - " + Math.round((joules / this.getMaxJoules()) * 100) + "%"); - } - - /** - * Make sure you super this method! - */ - @Override - public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) - { - // Makes sure the damage is set correctly - // for this electric item! - ItemElectric item = ((ItemElectric) par1ItemStack.getItem()); - item.setJoules(item.getJoules(par1ItemStack), par1ItemStack); - } - - /** - * Makes sure the item is uncharged when it is crafted and not charged. Change this if you do - * not want this to happen! - */ - @Override - public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) - { - par1ItemStack = this.getUncharged(); - } - - @Override - public double onReceive(double amps, double voltage, ItemStack itemStack) - { - double rejectedElectricity = Math.max((this.getJoules(itemStack) + ElectricInfo.getJoules(amps, voltage, 1)) - this.getMaxJoules(), 0); - this.setJoules(this.getJoules(itemStack) + ElectricInfo.getJoules(amps, voltage, 1) - rejectedElectricity, itemStack); - return rejectedElectricity; - } - - @Override - public double onUse(double joulesNeeded, ItemStack itemStack) - { - double electricityToUse = Math.min(this.getJoules(itemStack), joulesNeeded); - this.setJoules(this.getJoules(itemStack) - electricityToUse, itemStack); - return electricityToUse; - } - - public boolean canReceiveElectricity() - { - return true; - } - - public boolean canProduceElectricity() - { - return false; - } - - /** - * This function sets the electriicty. Do not directly call this function. Try to use - * onReceiveElectricity or onUseElectricity instead. - * - * @param wattHours - * - The amount of electricity in joules - */ - @Override - public void setJoules(double wattHours, Object... data) - { - if (data[0] instanceof ItemStack) - { - ItemStack itemStack = (ItemStack) data[0]; - - // Saves the frequency in the - // itemstack - if (itemStack.stackTagCompound == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } - - double electricityStored = Math.max(Math.min(wattHours, this.getMaxJoules()), 0); - itemStack.stackTagCompound.setDouble("electricity", electricityStored); - itemStack.setItemDamage((int) (getMaxJoules() - electricityStored)); - } - } - - /** - * This function is called to get the electricity stored in this item - * - * @return - The amount of electricity stored in watts - */ - @Override - public double getJoules(Object... data) - { - if (data[0] instanceof ItemStack) - { - ItemStack itemStack = (ItemStack) data[0]; - - if (itemStack.stackTagCompound == null) { return 0; } - double electricityStored = 0; - if (itemStack.stackTagCompound.getTag("electricity") instanceof NBTTagFloat) - { - electricityStored = itemStack.stackTagCompound.getFloat("electricity"); - } - else - { - electricityStored = itemStack.stackTagCompound.getDouble("electricity"); - } - itemStack.setItemDamage((int) (getMaxJoules() - electricityStored)); - return electricityStored; - } - - return -1; - } - - /** - * Returns an uncharged version of the electric item. Use this if you want the crafting recipe - * to use a charged version of the electric item instead of an empty version of the electric - * item - * - * @return The ItemStack of a fully charged electric item - */ - public ItemStack getUncharged() - { - ItemStack chargedItem = new ItemStack(this); - chargedItem.setItemDamage((int) this.getMaxJoules()); - return chargedItem; - } - - public static ItemStack getUncharged(ItemStack itemStack) - { - if (itemStack.getItem() instanceof IItemElectric) - { - ItemStack chargedItem = itemStack.copy(); - chargedItem.setItemDamage((int) ((IItemElectric) itemStack.getItem()).getMaxJoules()); - return chargedItem; - } - - return null; - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - // Add an uncharged version of the - // electric item - ItemStack unchargedItem = new ItemStack(this, 1); - unchargedItem.setItemDamage((int) this.getMaxJoules()); - par3List.add(unchargedItem); - // Add an electric item to the creative - // list that is fully charged - ItemStack chargedItem = new ItemStack(this, 1); - this.setJoules(((IItemElectric) chargedItem.getItem()).getMaxJoules(), chargedItem); - par3List.add(chargedItem); - } -} diff --git a/src/common/universalelectricity/prefab/RecipeHelper.java b/src/common/universalelectricity/prefab/RecipeHelper.java deleted file mode 100644 index 9fbcedd97..000000000 --- a/src/common/universalelectricity/prefab/RecipeHelper.java +++ /dev/null @@ -1,188 +0,0 @@ -package universalelectricity.prefab; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.src.CraftingManager; -import net.minecraft.src.IRecipe; -import net.minecraft.src.ItemStack; -import net.minecraftforge.common.Configuration; -import universalelectricity.core.UEConfig; -import cpw.mods.fml.common.registry.GameRegistry; - -/** - * This class is used to replace recipes that are already added in the existing recipe pool for - * crafting and smelting. All recipe functions take account of the Forge Ore Dictionary. It also - * includes some recipe helper functions to shorten some of your function calls. - * - * @author Calclavia - * - */ -public class RecipeHelper -{ - public static List getRecipesByOutput(ItemStack output) - { - List list = new ArrayList(); - - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).getRecipeOutput() == output) - { - list.add((IRecipe) obj); - } - } - } - - return list; - } - - /** - * Replaces a recipe with a new IRecipe. - * - * @return True if successful - */ - public static boolean replaceRecipe(IRecipe recipe, IRecipe newRecipe) - { - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).equals(recipe) || obj == recipe) - { - CraftingManager.getInstance().getRecipeList().remove(obj); - CraftingManager.getInstance().getRecipeList().add(newRecipe); - return true; - } - } - } - - return false; - } - - /** - * Replaces a recipe with the resulting ItemStack with a new IRecipe. - * - * @return True if successful - */ - public static boolean replaceRecipe(ItemStack recipe, IRecipe newRecipe) - { - if (removeRecipe(recipe)) - { - CraftingManager.getInstance().getRecipeList().add(newRecipe); - return true; - } - - return false; - } - - /** - * Removes a recipe by its IRecipe class. - * - * @return True if successful - */ - public static boolean removeRecipe(IRecipe recipe) - { - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj != null) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).equals(recipe) || obj == recipe) - { - CraftingManager.getInstance().getRecipeList().remove(obj); - return true; - } - } - } - } - - return false; - } - - /** - * Removes the first recipe found by its output. - * - * @return True if successful - */ - public static boolean removeRecipe(ItemStack stack) - { - for (Object obj : CraftingManager.getInstance().getRecipeList()) - { - if (obj != null) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).getRecipeOutput() != null) - { - if (((IRecipe) obj).getRecipeOutput().isItemEqual(stack)) - { - CraftingManager.getInstance().getRecipeList().remove(obj); - return true; - } - } - } - } - } - - return false; - } - - /** - * Removes all recipes found that has this output. - * - * @return True if successful - */ - public static boolean removeRecipes(ItemStack... itemStacks) - { - boolean didRemove = false; - - for (Iterator itr = CraftingManager.getInstance().getRecipeList().iterator(); itr.hasNext();) - { - Object obj = itr.next(); - - if (obj != null) - { - if (obj instanceof IRecipe) - { - if (((IRecipe) obj).getRecipeOutput() != null) - { - for (ItemStack itemStack : itemStacks) - { - if (((IRecipe) obj).getRecipeOutput().isItemEqual(itemStack)) - { - itr.remove(); - didRemove = true; - break; - } - } - } - } - } - } - - return didRemove; - } - - /** - * Use this function if you want to check if the recipe is allowed in the configuration file. - */ - public static void addRecipe(IRecipe recipe, String name, Configuration config, boolean defaultBoolean) - { - if (config != null) - { - if (UEConfig.getConfigData(config, "Allow " + name + " Crafting", defaultBoolean)) - { - GameRegistry.addRecipe(recipe); - } - } - } - - public static void addRecipe(IRecipe recipe, Configuration config, boolean defaultBoolean) - { - addRecipe(recipe, recipe.getRecipeOutput().getItemName(), config, defaultBoolean); - } -} diff --git a/src/common/universalelectricity/prefab/SlotElectricItem.java b/src/common/universalelectricity/prefab/SlotElectricItem.java deleted file mode 100644 index 00e31ade9..000000000 --- a/src/common/universalelectricity/prefab/SlotElectricItem.java +++ /dev/null @@ -1,29 +0,0 @@ -package universalelectricity.prefab; - -import net.minecraft.src.IInventory; -import net.minecraft.src.ItemStack; -import net.minecraft.src.Slot; -import universalelectricity.core.implement.IItemElectric; - -/** - * This slot should be used by any container that needs the slot for an electric items only. - * - * @author Calclavia - * - */ -public class SlotElectricItem extends Slot -{ - public SlotElectricItem(IInventory par2IInventory, int par3, int par4, int par5) - { - super(par2IInventory, par3, par4, par5); - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) - { - return par1ItemStack.getItem() instanceof IItemElectric; - } -} diff --git a/src/common/universalelectricity/prefab/UEDamageSource.java b/src/common/universalelectricity/prefab/UEDamageSource.java deleted file mode 100644 index 479528c06..000000000 --- a/src/common/universalelectricity/prefab/UEDamageSource.java +++ /dev/null @@ -1,57 +0,0 @@ -package universalelectricity.prefab; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.src.DamageSource; -import cpw.mods.fml.common.registry.LanguageRegistry; - -public class UEDamageSource extends DamageSource -{ - public static final List damageSources = new ArrayList(); - - /** - * Use this damage source for all types of electrical attacks. - */ - public static final UEDamageSource electrocution = (UEDamageSource) new UEDamageSource("electrocution", "%1$s got electrocuted!").setDamageBypassesArmor(); - - public String deathMessage; - - public UEDamageSource(String damageType) - { - super(damageType); - damageSources.add(this); - } - - public UEDamageSource(String damageType, String deathMessage) - { - this(damageType); - this.setDeathMessage(deathMessage); - } - - public UEDamageSource setDeathMessage(String deathMessage) - { - this.deathMessage = deathMessage; - return this; - } - - public DamageSource setDamageBypassesArmor() - { - return super.setDamageBypassesArmor(); - } - - public DamageSource setDamageAllowedInCreativeMode() - { - return super.setDamageAllowedInCreativeMode(); - } - - public DamageSource setFireDamage() - { - return super.setFireDamage(); - } - - public void registerDeathMessage() - { - LanguageRegistry.instance().addStringLocalization("death." + this.damageType, this.deathMessage); - } -} diff --git a/src/common/universalelectricity/prefab/UETab.java b/src/common/universalelectricity/prefab/UETab.java deleted file mode 100644 index 05dc647a1..000000000 --- a/src/common/universalelectricity/prefab/UETab.java +++ /dev/null @@ -1,34 +0,0 @@ -package universalelectricity.prefab; - -import net.minecraft.src.Block; -import net.minecraft.src.CreativeTabs; -import net.minecraft.src.ItemStack; -import cpw.mods.fml.common.registry.LanguageRegistry; - -public class UETab extends CreativeTabs -{ - public static final UETab INSTANCE = new UETab("UniversalElectricity"); - private static ItemStack itemStack; - - public UETab(String par2Str) - { - super(CreativeTabs.getNextID(), par2Str); - LanguageRegistry.instance().addStringLocalization("itemGroup.UniversalElectricity", "en_US", "Universal Electricity"); - } - - public static void setItemStack(ItemStack newItemStack) - { - if (itemStack == null) - { - itemStack = newItemStack; - } - } - - @Override - public ItemStack getIconItemStack() - { - if (itemStack == null) { return new ItemStack(Block.blocksList[this.getTabIconItemIndex()]); } - - return itemStack; - } -} diff --git a/src/common/universalelectricity/prefab/implement/IRedstoneProvider.java b/src/common/universalelectricity/prefab/implement/IRedstoneProvider.java deleted file mode 100644 index e1f93c44e..000000000 --- a/src/common/universalelectricity/prefab/implement/IRedstoneProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -package universalelectricity.prefab.implement; - -import net.minecraftforge.common.ForgeDirection; - -/** - * This should be applied on tile entities that can provide redstone power - * - * @author Calclavia - * - */ -public interface IRedstoneProvider -{ - public boolean isPoweringTo(ForgeDirection side); - - public boolean isIndirectlyPoweringTo(ForgeDirection side); -} diff --git a/src/common/universalelectricity/prefab/implement/IRedstoneReceptor.java b/src/common/universalelectricity/prefab/implement/IRedstoneReceptor.java deleted file mode 100644 index 489680088..000000000 --- a/src/common/universalelectricity/prefab/implement/IRedstoneReceptor.java +++ /dev/null @@ -1,21 +0,0 @@ -package universalelectricity.prefab.implement; - -/** - * This interface should be applied onto all tile entities that needs to receive redstone power. - * Look at TileEntityBatteryBox for reference. - * - * @author Calclavia - * - */ -public interface IRedstoneReceptor -{ - /** - * Called when the block is powered on by redstone - */ - public void onPowerOn(); - - /** - * Called when the block is powered off by redstone - */ - public void onPowerOff(); -} diff --git a/src/common/universalelectricity/prefab/implement/IRotatable.java b/src/common/universalelectricity/prefab/implement/IRotatable.java deleted file mode 100644 index 0bddcf684..000000000 --- a/src/common/universalelectricity/prefab/implement/IRotatable.java +++ /dev/null @@ -1,33 +0,0 @@ -package universalelectricity.prefab.implement; - -import net.minecraftforge.common.ForgeDirection; - -/** - * This interface should be applied onto all tile entities that are rotatable. This interface - * however is optional and you do not need it for your add-on to function. It just makes things - * easier for you to code. - * - * @author Calclavia - * - */ - -public interface IRotatable -{ - /** - * Gets the facing direction of the tile entity. Always returns the front side of the tile - * entity. - * - * @return The facing side from 0-5 The full list of which side the number represents is in the - * UniversalElectricity class. - */ - public ForgeDirection getDirection(); - - /** - * Sets the facing direction of the tile entity. - * - * @param facingDirection - * - A direction from 0-5. The full list of which side the number represents is in - * the UniversalElectricity class. - */ - public void setDirection(ForgeDirection facingDirection); -} diff --git a/src/common/universalelectricity/prefab/implement/ITier.java b/src/common/universalelectricity/prefab/implement/ITier.java deleted file mode 100644 index f67de2a55..000000000 --- a/src/common/universalelectricity/prefab/implement/ITier.java +++ /dev/null @@ -1,25 +0,0 @@ -package universalelectricity.prefab.implement; - -/** - * This interface should be applied to all things that has a tier/level. - * - * @author Calclavia - * - */ -public interface ITier -{ - /** - * Gets the tier of this object - * - * @return - The tier - */ - public int getTier(); - - /** - * Sets the tier of the object - * - * @param tier - * - The tier to be set - */ - public void setTier(int tier); -} diff --git a/src/common/universalelectricity/prefab/multiblock/BlockMulti.java b/src/common/universalelectricity/prefab/multiblock/BlockMulti.java deleted file mode 100644 index acc5be5fb..000000000 --- a/src/common/universalelectricity/prefab/multiblock/BlockMulti.java +++ /dev/null @@ -1,98 +0,0 @@ -package universalelectricity.prefab.multiblock; - -import java.util.Random; - -import net.minecraft.src.Block; -import net.minecraft.src.BlockContainer; -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.ItemStack; -import net.minecraft.src.MovingObjectPosition; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import universalelectricity.core.UniversalElectricity; -import universalelectricity.core.vector.Vector3; - -public class BlockMulti extends BlockContainer -{ - public BlockMulti(int id) - { - super(id, UniversalElectricity.machine); - this.setHardness(0.8F); - this.setBlockName("MultiBlock"); - } - - public void makeFakeBlock(World worldObj, Vector3 position, Vector3 mainBlock) - { - worldObj.setBlockWithNotify(position.intX(), position.intY(), position.intZ(), this.blockID); - ((TileEntityMulti) worldObj.getBlockTileEntity(position.intX(), position.intY(), position.intZ())).setMainBlock(mainBlock); - } - - @Override - public void breakBlock(World par1World, int x, int y, int z, int par5, int par6) - { - TileEntityMulti tileEntity = (TileEntityMulti) par1World.getBlockTileEntity(x, y, z); - tileEntity.onBlockRemoval(); - super.breakBlock(par1World, x, y, z, par5, par6); - } - - /** - * Called when the block is right clicked by the player. This modified version detects electric - * items and wrench actions on your machine block. Do not override this function. Use - * machineActivated instead! (It does the same thing) - */ - @Override - public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) - { - TileEntityMulti tileEntity = (TileEntityMulti) par1World.getBlockTileEntity(x, y, z); - return tileEntity.onBlockActivated(par1World, x, y, z, par5EntityPlayer); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) - { - return 0; - } - - @Override - public int getRenderType() - { - return -1; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @Override - public TileEntity createNewTileEntity(World var1) - { - return new TileEntityMulti(); - } - - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int x, int y, int z) - { - TileEntity tileEntity = par1World.getBlockTileEntity(x, y, z); - Vector3 mainBlockPosition = ((TileEntityMulti) tileEntity).mainBlockPosition; - - if (mainBlockPosition != null) - { - int mainBlockID = par1World.getBlockId(mainBlockPosition.intX(), mainBlockPosition.intY(), mainBlockPosition.intZ()); - - if (mainBlockID > 0) { return Block.blocksList[mainBlockID].getPickBlock(target, par1World, mainBlockPosition.intX(), mainBlockPosition.intY(), mainBlockPosition.intZ()); } - } - - return null; - } -} \ No newline at end of file diff --git a/src/common/universalelectricity/prefab/multiblock/IBlockActivate.java b/src/common/universalelectricity/prefab/multiblock/IBlockActivate.java deleted file mode 100644 index bbac0a969..000000000 --- a/src/common/universalelectricity/prefab/multiblock/IBlockActivate.java +++ /dev/null @@ -1,17 +0,0 @@ -package universalelectricity.prefab.multiblock; - -import net.minecraft.src.EntityPlayer; - -/** - * A general interface to be implemented by anything that needs it. - * - * @author Calclavia - * - */ -public interface IBlockActivate -{ - /** - * Called when activated - */ - public boolean onActivated(EntityPlayer entityPlayer); -} \ No newline at end of file diff --git a/src/common/universalelectricity/prefab/multiblock/IMultiBlock.java b/src/common/universalelectricity/prefab/multiblock/IMultiBlock.java deleted file mode 100644 index 52d786ceb..000000000 --- a/src/common/universalelectricity/prefab/multiblock/IMultiBlock.java +++ /dev/null @@ -1,30 +0,0 @@ -package universalelectricity.prefab.multiblock; - -import net.minecraft.src.TileEntity; -import universalelectricity.core.vector.Vector3; - -/** - * Interface to be applied to tile entity blocks that occupies more than one block space. Useful for - * large machines. - * - * @author Calclavia - * - */ -public interface IMultiBlock extends IBlockActivate -{ - /** - * Called when this multiblock is created - * - * @param placedPosition - * - The position the block was placed at - */ - public void onCreate(Vector3 placedPosition); - - /** - * Called when one of the multiblocks of this block is destroyed - * - * @param callingBlock - * - The tile entity who called the onDestroy function - */ - public void onDestroy(TileEntity callingBlock); -} diff --git a/src/common/universalelectricity/prefab/multiblock/TileEntityMulti.java b/src/common/universalelectricity/prefab/multiblock/TileEntityMulti.java deleted file mode 100644 index efe5152a3..000000000 --- a/src/common/universalelectricity/prefab/multiblock/TileEntityMulti.java +++ /dev/null @@ -1,120 +0,0 @@ -package universalelectricity.prefab.multiblock; - -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.INetworkManager; -import net.minecraft.src.NBTTagCompound; -import net.minecraft.src.Packet; -import net.minecraft.src.Packet250CustomPayload; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import universalelectricity.core.vector.Vector3; -import universalelectricity.prefab.network.IPacketReceiver; -import universalelectricity.prefab.network.PacketManager; - -import com.google.common.io.ByteArrayDataInput; - -/** - * This is a multiblock to be used for blocks that are bigger than one block. - * - * @author Calclavia - * - */ -public class TileEntityMulti extends TileEntity implements IPacketReceiver -{ - // The the position of the main block - public Vector3 mainBlockPosition; - - public void setMainBlock(Vector3 mainBlock) - { - this.mainBlockPosition = mainBlock; - - if (!this.worldObj.isRemote) - { - PacketManager.sendPacketToClients(this.getDescriptionPacket()); - } - } - - @Override - public Packet getDescriptionPacket() - { - return PacketManager.getPacket("BasicComponents", this, this.mainBlockPosition.x, this.mainBlockPosition.y, this.mainBlockPosition.z); - } - - public void onBlockRemoval() - { - if (mainBlockPosition != null) - { - TileEntity tileEntity = this.worldObj.getBlockTileEntity((int) mainBlockPosition.x, (int) mainBlockPosition.y, (int) mainBlockPosition.z); - - if (tileEntity != null && tileEntity instanceof IMultiBlock) - { - IMultiBlock mainBlock = (IMultiBlock) tileEntity; - - if (mainBlock != null) - { - mainBlock.onDestroy(this); - } - } - } - } - - public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer) - { - if (mainBlockPosition != null) - { - TileEntity tileEntity = this.worldObj.getBlockTileEntity((int) mainBlockPosition.x, (int) mainBlockPosition.y, (int) mainBlockPosition.z); - - if (tileEntity != null) - { - if (tileEntity instanceof IMultiBlock) { return ((IMultiBlock) tileEntity).onActivated(par5EntityPlayer); } - } - } - - return false; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) - { - super.readFromNBT(par1NBTTagCompound); - - this.mainBlockPosition = Vector3.readFromNBT("mainBlockPosition", par1NBTTagCompound); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) - { - super.writeToNBT(par1NBTTagCompound); - - this.mainBlockPosition.writeToNBT("mainBlockPosition", par1NBTTagCompound); - } - - /** - * Determines if this TileEntity requires update calls. - * - * @return True if you want updateEntity() to be called, false if not - */ - public boolean canUpdate() - { - return false; - } - - @Override - public void handlePacketData(INetworkManager network, int packetType, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) - { - try - { - this.mainBlockPosition = new Vector3(dataStream.readDouble(), dataStream.readDouble(), dataStream.readDouble()); - } - catch (Exception e) - { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/common/universalelectricity/prefab/network/ConnectionHandler.java b/src/common/universalelectricity/prefab/network/ConnectionHandler.java deleted file mode 100644 index 30250c64b..000000000 --- a/src/common/universalelectricity/prefab/network/ConnectionHandler.java +++ /dev/null @@ -1,88 +0,0 @@ -package universalelectricity.prefab.network; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.src.INetworkManager; -import net.minecraft.src.NetHandler; -import net.minecraft.src.NetLoginHandler; -import net.minecraft.src.Packet1Login; -import cpw.mods.fml.common.network.IConnectionHandler; -import cpw.mods.fml.common.network.Player; - -public class ConnectionHandler implements IConnectionHandler -{ - private static final List simpleConnectionHandlers = new ArrayList(); - - public static enum ConnectionType - { - LOGIN_SERVER, LOGIN_CLIENT, RECEIVED, OPEN_REMOTE, OPEN_LOCAL, CLOSED - } - - /** - * Registers a simple connection handler - * - * @param tileEntity - */ - public static void registerConnectionHandler(ISimpleConnectionHandler tileEntity) - { - simpleConnectionHandlers.add(tileEntity); - } - - @Override - public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager) - { - for (ISimpleConnectionHandler handler : simpleConnectionHandlers) - { - handler.handelConnection(ConnectionType.LOGIN_SERVER, player, netHandler, manager); - } - } - - @Override - public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login) - { - for (ISimpleConnectionHandler handler : simpleConnectionHandlers) - { - handler.handelConnection(ConnectionType.LOGIN_CLIENT, clientHandler, manager, login); - } - } - - @Override - public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager) - { - for (ISimpleConnectionHandler handler : simpleConnectionHandlers) - { - handler.handelConnection(ConnectionType.RECEIVED, netHandler, manager); - } - - return null; - } - - @Override - public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) - { - for (ISimpleConnectionHandler handler : simpleConnectionHandlers) - { - handler.handelConnection(ConnectionType.OPEN_REMOTE, netClientHandler, server, port, manager); - } - } - - @Override - public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager) - { - for (ISimpleConnectionHandler handler : simpleConnectionHandlers) - { - handler.handelConnection(ConnectionType.OPEN_LOCAL, netClientHandler, server, manager); - } - } - - @Override - public void connectionClosed(INetworkManager manager) - { - for (ISimpleConnectionHandler handler : simpleConnectionHandlers) - { - handler.handelConnection(ConnectionType.CLOSED, manager); - } - } -} diff --git a/src/common/universalelectricity/prefab/network/IPacketReceiver.java b/src/common/universalelectricity/prefab/network/IPacketReceiver.java deleted file mode 100644 index bf39ea4dd..000000000 --- a/src/common/universalelectricity/prefab/network/IPacketReceiver.java +++ /dev/null @@ -1,15 +0,0 @@ -package universalelectricity.prefab.network; - -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.INetworkManager; -import net.minecraft.src.Packet250CustomPayload; - -import com.google.common.io.ByteArrayDataInput; - -public interface IPacketReceiver -{ - /** - * Sends some data to the tile entity. - */ - public void handlePacketData(INetworkManager network, int packetType, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream); -} diff --git a/src/common/universalelectricity/prefab/network/ISimpleConnectionHandler.java b/src/common/universalelectricity/prefab/network/ISimpleConnectionHandler.java deleted file mode 100644 index 45972983a..000000000 --- a/src/common/universalelectricity/prefab/network/ISimpleConnectionHandler.java +++ /dev/null @@ -1,13 +0,0 @@ -package universalelectricity.prefab.network; - -import universalelectricity.prefab.network.ConnectionHandler.ConnectionType; - -public interface ISimpleConnectionHandler -{ - /** - * Called when a player logs in. Use this to reset some tile entities variables if you need to. - * - * @param player - */ - public void handelConnection(ConnectionType type, Object... data); -} diff --git a/src/common/universalelectricity/prefab/ore/OreGenBase.java b/src/common/universalelectricity/prefab/ore/OreGenBase.java deleted file mode 100644 index 863eff47a..000000000 --- a/src/common/universalelectricity/prefab/ore/OreGenBase.java +++ /dev/null @@ -1,104 +0,0 @@ -package universalelectricity.prefab.ore; - -import java.util.Random; - -import net.minecraft.src.Block; -import net.minecraft.src.IChunkProvider; -import net.minecraft.src.ItemStack; -import net.minecraft.src.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.OreDictionary; -import universalelectricity.core.UEConfig; -import universalelectricity.core.UniversalElectricity; - -/** - * This class is used for storing ore generation data. If you are too lazy to generate your own - * ores, you can do {@link #OreGenerator.ORES_TO_GENERATE.add()} to add your ore to the list of ores - * to generate. - * - * @author Calclavia - * - */ -public abstract class OreGenBase -{ - public String name; - - public String oreDictionaryName; - - public boolean shouldGenerate; - - public int blockIndexTexture; - - public ItemStack oreStack; - - public int oreID; - - public int oreMeta; - - /** - * What harvest level does this machine need to be acquired? - */ - public int harvestLevel; - - /** - * The predefined tool classes are "pickaxe", "shovel", "axe". You can add others for custom - * tools. - */ - public String harvestTool; - - /** - * @param name - * - The name of the ore for display - * @param textureFile - * - The 16x16 png texture of your ore to override - * @param minGenerateLevel - * - The highest generation level of your ore - * @param maxGenerateLevel - * - The lowest generation level of your ore - * @param amountPerChunk - * - The amount of ores to generate per chunk - * @param amountPerBranch - * - The amount of ores to generate in a clutter. E.g coal generates with a lot of - * other coal next to it. How much do you want? - */ - public OreGenBase(String name, String oreDiectionaryName, ItemStack stack, String harvestTool, int harvestLevel) - { - this.name = name; - this.shouldGenerate = false; - this.harvestTool = harvestTool; - this.harvestLevel = harvestLevel; - this.oreDictionaryName = oreDiectionaryName; - this.oreStack = stack; - this.oreID = stack.itemID; - this.oreMeta = stack.getItemDamage(); - - OreDictionary.registerOre(oreDictionaryName, stack); - MinecraftForge.setBlockHarvestLevel(Block.blocksList[stack.itemID], stack.getItemDamage(), harvestTool, harvestLevel); - } - - public OreGenBase enable() - { - this.shouldGenerate = shouldGenerateOre(name); - return this; - } - - // You may inherit from this class and change - // this function if you want a - // custom texture render for your ore. - public int getBlockTextureFromSide(int side) - { - return this.blockIndexTexture; - } - - // Checks the config file and see if Universal - // Electricity should generate - // this ore - private static boolean shouldGenerateOre(String oreName) - { - return UEConfig.getConfigData(UniversalElectricity.CONFIGURATION, "Generate " + oreName, true); - } - - public abstract void generate(World world, Random random, int varX, int varZ); - - public abstract boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator); -} diff --git a/src/common/universalelectricity/prefab/ore/OreGenReplace.java b/src/common/universalelectricity/prefab/ore/OreGenReplace.java deleted file mode 100644 index d4a646d00..000000000 --- a/src/common/universalelectricity/prefab/ore/OreGenReplace.java +++ /dev/null @@ -1,132 +0,0 @@ -package universalelectricity.prefab.ore; - -import java.util.Random; - -import net.minecraft.src.ChunkProviderEnd; -import net.minecraft.src.ChunkProviderGenerate; -import net.minecraft.src.ChunkProviderHell; -import net.minecraft.src.IChunkProvider; -import net.minecraft.src.ItemStack; -import net.minecraft.src.MathHelper; -import net.minecraft.src.World; - -/** - * This class is used for storing ore generation data. If you are too lazy to generate your own - * ores, you can do {@link #OreGenerator.ORES_TO_GENERATE.add()} to add your ore to the list of ores - * to generate. - * - * @author Calclavia - * - */ -public class OreGenReplace extends OreGenBase -{ - - public int minGenerateLevel; - public int maxGenerateLevel; - public int amountPerChunk; - public int amountPerBranch; - public int replaceID; - - public boolean generateSurface; - public boolean generateNether; - public boolean generateEnd; - - /** - * @param name - * - The name of the ore for display - * @param textureFile - * - The 16x16 png texture of your ore to override - * @param minGenerateLevel - * - The highest generation level of your ore - * @param maxGenerateLevel - * - The lowest generation level of your ore - * @param amountPerChunk - * - The amount of ores to generate per chunk - * @param amountPerBranch - * - The amount of ores to generate in a clutter. E.g coal generates with a lot of - * other coal next to it. How much do you want? - */ - public OreGenReplace(String name, String oreDiectionaryName, ItemStack stack, int replaceID, int minGenerateLevel, int maxGenerateLevel, int amountPerChunk, int amountPerBranch, String harvestTool, int harvestLevel) - { - super(name, oreDiectionaryName, stack, harvestTool, harvestLevel); - this.minGenerateLevel = minGenerateLevel; - this.maxGenerateLevel = maxGenerateLevel; - this.amountPerChunk = amountPerChunk; - this.amountPerBranch = amountPerBranch; - this.replaceID = replaceID; - } - - public void generate(World world, Random random, int varX, int varZ) - { - - for (int i = 0; i < this.amountPerChunk; i++) - { - int x = varX + random.nextInt(16); - int z = varZ + random.nextInt(16); - int y = random.nextInt(this.maxGenerateLevel - this.minGenerateLevel) + this.minGenerateLevel; - generateReplace(world, random, x, y, z); - } - } - - public boolean generateReplace(World par1World, Random par2Random, int par3, int par4, int par5) - { - float var6 = par2Random.nextFloat() * (float) Math.PI; - double var7 = (double) ((float) (par3 + 8) + MathHelper.sin(var6) * (float) this.amountPerBranch / 8.0F); - double var9 = (double) ((float) (par3 + 8) - MathHelper.sin(var6) * (float) this.amountPerBranch / 8.0F); - double var11 = (double) ((float) (par5 + 8) + MathHelper.cos(var6) * (float) this.amountPerBranch / 8.0F); - double var13 = (double) ((float) (par5 + 8) - MathHelper.cos(var6) * (float) this.amountPerBranch / 8.0F); - double var15 = (double) (par4 + par2Random.nextInt(3) - 2); - double var17 = (double) (par4 + par2Random.nextInt(3) - 2); - - for (int var19 = 0; var19 <= this.amountPerBranch; ++var19) - { - double var20 = var7 + (var9 - var7) * (double) var19 / (double) this.amountPerBranch; - double var22 = var15 + (var17 - var15) * (double) var19 / (double) this.amountPerBranch; - double var24 = var11 + (var13 - var11) * (double) var19 / (double) this.amountPerBranch; - double var26 = par2Random.nextDouble() * (double) this.amountPerBranch / 16.0D; - double var28 = (double) (MathHelper.sin((float) var19 * (float) Math.PI / (float) this.amountPerBranch) + 1.0F) * var26 + 1.0D; - double var30 = (double) (MathHelper.sin((float) var19 * (float) Math.PI / (float) this.amountPerBranch) + 1.0F) * var26 + 1.0D; - int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); - int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); - int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); - int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); - int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); - int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); - - for (int var38 = var32; var38 <= var35; ++var38) - { - double var39 = ((double) var38 + 0.5D - var20) / (var28 / 2.0D); - - if (var39 * var39 < 1.0D) - { - for (int var41 = var33; var41 <= var36; ++var41) - { - double var42 = ((double) var41 + 0.5D - var22) / (var30 / 2.0D); - - if (var39 * var39 + var42 * var42 < 1.0D) - { - for (int var44 = var34; var44 <= var37; ++var44) - { - double var45 = ((double) var44 + 0.5D - var24) / (var28 / 2.0D); - - int block = par1World.getBlockId(var38, var41, var44); - if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (this.replaceID == 0 || block == this.replaceID)) - { - par1World.setBlockAndMetadata(var38, var41, var44, this.oreID, this.oreMeta); - } - } - } - } - } - } - } - - return true; - } - - @Override - public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator) - { - return ((this.generateSurface && chunkGenerator instanceof ChunkProviderGenerate) || (this.generateNether && chunkGenerator instanceof ChunkProviderHell) || (this.generateEnd && chunkGenerator instanceof ChunkProviderEnd)); - } -} diff --git a/src/common/universalelectricity/prefab/ore/OreGenReplaceStone.java b/src/common/universalelectricity/prefab/ore/OreGenReplaceStone.java deleted file mode 100644 index bc4c4e2a4..000000000 --- a/src/common/universalelectricity/prefab/ore/OreGenReplaceStone.java +++ /dev/null @@ -1,18 +0,0 @@ -package universalelectricity.prefab.ore; - -import net.minecraft.src.ItemStack; - -public class OreGenReplaceStone extends OreGenReplace -{ - public OreGenReplaceStone(String name, String oreDiectionaryName, ItemStack stack, int replaceID, int minGenerateLevel, int maxGenerateLevel, int amountPerChunk, int amountPerBranch, String harvestTool, int harvestLevel) - { - super(name, oreDiectionaryName, stack, 1, minGenerateLevel, maxGenerateLevel, amountPerChunk, amountPerBranch, harvestTool, harvestLevel); - this.generateSurface = true; - } - - // A simplified version of the constructor - public OreGenReplaceStone(String name, String oreDiectionaryName, ItemStack stack, int replaceID, int maxGenerateLevel, int amountPerChunk, int amountPerBranch) - { - this(name, oreDiectionaryName, stack, 0, replaceID, maxGenerateLevel, amountPerChunk, amountPerBranch, "pickaxe", 1); - } -} \ No newline at end of file diff --git a/src/common/universalelectricity/prefab/ore/OreGenerator.java b/src/common/universalelectricity/prefab/ore/OreGenerator.java deleted file mode 100644 index 3c94519d3..000000000 --- a/src/common/universalelectricity/prefab/ore/OreGenerator.java +++ /dev/null @@ -1,75 +0,0 @@ -package universalelectricity.prefab.ore; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.src.IChunkProvider; -import net.minecraft.src.World; -import cpw.mods.fml.common.IWorldGenerator; -import cpw.mods.fml.common.registry.GameRegistry; - -public class OreGenerator implements IWorldGenerator -{ - public static boolean isInitiated = false; - - /** - * Add your ore data to this list of ores for it to automatically generate! No hassle indeed! - */ - private static final List ORES_TO_GENERATE = new ArrayList(); - - /** - * Adds an ore to the ore generate list. Do this in pre-init. - */ - public static void addOre(OreGenBase data) - { - if (!isInitiated) - { - GameRegistry.registerWorldGenerator(new OreGenerator()); - } - - ORES_TO_GENERATE.add(data); - } - - /** - * Checks to see if this ore - * - * @param oreName - * @return - */ - public static boolean oreExists(String oreName) - { - for (OreGenBase ore : ORES_TO_GENERATE) - { - if (ore.oreDictionaryName == oreName) { return true; } - } - - return false; - } - - /** - * Removes an ore to the ore generate list. Do this in init. - */ - public static void removeOre(OreGenBase data) - { - ORES_TO_GENERATE.remove(data); - } - - @Override - public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) - { - chunkX = chunkX << 4; - chunkZ = chunkZ << 4; - - // Checks to make sure this is the normal - // world - for (OreGenBase oreData : ORES_TO_GENERATE) - { - if (oreData.shouldGenerate && oreData.isOreGeneratedInWorld(world, chunkGenerator)) - { - oreData.generate(world, rand, chunkX, chunkZ); - } - - } - } -} diff --git a/src/common/universalelectricity/prefab/potion/CustomPotion.java b/src/common/universalelectricity/prefab/potion/CustomPotion.java deleted file mode 100644 index fc13deb97..000000000 --- a/src/common/universalelectricity/prefab/potion/CustomPotion.java +++ /dev/null @@ -1,41 +0,0 @@ -package universalelectricity.prefab.potion; - -import net.minecraft.src.Potion; -import cpw.mods.fml.common.registry.LanguageRegistry; - -public abstract class CustomPotion extends Potion -{ - /** - * Creates a new type of potion - * - * @param id - * - The ID of this potion. Make it greater than 20. - * @param isBadEffect - * - Is this potion a good potion or a bad one? - * @param color - * - The color of this potion. - * @param name - * - The name of this potion. - */ - public CustomPotion(int id, boolean isBadEffect, int color, String name) - { - super(id, isBadEffect, color); - this.setPotionName("potion." + name); - LanguageRegistry.instance().addStringLocalization(this.getName(), name); - } - - @Override - public Potion setIconIndex(int par1, int par2) - { - super.setIconIndex(par1, par2); - return this; - } - - /** - * You must register all your potion effects during mod initialization! - */ - public void register() - { - Potion.potionTypes[this.getId()] = this; - } -} diff --git a/src/common/universalelectricity/prefab/potion/CustomPotionEffect.java b/src/common/universalelectricity/prefab/potion/CustomPotionEffect.java deleted file mode 100644 index fedd88ccc..000000000 --- a/src/common/universalelectricity/prefab/potion/CustomPotionEffect.java +++ /dev/null @@ -1,41 +0,0 @@ -package universalelectricity.prefab.potion; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.src.ItemStack; -import net.minecraft.src.Potion; -import net.minecraft.src.PotionEffect; - -public class CustomPotionEffect extends PotionEffect -{ - public CustomPotionEffect(int potionID, int duration, int amplifier) - { - super(potionID, duration, amplifier); - } - - public CustomPotionEffect(Potion potion, int duration, int amplifier) - { - this(potion.getId(), duration, amplifier); - } - - /** - * Creates a potion effect with custom curable items. - * - * @param curativeItems - * - ItemStacks that can cure this potion effect - */ - public CustomPotionEffect(int potionID, int duration, int amplifier, List curativeItems) - { - super(potionID, duration, amplifier); - - if (curativeItems == null) - { - this.setCurativeItems(new ArrayList()); - } - else - { - this.setCurativeItems(curativeItems); - } - } -} diff --git a/src/common/universalelectricity/prefab/tile/TileEntityAdvanced.java b/src/common/universalelectricity/prefab/tile/TileEntityAdvanced.java deleted file mode 100644 index c005fa532..000000000 --- a/src/common/universalelectricity/prefab/tile/TileEntityAdvanced.java +++ /dev/null @@ -1,60 +0,0 @@ -package universalelectricity.prefab.tile; - -import net.minecraft.src.Block; -import net.minecraft.src.TileEntity; - -/** - * A TileEntity with some pre-added functionalities. - * - * @author Calclavia - * - */ -public abstract class TileEntityAdvanced extends TileEntity -{ - protected long ticks = 0; - - @Override - public void updateEntity() - { - if (this.ticks == 0) - { - this.initiate(); - } - - if (this.ticks >= Long.MAX_VALUE) - { - this.ticks = 1; - } - - this.ticks++; - } - - /** - * Called on the TileEntity's first tick. - */ - protected void initiate() - { - } - - @Override - public int getBlockMetadata() - { - if (this.blockMetadata == -1) - { - this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); - } - - return this.blockMetadata; - } - - @Override - public Block getBlockType() - { - if (this.blockType == null) - { - this.blockType = Block.blocksList[this.worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord)]; - } - - return this.blockType; - } -} diff --git a/src/common/universalelectricity/prefab/tile/TileEntityConductor.java b/src/common/universalelectricity/prefab/tile/TileEntityConductor.java deleted file mode 100644 index 3d33dfc49..000000000 --- a/src/common/universalelectricity/prefab/tile/TileEntityConductor.java +++ /dev/null @@ -1,167 +0,0 @@ -package universalelectricity.prefab.tile; - -import net.minecraft.src.EntityPlayer; -import net.minecraft.src.INetworkManager; -import net.minecraft.src.Packet250CustomPayload; -import net.minecraft.src.TileEntity; -import net.minecraft.src.World; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.electricity.ElectricityManager; -import universalelectricity.core.electricity.ElectricityNetwork; -import universalelectricity.core.implement.IConductor; -import universalelectricity.core.implement.IConnector; -import universalelectricity.core.vector.Vector3; -import universalelectricity.prefab.network.IPacketReceiver; - -import com.google.common.io.ByteArrayDataInput; - -/** - * This tile entity pre-fabricated for all conductors. - * - * @author Calclavia - * - */ -public abstract class TileEntityConductor extends TileEntityAdvanced implements IConductor, IPacketReceiver -{ - private ElectricityNetwork network; - - /** - * Stores information on the blocks that this conductor is connected to - */ - public TileEntity[] connectedBlocks = - { null, null, null, null, null, null }; - - public TileEntityConductor() - { - this.reset(); - } - - @Override - public ElectricityNetwork getNetwork() - { - return this.network; - } - - @Override - public void setNetwork(ElectricityNetwork network) - { - this.network = network; - } - - @Override - public TileEntity[] getConnectedBlocks() - { - return connectedBlocks; - } - - @Override - public void initiate() - { - this.refreshConnectedBlocks(); - } - - @Override - public void updateConnection(TileEntity tileEntity, ForgeDirection side) - { - if (tileEntity != null) - { - if (tileEntity instanceof IConnector) - { - this.connectedBlocks[side.ordinal()] = tileEntity; - - if (tileEntity.getClass() == this.getClass()) - { - ElectricityManager.instance.mergeConnection(this.getNetwork(), ((TileEntityConductor) tileEntity).getNetwork()); - } - - return; - } - } - - if (this.connectedBlocks[side.ordinal()] != null) - { - if (this.connectedBlocks[side.ordinal()] instanceof IConductor) - { - ElectricityManager.instance.splitConnection(this, (IConductor) this.getConnectedBlocks()[side.ordinal()]); - } - } - - this.connectedBlocks[side.ordinal()] = null; - } - - @Override - public void updateConnectionWithoutSplit(TileEntity tileEntity, ForgeDirection side) - { - if (tileEntity != null) - { - if (tileEntity instanceof IConnector) - { - this.connectedBlocks[side.ordinal()] = tileEntity; - - if (tileEntity.getClass() == this.getClass()) - { - ElectricityManager.instance.mergeConnection(this.getNetwork(), ((TileEntityConductor) tileEntity).getNetwork()); - } - - return; - } - } - - this.connectedBlocks[side.ordinal()] = null; - } - - @Override - public void handlePacketData(INetworkManager network, int type, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) - { - if (this.worldObj.isRemote) - { - this.refreshConnectedBlocks(); - } - } - - /** - * Determines if this TileEntity requires update calls. - * - * @return True if you want updateEntity() to be called, false if not - */ - @Override - public boolean canUpdate() - { - return false; - } - - @Override - public void reset() - { - this.network = null; - - if (ElectricityManager.instance != null) - { - ElectricityManager.instance.registerConductor(this); - } - } - - @Override - public void refreshConnectedBlocks() - { - if (this.worldObj != null) - { - for (byte i = 0; i < 6; i++) - { - this.updateConnection(Vector3.getConnectorFromSide(this.worldObj, Vector3.get(this), ForgeDirection.getOrientation(i)), ForgeDirection.getOrientation(i)); - } - } - } - - @Override - public World getWorld() - { - return this.worldObj; - } - - @Override - public boolean canConnect(ForgeDirection side) - { - return true; - } -} diff --git a/src/common/universalelectricity/prefab/tile/TileEntityDisableable.java b/src/common/universalelectricity/prefab/tile/TileEntityDisableable.java deleted file mode 100644 index 8554ae532..000000000 --- a/src/common/universalelectricity/prefab/tile/TileEntityDisableable.java +++ /dev/null @@ -1,46 +0,0 @@ -package universalelectricity.prefab.tile; - -import universalelectricity.core.implement.IDisableable; - -/** - * An easier way to implement the methods from IElectricityDisableable with default values set. - * - * @author Calclavia - */ -public abstract class TileEntityDisableable extends TileEntityAdvanced implements IDisableable -{ - protected int disabledTicks = 0; - - @Override - public void updateEntity() - { - super.updateEntity(); - - if (this.disabledTicks > 0) - { - this.disabledTicks--; - this.whileDisable(); - return; - } - } - - /** - * Called every tick while this tile entity is disabled. - */ - protected void whileDisable() - { - - } - - @Override - public void onDisable(int duration) - { - this.disabledTicks = duration; - } - - @Override - public boolean isDisabled() - { - return this.disabledTicks > 0; - } -} diff --git a/src/common/universalelectricity/prefab/tile/TileEntityElectricityReceiver.java b/src/common/universalelectricity/prefab/tile/TileEntityElectricityReceiver.java deleted file mode 100644 index 38e422755..000000000 --- a/src/common/universalelectricity/prefab/tile/TileEntityElectricityReceiver.java +++ /dev/null @@ -1,35 +0,0 @@ -package universalelectricity.prefab.tile; - -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.implement.IElectricityReceiver; - -/** - * An easier way to implement the methods from IElectricityReceiver with default values set. - * - * @author Calclavia - */ -public abstract class TileEntityElectricityReceiver extends TileEntityDisableable implements IElectricityReceiver -{ - public TileEntityElectricityReceiver() - { - super(); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - } - - @Override - public boolean canConnect(ForgeDirection side) - { - return this.canReceiveFromSide(side); - } - - @Override - public double getVoltage() - { - return 120; - } -} diff --git a/src/minecraft/mekanism/client/ClientProxy.java b/src/minecraft/mekanism/client/ClientProxy.java index dab566afd..50c56dd31 100644 --- a/src/minecraft/mekanism/client/ClientProxy.java +++ b/src/minecraft/mekanism/client/ClientProxy.java @@ -26,7 +26,7 @@ import mekanism.common.TileEntityElectricMachine; import mekanism.common.TileEntityEnrichmentChamber; import mekanism.common.TileEntityGasTank; import mekanism.common.TileEntityPlatinumCompressor; -import mekanism.common.TileEntityPowerUnit; +import mekanism.common.TileEntityEnergyCube; import mekanism.common.TileEntityTheoreticalElementizer; import net.minecraft.client.Minecraft; import net.minecraft.src.*; @@ -39,6 +39,8 @@ import net.minecraftforge.client.MinecraftForgeClient; */ public class ClientProxy extends CommonProxy { + public static int RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + @Override public int getArmorIndex(String string) { @@ -48,8 +50,6 @@ public class ClientProxy extends CommonProxy @Override public void registerRenderInformation() { - System.out.println("[Mekanism] Beginning render initiative..."); - //Preload block/item textures MinecraftForgeClient.preloadTexture("/resources/mekanism/textures/items.png"); MinecraftForgeClient.preloadTexture("/resources/mekanism/textures/terrain.png"); @@ -75,7 +75,10 @@ public class ClientProxy extends CommonProxy //Register entity rendering handlers RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new RenderObsidianTNT()); - System.out.println("[Mekanism] Render initiative complete."); + //Register item handler + MinecraftForgeClient.registerItemRenderer(Mekanism.energyCubeID, new ItemRenderingHandler()); + + System.out.println("[Mekanism] Render registrations complete."); } @Override @@ -116,7 +119,7 @@ public class ClientProxy extends CommonProxy case 7: return new GuiTheoreticalElementizer(player.inventory, (TileEntityTheoreticalElementizer)tileEntity); case 8: - return new GuiPowerUnit(player.inventory, (TileEntityPowerUnit)tileEntity); + return new GuiEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity); case 9: return new GuiControlPanel((TileEntityControlPanel)tileEntity, player, world); case 10: diff --git a/src/minecraft/mekanism/client/GuiPowerUnit.java b/src/minecraft/mekanism/client/GuiEnergyCube.java similarity index 76% rename from src/minecraft/mekanism/client/GuiPowerUnit.java rename to src/minecraft/mekanism/client/GuiEnergyCube.java index f517564f9..6cbe676d3 100644 --- a/src/minecraft/mekanism/client/GuiPowerUnit.java +++ b/src/minecraft/mekanism/client/GuiEnergyCube.java @@ -5,30 +5,30 @@ import org.lwjgl.opengl.GL11; import universalelectricity.core.electricity.ElectricInfo; import universalelectricity.core.electricity.ElectricInfo.ElectricUnit; -import mekanism.common.ContainerPowerUnit; +import mekanism.common.ContainerEnergyCube; import mekanism.common.MekanismUtils; -import mekanism.common.TileEntityPowerUnit; +import mekanism.common.TileEntityEnergyCube; import net.minecraft.src.*; -public class GuiPowerUnit extends GuiContainer +public class GuiEnergyCube extends GuiContainer { - private TileEntityPowerUnit tileEntity; + private TileEntityEnergyCube tileEntity; private int guiWidth; private int guiHeight; - public GuiPowerUnit(InventoryPlayer inventory, TileEntityPowerUnit tentity) + public GuiEnergyCube(InventoryPlayer inventory, TileEntityEnergyCube tentity) { - super(new ContainerPowerUnit(inventory, tentity)); + super(new ContainerEnergyCube(inventory, tentity)); tileEntity = tentity; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String capacityInfo = ElectricInfo.getDisplayShort(tileEntity.electricityStored, ElectricUnit.JOULES) + "/" + ElectricInfo.getDisplayShort(tileEntity.MAX_ELECTRICITY, ElectricUnit.JOULES); + String capacityInfo = ElectricInfo.getDisplayShort(tileEntity.electricityStored, ElectricUnit.JOULES) + "/" + ElectricInfo.getDisplayShort(tileEntity.tier.MAX_ELECTRICITY, ElectricUnit.JOULES); String outputInfo = "Out: " + tileEntity.output + "w"; - fontRenderer.drawString(tileEntity.getInvName(), 43, 6, 0x404040); + fontRenderer.drawString(tileEntity.tier.name + " Energy Cube", 43, 6, 0x404040); fontRenderer.drawString(capacityInfo, 45, 40, 0x404040); fontRenderer.drawString(outputInfo, 45, 49, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 0x404040); diff --git a/src/minecraft/mekanism/client/ItemRenderingHandler.java b/src/minecraft/mekanism/client/ItemRenderingHandler.java new file mode 100644 index 000000000..7596e6ed7 --- /dev/null +++ b/src/minecraft/mekanism/client/ItemRenderingHandler.java @@ -0,0 +1,93 @@ +package mekanism.client; + +import java.util.Random; + +import org.lwjgl.opengl.GL11; + +import mekanism.api.IEnergyCube; +import mekanism.api.IEnergyCube.EnumTier; +import mekanism.common.Mekanism; +import net.minecraft.src.*; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; + +public class ItemRenderingHandler implements IItemRenderer +{ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + EnumTier tier = ((IEnergyCube)item.getItem()).getTier(item); + + ForgeHooksClient.bindTexture(item.getItem().getTextureFile(), 0); + + if(type == ItemRenderType.EQUIPPED) + { + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + renderItem((RenderBlocks)data[0], tier == EnumTier.BASIC ? 0 : (tier == EnumTier.ADVANCED ? 1 : (tier == EnumTier.ULTIMATE ? 2 : 0))); + } + + /** + * Cleaned-up snip of RenderBlocks.renderBlockAsItem() -- used for rendering an item as an entity, + * in a player's inventory, and in a player's hand. + * @param renderer - RenderBlocks renderer to render the item with + * @param metadata - block/item metadata + * @param block - block to render + */ + public void renderItem(RenderBlocks renderer, int metadata) + { + Block block = Block.blocksList[Mekanism.energyCubeID]; + renderer.func_83018_a(block); + block.setBlockBoundsForItemRender(); + + if (renderer.useInventoryTint) + { + int renderColor = block.getRenderColor(metadata); + float red = (float)(renderColor >> 16 & 255) / 255.0F; + float green = (float)(renderColor >> 8 & 255) / 255.0F; + float blue = (float)(renderColor & 255) / 255.0F; + GL11.glColor4f(red, green, blue, 1.0F); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, metadata)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } +} diff --git a/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java b/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java index b46acd69b..11546bf13 100644 --- a/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java +++ b/src/minecraft/mekanism/generators/client/BlockRenderingHandler.java @@ -1,10 +1,10 @@ package mekanism.generators.client; - import org.lwjgl.opengl.GL11; import mekanism.common.Mekanism; import mekanism.generators.common.MekanismGenerators; +import mekanism.generators.common.BlockGenerator.GeneratorType; import net.minecraft.src.Block; import net.minecraft.src.IBlockAccess; import net.minecraft.src.ItemStack; @@ -24,27 +24,28 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { GL11.glPushMatrix(); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); if(block.blockID == MekanismGenerators.generatorID) { - switch(metadata) - { - case 4: - GL11.glTranslated(0.0F, -1.1F, 0.0F); - GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/resources/mekanism/render/BioGenerator.png")); - bioGenerator.render(0.0625F); - break; - case 5: - GL11.glTranslatef(0.0F, 0.3F, 0.0F); - GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/resources/mekanism/render/AdvancedSolarGenerator.png")); - solarGenerator.render(0.0F, 0.024F); - break; - default: - ForgeHooksClient.bindTexture(block.getTextureFile(), 0); - renderItem(renderer, metadata, block); - break; - } + if(metadata == 4) + { + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glTranslated(0.0F, -1.1F, 0.0F); + GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/resources/mekanism/render/BioGenerator.png")); + bioGenerator.render(0.0625F); + } + else if(metadata == 5) + { + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, 0.3F, 0.0F); + GL11.glBindTexture(3553, FMLClientHandler.instance().getClient().renderEngine.getTexture("/resources/mekanism/render/AdvancedSolarGenerator.png")); + solarGenerator.render(0.0F, 0.024F); + } + else { + ForgeHooksClient.bindTexture(block.getTextureFile(), 0); + renderItem(renderer, metadata, block); + } } GL11.glPopMatrix(); @@ -55,9 +56,14 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler { if(block.blockID == MekanismGenerators.generatorID) { - renderer.renderStandardBlock(block, x, y, z); - renderer.func_83018_a(block); - return true; + int metadata = world.getBlockMetadata(x, y, z); + + if(metadata != 4 && metadata != 5) + { + renderer.renderStandardBlock(block, x, y, z); + renderer.func_83018_a(block); + return true; + } } return false; @@ -75,9 +81,16 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler return GeneratorsClientProxy.RENDER_ID; } + /** + * Cleaned-up snip of RenderBlocks.renderBlockAsItem() -- used for rendering an item as an entity, + * in a player's inventory, and in a player's hand. + * @param renderer - RenderBlocks renderer to render the item with + * @param metadata - block/item metadata + * @param block - block to render + */ public void renderItem(RenderBlocks renderer, int metadata, Block block) { - block.setBlockBoundsForItemRender(); + block.setBlockBoundsForItemRender(); if (renderer.useInventoryTint) { @@ -92,11 +105,11 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); - renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata)); + renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata)); + renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); @@ -104,11 +117,11 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata)); + renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); - renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata)); + renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); diff --git a/src/minecraft/mekanism/generators/client/GeneratorsClientProxy.java b/src/minecraft/mekanism/generators/client/GeneratorsClientProxy.java index f733fc788..ee0e8cc2d 100644 --- a/src/minecraft/mekanism/generators/client/GeneratorsClientProxy.java +++ b/src/minecraft/mekanism/generators/client/GeneratorsClientProxy.java @@ -30,8 +30,6 @@ public class GeneratorsClientProxy extends GeneratorsCommonProxy @Override public void registerRenderInformation() { - System.out.println("[MekanismGenerators] Beginning render initiative..."); - //Preload block/item textures MinecraftForgeClient.preloadTexture("/resources/mekanism/textures/generators/items.png"); MinecraftForgeClient.preloadTexture("/resources/mekanism/textures/generators/terrain.png"); @@ -51,7 +49,7 @@ public class GeneratorsClientProxy extends GeneratorsCommonProxy //Register block handler RenderingRegistry.registerBlockHandler(new BlockRenderingHandler()); - System.out.println("[MekanismGenerators] Render initiative complete."); + System.out.println("[MekanismGenerators] Render registrations complete."); } @Override diff --git a/src/minecraft/mekanism/tools/client/ToolsClientProxy.java b/src/minecraft/mekanism/tools/client/ToolsClientProxy.java index 23b6d16bb..0a57f0e56 100644 --- a/src/minecraft/mekanism/tools/client/ToolsClientProxy.java +++ b/src/minecraft/mekanism/tools/client/ToolsClientProxy.java @@ -11,23 +11,15 @@ import mekanism.tools.common.EntityKnife; public class ToolsClientProxy extends ToolsCommonProxy { - @Override - public int getArmorIndex(String string) - { - return RenderingRegistry.addNewArmourRendererPrefix(string); - } - @Override public void registerRenderInformation() { - System.out.println("[Mekanism] Beginning render initiative..."); - //Preload block/item textures MinecraftForgeClient.preloadTexture("/resources/mekanism/textures/tools/items.png"); //Register entity rendering handlers RenderingRegistry.registerEntityRenderingHandler(EntityKnife.class, new RenderKnife()); - System.out.println("[MekanismTools] Render initiative complete."); + System.out.println("[MekanismTools] Render registrations complete."); } }