From 7604c9aff09bf926226c56c691672e3d82b3c981 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Fri, 9 Dec 2022 23:00:14 +0100 Subject: [PATCH] init --- .../cofh/api/energy/IEnergyConnection.class | Bin 0 -> 211 bytes .../cofh/api/energy/IEnergyProvider.class | Bin 0 -> 355 bytes .../cofh/api/energy/IEnergyReceiver.class | Bin 0 -> 355 bytes bin/main/cofh/api/energy/IEnergyStorage.class | Bin 0 -> 242 bytes .../api/CompatibilityModule.class | Bin 0 -> 5449 bytes .../api/CompatibilityType.class | Bin 0 -> 2352 bytes .../api/electricity/IElectricalNetwork.class | Bin 0 -> 235 bytes .../api/electricity/IVoltageInput.class | Bin 0 -> 302 bytes .../api/electricity/IVoltageOutput.class | Bin 0 -> 226 bytes .../api/energy/EnergyNetworkLoader.class | Bin 0 -> 2700 bytes .../api/energy/EnergyStorageHandler.class | Bin 0 -> 5209 bytes .../api/energy/IConductor.class | Bin 0 -> 477 bytes .../api/energy/IEnergyContainer.class | Bin 0 -> 320 bytes .../api/energy/IEnergyInterface.class | Bin 0 -> 301 bytes .../api/energy/IEnergyNetwork.class | Bin 0 -> 853 bytes .../api/energy/UnitDisplay$Unit.class | Bin 0 -> 2588 bytes .../api/energy/UnitDisplay$UnitPrefix.class | Bin 0 -> 2740 bytes .../api/energy/UnitDisplay.class | Bin 0 -> 3615 bytes .../api/item/IEnergyItem.class | Bin 0 -> 351 bytes .../api/item/IVoltageItem.class | Bin 0 -> 192 bytes .../api/item/ItemElectric.class | Bin 0 -> 4771 bytes .../api/net/IConnectable.class | Bin 0 -> 226 bytes .../api/net/IConnector.class | Bin 0 -> 687 bytes .../api/net/INetwork.class | Bin 0 -> 739 bytes .../api/net/INetworkProvider.class | Bin 0 -> 327 bytes .../api/net/INodeNetwork.class | Bin 0 -> 451 bytes .../api/net/IUpdate.class | Bin 0 -> 198 bytes .../net/NetworkEvent$EnergyProduceEvent.class | Bin 0 -> 891 bytes .../net/NetworkEvent$EnergyUpdateEvent.class | Bin 0 -> 643 bytes .../api/net/NetworkEvent.class | Bin 0 -> 708 bytes .../compat/CompatHandler.class | Bin 0 -> 2952 bytes .../compat/CompatTickHandler.class | Bin 0 -> 1047 bytes .../compat/ic2/IC2CompatModule.class | Bin 0 -> 6921 bytes bin/main/universalelectricity/core/Pair.class | Bin 0 -> 1388 bytes .../core/UniversalElectricity.class | Bin 0 -> 2810 bytes .../core/block/IConductor.class | Bin 0 -> 1092 bytes .../core/block/IConnectionProvider.class | Bin 0 -> 319 bytes .../core/block/IConnector.class | Bin 0 -> 701 bytes .../core/block/IElectricityStorage.class | Bin 0 -> 1190 bytes .../core/block/INetworkProvider.class | Bin 0 -> 347 bytes .../core/block/ISelfDriven.class | Bin 0 -> 135 bytes .../core/block/IVoltage.class | Bin 0 -> 156 bytes .../core/electricity/ElectricityNetwork.class | Bin 0 -> 12928 bytes .../ElectricityNetworkHelper.class | Bin 0 -> 7114 bytes .../core/electricity/ElectricityPack.class | Bin 0 -> 3053 bytes .../core/electricity/IConductorRegistry.class | Bin 0 -> 331 bytes .../electricity/IElectricityNetwork.class | Bin 0 -> 1911 bytes .../core/item/ElectricItemHelper.class | Bin 0 -> 3009 bytes .../core/item/IItemElectric.class | Bin 0 -> 582 bytes .../core/item/IItemElectricityStorage.class | Bin 0 -> 294 bytes .../core/item/IItemVoltage.class | Bin 0 -> 186 bytes .../core/item/ItemElectric.class | Bin 0 -> 4887 bytes .../core/path/IPathCallBack.class | Bin 0 -> 381 bytes .../core/path/Pathfinder.class | Bin 0 -> 1901 bytes .../core/path/PathfinderAStar.class | Bin 0 -> 4203 bytes .../core/path/PathfinderChecker$1.class | Bin 0 -> 2977 bytes .../core/path/PathfinderChecker$2.class | Bin 0 -> 2905 bytes .../core/path/PathfinderChecker.class | Bin 0 -> 1517 bytes .../core/vector/Vector2.class | Bin 0 -> 3222 bytes .../core/vector/Vector3.class | Bin 0 -> 10101 bytes .../core/vector/VectorHelper.class | Bin 0 -> 2367 bytes .../prefab/CustomDamageSource.class | Bin 0 -> 1490 bytes .../universalelectricity/prefab/GuiBase.class | Bin 0 -> 4134 bytes .../prefab/RecipeHelper.class | Bin 0 -> 4148 bytes .../prefab/SlotSpecific.class | Bin 0 -> 2570 bytes .../prefab/TranslationHelper.class | Bin 0 -> 2212 bytes .../prefab/block/BlockAdvanced.class | Bin 0 -> 6396 bytes .../prefab/block/BlockConductor.class | Bin 0 -> 1351 bytes .../prefab/block/BlockRotatable.class | Bin 0 -> 2576 bytes .../prefab/flag/CommandFlag.class | Bin 0 -> 8522 bytes .../prefab/flag/Flag.class | Bin 0 -> 1235 bytes .../prefab/flag/FlagBase.class | Bin 0 -> 958 bytes .../prefab/flag/FlagRegion.class | Bin 0 -> 5383 bytes .../prefab/flag/FlagRegistry.class | Bin 0 -> 1587 bytes .../prefab/flag/FlagWorld.class | Bin 0 -> 5721 bytes .../prefab/flag/ModFlag.class | Bin 0 -> 3980 bytes .../prefab/flag/NBTFileLoader.class | Bin 0 -> 3836 bytes .../prefab/implement/IDisableable.class | Bin 0 -> 197 bytes .../prefab/implement/IRedstoneProvider.class | Bin 0 -> 262 bytes .../prefab/implement/IRedstoneReceptor.class | Bin 0 -> 200 bytes .../prefab/implement/IRotatable.class | Bin 0 -> 357 bytes .../prefab/implement/ITier.class | Bin 0 -> 178 bytes .../prefab/implement/IToolConfigurator.class | Bin 0 -> 296 bytes .../prefab/modifier/IModifier.class | Bin 0 -> 324 bytes .../prefab/modifier/SlotModifier.class | Bin 0 -> 825 bytes .../prefab/multiblock/BlockMulti.class | Bin 0 -> 4965 bytes .../prefab/multiblock/IBlockActivate.class | Bin 0 -> 218 bytes .../prefab/multiblock/IMultiBlock.class | Bin 0 -> 333 bytes .../prefab/multiblock/TileEntityMulti.class | Bin 0 -> 3629 bytes .../prefab/ore/OreGenBase.class | Bin 0 -> 2789 bytes .../prefab/ore/OreGenReplace.class | Bin 0 -> 4701 bytes .../prefab/ore/OreGenReplaceStone.class | Bin 0 -> 1206 bytes .../prefab/ore/OreGenerator.class | Bin 0 -> 2340 bytes .../prefab/potion/CustomPotion.class | Bin 0 -> 1177 bytes .../prefab/potion/CustomPotionEffect.class | Bin 0 -> 1218 bytes .../prefab/tile/ElectricTileDriver.class | Bin 0 -> 6450 bytes .../prefab/tile/TileEntityAdvanced.class | Bin 0 -> 1236 bytes .../prefab/tile/TileEntityConductor.class | Bin 0 -> 6008 bytes .../prefab/tile/TileEntityDisableable.class | Bin 0 -> 929 bytes .../prefab/tile/TileEntityElectrical.class | Bin 0 -> 792 bytes .../tile/TileEntityElectricityRunnable.class | Bin 0 -> 2572 bytes .../tile/TileEntityElectricityStorage.class | Bin 0 -> 3851 bytes .../prefab/vector/Region2.class | Bin 0 -> 1152 bytes .../prefab/vector/Region3.class | Bin 0 -> 4963 bytes build.gradle | 43 ++- .../cofh/api/energy/IEnergyConnection.java | 8 + .../java/cofh/api/energy/IEnergyProvider.java | 12 + .../java/cofh/api/energy/IEnergyReceiver.java | 12 + .../java/cofh/api/energy/IEnergyStorage.java | 13 + .../api/CompatibilityModule.java | 326 ++++++++++++++++ .../api/CompatibilityType.java | 82 ++++ .../api/electricity/IElectricalNetwork.java | 18 + .../api/electricity/IVoltageInput.java | 18 + .../api/electricity/IVoltageOutput.java | 20 + .../api/energy/EnergyNetworkLoader.java | 69 ++++ .../api/energy/EnergyStorageHandler.java | 268 +++++++++++++ .../api/energy/IConductor.java | 27 ++ .../api/energy/IEnergyContainer.java | 28 ++ .../api/energy/IEnergyInterface.java | 37 ++ .../api/energy/IEnergyNetwork.java | 67 ++++ .../api/energy/UnitDisplay.java | 217 +++++++++++ .../api/item/IEnergyItem.java | 47 +++ .../api/item/IVoltageItem.java | 15 + .../api/item/ItemElectric.java | 155 ++++++++ .../api/net/IConnectable.java | 19 + .../api/net/IConnector.java | 29 ++ .../api/net/INetwork.java | 50 +++ .../api/net/INetworkProvider.java | 14 + .../api/net/INodeNetwork.java | 22 ++ .../universalelectricity/api/net/IUpdate.java | 22 ++ .../api/net/NetworkEvent.java | 52 +++ .../compat/CompatHandler.java | 42 ++ .../compat/CompatTickHandler.java | 16 + .../compat/ic2/IC2CompatModule.java | 242 ++++++++++++ .../java/universalelectricity/core/Pair.java | 34 ++ .../core/UniversalElectricity.java | 42 ++ .../core/block/IConductor.java | 17 + .../core/block/IConnectionProvider.java | 11 + .../core/block/IConnector.java | 17 + .../core/block/IElectricityStorage.java | 42 ++ .../core/block/INetworkProvider.java | 7 + .../core/block/ISelfDriven.java | 5 + .../core/block/IVoltage.java | 7 + .../core/electricity/ElectricityNetwork.java | 365 ++++++++++++++++++ .../electricity/ElectricityNetworkHelper.java | 151 ++++++++ .../core/electricity/ElectricityPack.java | 102 +++++ .../core/electricity/IConductorRegistry.java | 15 + .../core/electricity/IElectricityNetwork.java | 59 +++ .../core/item/ElectricItemHelper.java | 67 ++++ .../core/item/IItemElectric.java | 17 + .../core/item/IItemElectricityStorage.java | 12 + .../core/item/IItemVoltage.java | 7 + .../core/item/ItemElectric.java | 93 +++++ .../core/path/IPathCallBack.java | 12 + .../core/path/Pathfinder.java | 51 +++ .../core/path/PathfinderAStar.java | 112 ++++++ .../core/path/PathfinderChecker.java | 71 ++++ .../core/vector/Vector2.java | 101 +++++ .../core/vector/Vector3.java | 286 ++++++++++++++ .../core/vector/VectorHelper.java | 27 ++ .../prefab/CustomDamageSource.java | 32 ++ .../universalelectricity/prefab/GuiBase.java | 131 +++++++ .../prefab/RecipeHelper.java | 131 +++++++ .../prefab/SlotSpecific.java | 74 ++++ .../prefab/TranslationHelper.java | 49 +++ .../prefab/block/BlockAdvanced.java | 149 +++++++ .../prefab/block/BlockConductor.java | 34 ++ .../prefab/block/BlockRotatable.java | 52 +++ .../prefab/flag/CommandFlag.java | 226 +++++++++++ .../prefab/flag/Flag.java | 31 ++ .../prefab/flag/FlagBase.java | 23 ++ .../prefab/flag/FlagRegion.java | 130 +++++++ .../prefab/flag/FlagRegistry.java | 37 ++ .../prefab/flag/FlagWorld.java | 164 ++++++++ .../prefab/flag/ModFlag.java | 84 ++++ .../prefab/flag/NBTFileLoader.java | 77 ++++ .../prefab/implement/IDisableable.java | 9 + .../prefab/implement/IRedstoneProvider.java | 10 + .../prefab/implement/IRedstoneReceptor.java | 9 + .../prefab/implement/IRotatable.java | 12 + .../prefab/implement/ITier.java | 9 + .../prefab/implement/IToolConfigurator.java | 10 + .../prefab/modifier/IModifier.java | 12 + .../prefab/modifier/SlotModifier.java | 16 + .../prefab/multiblock/BlockMulti.java | 117 ++++++ .../prefab/multiblock/IBlockActivate.java | 8 + .../prefab/multiblock/IMultiBlock.java | 12 + .../prefab/multiblock/TileEntityMulti.java | 91 +++++ .../prefab/ore/OreGenBase.java | 60 +++ .../prefab/ore/OreGenReplace.java | 99 +++++ .../prefab/ore/OreGenReplaceStone.java | 16 + .../prefab/ore/OreGenerator.java | 60 +++ .../prefab/potion/CustomPotion.java | 22 ++ .../prefab/potion/CustomPotionEffect.java | 29 ++ .../prefab/tile/ElectricTileDriver.java | 107 +++++ .../prefab/tile/TileEntityAdvanced.java | 42 ++ .../prefab/tile/TileEntityConductor.java | 143 +++++++ .../prefab/tile/TileEntityDisableable.java | 27 ++ .../prefab/tile/TileEntityElectrical.java | 19 + .../tile/TileEntityElectricityRunnable.java | 50 +++ .../tile/TileEntityElectricityStorage.java | 81 ++++ .../prefab/vector/Region2.java | 27 ++ .../prefab/vector/Region3.java | 94 +++++ 203 files changed, 6318 insertions(+), 17 deletions(-) create mode 100644 bin/main/cofh/api/energy/IEnergyConnection.class create mode 100644 bin/main/cofh/api/energy/IEnergyProvider.class create mode 100644 bin/main/cofh/api/energy/IEnergyReceiver.class create mode 100644 bin/main/cofh/api/energy/IEnergyStorage.class create mode 100644 bin/main/universalelectricity/api/CompatibilityModule.class create mode 100644 bin/main/universalelectricity/api/CompatibilityType.class create mode 100644 bin/main/universalelectricity/api/electricity/IElectricalNetwork.class create mode 100644 bin/main/universalelectricity/api/electricity/IVoltageInput.class create mode 100644 bin/main/universalelectricity/api/electricity/IVoltageOutput.class create mode 100644 bin/main/universalelectricity/api/energy/EnergyNetworkLoader.class create mode 100644 bin/main/universalelectricity/api/energy/EnergyStorageHandler.class create mode 100644 bin/main/universalelectricity/api/energy/IConductor.class create mode 100644 bin/main/universalelectricity/api/energy/IEnergyContainer.class create mode 100644 bin/main/universalelectricity/api/energy/IEnergyInterface.class create mode 100644 bin/main/universalelectricity/api/energy/IEnergyNetwork.class create mode 100644 bin/main/universalelectricity/api/energy/UnitDisplay$Unit.class create mode 100644 bin/main/universalelectricity/api/energy/UnitDisplay$UnitPrefix.class create mode 100644 bin/main/universalelectricity/api/energy/UnitDisplay.class create mode 100644 bin/main/universalelectricity/api/item/IEnergyItem.class create mode 100644 bin/main/universalelectricity/api/item/IVoltageItem.class create mode 100644 bin/main/universalelectricity/api/item/ItemElectric.class create mode 100644 bin/main/universalelectricity/api/net/IConnectable.class create mode 100644 bin/main/universalelectricity/api/net/IConnector.class create mode 100644 bin/main/universalelectricity/api/net/INetwork.class create mode 100644 bin/main/universalelectricity/api/net/INetworkProvider.class create mode 100644 bin/main/universalelectricity/api/net/INodeNetwork.class create mode 100644 bin/main/universalelectricity/api/net/IUpdate.class create mode 100644 bin/main/universalelectricity/api/net/NetworkEvent$EnergyProduceEvent.class create mode 100644 bin/main/universalelectricity/api/net/NetworkEvent$EnergyUpdateEvent.class create mode 100644 bin/main/universalelectricity/api/net/NetworkEvent.class create mode 100644 bin/main/universalelectricity/compat/CompatHandler.class create mode 100644 bin/main/universalelectricity/compat/CompatTickHandler.class create mode 100644 bin/main/universalelectricity/compat/ic2/IC2CompatModule.class create mode 100644 bin/main/universalelectricity/core/Pair.class create mode 100644 bin/main/universalelectricity/core/UniversalElectricity.class create mode 100644 bin/main/universalelectricity/core/block/IConductor.class create mode 100644 bin/main/universalelectricity/core/block/IConnectionProvider.class create mode 100644 bin/main/universalelectricity/core/block/IConnector.class create mode 100644 bin/main/universalelectricity/core/block/IElectricityStorage.class create mode 100644 bin/main/universalelectricity/core/block/INetworkProvider.class create mode 100644 bin/main/universalelectricity/core/block/ISelfDriven.class create mode 100644 bin/main/universalelectricity/core/block/IVoltage.class create mode 100644 bin/main/universalelectricity/core/electricity/ElectricityNetwork.class create mode 100644 bin/main/universalelectricity/core/electricity/ElectricityNetworkHelper.class create mode 100644 bin/main/universalelectricity/core/electricity/ElectricityPack.class create mode 100644 bin/main/universalelectricity/core/electricity/IConductorRegistry.class create mode 100644 bin/main/universalelectricity/core/electricity/IElectricityNetwork.class create mode 100644 bin/main/universalelectricity/core/item/ElectricItemHelper.class create mode 100644 bin/main/universalelectricity/core/item/IItemElectric.class create mode 100644 bin/main/universalelectricity/core/item/IItemElectricityStorage.class create mode 100644 bin/main/universalelectricity/core/item/IItemVoltage.class create mode 100644 bin/main/universalelectricity/core/item/ItemElectric.class create mode 100644 bin/main/universalelectricity/core/path/IPathCallBack.class create mode 100644 bin/main/universalelectricity/core/path/Pathfinder.class create mode 100644 bin/main/universalelectricity/core/path/PathfinderAStar.class create mode 100644 bin/main/universalelectricity/core/path/PathfinderChecker$1.class create mode 100644 bin/main/universalelectricity/core/path/PathfinderChecker$2.class create mode 100644 bin/main/universalelectricity/core/path/PathfinderChecker.class create mode 100644 bin/main/universalelectricity/core/vector/Vector2.class create mode 100644 bin/main/universalelectricity/core/vector/Vector3.class create mode 100644 bin/main/universalelectricity/core/vector/VectorHelper.class create mode 100644 bin/main/universalelectricity/prefab/CustomDamageSource.class create mode 100644 bin/main/universalelectricity/prefab/GuiBase.class create mode 100644 bin/main/universalelectricity/prefab/RecipeHelper.class create mode 100644 bin/main/universalelectricity/prefab/SlotSpecific.class create mode 100644 bin/main/universalelectricity/prefab/TranslationHelper.class create mode 100644 bin/main/universalelectricity/prefab/block/BlockAdvanced.class create mode 100644 bin/main/universalelectricity/prefab/block/BlockConductor.class create mode 100644 bin/main/universalelectricity/prefab/block/BlockRotatable.class create mode 100644 bin/main/universalelectricity/prefab/flag/CommandFlag.class create mode 100644 bin/main/universalelectricity/prefab/flag/Flag.class create mode 100644 bin/main/universalelectricity/prefab/flag/FlagBase.class create mode 100644 bin/main/universalelectricity/prefab/flag/FlagRegion.class create mode 100644 bin/main/universalelectricity/prefab/flag/FlagRegistry.class create mode 100644 bin/main/universalelectricity/prefab/flag/FlagWorld.class create mode 100644 bin/main/universalelectricity/prefab/flag/ModFlag.class create mode 100644 bin/main/universalelectricity/prefab/flag/NBTFileLoader.class create mode 100644 bin/main/universalelectricity/prefab/implement/IDisableable.class create mode 100644 bin/main/universalelectricity/prefab/implement/IRedstoneProvider.class create mode 100644 bin/main/universalelectricity/prefab/implement/IRedstoneReceptor.class create mode 100644 bin/main/universalelectricity/prefab/implement/IRotatable.class create mode 100644 bin/main/universalelectricity/prefab/implement/ITier.class create mode 100644 bin/main/universalelectricity/prefab/implement/IToolConfigurator.class create mode 100644 bin/main/universalelectricity/prefab/modifier/IModifier.class create mode 100644 bin/main/universalelectricity/prefab/modifier/SlotModifier.class create mode 100644 bin/main/universalelectricity/prefab/multiblock/BlockMulti.class create mode 100644 bin/main/universalelectricity/prefab/multiblock/IBlockActivate.class create mode 100644 bin/main/universalelectricity/prefab/multiblock/IMultiBlock.class create mode 100644 bin/main/universalelectricity/prefab/multiblock/TileEntityMulti.class create mode 100644 bin/main/universalelectricity/prefab/ore/OreGenBase.class create mode 100644 bin/main/universalelectricity/prefab/ore/OreGenReplace.class create mode 100644 bin/main/universalelectricity/prefab/ore/OreGenReplaceStone.class create mode 100644 bin/main/universalelectricity/prefab/ore/OreGenerator.class create mode 100644 bin/main/universalelectricity/prefab/potion/CustomPotion.class create mode 100644 bin/main/universalelectricity/prefab/potion/CustomPotionEffect.class create mode 100644 bin/main/universalelectricity/prefab/tile/ElectricTileDriver.class create mode 100644 bin/main/universalelectricity/prefab/tile/TileEntityAdvanced.class create mode 100644 bin/main/universalelectricity/prefab/tile/TileEntityConductor.class create mode 100644 bin/main/universalelectricity/prefab/tile/TileEntityDisableable.class create mode 100644 bin/main/universalelectricity/prefab/tile/TileEntityElectrical.class create mode 100644 bin/main/universalelectricity/prefab/tile/TileEntityElectricityRunnable.class create mode 100644 bin/main/universalelectricity/prefab/tile/TileEntityElectricityStorage.class create mode 100644 bin/main/universalelectricity/prefab/vector/Region2.class create mode 100644 bin/main/universalelectricity/prefab/vector/Region3.class create mode 100644 src/main/java/cofh/api/energy/IEnergyConnection.java create mode 100644 src/main/java/cofh/api/energy/IEnergyProvider.java create mode 100644 src/main/java/cofh/api/energy/IEnergyReceiver.java create mode 100644 src/main/java/cofh/api/energy/IEnergyStorage.java create mode 100644 src/main/java/universalelectricity/api/CompatibilityModule.java create mode 100644 src/main/java/universalelectricity/api/CompatibilityType.java create mode 100644 src/main/java/universalelectricity/api/electricity/IElectricalNetwork.java create mode 100644 src/main/java/universalelectricity/api/electricity/IVoltageInput.java create mode 100644 src/main/java/universalelectricity/api/electricity/IVoltageOutput.java create mode 100644 src/main/java/universalelectricity/api/energy/EnergyNetworkLoader.java create mode 100644 src/main/java/universalelectricity/api/energy/EnergyStorageHandler.java create mode 100644 src/main/java/universalelectricity/api/energy/IConductor.java create mode 100644 src/main/java/universalelectricity/api/energy/IEnergyContainer.java create mode 100644 src/main/java/universalelectricity/api/energy/IEnergyInterface.java create mode 100644 src/main/java/universalelectricity/api/energy/IEnergyNetwork.java create mode 100644 src/main/java/universalelectricity/api/energy/UnitDisplay.java create mode 100644 src/main/java/universalelectricity/api/item/IEnergyItem.java create mode 100644 src/main/java/universalelectricity/api/item/IVoltageItem.java create mode 100644 src/main/java/universalelectricity/api/item/ItemElectric.java create mode 100644 src/main/java/universalelectricity/api/net/IConnectable.java create mode 100644 src/main/java/universalelectricity/api/net/IConnector.java create mode 100644 src/main/java/universalelectricity/api/net/INetwork.java create mode 100644 src/main/java/universalelectricity/api/net/INetworkProvider.java create mode 100644 src/main/java/universalelectricity/api/net/INodeNetwork.java create mode 100644 src/main/java/universalelectricity/api/net/IUpdate.java create mode 100644 src/main/java/universalelectricity/api/net/NetworkEvent.java create mode 100644 src/main/java/universalelectricity/compat/CompatHandler.java create mode 100644 src/main/java/universalelectricity/compat/CompatTickHandler.java create mode 100644 src/main/java/universalelectricity/compat/ic2/IC2CompatModule.java create mode 100644 src/main/java/universalelectricity/core/Pair.java create mode 100644 src/main/java/universalelectricity/core/UniversalElectricity.java create mode 100644 src/main/java/universalelectricity/core/block/IConductor.java create mode 100644 src/main/java/universalelectricity/core/block/IConnectionProvider.java create mode 100644 src/main/java/universalelectricity/core/block/IConnector.java create mode 100644 src/main/java/universalelectricity/core/block/IElectricityStorage.java create mode 100644 src/main/java/universalelectricity/core/block/INetworkProvider.java create mode 100644 src/main/java/universalelectricity/core/block/ISelfDriven.java create mode 100644 src/main/java/universalelectricity/core/block/IVoltage.java create mode 100644 src/main/java/universalelectricity/core/electricity/ElectricityNetwork.java create mode 100644 src/main/java/universalelectricity/core/electricity/ElectricityNetworkHelper.java create mode 100644 src/main/java/universalelectricity/core/electricity/ElectricityPack.java create mode 100644 src/main/java/universalelectricity/core/electricity/IConductorRegistry.java create mode 100644 src/main/java/universalelectricity/core/electricity/IElectricityNetwork.java create mode 100644 src/main/java/universalelectricity/core/item/ElectricItemHelper.java create mode 100644 src/main/java/universalelectricity/core/item/IItemElectric.java create mode 100644 src/main/java/universalelectricity/core/item/IItemElectricityStorage.java create mode 100644 src/main/java/universalelectricity/core/item/IItemVoltage.java create mode 100644 src/main/java/universalelectricity/core/item/ItemElectric.java create mode 100644 src/main/java/universalelectricity/core/path/IPathCallBack.java create mode 100644 src/main/java/universalelectricity/core/path/Pathfinder.java create mode 100644 src/main/java/universalelectricity/core/path/PathfinderAStar.java create mode 100644 src/main/java/universalelectricity/core/path/PathfinderChecker.java create mode 100644 src/main/java/universalelectricity/core/vector/Vector2.java create mode 100644 src/main/java/universalelectricity/core/vector/Vector3.java create mode 100644 src/main/java/universalelectricity/core/vector/VectorHelper.java create mode 100644 src/main/java/universalelectricity/prefab/CustomDamageSource.java create mode 100644 src/main/java/universalelectricity/prefab/GuiBase.java create mode 100644 src/main/java/universalelectricity/prefab/RecipeHelper.java create mode 100644 src/main/java/universalelectricity/prefab/SlotSpecific.java create mode 100644 src/main/java/universalelectricity/prefab/TranslationHelper.java create mode 100644 src/main/java/universalelectricity/prefab/block/BlockAdvanced.java create mode 100644 src/main/java/universalelectricity/prefab/block/BlockConductor.java create mode 100644 src/main/java/universalelectricity/prefab/block/BlockRotatable.java create mode 100644 src/main/java/universalelectricity/prefab/flag/CommandFlag.java create mode 100644 src/main/java/universalelectricity/prefab/flag/Flag.java create mode 100644 src/main/java/universalelectricity/prefab/flag/FlagBase.java create mode 100644 src/main/java/universalelectricity/prefab/flag/FlagRegion.java create mode 100644 src/main/java/universalelectricity/prefab/flag/FlagRegistry.java create mode 100644 src/main/java/universalelectricity/prefab/flag/FlagWorld.java create mode 100644 src/main/java/universalelectricity/prefab/flag/ModFlag.java create mode 100644 src/main/java/universalelectricity/prefab/flag/NBTFileLoader.java create mode 100644 src/main/java/universalelectricity/prefab/implement/IDisableable.java create mode 100644 src/main/java/universalelectricity/prefab/implement/IRedstoneProvider.java create mode 100644 src/main/java/universalelectricity/prefab/implement/IRedstoneReceptor.java create mode 100644 src/main/java/universalelectricity/prefab/implement/IRotatable.java create mode 100644 src/main/java/universalelectricity/prefab/implement/ITier.java create mode 100644 src/main/java/universalelectricity/prefab/implement/IToolConfigurator.java create mode 100644 src/main/java/universalelectricity/prefab/modifier/IModifier.java create mode 100644 src/main/java/universalelectricity/prefab/modifier/SlotModifier.java create mode 100644 src/main/java/universalelectricity/prefab/multiblock/BlockMulti.java create mode 100644 src/main/java/universalelectricity/prefab/multiblock/IBlockActivate.java create mode 100644 src/main/java/universalelectricity/prefab/multiblock/IMultiBlock.java create mode 100644 src/main/java/universalelectricity/prefab/multiblock/TileEntityMulti.java create mode 100644 src/main/java/universalelectricity/prefab/ore/OreGenBase.java create mode 100644 src/main/java/universalelectricity/prefab/ore/OreGenReplace.java create mode 100644 src/main/java/universalelectricity/prefab/ore/OreGenReplaceStone.java create mode 100644 src/main/java/universalelectricity/prefab/ore/OreGenerator.java create mode 100644 src/main/java/universalelectricity/prefab/potion/CustomPotion.java create mode 100644 src/main/java/universalelectricity/prefab/potion/CustomPotionEffect.java create mode 100644 src/main/java/universalelectricity/prefab/tile/ElectricTileDriver.java create mode 100644 src/main/java/universalelectricity/prefab/tile/TileEntityAdvanced.java create mode 100644 src/main/java/universalelectricity/prefab/tile/TileEntityConductor.java create mode 100644 src/main/java/universalelectricity/prefab/tile/TileEntityDisableable.java create mode 100644 src/main/java/universalelectricity/prefab/tile/TileEntityElectrical.java create mode 100644 src/main/java/universalelectricity/prefab/tile/TileEntityElectricityRunnable.java create mode 100644 src/main/java/universalelectricity/prefab/tile/TileEntityElectricityStorage.java create mode 100644 src/main/java/universalelectricity/prefab/vector/Region2.java create mode 100644 src/main/java/universalelectricity/prefab/vector/Region3.java diff --git a/bin/main/cofh/api/energy/IEnergyConnection.class b/bin/main/cofh/api/energy/IEnergyConnection.class new file mode 100644 index 0000000000000000000000000000000000000000..26ec813e79583b2a6236e76943ff7bf3a11046e2 GIT binary patch literal 211 zcmZWjJqyAx5Pes*RVOERH(fjsH%GM~2o7#;F{Cx6O(dj(f6c)k;Exhh>*jKIym#;8 z^?p17EHOwB5hl`R7Zz8|$|#rLdAI%UwKYabudPYYC5#Gj6I=?D^Wj_sB0y4@-&ZRk zET(&-JXbnMoydGT0zr;$6Jy#R2Kfqgq%{6ngU()7dp;H<6H*`qw=81N>3aNmnm| z2M@`E$;-#Q_xbhy0bqpv0zJZs4b=;qSI6Qd)^A+iuJtj7g_}w&ut7MSnT6rT_?jP{ zXJS)T$snhO$i2*wjG@qq93NiCd?RXsT3&SPR?Gw!!l}xrWDia^qr0 zxGJB{OTs}d--t;HQKp2;|AI2+NHOcwbOBz>^c#sNuZsRj-d!E|<;b?)47w=2sg=vTAw1NfoD*<7Vy zVKMVy{`}y*&#(6n08<IQSH-U6y=!M2N)%sR6zhCC$$K_Q?+N3!#%>IikO$V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;A~W_M$@NJ@--(@2WfM1a{3ZG9gr(vdPt5UK*99Jl6%r%Ew?Tp7M1@Cn8DW-NX`vcFddc#V8O+_?XHtmSr_y~*C zNUXo6wTu$mL1E=u@Od(D{d)`!1&7D;=Gaptf5yk(AT;*qt1dBo;@cO0ibpgKC_o3) z!y9bj3`G z2qYXDi%O5&|B=Venr1sfX#b$7VU0bOXq5JKl-=uS;a?n;m7{LC)7lwbWvw!!fybCw znGKlFSEeM_<^soeV8XGR literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/electricity/IElectricalNetwork.class b/bin/main/universalelectricity/api/electricity/IElectricalNetwork.class new file mode 100644 index 0000000000000000000000000000000000000000..07183d20121f29ab41f4dc935bddc9c2b8ae8d3a GIT binary patch literal 235 zcmX^0Z`VEs1_l!bZgvJHMh5fJyv(xHqTR5CHg zFSVpRzbKoXfrXJlAS&!K@Yc)d8tL|mHM8pU>a%?BLi1@ zYDrjrPDx^VDkB54hNcTpC^)~gC^^+FGY2Rnj%mFf$Y!8jK=nY(3iJ>o&^_!793U10 KCy-=f-~s^Z6GVsr literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/electricity/IVoltageInput.class b/bin/main/universalelectricity/api/electricity/IVoltageInput.class new file mode 100644 index 0000000000000000000000000000000000000000..8776ed0cda4dbe3ba60b40aea171ff70dfb4d7f7 GIT binary patch literal 302 zcmb7=L23d)5Ji6(<0J|u

p}hUhNaK@fy20=n)rHBCuRwX{7#uI3^K$e|=X;KD4k ztWVXW-v2qDz5y&SsW2eCb}C0s2OBuB%SoK%FJt#&uIJSzhHO2rbl>F)L&D?E9<2#h zy?OuKl}o~d=X||a;LmI2Y+6xv$u_x($+K~>ZKIklOEAkmsU;PFM17mpglW`mis~;Y v!u-FKdbS~qKVp|0FC{SH>5srm|NDqQxG7BlgW_|G5qhr*cO@a*_c_MDY`|M} literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/electricity/IVoltageOutput.class b/bin/main/universalelectricity/api/electricity/IVoltageOutput.class new file mode 100644 index 0000000000000000000000000000000000000000..27c5351a19840297304f723741de3585d312e76c GIT binary patch literal 226 zcmY*Uy9xp^5S;irwG#XZZ49WL?I8$)g#EP^HbsfA;!cK2nrsSAEaPXUXsW3i<6fJGpk;3%fd(qks U6coC-1)y@2J_hZCB4Y=`FS}<$#Q*>R literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/energy/EnergyNetworkLoader.class b/bin/main/universalelectricity/api/energy/EnergyNetworkLoader.class new file mode 100644 index 0000000000000000000000000000000000000000..6346d6ca476d4bf05ee322f14f4f1f3097b75689 GIT binary patch literal 2700 zcmb_eZBr9h6n-v2HYAG?RD3~eq@pC0#8&Yw_<{%sMzjR6s4ZPKYgpXurn?&{-}|M% z#IL^0Al7N8pZlXaeeUjtB$gS*PBWA2-gD16_c_mbx%unw-~Iq_5gQ6R1TNHV^QGZ> znq^pq?z^UL`kQ&JX66msa4Vbnso*hh_#2MkXE0e{EQc0k<*wmS{G|wvtbeGJEt@(A=5V-T{{`g37FF3PpcnUY@vcK)v zm4&I9+0x>|vOp^IU-wNbUow2EK5CbY{~rJ(g!s5_nYQWQ5Qq(DmIOK{owA|e07(cq z2r%5$yfxxTAcZ~^2hk(YH6ECCL*THAZY1J3B9PyWg`DoVM$R_;+*Fh)&5F{Jp!qQs z$1%X5J;RU00q1l)+!AJqDYh#Gi7{0)ZDYP(T{YZAZPj8z`ihROSxcI0%5@-2Acj81 zXz}TMoX-iL7F68G>D}=BVB!ZcLiT_IlWR{XRgR=^TSb|Nq$+U`d7-mYea`_V) z!jdgyo=E1iD)ymEKqa}d$|K(T+u7KxH5kd^yn;Ll{G_~9e2s4el;@5+uT{zCP-}b* z=39~xG9j~fQD*P7f=dENnqEVb+jY}o*Tr!~;QFIRyQUjez<#}!p4LpuD5rfV&Ge_E zIMTXoy7Y$Wucd7QN+&ReYqIhNtMxpX|`I znd(eSgi+85+`+VhDS_j9Z6jZG%3l6?)ynHmwd&aU>HEc^Q&BO4yM*Hz97tquco#TN zTYNWixRk&giVE%t9Bgto^|Nl&eABU2+?Sn}s

lCSA67F|uJ|L%aEFjIXkek05R zf=Y*5Hg;UHqI&{Q_qAHoIz1KHb{kRW39Jl1-LqF_Cmp+7*L}w=WcF5W>nyUL!;*@} z_)Z{c8ymB>=WDhMt33e`NeZ3_8qky6S{7A-j1q3 zLT@CAVUK=RQaK8uP82x*xd|2+Y$0j)Kv;)uO1p+Yr9{c8ySg#W86j}At&qYIos*Q| zGzU?P{|!2L5pf`Lr39-uj>)TOXPxA394dM!*-wotw2+?zACX#qkKT7U)Yrd_qi-nd zzzP2D5BwgXj{#nOCvY;@0quDUMqcuK3d;9o-{Xs>se}Ra1}18#fKy0Q)-6XS4+udH z22e^|Oa0Va9Lj#cmmPSVeTR&67i&S1CX&-M7;JHy!U$sqzT!7LNJ`>d$%6*yR>t}Z z{m5v~Ww$Z9jSH`Es`wFO%YB#M<7##bg)Q8S{f^i+CP%g~`zAo6@VL1M!13UaVWQ4Z znnjWa4q_B%kq^N1hwd?t2RtUpgCF8sdRgF#|Jddf%njgIl&}~fdQAg~Xyh$2TX^&* zmWv}F@RZluHda2sAO$0@iv(l7LR>yAAx%KfC)hLcd4>%U(lZzYJVs=f81!XoTqUXk zHLha_H;MUnfHI3tc_bXv_)MS=KfxuSlaxP%$G4&2&5w{L5qqX!eMUjGlcG9}I`Hxz D1JlI+ literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/energy/EnergyStorageHandler.class b/bin/main/universalelectricity/api/energy/EnergyStorageHandler.class new file mode 100644 index 0000000000000000000000000000000000000000..cf89cd97ef3d5d0231d0f0fa05a2690429baba5e GIT binary patch literal 5209 zcmbVPTXa-c8U9W)$z&!c2?U`8n*<^KsalidBjfI z)a1PEJ5wxJA`#A56GcY_#kZ$(>EaFpRne})1_C|#lpThFMiX^d#Eod5>^JtObN0Yw zcEm0mvPLq5Z0^q|t;}Jokd}A787Q7ePZ-$L|5+^DCVJaM?-KHg_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7a?M9`rgFy-uZ_q%+5__Q(zmS|g0x%Xm(CS;QOhV9k}6 z6q;m|U~ypkVR>@a!5Ssj*aBFRlY+%Ls<9G`i4=5o>;tsF$AuFj`3yLvV4RAt*5(;9 z?tFwhDuu^=g*oH3@C6;wxQd}<3I88wP#a>hPzl~7+o7q~80gTvK({l1z>_rf9CQ6C zI{X5bei`P6AP5^WF^i`g;P0wc#+afE^A-K#UcEE{=d1&_I1+?Q;CxXAF@r}Mid`=+~iH8 z3))R_CY-pbiEjGVd^bhKO}yLrx#>LJbg|OBPZn^KXb?A@^LNvwN}S*Mx{3Ek&7@yf zU1Ka##b`yQuA(|{qw0p6F;3E*m z56&WOqGr@UfEQiBT^g`n07Fx+`Uc@|9<=)TXmv#6yN~?X4 literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/energy/IConductor.class b/bin/main/universalelectricity/api/energy/IConductor.class new file mode 100644 index 0000000000000000000000000000000000000000..cbfddfab196d3c5f1afd9f76336aae9ea15600ab GIT binary patch literal 477 zcmaJ;OHRWu5Pc4x&_Zd&CHO1|3wA+l0!WoAkmw1F86ua+sV3v1o`!p{-~b#7VMhWK zq_FYGGjHC!H}moN_7312lN5=ji(0ylzKNoe)21LkgpkR;^pGM&dgSjo87SEyjI{RxTpY>|%8oB5P wc1_%pywv=hU;abg?f9{shs6e~NU()8oGc0JA7F@hhTRxLWv_il*l*+b3mM{X z{5IVGw_#cnu73(HiKtHn$FhpUjaDLQL(d-!K H*~7&*%nDvG literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/energy/IEnergyInterface.class b/bin/main/universalelectricity/api/energy/IEnergyInterface.class new file mode 100644 index 0000000000000000000000000000000000000000..ca0ae97cd8f74cfe220ab60b5956acbe459ba0f9 GIT binary patch literal 301 zcmZ{g&q@P948}9{&uSI)(s!^I$3t&Dx-BdSg1z;Y4%sDTHdEqkv9IRA2k@c9OvQ`f zAp}0Y{PHEAU+*6PFoWv~Mh+eZ;XUaqMv4@&a^QUMxMNR3+8uneIQB*|X^Vj>ICXHl z#Xb6n()s7j*5)cWcQE~zC6s;hm_*Eqn@A3BlDtqL+x^3LFuQvyww}$T*yc8AM?R#! zPvVEn(JzZqvl@hx%Ki>_S)~8~ literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/energy/IEnergyNetwork.class b/bin/main/universalelectricity/api/energy/IEnergyNetwork.class new file mode 100644 index 0000000000000000000000000000000000000000..f91054656fa304eb2313115b0494c30d2a6baa76 GIT binary patch literal 853 zcmb7CO;5r=5S>M|d@73HXAf{;J$S=-P$VH~Ac5$?lWUnai)9zLTMU2AgFnEl|Hrs3 z&O`tSjV@7=@Jlc5~m?;Z(2vk=x3DmUJmVHb}G6XKxw?B;fOd|nnq+~yI%-eIt zUO6(?dMAZx)>75&Xz7p(bQE*7E0u@Tk;9=BG}PRu&8X7g%Bbg3)EiIL27#=H`Zjc3 zR0OsvQKe`qHVcw!&YZjW7Gj{Mmt72apqYpi=9BS`OMq^qH(FK*=If0*0+$;RG^&s0 z0}=)T=}KJ6^<=0VY;xZyEHAoQi;Of=J?;snLuER??PYW8tAG2lvDd3x=MF8TX$|$f z|Bs{pgx#!}kEKmRR5#%?enJYi!7|a$m8WO!`&I~&9DUf@%;gmV?2Z- P!;pgG_;~`SF`oSb8qN!G literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/energy/UnitDisplay$Unit.class b/bin/main/universalelectricity/api/energy/UnitDisplay$Unit.class new file mode 100644 index 0000000000000000000000000000000000000000..d919c6ac154308cbefab281a84c65db4da523a01 GIT binary patch literal 2588 zcmbVN*>@9F82{a7o1_CBE>I|-RzYk6rR*ZD(2!0cB@1Sf)CgLq?a&TRCNWDPZs5M} z`@Szv9u2Y_IdXjV(Lc!JcW(nkiVx)_U*`Ai>;3DW-!B8$iJt=KVAxuB?K!JbH66>b zrfL;?%C0pA%(6XTxmIPSF_3fZ+K62(J7!~p_#c3mVd)8T&Kz(|cV<9$>qQ2CG&p>!_85Xh$!+2}#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NL?QtF6^ha|MTre# z`dz@Qc&#kdUlyw2LPt)*VLxL#!(HyCXGtzvAy;!vuBI$k4zQXO58p)h=Y$xp(@DWaTHU0};oJM5; literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/energy/UnitDisplay.class b/bin/main/universalelectricity/api/energy/UnitDisplay.class new file mode 100644 index 0000000000000000000000000000000000000000..f609499765bfdcb7ae42e7f7eb03dd5236538f5b GIT binary patch literal 3615 zcmbVO-)|IE6#j0z+ufZ`e^{w>r7cBp*+NTe1;n=0Lf0+}EmX=6DWJ@5r|q=U-F0@i zP$Y_q1x>{GB7(-KiQ&nJ21}KM#F+Tto4)8@fRFlWfe7{PoQ(0GsiK4@CkSb4g=Lw=$Zkn|dN^83`jh-J+$97Cot3qth)1lSVdTWYVTK z?Sn_4a$K9zT1+iD+OjV`&LaXPod!2`2^5DL4+(gBQp37}VgyupQ6f;$XC(E#xyiV0 z9nj*YE>P8%N@(UG%`)WNed)=L85x1*z9mrV5Ku<-d4dA5aAYaR*Gca>VndC63tkN} z2+7e71p*JKC`XmR?&YCI3cw0@r!+Ii7>Ec%MOPWXwxx3xC>z!j#-wHrm|8+-+(b;k zXJiJ)QWhb_Pyn^4_n}UpbqN8rBcft88ptlGP1?y?6dXSu5rBeq2>I}+K>5Osel0tu zVm-o?gBB+*PdL&T@nZuyHA_xSDw-vFNoIO7o-!4_YEjXO#{>dQ<$#&9G*e(jxIpxL zcwAuRf-xsoJ9CCPtXm4U;0YhL-lI`xhl*`@lHsvKzi&jKnxqQlybT>vw4HLt;`PQu zeo*G3K|ve3RqVh{`k|%MdUBY;Ep%cLh)b6GYC}ZD)6#E$Hs$bC5Jk*~T>@K|nzI2* zA2Cj;*o{5pWIM{>cZ3^{E?Ha-6d6X*uVOFuk)e^FHVUOZj6-T6Id}%91IcH?~9aV7*$EkEHl}ips9J$je zZ#WWbjK}~!FLQ80ptevt7a|=+Ttx!Rk&g=7Ypc3CT)66^7*R1QeP%K3h^MCX0DU!7 zJct!+Hj_CsYotv>w-^*zy$)JQ+73UpVF;*KrSLT5mlWCI|)fSwV zdVNvWe4#@n-RpQ^@=x}=msOm_E0lU#)&iBt=Ekg3T4J2?7)<4?gx+h&ORn-D<>6kP zn`F;oK4VGVsy(Kb$;g)Nkvn)wKAfV%8tT5-wpPj!uTTE^IB(&TEf?MmH{kz*gCf#_ zy$twK%CYKf;IoXgfJ~=*ct0V$e5Zt(>Z&~zbEv$=Sw6xs8({-Ha+j1kpK?@3C*JKGCG6GEC#M%vpg5{&*18#ELM0LRC^!LhqmqPb=GanNsrP!80oQVNO zD1}kZ4OC)+X)~Fo6zcH;)*^#OWYL5iJLX9${WQ9828Su+<9HQ1&S45OxQYw-3UA^z z-oo#ATc~(PY{yvgN8B3pu% zEAdX+l6B(`HF=BYkomX3-?x2m#O$B5W<4KT8W7v=C@C_QHk>k2XaG7occ z3}qW~bP&KP>dfg|zq*(+cDeV|c|O5vyUs7pVS2vMWfO2q-CmP|&+7wu%lA3Yw)0=- z7nbRrQ#JK=SG~ci`I=tcndKe zJFv79cI~v%8QGmnLS9B}0aacaz|S_Kb1Rg%h(#=RY5R2+JlMaB`1LJtzB|Zo9Dxhn G!G8d7i8!tR literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/item/IEnergyItem.class b/bin/main/universalelectricity/api/item/IEnergyItem.class new file mode 100644 index 0000000000000000000000000000000000000000..96796c98cbd0e046047cfb369bcdf41592fd1441 GIT binary patch literal 351 zcmaiwzfJ-{5XQej;W$*pM^GEDaT_~JPZAOn3la*uaUIXaVQ1mzsAKLjXawWdgG5purhR|-aOc`cwM{e5C{kQBA~5~+vuQno;10O S^r!DN`3T24NjTBiLVp7#Z(j!h literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/item/IVoltageItem.class b/bin/main/universalelectricity/api/item/IVoltageItem.class new file mode 100644 index 0000000000000000000000000000000000000000..14a5036a3d7328651f456b52740fdd5c04b4da8f GIT binary patch literal 192 zcmYk0u?oUK5JYFACTgXhV5b&dV`nQuK(Gkdug4lLUJ^Mk0e{WH5AdVJ3#70ac46Mk ze7>(YfGs8oBEq_T(QmXV^ThF>X)jj}O-8d}=V}&sPuh?|yF@Z1$8vzQ9BgEZ> IBxr>34-5e{GXMYp literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/item/ItemElectric.class b/bin/main/universalelectricity/api/item/ItemElectric.class new file mode 100644 index 0000000000000000000000000000000000000000..9b8f30070ff1707933e75194b6a62a5e0e3928d9 GIT binary patch literal 4771 zcmb7H4R;jf6@Dh!-AOh>fF(deg&GCi-9Q!sB4jCv$p(ldfCLhgs&ukDyBXN*q_eX~ zw6@mPdel}c{gBvdze`(MEw)`yTC4WM*0w*Tf1s!K^m*Tzoh%!c95|fK%=>kp``mk< z_s&QEd*@vMyYVj-4GQ9=f_cuci+bM38)?Tj)21_@(C5sA=@_$#Vg3wx6Dk4<))x#X zF>4l#w5?~I#YHMY3S!F~HdHX|+`KqbMbq-O$F01h=M1r4L3rrs(1}Bnr;iStR1g_C zqo30gdA*QJj1hDpmsGG~&?*!iz2J=N`I6Cu6$)CaoKg_lZx&4FfP%(oY+ONL(8?HL zG$Nv*6)VF~(57K6)+tz7G@McW{FtMs&yJao8w&1-4#!67_?{G7+ck8Et(vICt+h5E`;* z5~rBDDYGb8-z=Ur9K<2!^aICEjSP(`=&7FsbxvT~4&#W52T1U3Sl2LuQKl$k;o%vZ zv1~`dp=j#%G1Q^$n1{QiIHh466AGFf%cY%F z&f2Suak2%I__T^C)`y()lUT#Uc!UYWs;LQMCGy?ZW%i7*m_#VEKFS94H@cx)IA`K=kZk)FYvyqb63eE(C{_9NEpI1JvV60&RHc< zWSf^KZT;Ja=LrL2;?AJ^SPADA`*!Rs2nhwrlhh(Pob?$ykK;g!z3T3yv6 zj5(Gq>Y=47=ECBSHT(oWWi)5>;t^xMMh7Z#J|&j^OvBId3odoZRgky|vf8`fbA3QB z8sztv3O3f`_h8=AoiHxr4GnMN*Yqk|Dx^>E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H2?d zE|jesQmYw(AP8?`w`C!5N5iI;TA2&{<}8e`yquR2ffjNM)XXx)k?|(@IX2ZM6_o3u z(2ADGLHiE5kOnQHRusm6+E*KtY7Awnm@N$o-Tj+Tca%guRBH}(X}IX4Spw~^xQ<;? z1fILeX}lO()cXysFu0K6r}~PSZy`o_B?Q*MgAMTU_&mI&1~kFlR13DTx8qRQ#n+x! Iof_Hu0QFemA^-pY literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/net/INetwork.class b/bin/main/universalelectricity/api/net/INetwork.class new file mode 100644 index 0000000000000000000000000000000000000000..011e431a5b746e4aca19d8b1fb43dc38fab07640 GIT binary patch literal 739 zcmah{%TB^T6g`7NdCEgYf54O3J$7874^Qq_1M=HrWl%)Aoq++~z1u}bLo?e#NHnjRIPL(h2WJtDJyH~r(Qes#R zr-MPk=$(UcA#=aP==T-=9E4Y4ppfaj0E;fBj0$0kPzhDSwF6v7!}OcfZ{Y;lrM1y9 X^)BJw!GArRn*JHhKF<~UTcwL1dT7mB literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/net/INetworkProvider.class b/bin/main/universalelectricity/api/net/INetworkProvider.class new file mode 100644 index 0000000000000000000000000000000000000000..7190336de7b2a9b741add952a067cc3159453a89 GIT binary patch literal 327 zcmZWlyH3ME5S&f0otW?_@IRajxP~f0lt@U(AQ`2${5SQ%tQo@Bw9}Xoe!aTQSZG7jL5UBJy6E1H5`4Tm@rE5Z{L^~95 z-gK_uJ6lOaa=6>oFq5EevgJ7Ec1(o?!c<-XOysHnq2Ophm(@Eq*&Ed&TJw Dtvgf& literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/net/INodeNetwork.class b/bin/main/universalelectricity/api/net/INodeNetwork.class new file mode 100644 index 0000000000000000000000000000000000000000..5bba9335b136ecdab6cf6c91bbc6ba79d87891e2 GIT binary patch literal 451 zcmah`!Ab)$5S^*oZL2Nz;vWe1VlJLGOQ9?Xg|Z%Ye;}^Ik{S|8vz309R}cMwepGSV zEm-uhhk?xG<;{C9yZ!eT0G?nJK?h+{TfHW~Qicqb!Ru0ojZhz2SPEjExi`uvd^-Og z!6m}&QmvIR%2wj#b;%DR=px*=kTe7cy^6wtafL8`m@JN5b}4V?rLAsvo?$xp9_3E@F9F9SsX7~6#d$gX)8K)*0NRS>;tlSRs=I6;I9t}Ff+1`#xmGLf?m{+NSaxD}Y)a`k#fUJkWG97@_A2(5DrgCbAKrv` zxjGRtCGFQRFlWL{)z)e2`A_GE+P8|g+AyK`#jpG1gb-X|84!oIF%tBxDJBDEJqAS{ HZiMLvB-k!D literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/net/NetworkEvent$EnergyProduceEvent.class b/bin/main/universalelectricity/api/net/NetworkEvent$EnergyProduceEvent.class new file mode 100644 index 0000000000000000000000000000000000000000..93ec99b630c069487ef714c96b9440bcd4a93011 GIT binary patch literal 891 zcmb7C-%k@k5dOATT3SylXsh_U;)AU})&$-lB&I{A5f<)t$=zO&Kg);4 zga`is|0v_^!Gj4l!I#~gotbaGnQwmmKK}_|70Y#01l9|qCzRzXp@brr=}5aXsZO*s zU_QEpvOy=1?3wbu52ZzND1*qE9K z&8>wWZGVSfl z&#F7rxxmKk-maks&#=y6UNV7qv!VVyCV}Q&DbEM(X)gRN{#!4Xz|t=3qf;8`Tr>Cg z##pDEwuY&{8Ad0kGPQ9ozovxC}QG2mqlQ1JuiSH+LFym`2M^KP(oA)hzd`o@tys?&e<1GoCGr&#EBr?}H^&rQ+( zUgq8NentbH^7)KWx@h4!+E~VY{#`A79W3DiTR!$79x?t!R*f0>muKObb-c)&5#TXf V6+B^7FbBcNU}Uh@a}2mb;|~pZ=~Ms! literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/net/NetworkEvent$EnergyUpdateEvent.class b/bin/main/universalelectricity/api/net/NetworkEvent$EnergyUpdateEvent.class new file mode 100644 index 0000000000000000000000000000000000000000..80cca6a6c2626cc2a8bf49f2ea8e561607ee8598 GIT binary patch literal 643 zcma)3$xZ@65Pb~@I--aRiANI;qS1D{p(KW2LP9vWaBqfET4%b+Oat+=Jehd#1NFK>kb{?dk$2JMEd@C@mvf({f)7YSpelu3`J+A&Z3~ z=8zXCwY8znDC|*mqj~`ethTMMg06~mg1?+OH_)-b`Rtm1_gWJua8#m(z~Ssnzq1$c zuI(uD=~5>w%inc9cu->{uz58yPKVUhv1aNQ##pDEwuYJSxBcNnhPEHeyD*Tx4MS@r zB~uwF(+?<;4P|@^lBStyv1M4qMxf%D_}FCqX#2cK`qY literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/api/net/NetworkEvent.class b/bin/main/universalelectricity/api/net/NetworkEvent.class new file mode 100644 index 0000000000000000000000000000000000000000..e2bbbabad398044065f790a75f057e1a7a7469ec GIT binary patch literal 708 zcmb7C%SyvQ6g|^cV{0F_z8@Pwq_yA(y0f?`3PKSS^)vk`8r0Q#FD3%u#k3#!+ zIwTW2$O-Ja{gDhpFOs)`FWoQ*LL(`8eXoq?la*<&fWz`cDsa%5I)V(@yC->mn%2p% zV}aS0Hab2LIIRCy+~^AA+M!1UWHDcagQ7sT-st8bP%dHyvjUZlHgquvdStIv&nJOe zCv=tHRaPf>LgwOo9SJn2@8Newy!XOYIIu3A>BP4BGr;`^HB{_NMQt_}jHQcKyL&nm-CGIU_fw`4&H@npsu`YEL%q}v@UdNB_;tO5*IZtVlc!w%r-DEJF}UcMKJe$ z-=`$zPR#LBOddjbFE2mmkH|lg_hPDhcI8@p$a`*gbyw9_RbN%l-~avbCx8R^MMH=o zo_DM<;pGfl*uwNZ%e4Fn-E=cq!`Iu@&r!ok+rraO&aiI87&CO+aE9~~10$rsP~ltV zsBPtFS(Q}BdEc`2ZX=su2&b$e$MEx>U>IF^+M0BPuV*Yrn4U4{>!c)v<4gBFwCqsJ zM6x8ltS1JI0i~jM6mUzWBc2Qtd_wN^yB%=fbe>Z0h>1sxRrfPGJNpgf4H32wG(F4&y!z z_cH7%scvMgLQh)*mQDTxU75f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in/main/universalelectricity/compat/ic2/IC2CompatModule.class b/bin/main/universalelectricity/compat/ic2/IC2CompatModule.class new file mode 100644 index 0000000000000000000000000000000000000000..3178d2ec9138515a011431f20144c8a2cc64588c GIT binary patch literal 6921 zcmb_hYj_mp6@DkX*-177giA01BncoSB)CP;6oNq9BxW@U3K3{*)nRu+R+62#nII8s zsaEk)FRi^8TYI5et;K?9k*HO$TCMitrS{^bwzbx$wzYrz_}J3-d^0=QY!c8~o@aMw zzVFOA@439^I}@J$&%=)aSdM?{$kPxRNF}#h>3*}v>apTZIvGzogORx1+h;nFWc-v! zEP6^*-L=_?fgVdoP($sw51D<*h%1`hlI)=x_X!Q5RmoJ+S*;;ZRlQL|Flr~PFajtv zkdKgtDXqzr)jrU>#Y%UWTY4-F(^~Dg*|X71C*|H-3_9J(eho`o$F)8&%l z-EumTqJ2eG>&51FGty(Gwno-%xtM;}SGT4tC(=tG@wD0HL>x+5DMx}K4>hUFdL2_W z%>MwAI;LwVm-tCktdy1BI;eC;VomBslop}{C+L`|p)^O*l_6jQr6|)-kWBSEW-3nb zvs-gyJ%tpm52F~f4a~ubuFIS3bWef~YB;ef*TG9=FQO#s3;A5RfeKVISv#V(ola=b zVzNBnzyh^AsFr1Ep@Bte=`yucglg32SgfIJLSzPNu|&fpreP$S8k(wdqMi*Z7K`O# z9zQ7>^lmei=&{mLIAb!aAMBPBSnWQ*?a%*u}CTnc7x_I;=EM zk5w9`GLDT_FP*j$8C2v}V!t&TMs7LUu3F%0b(?6V9s;0%&5*4}vDhK}{IhSuo% zhUN~ke0-vftAwSu8jS{;(5xZcm9~4&ve_+2*I-qn_}YTAbi_1F9?4Ie>2w=78?9^% zB%X%+sz%C+qwNOP;T#P{G9~QH__#c$UXCAU&-Qu)8(cf)4ncaJfsKN+z_Bwp3lo{_ zuql4XbdoieVl`RQsG-m=8Qym?1X64K>1P@>ROS*`b~9~3GR=M!N~r8om6NGHg6*-o z9GlHr2kBWn5=gg&>FCn1WK?fDUVNDKgx$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?8$OYydJfuk2tQqMC-US zgLd7H{J`GeUM{jc~pHT?(%?NNySnq6-ssc5~?1;4A$6^!`L&7?`qhc z(^;k|`7YY)W(!U-89iAASK-^O@a$5z$CnV>s2~Wa@RR26V=fs%B=_R`9-hazD{N?R z=^iW#svdblS&%)Fn2KwMu{Xdv$`9_9J+=b1*X`}?_x1uKVV}pk1TG=X`bqWy7WsBI z!$A^$Cr-!Zr27?FmDJ!n(BM1J;1j+94=_yu>RPE>ak*0{9e+MunN2Sq#1B1RcGIx< zvWzr1xH8DXFAL7V!@*!6FbvlEX0?(b`c1pJp%}ioEGTD^n_f5ES25gI^EkPN=ghTP z;a=vWUFO&QGS!sw_{0)CO3nuf=SLqj;g3y}@EfV`W+wa=Cj8bc1lb99PeXiwgdf2Z zUXYrIPna`R`ob`NoR?_m-Hs(pGwwRdEx zE%DWs_-dcUa~@KMaD;_(d=~QXF0N%=4&!GU=kH%;_bfMWdl1u955iwffZ#qN*hd8WiQs|%5y5ZpTQ3GTFapvp z7WnO=PIbB31Nhxtm_icPX)Z&v8=u?14-v^Q8Tbf2eUu}~;|h&?PA%}`vA{oO7vMED zc!XGSBW*)*jeoT)o<>No9|Kr-4zO+k#`Z84*pmeI6oEZWV9yZPa~~bp@BN(Z_99l9 zT{R_AHSN-6)yS9AVcl>&PgE~3aW7&ThoEx2oQ0~=4_BpMKC`{@nZ{>i63gncQx$eji6p9s5d?Ys0Z+eF`x?ZNBqgFEz_fI#ljhQ^ERH+ z!M(hCORnTS6S?bSy*yUVdRIT!qy6Z>1NlfNiD?mI#S{>nK=#ylS62!sm@IeGEr z&oh@Mon;)Vopmq2fkphty-<8MKjr+)Cz5^C%+K5WyfZRiyE%G?|K0I7w!6P`vi=7r b>UXou*K)OzI>dYk!8rj=w;H9StG)YQS)Ui} literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/Pair.class b/bin/main/universalelectricity/core/Pair.class new file mode 100644 index 0000000000000000000000000000000000000000..1753cdb668a7554d7431fe4cb2b6ee54d1f665eb GIT binary patch literal 1388 zcma)6OHUJF6g^)%eL9s=3MvX#d@ya1`shj<5@SMQ9Mk~m!rf5Ec5rNQn3AwE@n7g~ zV4+4Zaba|2;%_p>b7yLK3=tRY_ucc|d+xc9_UG>}UjfunPa&o--S0YEwzp}ywrjV1 z&uKaScCFR(?AjB{@lwzf^6S=?RdcOwyY_f(on8u>Yd_~vFpoanRmiM3?XKnbJzF8Z zY7$9!PP;?*`06sPWW(t?{({1+5e<(bOXm2YNjdHYFHp?gnO-s|SX}Nu>7Dzgm?pT{0DL*Lsfi&TYj!T#! ztNp5PxvXORn5LGWX4w@(#|2DDP({a8ToY_g$3;vjs2;OyaNs-_PpT!VI*Lf8xfS1P zy;!m~27S)1^!i@QUUXy<8CkD+Ss#T)!@LuvSUv_@h`OhN?{nz z;v6j!4ARR@62~xk$m{&jD@`GxSC(E%<}wsD9f-O|RD2SZPbj?SC6pr70J$K&9y$!t zOR9ZDQYjhjkhT<|Egq#E{ZCph9Lc41W}qI(i^@G*=27JFW`}PF1&<$K&PN0b5(?&4 z4wyfZS%y-t{y-wWQ~eJ0F1UPyT9RyYdzjrr`7OpIDXnT?CA6KmWY>bpO>zq0bTm#P z$u8&EkP)_}$l2{rus)n%9oK_}k@tDVg%h0MDgT(E%J8j5>;_T(oRaBZm`PE03^$3y KaBHw$xBmdNM)WoS literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/UniversalElectricity.class b/bin/main/universalelectricity/core/UniversalElectricity.class new file mode 100644 index 0000000000000000000000000000000000000000..72d754a1f3f597d2ed709fadd91a64ac0f8d2492 GIT binary patch literal 2810 zcmb7GYgZFj6x|o1c{o&zFQAI?g^60nqE=g|Ery_J1K0qm&<7ocAzYozq%#8)t$n{= zU;8^6y2Mr2>JR9T>gv9eAfQ1kYcY53x#ygF9{cRcKmY#qH-L-yEs7R_a|@1Kv^?Li zE!#2!Pnt4V)=k&5^og~T-1^5$MT~i0?ESq=@|Vv z0jJaUW^~x4w zs#IKui!&$7IvsLZ@QgsZ4sXyVa?|;2?{w%wKnx1(qNq5uCP_-aSmjSb; z+LXX<>5o{!lIz_WFzeE|G<&mdrD~|eDuy}FKm<;04oaV~UGt7!F#^kzhOG}bUKmTP z-?XJ8gR26q=}bu=l67aTC^}j0|Cd-4FEX{TpwiWcq-`Z|7)PS$7U(joOM1nf_4T=m zy;hxqYs^}nh7^u64jC5RWbobTOkr#NKIQeeh7&l+>&jM8ukN7q*lb#E44^NDQvw~$ zz;Vu;D<{x}jE2)VBe1i-QHA5_%`TpXNT!rP2VPQ!=LGgVp`R(mA#h$p0=weq#lio#y#MpQ-KTyaP2ZqK4&K92ENuRpAb1o1*Ic!O~Y=q ztG7W7d+KjP8j@&_;)cM6&&r5-bsGM>{=#yqKnb16`4j7G@54Ss!koTf6H+tZ9eZ+dRk@`7bXcpG*UcLXw< zAonaI4HY;73C48Ib#2SwCX$}YOvO;;{4$pYr>5$p8Uv~1Gk+M?(Y0Xcu zTqzk?6<_5XXjljf<{KeR6DXIOmV3JVh44v44o!mvaYYF%K0`NVqcs5+grQy08?cquu4Og-#*G@${TqCsIj|22{ zkh}Zzss3`0&@uT4U6T)S=mCx;dsdNN#n~0;HN5;MF0bIV8v4VRHzF$-;D5GtMVVcn ztRcUO(G?W`praOy^VuDSxtEvj!!cfWh8OC*@B#sSnbL_+6AXgX)(A!CDk$G^dKIO0 zS1M;P17)Js6>tla+zCwKJzn@e-<8$}TvblLGshOLqc!Lc@FAZ`BWcz!@Bmi$luV#5 zb!*6mQa&lo)}`0F8cg+)8eXEzSv2)}VD++eFln5zo&K>hkgm<$Aq zSYm(zpJ2I3!2PsQ0Y@IP}altr#Et*UxtO)Psvx5eeL5L YeCy*oeD4z@KTsvXqaX1ze(j0>2Nz58EC2ui literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/block/IConductor.class b/bin/main/universalelectricity/core/block/IConductor.class new file mode 100644 index 0000000000000000000000000000000000000000..dc49b4a6ab225cf95897ed6849dd115f6b650a92 GIT binary patch literal 1092 zcmcIj%WfJm6g?g&Bv49{CQV=a1{Bqm5_LnB4Fm~kM5|JD(VZC#F&XU0c!>HX{f(}> z$Oq&n`X^DY2Pz_zWAn%|Yz@Uk@L1>pf8QMvBaa-zo3&Qj(p?&R{=u4w>PfP-!Em&e zMZPupP)5&*1%_8EiQ+l-_e6qeD*Xr4F~^QK1{%1-6gD&ajf)fhHAYM_NnED8Gd z-yFSLttd_H-CVa$=ZT+Xsdhptvvt!Wf#r~5&`w5OX+Mc>Ovp}XA`yQUR{8S`%(^o* zW;pzV)5UrsADNz_B=NtDHAA6e5*x{;@_Nei5`FEfli_E$Sf#b~x)v(*9*pJc{0(Wj zGXE_()NvF$8V``iCUtX$IFl%(DmD7Hs9;!wf3XBNn|6La%;dI04x^A>#pY~U_gtA<`+n;`h&2wu+uh5xjdZwWrd(+nJZ=MkvqYfp%Q}$&_b$g+v zK$xyz5@kZ1u#KZ$-d66!ha=1-HkH|_blTSgvQ%8@E@3X?HmFpNY%&mV8VHR^-@i^wOz>*#l$rXkHRzCowD8V!U literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/block/IElectricityStorage.class b/bin/main/universalelectricity/core/block/IElectricityStorage.class new file mode 100644 index 0000000000000000000000000000000000000000..40aa472e5cc0afd415e91223737338230a14fb0d GIT binary patch literal 1190 zcmb7CT~8B16g|_f{bChCEg&i=XiFbl6@BW9rj@KtkRYNxOv3Kr0bIzIj>-UeJ0A8YAL{4CL66zBbjb)$$<;Risb$sgiCQ@E6 zF#Z?s-P>vWFgB4Ks3IJJo5%7*dVvfF-a+q}r9~73p3Q}mBkieBMT1kqC2PxsvDDlO zlm{x_HsRdAmiy}$_iyhW~m<)R=`XqaS5?JmSUj|(nY5SiA zo%pjR&sUwfI{$53lh^hmGZgTy$T+p+T=4Ey1=B$*^{$IDDguS{DFg(KSh{esB}dXe zzD?b5v1wh&Y)@~t2ajAV*n`TUnMA(Y)7GigIX&{!wg>atYDC{x> zH7$J;h9;KwN$6;`Gwr8oO_MFfuHd-Fo-I4VJ{D~IQAx6r4Nu4v*E!$dzKI+^px8LW zqQEz9b6DbBU;?;X=3Grva0|Ej$7I}L%wD#F)eLB#7dt#FHR@+r%i}xuDN-e=uCi(+ zLEB^|^DfXz8Jdl);~ujG?$0Io;4;DW{}6Nunks#s0RL6#MgrtA+3HJ`T78wQ{54r8 wyc@N-`nFiLJws+zpH*euVwYrSvt%A#R#lrrCXcPe(rrBE3OwPkk5mKx0Mg3sng9R* literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/block/INetworkProvider.class b/bin/main/universalelectricity/core/block/INetworkProvider.class new file mode 100644 index 0000000000000000000000000000000000000000..cff4bf01ca53bb07ca78f055fb4bd0006d3ffacb GIT binary patch literal 347 zcmb7=O$x#=5QSg-t3Mkz9z)~8UB#V(P*m^)X&g#wXe6c;Hy+G|2k=m0EP|qLT+Gbo z&3kCVHoC_D#-4ICQZ^=C6zmJX)N(r8@c841-XN<+m$ti+K>%UW9X)$ z5L}Ba;mbJne*qc{{hwZ9r+7y0%ZQ=9Ho28FQ<@lhpFx91219GDl1#YVdd(^N%nhTz kGRME=CGI=_eEKTm$sbNakH}Ems zWM8&MQ+wixT^788(rd%J!wntbuJ(pYwqMKj7W{(qM@O@HFi}CEI}vZ|iBKXzMT;Td zlZtgTtPLl3t_ycJamI#NdsjHslZXng8$4r4OII}2&>8EBMiSv2sRk~NM!Qm~)kfZ4 zU~ZdQMkiv9gzLkRT}{iBep0M;X#Fs5|mmPCny_aq9DeiA^^bz8x{)nZlaAM z6k3=xXg=i(;w)$W**0v9Q9Wq9)}GGo(Zt5^_70l4yd@q9cWe$PV*2b3dQ&@N)Vgs5 zrA9^&4K$}_+X%}C*<|MCAf}_n!i+TZ3^rCI65)MG8#7TW@Q0Hvv1CdxjkNRO*)%i9 zBRZ|A2=$n4VU}P_){?Y}jRwq7YHe*RIywZQnw*uZ;vE_fv3OV0%qs-5PD=?vaWWN7 zq}Cgt$GX}D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{XH-*pP#)qh N56aOgz4C}Z@c%#Igv$T` literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/electricity/ElectricityNetworkHelper.class b/bin/main/universalelectricity/core/electricity/ElectricityNetworkHelper.class new file mode 100644 index 0000000000000000000000000000000000000000..d1299b36995b0edf35154520a205e26f7cb50077 GIT binary patch literal 7114 zcmcIo`F|W`9e&>3O(xl$G$p;VG%b}LB%6dSl!7^$UTJM0MLt6KKn(jA7l%XbC-`$85`p8TR35%(V1q{)cUolij*~(6okj=!vv$ zDF_J6zeO9?q6sZE80{Ijg;WGeTaA=qw+Z-b>-q!&Tg|v0gdgQ9N>D0L*=eNo?rd^E zw{~d*30s(8lq~{5BQ>lgjJRf#S8Z))O1Gm)$`G@( z{dUwg61twUrRuvl+~y2h>iUAX01FgU2{aaL*l${cI<1sUnyF}(yQACXmv+OV_J)~K zu@H*{<_+q0k7bauCcg??UfWSu$a*G9EkP_nSV6VG$^sFlmRZGxSSk=A<9^dh#OV)# zWwk|2qjX>*9(7iVH@lEgu?njN z7E;8mW{Msl_3f6K>^0(a&C|uM$rtq;FesF=T(t9up8W!A zYV(k_HKAoPEmJ9@fbNS-4>k|b6JZ*{4qT(66J3N%OiOtaGOwMdI(2)bIz1|O;`1yL zT0AbWC|_u|khIk8p*PcJCS$ND$P7X6EpT83&S zEFqT{bUTSM8g_aE=0ml3Ul0QQD%!A7j&`fq1uFaEEM+|l0<(>nVln0_K5KZMcG408 zSIyBB0w2y*?emYLIm$R!I|Z>1nu41J*3StiDh3b}D2XK)+bj(%8grt<{2`#L*bnCW zn#nqpnId4Wo~t(svP`Fuv0FkgFrE%m61uj4V=`+%0|rcoSEFhecW(oD5l>;OB5iJ~gAbgrFnbHPGOPii~_qz3ac z4r^D;?fLY$*9XzV^YaqA0~!JKpmhFD-EzA^pRtOJ^Oohj#>Bt4@ZfMbojW|V=dJh3 z_xWcF78XjJ$tKS(EHa>;Q}HZV%l4sM+WtE#UXZr0%-FPjVej=l702-+vFFh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z|O&+c%elOXRoF{&0z`0;71NxinlF4vgWgW+kjJ<2QtrQT*%}g3jRQ{YU&_ znaq(V8YZLjatAs|@--QqY38|G*VfiF}LCu16q|Bav(rkCKXMj{M!@D@mC~RV!y~m7DO6rU7OU9m(7jcqWF5)WS z{{$5ZPKbY_L)Hs+q+YUpgluH8Z6o4aSS48bu8_sz80ND?OccNqvR>4W;#XeDD4Z11 z7%mnsq&UD`RPb<$SGI?qe~ypTa%pDD5Wgwh5)%@LMY4CWZif7u8U@PW;Z3?hvWU z9$-b}J(T!I+$vV-$kH&5-}^BVsb|gp)5rw>#WW0fG!NimO7aLD@+hnBV-D{XF0BdP cEATgmH|gW=G^Ec#B&8^=BL5Fb$A^FX7w}5xaR2}S literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/electricity/ElectricityPack.class b/bin/main/universalelectricity/core/electricity/ElectricityPack.class new file mode 100644 index 0000000000000000000000000000000000000000..5c953fc54d6b4dfa810ccbd07c04538db9b5e68d GIT binary patch literal 3053 zcmbVO?Q+vb6g^86%Q7Ma6GBSUHnhaZ1`?*_GX|QFgi;z3N@yT_vSx#ymH_pbl_@9%#AoWoNS`xMSMD*h|4 zR(H!@*(-%LzvPF%PM3n3H{H3g*#3COExj;dC=5S$U%As|x3W3C^6WW{O{5eKw^!%O zLB(^Ql|2R1eOdKtUR^;gaP}%FhwdiVQ&;?oA6`=!bQTu!YYN7Eu;FDefFT^pi!9Mp(26!L3tBo1R#~T&O?r0nOYL%tSBoaTR5+SkzTWW58(uAqIfc})j8ty0_WFc#|;}_;UE~b+#DeS>@-ENtUI z;pAHk7xHhB{fkTcFv4dR2A>%|_p<}p7{UP@;mQOJX@*f8}euL}|KKUboHrBz&){GQ8&@LFCB{9bPVodIa zkxODs^ue&;L|K*`UScewjFEF*ByCT0C}Ok}F_4cG5tM>fWRVytqL@S(GkSoW2q@0F ziBnoyQ%g&;2-4vEbU$K2lGy1kVrMj7o7mKQp`7hPX(n7)NWv{lVOocGmf=aMrE()U z+Y{Zn2q!MS6h4pGSoosFp{OM`b2~Wa^aOLMgNBI<32`i3Yys_-t1BHSh9<$Rwt~6T zKbRgivt7Z&sj}p9)l%%nVWEpdGtF%dyxZPO(3@QxVnr;u%lcXOM6lFl9j8^Sn-N^q z>9BGR&+QIolGSymBMhrmtyW7){#i(h;pBQ~-0MIwS}1KX_-7=E!p4;3@?cjKB{!Q! zS&6zPF!>JG*0ZzQxGvpk3yayWxA2X0DH$(wyoEc--uJjev&mMs;*FufXL!1$;|)vy zY<9gqJ@jb@&TtFo9=_8!>-r##3&tt_e)}DVgd4|Mjt7m`1Fz|4Ai6$cpBo(#jB8A= z8?Ev3P`DrMR>y|tc)>m3DP8A+wC9J>6*b9`5FadT;c+r*{%heUIoJx{N24G92f}dM Ak^lez literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/electricity/IConductorRegistry.class b/bin/main/universalelectricity/core/electricity/IConductorRegistry.class new file mode 100644 index 0000000000000000000000000000000000000000..ac5d0f6d1cf6a967d9a0c673cb55096f49a3337b GIT binary patch literal 331 zcmZ`#!Ab)`41KA!+g7WhhyKF$;#@okJ&7O)3qlLtr(;;A4l|IQE%ets_yK;Dm@eA( z;w3NSz2qhN`u_L?aEFTmJ;Hq({f4EnfdjiN-ub*WE(x3C!t-N_Z>`Ho7F_!#%eFwD zaJ9A@Yl4lnd0DNspD>h8z(O!(_5bu$NbcPn=FVrYgi9CL#=TcVI4O7a8{vlYLkLPm zwecw`H>o)vYp=^$)h*O!A55id&I#jXYQ^!B4@{UI{QmB^-E|BIYNc-h`g+zW2AU8G S3_BeC;uvSDAe?LLVe$j(dtM;` literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/electricity/IElectricityNetwork.class b/bin/main/universalelectricity/core/electricity/IElectricityNetwork.class new file mode 100644 index 0000000000000000000000000000000000000000..79487d75fdb2e005d25c76fa1cebaadb5c460bbe GIT binary patch literal 1911 zcmbVN-A+?M5T3=K3M~|>2;%<_+M;qa@j_FA7Zf8&QBqJ7O*G44C`(Vz9(VVYc*(2y z7+&}QK9q5Gdu$K2mZlf&oY|S3@0*$3*cXra@H`y#9}_)@G|kERIGSA5@iMg)kVv7C13bKQNGt9|4DLpsHIi~Ego={zoxjMXos9*3w4?liJ8=gsp^`cQvWu*BG^NMac=BR;g$*N-t#VnA8yWYzaRNRm0MV zMPx8RcnLm(g|6~Jm;)J;iMnZo4C!zcM@K36GSqPsQ%z*>dB_%woLjD2OQjjiQUdOT z$8-?A*IXZL@~F&Ud|T8*ZeoQDbU&Y!p?WYP%~fKM5N(M)y1WbuCrDI(D^2nthUk8nrBWRZKFkh*}JwfAl=IT}58p+dSj3Mu(bbw!xUWzj zq%HX-syfmNO`P_jT`dmadCE+5BPOS#K$y;udp;;$H}3?WhKB2@i!`wU)`-D(8=~bXM(C-{QK6CVPWZ(kW7bFAY zPEJ79$s9~NIhEL_5_>+ePdocD%s_$sj^Uz{3@*W}+jkk}oScU%gtkCvV{nyluEF(= weuMOzJ@#8Y_S2cBA4Ky(;vZOhq>(jy@bJ&KQIegBLDyZ literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/item/ElectricItemHelper.class b/bin/main/universalelectricity/core/item/ElectricItemHelper.class new file mode 100644 index 0000000000000000000000000000000000000000..375def329f1b12c6701cb04c0d246dd1c31900df GIT binary patch literal 3009 zcmbVOTUQ%Z7~Lm?grt*{Te*}=DJUcRK*+@xkBWzi=&=`^-!rRT3;OGm~@KXYX%+-*@uI-#`5VU<~;nd;+)j z3&w%8N_tM_WX86PjA6e_W=u;a4O`}ubKdA8e=NvcQCdOx1seDC13j733p>fj+k4z7 z5V&s?4EupVT`ayX;GZ?KGK@NeG}I#?aCyln$VdD6ZD~Exw{udUdCAP^xpmz#)NgOl zZ|@o0}ZC8+*TeJ1di&Q!tPlwTjmLQr1 zx@)b~(26Sp!5wM4*j=%BHSkmr?E=H+&|g$I<=|dI8#*;yMVCMm&sdciNmo|oSNpQW z&~BWgBwiy}mA018qs1#K0%7#vS`fVgjDj=yrJ7RZKL;$=>Xmh;vIqL zX_hSO_O6CO3~>z|5vY&3@$W%gLjpGhG{VeVX5NEJsRb7lrUH6X!w8ZBA+zAcQ{bD} z1p%v>?Pk(NX@+qNcY?TGEnW1Yk(@R2Mcp>GjT~KDHnaOVsj+&;Da=!I-fS^`&M zOQ*4RD>4<|RQUHaMDgDLsD{mWT49#UL!h^|Xjc55Nj7v{aA)wq%-Q-5%UUaEj9V%r zHA1dVOTJMGEaGU!ni;*>oLP{kJk?Pd4OuWH{TZ|P zQlPJT*LDlpZ9-2Au7O#B2UR(iE5D`*0uxmMQs)?`BCx07Id*ujt(p5)M$Q}R+H5ap zwDQHhlSfqX<2rZL@ooni_{B??&mey#`4)WFCw@S~_x$i7%%_?LLb$}I<}Tnn;*3Rc znImfRp9Bi=y_NVK>BMU^{)VI1kpCEW52J^~uX8vJI%lbt6+t_nG4e>F5z{nt z4lP*YMZC!w#rXjhkQXK}$+!AS;l86|3sd~6!Q}F;54_-*|qZ7rC&rrqm(rM$z@|s^dq3N^VfgFm>GI za|E|B>acHP-l;#HWxvKezmyMt_woMwosk~#7-nw~LnH+kG=>afb>9j^e6 z;0t`od2aE5L(oqoPI+)4irPL4YN7%vbiy%o0>wJ?n2i!jRZbugJ%iGegX7jyz{3f# fig&%;cfH+OS=TX)f6JPwz|cHd0xx)`54nE;SibPR literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/item/IItemElectric.class b/bin/main/universalelectricity/core/item/IItemElectric.class new file mode 100644 index 0000000000000000000000000000000000000000..7507453cea528ae3789fa01da653e88afb804c60 GIT binary patch literal 582 zcmcIi%SuBr6r5bEvGvvZ6&1y7#Eol(Lc!7tx{mR9Nlg<>b1(Q4evk`4z>kuiTcYSf zP{GYP2`6)AhRN&O^9z6z3?vGHquSes;zB!eWKy)orblH$BxMuL)o8@^JdY$g0{xk8 zv~t>4>hfmB7>Nym)8Fi2iZX?$E0Wk0IQ$9rD!9Y|fo||qGQ_F{o`&P^v7ZgSJ7DIC zHuq;^Pf5+KClmEu%2wHFncC^WAGfZ=O=4*5EsGmel(Nz(J=C;F0@uU;Vs6{nqm92voj8)l(^1anJg47R=o6}6DtcL-2@?OJ{_qRz8`#uGVqQk+B)tJPBOsFYP6F`PBGH?aw nmlh?bx@G31GBOAv+n@(B9B3RP12Yh_0^P{~q}hQa69WeTBJ(y* literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/item/ItemElectric.class b/bin/main/universalelectricity/core/item/ItemElectric.class new file mode 100644 index 0000000000000000000000000000000000000000..f81a9a78a7f0a640fac9a918a24f00f01b828d5e GIT binary patch literal 4887 zcmbVQ340UQ6+L5XvE{*laEwg};FttSU_=ZgfG9Y&4A?Q7ZS0!RWh{@yfUHqQBL_&^ zq;0x4wEaSxq;1l4P1lg5t#FbyZPO)f{zZRC`}N#6V_C=+{sMfAX6C(j?|J9md)^&B z_}|;_0@#NS!f4R2vy`{yO{Zw&%$%8V9V=tGSCbjrF_V^S&LxL<8T3cO2x!=tH{Il% zl{YhvG3zc(3L~Up*J{?P&1nc7w(^#HL_=dNKA|BnV9%HlG@?aE7)=pqSfisAYc;Gb zn(j&C%9v|pE{|E)Obwf3L-CP1SW>cdy^g3X)xD)@W6sFZx`s9#_n=)v3kOcwqh`Ud z91S0d)i+1~Bi!++(%iJ^j2qKA`j3v-86!7gIF>y7F9YsHtEi!8WHlbDSWRhYHD+dp z^0T%xXSkM~*Ki?LZ)=KyRL!WFcO`0toN?83l7s5$jCx3oTr%d3WXZL1$q}pQrq0JF zny^I!go$lBx^SO{=B()s+ohaI>|Lw4j;Ceib{+T2N}Vei7jJQ>uZfw(KTU`;rtiJF zFVv@=$p2oGxr z&l|atd3sjE12J!p%F5~KOU&X_yy}%_m?^Ob2PLl#X}G6)i9a5nXvSe23FD(0_N*8_ zqhKY?yy;}GCeJZ#(^gRk-!At$j-rqGJbe1x$l#cU-jx&J4i<>7AL%d#>XqcmYjq6b zn1%?$;N#J7JeL0O?&~mi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u!yFaINrdUKALBVMY1?a?ruy`NPoA0vZq0dFAfEI zIs=JLaz{S@xTH_j1vW*l&QqBlV|iUrc)S8jR`4Y87yOk@=?d@RZz=FQ(<WCY$Rh-wh5BO2^4gEDp1}@o=p^C z2^e9}luqP!1Xi}={#NZ(w-M`|FcrhHi3(^!o(!?A- zW7u9SBZt`#m}XTCHDBo4t66sB86BrtH1Ga3@j1R=D|DQ0L*8R)vUr(@d3%$Wx zkn#vR`ESvy2ok)pX3Upl(YZTl7S-|s%iE=FYXH@qHSK6OcA_L09SzpYQ2eV-x5FnW zgGG$1&iUTNC=7v2GwemKyzHqC&kbLIS#=eMc~ay1s&VGK!WHudBbj-fbDEY6vK&qB zmXP8H z>VyA78tV3n^&1Y9)^R9>WiIm;*T*$Hz=-x}urFy?hb^#JUdJhchw2}fUkdz%uNw-W zvW{~pJbd-ssyxBP2d|!`9}!ziSe_s^#VJc}`^agAY|1!@(>TQ1J;HiAiWZJ1%&iSh zZC7ofF$Ym4+1|VT$--|qcPvp literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/path/PathfinderAStar.class b/bin/main/universalelectricity/core/path/PathfinderAStar.class new file mode 100644 index 0000000000000000000000000000000000000000..a14879b0a4f1c9c37bb984ef1ba441b44de0921c GIT binary patch literal 4203 zcmbtXYjYdb8GepsOSW}v=bji6*CeU2WH}0i0*N50k>kXPd?5~YE_K6twU*bBcFk&K zlHM<*O`%sP6jORhZ*IYD!whk7JJVr0oph$(`kf!pX@5X31EJ5^UD=8gL_PhWJ!j9p z=e<7fMSr>ZyFUPU0B=N4Be17rnX`sd)bd8&&|SyWP4{9_w;dxnqq$SbVLm2JD{DAC zBd+E|P%9AopYI4X=~_Pjn5LgkPZ|1o%FBGn<$fhG9b8HYMC=*E8Zlgfmdvy^t0haW znNRY7-#k7nWZyqCpqdZ z`xKW)Ov`i+3Y_h%a?SJEttM2VUL_n@^Q$L=yK!uvcLHiW&i;B<{yP zsxng|CLg|oDi!R?%H4jXO#YaJ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N$R zKPLW+@VvN(1SjH&C7cXl4t1f01P>_u%p5ky zq{6GM;Z6PoU-%;8N_#){d_!2FQq3O^~tdAfQir~n* zYBJCK2OHM4Y~TGJ4y)sx|3>CtXoyl6`-6{k3{Z^V^}FN0$EDNP@zrZ+<2K3dv)72C z>v--eKUXH!5Pdm}E%cg7Ea_hl>=9~;30S{Gy=zI42sjURGv?nI>*Dj9bJ*G)?^0W0 zEVGDni}=o1_tkDC%a7Y#UUhha-WsLdW0ZG_5jxH2ob}|!ecok1^1s51Om<~Tf^ky` zUC;j^-^0t~r~Fe7@h;*KHa@{<^#nThlFq9~N|l-4lFqkORU6<*Pm*6c!poAvLBv!| zDwhsUL;=SI@>5o)h{qE*(4v+&OUPUZR|7{3gbvPQOQLHLKiKgWt}J3+`Q@3A*s(5r z<^8`WR-Dkr-~w4b4Qxb?HOnM?r?HpoeiSMkky=(Sh1Y4mAZVE-X5>OTZ literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/path/PathfinderChecker$1.class b/bin/main/universalelectricity/core/path/PathfinderChecker$1.class new file mode 100644 index 0000000000000000000000000000000000000000..79a74cd435ddbb0027e792e552e62c0cec766504 GIT binary patch literal 2977 zcmcIm-%}G;6#i}!vXU%_AZpYCt*8kE*PpZnwN;dwHXtnuD%y70T#}W|F79sV_}-WP z3HGfob*AG(JEN%WOs9SAztriE?=F!Lrhqcjo!Py2@1A?^Ip_P%Is3=oKmQ8gEFNfx z37oFE_OkQ?(~*v}Lf^LR@S$OOzBHE1uwqQ{v0%F;>5o;UwJ81mQyLNi9rw*;({N0; zY+Rqe&z%~Q0{LyU6_mO$({V1F)}lb`vg!1H<@ruY;84+(p;5J6Y5C?tXhh4#tok@A z(4{2pvP-+hJeM+|=L-za6*oU{-tnwOqfi&OJ$K6YmTfxnN?mCBWf`thcW#H;lILyL z4lfFPlik9Jo!Po0lX5cxi7~GvTOqJVhlX8h)}^BrDK+cXk%pc^9Q$>&;ebFqt2XT} zGX9gb>b&%CnDdSl=q!4c>CBkEt={X4iLhb^0%x}{ZZq;Q_xm3E4I%=NGl!3a9p6BUS0QX>4v6SWoBgyxn??Sr)e~W90oNE2xK?sb+d~) z@)#0mu^i7OT={J7^`oPXGjyE9DS>@euVgPgobm!&nLqA()oCV+z}yB-Z|lSx8gNEu zEjlOA#`xW^9eLFaS%Cx!8_um4gu-Q&)|V_x1_9x1Ldqb_k^ra*)=)*z-xV0xJfMw2 zQL3rBlEVAorjb`gF2ekh@0$+;9p`aDAZZ3gI|v1iX6IHJwyqF1kxq$?rttwTY50&N zX;4pn(Qz4L0=q1atg&6@L3j2)^xaX^ysBdy9|@!t&z6=HPDJMv@otL2w(z7ejDn7j z@rgjnGTnOpQ+$0xO*z`tiwPZ*%89sHViixW_6mW)Eoiu*Hn1e5t(xx>IaLja)fRi3 z+0U)5uC&XQdCzC`y4Iz8J+&zzY~BS*mR_Z-fboXD5~L{PQD(OjFV%u%DIz0j(5!6} z9+KnJA^YBhxm2&CyF7PVn!Z&Lxb;63z&ow@67w2Nf!yXPumKSr76_*1%b@0j4D9Z8 zfmL-hjRj0-DAT0|qxpet$BiINO?x%plH*KB))v+En|>lrs9jWh)n(lZY_~ii!-`kZ zP!%}&+Gf`ONK^;&wrRdwFshOM3R42S_Mfn`j;;ErULZmIF~S`C?>4kkYBy&W5krFG-hshq=orX9L+8NIGrm5@zMr@rLx#^JrGYLS zCgdr|;zQB7K?IkY8@GTB!wBInSxqDg`yuYUpFvSfh( literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/path/PathfinderChecker$2.class b/bin/main/universalelectricity/core/path/PathfinderChecker$2.class new file mode 100644 index 0000000000000000000000000000000000000000..14867f2dc3e54edc8cd8792f9e67e9037882fc97 GIT binary patch literal 2905 zcmcIm-%}G;6#i}!vXCr4MA4>Npsm^f!BtdjiK2p1(+0GnprUP;%_Uh`c5!z@$M^md z_N_1NOvi_IMp4_DPW#$_snZ|dT_PA7emyiZyLWT<-0z-qzVDv1fBgOPuK>>Ak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Dt(n0&Jm7p8`6z&!Yfjbzpu4z^8&Oa;KEur@2ouw| zMeH>0<2DfzM7)Ms++k{aaRGN}mn8ZS?qQCJzR%rT5&sKq8hXT^n2Hhb0X|>L3?30w z<-I#s3!KA&@6a*u3}574LB=qfcp87Y9!_V($tW4RNS7}$(_@kAy=y4zu6M7y-i=D+ ex^jdHIKrFF#~2=Bkz)c5TrBe`MVAzr{QV1Bj!0tw literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/path/PathfinderChecker.class b/bin/main/universalelectricity/core/path/PathfinderChecker.class new file mode 100644 index 0000000000000000000000000000000000000000..3f5944e34ae745c221df8556c84594c025d9ebd0 GIT binary patch literal 1517 zcmbVMO>fgc5Ph4bb!tLg0+f&NRa&Gbr8TX9OArSvRf-g$N}wRr)5h60+qmAc-UM;v z$j{+a2_$|1KMFCM6ogbe3Esob>}qD-+nHzo{PpbzfTwumpuq5C5X+&^36Df1LZf9U z%_l!pTKK2j^!$C=4rSaGI_Qb8FSLUqLv7|PhJ_b0mgXhHmyK2|jDI3y5o&&D{EtdU zUH_fk8?Ee$ok)d!zZs~Q5{*>xzE(p?j2Z{IvTALHVxYRh!6L(MHgI|a)^}W#aH))W zl&3r@AHSTBaxsS`%gSTe*_cpd^sJ^GY`~-F6%YFj+Y+xugLyqT=?MLncOt=1X{nG$ zZLXy~pI;VDPbSp1X#f|5(_ok%O`M@RK?p>|aD61q`Mi~8cs2nnTOCwM9>t{Oe=0rC zHxh;q|1VyCDt#;XKgv~^f=!96wH@5aqt0CyRot^WxIcw;Mk`Xtq_;mM(CVl*b2LMJ zb`A{g8#U0O*ppV9D;M;&eawfPq1>e3gbpH}BqG5o7=0FY74VsQvOs5tP6y-_$$Itg zD81j@dVB`=441!-0+(rbDFL{OC2ZmfdG&EPDs*R;hikY_#jLl28>46sH*t&LNa(no o0#qFX-Aw`7CZN3;fFAq>S|y+Y9uk29*04^tLSBiiUDdJq4ctJ_E&u=k literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/core/vector/Vector2.class b/bin/main/universalelectricity/core/vector/Vector2.class new file mode 100644 index 0000000000000000000000000000000000000000..bd09e64f64b743397fc5b64dddf5af34d2172dd7 GIT binary patch literal 3222 zcmbtWZBr9h6n<{VyAcotBSxztC0W4Kw^pR}HBhmDtymPT+GVrA!jg@fjiaCYtuyV{ z&iEUgX**NVsWW}~+F#Qj(CPHKcQ>0D;tWoi*}X4&?(;n7+;dL&>)&6018@fQ1R?_Y zdc}Hdx;5Q4ZPV~v%dotsMZ->;FTwrf= z_p0qwOnuol1;i6RB|c9D;vZWT%ex@Zl`kv`M6Wt!GYx_64ASTkh~-Nq`Jrdls+jZj z&1KWQ<)ie?I)-j9>aHc%!DiH3vuXm`>`ui`rqP9dNwzCR+Wi?Mkd(6n8KjV;BCF!v zQSxTeIE42SI81d-zvgsrErTOCO06rl zsDK835kNEH0$CMLxgX3Dy9@As&Ox8>|%UpxOO)k1=DU{~_Mn>}67mQS%6%VF z&ZJUF)1$OX4+e2CpgFC40aDs87!`i_!IQ(JoaI-1%DvKA0WQ02|=4i9-bq*%)_+CQ(O4tc8g}e zY%lW6C54yqEdx9ue^Iz2E5A+UMk5d-oNZTGqRJ_%oPLYSOM%MEp~@>kwPYLB@(NeJ zm3c154pno#MQ=9LI~C$x3h)M+c+)=IbO*Hg7PLk*1v^e7h8@syK3c8=+Rct={51(; zITzf>&}+;r^?mjdbF#9w@Oj^@Ei6i0&bP3%h5PMYYq15okCf|p2=FXW_~)EF*9b$&RZ$VKAlMA@@8U| z&$)c!fWB=ABc!nMWO6o{$RxAliQA5ypKC+|Q;@%6=rmxK^RFRLZ~)3|t4Y*Phyu%jMH_+GrI0*kE9z?mn%% zrE9Z+8+6whcjWpqfdkmea2XRvv+Z38hh4luBfOOa(ZWftzYe+<) ziCfAf@V+5yUm)w=+^m%yccS?A+_Ys|xvZ9ACvFL2mqJ&76hR*u*sYCmER#!3(9Jt> ztAXDscG1y0vDd)9Vi#TA6C`jDJQb+$x7Kd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alelectricity/core/vector/VectorHelper.class new file mode 100644 index 0000000000000000000000000000000000000000..1864c1b0fceaf400352a12cb84516c1ed82581af GIT binary patch literal 2367 zcmbtWTXWk)7(MHYq_|3&wrS{(qI3+_#MDoD65DGOze5i zz8%y}*LH0y3>?b|9~+h**v3Ae{lM6Wre)jRwF4Cif&Pc)zG=9ow_}vH9#SiCer>TZ zyPn@z{Bm`6eJ%gFKzwsEFQCm>uH!l3T?*2f4S~eGU$s@76Nqi*dmzxOBMF5b3XW$N z_i9^qux@U-w!p=LZ<+3f894H}DO6@6cPYeiQAa;Cx(vT^>H`ATWd&XYqxWjOAm^&M_t+HQVjg6j$0U_7eA;vp6NzN=B4H}9k=ni zKwo2EFCbv>vURyG`H+7-Zh}hzL2^g6g{tsEn`uz^xh& z0;oWf|ig z9hWh94pVqf$NTtznOmmUG?I9B$(zg<^d2E0aJ}8O4Io|+yMEn~XNXmt9WLf4Ti)oi zz(_}k)8SAtCvdy%0Gtk73JX|Lu_%y!d1KoyM|SjMEVE|I^*vr7|z(XoO8 zc~JAK&i3Q`&88foEU?)%1l=W2)KS8HUdL@L6UcYOZNitIlf0U>EW2LMb)5Cnn<`I3 z+20E+dx^*iTsZk!nUw6uFqs(VtBFTNz7x1gLW9b`Ko6h(=34%K=vRJ2suJ&4e&wi? zDv4yNl1!8;s#dCKYN=dFG*l{86e&{0Et*1AGEyZdO43rHSmicNqe^M1C|0OGcBr;g z(jhHWsBi8ZtRiAwQ0P~05Qr&vIltOd)yq0rojW~*=M*pJ;q`35W`QQQ1K%-#!uwa7dann zIKT*QP)}EQgDZhiuKAHLJg4&3=s_A88fT*|V;p5kd*#8x=nqWfkMj zA$){;3@G!{5&H)tDrWET&s2CUD<{Rb)JbEyCT literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/CustomDamageSource.class b/bin/main/universalelectricity/prefab/CustomDamageSource.class new file mode 100644 index 0000000000000000000000000000000000000000..7e015ef2c6cd42e8b98c42a8eabc4e7151d938ea GIT binary patch literal 1490 zcmb7ETTc@~7(D~@Lfr~h%1!PUX^V8hD_TUMgv6xyAcTa+VRtC2duevJkov1Mn$}2S zeD+5fznN{olp4cBo1K~So%3DJ%&*_ye*k!lodkLqignjI6Mn#LVGASlEyD^Mdd(Ln z{8%s7gV1w!xWlVr->dtENT82l+7+ShSgtU9eiG{S(6aTvK@91L%rofBa~W1EHRBLI$_RAkzoxZ7-blc zB7%pfdm;#^X$(8v61!qT41P>ZDg}&CP6y~syz&yi>Q9IWi&kXbv$JPzcaXeS|Mb!#IzoA#Cxpk`Q zU3){rBJR_qEH?L2_3KR1(VD8PZ527PL58VIn{L^*cP`8~ZrP^>&?Vg?|4Y=Sh7IZH zG(mSQUqr5!CtDg`$&*xcS$8dIkCE%QxF`$5EV-(eo&tt3X)XGSBZ&n482V|ou1cdSjrl#es R>Jt3AGkCIV@U|+o{0AAWQlbC= literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/GuiBase.class b/bin/main/universalelectricity/prefab/GuiBase.class new file mode 100644 index 0000000000000000000000000000000000000000..8336bb34b3e063950702148d3ad12491b530dff5 GIT binary patch literal 4134 zcma)8Yj9N69six(yZ0u$7f1qEQ9>X=FiD9EC~FN=g+SuU0)Y*oYHf4bd$YN4b9cFW zHxRUl7U|oz+R|blK8jLXYlT8gZA%|^oVH&&({JreJJWHdGyUdFzjPdh{?5Idhq~G( zv*(<9&j0cIKhOE&l~*qVxCOt{5EEEc^_&UYub8gw+J(S(3QjPYF8lVVc_2Mdb+(!n zTZ1Cd;n_iY-0|#!Z;l4(g6r5`kS?Xwt&cTJsGVv(&X&XKtSbc zs8r@+v*S6z?E>-6u3-VCuVmRt#IaCE5~)TAH0ek{m8%vV8dQNrIqKe39Y0|EL*@aO zN?LNIg6R&Mz9YYDn@TX|R0LM%{tvr031|`s4UpQe({XL2eVL9{sWWlJv4Sy)qD@Cb zglDCWc6p|b*-mjRkcX>uG|H`{<(o%lT%mSmv;AGeNuJ-RqZ26sL!NJ=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mUFd{IAu5hh&$kHf-gzJIupjd}P;tsx6M=&lPg(sfni}N)c z7JuMN@=vIUzatQDpep`}qvBuO|2G~G|G{x_1rNm(oQP?7I3{0Tvi&|rq)h6W`sM0D zRxK-&tEhhE>Sf}HW109{*lZNEiNE3k=@PVQAuUn)zgxUeTjj-b_$hZZzL5^#B3BK> z{CiyDs*%WlhAFO+;&ryaSGYPaJ-CPab7@^e$C%+Z2T6l{TJ?@p6dVr literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/RecipeHelper.class b/bin/main/universalelectricity/prefab/RecipeHelper.class new file mode 100644 index 0000000000000000000000000000000000000000..0dce6c05855da6a5d395240c8ee92b2609f6f1f2 GIT binary patch literal 4148 zcmb7HOIIAn8ND?#&^%faLIMd}k`a2%41)$ELM#n_2qY{L&;t+(D01A)G^j;S_o$}_ zgq_&2<2;=AJ3)D8VQsufHb_J{KFNlK7g=iIACN`P$v?0&xz*kCKpF?Kpr@<4>Z^Ni z-S4a7!~gu{0|5Q_y@HTHv|t%ax|7#T-PF^rW26mtC7E;dd2KE^p{I?UenB^Lx}zW> z&~i&#(vqfTEhI0^-QswG`a#1o+!qAG(b%*=WZ2H=O$eh=MIGt|c8wX9ezB09)14`8 z&eR23$LzFbPHT=K+d*fp0qq{L+LLG&W%`+7+}3bk_*$ ztzb}%VYw7v#x+Y@&>a=~uwS5=07tF7t66FCPDW$3pnY15lwA5L6;I=Uz>YFiiHy`4 zs{+~M(TqdrRPc1D1B9N0#WX- zrQhNDdrJ|jyg()60!RLrOr!pGH6w2Mrk20xL8nh=XK6rfPwIVo+>WCgiY+ zb5gN-{dPe!^U^LODqi-w96f6<>9VVr0~{~y1&(bixZ2>IaCnOqZe=w- z*08SV^;#^;!BW06uS@Y+Ae)R*ZQ|T#wwOw>Ge%~@+b#h?s$s)rMn^Qqp${XbZt+Kq za$GsAf*WiyPf7|dZcm*m+fMReuofP3+q~^8=*hI5&Ds`!ta*cV(EBN{o*1^3nvG32 z!N8&droqW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o>3|bIE{k;l( zv`dleLwA9!V^jb-jtYnas%c{xlyOWT-l#h^M`M4N$i*&N)WPxDH*VREtQG>Vpvo^; zg|LW%8a5^E!W=&jrSK6>X!uxQdpE_6Pnf1x%ittVv5gJM@uoiiZzMXpp$NutR>K*A z-q#H}eYYa(>K@48TsY8m&J>xnDz|w_DE((T7%y7EO*P-I54ZItu({(i)vVV&KaiAH zZx=2Ek{wSDvpB~a#qxcMGUiB^kBH4h@3_!|`QyrCm`~-xXVeaNA%Cp}mk3f^)n~P)xn^1p zd~V<_iH+Dq3lB&3Ax10kB6_?uS$Z}ai;l(@@#tVKJ~EbAM$c39T^(G;w#V3&Pb^_i zb|04|?9V5nODNGHYbg70_Q*rrS+#v{3Ga_-d2LM3YtKfL(b3c*j_37UYGf>(PiK#O z2R)yDj{X0YBCS%~kBIvzkxS*04_1C#MDLiEJs$l9(Pey?*OqWveUFP=JQsVgV($2n zWu3x9d{4PXLmFmy)2NaaDKV0vlY))>+d>MCpoiXBTtP3c(sG@?Rcys=Y{MN+?Kjwt zZ)tmoo%jK}@CduH%!}|TWBh^sklOnpr7!Ra&NB~*goz2Fh|psa7x;|fcU+_`%G|%= zQ`!`cC%DA7II}Kdif0oxYv-A@^S{=x;USN>bl*sh~{!SSobA7ESsD#Yv VA@}E*L)F55wV)+wkTgUv_YdWu5uN}5 literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/block/BlockAdvanced.class b/bin/main/universalelectricity/prefab/block/BlockAdvanced.class new file mode 100644 index 0000000000000000000000000000000000000000..49ade59520495d35f6cd4ba90cadc793ebf1296d GIT binary patch literal 6396 zcmcgw3wRXO75?vLlgVy|1Y$y511N}^2WABoFcA?5(X}B#0>mJ#PIf2B!e%Gk-Gql$ zY->@gD5WoBYpJ4AT3V~s1tnVS1Fc2-vQOJu`+iybZhe&Wzjr2+$tK{}@9XEc-_G2* z_uPBWIsZBTxiilkd+Z4S=Lw;~ClKyW#s|z)+DMoQGnz@oqw&m^a9_&oG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VmW|Cg4_mMZTbbzyZ!mVVU9ijxciK)0wa7}SGNl+3|)<$b23PjyV6tLwSLD+JR zAZ$5D5Vo8sV9SnzpqR~_USU+t;7&8~XOiqpq2n)%kpT671%IV3L0a$<{)WG!h;}@W zfAFf)nx{z1moYwLECl~#tC&{p!M`}Sg!Zh(zws*deUVlDHI7bE^t~R1$1q#N>l*fm zVX9lA82MyXe*eSjs|Hw)HSF{Ge83z0Zv6(W8UmaH0w1)>o;Wz%c#e6ZkL5 CfdUNx literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/block/BlockConductor.class b/bin/main/universalelectricity/prefab/block/BlockConductor.class new file mode 100644 index 0000000000000000000000000000000000000000..a7fb68764f93823f73221c04396250eb76d69ac6 GIT binary patch literal 1351 zcmb7@T~8B16o%h{b{9%3T0XSURRJkblttr}B_xO%n-p#!cs<=6U}4!M%N9TWi5DjR z1#cvJVf5DDWQ^}@ODUy^n$1pUrtdlDIUoD;_t$R#9^;{jK7r*%;GL@IMEc5CP8@lT z7r(WSBeg5*cHIx1L;I;-*TcYVIB^)6NC`{_Dz=ZjKsk}zjk|QQd^*o5#7+p*4s|zxwKqUhELR&F0Nqx_9IANq( zU8}Y`JA?^XS=`1Qay5=!c4f^ykPbal!(PW;7_h|s^SV#zgjHa&i=`t4R#v>>Tjfi1 z@lGJ4QO|Rk?K17125YbtOXqMy9w)6fQ5KlFT(_Q<0%KvYsl2`YdKfi_cwYv49H5oI z^s0-i<1c20t}H1Gt|m{b z=;H$z<;61$eB!PT8LpY+Hb><(4DmePR3VETPt@~%m_CG_vX-xpiC>^pUMyN;sWar0 z-_IC*k}jlwVB$S;h4gn!d_hq_$LddFjnfXuV-O>JMls2uo#jyKxT}mrkL|c6+=b3X z-%VpCp(^1XcRITg?Picl{FE?9zw^8ufcS-36AQFk#QhfS2kLYMtTv=kFj|ntRmeQ$ yK#{-}QEziMl>okMI%xx1Z9uCHXte>Y79hjo0hS1uA*@CMe2RGabou>1!me?cYy literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/block/BlockRotatable.class b/bin/main/universalelectricity/prefab/block/BlockRotatable.class new file mode 100644 index 0000000000000000000000000000000000000000..4c943e7e99a83e14983f1d328e36e1e4125ed484 GIT binary patch literal 2576 zcmb7_?Q+vb6o%hTY|C+kaRY&dPeTjD;X^b)`r$Mofw-v62ZWG7pv8(TCjwdW$Vw>v z(diBJI_PxzqwO#$?T=nSuc9~7PTyU*n%IQ~lF{nyYIo0b&UttJ$KSvG4&X8@4Lt%E zH+^@@30s!uc#a)~uI)xojb`Z7tuxDv>WyS^Ju2#gHR`c7mtT;H)ns~)w{8dl_luH_kXZKGUT7D!zS zYEBNl=+~hkE3kK#>*hBbYfiW%V-Oga4Q$I>wz!!6_FyX7a9aYSv#%Ll0$LWx{)-}T z<~32t75FN-H$96J2#8AR>NjAvp97i6KPf8y z*9Ra=W1wr_*7Hq1rq=v7T%p6YPjE2(!=R3Bj z2jRM7*g>Na_=ei9B1f*fA%#mQ9m6OINTy3EO5A!(%4yhru$1iCLhW~d_}IfR&mw;tGZWIl2YxHa!^VT zIM(H|ODSZt{B?O?GWG^78e&>tk6JxvHQNWLKk)CgoR!e=?G1s2H_DLF25oxQQzvXo znFoTMvRSEAN~?X;!=#R@nBs|9Tv(b~G8g6_&P^>Xns)_y@873l1g`10jv1zf<=;`R z<(I>l>fBA)w$p0KbM@u|IfYMj+yD!r1!2wgEsre2CH4zVE4(tJj$|AMudl8&|4+=k zzFKaLiB4^}5#y7ud+}?vAGdH@!=ga3<7BjzvNI?hOSnT8Wa_iJq3u*$smy)KYjPJ~cw}u^sS{L0FP}88q%`0B8DQJT-UNF1&l_vx z>@UduM5_ln+ngFLaQ0i+!~TJI7V_B39_ORLFVsHK)tE>fDedOg0(x$F5e7Q2O3h^s$ra;ag zITABwI1l8I$-NxUO!)E~Usm7q312?p%eVQ2{CR16Ym!aU6_mH3G}DsV#>z^!JVz3D<};aOZ6W+4RZYe literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/flag/CommandFlag.class b/bin/main/universalelectricity/prefab/flag/CommandFlag.class new file mode 100644 index 0000000000000000000000000000000000000000..1b6097d4cc2ecb4fdfa30ae74f36e739de36e28a GIT binary patch literal 8522 zcmb7K349#Yeg59g?#}FLEbNtKv$nzG1M9FX*}@oD`Mw2`e8`ru!G*Cjl9sG?#qLV@ zNT?fV+K{u(;n-;mG3DlQyRWV{?R46E>N*p4 zSKXRaPmi7KSkJKzzrd`dldbECC!O}R-I=Xxcb9Y9R@)gzz*w`Xxp`H~+E#(GTbu5* z`|Y}fo$RV>C4*#FgFuOQti|r(_DIn!Jt@U>t(~<6s+%q;XtTSY)QzR>iFh)eT`r(i zR<#NE*Q7ce9ajiU94m~0NnB6FGg$*=0-=nPO*>ujRMJ4XfSGoBQpCrbnM#7(5Q0F| zL;yj7E1C#JOJC0(C%w(ylTg~E+U-P}osP?AZ!);l6KFx@>{vs^L{(g=WOZ}m{(aK+onBtG8T%_52GG8N(EyA<%LH)&#r1SuvEYou9G{L zn^=LB0ztdCmm&+$_+zCi!o?G`L87_ZL=6@gSSuhbNpro44Ol=Q&!$|S44+;*y=XKx zROs?BR4$(FODA*0{B}A$S4M=BBW!kz(7O85}u|uG8G;=4JRT(T{?{m_1>(tX`^$sw?nSe0=sd$jz1um%S}Hf?f~e&rW0-yOOE2BNxYU)?Ee&fMzEWQqhEo z9wcetLeZH|BDuKj%f=IRP0W-HCFn(3$6Yk2^5^`Di43xYH=cFUb~cq3m@?{gqc=|q z{n)GHZjv9NkXtpe5BuqZNoOyKjm{fhZ0dMFi^3(1lE*EK1GvY;A4&zoRB)@x=ouY< z#Ef-WWZV-W9K^jQ?t>xaWA!rdA%=)mDHs0K#D{S|bzrZil=0D2%pyRsqs9!$Qcu#!DpEg_VV9a znTkFq)7ue&8I@}$N(*azR#7KDwscmPM&Im1LgS zMs{I5j2la^1&^BeD}0p>ZFh9YUCqo=sv5B}jLtBMP~#{{4YKqdz)2I2;|Vqqc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Jgwye6jS|2zo7OPs%IdL6pvJc_F17eA|o;IBtI3#W$+J4Lo+|M4spk)_} zUy7Kl^+fZyH+qA&Uo}UKR(PXBydSDLTKjp?z!N&{ci0;db$8@HEF$iRR%sDS#WEPg zu-_f|9~2>XM1MIamWve#iE6%;c1Pc)-PMR5)FM{$Y?vO{C021?3FTfWR*N z*=y-VH%V5rE=8bW;Uy@rCoW1ouTR4;rjK-cBRWg=k#P>o-!Tb=(sACn;%lXE0q#VUrG{It9r%!)$XESkKIzlPuPHsA|9B0n*5H+q#&Lfx+9ynCY& zqFJ+6j)b5EGqR+t*ru!xL)+mrWcxUMNC==_X7-cn`PH53r!!ZNztSi zeSkhx({C0cCYXRBnK?6O&hLC@<}82z{r&^s11^$?37iZ)XQYCGbd{^xVc@i#@P~aD zsIF|;U03$(8iynj0_CNSUde$HFm&h_)pLALpjuxla&r7qAmPbA8M*p5Ig++3y`Ftb zWnPcIm63FZbgq7MJSY4la8Y^@z1$@K+V3a>acr0{kP(QN%FQ$cHchNxRUlJ$Jased zw^Y!OEjQBQx24;Zfuq;c%|!Us83+`Y6F~8emua1^e}1RjG$?#m7qX^Hcx@tyl(zOw zq>&O>3zY2C0>6KA)!=)V>YfViJ_~FIvK!i7E41lp$lkTzzw?J)=d#>PA!*<(-X(D? zaI`4E#Cx0wqTPdV@`;;JXyjU08>U-dXs^L?x)>kochAJ};W|@o6 zWS&o~+rYT>he2D_9R0v)-R9@I;mD;Xej;(sYzJCG-)S`SMmZa|c z9b<1s&PD!B#^y-aLWVp|wOu5Sxg(n5&A5-R0M2T4bWz6GAw|=2;4^5}FM{8Eq1iw%G0da>5@aNPU GgZ&>&Ee)0c literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/flag/FlagBase.class b/bin/main/universalelectricity/prefab/flag/FlagBase.class new file mode 100644 index 0000000000000000000000000000000000000000..eba3aa48188326dba3aa0cb1217ef964006fef23 GIT binary patch literal 958 zcma)4-%k@k5dO9;TsaO~sED9QL6DXr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I|qe>#C1*$3cqPJCj7SXt_xXOc5_#vt$K1_(DVEw`gSq!1%q52+r?0F7sKy)nP3>u zT?NVz)<7>IPlY!i5QjK|Gx-%fZ!3Pp>6WYF1;$k_M$-UiaF)9?Mli|~#bt&86dQd9 z1I2S6kbl-f(8HT7?Yl#i{-!0)Q?q(>T)-G{(lBu`!keItikne*A8_d#Cf;$|RMVu? z7o(Jkz|y#e>k)((L5%KT_${;)6GEgL4|gzB{DkQQ-lC(qo=@OeQNbs}WDSPAa(t^g f3^DV^aTLSUd@2@lGzxi-ekmmML595_Qhe|ecdl*_ literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/flag/FlagWorld.class b/bin/main/universalelectricity/prefab/flag/FlagWorld.class new file mode 100644 index 0000000000000000000000000000000000000000..173baa0100076fb3c8c8908b4b15e6493751419c GIT binary patch literal 5721 zcmb7I`+F4C8GdK8n@yJCVjzJ9!3Ys^*|2~DB^#q$g2W~P%>@%h95zE3*v!V+*$C8I zYg=lyUh5@zX=_{4TH2z;q?oF`YPH&%z1Oxs^m+O})CWu7@67CG6IO*^HfPS9%lE$D z`@QE(-umCmuL8In{|qCbp+0L{Bc_uvQfA6bx{j5!+{5u<$J}S^jqghtgYj+r*_C!u z17QR;)Sc7#%|^!5F#GEE9h*0`@42q^>b4!78YqmPE?<^+S%bFWW*vrf<&4+O?dOE&I<|2owi9+| zc4)8ZbQ^n9gi+C+P8z9R!?EPq?+m*8Eiw>0H%K|^W;v!Yu+2#ib#Cs~aLG(i_Fgy6 zH{HhImh{kYI%^Lk>Utxn!OAc$(NH}-D`$_^aVct<<$YN@xo6F~)oVAd-;>mEL2X?@ zCb~>FF$?vGh0(yVQ|$1Cjz+A~P-eNNW4LKYL)EmoZGJx&SdFz|tRXv73*_GFxD1yw zCAN9U)vzG9f|BBny$7iLL>TKSpP333sGrcW5ltHA44Q6^1rnlReeKzbuA8BXvnk|wbQbWA3{eOB zG%TE{xXoFTV>)Hn&+^)4SSfR$+D%tyj1j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!Xy!_%xJVjg;xJl6_ zWVPaH(iY_3YCJyYSPSzE&-?&*sLqoE1> zWCA}|z9t9*%FX5wDKJ1}CUdl}098*ORgZitGAwaz(WId2!5jD`=Ptq(c$0lW&R&MM zgk_HW72ft?JkHT#;jw%jcK9ZPkal9qwZw~<#V?R-#aD><&!J<_4u7%@-YQON`Afq z;<=(K0l&PL63g%LkWct?KH(dR5MFY;DB&`aAm8PASD<~bnvatEd%5*}1n~fQevsTh zOtXKafd377{x{_LZ_M+*=)?Jcl(Bl(gFlfcs62=qx94MTAH(W~+|kw%djmS3{;cu4 zAR41$UWYD!D*pN$%Dor-Rlf9&EHPzGE17!Wae^78AdbN)qn~8TWofeNx%za-8|2^&!z(4*E;9iZU literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/flag/ModFlag.class b/bin/main/universalelectricity/prefab/flag/ModFlag.class new file mode 100644 index 0000000000000000000000000000000000000000..89baf195153b1f10565c83ddbd46eb043e29b836 GIT binary patch literal 3980 zcmb7``&Sg_8OOixvN*5~Dkxe?f*Zkv<>DA4R9Qk4mAEMo4T!}??Xdf@jPA~CW@k}) zOPln5P47*5ORx4~+nACi)^mE=U+g*klkCNQ-`QCh2uM78&dlsP&pemUb9vu?{qL`T z18^AcXov`OmTYTYxd)?=DcZ?JS%66T177@P(NX1ZPP2clpR|0dT{i88S=F!hp24Jpk-U$ zkih=VQCoUO-m+!dHD^7;p7D(F;mJued&0>VoRXbMCZ+_UC!CCop#}{)>ak6rrZX|6 zVTZuZ6;F@5uDPJxjbS?)>cN*fYOy88r)C|y5fj+zN;5O!I(Zrq*gi_bT%5*LDKUj=B~>{9Xxcj|8iQOu`>}$$b|HgThW2XHSDMC3Ld`D@dP>r>MT#Xrsuc=OzX+8@)L8W zJ0V{xNjoi*A)~9-1EgVZVi>|P4bPDHN@OY9lUeENIF4bGEtqama*Y)iHd%>3nMlQO z5+fQ;v6@z8d)9HY(nve`yki?Dt-Q30mSc~Zw&^Q>7N@D4$ow7>=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O@97baHx#36yij92kZOR6fBwB=)QRLUxP*;x^OaRM4w{2Ju1#=A7Hg4b<>tBAe9MHdqM zm9N2Be;kiuWu9LVRoT6)1N^}1!ESyy?7>NXGEQM1W^jN<-a%^T zAzJrPDR0B8ILx-cU7>KCwX#xt3&o?mrYzyjZcriD;ikE75c}3ZM z>AmbO0zb9mU?$(&+iFdVGrmokG8r*2jEWBffXzj85xv8J||#BbQC;M)n@ zAPPd&9)oxnBdnQC!tjlPRQt<%CC(9ugWTY+Tz27a{{hWK-l6~i literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/implement/IDisableable.class b/bin/main/universalelectricity/prefab/implement/IDisableable.class new file mode 100644 index 0000000000000000000000000000000000000000..2b4b4b6c13ae0c0b4c530306bd7202f3aa627f0c GIT binary patch literal 197 zcmYk0Jqp4=5QX2wm}qSD7D?lRcmxqrSqK((n>fmb%_eMqz^hq!01qYZLJEs%KHhuZ ze7>(YfIU_*0>W-EYGm6<&6>;Js#5h&(OSOCLa4gcT(jv#eo&n(H2aGY64sR*rO?tm z#HpxUldx>elp=&_o?Qru>Lzp}%+l=Y(773G$w#G`u=(HJ`pJmklI}quaGE(HcwLNz JBhKMDk{>~dF_-`V literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/implement/IRedstoneProvider.class b/bin/main/universalelectricity/prefab/implement/IRedstoneProvider.class new file mode 100644 index 0000000000000000000000000000000000000000..6a187d858c9fbfd1afce3d09ababdc3037bc5588 GIT binary patch literal 262 zcmZXP!Ab)`42CmRyIMSW@)`7EKm-q7rBDzo>Z!NsY<5YRNlJEhrLX3}2k@c98BcgQ&+2A8Z3fVYtKH%P{^IPP!kCaF80M1BA-9|q2@D7k1MxgN>0KtyPneyJ_-Y<}03S-6xflXo zyfsBveN=sYe|!R%;j+R&VA^}L=h!LBmUW6ooAge*$c?JWxSeIkK9PJ5NhMWVu5c=F zvsHUVR{55e^)~wiu3AnHCg$4&FR;FS^qj~U&pN6m(OZaiL-O7R{d%W0cimh{IX?bs zLTs6Ia4vZ2ld-fY%5UyGbGjqW)8CwzLMwoO=8x9`qgCjm=7q5=aD8Y#DW!)30w;Mu UV33D6!w_YV3g=l7xF|YCKWbcxNJ>g2rI2_v7aqVv8K)*L-=F;V=lyxU z035K9NCbA1Gc);7Te8#yZyFOGYVdT^wKDx+sV5gybur{6Qh{x!XRWMutvb~mR|I5B zA>IWRMOiVAe@=_4yb9#!`{Wxs8cPg6*FI`80q*cOK*H)JGQSKg)l(WN-KKvxni;EPMbT%CL8> zmE}zGO=jlj_v;(LJw_RN3J;C9Czc~Qc5I?pW8+!Z!X<6Bt!l>=`>2ce5ZqJnrQJ6| zF-V4Mh4Fz-q#gOae%&4tu5e?>uZ6w&P?+7#Jx5(x&qk<>Iwf`Kj?OIlxl?bQcr1!y zvQfxCJ9c^G-T(Pj;uoP2!!Opc!tI~d)3)$HLE$QW0QAy`J_cyVWEdtVEogn@7p{a@ A)Bpeg literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/modifier/IModifier.class b/bin/main/universalelectricity/prefab/modifier/IModifier.class new file mode 100644 index 0000000000000000000000000000000000000000..93cff4d61879bd0f3a63fde01fd4c02b51ff2be1 GIT binary patch literal 324 zcma)2&1wQc4F006tF}sCp*OuaAl|&Tg$2dK_65c{t0Glo{guQO8dQx{pBqJFbtwLq){I-@& zQTJO(Lp7Duel<$W*}!q(5c07!eoMtN)S_v8758Lp5`C9431depR_2&c+OE9E41!@& zIS7Jcjo_Rl4e4P7<2j6Cj4)l{4(HugUFr)_k0fEPl7u3v39YO@*mTUb>JauT|9zG+ zVX7_k*C#E6t&b>Xv7EP0pr8*A`sR=@p*n$)t(u5bgHU*L0UYx!p=v~UTP|LDSi)x) z%Wp6B1v7^gtPUQz9(qTf`#TsGvL)Q@u=SrC5Bkes(Bdotyzb~EORg{Yi`U!cR zkk2th1$Nn{re!yaFI<5x&wSCVy5^)&G6j0ZuNjMmUNr0l{X8An z3t53!;i_TVW>KKysAXH;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)8DX>#VsVGh1TMu=%6eVRRLR`Ld6pfq4q|@H-+T zE~P7(>nWux$-$J;mDK%|(p5Wc=akwz=pifjQu@@f9rsxkaa93b5dXp?DLzyUN>&R}d;Ll6X^Qd1KJFvqWN7A(3ad5Gx@PB`HcTigy+3+Vna1?CD-pmHB0NQp8lnU`uC5ziOnq R4aO+i6HGNR*ef~qe*kW4WfK4Z literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/multiblock/TileEntityMulti.class b/bin/main/universalelectricity/prefab/multiblock/TileEntityMulti.class new file mode 100644 index 0000000000000000000000000000000000000000..e343d62b7318681417a612bf52f4fb7903bf7f56 GIT binary patch literal 3629 zcmb7GTUXRp6#fpELC1gy-cZ}h&BB026qGuOB1%O8sUQe#wP6Stm`SFYfI{#0>mO)e z`UiZlYgw#ytuFgQ*Xobz>bH|H3^SwBhvXzX`|R)A*OPz#{o_vno%pc=B?_k&ZEMMN zGe*)(nhDRf5|+2Dr(JW_nATH^Nza;2I*A2+%u1S(7m4puA- zfua2x$`KKh2Q(bSA%$)C95*?0eR^Ku;Na$b_+Ru1`5xbnS8=!kuPM|$S4l%X8fekV z+%Qv)$3Uqmfojswj3W&6{XWNWXDA*Jaf^mlU%c##MbxID-50I+q9{R+Y0z<;F;5xp zf?oywj(ambV~G7o%fP^ZByD@PMieSXJtMI&WTeBy?4C2dOJ*kFT4^bs5q>m1g~Kha zdH&Kdy1bwV8u1F8qSj__?P*URzBo2!%=I~`w6kc>MA3!HDBb||&(Nu@)}@BCIHwT3 z=USdQ=Fq4@e@i~20=Req=|YtXoL7kF5f6P!Cyix2W4dfvee`5k;A#-gjSh`66}=iR zqEDfk(euMTWO@dpZuosN5Je9zOM~<)v`Q8Rwm_YUDrE!}8eXofP~`+&FU7QEBqhez zGzx9d2;S0gV_h&M^)sg7CJ060Hk2gPJJ1~JM4R7Ne7N}#h20hnVW{u>hxj3xUbyPkDV^g7dOKcT7i%*3Ya^?7` z4&&XM@T?`a7aR3jKGWQhP?+;@cuS43yaL)I{!6@dN}`d_Fa!4O4#&(EXeylhg(Fl3l^haBo5(0au5!g&}huCZsd;4OKQ1=M0{EWTw#H*3l>%3yCI4WSJKHVB_ z0_y1L0RkOF11Gvr4*(mpfQ{(zT|43LR1L&D$zRj}d4+5Qxr65S{f%<7j2;!WQsoprJ-O-HiP>lEb4TyqBdZu4Y+J*Dw!bj(6KdO@VPdF#4bk@46HJz1BRsE? z5YWbZJDPBmNk2xfb#&u6&aq_%3dfS0^*wfjf*$NcKF1@4?_*O5hpE zit%3I^b)dXB6X29?5~UXe5>msBwSbi1k)vWQ2KyIf@JPx8bNLq9BIusL)2ZZiu+{EFmy!>Js4bDi77L~V?D zwPS5H=~cY{I~G}q`IUW%)-E&Q{W%G)&GM=Z6Rc!xhQ{Z)LyXsp@%ur%_7Os!HmYnD zD;tRm>gg&sUSk^$GD+8S;Oet*^_%PIFcCk-Cn0V-SBX%GALHEqzTq1S`nx1Frtm2~ z3wPcoUx{8-`zk&kjvXx?i3!rXg-T5N)?&eqEVU|pjcG#45 GKl}$xr+R(> literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/ore/OreGenBase.class b/bin/main/universalelectricity/prefab/ore/OreGenBase.class new file mode 100644 index 0000000000000000000000000000000000000000..0d954fd5edb3c2a6cf2f5dadb3a148da2e12a68a GIT binary patch literal 2789 zcmb7G>sJ#;9KAyV!LXo4Q4t@(2PQ#S6}69OAAo3TPzw|lt9026VP&(MZZ;r&zx${3 zOFy*d6y&t0{n!uvquSot4M;+&l@n%WXMb~lkGXSa|N8saKLA|B_c62xWU7v}EWL_h zOIw=0XPK72s+T>vV9e{TC-vK&ye^#)qatI73ha4oEE~FQI7R*T{9~>Vh&o0|3MBH+ zUQH3mDP{%s5@O6Ueam$WZ}nDS*i~6{t9F5?(ldOn6tgs(w_S57=M?0VY5ByjdTKr= z&`y9U-!PX1j^!Qc>m|#Pre`epy5-A~o?{cdr?Xbt=Eeki8w>+zeMC8+Rg6{>(l-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1bmf7ph+3VmU)^uB%wWvOq2#dH<{-n*xjPDwhGHHg2l8h1&uHCo(iS zbW$st0wWck*lw$SEQ5XP*kxP!if>!)ffYDW+)Jjy_YP%BmH)gMWr2i4F+r)E)7-ME zFKabkDQ1q?itW38z=QX?hUEMG6Hw`zY5Sh(Rpm#4Wz95;SInBkx{4CkNZhc3Qv6{w zN~&0%x7(9V4z#50T+Q}O#bZ2S%R2(uJ--#$@|6==HTL%-SdA`dYMD+a`INww17eVC zn$ahu7y$)+ZhoNyMgNZ6+x$=mBeSVC@@-7DaqaLc7WFo6=zCvSn!p{dc>)22BpECq z%UlixX4YdmXecrwF?8IeShTx`6{4fvDsxdg1sJ$bCLSTydM&-?pXgtPEp_nVQ2)#z z7R`3y!xSAM6ufcW!gH|<9`?jCc*I?T)U>Ea{Gvy!=!FiR_VbR@m5DCzR98ni=T*pC MCX2vEx0mO?0f)Q_^8f$< literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/potion/CustomPotionEffect.class b/bin/main/universalelectricity/prefab/potion/CustomPotionEffect.class new file mode 100644 index 0000000000000000000000000000000000000000..702c73fcb11b27f1e578506b484cce9797519d00 GIT binary patch literal 1218 zcmbVLT~8BH5Is}2Y`bmws(__MSo|tQSxitLN=OW9vPm^25R8wPx8l{4!llVt9HxViMqPod=n=x>UDsJu`fbp@_y0M?^T!ZwDw;OR|%<} z8~-_hd`=IeP#AlJv}kr3s;*>6SSi;=*s2;24sKx1#w?*Y0-D7MFy1Hs+nBG-KEuo{3hxOzd(AE&K(z5CKeC%ow ze5`IWiH&7K{(}2i7>W}k;9vw$t)(C z;>e&=nC7UbFw<9f+gHd`)=rT(B86d*X%?HgB$643WUzo@ERq?BWG;!6Say+x6Sx)I z`NCpJ&fUJ9g7pK_m2X&jcLw(qcRnFqDOens7OdFk0?z`N<=5v}cHZ1>7A;^IrMRWd z9^s%Rci`I{wB+_%VquiA%FGq!%*KtI${JT5a3zn#ZzfOLAbxB-1d|gy{waZtKgMqj ACjbBd literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/tile/ElectricTileDriver.class b/bin/main/universalelectricity/prefab/tile/ElectricTileDriver.class new file mode 100644 index 0000000000000000000000000000000000000000..735ff36ce0f6f1ebb4fce81ddc9f6ff4d4852df8 GIT binary patch literal 6450 zcmc&&dwd*K75?sSlG$u-Qm9a}l-dVElO}Y5N=uUx9@&(p&7(As(6mq{yOU(dW+%)} z(uN8aMT+=D1uP(luYy(uENMce;tLfO6a^F&s;KzH_Y0xryEC)NZrIYq{^2jb?9AN9 zx#ynqo$s7`A3gBkJ^*jV0Sy6xC4(t*$gtCT(nuO{$2Q}pGaMbTjc&aw>X=C*+Tgce z$d8z<25Tq~IO=kJNRKAvB#N(0cV$B5BwHCpD!EC)#hOjJU0LJFXxjmHd6x3S@Ba9$QBs55YU`1tnF$Bsa3Q;65qlxRb4EA>! z_Jw*^(h!*0WX1JlyKbB6+ixszdd;-J8BPC#1*m%1ObzKtGod?F=2#r3VU|E$URiO= zHlo?)&6t$-Xfd44mfg3?NDdgb#2XOe4jnVz=kBXBjMOAW+g{IR0wf_R$rUO|AzA>Evj$K2WRSO>CZMTcxLa+YBd+6H!u(g{ag} zA#h5L8r_!NV?^Utf4`NAx{_9^mY8W15T=!qScED9D&l%iR+)AYf`zd;!FM8aT*|wz(-EAzBI5VSE!xqQZl zf3mbJM=4>I?IozgIU3FuD4p;ZeJF7*&Le)(=9QGgxM&mz(P0W<^!bb|LCWJUhzACp zHZx&N>Q?Ir%*u_M;ekx-Y|WLlVw!f$A9Ak=lg8J^No^g~Iwxy&DmvZOm59 z2re0DXv#4qg))lT%$}6)4B9m1Lz7%G-6fA`!;`=?-L>mn^sSY+0P7gwWPzB`Pog#w zt1X5K9e-?|$f%5|(7RCLA~kCUXEmk>m3AxX=sku4V28xTSWgb`GlpG*@X{bdm8}C&lqy;BB(~uin!!x_&}=hOY145TU%2V> z?Go4G9bW$HuBgT#iJS2e zi92v71DT=Kp*s$VgBix9iM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Qx>Mo}J?1v*8b8c6OqMy8g)sjM*U$Of literal 0 HcmV?d00001 diff --git a/bin/main/universalelectricity/prefab/tile/TileEntityConductor.class b/bin/main/universalelectricity/prefab/tile/TileEntityConductor.class new file mode 100644 index 0000000000000000000000000000000000000000..d269dcaabf8826e40f3de7f4cedfba3d65934357 GIT binary patch literal 6008 zcmcIod0ZUT9sfRdVPG>!kRVMA8cZ}UyW(hw8jC?W5`zMXfFyxxGVBgyWOrsWJBx`; zJz87sVXLh@OscJ|M-SU-n-C&uwTHIaQ|)Q(ec%7~%?#`=gn;d*`}xegH}AdQ zeZGC}UynTrU_Jh>phRGO&N9agC#$E7l#y^9Ghw>>wTxp7>qDArrVOo*uT7TAPC|z0P(<1)4hNhAZT~ zV^dy`ZXdWw;G{7#o6}P%DTGBqjif-y;DEr=#MDBoB%T#mJJ?C0TH53}M;~@QH5i@- z3Y0;dN@9;rWGR8F&TI8CT}$cKh}KIbS|i*pyV$f$w^<+*t?w5Ix7kS}f)JLeSc=LD z2%M~<0ucqT6IinVk`iQvibYV%u~LAr0;j52j3pGKlk9fq(nE&Rrw^qJ$&;PXQ~kPQ z%I{z??Cvos;swXozHTUB!onZD+*L5_URmTUw5Orfrrh z?WRN95N%U^zm)Dw6>D*pKsj9?mE1aXt-#7+M4GpwZI}B^6{tsCL5ylDR%gK>6=$P? z7|m>tk+xkbN(@Ax;XDQB3N#eK&BvvRb!Ze=G-9}0GZ{N;N_6K%>x)^O4@*-7=i@>J z7YH;j%*AJW_!c9TF&q^eaFIYHp<9841P=UP%u_7k91&9QDYi+)#n{Mbv7Mx8>5LY} zLq`Ocphdx@bg6vk(7-gmidMAILey$oO3%_=mr~De6A1*{0vkzUZe;W2mqlpD6%uWyKy?wbzDVS@Ti~Mqn!qA-VVjC8 z(Zfhj8;q2~2yBl253JYsE9eu5&&^w)$zCHh-0rYgSP}GNhl1?_^>aX_GrFs_*>c#T zTgjAk&7EMjRUKo*%(_fctSSQ0g*j(^zf`~*R9r1_EY7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+|0kI7`A$ftjAG1llgxGPdYf?E-EE+53YWn`8 zKg1;W+$cX!(_npsSsTqbil^`jqWq0^oa1X;Pf$LMSG7woxgb54!gRwykvu&?wvJ(z z?(9R7Cugbq1^!k&!I@u^yBEPv(Hufr{Ra_#8&u23*ug)ZzJWK(bj%4I>Sdw{6V-x8 z$2pG$3n5T& loadedModules = new LinkedHashSet<>(); + + /** A cache to know which module to use with when facing objects with a specific class. */ + public static final HashMap, CompatibilityModule> energyHandlerCache = new HashMap<>(); + public static final HashMap, CompatibilityModule> energyStorageCache = new HashMap<>(); + + public static void register(CompatibilityModule module) + { + loadedModules.add(module); + } + + /** Can the handler connect to this specific direction? */ + public static boolean canConnect(Object handler, ForgeDirection direction, Object source) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doCanConnect(handler, direction, source); + } + + return false; + } + + /** + * Make the handler receive energy. + * + * @return The actual energy that was used. + */ + public static double receiveEnergy(Object handler, ForgeDirection direction, double energy, boolean doReceive) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doReceiveEnergy(handler, direction, energy, doReceive); + } + + return 0; + } + + /** + * Make the handler extract energy. + * + * @return The actual energy that was extract. + */ + public static double extractEnergy(Object handler, ForgeDirection direction, double energy, boolean doExtract) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doExtractEnergy(handler, direction, energy, doExtract); + } + + return 0; + } + + /** + * Gets the energy stored in the handler. + */ + public static double getEnergy(Object handler, ForgeDirection direction) + { + if (isEnergyContainer(handler)) + { + return energyStorageCache.get(handler.getClass()).doGetEnergy(handler, direction); + } + + return 0; + } + + /** + * Charges an item + * + * @return The actual energy that was accepted. + */ + public static double chargeItem(ItemStack itemStack, double energy, boolean doCharge) + { + if (itemStack != null && isHandler(itemStack.getItem())) + { + return energyHandlerCache.get(itemStack.getItem().getClass()).doChargeItem(itemStack, energy, doCharge); + } + + return 0; + } + + /** + * Discharges an item + * + * @return The actual energy that was removed. + */ + public static double dischargeItem(ItemStack itemStack, double energy, boolean doCharge) + { + if (itemStack != null && isHandler(itemStack.getItem())) + { + return energyHandlerCache.get(itemStack.getItem().getClass()).doDischargeItem(itemStack, energy, doCharge); + } + + return 0; + } + + /** + * Gets the itemStack with a specific charge. + * + * @return ItemStack of electrical/energy item. + */ + public static ItemStack getItemWithCharge(ItemStack itemStack, double energy) + { + if (itemStack != null && isHandler(itemStack.getItem())) + { + return energyHandlerCache.get(itemStack.getItem().getClass()).doGetItemWithCharge(itemStack, energy); + } + + return null; + } + + /** + * Is this object a valid energy handler? + * + * @param True if the handler can store energy. This can be for items and blocks. + */ + public static boolean isHandler(Object handler) + { + if (handler != null) + { + Class clazz = handler.getClass(); + + if (energyHandlerCache.containsKey(clazz)) + { + return true; + } + + for (CompatibilityModule module : CompatibilityModule.loadedModules) + { + if (module.doIsHandler(handler)) + { + energyHandlerCache.put(clazz, module); + return true; + } + } + } + + return false; + } + + /** + * Is this object able to store energy? + * + * @param handler + * @return True if the handler can store energy. The handler MUST be a block. + */ + public static boolean isEnergyContainer(Object handler) + { + if (handler != null) + { + Class clazz = handler.getClass(); + + if (energyStorageCache.containsKey(clazz)) + { + return true; + } + + for (CompatibilityModule module : CompatibilityModule.loadedModules) + { + if (module.doIsEnergyContainer(handler)) + { + energyStorageCache.put(clazz, module); + return true; + } + } + } + + return false; + } + + /** + * Blocks only + */ + public static double getMaxEnergy(Object handler, ForgeDirection direction) + { + if (isEnergyContainer(handler)) + { + return energyStorageCache.get(handler.getClass()).doGetMaxEnergy(handler, direction); + } + + return 0; + } + + public static double getInputVoltage(Object handler) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doGetInputVoltage(handler); + } + + return 0; + } + + public static double getOutputVoltage(Object handler) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doGetOutputVoltage(handler); + } + + return 0; + } + + public static boolean canReceive(Object handler, ForgeDirection side) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doCanReceive(handler, side); + } + + return false; + } + + public static boolean canExtract(Object handler, ForgeDirection side) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doCanExtract(handler, side); + } + + return false; + } + + public static double getDemandedJoules(Object handler) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doGetDemandedJoules(handler); + } + + return 0; + } + + public static double getProvidedJoules(Object handler) + { + if (isHandler(handler)) + { + return energyHandlerCache.get(handler.getClass()).doGetProvidedJoules(handler); + } + + return 0; + } + + public static double getEnergyItem(ItemStack itemStack) + { + if (itemStack != null && isHandler(itemStack.getItem())) + { + return energyHandlerCache.get(itemStack.getItem().getClass()).doGetEnergyItem(itemStack); + } + + return 0; + } + + public static double getMaxEnergyItem(ItemStack itemStack) + { + if (itemStack != null && isHandler(itemStack.getItem())) + { + return energyHandlerCache.get(itemStack.getItem().getClass()).doGetMaxEnergyItem(itemStack); + } + + return 0; + } + + public abstract double doReceiveEnergy(Object handler, ForgeDirection direction, double energy, boolean doReceive); + + public abstract double doExtractEnergy(Object handler, ForgeDirection direction, double energy, boolean doExtract); + + /** + * Charges an item with the given energy + * + * @param itemStack - item stack that is the item + * @param joules - input energy + * @param docharge - do the action + * @return amount of energy accepted + */ + public abstract double doChargeItem(ItemStack itemStack, double joules, boolean docharge); + + /** + * discharges an item with the given energy + * + * @param itemStack - item stack that is the item + * @param joules - input energy + * @param docharge - do the action + * @return amount of energy that was removed + */ + public abstract double doDischargeItem(ItemStack itemStack, double joules, boolean doDischarge); + + public abstract boolean doIsHandler(Object obj); + + public abstract boolean doIsEnergyContainer(Object obj); + + public abstract double doGetEnergy(Object obj, ForgeDirection direction); + + public abstract boolean doCanConnect(Object obj, ForgeDirection direction, Object source); + + public abstract ItemStack doGetItemWithCharge(ItemStack itemStack, double energy); + + public abstract double doGetMaxEnergy(Object handler, ForgeDirection direction); + + public abstract double doGetEnergyItem(ItemStack is); + + public abstract double doGetMaxEnergyItem(ItemStack is); + + public abstract double doGetInputVoltage(Object handler); + + public abstract double doGetOutputVoltage(Object handler); + + public abstract boolean doCanReceive(Object handler, ForgeDirection side); + + public abstract boolean doCanExtract(Object handler, ForgeDirection side); + + public abstract double doGetDemandedJoules(Object handler); + + public abstract double doGetProvidedJoules(Object handler); +} diff --git a/src/main/java/universalelectricity/api/CompatibilityType.java b/src/main/java/universalelectricity/api/CompatibilityType.java new file mode 100644 index 0000000..51bdf0a --- /dev/null +++ b/src/main/java/universalelectricity/api/CompatibilityType.java @@ -0,0 +1,82 @@ +package universalelectricity.api; + +import cpw.mods.fml.common.Loader; + +/** + * ORDER OF MAGNITUDE: + * A coal in Universal Electricity (based on an estimate in real life) is worth 4MJ. + * A fission reactor should make around 4-9GW. + * A fusion reactor would go into the tera-watts. + * Reika's conversion: IC2[22512], BC[56280], RF[5628] + * @author Calclavia + */ +public enum CompatibilityType +{ + REDSTONE_FLUX("universalelectricity", "RedstoneFlux", "Redstone Flux", "RF", 2.5), + INDUSTRIALCRAFT("IC2", "IndustrialCraft", "Electrical Unit", "EU", 10); + + public final String modID; + public final String moduleName; + public final String fullUnit; + public final String unit; + + /** + * Multiply UE energy by this ratio to convert it to the forgien ratio. + */ + public double ratio; + + /** + * Multiply the forgien energy by this ratio to convert it into UE energy. + */ + public double reciprocal_ratio; + + /** + * The Universal Electricity Loader will change this value to indicate if the module is + * loaded or not. + */ + public boolean isModuleEnabled; + + /** + * @param modID - The Forge mod ID. + * @param moduleName - The name of the module, used for config and ASM + * @param fullUnit - The unit used + * @param unit - The unit short form used + * @param ratio - How much UE energy equates to the forgien energy? + */ + CompatibilityType(String modID, String moduleName, String fullUnit, String unit, double ratio) + { + this.modID = modID; + this.moduleName = moduleName; + this.fullUnit = fullUnit; + this.unit = unit; + this.ratio = 1.0 / ratio; + this.reciprocal_ratio = ratio; + } + + public boolean isLoaded() + { + return Loader.isModLoaded(this.modID); + } + + public static CompatibilityType get(String moduleName) + { + for (CompatibilityType type : values()) + { + if (moduleName.equals(type.moduleName)) + { + return type; + } + } + + return null; + } + + public double fromJoules(double joules) { + return this.ratio * joules; + } + + public double toJoules(double energy) { + return this.reciprocal_ratio * energy; + } + +} diff --git a/src/main/java/universalelectricity/api/electricity/IElectricalNetwork.java b/src/main/java/universalelectricity/api/electricity/IElectricalNetwork.java new file mode 100644 index 0000000..62a27b5 --- /dev/null +++ b/src/main/java/universalelectricity/api/electricity/IElectricalNetwork.java @@ -0,0 +1,18 @@ +package universalelectricity.api.electricity; + +import net.minecraft.tileentity.TileEntity; +import universalelectricity.api.energy.IEnergyNetwork; +import universalelectricity.core.electricity.ElectricityPack; + +/** + * Extended version of the energy network that properly implements amperage and voltage. + * If you want amps get last buffer and divide it by the voltage + * + * @author DarkGuardsman + */ +public interface IElectricalNetwork extends IEnergyNetwork +{ + /** Gets the current voltage of the network at this point. */ + public double getVoltage(); + +} diff --git a/src/main/java/universalelectricity/api/electricity/IVoltageInput.java b/src/main/java/universalelectricity/api/electricity/IVoltageInput.java new file mode 100644 index 0000000..3cd7cab --- /dev/null +++ b/src/main/java/universalelectricity/api/electricity/IVoltageInput.java @@ -0,0 +1,18 @@ +package universalelectricity.api.electricity; + +import net.minecraftforge.common.util.ForgeDirection; + +/** + * Implement this on your TileEntity if it has a voltage based energy input. You machine will still + * need to run its own voltage checks as this doesn't do anything on its own. + * + * @author DarkGuardsman + */ +public interface IVoltageInput +{ + /** Voltage input on the side mainly used for meters */ + public double getVoltageInput(ForgeDirection direction); + + /** Called when the network voltage doesn't equal the input */ + public void onWrongVoltage(ForgeDirection direction, double voltage); +} diff --git a/src/main/java/universalelectricity/api/electricity/IVoltageOutput.java b/src/main/java/universalelectricity/api/electricity/IVoltageOutput.java new file mode 100644 index 0000000..6f36b76 --- /dev/null +++ b/src/main/java/universalelectricity/api/electricity/IVoltageOutput.java @@ -0,0 +1,20 @@ +package universalelectricity.api.electricity; + +import net.minecraftforge.common.util.ForgeDirection; + +/** + * Applied to electrical machines that are designed to act as sources of power in an electrical + * network. Mainly used to calculate the over all voltage of a network correctly. + * + * @author DarkGuardsman + */ +public interface IVoltageOutput +{ + /** + * Can this machine emit voltage on the given side. + * + * @param side - side that the voltage will be emitted on + * @return the voltage emitted + */ + public double getVoltageOutput(ForgeDirection side); +} diff --git a/src/main/java/universalelectricity/api/energy/EnergyNetworkLoader.java b/src/main/java/universalelectricity/api/energy/EnergyNetworkLoader.java new file mode 100644 index 0000000..ef067d4 --- /dev/null +++ b/src/main/java/universalelectricity/api/energy/EnergyNetworkLoader.java @@ -0,0 +1,69 @@ +package universalelectricity.api.energy; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import cpw.mods.fml.common.FMLLog; + +/** + * A dynamic network loader for injecting energy networks (NOT for other networks such as fuild + * networks). + * Example usage would be that ElectricityNetwork replaces EnergyNetwork. + * + * @author Calclavia + * + */ +public class EnergyNetworkLoader +{ + /** + * The default IElectricityNetwork used for primary energy networks. + */ + public static Class NETWORK_CLASS; + public static final Set> NETWORK_CLASS_REGISTRY = new HashSet>(); + + static + { + setNetworkClass("universalelectricity.core.net.ElectricalNetwork"); + } + + public static void setNetworkClass(Class networkClass) + { + NETWORK_CLASS_REGISTRY.add(networkClass); + NETWORK_CLASS = networkClass; + } + + public static void setNetworkClass(String className) + { + try + { + setNetworkClass((Class) Class.forName(className)); + } + catch (Exception e) + { + FMLLog.severe("Universal Electricity: Failed to set network class with name " + className); + e.printStackTrace(); + } + } + + public static IEnergyNetwork getNewNetwork(IConductor... conductors) + { + try + { + IEnergyNetwork network = NETWORK_CLASS.newInstance(); + network.getConnectors().addAll(Arrays.asList(conductors)); + return network; + } + catch (InstantiationException e) + { + e.printStackTrace(); + } + catch (IllegalAccessException e) + { + e.printStackTrace(); + } + + return null; + } + +} \ No newline at end of file diff --git a/src/main/java/universalelectricity/api/energy/EnergyStorageHandler.java b/src/main/java/universalelectricity/api/energy/EnergyStorageHandler.java new file mode 100644 index 0000000..f2153cd --- /dev/null +++ b/src/main/java/universalelectricity/api/energy/EnergyStorageHandler.java @@ -0,0 +1,268 @@ +package universalelectricity.api.energy; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagInt; +import net.minecraft.nbt.NBTTagLong; + +/** + * Can be used internally for IEnergyInterface blocks. This is optional and should be used for + * ease of use purposes. + * + * @author Calclavia, Based on Thermal Expansion + * + */ +public class EnergyStorageHandler +{ + protected long energy; + protected long capacity; + protected long maxReceive; + protected long maxExtract; + + /** + * A cache of the last energy stored through extract and receive. + */ + protected long lastEnergy; + + public EnergyStorageHandler() + { + this(0); + } + + public EnergyStorageHandler(long capacity) + { + this(capacity, capacity, capacity); + } + + public EnergyStorageHandler(long capacity, long maxTransfer) + { + this(capacity, maxTransfer, maxTransfer); + } + + public EnergyStorageHandler(long capacity, long maxReceive, long maxExtract) + { + this.capacity = capacity; + this.maxReceive = maxReceive; + this.maxExtract = maxExtract; + } + + public EnergyStorageHandler readFromNBT(NBTTagCompound nbt) + { + NBTBase energyTag = nbt.getTag("energy"); + if (energyTag instanceof NBTTagDouble) + { + this.energy = (long) ((NBTTagDouble) energyTag).func_150286_g(); + } + else if (energyTag instanceof NBTTagFloat) + { + this.energy = (long) ((NBTTagFloat) energyTag).func_150288_h(); + } + else if (energyTag instanceof NBTTagInt) + { + this.energy = ((NBTTagInt) energyTag).func_150287_d(); + } + else if (energyTag instanceof NBTTagLong) + { + this.energy = ((NBTTagLong) energyTag).func_150291_c(); + } + return this; + } + + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { + nbt.setLong("energy", this.getEnergy()); + return nbt; + } + + public void setCapacity(long capacity) + { + this.capacity = capacity; + + if (getEnergy() > capacity) + { + energy = capacity; + } + } + + public void setMaxTransfer(long maxTransfer) + { + setMaxReceive(maxTransfer); + setMaxExtract(maxTransfer); + } + + public void setMaxReceive(long maxReceive) + { + this.maxReceive = maxReceive; + } + + public void setMaxExtract(long maxExtract) + { + this.maxExtract = maxExtract; + } + + public long getMaxReceive() + { + return maxReceive; + } + + public long getMaxExtract() + { + return maxExtract; + } + + /** + * This function is included to allow for server -> client sync. Do not call this externally to + * the containing Tile Entity, as not all IEnergyHandlers are + * guaranteed to have it. + * + * @param energy + */ + public void setEnergy(long energy) + { + this.energy = energy; + + if (this.getEnergy() > this.getEnergyCapacity()) + { + this.energy = this.getEnergyCapacity(); + } + else if (this.getEnergy() < 0) + { + this.energy = 0; + } + } + + /** + * This function is included to allow the containing tile to directly and efficiently modify the + * energy contained in the EnergyStorage. Do not rely on this + * externally, as not all IEnergyHandlers are guaranteed to have it. + * + * @param energy + */ + public void modifyEnergyStored(long energy) + { + this.setEnergy(this.getEmptySpace() + energy); + + if (this.getEnergy() > this.getEnergyCapacity()) + { + this.setEnergy(this.getEnergyCapacity()); + } + else if (this.getEnergy() < 0) + { + this.setEnergy(0); + } + } + + public long receiveEnergy(long receive, boolean doReceive) + { + long energyReceived = Math.min(this.getEnergyCapacity() - this.getEnergy(), Math.min(this.getMaxReceive(), receive)); + + if (doReceive) + { + this.lastEnergy = this.getEnergy(); + this.setEnergy(this.getEnergy() + energyReceived); + } + return energyReceived; + } + + public long receiveEnergy(boolean doReceive) + { + return this.receiveEnergy(this.getMaxReceive(), doReceive); + } + + public long receiveEnergy() + { + return this.receiveEnergy(true); + } + + public long extractEnergy(long extract, boolean doExtract) + { + long energyExtracted = Math.min(this.getEnergy(), Math.min(this.getMaxExtract(), extract)); + + if (doExtract) + { + this.lastEnergy = this.getEnergy(); + this.setEnergy(this.getEnergy() - energyExtracted); + } + return energyExtracted; + } + + public long extractEnergy(boolean doExtract) + { + return this.extractEnergy(this.getMaxExtract(), doExtract); + } + + public long extractEnergy() + { + return this.extractEnergy(true); + } + + public boolean checkReceive(long receive) + { + return this.receiveEnergy(receive, false) >= receive; + } + + public boolean checkReceive() + { + return this.checkReceive(this.getMaxReceive()); + } + + public boolean checkExtract(long extract) + { + return this.extractEnergy(extract, false) >= extract; + } + + public boolean checkExtract() + { + return this.checkExtract(this.getMaxExtract()); + } + + public boolean isFull() + { + return this.getEnergy() >= this.getEnergyCapacity(); + } + + public boolean isEmpty() + { + return this.getEnergy() == 0; + } + + public long getLastEnergy() + { + return this.lastEnergy; + } + + /** + * @return True if the last energy state and the current one are either in an + * "empty or not empty" change state. + */ + public boolean didEnergyStateChange() + { + return (this.getLastEnergy() == 0 && this.getEnergy() > 0) || (this.getLastEnergy() > 0 && this.getEnergy() == 0); + } + + /** + * Returns the amount of energy this storage can further store. + */ + public long getEmptySpace() + { + return this.getEnergyCapacity() - this.getEnergy(); + } + + public long getEnergy() + { + return this.energy; + } + + public long getEnergyCapacity() + { + return this.capacity; + } + + @Override + public String toString() + { + return this.getClass().getSimpleName() + "[" + this.getEnergy() + "/" + this.getEnergyCapacity() + "]"; + } +} diff --git a/src/main/java/universalelectricity/api/energy/IConductor.java b/src/main/java/universalelectricity/api/energy/IConductor.java new file mode 100644 index 0000000..b9dfafb --- /dev/null +++ b/src/main/java/universalelectricity/api/energy/IConductor.java @@ -0,0 +1,27 @@ +package universalelectricity.api.energy; + +import universalelectricity.api.net.IConnector; + +/** + * A connector for {EnergyNetwork}. + * + * @author Calclavia + */ +public interface IConductor extends IConnector, IEnergyInterface +{ + /** + * Gets the amount of resistance of energy conducting pass this conductor. + * + * @return The amount of loss in Ohms. + */ + public double getResistance(); + + /** + * The maximum amount of current this conductor can buffer (the transfer rate, essentially). You + * can simply do divide your energy transfer rate by UniversalElectricity.DEFAULT_VOLTAGE if + * your conductor is not voltage sensitive. + * + * @return The amount of current in amperes. + */ + public double getCurrentCapacity(); +} diff --git a/src/main/java/universalelectricity/api/energy/IEnergyContainer.java b/src/main/java/universalelectricity/api/energy/IEnergyContainer.java new file mode 100644 index 0000000..ef25a4f --- /dev/null +++ b/src/main/java/universalelectricity/api/energy/IEnergyContainer.java @@ -0,0 +1,28 @@ +package universalelectricity.api.energy; + +import net.minecraftforge.common.util.ForgeDirection; + +/** + * This interface is to be applied to all TileEntities which can store energy. + * + * @author Calclavia + */ +public interface IEnergyContainer +{ + /** + * Sets the amount of energy this unit stored. + * + * This function is NOT recommended for calling. + */ + public void setEnergy(ForgeDirection from, double energy); + + /** + * * @return Get the amount of energy currently stored in the block. + */ + public double getEnergy(ForgeDirection from); + + /** + * @return Get the max amount of energy that can be stored in the block. + */ + public double getEnergyCapacity(ForgeDirection from); +} diff --git a/src/main/java/universalelectricity/api/energy/IEnergyInterface.java b/src/main/java/universalelectricity/api/energy/IEnergyInterface.java new file mode 100644 index 0000000..3755be0 --- /dev/null +++ b/src/main/java/universalelectricity/api/energy/IEnergyInterface.java @@ -0,0 +1,37 @@ +package universalelectricity.api.energy; + +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.net.IConnectable; + +/** + * Applied to all TileEntities that can interact with energy. + * + * @author Calclavia, Inspired by Thermal Expansion + */ +public interface IEnergyInterface extends IConnectable +{ + /** + * Adds energy to a block. Returns the quantity of energy that was accepted. This should always + * return 0 if the block cannot be externally charged. + * + * @param from Orientation the energy is sent in from. + * @param receive Maximum amount of energy (joules) to be sent into the block. + * @param doReceive If false, the charge will only be simulated. + * @return Amount of energy that was accepted by the block. + */ + public double onReceiveEnergy(ForgeDirection from, double receive, boolean doReceive); + + /** + * Removes energy from a block. Returns the quantity of energy that was extracted. This should + * always return 0 if the block cannot be externally discharged. + * + * @param from Orientation the energy is requested from. This direction MAY be passed as + * "Unknown" if it is wrapped from another energy system that has no clear way to find + * direction. (e.g BuildCraft 4) + * @param energy Maximum amount of energy to be sent into the block. + * @param doExtract If false, the charge will only be simulated. + * @return Amount of energy that was given out by the block. + */ + public double onExtractEnergy(ForgeDirection from, double extract, boolean doExtract); + +} diff --git a/src/main/java/universalelectricity/api/energy/IEnergyNetwork.java b/src/main/java/universalelectricity/api/energy/IEnergyNetwork.java new file mode 100644 index 0000000..2cb3e1b --- /dev/null +++ b/src/main/java/universalelectricity/api/energy/IEnergyNetwork.java @@ -0,0 +1,67 @@ +package universalelectricity.api.energy; + +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.net.INodeNetwork; +import universalelectricity.api.net.IUpdate; + +/** + * The Energy Network for energy items and blocks. + * + * @author Calclavia + */ +public interface IEnergyNetwork extends INodeNetwork, IUpdate +{ + /** + * Produces power to the energy network. + * + * @param conductor - The conductor that is producing into the energy. + * @param side - The direction the source is producing out towards. + * @param receive - The amount that is produced. + * @return The amount that was accepted by the network. + */ + public double produce(IConductor conductor, ForgeDirection from, double amount, boolean doProduce); + + /** + * @return The current buffer in the network that is going sent to all energy handlers. + */ + public double getBuffer(); + + /** + * @return The last buffer in the network that was sent to all energy handlers. + */ + public double getLastBuffer(); + + /** + * Gets an estimated value of what the network wants for energy + */ + public double getRequest(); + + /** + * Gets a value that represents the amount of energy lost in the network + */ + public double getResistance(); + + /** + * Used by conductors to load their internal buffers to the network. This should be called when + * reading NBT data. + * + * @param conductor + */ + public double getBufferOf(IConductor conductor); + + /** + * Used by conductors to load their internal buffers to the network. This should be called when + * writing NBT data. + * + * @param conductor + */ + public void setBufferFor(IConductor conductor, double buffer); + + /** + * Sets the buffer of the network. + * + * @param newBuffer + */ + public void setBuffer(double newBuffer); + +} diff --git a/src/main/java/universalelectricity/api/energy/UnitDisplay.java b/src/main/java/universalelectricity/api/energy/UnitDisplay.java new file mode 100644 index 0000000..218c39d --- /dev/null +++ b/src/main/java/universalelectricity/api/energy/UnitDisplay.java @@ -0,0 +1,217 @@ +package universalelectricity.api.energy; + +/** + * An easy way to display information on electricity for the client. + * + * @author Calclavia + */ +public class UnitDisplay +{ + /** + * Universal Electricity's units are in KILOJOULES, KILOWATTS and KILOVOLTS. Try to make your + * energy ratio as close to real life as possible. + */ + public static enum Unit + { + 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"), LITER("Liter", "L"), NEWTON_METER("Newton Meter", "Nm"), + REDFLUX("Redstone-Flux", "Rf"), ELECTRICAL_UNITS("Electrical-Units", "Eu"); + + public String name; + public String symbol; + + private Unit(String name, String symbol) + { + this.name = name; + this.symbol = symbol; + } + + public String getPlural() + { + return this.name + "s"; + } + } + + /** Metric system of measurement. */ + public static enum UnitPrefix + { + MICRO("Micro", "u", 0.000001), MILLI("Milli", "m", 0.001), BASE("", "", 1), + KILO("Kilo", "k", 1000), MEGA("Mega", "M", 1000000), GIGA("Giga", "G", 1000000000), + TERA("Tera", "T", 1000000000000d), PETA("Peta", "P", 1000000000000000d), + EXA("Exa", "E", 1000000000000000000d), ZETTA("Zetta", "Z", 1000000000000000000000d), + YOTTA("Yotta", "Y", 1000000000000000000000000d); + + /** long name for the unit */ + public String name; + /** short unit version of the unit */ + public String symbol; + /** Point by which a number is consider to be of this unit */ + public double value; + + private UnitPrefix(String name, String symbol, double value) + { + this.name = name; + this.symbol = symbol; + this.value = value; + } + + public String getName(boolean getShort) + { + if (getShort) + { + return symbol; + } + else + { + return name; + } + } + + /** Divides the value by the unit value start */ + public double process(double value) + { + return value / this.value; + } + + /** Checks if a value is above the unit value start */ + public boolean isAbove(double value) + { + return value > this.value; + } + + /** Checks if a value is lower than the unit value start */ + public boolean isBellow(double value) + { + return value < this.value; + } + } + + public static String getDisplay(double value, Unit unit, int decimalPlaces, boolean isShort) + { + return getDisplay(value, unit, decimalPlaces, isShort, 1); + } + + /** + * Displays the unit as text. Does handle negative numbers, and will place a negative sign in + * front of the output string showing this. Use string.replace to remove the negative sign if + * unwanted + */ + public static String getDisplay(double value, Unit unit, int decimalPlaces, boolean isShort, double multiplier) + { + String unitName = unit.name; + String prefix = ""; + + if (value < 0) + { + value = Math.abs(value); + prefix = "-"; + } + + value *= multiplier; + + if (isShort) + { + unitName = unit.symbol; + } + else if (value > 1) + { + unitName = unit.getPlural(); + } + + if (value == 0) + { + return value + " " + unitName; + } + else + { + for (int i = 0; i < UnitPrefix.values().length; i++) + { + UnitPrefix lowerMeasure = UnitPrefix.values()[i]; + + if (lowerMeasure.isBellow(value) && lowerMeasure.ordinal() == 0) + { + return prefix + roundDecimals(lowerMeasure.process(value), decimalPlaces) + " " + lowerMeasure.getName(isShort) + unitName; + } + if (lowerMeasure.ordinal() + 1 >= UnitPrefix.values().length) + { + return prefix + roundDecimals(lowerMeasure.process(value), decimalPlaces) + " " + lowerMeasure.getName(isShort) + unitName; + } + + UnitPrefix upperMeasure = UnitPrefix.values()[i + 1]; + + if ((lowerMeasure.isAbove(value) && upperMeasure.isBellow(value)) || lowerMeasure.value == value) + { + return prefix + roundDecimals(lowerMeasure.process(value), decimalPlaces) + " " + lowerMeasure.getName(isShort) + unitName; + } + } + } + + return prefix + roundDecimals(value, decimalPlaces) + " " + unitName; + } + + public static String getDisplay(double value, Unit unit) + { + return getDisplay(value, unit, 2, false); + } + + public static String getDisplay(double value, Unit unit, UnitPrefix prefix) + { + return getDisplay(value, unit, 2, false, prefix.value); + } + + public static String getDisplayShort(double value, Unit unit) + { + return getDisplay(value, unit, 2, true); + } + + /** + * Gets a display for the value with a unit that is in the specific prefix. + */ + public static String getDisplayShort(double value, Unit unit, UnitPrefix prefix) + { + return getDisplay(value, unit, 2, true, prefix.value); + } + + public static String getDisplayShort(double value, Unit unit, int decimalPlaces) + { + return getDisplay(value, unit, decimalPlaces, true); + } + + public static String getDisplaySimple(double value, Unit unit, int decimalPlaces) + { + if (value > 1) + { + if (decimalPlaces < 1) + { + return (int) value + " " + unit.getPlural(); + } + + return roundDecimals(value, decimalPlaces) + " " + unit.getPlural(); + } + + if (decimalPlaces < 1) + { + return (int) value + " " + unit.name; + } + + return roundDecimals(value, decimalPlaces) + " " + 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 decimalPlaces) + { + int j = (int) (d * Math.pow(10, decimalPlaces)); + return j / Math.pow(10, decimalPlaces); + } + + public static double roundDecimals(double d) + { + return roundDecimals(d, 2); + } +} diff --git a/src/main/java/universalelectricity/api/item/IEnergyItem.java b/src/main/java/universalelectricity/api/item/IEnergyItem.java new file mode 100644 index 0000000..af6c07b --- /dev/null +++ b/src/main/java/universalelectricity/api/item/IEnergyItem.java @@ -0,0 +1,47 @@ +package universalelectricity.api.item; + +import net.minecraft.item.ItemStack; + +public interface IEnergyItem +{ + /** + * Adds energy to an item. Returns the quantity of energy that was accepted. This should always + * return 0 if the item cannot be externally charged. + * + * @param itemStack ItemStack to be charged. + * @param energy Maximum amount of energy to be sent into the item. + * @param doRecharge If false, the charge will only be simulated. + * @return Amount of energy that was accepted by the item. + */ + public double recharge(ItemStack itemStack, double energy, boolean doRecharge); + + /** + * Removes energy from an item. Returns the quantity of energy that was removed. This should + * always return 0 if the item cannot be externally discharged. + * + * @param itemStack ItemStack to be discharged. + * @param energy Maximum amount of energy to be removed from the item. + * @param doDischarge If false, the discharge will only be simulated. + * @return Amount of energy that was removed from the item. + */ + public double discharge(ItemStack itemStack, double energy, boolean doDischarge); + + /** + * Get the amount of energy currently stored in the item. + */ + public double getEnergy(ItemStack theItem); + + /** + * Get the max amount of energy that can be stored in the item. + */ + public double getEnergyCapacity(ItemStack theItem); + + /** + * Sets the amount of energy in the ItemStack. Use recharge or discharge instead of calling this + * to be safer! + * + * @param itemStack - the ItemStack. + * @param energy - Amount of electrical energy. + */ + public void setEnergy(ItemStack itemStack, double energy); +} diff --git a/src/main/java/universalelectricity/api/item/IVoltageItem.java b/src/main/java/universalelectricity/api/item/IVoltageItem.java new file mode 100644 index 0000000..3fc2994 --- /dev/null +++ b/src/main/java/universalelectricity/api/item/IVoltageItem.java @@ -0,0 +1,15 @@ +package universalelectricity.api.item; + +import net.minecraft.item.ItemStack; + +/** + * @author Calclavia + * + */ +public interface IVoltageItem +{ + /** + * Get the max amount of voltage of this item. + */ + public double getVoltage(ItemStack theItem); +} diff --git a/src/main/java/universalelectricity/api/item/ItemElectric.java b/src/main/java/universalelectricity/api/item/ItemElectric.java new file mode 100644 index 0000000..94cc028 --- /dev/null +++ b/src/main/java/universalelectricity/api/item/ItemElectric.java @@ -0,0 +1,155 @@ +package universalelectricity.api.item; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.world.World; +import universalelectricity.api.CompatibilityModule; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.api.energy.UnitDisplay; +import universalelectricity.api.energy.UnitDisplay.Unit; + +/** 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 IEnergyItem, IVoltageItem +{ + private static final String ENERGY_NBT = "electricity"; + + public ItemElectric() + { + super(); + setMaxStackSize(1); + setMaxDamage(100); + setNoRepair(); + } + + @Override + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4) + { + String color = ""; + double joules = getEnergy(itemStack); + + if (joules <= getEnergyCapacity(itemStack) / 3) + { + color = "\u00a74"; + } + else if (joules > getEnergyCapacity(itemStack) * 2 / 3) + { + color = "\u00a72"; + } + else + { + color = "\u00a76"; + } + + list.add(color + UnitDisplay.getDisplayShort(joules, Unit.JOULES) + "/" + UnitDisplay.getDisplayShort(getEnergyCapacity(itemStack), Unit.JOULES)); + } + + /** 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 itemStack, World par2World, EntityPlayer par3EntityPlayer) + { + setEnergy(itemStack, 0); + } + + @Override + public double recharge(ItemStack itemStack, double energy, boolean doReceive) + { + double energyReceived = Math.min(getEnergyCapacity(itemStack) - getEnergy(itemStack), Math.min(getTransferRate(itemStack), energy)); + + if (doReceive) + { + setEnergy(itemStack, getEnergy(itemStack) + energyReceived); + } + + return energyReceived; + } + + public double getTransferRate(ItemStack itemStack) + { + return getEnergyCapacity(itemStack) / 100; + } + + @Override + public double discharge(ItemStack itemStack, double energy, boolean doTransfer) + { + double energyExtracted = Math.min(getEnergy(itemStack), Math.min(getTransferRate(itemStack), energy)); + + if (doTransfer) + { + setEnergy(itemStack, getEnergy(itemStack) - energyExtracted); + } + + return energyExtracted; + } + + @Override + public double getVoltage(ItemStack itemStack) + { + return 120.0; + } + + @Override + public void setEnergy(ItemStack itemStack, double joules) + { + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + double electricityStored = Math.max(Math.min(joules, getEnergyCapacity(itemStack)), 0); + itemStack.getTagCompound().setDouble(ENERGY_NBT, electricityStored); + itemStack.setItemDamage((int) (100 - ((double) electricityStored / (double) getEnergyCapacity(itemStack)) * 100)); + } + + public double getTransfer(ItemStack itemStack) + { + return getEnergyCapacity(itemStack) - getEnergy(itemStack); + } + + @Override + public double getEnergy(ItemStack itemStack) + { + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + double energyStored = 0; + + if (itemStack.getTagCompound().hasKey(ENERGY_NBT)) + { + // Backwards compatibility + NBTBase obj = itemStack.getTagCompound().getTag(ENERGY_NBT); + + if (obj instanceof NBTTagFloat) + { + energyStored = ((NBTTagFloat) obj).func_150286_g(); + } + else if (obj instanceof NBTTagDouble) + { + energyStored = ((NBTTagDouble) obj).func_150286_g(); + } + } + + itemStack.setItemDamage((int) (100 - ((double) energyStored / (double) getEnergyCapacity(itemStack)) * 100)); + return energyStored; + } + + @Override + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + par3List.add(CompatibilityModule.getItemWithCharge(new ItemStack(this), 0)); + par3List.add(CompatibilityModule.getItemWithCharge(new ItemStack(this), getEnergyCapacity(new ItemStack(this)))); + } +} diff --git a/src/main/java/universalelectricity/api/net/IConnectable.java b/src/main/java/universalelectricity/api/net/IConnectable.java new file mode 100644 index 0000000..fe717fb --- /dev/null +++ b/src/main/java/universalelectricity/api/net/IConnectable.java @@ -0,0 +1,19 @@ +package universalelectricity.api.net; + +import net.minecraftforge.common.util.ForgeDirection; + +/** + * @author Calclavia + * + */ +public interface IConnectable +{ + /** + * Can this object connect with another? + * + * @param from - The direction the connection is coming from. + * @param source - The source calling canConnect onto this object. + * @return Return true, if the connection is possible. + */ + public boolean canConnect(ForgeDirection from, Object source); +} diff --git a/src/main/java/universalelectricity/api/net/IConnector.java b/src/main/java/universalelectricity/api/net/IConnector.java new file mode 100644 index 0000000..ac0a41e --- /dev/null +++ b/src/main/java/universalelectricity/api/net/IConnector.java @@ -0,0 +1,29 @@ +package universalelectricity.api.net; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +/** + * Applied to TileEntities that has an instance of an electricity network. + * + * @author Calclavia, tilera + * + */ +public interface IConnector extends INetworkProvider, IConnectable +{ + /** + * Gets an array of all the connected IConnecables that this connector is connected to. This + * should correspond to the ForgeDirection index. + * + * @return An array of length "6". + */ + public TileEntity[] getAdjacentConnections(); + + /** + * Gets this connector instance. Used specially for MultiPart connections. + * + * @return The instance, in most cases, just return "this". + */ + public IConnector getInstance(ForgeDirection dir); + +} diff --git a/src/main/java/universalelectricity/api/net/INetwork.java b/src/main/java/universalelectricity/api/net/INetwork.java new file mode 100644 index 0000000..f360be6 --- /dev/null +++ b/src/main/java/universalelectricity/api/net/INetwork.java @@ -0,0 +1,50 @@ +package universalelectricity.api.net; + +import java.util.Set; + +/** + * A network with connectors only. + */ +public interface INetwork +{ + public void addConnector(C connector); + + public void removeConnector(C connector); + + /** + * Gets the set of conductors that make up this network. + * + * @return conductor set + */ + public Set getConnectors(); + + /** + * Reconstructs the network and all objects within it. + */ + public void reconstruct(); + + /** + * Creates a new network that makes up the current network and the network defined in the + * parameters. Be sure to refresh the new network inside this method. + * + * @param network - network to merge + * @return The new network instance. + */ + public N merge(N network); + + /** + * Splits a network by removing a conductor referenced in the parameter. It will then create and + * refresh the new independent networks possibly created by this operation. + * + * @param connection + */ + public void split(C connection); + + /** + * Splits the network between 2 connectors, separating their networks. + * + * @param connectorA + * @param connectorB + */ + public void split(C connectorA, C connectorB); +} diff --git a/src/main/java/universalelectricity/api/net/INetworkProvider.java b/src/main/java/universalelectricity/api/net/INetworkProvider.java new file mode 100644 index 0000000..003b85b --- /dev/null +++ b/src/main/java/universalelectricity/api/net/INetworkProvider.java @@ -0,0 +1,14 @@ +package universalelectricity.api.net; + +/** + * Applied to TileEntities that has an instance of an electricity network. + * + * @author Calclavia + * + */ +public interface INetworkProvider +{ + public N getNetwork(); + + public void setNetwork(N network); +} diff --git a/src/main/java/universalelectricity/api/net/INodeNetwork.java b/src/main/java/universalelectricity/api/net/INodeNetwork.java new file mode 100644 index 0000000..fbe1b23 --- /dev/null +++ b/src/main/java/universalelectricity/api/net/INodeNetwork.java @@ -0,0 +1,22 @@ +package universalelectricity.api.net; + +import java.util.Set; + +/** + * A network of with connectors and individual nodes. + * + * @author Calclavia + * + * @param - the class/interface Type value in which you implement this + * @param - the class/interface Type which makes up the network's connector set + * @param - the class/interface Type which makes up the network's node set + */ +public interface INodeNetwork extends INetwork +{ + /** + * The nodes in a network are the objects that interact with the connectors. + * + * @return The list of nodes in the network. + */ + public Set getNodes(); +} diff --git a/src/main/java/universalelectricity/api/net/IUpdate.java b/src/main/java/universalelectricity/api/net/IUpdate.java new file mode 100644 index 0000000..243a3c0 --- /dev/null +++ b/src/main/java/universalelectricity/api/net/IUpdate.java @@ -0,0 +1,22 @@ +package universalelectricity.api.net; + +public interface IUpdate +{ + /** + * Updates the network. Called by the {NetworkTickHandler}. + */ + public void update(); + + /** + * Can the network update? + * + * @return True if the network can update, otherwise the network tick handler will remove the + * network from the tick list. + */ + public boolean canUpdate(); + + /** + * @return True to leave the network in the ticker. False to remove the network from the ticker. + */ + public boolean continueUpdate(); +} diff --git a/src/main/java/universalelectricity/api/net/NetworkEvent.java b/src/main/java/universalelectricity/api/net/NetworkEvent.java new file mode 100644 index 0000000..7a4714b --- /dev/null +++ b/src/main/java/universalelectricity/api/net/NetworkEvent.java @@ -0,0 +1,52 @@ +package universalelectricity.api.net; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import universalelectricity.api.energy.IEnergyNetwork; + +public class NetworkEvent extends Event +{ + public final IEnergyNetwork network; + + public NetworkEvent(IEnergyNetwork network) + { + this.network = network; + } + + /** + * Call this to have your TileEntity produce power into the network. + * + * @author Calclavia + * + */ + @Cancelable + public static class EnergyProduceEvent extends NetworkEvent + { + private Object source; + private long amount; + private boolean doReceive; + + public EnergyProduceEvent(IEnergyNetwork network, Object source, long amount, boolean doReceive) + { + super(network); + this.source = source; + this.amount = amount; + this.doReceive = doReceive; + } + } + + /** + * These events are fired when something happens in the network. + * + * @author Calclavia + * + */ + @Cancelable + public static class EnergyUpdateEvent extends NetworkEvent + { + public EnergyUpdateEvent(IEnergyNetwork network) + { + super(network); + } + } +} diff --git a/src/main/java/universalelectricity/compat/CompatHandler.java b/src/main/java/universalelectricity/compat/CompatHandler.java new file mode 100644 index 0000000..06d6c53 --- /dev/null +++ b/src/main/java/universalelectricity/compat/CompatHandler.java @@ -0,0 +1,42 @@ +package universalelectricity.compat; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import net.minecraft.tileentity.TileEntity; +import universalelectricity.api.CompatibilityModule; +import universalelectricity.compat.ic2.IC2CompatModule; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.tile.ElectricTileDriver; + +public class CompatHandler { + + static Map ticklist = new ConcurrentHashMap<>(); + + public static void initCompatHandlers() { + FMLCommonHandler.instance().bus().register(new CompatTickHandler()); + if (Loader.isModLoaded("IC2") && UniversalElectricity.ic2Compat) { + CompatibilityModule.register(new IC2CompatModule()); + } + } + + public static void tick() { + for(TileEntity t : ticklist.keySet()) { + ElectricTileDriver driver = ticklist.get(t); + if (!driver.tick()) { + System.out.println("Remove driver for tile at x:" + t.xCoord + " y:" + t.yCoord + " z:" + t.zCoord); + ticklist.remove(t); + driver.invalidate(); + } + } + } + + public static void registerTile(TileEntity tile) { + if (!ticklist.containsKey(tile) && CompatibilityModule.isHandler(tile)) { + ticklist.put(tile, new ElectricTileDriver(tile)); + } + } + +} diff --git a/src/main/java/universalelectricity/compat/CompatTickHandler.java b/src/main/java/universalelectricity/compat/CompatTickHandler.java new file mode 100644 index 0000000..dc61260 --- /dev/null +++ b/src/main/java/universalelectricity/compat/CompatTickHandler.java @@ -0,0 +1,16 @@ +package universalelectricity.compat; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent; + +public class CompatTickHandler { + + @SubscribeEvent + public void onTick(ServerTickEvent event) { + if (event.phase == Phase.END) { + CompatHandler.tick(); + } + } + +} diff --git a/src/main/java/universalelectricity/compat/ic2/IC2CompatModule.java b/src/main/java/universalelectricity/compat/ic2/IC2CompatModule.java new file mode 100644 index 0000000..8ff1fb2 --- /dev/null +++ b/src/main/java/universalelectricity/compat/ic2/IC2CompatModule.java @@ -0,0 +1,242 @@ +package universalelectricity.compat.ic2; + +import ic2.api.energy.EnergyNet; +import ic2.api.energy.tile.IEnergySink; +import ic2.api.energy.tile.IEnergySource; +import ic2.api.energy.tile.IEnergyTile; +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import ic2.api.tile.IEnergyStorage; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.CompatibilityModule; +import universalelectricity.api.CompatibilityType; + +public class IC2CompatModule extends CompatibilityModule { + + private TileEntity getENetTile(Object handler) { + if (handler instanceof TileEntity) { + TileEntity te = (TileEntity) handler; + if (te instanceof IEnergyTile) { + return te; + } + return EnergyNet.instance.getTileEntity(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord); + } + return null; + } + + @Override + public double doReceiveEnergy(Object handler, ForgeDirection direction, double energy, boolean doReceive) { + TileEntity tile = getENetTile(handler); + + if (tile instanceof IEnergySink) { + IEnergySink sink = (IEnergySink) tile; + double demand = sink.getDemandedEnergy(); + double toReceive = Math.min(demand, CompatibilityType.INDUSTRIALCRAFT.fromJoules(energy)); + + if (doReceive) { + double leftover = sink.injectEnergy(direction, toReceive, 1); + return CompatibilityType.INDUSTRIALCRAFT.toJoules(Math.max(0, toReceive - leftover)); + } + + return CompatibilityType.INDUSTRIALCRAFT.toJoules(toReceive); + } + return 0; + } + + @Override + public double doExtractEnergy(Object handler, ForgeDirection direction, double energy, boolean doExtract) { + TileEntity tile = getENetTile(handler); + if (tile instanceof IEnergySource) + { + double demand = Math.min(((IEnergySource) tile).getOfferedEnergy(), energy * CompatibilityType.INDUSTRIALCRAFT.ratio); + + if (doExtract) + { + ((IEnergySource) tile).drawEnergy(demand); + } + + return demand * CompatibilityType.INDUSTRIALCRAFT.reciprocal_ratio; + } + + return 0; + } + + @Override + public double doChargeItem(ItemStack itemStack, double joules, boolean docharge) { + if (itemStack.getItem() instanceof IElectricItem) + { + return (ElectricItem.manager.charge(itemStack, joules * CompatibilityType.INDUSTRIALCRAFT.ratio, 4, true, !docharge) * CompatibilityType.INDUSTRIALCRAFT.reciprocal_ratio); + } + return 0; + } + + @Override + public double doDischargeItem(ItemStack itemStack, double joules, boolean doDischarge) { + if (itemStack.getItem() instanceof IElectricItem) + { + IElectricItem item = (IElectricItem) itemStack.getItem(); + + if (item.canProvideEnergy(itemStack)) + { + return (long) (ElectricItem.manager.discharge(itemStack, joules * CompatibilityType.INDUSTRIALCRAFT.ratio, 4, true, false, !doDischarge) * CompatibilityType.INDUSTRIALCRAFT.reciprocal_ratio); + } + } + return 0; + } + + @Override + public boolean doIsHandler(Object obj) { + return getENetTile(obj) != null || obj instanceof IElectricItem; + } + + @Override + public boolean doIsEnergyContainer(Object obj) { + TileEntity tile = getENetTile(obj); + return tile instanceof IEnergyStorage; + } + + @Override + public double doGetEnergy(Object obj, ForgeDirection direction) { + TileEntity tile = getENetTile(obj); + + if (tile instanceof IEnergyStorage) { + return CompatibilityType.INDUSTRIALCRAFT.toJoules(((IEnergyStorage)tile).getStored()); + } + + return 0; + } + + @Override + public boolean doCanConnect(Object obj, ForgeDirection direction, Object source) { + TileEntity tile = getENetTile(obj); + + if (tile instanceof IEnergySink) + { + if (((IEnergySink) tile).acceptsEnergyFrom((TileEntity) source, direction)) + return true; + } + + if (tile instanceof IEnergySource) + { + if (((IEnergySource) tile).emitsEnergyTo((TileEntity) source, direction)) + return true; + } + return false; + } + + @Override + public ItemStack doGetItemWithCharge(ItemStack itemStack, double energy) { + ItemStack is = itemStack.copy(); + + ElectricItem.manager.discharge(is, Integer.MAX_VALUE, 1, true, false, false); + ElectricItem.manager.charge(is, (int) (energy * CompatibilityType.INDUSTRIALCRAFT.ratio), 1, true, false); + + return is; + } + + @Override + public double doGetMaxEnergy(Object handler, ForgeDirection direction) { + TileEntity tile = getENetTile(handler); + + if (tile instanceof IEnergyStorage) { + return CompatibilityType.INDUSTRIALCRAFT.toJoules(((IEnergyStorage)tile).getCapacity()); + } + + return 0; + } + + @Override + public double doGetEnergyItem(ItemStack is) { + return ElectricItem.manager.getCharge(is) * CompatibilityType.INDUSTRIALCRAFT.reciprocal_ratio; + } + + @Override + public double doGetMaxEnergyItem(ItemStack is) { + return ((IElectricItem) is.getItem()).getMaxCharge(is) * CompatibilityType.INDUSTRIALCRAFT.reciprocal_ratio; + } + + @Override + public double doGetInputVoltage(Object handler) { + TileEntity tile = getENetTile(handler); + + if (tile instanceof IEnergySink) { + return tierToVolt(((IEnergySink)tile).getSinkTier()); + } + + return 0; + } + + @Override + public double doGetOutputVoltage(Object handler) { + TileEntity tile = getENetTile(handler); + + if (tile instanceof IEnergySource) { + return tierToVolt(((IEnergySource)tile).getSourceTier()); + } + + return 0; + } + + @Override + public boolean doCanReceive(Object handler, ForgeDirection side) { + TileEntity tile = getENetTile(handler); + if (!(tile instanceof IEnergySink)) return false; + + if (side != ForgeDirection.UNKNOWN) { + return ((IEnergySink)tile).acceptsEnergyFrom(null, side); + } + + return true; + } + + @Override + public boolean doCanExtract(Object handler, ForgeDirection side) { + TileEntity tile = getENetTile(handler); + if (!(tile instanceof IEnergySource)) return false; + + if (side != ForgeDirection.UNKNOWN) { + return ((IEnergySource)tile).emitsEnergyTo(null, side); + } + + return true; + } + + @Override + public double doGetDemandedJoules(Object handler) { + TileEntity tile = getENetTile(handler); + if (tile instanceof IEnergySink) { + IEnergySink sink = (IEnergySink) tile; + return CompatibilityType.INDUSTRIALCRAFT.toJoules(sink.getDemandedEnergy()); + } + return 0; + } + + @Override + public double doGetProvidedJoules(Object handler) { + TileEntity tile = getENetTile(handler); + if (tile instanceof IEnergySource) { + IEnergySource source = (IEnergySource) tile; + return CompatibilityType.INDUSTRIALCRAFT.toJoules(source.getOfferedEnergy()); + } + return 0; + } + + public static int voltToTier(double volt) { + if (volt <= 120.0) return 1; + if (volt <= 240.0) return 2; + if (volt <= 480.0) return 3; + return 4; + } + + public static double tierToVolt(int tier) { + switch (tier) { + case 1: return 120.0; + case 2: return 240.0; + case 3: return 480.0; + default: return 960.0; + } + } + +} diff --git a/src/main/java/universalelectricity/core/Pair.java b/src/main/java/universalelectricity/core/Pair.java new file mode 100644 index 0000000..dfa4832 --- /dev/null +++ b/src/main/java/universalelectricity/core/Pair.java @@ -0,0 +1,34 @@ +package universalelectricity.core; + +public class Pair { + private final L left; + private final R right; + + public Pair(L left, R right) { + this.left = left; + this.right = right; + } + + public L getKey() { + return this.left; + } + + public R getValue() { + return this.right; + } + + public int hashCode() { + return this.left.hashCode() ^ this.right.hashCode(); + } + + public boolean equals(Object o) { + if (o == null) { + return false; + } + if (!(o instanceof Pair)) { + return false; + } + Pair pairo = (Pair)o; + return this.left.equals(pairo.getKey()) && this.right.equals(pairo.getValue()); + } +} diff --git a/src/main/java/universalelectricity/core/UniversalElectricity.java b/src/main/java/universalelectricity/core/UniversalElectricity.java new file mode 100644 index 0000000..0272510 --- /dev/null +++ b/src/main/java/universalelectricity/core/UniversalElectricity.java @@ -0,0 +1,42 @@ +package universalelectricity.core; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +import java.io.File; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraftforge.common.config.Configuration; +import universalelectricity.api.CompatibilityType; +import universalelectricity.compat.CompatHandler; + +@Mod(modid = "universalelectricity", name = "Universal Electricity", version = UniversalElectricity.VERSION) +public class UniversalElectricity { + + public static final String VERSION = "{VERSION}"; + public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "UniversalElectricity.cfg")); + public static double UE_IC2_RATIO = CompatibilityType.INDUSTRIALCRAFT.reciprocal_ratio; + public static double UE_RF_RATIO = CompatibilityType.REDSTONE_FLUX.reciprocal_ratio; + public static boolean isVoltageSensitive = true; + public static boolean isNetworkActive = true; + public static boolean ic2Compat = false; + public static final Material machine = new Material(MapColor.ironColor); + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent e) { + CONFIGURATION.load(); + isVoltageSensitive = CONFIGURATION.get("Compatiblity", "Is Voltage Sensitive", isVoltageSensitive).getBoolean(isVoltageSensitive); + isNetworkActive = CONFIGURATION.get("Compatiblity", "Is Network Active", isNetworkActive).getBoolean(isNetworkActive); + ic2Compat = CONFIGURATION.get("Compatiblity", "Compatiblity with IC2 tiles and items", ic2Compat).getBoolean(ic2Compat); + CONFIGURATION.save(); + } + + @Mod.EventHandler + public void init(FMLInitializationEvent e) { + CompatHandler.initCompatHandlers(); + + } + +} diff --git a/src/main/java/universalelectricity/core/block/IConductor.java b/src/main/java/universalelectricity/core/block/IConductor.java new file mode 100644 index 0000000..f2ba6bf --- /dev/null +++ b/src/main/java/universalelectricity/core/block/IConductor.java @@ -0,0 +1,17 @@ +package universalelectricity.core.block; + +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.net.IConnector; +import universalelectricity.core.electricity.IElectricityNetwork; + +public interface IConductor extends INetworkProvider, IConnectionProvider, IConnector { + + double getResistance(); + + double getCurrentCapcity(); + + @Override + default IConnector getInstance(ForgeDirection dir) { + return this; + } +} diff --git a/src/main/java/universalelectricity/core/block/IConnectionProvider.java b/src/main/java/universalelectricity/core/block/IConnectionProvider.java new file mode 100644 index 0000000..653d6e6 --- /dev/null +++ b/src/main/java/universalelectricity/core/block/IConnectionProvider.java @@ -0,0 +1,11 @@ +package universalelectricity.core.block; + +import net.minecraft.tileentity.TileEntity; +import universalelectricity.core.block.IConnector; + +public interface IConnectionProvider extends IConnector { + + TileEntity[] getAdjacentConnections(); + + void updateAdjacentConnections(); +} diff --git a/src/main/java/universalelectricity/core/block/IConnector.java b/src/main/java/universalelectricity/core/block/IConnector.java new file mode 100644 index 0000000..5a542c2 --- /dev/null +++ b/src/main/java/universalelectricity/core/block/IConnector.java @@ -0,0 +1,17 @@ +package universalelectricity.core.block; + +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.net.IConnectable; + +public interface IConnector extends IConnectable, ISelfDriven { + + boolean canConnect(ForgeDirection from); + + @Override + default boolean canConnect(ForgeDirection from, Object source) { + if (source instanceof IConnector) { + return canConnect(from); + } + return false; + } +} diff --git a/src/main/java/universalelectricity/core/block/IElectricityStorage.java b/src/main/java/universalelectricity/core/block/IElectricityStorage.java new file mode 100644 index 0000000..831d243 --- /dev/null +++ b/src/main/java/universalelectricity/core/block/IElectricityStorage.java @@ -0,0 +1,42 @@ +package universalelectricity.core.block; + +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.energy.IEnergyContainer; + +@Deprecated +public interface IElectricityStorage extends IEnergyContainer { + + double getJoules(); + + void setJoules(double var1); + + double getMaxJoules(); + + @Override + default double getEnergy(ForgeDirection from) { + return getJoules(); + } + + @Override + default void setEnergy(ForgeDirection from, double energy) { + setJoules(energy); + } + + @Override + default double getEnergyCapacity(ForgeDirection from) { + return getMaxEnergy(); + } + + default double getEnergy() { + return getJoules(); + } + + default void setEnergy(double energy) { + setJoules(energy); + } + + default double getMaxEnergy() { + return getMaxJoules(); + } + +} diff --git a/src/main/java/universalelectricity/core/block/INetworkProvider.java b/src/main/java/universalelectricity/core/block/INetworkProvider.java new file mode 100644 index 0000000..1730ac7 --- /dev/null +++ b/src/main/java/universalelectricity/core/block/INetworkProvider.java @@ -0,0 +1,7 @@ +package universalelectricity.core.block; + +import universalelectricity.core.electricity.IElectricityNetwork; + +public interface INetworkProvider extends universalelectricity.api.net.INetworkProvider { + +} diff --git a/src/main/java/universalelectricity/core/block/ISelfDriven.java b/src/main/java/universalelectricity/core/block/ISelfDriven.java new file mode 100644 index 0000000..d71a417 --- /dev/null +++ b/src/main/java/universalelectricity/core/block/ISelfDriven.java @@ -0,0 +1,5 @@ +package universalelectricity.core.block; + +public interface ISelfDriven { + +} diff --git a/src/main/java/universalelectricity/core/block/IVoltage.java b/src/main/java/universalelectricity/core/block/IVoltage.java new file mode 100644 index 0000000..be0c0d2 --- /dev/null +++ b/src/main/java/universalelectricity/core/block/IVoltage.java @@ -0,0 +1,7 @@ +package universalelectricity.core.block; + + +public interface IVoltage { + + double getVoltage(); +} diff --git a/src/main/java/universalelectricity/core/electricity/ElectricityNetwork.java b/src/main/java/universalelectricity/core/electricity/ElectricityNetwork.java new file mode 100644 index 0000000..f11d6c7 --- /dev/null +++ b/src/main/java/universalelectricity/core/electricity/ElectricityNetwork.java @@ -0,0 +1,365 @@ +package universalelectricity.core.electricity; + +import cpw.mods.fml.common.FMLLog; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.block.IConductor; +import universalelectricity.core.block.IConnectionProvider; +import universalelectricity.core.block.INetworkProvider; +import universalelectricity.core.path.PathfinderChecker; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; + +public class ElectricityNetwork implements IElectricityNetwork { + + private final HashMap producers = new HashMap<>(); + private final HashMap consumers = new HashMap<>(); + private final Set conductors = new HashSet<>(); + + + public ElectricityNetwork() {} + + public ElectricityNetwork(IConductor ... conductors) { + this.conductors.addAll(Arrays.asList(conductors)); + } + + public void startProducing(TileEntity tileEntity, ElectricityPack electricityPack) { + if(tileEntity != null && electricityPack.getWatts() > 0.0D) { + this.producers.put(tileEntity, electricityPack); + } + + } + + public void startProducing(TileEntity tileEntity, double amperes, double voltage) { + this.startProducing(tileEntity, new ElectricityPack(amperes, voltage)); + } + + public boolean isProducing(TileEntity tileEntity) { + return this.producers.containsKey(tileEntity); + } + + public void stopProducing(TileEntity tileEntity) { + this.producers.remove(tileEntity); + } + + public void startRequesting(TileEntity tileEntity, ElectricityPack electricityPack) { + if(tileEntity != null && electricityPack.getWatts() > 0.0D) { + this.consumers.put(tileEntity, electricityPack); + } + + } + + public void startRequesting(TileEntity tileEntity, double amperes, double voltage) { + this.startRequesting(tileEntity, new ElectricityPack(amperes, voltage)); + } + + public boolean isRequesting(TileEntity tileEntity) { + return this.consumers.containsKey(tileEntity); + } + + public void stopRequesting(TileEntity tileEntity) { + this.consumers.remove(tileEntity); + } + + public ElectricityPack getProduced(TileEntity ... ignoreTiles) { + ElectricityPack totalElectricity = new ElectricityPack(0.0D, 0.0D); + Iterator it = this.producers.entrySet().iterator(); + + label47: + while(it.hasNext()) { + Entry pairs = (Entry)it.next(); + if(pairs != null) { + TileEntity tileEntity = (TileEntity)pairs.getKey(); + if(tileEntity == null) { + it.remove(); + } else if(tileEntity.isInvalid()) { + it.remove(); + } else if(tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) != tileEntity) { + it.remove(); + } else { + if(ignoreTiles != null) { + TileEntity[] pack = ignoreTiles; + int newWatts = ignoreTiles.length; + + for(int i$ = 0; i$ < newWatts; ++i$) { + TileEntity newVoltage = pack[i$]; + if(tileEntity == newVoltage) { + continue label47; + } + } + } + + ElectricityPack var11 = (ElectricityPack)pairs.getValue(); + if(pairs.getKey() != null && pairs.getValue() != null && var11 != null) { + double var12 = totalElectricity.getWatts() + var11.getWatts(); + double var13 = Math.max(totalElectricity.voltage, var11.voltage); + totalElectricity.amperes = var12 / var13; + totalElectricity.voltage = var13; + } + } + } + } + + return totalElectricity; + } + + public ElectricityPack getRequest(TileEntity ... ignoreTiles) { + ElectricityPack totalElectricity = this.getRequestWithoutReduction(); + totalElectricity.amperes = Math.max(totalElectricity.amperes - this.getProduced(ignoreTiles).amperes, 0.0D); + return totalElectricity; + } + + public ElectricityPack getRequestWithoutReduction() { + ElectricityPack totalElectricity = new ElectricityPack(0.0D, 0.0D); + Iterator it = this.consumers.entrySet().iterator(); + + while(it.hasNext()) { + Entry pairs = (Entry)it.next(); + if(pairs != null) { + TileEntity tileEntity = (TileEntity)pairs.getKey(); + if(tileEntity == null) { + it.remove(); + } else if(tileEntity.isInvalid()) { + it.remove(); + } else if(tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) != tileEntity) { + it.remove(); + } else { + ElectricityPack pack = (ElectricityPack)pairs.getValue(); + if(pack != null) { + totalElectricity.amperes += pack.amperes; + totalElectricity.voltage = Math.max(totalElectricity.voltage, pack.voltage); + } + } + } + } + + return totalElectricity; + } + + public ElectricityPack consumeElectricity(TileEntity tileEntity) { + ElectricityPack totalElectricity = new ElectricityPack(0.0D, 0.0D); + + try { + ElectricityPack e = (ElectricityPack)this.consumers.get(tileEntity); + if(this.consumers.containsKey(tileEntity) && e != null) { + totalElectricity = this.getProduced(new TileEntity[0]); + if(totalElectricity.getWatts() > 0.0D) { + ElectricityPack totalRequest = this.getRequestWithoutReduction(); + totalElectricity.amperes *= e.amperes / totalRequest.amperes; + int distance = this.conductors.size(); + double ampsReceived = totalElectricity.amperes - totalElectricity.amperes * totalElectricity.amperes * this.getTotalResistance() / totalElectricity.voltage; + double voltsReceived = totalElectricity.voltage - totalElectricity.amperes * this.getTotalResistance(); + totalElectricity.amperes = ampsReceived; + totalElectricity.voltage = voltsReceived; + return totalElectricity; + } + } + } catch (Exception var10) { + FMLLog.severe("Failed to consume electricity!", new Object[0]); + var10.printStackTrace(); + } + + return totalElectricity; + } + + public HashMap getProducers() { + return this.producers; + } + + public List getProviders() { + ArrayList providers = new ArrayList<>(); + providers.addAll(this.producers.keySet()); + return providers; + } + + public HashMap getConsumers() { + return this.consumers; + } + + public List getReceivers() { + ArrayList receivers = new ArrayList<>(); + receivers.addAll(this.consumers.keySet()); + return receivers; + } + + public void cleanUpConductors() { + Iterator it = this.conductors.iterator(); + + while(it.hasNext()) { + IConductor conductor = (IConductor)it.next(); + if(conductor == null) { + it.remove(); + } else if(((TileEntity)conductor).isInvalid()) { + it.remove(); + } else { + conductor.setNetwork(this); + } + } + + } + + public void refreshConductors() { + this.cleanUpConductors(); + + try { + Iterator e = this.conductors.iterator(); + + while(e.hasNext()) { + IConductor conductor = (IConductor)e.next(); + conductor.updateAdjacentConnections(); + } + } catch (Exception var3) { + FMLLog.severe("Universal Electricity: Failed to refresh conductor.", new Object[0]); + var3.printStackTrace(); + } + + } + + public double getTotalResistance() { + double resistance = 0.0D; + + IConductor conductor; + for(Iterator i$ = this.conductors.iterator(); i$.hasNext(); resistance += conductor.getResistance()) { + conductor = (IConductor)i$.next(); + } + + return resistance; + } + + public double getLowestCurrentCapacity() { + double lowestAmp = 0.0D; + Iterator i$ = this.conductors.iterator(); + + while(i$.hasNext()) { + IConductor conductor = (IConductor)i$.next(); + if(lowestAmp == 0.0D || conductor.getCurrentCapcity() < lowestAmp) { + lowestAmp = conductor.getCurrentCapcity(); + } + } + + return lowestAmp; + } + + public Set getConductors() { + return this.conductors; + } + + public void mergeConnection(IElectricityNetwork network) { + if(network != null && network != this) { + ElectricityNetwork newNetwork = new ElectricityNetwork(); + newNetwork.getConductors().addAll(this.getConductors()); + newNetwork.getConductors().addAll(network.getConductors()); + newNetwork.cleanUpConductors(); + } + + } + + public void splitNetwork(IConnectionProvider splitPoint) { + if(splitPoint instanceof TileEntity) { + this.getConductors().remove(splitPoint); + ForgeDirection[] connectedBlocks = ForgeDirection.values(); + int i = connectedBlocks.length; + + for(int connectedBlockA = 0; connectedBlockA < i; ++connectedBlockA) { + ForgeDirection ii = connectedBlocks[connectedBlockA]; + if(ii != ForgeDirection.UNKNOWN) { + Vector3 connectedBlockB = new Vector3((TileEntity)splitPoint); + TileEntity finder = VectorHelper.getTileEntityFromSide(((TileEntity)splitPoint).getWorldObj(), connectedBlockB, ii); + if(this.producers.containsKey(finder)) { + this.stopProducing(finder); + this.stopRequesting(finder); + } + } + } + + TileEntity[] var12 = splitPoint.getAdjacentConnections(); + + for(i = 0; i < var12.length; ++i) { + TileEntity var13 = var12[i]; + if(var13 instanceof IConnectionProvider) { + for(int var14 = 0; var14 < var12.length; ++var14) { + TileEntity var15 = var12[var14]; + if(var13 != var15 && var15 instanceof IConnectionProvider) { + PathfinderChecker var16 = new PathfinderChecker(((TileEntity)splitPoint).getWorldObj(), (IConnectionProvider)var15, new IConnectionProvider[]{splitPoint}); + var16.init(new Vector3(var13)); + if(var16.results.size() > 0) { + Iterator newNetwork = var16.closedSet.iterator(); + + while(newNetwork.hasNext()) { + Vector3 i$ = (Vector3)newNetwork.next(); + TileEntity node = i$.getTileEntity(((TileEntity)splitPoint).getWorldObj()); + if(node instanceof INetworkProvider && node != splitPoint) { + ((INetworkProvider)node).setNetwork(this); + } + } + } else { + ElectricityNetwork var17 = new ElectricityNetwork(); + Iterator var18 = var16.closedSet.iterator(); + + while(var18.hasNext()) { + Vector3 var19 = (Vector3)var18.next(); + TileEntity nodeTile = var19.getTileEntity(((TileEntity)splitPoint).getWorldObj()); + if(nodeTile instanceof INetworkProvider && nodeTile != splitPoint) { + var17.getConductors().add((IConductor)nodeTile); + } + } + + var17.cleanUpConductors(); + } + } + } + } + } + } + + } + + public String toString() { + return "ElectricityNetwork[" + this.hashCode() + "|Wires:" + this.conductors.size() + "]"; + } + + @Override + public void addConnector(IConductor connector) { + this.conductors.add(connector); + } + + @Override + public void removeConnector(IConductor connector) { + this.conductors.remove(connector); + } + + @Override + public Set getConnectors() { + return this.conductors; + } + + @Override + public void reconstruct() { + refreshConductors(); + } + + @Override + public IElectricityNetwork merge(IElectricityNetwork network) { + this.mergeConnection(network); + return this; + } + + @Override + public void split(IConductor connection) { + splitNetwork(connection); + } + + @Override + public void split(IConductor connectorA, IConductor connectorB) { + // TODO: implement this + } + +} diff --git a/src/main/java/universalelectricity/core/electricity/ElectricityNetworkHelper.java b/src/main/java/universalelectricity/core/electricity/ElectricityNetworkHelper.java new file mode 100644 index 0000000..b1ac5be --- /dev/null +++ b/src/main/java/universalelectricity/core/electricity/ElectricityNetworkHelper.java @@ -0,0 +1,151 @@ +package universalelectricity.core.electricity; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.CompatibilityModule; +import universalelectricity.core.block.IConnector; +import universalelectricity.core.block.INetworkProvider; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; + +public class ElectricityNetworkHelper { + + public static void invalidate(TileEntity tileEntity) { + for(int i = 0; i < 6; ++i) { + ForgeDirection direction = ForgeDirection.getOrientation(i); + TileEntity checkTile = VectorHelper.getConnectorFromSide(tileEntity.getWorldObj(), new Vector3(tileEntity), direction); + if(checkTile instanceof INetworkProvider) { + IElectricityNetwork network = ((INetworkProvider)checkTile).getNetwork(); + if(network != null) { + network.stopRequesting(tileEntity); + network.stopProducing(tileEntity); + } + } + } + + } + + public static EnumSet getDirections(TileEntity tileEntity) { + EnumSet possibleSides = EnumSet.noneOf(ForgeDirection.class); + if(tileEntity instanceof IConnector) { + for(int i = 0; i < 6; ++i) { + ForgeDirection direction = ForgeDirection.getOrientation(i); + if(((IConnector)tileEntity).canConnect(direction)) { + possibleSides.add(direction); + } + } + } + + return possibleSides; + } + + public static ElectricityPack produceFromMultipleSides(TileEntity tileEntity, ElectricityPack electricityPack) { + return produceFromMultipleSides(tileEntity, getDirections(tileEntity), electricityPack); + } + + public static ElectricityPack produceFromMultipleSides(TileEntity tileEntity, EnumSet approachingDirection, ElectricityPack producingPack) { + ElectricityPack remainingElectricity = producingPack.clone(); + if(tileEntity != null && approachingDirection != null) { + List connectedNetworks = getNetworksFromMultipleSides(tileEntity, approachingDirection); + if(connectedNetworks.size() > 0) { + double wattsPerSide = producingPack.getWatts() / (double)connectedNetworks.size(); + double voltage = producingPack.voltage; + Iterator i$ = connectedNetworks.iterator(); + + while(i$.hasNext()) { + IElectricityNetwork network = (IElectricityNetwork)i$.next(); + if(wattsPerSide > 0.0D && producingPack.getWatts() > 0.0D) { + double amperes = Math.min(wattsPerSide / voltage, network.getRequest(new TileEntity[]{tileEntity}).amperes); + if(amperes > 0.0D) { + network.startProducing(tileEntity, amperes, voltage); + remainingElectricity.amperes -= amperes; + } + } else { + network.stopProducing(tileEntity); + } + } + } + } + + return remainingElectricity; + } + + public static ElectricityPack consumeFromMultipleSides(TileEntity tileEntity, ElectricityPack electricityPack) { + return consumeFromMultipleSides(tileEntity, getDirections(tileEntity), electricityPack); + } + + public static ElectricityPack consumeFromMultipleSides(TileEntity tileEntity, EnumSet approachingDirection, ElectricityPack requestPack) { + ElectricityPack consumedPack = new ElectricityPack(); + if(tileEntity != null && approachingDirection != null) { + List connectedNetworks = getNetworksFromMultipleSides(tileEntity, approachingDirection); + if(connectedNetworks.size() > 0) { + double wattsPerSide = requestPack.getWatts() / (double)connectedNetworks.size(); + double voltage = requestPack.voltage; + Iterator i$ = connectedNetworks.iterator(); + + while(i$.hasNext()) { + IElectricityNetwork network = (IElectricityNetwork)i$.next(); + if(wattsPerSide > 0.0D && requestPack.getWatts() > 0.0D) { + network.startRequesting(tileEntity, wattsPerSide / voltage, voltage); + ElectricityPack receivedPack = network.consumeElectricity(tileEntity); + consumedPack.amperes += receivedPack.amperes; + consumedPack.voltage = Math.max(consumedPack.voltage, receivedPack.voltage); + } else { + network.stopRequesting(tileEntity); + } + } + } + } + + return consumedPack; + } + + public static List getNetworksFromMultipleSides(TileEntity tileEntity, EnumSet approachingDirection) { + ArrayList connectedNetworks = new ArrayList(); + + for(int i = 0; i < 6; ++i) { + ForgeDirection direction = ForgeDirection.getOrientation(i); + if(approachingDirection.contains(direction)) { + Vector3 position = new Vector3(tileEntity); + position.modifyPositionFromSide(direction); + TileEntity outputConductor = position.getTileEntity(tileEntity.getWorldObj()); + IElectricityNetwork electricityNetwork = getNetworkFromTileEntity(outputConductor, direction); + if(electricityNetwork != null && !connectedNetworks.contains(electricityNetwork)) { + connectedNetworks.add(electricityNetwork); + } + } + } + + return connectedNetworks; + } + + public static IElectricityNetwork getNetworkFromTileEntity(TileEntity tileEntity, ForgeDirection approachDirection) { + if(tileEntity != null && tileEntity instanceof INetworkProvider) { + if(!(tileEntity instanceof IConnector)) { + return ((INetworkProvider)tileEntity).getNetwork(); + } + + if(((IConnector)tileEntity).canConnect(approachDirection.getOpposite())) { + return ((INetworkProvider)tileEntity).getNetwork(); + } + } + + return null; + } + + public static boolean canConnect(TileEntity tileEntity, ForgeDirection side, TileEntity source) { + if (tileEntity == null) { + return false; + } else if (tileEntity instanceof IConnector) { + return ((IConnector)tileEntity).canConnect(side, source); + } else { + return CompatibilityModule.canConnect(tileEntity, side, source); + } + } + +} diff --git a/src/main/java/universalelectricity/core/electricity/ElectricityPack.java b/src/main/java/universalelectricity/core/electricity/ElectricityPack.java new file mode 100644 index 0000000..1560db0 --- /dev/null +++ b/src/main/java/universalelectricity/core/electricity/ElectricityPack.java @@ -0,0 +1,102 @@ +package universalelectricity.core.electricity; + + +public class ElectricityPack implements Cloneable { + + public double amperes; + public double voltage; + + + public ElectricityPack(double amperes, double voltage) { + this.amperes = amperes; + this.voltage = voltage; + } + + public ElectricityPack() { + this(0.0D, 0.0D); + } + + public static ElectricityPack getFromWatts(double watts, double voltage) { + return new ElectricityPack(watts / voltage, voltage); + } + + public double getWatts() { + return getWatts(this.amperes, this.voltage); + } + + public double getConductance() { + return getConductance(this.amperes, this.voltage); + } + + public double getResistance() { + return getResistance(this.amperes, this.voltage); + } + + 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.0D; + } + + 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.0D; + } + + public static double getWatts(double amps, double voltage) { + return amps * voltage; + } + + public static double getWatts(double wattHours) { + return wattHours * 3600.0D; + } + + public static double getWattHours(double watts) { + return watts / 3600.0D; + } + + 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; + } + + public String toString() { + return "ElectricityPack [Amps:" + this.amperes + " Volts:" + this.voltage + "]"; + } + + public ElectricityPack clone() { + return new ElectricityPack(this.amperes, this.voltage); + } + + public boolean isEqual(ElectricityPack electricityPack) { + return this.amperes == electricityPack.amperes && this.voltage == electricityPack.voltage; + } +} diff --git a/src/main/java/universalelectricity/core/electricity/IConductorRegistry.java b/src/main/java/universalelectricity/core/electricity/IConductorRegistry.java new file mode 100644 index 0000000..79aa9db --- /dev/null +++ b/src/main/java/universalelectricity/core/electricity/IConductorRegistry.java @@ -0,0 +1,15 @@ +package universalelectricity.core.electricity; + +import java.util.List; +import universalelectricity.core.block.IConductor; + +public interface IConductorRegistry { + + void register(IConductor var1); + + void cleanConductors(); + + void resetAllConnections(); + + List getConductors(); +} diff --git a/src/main/java/universalelectricity/core/electricity/IElectricityNetwork.java b/src/main/java/universalelectricity/core/electricity/IElectricityNetwork.java new file mode 100644 index 0000000..7d84b5e --- /dev/null +++ b/src/main/java/universalelectricity/core/electricity/IElectricityNetwork.java @@ -0,0 +1,59 @@ +package universalelectricity.core.electricity; + +import java.util.HashMap; +import java.util.List; +import java.util.Set; +import net.minecraft.tileentity.TileEntity; +import universalelectricity.api.net.INetwork; +import universalelectricity.core.block.IConductor; +import universalelectricity.core.block.IConnectionProvider; + +public interface IElectricityNetwork extends INetwork { + + void startProducing(TileEntity var1, ElectricityPack var2); + + void startProducing(TileEntity var1, double var2, double var4); + + boolean isProducing(TileEntity var1); + + void stopProducing(TileEntity var1); + + void startRequesting(TileEntity var1, ElectricityPack var2); + + void startRequesting(TileEntity var1, double var2, double var4); + + boolean isRequesting(TileEntity var1); + + void stopRequesting(TileEntity var1); + + ElectricityPack getProduced(TileEntity ... var1); + + ElectricityPack getRequest(TileEntity ... var1); + + ElectricityPack getRequestWithoutReduction(); + + ElectricityPack consumeElectricity(TileEntity var1); + + HashMap getProducers(); + + List getProviders(); + + HashMap getConsumers(); + + List getReceivers(); + + Set getConductors(); + + double getTotalResistance(); + + double getLowestCurrentCapacity(); + + void cleanUpConductors(); + + void refreshConductors(); + + void mergeConnection(IElectricityNetwork var1); + + void splitNetwork(IConnectionProvider var1); + +} diff --git a/src/main/java/universalelectricity/core/item/ElectricItemHelper.java b/src/main/java/universalelectricity/core/item/ElectricItemHelper.java new file mode 100644 index 0000000..8284c4d --- /dev/null +++ b/src/main/java/universalelectricity/core/item/ElectricItemHelper.java @@ -0,0 +1,67 @@ +package universalelectricity.core.item; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import universalelectricity.api.CompatibilityModule; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.item.IItemElectric; + +public class ElectricItemHelper { + + public static double chargeItem(ItemStack itemStack, double joules, double voltage) { + if(itemStack != null && itemStack.getItem() instanceof IItemElectric) { + IItemElectric electricItem = (IItemElectric)itemStack.getItem(); + double providingWatts = Math.min(joules, electricItem.getReceiveRequest(itemStack).getWatts()); + if(providingWatts > 0.0D) { + ElectricityPack providedElectricity = electricItem.onReceive(ElectricityPack.getFromWatts(providingWatts, voltage), itemStack); + return providedElectricity.getWatts(); + } + } else if (itemStack != null && CompatibilityModule.isHandler(itemStack.getItem())) { + return CompatibilityModule.chargeItem(itemStack, joules, true); + } + + return 0.0D; + } + + public static double dechargeItem(ItemStack itemStack, double joules, double voltage) { + if(itemStack != null && itemStack.getItem() instanceof IItemElectric) { + IItemElectric electricItem = (IItemElectric)itemStack.getItem(); + double requestingWatts = Math.min(joules, electricItem.getProvideRequest(itemStack).getWatts()); + if(requestingWatts > 0.0D) { + ElectricityPack receivedElectricity = electricItem.onProvide(ElectricityPack.getFromWatts(requestingWatts, voltage), itemStack); + return receivedElectricity.getWatts(); + } + } else if (itemStack != null && CompatibilityModule.isHandler(itemStack.getItem())) { + return CompatibilityModule.dischargeItem(itemStack, joules, true); + } + + return 0.0D; + } + + public static ItemStack getWithCharge(ItemStack itemStack, double joules) { + if(itemStack != null && itemStack.getItem() instanceof IItemElectric) { + ((IItemElectric)itemStack.getItem()).setJoules(joules, itemStack); + return itemStack; + } else if (itemStack != null && CompatibilityModule.isHandler(itemStack.getItem())) { + return CompatibilityModule.getItemWithCharge(itemStack, joules); + } else { + return itemStack; + } + } + + public static ItemStack getWithCharge(Item item, double joules) { + return getWithCharge(new ItemStack(item), joules); + } + + public static ItemStack getCloneWithCharge(ItemStack itemStack, double joules) { + return getWithCharge(itemStack.copy(), joules); + } + + public static ItemStack getUncharged(ItemStack itemStack) { + return getWithCharge(itemStack, 0.0D); + } + + public static ItemStack getUncharged(Item item) { + return getUncharged(new ItemStack(item)); + } +} diff --git a/src/main/java/universalelectricity/core/item/IItemElectric.java b/src/main/java/universalelectricity/core/item/IItemElectric.java new file mode 100644 index 0000000..17eb647 --- /dev/null +++ b/src/main/java/universalelectricity/core/item/IItemElectric.java @@ -0,0 +1,17 @@ +package universalelectricity.core.item; + +import net.minecraft.item.ItemStack; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.item.IItemElectricityStorage; +import universalelectricity.core.item.IItemVoltage; + +public interface IItemElectric extends IItemElectricityStorage, IItemVoltage { + + ElectricityPack onReceive(ElectricityPack var1, ItemStack var2); + + ElectricityPack onProvide(ElectricityPack var1, ItemStack var2); + + ElectricityPack getReceiveRequest(ItemStack var1); + + ElectricityPack getProvideRequest(ItemStack var1); +} diff --git a/src/main/java/universalelectricity/core/item/IItemElectricityStorage.java b/src/main/java/universalelectricity/core/item/IItemElectricityStorage.java new file mode 100644 index 0000000..5a88ab4 --- /dev/null +++ b/src/main/java/universalelectricity/core/item/IItemElectricityStorage.java @@ -0,0 +1,12 @@ +package universalelectricity.core.item; + +import net.minecraft.item.ItemStack; + +public interface IItemElectricityStorage { + + double getJoules(ItemStack var1); + + void setJoules(double var1, ItemStack var3); + + double getMaxJoules(ItemStack var1); +} diff --git a/src/main/java/universalelectricity/core/item/IItemVoltage.java b/src/main/java/universalelectricity/core/item/IItemVoltage.java new file mode 100644 index 0000000..cd15b82 --- /dev/null +++ b/src/main/java/universalelectricity/core/item/IItemVoltage.java @@ -0,0 +1,7 @@ +package universalelectricity.core.item; + +import universalelectricity.api.item.IVoltageItem; + +public interface IItemVoltage extends IVoltageItem { + +} diff --git a/src/main/java/universalelectricity/core/item/ItemElectric.java b/src/main/java/universalelectricity/core/item/ItemElectric.java new file mode 100644 index 0000000..ebab4bd --- /dev/null +++ b/src/main/java/universalelectricity/core/item/ItemElectric.java @@ -0,0 +1,93 @@ +package universalelectricity.core.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import universalelectricity.api.energy.UnitDisplay; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.item.ElectricItemHelper; +import universalelectricity.core.item.IItemElectric; + +public abstract class ItemElectric extends Item implements IItemElectric { + + public ItemElectric() { + super(); + this.setMaxStackSize(1); + this.setMaxDamage(100); + this.setNoRepair(); + } + + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4) { + String color = ""; + double joules = this.getJoules(itemStack); + if(joules <= this.getMaxJoules(itemStack) / 3.0D) { + color = "§4"; + } else if(joules > this.getMaxJoules(itemStack) * 2.0D / 3.0D) { + color = "§2"; + } else { + color = "§6"; + } + + list.add(color + UnitDisplay.getDisplay(joules, UnitDisplay.Unit.JOULES) + "/" + UnitDisplay.getDisplay(this.getMaxJoules(itemStack), UnitDisplay.Unit.JOULES)); + } + + public void onCreated(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer) { + this.setJoules(0.0D, itemStack); + } + + public ElectricityPack onReceive(ElectricityPack electricityPack, ItemStack itemStack) { + double rejectedElectricity = Math.max(this.getJoules(itemStack) + electricityPack.getWatts() - this.getMaxJoules(itemStack), 0.0D); + double joulesToStore = electricityPack.getWatts() - rejectedElectricity; + this.setJoules(this.getJoules(itemStack) + joulesToStore, itemStack); + return ElectricityPack.getFromWatts(joulesToStore, this.getVoltage(itemStack)); + } + + public ElectricityPack onProvide(ElectricityPack electricityPack, ItemStack itemStack) { + double electricityToUse = Math.min(this.getJoules(itemStack), electricityPack.getWatts()); + this.setJoules(this.getJoules(itemStack) - electricityToUse, itemStack); + return ElectricityPack.getFromWatts(electricityToUse, this.getVoltage(itemStack)); + } + + public ElectricityPack getReceiveRequest(ItemStack itemStack) { + return ElectricityPack.getFromWatts(Math.min(this.getMaxJoules(itemStack) - this.getJoules(itemStack), this.getTransferRate(itemStack)), this.getVoltage(itemStack)); + } + + public ElectricityPack getProvideRequest(ItemStack itemStack) { + return ElectricityPack.getFromWatts(Math.min(this.getJoules(itemStack), this.getTransferRate(itemStack)), this.getVoltage(itemStack)); + } + + public double getTransferRate(ItemStack itemStack) { + return this.getMaxJoules(itemStack) * 0.01D; + } + + public void setJoules(double joules, ItemStack itemStack) { + if(itemStack.getTagCompound() == null) { + itemStack.setTagCompound(new NBTTagCompound()); + } + + double electricityStored = Math.max(Math.min(joules, this.getMaxJoules(itemStack)), 0.0D); + itemStack.getTagCompound().setDouble("electricity", electricityStored); + itemStack.setItemDamage((int)(100.0D - electricityStored / this.getMaxJoules(itemStack) * 100.0D)); + } + + public double getJoules(ItemStack itemStack) { + if(itemStack.getTagCompound() == null) { + return 0.0D; + } else { + double electricityStored = itemStack.getTagCompound().getDouble("electricity"); + itemStack.setItemDamage((int)(100.0D - electricityStored / this.getMaxJoules(itemStack) * 100.0D)); + return electricityStored; + } + } + + @Override + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + par3List.add(ElectricItemHelper.getUncharged(new ItemStack(this))); + ItemStack chargedItem = new ItemStack(this); + par3List.add(ElectricItemHelper.getWithCharge(chargedItem, this.getMaxJoules(chargedItem))); + } +} diff --git a/src/main/java/universalelectricity/core/path/IPathCallBack.java b/src/main/java/universalelectricity/core/path/IPathCallBack.java new file mode 100644 index 0000000..fc20f3b --- /dev/null +++ b/src/main/java/universalelectricity/core/path/IPathCallBack.java @@ -0,0 +1,12 @@ +package universalelectricity.core.path; + +import java.util.Set; +import universalelectricity.core.path.Pathfinder; +import universalelectricity.core.vector.Vector3; + +public interface IPathCallBack { + + Set getConnectedNodes(Pathfinder var1, Vector3 var2); + + boolean onSearch(Pathfinder var1, Vector3 var2); +} diff --git a/src/main/java/universalelectricity/core/path/Pathfinder.java b/src/main/java/universalelectricity/core/path/Pathfinder.java new file mode 100644 index 0000000..e137fde --- /dev/null +++ b/src/main/java/universalelectricity/core/path/Pathfinder.java @@ -0,0 +1,51 @@ +package universalelectricity.core.path; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import universalelectricity.core.path.IPathCallBack; +import universalelectricity.core.vector.Vector3; + +public class Pathfinder { + + public IPathCallBack callBackCheck; + public Set closedSet; + public Set results; + + + public Pathfinder(IPathCallBack callBack) { + this.callBackCheck = callBack; + this.reset(); + } + + public boolean findNodes(Vector3 currentNode) { + this.closedSet.add(currentNode); + if(this.callBackCheck.onSearch(this, currentNode)) { + return false; + } else { + Iterator i$ = this.callBackCheck.getConnectedNodes(this, currentNode).iterator(); + + Vector3 node; + do { + if(!i$.hasNext()) { + return false; + } + + node = (Vector3)i$.next(); + } while(this.closedSet.contains(node) || !this.findNodes(node)); + + return true; + } + } + + public Pathfinder init(Vector3 startNode) { + this.findNodes(startNode); + return this; + } + + public Pathfinder reset() { + this.closedSet = new HashSet(); + this.results = new HashSet(); + return this; + } +} diff --git a/src/main/java/universalelectricity/core/path/PathfinderAStar.java b/src/main/java/universalelectricity/core/path/PathfinderAStar.java new file mode 100644 index 0000000..51eae44 --- /dev/null +++ b/src/main/java/universalelectricity/core/path/PathfinderAStar.java @@ -0,0 +1,112 @@ +package universalelectricity.core.path; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.path.IPathCallBack; +import universalelectricity.core.path.Pathfinder; +import universalelectricity.core.vector.Vector3; + +public class PathfinderAStar extends Pathfinder { + + public IPathCallBack callBackCheck; + public Set openSet; + public HashMap navigationMap; + public HashMap gScore; + public HashMap fScore; + public Vector3 goal; + + + public PathfinderAStar(IPathCallBack callBack, Vector3 goal) { + super(callBack); + this.goal = goal; + } + + public boolean findNodes(Vector3 start) { + this.openSet.add(start); + this.gScore.put(start, Double.valueOf(0.0D)); + this.fScore.put(start, Double.valueOf(((Double)this.gScore.get(start)).doubleValue() + this.getHeuristicEstimatedCost(start, this.goal))); + + while(!this.openSet.isEmpty()) { + Vector3 currentNode = null; + double lowestFScore = 0.0D; + Iterator i$ = this.openSet.iterator(); + + Vector3 neighbor; + while(i$.hasNext()) { + neighbor = (Vector3)i$.next(); + if(currentNode == null || ((Double)this.fScore.get(neighbor)).doubleValue() < lowestFScore) { + currentNode = neighbor; + lowestFScore = ((Double)this.fScore.get(neighbor)).doubleValue(); + } + } + + if(currentNode == null) { + break; + } + + if(this.callBackCheck.onSearch(this, currentNode)) { + return false; + } + + if(currentNode.equals(this.goal)) { + super.results = this.reconstructPath(this.navigationMap, this.goal); + return true; + } + + this.openSet.remove(currentNode); + super.closedSet.add(currentNode); + i$ = this.getNeighborNodes(currentNode).iterator(); + + while(i$.hasNext()) { + neighbor = (Vector3)i$.next(); + double tentativeGScore = ((Double)this.gScore.get(currentNode)).doubleValue() + currentNode.distanceTo(neighbor); + if((!super.closedSet.contains(neighbor) || tentativeGScore < ((Double)this.gScore.get(neighbor)).doubleValue()) && (!this.openSet.contains(neighbor) || tentativeGScore < ((Double)this.gScore.get(neighbor)).doubleValue())) { + this.navigationMap.put(neighbor, currentNode); + this.gScore.put(neighbor, Double.valueOf(tentativeGScore)); + this.fScore.put(neighbor, Double.valueOf(((Double)this.gScore.get(neighbor)).doubleValue() + this.getHeuristicEstimatedCost(neighbor, this.goal))); + this.openSet.add(neighbor); + } + } + } + + return false; + } + + public Pathfinder reset() { + this.openSet = new HashSet(); + this.navigationMap = new HashMap(); + return super.reset(); + } + + public Set reconstructPath(HashMap nagivationMap, Vector3 current_node) { + HashSet path = new HashSet(); + path.add(current_node); + if(nagivationMap.containsKey(current_node)) { + path.addAll(this.reconstructPath(nagivationMap, (Vector3)nagivationMap.get(current_node))); + return path; + } else { + return path; + } + } + + public double getHeuristicEstimatedCost(Vector3 start, Vector3 goal) { + return start.distanceTo(goal); + } + + public Set getNeighborNodes(Vector3 vector) { + if(this.callBackCheck != null) { + return this.callBackCheck.getConnectedNodes(this, vector); + } else { + HashSet neighbors = new HashSet(); + + for(int i = 0; i < 6; ++i) { + neighbors.add(vector.clone().modifyPositionFromSide(ForgeDirection.getOrientation(i))); + } + + return neighbors; + } + } +} diff --git a/src/main/java/universalelectricity/core/path/PathfinderChecker.java b/src/main/java/universalelectricity/core/path/PathfinderChecker.java new file mode 100644 index 0000000..fdf8d9b --- /dev/null +++ b/src/main/java/universalelectricity/core/path/PathfinderChecker.java @@ -0,0 +1,71 @@ +package universalelectricity.core.path; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.net.IConnector; +import universalelectricity.core.block.IConductor; +import universalelectricity.core.block.IConnectionProvider; +import universalelectricity.core.path.IPathCallBack; +import universalelectricity.core.path.Pathfinder; +import universalelectricity.core.vector.Vector3; + +public class PathfinderChecker extends Pathfinder { + + public PathfinderChecker(final World world, final IConnectionProvider targetConnector, final IConnectionProvider ... ignoreConnector) { + super(new IPathCallBack() { + public Set getConnectedNodes(Pathfinder finder, Vector3 currentNode) { + HashSet neighbors = new HashSet(); + + for(int i = 0; i < 6; ++i) { + ForgeDirection direction = ForgeDirection.getOrientation(i); + Vector3 position = currentNode.clone().modifyPositionFromSide(direction); + TileEntity connectedBlock = position.getTileEntity(world); + if(connectedBlock instanceof IConductor && !Arrays.asList(ignoreConnector).contains(connectedBlock) && ((IConductor)connectedBlock).canConnect(direction.getOpposite())) { + neighbors.add(position); + } + } + + return neighbors; + } + public boolean onSearch(Pathfinder finder, Vector3 node) { + if(node.getTileEntity(world) == targetConnector) { + finder.results.add(node); + return true; + } else { + return false; + } + } + }); + } + + public PathfinderChecker(final World world, final IConnector targetConnector, final IConnector[] ignoreConnector) { + super(new IPathCallBack() { + public Set getConnectedNodes(Pathfinder finder, Vector3 currentNode) { + HashSet neighbors = new HashSet(); + + for(int i = 0; i < 6; ++i) { + ForgeDirection direction = ForgeDirection.getOrientation(i); + Vector3 position = currentNode.clone().modifyPositionFromSide(direction); + TileEntity connectedBlock = position.getTileEntity(world); + if(connectedBlock instanceof IConductor && !Arrays.asList(ignoreConnector).contains(connectedBlock) && ((IConductor)connectedBlock).canConnect(direction.getOpposite())) { + neighbors.add(position); + } + } + + return neighbors; + } + public boolean onSearch(Pathfinder finder, Vector3 node) { + if(node.getTileEntity(world) == targetConnector) { + finder.results.add(node); + return true; + } else { + return false; + } + } + }); + } +} diff --git a/src/main/java/universalelectricity/core/vector/Vector2.java b/src/main/java/universalelectricity/core/vector/Vector2.java new file mode 100644 index 0000000..4b9e35f --- /dev/null +++ b/src/main/java/universalelectricity/core/vector/Vector2.java @@ -0,0 +1,101 @@ +package universalelectricity.core.vector; + +import net.minecraft.util.MathHelper; + +public class Vector2 implements Cloneable { + + public double x; + public double y; + + + public Vector2() { + this(0.0D, 0.0D); + } + + public Vector2(double x, double y) { + this.x = x; + this.y = y; + } + + public int intX() { + return (int)Math.floor(this.x); + } + + public int intY() { + return (int)Math.floor(this.y); + } + + public Vector2 clone() { + return new Vector2(this.x, this.y); + } + + public static double distance(Vector2 point1, Vector2 point2) { + double xDifference = point1.x - point2.x; + double yDiference = point1.y - point2.y; + return (double)MathHelper.sqrt_double(xDifference * xDifference + yDiference * yDiference); + } + + public static double slope(Vector2 point1, Vector2 point2) { + double xDifference = point1.x - point2.x; + double yDiference = point1.y - point2.y; + return yDiference / xDifference; + } + + public double distanceTo(Vector2 target) { + double xDifference = this.x - target.x; + double yDifference = this.y - target.y; + return (double)MathHelper.sqrt_double(xDifference * xDifference + yDifference * yDifference); + } + + public Vector2 add(Vector2 par1) { + this.x += par1.x; + this.y += par1.y; + return this; + } + + public Vector2 add(double par1) { + this.x += par1; + this.y += par1; + return this; + } + + public Vector2 invert() { + this.multiply(-1.0D); + return this; + } + + public Vector2 multiply(double amount) { + this.x *= amount; + this.y *= amount; + return this; + } + + public Vector2 round() { + return new Vector2((double)Math.round(this.x), (double)Math.round(this.y)); + } + + public Vector2 ceil() { + return new Vector2(Math.ceil(this.x), Math.ceil(this.y)); + } + + public Vector2 floor() { + return new Vector2(Math.floor(this.x), Math.floor(this.y)); + } + + public int hashCode() { + return ("X:" + this.x + "Y:" + this.y).hashCode(); + } + + public boolean equals(Object o) { + if(!(o instanceof Vector2)) { + return false; + } else { + Vector2 vector = (Vector2)o; + return this.x == vector.x && this.y == vector.y; + } + } + + public String toString() { + return "Vector2 [" + this.x + "," + this.y + "]"; + } +} diff --git a/src/main/java/universalelectricity/core/vector/Vector3.java b/src/main/java/universalelectricity/core/vector/Vector3.java new file mode 100644 index 0000000..87791e4 --- /dev/null +++ b/src/main/java/universalelectricity/core/vector/Vector3.java @@ -0,0 +1,286 @@ +package universalelectricity.core.vector; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class Vector3 implements Cloneable { + + public double x; + public double y; + public double z; + + + public Vector3() { + this(0.0D, 0.0D, 0.0D); + } + + public Vector3(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } + + public Vector3(Entity par1) { + this.x = par1.posX; + this.y = par1.posY; + this.z = par1.posZ; + } + + public Vector3(TileEntity par1) { + this.x = (double)par1.xCoord; + this.y = (double)par1.yCoord; + this.z = (double)par1.zCoord; + } + + public Vector3(Vec3 par1) { + this.x = par1.xCoord; + this.y = par1.yCoord; + this.z = par1.zCoord; + } + + public Vector3(MovingObjectPosition par1) { + this.x = (double)par1.blockX; + this.y = (double)par1.blockY; + this.z = (double)par1.blockZ; + } + + public Vector3(ChunkCoordinates par1) { + this.x = (double)par1.posX; + this.y = (double)par1.posY; + this.z = (double)par1.posZ; + } + + public Vector3(ForgeDirection direction) { + this.x = (double)direction.offsetX; + this.y = (double)direction.offsetY; + this.z = (double)direction.offsetZ; + } + + public int intX() { + return (int)Math.floor(this.x); + } + + public int intY() { + return (int)Math.floor(this.y); + } + + public int intZ() { + return (int)Math.floor(this.z); + } + + public Vector3 clone() { + return new Vector3(this.x, this.y, this.z); + } + + public Block getBlock(IBlockAccess world) { + return world.getBlock(this.intX(), this.intY(), this.intZ()); + } + + public int getBlockMetadata(IBlockAccess world) { + return world.getBlockMetadata(this.intX(), this.intY(), this.intZ()); + } + + public TileEntity getTileEntity(IBlockAccess world) { + return world.getTileEntity(this.intX(), this.intY(), this.intZ()); + } + + public boolean setBlock(World world, Block block, int metadata, int notify) { + return world.setBlock(this.intX(), this.intY(), this.intZ(), block, metadata, notify); + } + + public boolean setBlock(World world, Block block, int metadata) { + return this.setBlock(world, block, metadata, 3); + } + + public boolean setBlock(World world, Block block) { + return this.setBlock(world, block, 0); + } + + public Vector2 toVector2() { + return new Vector2(this.x, this.z); + } + + public Vec3 toVec3() { + return Vec3.createVectorHelper(this.x, this.y, this.z); + } + + public double getMagnitude() { + return Math.sqrt(this.getMagnitudeSquared()); + } + + public double getMagnitudeSquared() { + return this.x * this.x + this.y * this.y + this.z * this.z; + } + + public Vector3 normalize() { + double d = this.getMagnitude(); + if(d != 0.0D) { + this.multiply(1.0D / d); + } + + return this; + } + + public static double distance(Vector3 par1, Vector3 par2) { + double var2 = par1.x - par2.x; + double var4 = par1.y - par2.y; + double var6 = par1.z - par2.z; + return (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6); + } + + public double distanceTo(Vector3 vector3) { + double var2 = vector3.x - this.x; + double var4 = vector3.y - this.y; + double var6 = vector3.z - this.z; + return (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6); + } + + public Vector3 add(Vector3 par1) { + this.x += par1.x; + this.y += par1.y; + this.z += par1.z; + return this; + } + + public Vector3 add(double par1) { + this.x += par1; + this.y += par1; + this.z += par1; + return this; + } + + public Vector3 subtract(Vector3 amount) { + this.x -= amount.x; + this.y -= amount.y; + this.z -= amount.z; + return this; + } + + public Vector3 invert() { + this.multiply(-1.0D); + return this; + } + + public Vector3 multiply(double amount) { + this.x *= amount; + this.y *= amount; + this.z *= amount; + return this; + } + + public Vector3 multiply(Vector3 vec) { + this.x *= vec.x; + this.y *= vec.y; + this.z *= vec.z; + return this; + } + + public static Vector3 subtract(Vector3 par1, Vector3 par2) { + return new Vector3(par1.x - par2.x, par1.y - par2.y, par1.z - par2.z); + } + + public static Vector3 add(Vector3 par1, Vector3 par2) { + return new Vector3(par1.x + par2.x, par1.y + par2.y, par1.z + par2.z); + } + + public static Vector3 add(Vector3 par1, double par2) { + return new Vector3(par1.x + par2, par1.y + par2, par1.z + par2); + } + + public static Vector3 multiply(Vector3 vec1, Vector3 vec2) { + return new Vector3(vec1.x * vec2.x, vec1.y * vec2.y, vec1.z * vec2.z); + } + + public static Vector3 multiply(Vector3 vec1, double vec2) { + return new Vector3(vec1.x * vec2, vec1.y * vec2, vec1.z * vec2); + } + + public Vector3 round() { + return new Vector3((double)Math.round(this.x), (double)Math.round(this.y), (double)Math.round(this.z)); + } + + public Vector3 ceil() { + return new Vector3(Math.ceil(this.x), Math.ceil(this.y), Math.ceil(this.z)); + } + + public Vector3 floor() { + return new Vector3(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z)); + } + + public List getEntitiesWithin(World worldObj, Class par1Class) { + return worldObj.getEntitiesWithinAABB(par1Class, AxisAlignedBB.getBoundingBox((double)this.intX(), (double)this.intY(), (double)this.intZ(), (double)(this.intX() + 1), (double)(this.intY() + 1), (double)(this.intZ() + 1))); + } + + public Vector3 modifyPositionFromSide(ForgeDirection side, double amount) { + switch(side.ordinal()) { + case 0: + this.y -= amount; + break; + case 1: + this.y += amount; + break; + case 2: + this.z -= amount; + break; + case 3: + this.z += amount; + break; + case 4: + this.x -= amount; + break; + case 5: + this.x += amount; + } + + return this; + } + + public Vector3 modifyPositionFromSide(ForgeDirection side) { + this.modifyPositionFromSide(side, 1.0D); + return this; + } + + public static Vector3 readFromNBT(NBTTagCompound nbtCompound) { + Vector3 tempVector = new Vector3(); + tempVector.x = nbtCompound.getDouble("x"); + tempVector.y = nbtCompound.getDouble("y"); + tempVector.z = nbtCompound.getDouble("z"); + return tempVector; + } + + public NBTTagCompound writeToNBT(NBTTagCompound par1NBTTagCompound) { + par1NBTTagCompound.setDouble("x", this.x); + par1NBTTagCompound.setDouble("y", this.y); + par1NBTTagCompound.setDouble("z", this.z); + return par1NBTTagCompound; + } + + public int hashCode() { + return ("X:" + this.x + "Y:" + this.y + "Z:" + this.z).hashCode(); + } + + public boolean equals(Object o) { + if(!(o instanceof Vector3)) { + return false; + } else { + Vector3 vector3 = (Vector3)o; + return this.x == vector3.x && this.y == vector3.y && this.z == vector3.z; + } + } + + public String toString() { + return "Vector3 [" + this.x + "," + this.y + "," + this.z + "]"; + } +} diff --git a/src/main/java/universalelectricity/core/vector/VectorHelper.java b/src/main/java/universalelectricity/core/vector/VectorHelper.java new file mode 100644 index 0000000..306bdc8 --- /dev/null +++ b/src/main/java/universalelectricity/core/vector/VectorHelper.java @@ -0,0 +1,27 @@ +package universalelectricity.core.vector; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.block.IConnector; + +public class VectorHelper { + + public static final int[][] RELATIVE_MATRIX = new int[][]{{3, 2, 1, 0, 5, 4}, {4, 5, 0, 1, 2, 3}, {0, 1, 3, 2, 4, 5}, {0, 1, 2, 3, 5, 4}, {0, 1, 5, 4, 3, 2}, {0, 1, 4, 5, 2, 3}}; + + + public static ForgeDirection getOrientationFromSide(ForgeDirection front, ForgeDirection side) { + return front != ForgeDirection.UNKNOWN && side != ForgeDirection.UNKNOWN?ForgeDirection.getOrientation(RELATIVE_MATRIX[front.ordinal()][side.ordinal()]):ForgeDirection.UNKNOWN; + } + + @Deprecated + public static TileEntity getConnectorFromSide(World world, Vector3 position, ForgeDirection side) { + TileEntity tileEntity = getTileEntityFromSide(world, position, side); + return tileEntity instanceof IConnector && ((IConnector)tileEntity).canConnect(getOrientationFromSide(side, ForgeDirection.NORTH))?tileEntity:null; + } + + public static TileEntity getTileEntityFromSide(World world, Vector3 position, ForgeDirection side) { + return position.clone().modifyPositionFromSide(side).getTileEntity(world); + } + +} diff --git a/src/main/java/universalelectricity/prefab/CustomDamageSource.java b/src/main/java/universalelectricity/prefab/CustomDamageSource.java new file mode 100644 index 0000000..3ea4c78 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/CustomDamageSource.java @@ -0,0 +1,32 @@ +package universalelectricity.prefab; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import net.minecraft.util.DamageSource; + +public class CustomDamageSource extends DamageSource { + + public static final CustomDamageSource electrocution = ((CustomDamageSource)(new CustomDamageSource("electrocution")).setDamageBypassesArmor()).setDeathMessage("%1$s got electrocuted!"); + + + public CustomDamageSource(String damageType) { + super(damageType); + } + + public CustomDamageSource setDeathMessage(String deathMessage) { + LanguageRegistry.instance().addStringLocalization("death.attack." + super.damageType, deathMessage); + return this; + } + + public DamageSource setDamageBypassesArmor() { + return super.setDamageBypassesArmor(); + } + + public DamageSource setDamageAllowedInCreativeMode() { + return super.setDamageAllowedInCreativeMode(); + } + + public DamageSource setFireDamage() { + return super.setFireDamage(); + } + +} diff --git a/src/main/java/universalelectricity/prefab/GuiBase.java b/src/main/java/universalelectricity/prefab/GuiBase.java new file mode 100644 index 0000000..d7ba311 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/GuiBase.java @@ -0,0 +1,131 @@ +package universalelectricity.prefab; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public abstract class GuiBase extends GuiScreen { + + protected int xSize = 176; + protected int ySize = 166; + protected int guiLeft; + protected int guiTop; + + + public void initGui() { + super.initGui(); + this.guiLeft = (this.width - this.xSize) / 2; + this.guiTop = (this.height - this.ySize) / 2; + } + + public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + int var4 = this.guiLeft; + int var5 = this.guiTop; + this.drawBackgroundLayer(par1, par2, par3); + GL11.glPushMatrix(); + GL11.glTranslatef((float)var4, (float)var5, 0.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable('\u803a'); + short var7 = 240; + short var8 = 240; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var7 / 1.0F, (float)var8 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.drawForegroundLayer(par1, par2, par3); + GL11.glDisable('\u803a'); + GL11.glDisable(2896); + GL11.glDisable(2929); + GL11.glPopMatrix(); + super.drawScreen(par1, par2, par3); + GL11.glEnable(2896); + GL11.glEnable(2929); + } + + protected abstract void drawForegroundLayer(int var1, int var2, float var3); + + protected abstract void drawBackgroundLayer(int var1, int var2, float var3); + + protected void keyTyped(char x, int y) { + if(y == 1 || y == this.mc.gameSettings.keyBindInventory.getKeyCode()) { + this.mc.thePlayer.closeScreen(); + } + + } + + public boolean doesGuiPauseGame() { + return false; + } + + public void updateScreen() { + super.updateScreen(); + if(!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) { + this.mc.thePlayer.closeScreen(); + } + + } + + public void drawTooltip(int x, int y, String ... toolTips) { + GL11.glDisable('\u803a'); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(2896); + GL11.glDisable(2929); + if(toolTips != null) { + int var5 = 0; + + int var6; + int var7; + for(var6 = 0; var6 < toolTips.length; ++var6) { + var7 = this.fontRendererObj.getStringWidth(toolTips[var6]); + if(var7 > var5) { + var5 = var7; + } + } + + var6 = x + 12; + var7 = y - 12; + int var9 = 8; + if(toolTips.length > 1) { + var9 += 2 + (toolTips.length - 1) * 10; + } + + if(this.guiTop + var7 + var9 + 6 > this.height) { + var7 = this.height - var9 - this.guiTop - 6; + } + + super.zLevel = 300.0F; + int var10 = -267386864; + this.drawGradientRect(var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10); + this.drawGradientRect(var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10); + this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10); + this.drawGradientRect(var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10); + this.drawGradientRect(var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10); + int var11 = 1347420415; + int var12 = (var11 & 16711422) >> 1 | var11 & -16777216; + this.drawGradientRect(var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12); + this.drawGradientRect(var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12); + this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11); + this.drawGradientRect(var6 - 3, var7 + var9 + 2, var6 + var5 + 3, var7 + var9 + 3, var12, var12); + + for(int var13 = 0; var13 < toolTips.length; ++var13) { + String var14 = toolTips[var13]; + this.fontRendererObj.drawStringWithShadow(var14, var6, var7, -1); + if(var13 == 0) { + var7 += 2; + } + + var7 += 10; + } + + super.zLevel = 0.0F; + } + + GL11.glEnable(2929); + GL11.glEnable(2896); + RenderHelper.enableGUIStandardItemLighting(); + GL11.glEnable('\u803a'); + } +} diff --git a/src/main/java/universalelectricity/prefab/RecipeHelper.java b/src/main/java/universalelectricity/prefab/RecipeHelper.java new file mode 100644 index 0000000..7ee0a03 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/RecipeHelper.java @@ -0,0 +1,131 @@ +package universalelectricity.prefab; + +import cpw.mods.fml.common.registry.GameRegistry; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.common.config.Configuration; + +public class RecipeHelper { + + public static List getRecipesByOutput(ItemStack output) { + ArrayList list = new ArrayList(); + Iterator i$ = CraftingManager.getInstance().getRecipeList().iterator(); + + while(i$.hasNext()) { + Object obj = i$.next(); + if(obj instanceof IRecipe && ((IRecipe)obj).getRecipeOutput() == output) { + list.add((IRecipe)obj); + } + } + + return list; + } + + public static boolean replaceRecipe(IRecipe recipe, IRecipe newRecipe) { + Iterator i$ = CraftingManager.getInstance().getRecipeList().iterator(); + + Object obj; + do { + do { + if(!i$.hasNext()) { + return false; + } + + obj = i$.next(); + } while(!(obj instanceof IRecipe)); + } while(!((IRecipe)obj).equals(recipe) && obj != recipe); + + CraftingManager.getInstance().getRecipeList().remove(obj); + CraftingManager.getInstance().getRecipeList().add(newRecipe); + return true; + } + + public static boolean replaceRecipe(ItemStack recipe, IRecipe newRecipe) { + if(removeRecipe(recipe)) { + CraftingManager.getInstance().getRecipeList().add(newRecipe); + return true; + } else { + return false; + } + } + + public static boolean removeRecipe(IRecipe recipe) { + Iterator i$ = CraftingManager.getInstance().getRecipeList().iterator(); + + Object obj; + do { + do { + do { + if(!i$.hasNext()) { + return false; + } + + obj = i$.next(); + } while(obj == null); + } while(!(obj instanceof IRecipe)); + } while(!((IRecipe)obj).equals(recipe) && obj != recipe); + + CraftingManager.getInstance().getRecipeList().remove(obj); + return true; + } + + public static boolean removeRecipe(ItemStack stack) { + Iterator i$ = CraftingManager.getInstance().getRecipeList().iterator(); + + Object obj; + do { + if(!i$.hasNext()) { + return false; + } + + obj = i$.next(); + } while(obj == null || !(obj instanceof IRecipe) || ((IRecipe)obj).getRecipeOutput() == null || !((IRecipe)obj).getRecipeOutput().isItemEqual(stack)); + + CraftingManager.getInstance().getRecipeList().remove(obj); + return true; + } + + public static boolean removeRecipes(ItemStack ... itemStacks) { + boolean didRemove = false; + Iterator itr = CraftingManager.getInstance().getRecipeList().iterator(); + + while(itr.hasNext()) { + Object obj = itr.next(); + if(obj != null && obj instanceof IRecipe && ((IRecipe)obj).getRecipeOutput() != null) { + ItemStack[] arr$ = itemStacks; + int len$ = itemStacks.length; + + for(int i$ = 0; i$ < len$; ++i$) { + ItemStack itemStack = arr$[i$]; + if(((IRecipe)obj).getRecipeOutput().isItemEqual(itemStack)) { + itr.remove(); + didRemove = true; + break; + } + } + } + } + + return didRemove; + } + + public static void addRecipe(IRecipe recipe, String name, Configuration configuration, boolean defaultBoolean) { + if(configuration != null) { + configuration.load(); + if(configuration.get("Crafting", "Allow " + name + " Crafting", defaultBoolean).getBoolean(defaultBoolean)) { + GameRegistry.addRecipe(recipe); + } + + configuration.save(); + } + + } + + public static void addRecipe(IRecipe recipe, Configuration config, boolean defaultBoolean) { + addRecipe(recipe, recipe.getRecipeOutput().getUnlocalizedName(), config, defaultBoolean); + } +} diff --git a/src/main/java/universalelectricity/prefab/SlotSpecific.java b/src/main/java/universalelectricity/prefab/SlotSpecific.java new file mode 100644 index 0000000..12e53ba --- /dev/null +++ b/src/main/java/universalelectricity/prefab/SlotSpecific.java @@ -0,0 +1,74 @@ +package universalelectricity.prefab; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class SlotSpecific extends Slot { + + public ItemStack[] validItemStacks = new ItemStack[0]; + public Class[] validClasses = new Class[0]; + public boolean isInverted = false; + public boolean isMetadataSensitive = false; + + + public SlotSpecific(IInventory par2IInventory, int par3, int par4, int par5, ItemStack ... itemStacks) { + super(par2IInventory, par3, par4, par5); + this.setItemStacks(itemStacks); + } + + public SlotSpecific(IInventory par2IInventory, int par3, int par4, int par5, Class ... validClasses) { + super(par2IInventory, par3, par4, par5); + this.setClasses(validClasses); + } + + public SlotSpecific setMetadataSensitive() { + this.isMetadataSensitive = true; + return this; + } + + public SlotSpecific setItemStacks(ItemStack ... validItemStacks) { + this.validItemStacks = validItemStacks; + return this; + } + + public SlotSpecific setClasses(Class ... validClasses) { + this.validClasses = validClasses; + return this; + } + + public SlotSpecific toggleInverted() { + this.isInverted = !this.isInverted; + return this; + } + + public boolean isItemValid(ItemStack compareStack) { + boolean returnValue = false; + ItemStack[] arr$ = this.validItemStacks; + int len$ = arr$.length; + + int i$; + for(i$ = 0; i$ < len$; ++i$) { + ItemStack clazz = arr$[i$]; + if(compareStack.isItemEqual(clazz) || !this.isMetadataSensitive && compareStack.getItem() == clazz.getItem()) { + returnValue = true; + break; + } + } + + if(!returnValue) { + Class[] var7 = this.validClasses; + len$ = var7.length; + + for(i$ = 0; i$ < len$; ++i$) { + Class var8 = var7[i$]; + if(var8.equals(compareStack.getItem().getClass()) || var8.isInstance(compareStack.getItem())) { + returnValue = true; + break; + } + } + } + + return this.isInverted?!returnValue:returnValue; + } +} diff --git a/src/main/java/universalelectricity/prefab/TranslationHelper.java b/src/main/java/universalelectricity/prefab/TranslationHelper.java new file mode 100644 index 0000000..6456da6 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/TranslationHelper.java @@ -0,0 +1,49 @@ +package universalelectricity.prefab; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.registry.LanguageRegistry; + +public class TranslationHelper { + + public static int loadLanguages(String languagePath, String[] languageSupported) { + int languages = 0; + String[] arr$ = languageSupported; + int len$ = languageSupported.length; + + for(int i$ = 0; i$ < len$; ++i$) { + String language = arr$[i$]; + LanguageRegistry.instance().loadLocalization(languagePath + language + ".properties", language, false); + if(LanguageRegistry.instance().getStringLocalization("children", language) != "") { + try { + String[] e = LanguageRegistry.instance().getStringLocalization("children", language).split(","); + String[] arr$1 = e; + int len$1 = e.length; + + for(int i$1 = 0; i$1 < len$1; ++i$1) { + String child = arr$1[i$1]; + if(child != "" || child != null) { + LanguageRegistry.instance().loadLocalization(languagePath + language + ".properties", child, false); + ++languages; + } + } + } catch (Exception var12) { + FMLLog.severe("Failed to load a child language file.", new Object[0]); + var12.printStackTrace(); + } + } + + ++languages; + } + + return languages; + } + + public static String getLocal(String key) { + String text = LanguageRegistry.instance().getStringLocalization(key); + if(text == null || text == "") { + text = LanguageRegistry.instance().getStringLocalization(key, "en_US"); + } + + return text; + } +} diff --git a/src/main/java/universalelectricity/prefab/block/BlockAdvanced.java b/src/main/java/universalelectricity/prefab/block/BlockAdvanced.java new file mode 100644 index 0000000..bafffb7 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/block/BlockAdvanced.java @@ -0,0 +1,149 @@ +package universalelectricity.prefab.block; + +import java.lang.reflect.Method; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public abstract class BlockAdvanced extends BlockContainer { + + public BlockAdvanced(Material material) { + super(material); + this.setHardness(0.6F); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) { + world.getBlockMetadata(x, y, z); + if(this.isUsableWrench(entityPlayer, entityPlayer.inventory.getCurrentItem(), x, y, z)) { + this.damageWrench(entityPlayer, entityPlayer.inventory.getCurrentItem(), x, y, z); + if(entityPlayer.isSneaking() && this.onSneakUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)) { + return true; + } + + if(this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)) { + return true; + } + } + + return entityPlayer.isSneaking() && this.onSneakMachineActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)?true:this.onMachineActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); + } + + public boolean isUsableWrench(EntityPlayer entityPlayer, ItemStack itemStack, int x, int y, int z) { + if(entityPlayer != null && itemStack != null) { + Class wrenchClass = itemStack.getItem().getClass(); + + try { + Method e = wrenchClass.getMethod("canWrench", new Class[]{EntityPlayer.class, Integer.TYPE, Integer.TYPE, Integer.TYPE}); + return ((Boolean)e.invoke(itemStack.getItem(), new Object[]{entityPlayer, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(z)})).booleanValue(); + } catch (NoClassDefFoundError var8) { + ; + } catch (Exception var9) { + ; + } + + try { + if(wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrench") || wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrenchElectric")) { + return itemStack.getItemDamage() < itemStack.getMaxDamage(); + } + } catch (Exception var10) { + ; + } + } + + return false; + } + + public boolean damageWrench(EntityPlayer entityPlayer, ItemStack itemStack, int x, int y, int z) { + if(this.isUsableWrench(entityPlayer, itemStack, x, y, z)) { + Class wrenchClass = itemStack.getItem().getClass(); + + Method e; + try { + e = wrenchClass.getMethod("wrenchUsed", new Class[]{EntityPlayer.class, Integer.TYPE, Integer.TYPE, Integer.TYPE}); + e.invoke(itemStack.getItem(), new Object[]{entityPlayer, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(z)}); + return true; + } catch (Exception var9) { + try { + if(wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrench") || wrenchClass == Class.forName("ic2.core.item.tool.ItemToolWrenchElectric")) { + e = wrenchClass.getMethod("damage", new Class[]{ItemStack.class, Integer.TYPE, EntityPlayer.class}); + e.invoke(itemStack.getItem(), new Object[]{itemStack, Integer.valueOf(1), entityPlayer}); + return true; + } + } catch (Exception var8) { + ; + } + } + } + + return false; + } + + public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) { + return false; + } + + public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) { + return false; + } + + public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) { + return false; + } + + public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) { + return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { + this.dropEntireInventory(world, x, y, z, par5, par6); + super.breakBlock(world, x, y, z, par5, par6); + } + + public void dropEntireInventory(World world, int x, int y, int z, Block par5, int par6) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + if(tileEntity != null && tileEntity instanceof IInventory) { + IInventory inventory = (IInventory)tileEntity; + + for(int var6 = 0; var6 < inventory.getSizeInventory(); ++var6) { + ItemStack var7 = inventory.getStackInSlot(var6); + if(var7 != null) { + Random random = new Random(); + float var8 = random.nextFloat() * 0.8F + 0.1F; + float var9 = random.nextFloat() * 0.8F + 0.1F; + float var10 = random.nextFloat() * 0.8F + 0.1F; + + while(var7.stackSize > 0) { + int var11 = random.nextInt(21) + 10; + if(var11 > var7.stackSize) { + var11 = var7.stackSize; + } + + var7.stackSize -= var11; + EntityItem var12 = new EntityItem(world, (double)((float)x + var8), (double)((float)y + var9), (double)((float)z + var10), new ItemStack(var7.getItem(), var11, var7.getItemDamage())); + if(var7.hasTagCompound()) { + var12.getEntityItem().setTagCompound((NBTTagCompound)var7.getTagCompound().copy()); + } + + float var13 = 0.05F; + var12.motionX = (double)((float)random.nextGaussian() * var13); + var12.motionY = (double)((float)random.nextGaussian() * var13 + 0.2F); + var12.motionZ = (double)((float)random.nextGaussian() * var13); + world.spawnEntityInWorld(var12); + } + } + } + } + + } +} diff --git a/src/main/java/universalelectricity/prefab/block/BlockConductor.java b/src/main/java/universalelectricity/prefab/block/BlockConductor.java new file mode 100644 index 0000000..48ab516 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/block/BlockConductor.java @@ -0,0 +1,34 @@ +package universalelectricity.prefab.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import universalelectricity.core.block.IConductor; + +public abstract class BlockConductor extends BlockContainer { + + public BlockConductor(Material material) { + super(material); + } + + @Override + public void onBlockAdded(World world, int x, int y, int z) { + super.onBlockAdded(world, x, y, z); + TileEntity tileEntity = world.getTileEntity(x, y, z); + if(tileEntity instanceof IConductor) { + ((IConductor)tileEntity).updateAdjacentConnections(); + } + + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block blockID) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + if(tileEntity instanceof IConductor) { + ((IConductor)tileEntity).updateAdjacentConnections(); + } + + } +} diff --git a/src/main/java/universalelectricity/prefab/block/BlockRotatable.java b/src/main/java/universalelectricity/prefab/block/BlockRotatable.java new file mode 100644 index 0000000..e8b5917 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/block/BlockRotatable.java @@ -0,0 +1,52 @@ +package universalelectricity.prefab.block; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.prefab.implement.IRotatable; + +public abstract class BlockRotatable extends BlockAdvanced implements IRotatable { + + public BlockRotatable(Material material) { + super(material); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) { + int angle = MathHelper.floor_double((double)(entityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + byte change = 3; + switch(angle) { + case 0: + change = 2; + break; + case 1: + change = 5; + break; + case 2: + change = 3; + break; + case 3: + change = 4; + } + + this.setDirection(world, x, y, z, ForgeDirection.getOrientation(change)); + } + + public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) { + this.setDirection(world, x, y, z, ForgeDirection.getOrientation(ForgeDirection.ROTATION_MATRIX[0][this.getDirection(world, x, y, z).ordinal()])); + return true; + } + + public ForgeDirection getDirection(IBlockAccess world, int x, int y, int z) { + return ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z)); + } + + public void setDirection(World world, int x, int y, int z, ForgeDirection facingDirection) { + world.setBlockMetadataWithNotify(x, y, z, facingDirection.ordinal(), 3); + } +} diff --git a/src/main/java/universalelectricity/prefab/flag/CommandFlag.java b/src/main/java/universalelectricity/prefab/flag/CommandFlag.java new file mode 100644 index 0000000..ea6b26b --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/CommandFlag.java @@ -0,0 +1,226 @@ +package universalelectricity.prefab.flag; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; +import universalelectricity.core.vector.Vector3; + +public class CommandFlag extends CommandBase { + + public static final String[] COMMANDS = new String[]{"list", "setregion", "removeregion", "set"}; + public String commandName; + public ModFlag modFlagData; + + + public CommandFlag(ModFlag modFlag) { + this.commandName = "modflag"; + this.modFlagData = modFlag; + } + + public CommandFlag(ModFlag modFlag, String commandName) { + this(modFlag); + this.commandName = commandName; + } + + public String getCommandName() { + return this.commandName; + } + + public String getCommandUsage(ICommandSender par1ICommandSender) { + String returnString = ""; + String[] arr$ = COMMANDS; + int len$ = arr$.length; + + for(int i$ = 0; i$ < len$; ++i$) { + String command = arr$[i$]; + returnString = returnString + "\n/" + this.getCommandName() + " " + command; + } + + return returnString; + } + + public void processCommand(ICommandSender sender, String[] args) { + if(args.length > 0) { + EntityPlayer entityPlayer = (EntityPlayer)sender; + FlagWorld flagWorld = this.modFlagData.getFlagWorld(entityPlayer.worldObj); + String commandName = args[0].toLowerCase(); + String regionName; + String flagName; + FlagRegion flagRegion; + if(commandName.equalsIgnoreCase("list")) { + if(args.length > 1) { + regionName = args[1]; + Iterator flagRegion1; + if(regionName.equalsIgnoreCase("all")) { + flagName = ""; + flagRegion1 = this.modFlagData.getFlagWorlds().iterator(); + + FlagRegion i$1; + while(flagRegion1.hasNext()) { + for(Iterator flags1 = ((FlagWorld)flagRegion1.next()).getRegions().iterator(); flags1.hasNext(); flagName = flagName + " " + i$1.name + " (" + i$1.region.min.x + "," + i$1.region.min.z + ")" + ",") { + i$1 = (FlagRegion)flags1.next(); + } + } + + if(flagName != "") { + flagName = "List of regions in world:\n" + flagName; + } else { + flagName = "No regions in this world."; + } + + sender.addChatMessage(new ChatComponentText(flagName)); + } else { + Flag flags2; + if(flagWorld.getRegion(regionName) != null) { + flagName = ""; + + for(flagRegion1 = flagWorld.getRegion(regionName).getFlags().iterator(); flagRegion1.hasNext(); flagName = flagName + " " + flags2.name + " => " + flags2.value + ",") { + flags2 = (Flag)flagRegion1.next(); + } + + if(flagName != "") { + flagName = "List of flags in region " + regionName + ":\n" + flagName; + } else { + flagName = "No flags in this region."; + } + + sender.addChatMessage(new ChatComponentText(flagName)); + } else { + flagName = "Region does not exist, but here are existing flags in the position you are standing on:\n"; + + for(flagRegion1 = flagWorld.getFlagsInPosition(new Vector3(entityPlayer)).iterator(); flagRegion1.hasNext(); flagName = flagName + " " + flags2.name + "=>" + flags2.value + ",") { + flags2 = (Flag)flagRegion1.next(); + } + + sender.addChatMessage(new ChatComponentText(flagName)); + } + } + } else { + regionName = ""; + + for(Iterator flagName3 = flagWorld.getRegions().iterator(); flagName3.hasNext(); regionName = regionName + " " + flagRegion.name + " (" + flagRegion.region.min.x + "," + flagRegion.region.min.z + ")" + ",") { + flagRegion = (FlagRegion)flagName3.next(); + } + + if(regionName != "") { + regionName = "List of regions in this dimension:\n" + regionName; + } else { + regionName = "No regions in this dimension."; + } + + sender.addChatMessage(new ChatComponentText(regionName)); + } + + return; + } + + if(commandName.equalsIgnoreCase("setregion")) { + if(args.length > 1) { + regionName = args[1]; + if(regionName.equalsIgnoreCase("dimension")) { + if(flagWorld.addRegion(regionName, new Vector3(entityPlayer), 1)) { + sender.addChatMessage(new ChatComponentText("Created global dimension region setting.")); + return; + } + } else { + if(args.length <= 2) { + throw new WrongUsageException("/" + this.getCommandName() + " addregion ", new Object[0]); + } + + boolean flagName1 = false; + + int flagName2; + try { + flagName2 = Integer.parseInt(args[2]); + } catch (Exception var12) { + throw new WrongUsageException("Radius not a number!", new Object[0]); + } + + if(flagName2 <= 0) { + throw new WrongUsageException("Radius has to be greater than zero!", new Object[0]); + } + + flagRegion = flagWorld.getRegion(regionName); + if(flagRegion == null) { + if(flagWorld.addRegion(regionName, new Vector3(entityPlayer), flagName2)) { + sender.addChatMessage(new ChatComponentText("Region " + regionName + " added.")); + } + } else { + flagRegion.edit(new Vector3(entityPlayer), flagName2); + sender.addChatMessage(new ChatComponentText("Region " + regionName + " already exists. Modified region to have a radius of: " + flagName2)); + } + } + + return; + } + + throw new WrongUsageException("Please specify the region name.", new Object[0]); + } + + if(commandName.equalsIgnoreCase("removeregion")) { + if(args.length > 1) { + regionName = args[1]; + if(flagWorld.removeRegion(regionName)) { + sender.addChatMessage(new ChatComponentText("Region with name " + regionName + " is removed.")); + return; + } + + throw new WrongUsageException("The specified region does not exist in this world.", new Object[0]); + } + + throw new WrongUsageException("Please specify the region name.", new Object[0]); + } + + if(commandName.equalsIgnoreCase("set")) { + if(args.length <= 2) { + throw new WrongUsageException("/" + this.getCommandName() + " set ", new Object[0]); + } + + regionName = args[1]; + flagName = args[2]; + flagRegion = flagWorld.getRegion(regionName); + if(flagRegion == null) { + throw new WrongUsageException("The specified region \'" + regionName + "\' does not exist.", new Object[0]); + } + + String flags; + if(FlagRegistry.flags.contains(flagName)) { + if(args.length > 3) { + flags = args[3]; + flagRegion.setFlag(flagName, flags); + sender.addChatMessage(new ChatComponentText("Flag \'" + flagName + "\' has been set to \'" + flags + "\' in " + regionName + ".")); + } else { + flagRegion.removeFlag(flagName); + sender.addChatMessage(new ChatComponentText("Removed flag \'" + flagName + "\'.")); + } + + return; + } + + flags = "Flag does not exist. Existing flags:\n"; + + String registeredFlag; + for(Iterator i$ = FlagRegistry.flags.iterator(); i$.hasNext(); flags = flags + registeredFlag + ", ") { + registeredFlag = (String)i$.next(); + } + + throw new WrongUsageException(flags, new Object[0]); + } + } + + throw new WrongUsageException(this.getCommandUsage(sender), new Object[0]); + } + + public int getRequiredPermissionLevel() { + return 2; + } + + public List addTabCompletionOptions(ICommandSender sender, String[] args) { + return args.length == 1?getListOfStringsMatchingLastWord(args, COMMANDS):null; + } + +} diff --git a/src/main/java/universalelectricity/prefab/flag/Flag.java b/src/main/java/universalelectricity/prefab/flag/Flag.java new file mode 100644 index 0000000..3bd6071 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/Flag.java @@ -0,0 +1,31 @@ +package universalelectricity.prefab.flag; + +import net.minecraft.nbt.NBTTagCompound; + +public class Flag extends FlagBase { + + public FlagRegion flagRegion; + public String name; + public String value; + + + public Flag(FlagRegion flagRegion) { + this.flagRegion = flagRegion; + } + + public Flag(FlagRegion flagRegion, String name, String value) { + this(flagRegion); + this.name = name; + this.value = value; + } + + public void readFromNBT(NBTTagCompound nbt) { + this.name = nbt.getString("name"); + this.value = nbt.getString("value"); + } + + public void writeToNBT(NBTTagCompound nbt) { + nbt.setString("name", this.name); + nbt.setString("value", this.value); + } +} diff --git a/src/main/java/universalelectricity/prefab/flag/FlagBase.java b/src/main/java/universalelectricity/prefab/flag/FlagBase.java new file mode 100644 index 0000000..cb14bf3 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/FlagBase.java @@ -0,0 +1,23 @@ +package universalelectricity.prefab.flag; + +import net.minecraft.nbt.NBTTagCompound; + +public abstract class FlagBase { + + public abstract void readFromNBT(NBTTagCompound var1); + + public abstract void writeToNBT(NBTTagCompound var1); + + public NBTTagCompound getNBT() { + NBTTagCompound nbt = new NBTTagCompound(); + + try { + this.writeToNBT(nbt); + } catch (Exception var3) { + System.out.println("Failed to read flag"); + var3.printStackTrace(); + } + + return nbt; + } +} diff --git a/src/main/java/universalelectricity/prefab/flag/FlagRegion.java b/src/main/java/universalelectricity/prefab/flag/FlagRegion.java new file mode 100644 index 0000000..8d8cce2 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/FlagRegion.java @@ -0,0 +1,130 @@ +package universalelectricity.prefab.flag; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import universalelectricity.core.vector.Vector3; +import universalelectricity.prefab.vector.Region3; + +public class FlagRegion extends FlagBase { + + public FlagWorld flagWorld; + public String name; + public Region3 region; + private final List flags = new ArrayList(); + + + public FlagRegion(FlagWorld worldFlagData) { + this.flagWorld = worldFlagData; + } + + public FlagRegion(FlagWorld flagWorld, String name, Region3 region) { + this.flagWorld = flagWorld; + this.name = name; + this.region = region; + } + + public void readFromNBT(NBTTagCompound nbt) { + this.name = nbt.getString("name"); + Vector3 startVector = Vector3.readFromNBT(nbt.getCompoundTag("min")); + Vector3 endVector = Vector3.readFromNBT(nbt.getCompoundTag("max")); + this.region = new Region3(startVector, endVector); + NBTTagList flagList = nbt.getTagList("flags", 10); + + for(int i = 0; i < flagList.tagCount(); ++i) { + NBTTagCompound childNode = (NBTTagCompound)flagList.getCompoundTagAt(i); + + Flag e = new Flag(this); + e.readFromNBT(childNode); + this.flags.add(e); + } + + } + + public void writeToNBT(NBTTagCompound nbt) { + nbt.setString("name", this.name); + nbt.setTag("min", this.region.min.writeToNBT(new NBTTagCompound())); + nbt.setTag("max", this.region.max.writeToNBT(new NBTTagCompound())); + NBTTagList flagList = new NBTTagList(); + + for (Flag flag : this.getFlags()) { + flagList.appendTag(flag.getNBT()); + } + + nbt.setTag("flags", flagList); + } + + public boolean containsValue(String flagName, String checkValue, Vector3 position) { + Iterator i$ = this.flags.iterator(); + + Flag flag; + do { + if(!i$.hasNext()) { + return false; + } + + flag = (Flag)i$.next(); + } while(!flag.name.equalsIgnoreCase(flagName) || !flag.value.equalsIgnoreCase(checkValue)); + + return true; + } + + public boolean setFlag(String flagName, String value) { + this.removeFlag(flagName); + return value != null && value != "" && !this.containsFlag(flagName)?this.flags.add(new Flag(this, flagName, value)):false; + } + + public boolean containsFlag(String flagName) { + Iterator i$ = this.flags.iterator(); + + Flag region; + do { + if(!i$.hasNext()) { + return false; + } + + region = (Flag)i$.next(); + } while(!region.name.equalsIgnoreCase(flagName)); + + return true; + } + + public boolean removeFlag(String flagName) { + Iterator i$ = this.flags.iterator(); + + Flag region; + do { + if(!i$.hasNext()) { + return false; + } + + region = (Flag)i$.next(); + } while(!region.name.equalsIgnoreCase(flagName)); + + this.flags.remove(region); + return true; + } + + public List getFlags() { + Iterator it = this.flags.iterator(); + + while(it.hasNext()) { + Flag flag = (Flag)it.next(); + if(flag == null) { + it.remove(); + } else if(flag.name == null || flag.name == "") { + it.remove(); + } + } + + return this.flags; + } + + public void edit(Vector3 position, int radius) { + Vector3 minVec = new Vector3((double)(position.intX() - radius), 0.0D, (double)(position.intZ() - radius)); + Vector3 maxVec = new Vector3((double)(position.intX() + radius), (double)this.flagWorld.world.getHeight(), (double)(position.intZ() + radius)); + this.region = new Region3(minVec, maxVec); + } +} diff --git a/src/main/java/universalelectricity/prefab/flag/FlagRegistry.java b/src/main/java/universalelectricity/prefab/flag/FlagRegistry.java new file mode 100644 index 0000000..4b0b872 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/FlagRegistry.java @@ -0,0 +1,37 @@ +package universalelectricity.prefab.flag; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import universalelectricity.prefab.flag.ModFlag; + +public class FlagRegistry { + + public static final String DEFAULT_NAME = "ModFlags"; + private static final HashMap MOD_FLAGS = new HashMap(); + public static final List flags = new ArrayList(); + public static boolean isInitiated = false; + + + public static void registerModFlag(String name, ModFlag flagData) { + MOD_FLAGS.put(name, flagData); + } + + public static ModFlag getModFlag(String name) { + return (ModFlag)MOD_FLAGS.get(name); + } + + public static String registerFlag(String name) { + if(!isInitiated) { + isInitiated = true; + } + + name = name.toLowerCase(); + if(!flags.contains(name)) { + flags.add(name); + } + + return name; + } + +} diff --git a/src/main/java/universalelectricity/prefab/flag/FlagWorld.java b/src/main/java/universalelectricity/prefab/flag/FlagWorld.java new file mode 100644 index 0000000..fc5b504 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/FlagWorld.java @@ -0,0 +1,164 @@ +package universalelectricity.prefab.flag; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import universalelectricity.core.vector.Vector3; +import universalelectricity.prefab.vector.Region3; + +public class FlagWorld extends FlagBase { + + public static final String GLOBAL_REGION = "dimension"; + public World world; + private final List regions = new ArrayList(); + + + public FlagWorld(World world) { + this.world = world; + } + + public void readFromNBT(NBTTagCompound nbt) { + + for(String key : (Set) nbt.func_150296_c()) { + NBTTagCompound childCompound = nbt.getCompoundTag(key); + FlagRegion e = new FlagRegion(this); + e.readFromNBT(childCompound); + this.regions.add(e); + } + + } + + public void writeToNBT(NBTTagCompound nbt) { + Iterator i$ = this.regions.iterator(); + + while(i$.hasNext()) { + FlagRegion region = (FlagRegion)i$.next(); + + try { + NBTTagCompound e = new NBTTagCompound(); + region.writeToNBT(e); + nbt.setTag(region.name, e); + } catch (Exception var5) { + System.out.println("Failed to save world flag data: " + region.name); + var5.printStackTrace(); + } + } + + } + + public List getFlagsInPosition(Vector3 position) { + ArrayList returnFlags = new ArrayList(); + Iterator i$ = this.regions.iterator(); + + while(i$.hasNext()) { + FlagRegion flagRegion = (FlagRegion)i$.next(); + if(flagRegion.region.isIn(position) || flagRegion.name.equalsIgnoreCase("dimension")) { + Iterator i$1 = flagRegion.getFlags().iterator(); + + while(i$1.hasNext()) { + Flag flag = (Flag)i$1.next(); + returnFlags.add(flag); + } + } + } + + return returnFlags; + } + + public List getValues(String flagName, Vector3 position) { + ArrayList values = new ArrayList(); + Iterator i$ = this.getFlagsInPosition(position).iterator(); + + while(i$.hasNext()) { + Flag flag = (Flag)i$.next(); + values.add(flag.value); + } + + return values; + } + + public boolean containsValue(String flagName, String checkValue, Vector3 position) { + Iterator i$ = this.getFlagsInPosition(position).iterator(); + + Flag flag; + do { + if(!i$.hasNext()) { + return false; + } + + flag = (Flag)i$.next(); + } while(!flag.name.equalsIgnoreCase(flagName) || !flag.value.equalsIgnoreCase(checkValue)); + + return true; + } + + public boolean addRegion(String name, Vector3 position, int radius) { + Vector3 minVec = new Vector3((double)(position.intX() - radius), 0.0D, (double)(position.intZ() - radius)); + Vector3 maxVec = new Vector3((double)(position.intX() + radius), (double)this.world.getHeight(), (double)(position.intZ() + radius)); + return this.regions.add(new FlagRegion(this, name, new Region3(minVec, maxVec))); + } + + public FlagRegion getRegion(String name) { + Iterator i$ = this.regions.iterator(); + + FlagRegion region; + do { + if(!i$.hasNext()) { + return null; + } + + region = (FlagRegion)i$.next(); + } while(!region.name.equals(name)); + + return region; + } + + public List getRegions(Vector3 position) { + ArrayList returnRegions = new ArrayList(); + Iterator i$ = this.regions.iterator(); + + while(i$.hasNext()) { + FlagRegion region = (FlagRegion)i$.next(); + if(region.region.isIn(position)) { + returnRegions.add(region); + } + } + + return returnRegions; + } + + public boolean removeRegion(String name) { + Iterator i$ = this.regions.iterator(); + + FlagRegion region; + do { + if(!i$.hasNext()) { + return false; + } + + region = (FlagRegion)i$.next(); + } while(!region.name.equals(name)); + + this.regions.remove(region); + return true; + } + + public List getRegions() { + Iterator it = this.regions.iterator(); + + while(it.hasNext()) { + FlagRegion region = (FlagRegion)it.next(); + if(region == null) { + it.remove(); + } else if(region.name == null || region.name == "") { + it.remove(); + } + } + + return this.regions; + } +} diff --git a/src/main/java/universalelectricity/prefab/flag/ModFlag.java b/src/main/java/universalelectricity/prefab/flag/ModFlag.java new file mode 100644 index 0000000..b221cb3 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/ModFlag.java @@ -0,0 +1,84 @@ +package universalelectricity.prefab.flag; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.DimensionManager; +import universalelectricity.core.vector.Vector3; + +public class ModFlag extends FlagBase { + + private final List flagWorlds = new ArrayList(); + + + public ModFlag(NBTTagCompound nbt) { + this.readFromNBT(nbt); + } + + public void readFromNBT(NBTTagCompound nbt) { + if(nbt != null) { + for (String key : (Set) nbt.func_150296_c()) { + NBTTagCompound dimensionCompound = nbt.getCompoundTag(key); + int e = Integer.parseInt(key.replace("dim_", "")); + WorldServer world = DimensionManager.getWorld(e); + FlagWorld flagWorld = new FlagWorld(world); + flagWorld.readFromNBT(dimensionCompound); + this.flagWorlds.add(flagWorld); + } + } + + } + + public void writeToNBT(NBTTagCompound nbt) { + if(nbt != null) { + Iterator i$ = this.flagWorlds.iterator(); + + while(i$.hasNext()) { + FlagWorld worldData = (FlagWorld)i$.next(); + + try { + nbt.setTag("dim_" + worldData.world.provider.dimensionId, worldData.getNBT()); + } catch (Exception var5) { + System.out.println("Mod Flag: Failed to save world flag data: " + worldData.world); + var5.printStackTrace(); + } + } + } + + } + + public FlagWorld getFlagWorld(World world) { + FlagWorld worldData = null; + if(world != null) { + Iterator i$ = this.flagWorlds.iterator(); + + while(i$.hasNext()) { + FlagWorld data = (FlagWorld)i$.next(); + if(data.world != null && data.world.provider != null && data.world.provider.dimensionId == world.provider.dimensionId) { + worldData = data; + break; + } + } + + if(worldData == null) { + worldData = new FlagWorld(world); + this.flagWorlds.add(worldData); + } + } + + return worldData; + } + + public boolean containsValue(World world, String flagName, String checkValue, Vector3 position) { + return this.getFlagWorld(world).containsValue(flagName, checkValue, position); + } + + public List getFlagWorlds() { + return this.flagWorlds; + } +} diff --git a/src/main/java/universalelectricity/prefab/flag/NBTFileLoader.java b/src/main/java/universalelectricity/prefab/flag/NBTFileLoader.java new file mode 100644 index 0000000..54fdb9f --- /dev/null +++ b/src/main/java/universalelectricity/prefab/flag/NBTFileLoader.java @@ -0,0 +1,77 @@ +package universalelectricity.prefab.flag; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; + +public class NBTFileLoader { + + public static boolean saveData(File saveDirectory, String filename, NBTTagCompound data) { + try { + File e = new File(saveDirectory, filename + "_tmp.dat"); + File file = new File(saveDirectory, filename + ".dat"); + CompressedStreamTools.writeCompressed(data, new FileOutputStream(e)); + if(file.exists()) { + file.delete(); + } + + e.renameTo(file); + FMLLog.fine("Saved " + filename + " NBT data file successfully.", new Object[0]); + return true; + } catch (Exception var5) { + System.out.println("Failed to save " + filename + ".dat!"); + var5.printStackTrace(); + return false; + } + } + + public static boolean saveData(String filename, NBTTagCompound data) { + return saveData(getSaveDirectory(MinecraftServer.getServer().getFolderName()), filename, data); + } + + public static NBTTagCompound loadData(File saveDirectory, String filename) { + try { + File e = new File(saveDirectory, filename + ".dat"); + if(e.exists()) { + FMLLog.fine("Loaded " + filename + " data.", new Object[0]); + return CompressedStreamTools.readCompressed(new FileInputStream(e)); + } else { + FMLLog.fine("Created new " + filename + " data.", new Object[0]); + return new NBTTagCompound(); + } + } catch (Exception var3) { + System.out.println("Failed to load " + filename + ".dat!"); + var3.printStackTrace(); + return null; + } + } + + public static NBTTagCompound loadData(String filename) { + return loadData(getSaveDirectory(MinecraftServer.getServer().getFolderName()), filename); + } + + public static File getSaveDirectory(String worldName) { + File parent = getBaseDirectory(); + if(FMLCommonHandler.instance().getSide().isClient()) { + parent = new File(getBaseDirectory(), "saves" + File.separator); + } + + return new File(parent, worldName + File.separator); + } + + public static File getBaseDirectory() { + if(FMLCommonHandler.instance().getSide().isClient()) { + FMLClientHandler.instance().getClient(); + return Minecraft.getMinecraft().mcDataDir; + } else { + return new File("."); + } + } +} diff --git a/src/main/java/universalelectricity/prefab/implement/IDisableable.java b/src/main/java/universalelectricity/prefab/implement/IDisableable.java new file mode 100644 index 0000000..c4e3d16 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/implement/IDisableable.java @@ -0,0 +1,9 @@ +package universalelectricity.prefab.implement; + + +public interface IDisableable { + + void onDisable(int var1); + + boolean isDisabled(); +} diff --git a/src/main/java/universalelectricity/prefab/implement/IRedstoneProvider.java b/src/main/java/universalelectricity/prefab/implement/IRedstoneProvider.java new file mode 100644 index 0000000..7631422 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/implement/IRedstoneProvider.java @@ -0,0 +1,10 @@ +package universalelectricity.prefab.implement; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IRedstoneProvider { + + boolean isPoweringTo(ForgeDirection var1); + + boolean isIndirectlyPoweringTo(ForgeDirection var1); +} diff --git a/src/main/java/universalelectricity/prefab/implement/IRedstoneReceptor.java b/src/main/java/universalelectricity/prefab/implement/IRedstoneReceptor.java new file mode 100644 index 0000000..22c9001 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/implement/IRedstoneReceptor.java @@ -0,0 +1,9 @@ +package universalelectricity.prefab.implement; + + +public interface IRedstoneReceptor { + + void onPowerOn(); + + void onPowerOff(); +} diff --git a/src/main/java/universalelectricity/prefab/implement/IRotatable.java b/src/main/java/universalelectricity/prefab/implement/IRotatable.java new file mode 100644 index 0000000..e007baf --- /dev/null +++ b/src/main/java/universalelectricity/prefab/implement/IRotatable.java @@ -0,0 +1,12 @@ +package universalelectricity.prefab.implement; + +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public interface IRotatable { + + ForgeDirection getDirection(IBlockAccess var1, int var2, int var3, int var4); + + void setDirection(World var1, int var2, int var3, int var4, ForgeDirection var5); +} diff --git a/src/main/java/universalelectricity/prefab/implement/ITier.java b/src/main/java/universalelectricity/prefab/implement/ITier.java new file mode 100644 index 0000000..9a84564 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/implement/ITier.java @@ -0,0 +1,9 @@ +package universalelectricity.prefab.implement; + + +public interface ITier { + + int getTier(); + + void setTier(int var1); +} diff --git a/src/main/java/universalelectricity/prefab/implement/IToolConfigurator.java b/src/main/java/universalelectricity/prefab/implement/IToolConfigurator.java new file mode 100644 index 0000000..c8f3e32 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/implement/IToolConfigurator.java @@ -0,0 +1,10 @@ +package universalelectricity.prefab.implement; + +import net.minecraft.entity.player.EntityPlayer; + +public interface IToolConfigurator { + + boolean canWrench(EntityPlayer var1, int var2, int var3, int var4); + + void wrenchUsed(EntityPlayer var1, int var2, int var3, int var4); +} diff --git a/src/main/java/universalelectricity/prefab/modifier/IModifier.java b/src/main/java/universalelectricity/prefab/modifier/IModifier.java new file mode 100644 index 0000000..8be79fc --- /dev/null +++ b/src/main/java/universalelectricity/prefab/modifier/IModifier.java @@ -0,0 +1,12 @@ +package universalelectricity.prefab.modifier; + +import net.minecraft.item.ItemStack; + +public interface IModifier +{ + String getType(final ItemStack p0); + + double getEffectiveness(final ItemStack p0); + + int getTier(final ItemStack p0); +} diff --git a/src/main/java/universalelectricity/prefab/modifier/SlotModifier.java b/src/main/java/universalelectricity/prefab/modifier/SlotModifier.java new file mode 100644 index 0000000..7bbbab5 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/modifier/SlotModifier.java @@ -0,0 +1,16 @@ +package universalelectricity.prefab.modifier; + +import net.minecraft.item.ItemStack; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; + +public class SlotModifier extends Slot +{ + public SlotModifier(final IInventory par2IInventory, final int par3, final int par4, final int par5) { + super(par2IInventory, par3, par4, par5); + } + + public boolean isItemValid(final ItemStack par1ItemStack) { + return par1ItemStack.getItem() instanceof IModifier; + } +} diff --git a/src/main/java/universalelectricity/prefab/multiblock/BlockMulti.java b/src/main/java/universalelectricity/prefab/multiblock/BlockMulti.java new file mode 100644 index 0000000..73438ad --- /dev/null +++ b/src/main/java/universalelectricity/prefab/multiblock/BlockMulti.java @@ -0,0 +1,117 @@ +package universalelectricity.prefab.multiblock; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.core.vector.Vector3; + +public class BlockMulti extends BlockContainer { + + public String textureName = null; + public String channel = ""; + + + public BlockMulti() { + super(UniversalElectricity.machine); + this.setHardness(0.8F); + this.setBlockName("multiBlock"); + } + + public BlockMulti setChannel(String channel) { + this.channel = channel; + return this; + } + + public BlockMulti setTextureName(String name) { + this.textureName = name; + return this; + } + + public void makeFakeBlock(World worldObj, Vector3 position, Vector3 mainBlock) { + worldObj.setBlock(position.intX(), position.intY(), position.intZ(), this); + TileEntity tile = position.getTileEntity(worldObj); + if (tile instanceof TileEntityMulti) { + ((TileEntityMulti)tile).setMainBlock(mainBlock); + } else { + TileEntityMulti newTile = (TileEntityMulti)createNewTileEntity(worldObj, 0); + worldObj.setTileEntity(position.intX(), position.intY(), position.intZ(), newTile); + newTile.setMainBlock(mainBlock); + + } + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister iconRegister) { + if(this.textureName != null) { + this.blockIcon = iconRegister.registerIcon(this.textureName); + } else { + super.registerBlockIcons(iconRegister); + } + + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + if(tileEntity instanceof TileEntityMulti) { + ((TileEntityMulti)tileEntity).onBlockRemoval(); + } + + super.breakBlock(world, x, y, z, par5, par6); + } + + @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.getTileEntity(x, y, z); + return tileEntity.onBlockActivated(par1World, x, y, z, par5EntityPlayer); + } + + @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, int meta) { + return new TileEntityMulti(this.channel); + } + + public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int x, int y, int z) { + TileEntity tileEntity = par1World.getTileEntity(x, y, z); + Vector3 mainBlockPosition = ((TileEntityMulti)tileEntity).mainBlockPosition; + if(mainBlockPosition != null) { + Block mainBlockID = par1World.getBlock(mainBlockPosition.intX(), mainBlockPosition.intY(), mainBlockPosition.intZ()); + if(mainBlockID != Blocks.air) { + return mainBlockID.getPickBlock(target, par1World, mainBlockPosition.intX(), mainBlockPosition.intY(), mainBlockPosition.intZ()); + } + } + + return null; + } +} diff --git a/src/main/java/universalelectricity/prefab/multiblock/IBlockActivate.java b/src/main/java/universalelectricity/prefab/multiblock/IBlockActivate.java new file mode 100644 index 0000000..7657fca --- /dev/null +++ b/src/main/java/universalelectricity/prefab/multiblock/IBlockActivate.java @@ -0,0 +1,8 @@ +package universalelectricity.prefab.multiblock; + +import net.minecraft.entity.player.EntityPlayer; + +public interface IBlockActivate { + + boolean onActivated(EntityPlayer var1); +} diff --git a/src/main/java/universalelectricity/prefab/multiblock/IMultiBlock.java b/src/main/java/universalelectricity/prefab/multiblock/IMultiBlock.java new file mode 100644 index 0000000..820c5cc --- /dev/null +++ b/src/main/java/universalelectricity/prefab/multiblock/IMultiBlock.java @@ -0,0 +1,12 @@ +package universalelectricity.prefab.multiblock; + +import net.minecraft.tileentity.TileEntity; +import universalelectricity.core.vector.Vector3; +import universalelectricity.prefab.multiblock.IBlockActivate; + +public interface IMultiBlock extends IBlockActivate { + + void onCreate(Vector3 var1); + + void onDestroy(TileEntity var1); +} diff --git a/src/main/java/universalelectricity/prefab/multiblock/TileEntityMulti.java b/src/main/java/universalelectricity/prefab/multiblock/TileEntityMulti.java new file mode 100644 index 0000000..9af9238 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/multiblock/TileEntityMulti.java @@ -0,0 +1,91 @@ +package universalelectricity.prefab.multiblock; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import universalelectricity.core.vector.Vector3; + +public class TileEntityMulti extends TileEntity { + + public Vector3 mainBlockPosition; + public String channel; + + + public TileEntityMulti() {} + + public TileEntityMulti(String channel) { + this.channel = channel; + } + + public void setMainBlock(Vector3 mainBlock) { + this.mainBlockPosition = mainBlock; + if(!this.worldObj.isRemote) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + + } + + @Override + public Packet getDescriptionPacket() { + if(this.mainBlockPosition == null) { + return null; + } else { + NBTTagCompound nbt = this.mainBlockPosition.writeToNBT(new NBTTagCompound()); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, getBlockMetadata(),nbt); + } + } + + public void onBlockRemoval() { + if(this.mainBlockPosition != null) { + TileEntity tileEntity = this.worldObj.getTileEntity(this.mainBlockPosition.intX(), this.mainBlockPosition.intY(), this.mainBlockPosition.intZ()); + 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(this.mainBlockPosition != null) { + TileEntity tileEntity = this.worldObj.getTileEntity(this.mainBlockPosition.intX(), this.mainBlockPosition.intY(), this.mainBlockPosition.intZ()); + if(tileEntity != null && tileEntity instanceof IMultiBlock) { + return ((IMultiBlock)tileEntity).onActivated(par5EntityPlayer); + } + } + + return false; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.mainBlockPosition = Vector3.readFromNBT(nbt.getCompoundTag("mainBlockPosition")); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + if(this.mainBlockPosition != null) { + nbt.setTag("mainBlockPosition", this.mainBlockPosition.writeToNBT(new NBTTagCompound())); + } + + } + + public boolean canUpdate() { + return false; + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + this.mainBlockPosition = Vector3.readFromNBT(nbt); + } + +} diff --git a/src/main/java/universalelectricity/prefab/ore/OreGenBase.java b/src/main/java/universalelectricity/prefab/ore/OreGenBase.java new file mode 100644 index 0000000..26388a1 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/ore/OreGenBase.java @@ -0,0 +1,60 @@ +package universalelectricity.prefab.ore; + +import cpw.mods.fml.common.FMLLog; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.oredict.OreDictionary; + +public abstract class OreGenBase { + + public String name; + public String oreDictionaryName; + public boolean shouldGenerate = false; + public int blockIndexTexture; + public ItemStack oreStack; + public Block oreID; + public int oreMeta; + public int harvestLevel; + public String harvestTool; + + + public OreGenBase(String name, String oreDiectionaryName, ItemStack stack, String harvestTool, int harvestLevel) { + if(stack != null) { + this.name = name; + this.harvestTool = harvestTool; + this.harvestLevel = harvestLevel; + this.oreDictionaryName = oreDiectionaryName; + this.oreStack = stack; + this.oreID = Block.getBlockFromItem(stack.getItem()); + this.oreMeta = stack.getItemDamage(); + OreDictionary.registerOre(this.oreDictionaryName, stack); + oreID.setHarvestLevel(harvestTool, harvestLevel, stack.getItemDamage()); + + } else { + FMLLog.severe("ItemStack is null while registering ore generation!", new Object[0]); + } + + } + + public OreGenBase enable(Configuration config) { + this.shouldGenerate = shouldGenerateOre(config, this.name); + return this; + } + + private static boolean shouldGenerateOre(Configuration configuration, String oreName) { + configuration.load(); + boolean shouldGenerate = configuration.get("Ore_Generation", "Generate " + oreName, true).getBoolean(true); + configuration.save(); + return shouldGenerate; + } + + public abstract void generate(World var1, Random var2, int var3, int var4); + + public abstract boolean isOreGeneratedInWorld(World var1, IChunkProvider var2); +} diff --git a/src/main/java/universalelectricity/prefab/ore/OreGenReplace.java b/src/main/java/universalelectricity/prefab/ore/OreGenReplace.java new file mode 100644 index 0000000..39cc980 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/ore/OreGenReplace.java @@ -0,0 +1,99 @@ +package universalelectricity.prefab.ore; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderEnd; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.ChunkProviderHell; + +public class OreGenReplace extends OreGenBase { + + public int minGenerateLevel; + public int maxGenerateLevel; + public int amountPerChunk; + public int amountPerBranch; + public Block replaceID; + public boolean ignoreSurface = false; + public boolean ignoreNether = true; + public boolean ignoreEnd = true; + + + public OreGenReplace(String name, String oreDiectionaryName, ItemStack stack, Block 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) { + try { + for(int e = 0; e < this.amountPerChunk; ++e) { + int x = varX + random.nextInt(16); + int z = varZ + random.nextInt(16); + int y = random.nextInt(Math.max(this.maxGenerateLevel - this.minGenerateLevel, 0)) + this.minGenerateLevel; + this.generateReplace(world, random, x, y, z); + } + } catch (Exception var9) { + System.out.println("Error generating ore: " + super.name); + var9.printStackTrace(); + } + + } + + public boolean generateReplace(World par1World, Random par2Random, int par3, int par4, int par5) { + float var6 = par2Random.nextFloat() * 3.1415927F; + 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 * 3.1415927F / (float)this.amountPerBranch) + 1.0F) * var26 + 1.0D; + double var30 = (double)(MathHelper.sin((float)var19 * 3.1415927F / (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); + Block block = par1World.getBlock(var38, var41, var44); + if(var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (this.replaceID == Blocks.air || block == this.replaceID)) { + par1World.setBlock(var38, var41, var44, super.oreID, super.oreMeta, 2); + } + } + } + } + } + } + } + + return true; + } + + public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator) { + return !super.shouldGenerate?false:(this.ignoreSurface && chunkGenerator instanceof ChunkProviderGenerate?false:(this.ignoreNether && chunkGenerator instanceof ChunkProviderHell?false:!this.ignoreEnd || !(chunkGenerator instanceof ChunkProviderEnd))); + } +} diff --git a/src/main/java/universalelectricity/prefab/ore/OreGenReplaceStone.java b/src/main/java/universalelectricity/prefab/ore/OreGenReplaceStone.java new file mode 100644 index 0000000..8e033e8 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/ore/OreGenReplaceStone.java @@ -0,0 +1,16 @@ +package universalelectricity.prefab.ore; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import universalelectricity.prefab.ore.OreGenReplace; + +public class OreGenReplaceStone extends OreGenReplace { + + public OreGenReplaceStone(String name, String oreDiectionaryName, ItemStack stack, int minGenerateLevel, int maxGenerateLevel, int amountPerChunk, int amountPerBranch, String harvestTool, int harvestLevel) { + super(name, oreDiectionaryName, stack, Blocks.stone, minGenerateLevel, maxGenerateLevel, amountPerChunk, amountPerBranch, harvestTool, harvestLevel); + } + + public OreGenReplaceStone(String name, String oreDiectionaryName, ItemStack stack, int maxGenerateLevel, int amountPerChunk, int amountPerBranch) { + this(name, oreDiectionaryName, stack, 0, maxGenerateLevel, amountPerChunk, amountPerBranch, "pickaxe", 1); + } +} diff --git a/src/main/java/universalelectricity/prefab/ore/OreGenerator.java b/src/main/java/universalelectricity/prefab/ore/OreGenerator.java new file mode 100644 index 0000000..4b0d74a --- /dev/null +++ b/src/main/java/universalelectricity/prefab/ore/OreGenerator.java @@ -0,0 +1,60 @@ +package universalelectricity.prefab.ore; + +import cpw.mods.fml.common.IWorldGenerator; +import cpw.mods.fml.common.registry.GameRegistry; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import universalelectricity.prefab.ore.OreGenBase; + +public class OreGenerator implements IWorldGenerator { + + public static boolean isInitiated = false; + private static final List ORES_TO_GENERATE = new ArrayList(); + + + public static void addOre(OreGenBase data) { + if(!isInitiated) { + GameRegistry.registerWorldGenerator(new OreGenerator(), 10); //TODO figure out the right value instead of 10 + } + + ORES_TO_GENERATE.add(data); + } + + public static boolean oreExists(String oreName) { + Iterator i$ = ORES_TO_GENERATE.iterator(); + + OreGenBase ore; + do { + if(!i$.hasNext()) { + return false; + } + + ore = (OreGenBase)i$.next(); + } while(ore.oreDictionaryName != oreName); + + return true; + } + + public static void removeOre(OreGenBase data) { + ORES_TO_GENERATE.remove(data); + } + + public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { + chunkX <<= 4; + chunkZ <<= 4; + Iterator i$ = ORES_TO_GENERATE.iterator(); + + while(i$.hasNext()) { + OreGenBase oreData = (OreGenBase)i$.next(); + if(oreData.shouldGenerate && oreData.isOreGeneratedInWorld(world, chunkGenerator)) { + oreData.generate(world, rand, chunkX, chunkZ); + } + } + + } + +} diff --git a/src/main/java/universalelectricity/prefab/potion/CustomPotion.java b/src/main/java/universalelectricity/prefab/potion/CustomPotion.java new file mode 100644 index 0000000..3f46380 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/potion/CustomPotion.java @@ -0,0 +1,22 @@ +package universalelectricity.prefab.potion; + +import net.minecraft.potion.Potion; + +public abstract class CustomPotion extends Potion { + + public CustomPotion(int id, boolean isBadEffect, int color, String name) { + super(id, isBadEffect, color); + this.setPotionName("potion." + name); + Potion.potionTypes[this.getId()] = this; + } + + public Potion setIconIndex(int par1, int par2) { + super.setIconIndex(par1, par2); + return this; + } + + protected Potion setEffectiveness(double par1) { + super.setEffectiveness(par1); + return this; + } +} diff --git a/src/main/java/universalelectricity/prefab/potion/CustomPotionEffect.java b/src/main/java/universalelectricity/prefab/potion/CustomPotionEffect.java new file mode 100644 index 0000000..24ea3d5 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/potion/CustomPotionEffect.java @@ -0,0 +1,29 @@ +package universalelectricity.prefab.potion; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.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); + } + + 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/main/java/universalelectricity/prefab/tile/ElectricTileDriver.java b/src/main/java/universalelectricity/prefab/tile/ElectricTileDriver.java new file mode 100644 index 0000000..bc0edc9 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/tile/ElectricTileDriver.java @@ -0,0 +1,107 @@ +package universalelectricity.prefab.tile; + +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.api.CompatibilityModule; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.core.vector.Vector3; + +public class ElectricTileDriver { + + TileEntity handler; + + public ElectricTileDriver(TileEntity handler) { + this.handler = handler; + } + + public void invalidate() { + ElectricityNetworkHelper.invalidate(handler); + } + + public boolean tick() { + if (handler.isInvalid()) return false; + Map networks = getNetworks(); + Set inputSides = new HashSet<>(); + if (CompatibilityModule.canReceive(handler, ForgeDirection.UNKNOWN)) { + inputSides = consume(networks); + } + if (CompatibilityModule.canExtract(handler, ForgeDirection.UNKNOWN)) { + produce(networks, inputSides); + } + return networks.size() > 0; + } + + public Set consume(Map networks) { + Set inputSides = new HashSet<>(); + + if (networks.size() > 0) { + double demand = CompatibilityModule.getDemandedJoules(handler); + double voltage = CompatibilityModule.getInputVoltage(handler); + double wattsPerSide = demand / networks.size(); + for (ForgeDirection side : networks.keySet()) { + IElectricityNetwork net = networks.get(side); + if (CompatibilityModule.canReceive(handler, side) && wattsPerSide > 0 && demand > 0) { + inputSides.add(side); + net.startRequesting(handler, wattsPerSide / voltage, voltage); + ElectricityPack receivedPack = net.consumeElectricity(handler); + if (receivedPack.voltage > voltage && UniversalElectricity.isVoltageSensitive) { + handler.getWorldObj().createExplosion(null, handler.xCoord, handler.yCoord, handler.zCoord, 1, true); + return EnumSet.allOf(ForgeDirection.class); + } + CompatibilityModule.receiveEnergy(handler, side, receivedPack.getWatts(), true); + } else { + net.stopRequesting(handler); + } + } + + } + + return inputSides; + } + + public void produce(Map networks, Set inputSides) { + if ((networks.size() - inputSides.size()) > 0) { + double provided = CompatibilityModule.getProvidedJoules(handler); + double voltage = CompatibilityModule.getOutputVoltage(handler); + double wattsPerSide = provided / (networks.size() - inputSides.size()); + for (ForgeDirection side : networks.keySet()) { + IElectricityNetwork net = networks.get(side); + if (!inputSides.contains(side) && CompatibilityModule.canExtract(handler, side) && wattsPerSide > 0 && provided > 0) { + double amperes = Math.min(wattsPerSide / voltage, net.getRequest(new TileEntity[]{handler}).amperes); + net.startProducing(handler, amperes, voltage); + CompatibilityModule.extractEnergy(handler, side, new ElectricityPack(amperes, voltage).getWatts(), true); + } else { + net.stopProducing(handler); + } + } + } + } + + public Map getNetworks() { + Map networks = new HashMap<>(); + + for(ForgeDirection dir : ForgeDirection.values()) { + if (CompatibilityModule.canReceive(handler, dir) || CompatibilityModule.canExtract(handler, dir)) { + Vector3 position = new Vector3(handler); + position.modifyPositionFromSide(dir); + TileEntity outputConductor = position.getTileEntity(handler.getWorldObj()); + IElectricityNetwork electricityNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity(outputConductor, dir); + if(electricityNetwork != null && !networks.containsValue(electricityNetwork)) { + networks.put(dir, electricityNetwork); + } + } + } + + return networks; + } + +} diff --git a/src/main/java/universalelectricity/prefab/tile/TileEntityAdvanced.java b/src/main/java/universalelectricity/prefab/tile/TileEntityAdvanced.java new file mode 100644 index 0000000..6bd2c3e --- /dev/null +++ b/src/main/java/universalelectricity/prefab/tile/TileEntityAdvanced.java @@ -0,0 +1,42 @@ +package universalelectricity.prefab.tile; + +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; + +public abstract class TileEntityAdvanced extends TileEntity { + + protected long ticks = 0L; + + @Override + public void updateEntity() { + if(this.ticks == 0L) { + this.initiate(); + } + + if(this.ticks >= Long.MAX_VALUE) { + this.ticks = 1L; + } + + ++this.ticks; + } + + public 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 = this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord); + } + + return this.blockType; + } +} diff --git a/src/main/java/universalelectricity/prefab/tile/TileEntityConductor.java b/src/main/java/universalelectricity/prefab/tile/TileEntityConductor.java new file mode 100644 index 0000000..1fcd78a --- /dev/null +++ b/src/main/java/universalelectricity/prefab/tile/TileEntityConductor.java @@ -0,0 +1,143 @@ +package universalelectricity.prefab.tile; + +import java.util.Arrays; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.compat.CompatHandler; +import universalelectricity.core.block.IConductor; +import universalelectricity.core.block.INetworkProvider; +import universalelectricity.core.block.ISelfDriven; +import universalelectricity.core.electricity.ElectricityNetwork; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; + +public abstract class TileEntityConductor extends TileEntityAdvanced implements IConductor { + + private IElectricityNetwork network; + public boolean[] visuallyConnected = new boolean[]{false, false, false, false, false, false}; + public TileEntity[] connectedBlocks = new TileEntity[]{null, null, null, null, null, null}; + protected String channel = ""; + + + public void updateConnection(TileEntity tileEntity, ForgeDirection side) { + if(!this.worldObj.isRemote) { + if(ElectricityNetworkHelper.canConnect(tileEntity, side.getOpposite(), this)) { + this.connectedBlocks[side.ordinal()] = tileEntity; + this.visuallyConnected[side.ordinal()] = true; + if(tileEntity.getClass() == this.getClass() && tileEntity instanceof INetworkProvider) { + this.getNetwork().mergeConnection(((INetworkProvider)tileEntity).getNetwork()); + } else if (!(tileEntity instanceof ISelfDriven)) { + CompatHandler.registerTile(tileEntity); + } + + return; + } + + if(this.connectedBlocks[side.ordinal()] != null) { + this.getNetwork().stopProducing(this.connectedBlocks[side.ordinal()]); + this.getNetwork().stopRequesting(this.connectedBlocks[side.ordinal()]); + } + + this.connectedBlocks[side.ordinal()] = null; + this.visuallyConnected[side.ordinal()] = false; + } + + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + if(this.worldObj.isRemote) { + NBTTagCompound nbt = pkt.func_148857_g(); + this.visuallyConnected[0] = nbt.getBoolean("bottom"); + this.visuallyConnected[1] = nbt.getBoolean("top"); + this.visuallyConnected[2] = nbt.getBoolean("back"); + this.visuallyConnected[3] = nbt.getBoolean("front"); + this.visuallyConnected[4] = nbt.getBoolean("left"); + this.visuallyConnected[5] = nbt.getBoolean("right"); + } + } + + public void initiate() { + this.updateAdjacentConnections(); + } + + @Override + public void invalidate() { + if(!this.worldObj.isRemote) { + this.getNetwork().splitNetwork(this); + } + + super.invalidate(); + } + + @Override + public void updateEntity() { + super.updateEntity(); + if(!this.worldObj.isRemote && super.ticks % 300L == 0L) { + this.updateAdjacentConnections(); + } + + } + + public void updateAdjacentConnections() { + if(this.worldObj != null && !this.worldObj.isRemote) { + boolean[] previousConnections = (boolean[])this.visuallyConnected.clone(); + + for(byte i = 0; i < 6; ++i) { + this.updateConnection(VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), ForgeDirection.getOrientation(i)), ForgeDirection.getOrientation(i)); + } + + if(!Arrays.equals(previousConnections, this.visuallyConnected)) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + } + + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setBoolean("bottom", this.visuallyConnected[0]); + nbt.setBoolean("top", this.visuallyConnected[1]); + nbt.setBoolean("back", this.visuallyConnected[2]); + nbt.setBoolean("front", this.visuallyConnected[3]); + nbt.setBoolean("left", this.visuallyConnected[4]); + nbt.setBoolean("right", this.visuallyConnected[5]); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt); + } + + public IElectricityNetwork getNetwork() { + if(this.network == null) { + this.setNetwork(new ElectricityNetwork(new IConductor[]{this})); + } + + return this.network; + } + + public void setNetwork(IElectricityNetwork network) { + this.network = network; + } + + public TileEntity[] getAdjacentConnections() { + return this.connectedBlocks; + } + + public boolean canConnect(ForgeDirection direction) { + return true; + } + + @SideOnly(Side.CLIENT) + public AxisAlignedBB getRenderBoundingBox() { + return AxisAlignedBB.getBoundingBox((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (double)(this.xCoord + 1), (double)(this.yCoord + 1), (double)(this.zCoord + 1)); + } +} diff --git a/src/main/java/universalelectricity/prefab/tile/TileEntityDisableable.java b/src/main/java/universalelectricity/prefab/tile/TileEntityDisableable.java new file mode 100644 index 0000000..1f9b3c9 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/tile/TileEntityDisableable.java @@ -0,0 +1,27 @@ +package universalelectricity.prefab.tile; + +import universalelectricity.prefab.implement.IDisableable; + +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(); + } + } + + protected void whileDisable() {} + + public void onDisable(int duration) { + this.disabledTicks = duration; + } + + public boolean isDisabled() { + return this.disabledTicks > 0; + } +} diff --git a/src/main/java/universalelectricity/prefab/tile/TileEntityElectrical.java b/src/main/java/universalelectricity/prefab/tile/TileEntityElectrical.java new file mode 100644 index 0000000..9771f5b --- /dev/null +++ b/src/main/java/universalelectricity/prefab/tile/TileEntityElectrical.java @@ -0,0 +1,19 @@ +package universalelectricity.prefab.tile; + +import universalelectricity.core.block.IConnector; +import universalelectricity.core.block.IVoltage; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.prefab.tile.TileEntityDisableable; + +public abstract class TileEntityElectrical extends TileEntityDisableable implements IConnector, IVoltage { + + public double getVoltage() { + return 120.0D; + } + + @Override + public void invalidate() { + ElectricityNetworkHelper.invalidate(this); + super.invalidate(); + } +} diff --git a/src/main/java/universalelectricity/prefab/tile/TileEntityElectricityRunnable.java b/src/main/java/universalelectricity/prefab/tile/TileEntityElectricityRunnable.java new file mode 100644 index 0000000..9892d70 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/tile/TileEntityElectricityRunnable.java @@ -0,0 +1,50 @@ +package universalelectricity.prefab.tile; + +import java.util.EnumSet; +import net.minecraft.entity.Entity; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.ElectricityPack; + +public abstract class TileEntityElectricityRunnable extends TileEntityElectrical { + + public double prevWatts; + public double wattsReceived = 0.0D; + + @Override + public void updateEntity() { + super.updateEntity(); + this.prevWatts = this.wattsReceived; + if(!this.worldObj.isRemote) { + if(!this.isDisabled()) { + ElectricityPack electricityPack = ElectricityNetworkHelper.consumeFromMultipleSides(this, this.getConsumingSides(), this.getRequest()); + this.onReceive(electricityPack); + } else { + ElectricityNetworkHelper.consumeFromMultipleSides(this, new ElectricityPack()); + } + } + + } + + protected EnumSet getConsumingSides() { + return ElectricityNetworkHelper.getDirections(this); + } + + public ElectricityPack getRequest() { + return new ElectricityPack(); + } + + public void onReceive(ElectricityPack electricityPack) { + if(UniversalElectricity.isVoltageSensitive && electricityPack.voltage > this.getVoltage()) { + this.worldObj.createExplosion((Entity)null, (double)this.xCoord, (double)this.yCoord, (double)this.zCoord, 1.5F, true); + } else { + this.wattsReceived = Math.min(this.wattsReceived + electricityPack.getWatts(), this.getWattBuffer()); + } + } + + public double getWattBuffer() { + return this.getRequest().getWatts() * 2.0D; + } + +} diff --git a/src/main/java/universalelectricity/prefab/tile/TileEntityElectricityStorage.java b/src/main/java/universalelectricity/prefab/tile/TileEntityElectricityStorage.java new file mode 100644 index 0000000..77630ef --- /dev/null +++ b/src/main/java/universalelectricity/prefab/tile/TileEntityElectricityStorage.java @@ -0,0 +1,81 @@ +package universalelectricity.prefab.tile; + +import java.util.EnumSet; + +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.core.block.IElectricityStorage; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.prefab.tile.TileEntityElectrical; + +public abstract class TileEntityElectricityStorage extends TileEntityElectrical implements IElectricityStorage { + + private double joules = 0.0D; + public double prevJoules = 0.0D; + + @Override + public void updateEntity() { + super.updateEntity(); + this.prevJoules = this.joules; + if(!this.worldObj.isRemote) { + if(!this.isDisabled()) { + ElectricityPack electricityPack = ElectricityNetworkHelper.consumeFromMultipleSides(this, this.getConsumingSides(), this.getRequest()); + this.onReceive(electricityPack); + } else { + ElectricityNetworkHelper.consumeFromMultipleSides(this, new ElectricityPack()); + } + } + + } + + protected EnumSet getConsumingSides() { + return ElectricityNetworkHelper.getDirections(this); + } + + public ElectricityPack getRequest() { + return new ElectricityPack((this.getMaxJoules() - this.getJoules()) / this.getVoltage(), this.getVoltage()); + } + + public void onReceive(ElectricityPack electricityPack) { + if(UniversalElectricity.isVoltageSensitive && electricityPack.voltage > this.getVoltage()) { + this.worldObj.createExplosion((Entity)null, (double)this.xCoord, (double)this.yCoord, (double)this.zCoord, 1.5F, true); + } else { + this.setJoules(this.getJoules() + electricityPack.getWatts()); + } + } + + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) { + super.readFromNBT(par1NBTTagCompound); + this.joules = par1NBTTagCompound.getDouble("joules"); + } + + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setDouble("joules", this.joules); + } + + public double getJoules() { + return this.joules; + } + + public void setJoules(double joules) { + this.joules = Math.max(Math.min(joules, this.getMaxJoules()), 0.0D); + } + + public double transferEnergyToAcceptor(ForgeDirection side, double amount) { + if (!canReceiveEnergy(side)) return 0; + double toUse = Math.min(getMaxEnergy()-getEnergy(), amount); + setEnergy(toUse + getEnergy()); + return toUse; + } + + public boolean canReceiveEnergy(ForgeDirection side) { + return getConsumingSides().contains(side); + } + +} diff --git a/src/main/java/universalelectricity/prefab/vector/Region2.java b/src/main/java/universalelectricity/prefab/vector/Region2.java new file mode 100644 index 0000000..8becb39 --- /dev/null +++ b/src/main/java/universalelectricity/prefab/vector/Region2.java @@ -0,0 +1,27 @@ +package universalelectricity.prefab.vector; + +import universalelectricity.core.vector.Vector2; + +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; + } + + 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; + } + + 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:false; + } +} diff --git a/src/main/java/universalelectricity/prefab/vector/Region3.java b/src/main/java/universalelectricity/prefab/vector/Region3.java new file mode 100644 index 0000000..c52740a --- /dev/null +++ b/src/main/java/universalelectricity/prefab/vector/Region3.java @@ -0,0 +1,94 @@ +package universalelectricity.prefab.vector; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import universalelectricity.core.vector.Vector3; +import universalelectricity.prefab.vector.Region2; + +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(AxisAlignedBB aabb) { + this.min = new Vector3(aabb.minX, aabb.minY, aabb.minZ); + this.max = 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()); + } + + 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; + } + + 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); + } + + public List getVectors() { + ArrayList 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((double)x, (double)y, (double)z)); + } + } + } + + return vectors; + } + + public List getVectors(Vector3 center, int radius) { + ArrayList 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((double)x, (double)y, (double)z); + if(center.distanceTo(vector3) <= (double)radius) { + vectors.add(vector3); + } + } + } + } + + return vectors; + } + + 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); + } +}