From f4a938ab3df7635b615118c36ee1932635c0fd18 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Mon, 31 Oct 2022 19:14:21 +0100 Subject: [PATCH] add the code! --- .gitignore | 4 + build.gradle | 25 +- gradlew | 0 .../computercraft/api/ComputerCraftAPI.java | 315 +++++++++ .../computercraft/api/filesystem/IMount.java | 57 ++ .../api/filesystem/IWritableMount.java | 52 ++ .../api/filesystem/package-info.java | 10 + .../computercraft/api/lua/ILuaContext.java | 58 ++ .../computercraft/api/lua/ILuaObject.java | 26 + .../computercraft/api/lua/ILuaTask.java | 12 + .../computercraft/api/lua/LuaException.java | 36 + .../computercraft/api/lua/package-info.java | 10 + .../computercraft/api/media/IMedia.java | 59 ++ .../api/media/IMediaProvider.java | 23 + .../computercraft/api/media/package-info.java | 10 + .../computercraft/api/package-info.java | 10 + .../api/peripheral/IComputerAccess.java | 102 +++ .../api/peripheral/IPeripheral.java | 100 +++ .../api/peripheral/IPeripheralProvider.java | 23 + .../api/peripheral/package-info.java | 10 + .../ITurtlePermissionProvider.java | 19 + .../api/permissions/package-info.java | 10 + .../redstone/IBundledRedstoneProvider.java | 23 + .../api/redstone/package-info.java | 10 + .../api/turtle/ITurtleAccess.java | 168 +++++ .../api/turtle/ITurtleCommand.java | 25 + .../api/turtle/ITurtleUpgrade.java | 94 +++ .../api/turtle/TurtleAnimation.java | 22 + .../api/turtle/TurtleCommandResult.java | 73 ++ .../computercraft/api/turtle/TurtleSide.java | 23 + .../api/turtle/TurtleUpgradeType.java | 27 + .../computercraft/api/turtle/TurtleVerb.java | 26 + .../api/turtle/package-info.java | 10 + .../api/ElectricExpansionItems.java | 31 + .../api/EnumWireMaterial.java | 23 + .../electricexpansion/api/EnumWireType.java | 10 + .../api/IAdvancedConductor.java | 9 + .../java/electricexpansion/api/IItemFuse.java | 17 + .../api/IRedstoneNetAccessor.java | 8 + .../api/IWirelessPowerMachine.java | 16 + .../java/electricexpansion/api/Recipes.java | 60 ++ .../electricexpansion/client/ClientProxy.java | 95 +++ .../client/gui/GuiAdvancedBatteryBox.java | 79 +++ .../client/gui/GuiFuseBox.java | 67 ++ .../client/gui/GuiInsulationMachine.java | 88 +++ .../client/gui/GuiLogisticsWire.java | 110 +++ .../client/gui/GuiQuantumBatteryBox.java | 134 ++++ .../client/gui/GuiSwitchButton.java | 76 +++ .../client/gui/GuiWireMill.java | 89 +++ .../client/model/ModelInsulatedWire.java | 106 +++ .../client/model/ModelRawWire.java | 99 +++ .../client/model/ModelTransformer.java | 148 ++++ .../client/model/ModelWireMill.java | 148 ++++ .../client/render/RenderFloatingText.java | 60 ++ .../client/render/RenderHandler.java | 88 +++ .../client/render/RenderInsulatedWire.java | 309 +++++++++ .../client/render/RenderMultimeter.java | 120 ++++ .../client/render/RenderRawWire.java | 73 ++ .../client/render/RenderTransformer.java | 91 +++ .../client/render/RenderWireMill.java | 51 ++ .../electricexpansion/common/CommonProxy.java | 99 +++ .../common/ElectricExpansion.java | 337 +++++++++ .../common/RecipeRegistery.java | 639 ++++++++++++++++++ .../blocks/BlockAdvancedBatteryBox.java | 226 +++++++ .../common/blocks/BlockBasic.java | 64 ++ .../common/blocks/BlockFuseBox.java | 186 +++++ .../common/blocks/BlockInsulatedWire.java | 164 +++++ .../common/blocks/BlockInsulationMachine.java | 179 +++++ .../common/blocks/BlockLogisticsWire.java | 144 ++++ .../common/blocks/BlockMultimeter.java | 163 +++++ .../common/blocks/BlockQuantumBatteryBox.java | 205 ++++++ .../common/blocks/BlockRawWire.java | 105 +++ .../blocks/BlockRedstoneNetworkCore.java | 154 +++++ .../blocks/BlockRedstonePaintedWire.java | 198 ++++++ .../common/blocks/BlockSwitchWire.java | 89 +++ .../common/blocks/BlockSwitchWireBlock.java | 106 +++ .../common/blocks/BlockTransformer.java | 177 +++++ .../common/blocks/BlockWireBlock.java | 119 ++++ .../common/blocks/BlockWireMill.java | 136 ++++ .../cables/TileEntityInsulatedWire.java | 63 ++ .../cables/TileEntityLogisticsWire.java | 148 ++++ .../common/cables/TileEntityRawWire.java | 11 + .../cables/TileEntityRedstonePaintedWire.java | 48 ++ .../common/cables/TileEntitySwitchWire.java | 12 + .../cables/TileEntitySwitchWireBlock.java | 4 + .../common/cables/TileEntityWireBlock.java | 6 + .../containers/ContainerAdvBatteryBox.java | 90 +++ .../containers/ContainerDistribution.java | 46 ++ .../common/containers/ContainerFuseBox.java | 88 +++ .../ContainerInsulationMachine.java | 92 +++ .../common/containers/ContainerWireMill.java | 92 +++ .../containers/SlotUniversalElectricItem.java | 18 + .../common/helpers/ItemBlockCableHelper.java | 70 ++ .../PacketHandlerLogisticsWireButton.java | 26 + ...ndlerUpdateQuantumBatteryBoxFrequency.java | 25 + .../helpers/PacketLogisticsWireButton.java | 37 + ...acketUpdateQuantumBatteryBoxFrequency.java | 33 + .../common/helpers/PlayerHelper.java | 18 + .../helpers/TileEntityConductorBase.java | 249 +++++++ .../itemblocks/ItemBlockInsulatedWire.java | 21 + .../itemblocks/ItemBlockLogisticsWire.java | 21 + .../common/itemblocks/ItemBlockRawWire.java | 27 + .../ItemBlockRedstonePaintedWire.java | 22 + .../itemblocks/ItemBlockSwitchWire.java | 22 + .../itemblocks/ItemBlockSwitchWireBlock.java | 10 + .../itemblocks/ItemBlockTransformer.java | 32 + .../common/itemblocks/ItemBlockWireBlock.java | 10 + .../common/items/ItemAdvancedBattery.java | 31 + .../common/items/ItemEliteBattery.java | 31 + .../common/items/ItemFuse.java | 130 ++++ .../common/items/ItemMultimeter.java | 130 ++++ .../common/items/ItemParts.java | 71 ++ .../common/items/ItemUltimateBattery.java | 31 + .../common/items/ItemUpgrade.java | 217 ++++++ .../common/misc/DistributionNetworks.java | 169 +++++ .../common/misc/EENetwork.java | 356 ++++++++++ .../electricexpansion/common/misc/EETab.java | 37 + .../common/misc/EventHandler.java | 53 ++ .../common/misc/InsulationRecipes.java | 129 ++++ .../common/misc/WireMillRecipes.java | 129 ++++ .../common/nei/EEMachineRecipeHandler.java | 160 +++++ .../nei/InsulatingMachineRecipeHandler.java | 48 ++ .../nei/NEIElextricExpansionConfig.java | 32 + .../common/nei/WireMillRecipeHandler.java | 48 ++ .../tile/TileEntityAdvancedBatteryBox.java | 445 ++++++++++++ .../common/tile/TileEntityFuseBox.java | 180 +++++ .../tile/TileEntityInsulatingMachine.java | 383 +++++++++++ .../common/tile/TileEntityMultimeter.java | 99 +++ .../tile/TileEntityQuantumBatteryBox.java | 355 ++++++++++ .../tile/TileEntityRedstoneNetworkCore.java | 72 ++ .../common/tile/TileEntityTransformer.java | 148 ++++ .../common/tile/TileEntityWireMill.java | 392 +++++++++++ src/main/resources/EELogo.png | Bin 0 -> 13152 bytes .../electricexpansion/lang/en_US.properties | 131 ++++ .../electricexpansion/lang/pl_PL.properties | 83 +++ .../textures/blocks/CamoWire.png | Bin 0 -> 2088 bytes .../blocks/InsulatedWire.Aluminum.png | Bin 0 -> 283 bytes .../textures/blocks/InsulatedWire.Copper.png | Bin 0 -> 239 bytes .../textures/blocks/InsulatedWire.Silver.png | Bin 0 -> 283 bytes .../blocks/InsulatedWire.Superconductor.png | Bin 0 -> 280 bytes .../textures/blocks/InsulatedWire.Tin.png | Bin 0 -> 239 bytes .../textures/blocks/LeadBlock.png | Bin 0 -> 546 bytes .../blocks/LogisticsWire.Aluminum.png | Bin 0 -> 292 bytes .../textures/blocks/LogisticsWire.Copper.png | Bin 0 -> 264 bytes .../textures/blocks/LogisticsWire.Silver.png | Bin 0 -> 251 bytes .../blocks/LogisticsWire.Superconductor.png | Bin 0 -> 256 bytes .../textures/blocks/LogisticsWire.Tin.png | Bin 0 -> 262 bytes .../textures/blocks/RawWire.Aluminum.png | Bin 0 -> 269 bytes .../textures/blocks/RawWire.Copper.png | Bin 0 -> 224 bytes .../textures/blocks/RawWire.Silver.png | Bin 0 -> 269 bytes .../blocks/RawWire.Superconductor.png | Bin 0 -> 225 bytes .../textures/blocks/RawWire.Tin.png | Bin 0 -> 224 bytes .../blocks/RedstonePaintedWire.Aluminum.png | Bin 0 -> 341 bytes .../blocks/RedstonePaintedWire.Copper.png | Bin 0 -> 342 bytes .../blocks/RedstonePaintedWire.Silver.png | Bin 0 -> 344 bytes .../RedstonePaintedWire.Superconductor.png | Bin 0 -> 343 bytes .../blocks/RedstonePaintedWire.Tin.png | Bin 0 -> 343 bytes .../textures/blocks/SilverOre.png | Bin 0 -> 592 bytes .../textures/blocks/SwitchWire.Aluminum.png | Bin 0 -> 293 bytes .../textures/blocks/SwitchWire.Copper.png | Bin 0 -> 265 bytes .../textures/blocks/SwitchWire.Silver.png | Bin 0 -> 293 bytes .../blocks/SwitchWire.Superconductor.png | Bin 0 -> 304 bytes .../textures/blocks/SwitchWire.Tin.png | Bin 0 -> 304 bytes .../textures/blocks/batBoxT1.png | Bin 0 -> 2117 bytes .../textures/blocks/batBoxT2.png | Bin 0 -> 2132 bytes .../textures/blocks/batBoxT3.png | Bin 0 -> 2138 bytes .../textures/blocks/batBoxT4.png | Bin 0 -> 2046 bytes .../textures/blocks/darkMachine.png | Bin 0 -> 1418 bytes .../textures/blocks/darkMachineInput.png | Bin 0 -> 1636 bytes .../textures/blocks/darkMachineOutput.png | Bin 0 -> 1617 bytes .../textures/blocks/darkMachineTop.png | Bin 0 -> 1530 bytes .../textures/blocks/insulatorFront.png | Bin 0 -> 2092 bytes .../textures/blocks/insulatorTop.png | Bin 0 -> 2405 bytes .../textures/blocks/machine.png | Bin 0 -> 1794 bytes .../textures/blocks/machineInput.png | Bin 0 -> 2010 bytes .../textures/blocks/machineOutput.png | Bin 0 -> 1966 bytes .../textures/blocks/machineTop.png | Bin 0 -> 1939 bytes .../textures/blocks/multimeter.png | Bin 0 -> 2138 bytes .../textures/blocks/rsMachine.png | Bin 0 -> 1425 bytes .../textures/blocks/rsMachineOutput.png | Bin 0 -> 1480 bytes .../textures/gui/GuiBatBox.png | Bin 0 -> 2548 bytes .../textures/gui/GuiEEMachine.png | Bin 0 -> 2376 bytes .../textures/gui/GuiFuseBox.png | Bin 0 -> 1845 bytes .../textures/gui/GuiLogistics.png | Bin 0 -> 1940 bytes .../electricexpansion/textures/gui/GuiWPT.png | Bin 0 -> 2006 bytes .../textures/gui/SwitchButton.png | Bin 0 -> 2534 bytes .../textures/items/AdvancedBattery.png | Bin 0 -> 1274 bytes .../textures/items/CamoPaste.png | Bin 0 -> 171 bytes .../electricexpansion/textures/items/Coil.png | Bin 0 -> 1273 bytes .../textures/items/CondensedElectrumDust.png | Bin 0 -> 608 bytes .../textures/items/DoubleVoltage.png | Bin 0 -> 318 bytes .../textures/items/DrawPlates.png | Bin 0 -> 1797 bytes .../textures/items/ElectrumIngot.png | Bin 0 -> 443 bytes .../textures/items/EliteBattery.png | Bin 0 -> 1244 bytes .../textures/items/HVAlloyIngot.png | Bin 0 -> 435 bytes .../textures/items/HVInputUpgrade.png | Bin 0 -> 284 bytes .../textures/items/HVUpgrade.png | Bin 0 -> 316 bytes .../textures/items/HalfVoltage.png | Bin 0 -> 283 bytes .../textures/items/Insulation.png | Bin 0 -> 843 bytes .../textures/items/LeadIngot.png | Bin 0 -> 373 bytes .../textures/items/Multimeter.png | Bin 0 -> 952 bytes .../textures/items/RawHVAlloy.png | Bin 0 -> 527 bytes .../textures/items/SilverIngot.png | Bin 0 -> 373 bytes .../textures/items/Storage1.png | Bin 0 -> 1068 bytes .../textures/items/Storage2.png | Bin 0 -> 1047 bytes .../textures/items/Storage3.png | Bin 0 -> 984 bytes .../textures/items/Storage4.png | Bin 0 -> 1007 bytes .../textures/items/UltimateBattery.png | Bin 0 -> 1146 bytes .../textures/items/Unlimiter1.png | Bin 0 -> 1915 bytes .../textures/items/Unlimiter2.png | Bin 0 -> 1939 bytes .../textures/items/Unlimiter3.png | Bin 0 -> 1976 bytes .../textures/items/Unlimiter4.png | Bin 0 -> 1813 bytes .../textures/models/CopperLogisticsWire.png | Bin 0 -> 1023 bytes .../textures/models/CopperRSWire.png | Bin 0 -> 877 bytes .../textures/models/CopperSwitchWireOff.png | Bin 0 -> 961 bytes .../textures/models/CopperSwitchWireOn.png | Bin 0 -> 962 bytes .../textures/models/HVLogisticsWire.png | Bin 0 -> 964 bytes .../textures/models/HVRSWire.png | Bin 0 -> 931 bytes .../textures/models/HVSwitchWireOff.png | Bin 0 -> 964 bytes .../textures/models/HVSwitchWireOn.png | Bin 0 -> 949 bytes .../textures/models/InsulatedCopperWire.png | Bin 0 -> 851 bytes .../textures/models/InsulatedHVWire.png | Bin 0 -> 806 bytes .../textures/models/InsulatedSCWire.png | Bin 0 -> 820 bytes .../textures/models/InsulatedSilverWire.png | Bin 0 -> 804 bytes .../textures/models/InsulatedTinWire.png | Bin 0 -> 818 bytes .../textures/models/RawCopperWire.png | Bin 0 -> 392 bytes .../textures/models/RawHVWire.png | Bin 0 -> 390 bytes .../textures/models/RawSCWire.png | Bin 0 -> 393 bytes .../textures/models/RawSilverWire.png | Bin 0 -> 392 bytes .../textures/models/RawTinWire.png | Bin 0 -> 391 bytes .../textures/models/SCLogisticsWire.png | Bin 0 -> 988 bytes .../textures/models/SCRSWire.png | Bin 0 -> 973 bytes .../textures/models/SCSwitchWireOff.png | Bin 0 -> 965 bytes .../textures/models/SCSwitchWireOn.png | Bin 0 -> 961 bytes .../textures/models/SilverLogisticsWire.png | Bin 0 -> 985 bytes .../textures/models/SilverRSWire.png | Bin 0 -> 939 bytes .../textures/models/SilverSwitchWireOff.png | Bin 0 -> 959 bytes .../textures/models/SilverSwitchWireOn.png | Bin 0 -> 958 bytes .../textures/models/TinLogisticsWire.png | Bin 0 -> 983 bytes .../textures/models/TinRSWire.png | Bin 0 -> 956 bytes .../textures/models/TinSwitchWireOff.png | Bin 0 -> 1047 bytes .../textures/models/TinSwitchWireOn.png | Bin 0 -> 958 bytes .../textures/models/WirePaintOverlay.png | Bin 0 -> 528 bytes .../textures/models/transformer1.png | Bin 0 -> 1443 bytes .../textures/models/transformer2.png | Bin 0 -> 1435 bytes .../textures/models/transformer3.png | Bin 0 -> 1479 bytes .../textures/models/wiremill.png | Bin 0 -> 2658 bytes 247 files changed, 12595 insertions(+), 3 deletions(-) mode change 100644 => 100755 gradlew create mode 100755 src/main/java/dan200/computercraft/api/ComputerCraftAPI.java create mode 100755 src/main/java/dan200/computercraft/api/filesystem/IMount.java create mode 100755 src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java create mode 100755 src/main/java/dan200/computercraft/api/filesystem/package-info.java create mode 100755 src/main/java/dan200/computercraft/api/lua/ILuaContext.java create mode 100755 src/main/java/dan200/computercraft/api/lua/ILuaObject.java create mode 100755 src/main/java/dan200/computercraft/api/lua/ILuaTask.java create mode 100755 src/main/java/dan200/computercraft/api/lua/LuaException.java create mode 100755 src/main/java/dan200/computercraft/api/lua/package-info.java create mode 100755 src/main/java/dan200/computercraft/api/media/IMedia.java create mode 100755 src/main/java/dan200/computercraft/api/media/IMediaProvider.java create mode 100755 src/main/java/dan200/computercraft/api/media/package-info.java create mode 100755 src/main/java/dan200/computercraft/api/package-info.java create mode 100755 src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java create mode 100755 src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java create mode 100755 src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java create mode 100755 src/main/java/dan200/computercraft/api/peripheral/package-info.java create mode 100644 src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java create mode 100644 src/main/java/dan200/computercraft/api/permissions/package-info.java create mode 100755 src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java create mode 100755 src/main/java/dan200/computercraft/api/redstone/package-info.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/TurtleAnimation.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/TurtleSide.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/TurtleUpgradeType.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/TurtleVerb.java create mode 100755 src/main/java/dan200/computercraft/api/turtle/package-info.java create mode 100644 src/main/java/electricexpansion/api/ElectricExpansionItems.java create mode 100644 src/main/java/electricexpansion/api/EnumWireMaterial.java create mode 100644 src/main/java/electricexpansion/api/EnumWireType.java create mode 100644 src/main/java/electricexpansion/api/IAdvancedConductor.java create mode 100644 src/main/java/electricexpansion/api/IItemFuse.java create mode 100644 src/main/java/electricexpansion/api/IRedstoneNetAccessor.java create mode 100644 src/main/java/electricexpansion/api/IWirelessPowerMachine.java create mode 100644 src/main/java/electricexpansion/api/Recipes.java create mode 100644 src/main/java/electricexpansion/client/ClientProxy.java create mode 100644 src/main/java/electricexpansion/client/gui/GuiAdvancedBatteryBox.java create mode 100644 src/main/java/electricexpansion/client/gui/GuiFuseBox.java create mode 100644 src/main/java/electricexpansion/client/gui/GuiInsulationMachine.java create mode 100644 src/main/java/electricexpansion/client/gui/GuiLogisticsWire.java create mode 100644 src/main/java/electricexpansion/client/gui/GuiQuantumBatteryBox.java create mode 100644 src/main/java/electricexpansion/client/gui/GuiSwitchButton.java create mode 100644 src/main/java/electricexpansion/client/gui/GuiWireMill.java create mode 100644 src/main/java/electricexpansion/client/model/ModelInsulatedWire.java create mode 100644 src/main/java/electricexpansion/client/model/ModelRawWire.java create mode 100644 src/main/java/electricexpansion/client/model/ModelTransformer.java create mode 100644 src/main/java/electricexpansion/client/model/ModelWireMill.java create mode 100644 src/main/java/electricexpansion/client/render/RenderFloatingText.java create mode 100644 src/main/java/electricexpansion/client/render/RenderHandler.java create mode 100644 src/main/java/electricexpansion/client/render/RenderInsulatedWire.java create mode 100644 src/main/java/electricexpansion/client/render/RenderMultimeter.java create mode 100644 src/main/java/electricexpansion/client/render/RenderRawWire.java create mode 100644 src/main/java/electricexpansion/client/render/RenderTransformer.java create mode 100644 src/main/java/electricexpansion/client/render/RenderWireMill.java create mode 100644 src/main/java/electricexpansion/common/CommonProxy.java create mode 100644 src/main/java/electricexpansion/common/ElectricExpansion.java create mode 100644 src/main/java/electricexpansion/common/RecipeRegistery.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockAdvancedBatteryBox.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockBasic.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockFuseBox.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockInsulatedWire.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockInsulationMachine.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockLogisticsWire.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockMultimeter.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockQuantumBatteryBox.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockRawWire.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockRedstoneNetworkCore.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockRedstonePaintedWire.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockSwitchWire.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockSwitchWireBlock.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockTransformer.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockWireBlock.java create mode 100644 src/main/java/electricexpansion/common/blocks/BlockWireMill.java create mode 100644 src/main/java/electricexpansion/common/cables/TileEntityInsulatedWire.java create mode 100644 src/main/java/electricexpansion/common/cables/TileEntityLogisticsWire.java create mode 100644 src/main/java/electricexpansion/common/cables/TileEntityRawWire.java create mode 100644 src/main/java/electricexpansion/common/cables/TileEntityRedstonePaintedWire.java create mode 100644 src/main/java/electricexpansion/common/cables/TileEntitySwitchWire.java create mode 100644 src/main/java/electricexpansion/common/cables/TileEntitySwitchWireBlock.java create mode 100644 src/main/java/electricexpansion/common/cables/TileEntityWireBlock.java create mode 100644 src/main/java/electricexpansion/common/containers/ContainerAdvBatteryBox.java create mode 100644 src/main/java/electricexpansion/common/containers/ContainerDistribution.java create mode 100644 src/main/java/electricexpansion/common/containers/ContainerFuseBox.java create mode 100644 src/main/java/electricexpansion/common/containers/ContainerInsulationMachine.java create mode 100644 src/main/java/electricexpansion/common/containers/ContainerWireMill.java create mode 100644 src/main/java/electricexpansion/common/containers/SlotUniversalElectricItem.java create mode 100644 src/main/java/electricexpansion/common/helpers/ItemBlockCableHelper.java create mode 100644 src/main/java/electricexpansion/common/helpers/PacketHandlerLogisticsWireButton.java create mode 100644 src/main/java/electricexpansion/common/helpers/PacketHandlerUpdateQuantumBatteryBoxFrequency.java create mode 100644 src/main/java/electricexpansion/common/helpers/PacketLogisticsWireButton.java create mode 100644 src/main/java/electricexpansion/common/helpers/PacketUpdateQuantumBatteryBoxFrequency.java create mode 100644 src/main/java/electricexpansion/common/helpers/PlayerHelper.java create mode 100644 src/main/java/electricexpansion/common/helpers/TileEntityConductorBase.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockInsulatedWire.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockLogisticsWire.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockRawWire.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockRedstonePaintedWire.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWire.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWireBlock.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockTransformer.java create mode 100644 src/main/java/electricexpansion/common/itemblocks/ItemBlockWireBlock.java create mode 100644 src/main/java/electricexpansion/common/items/ItemAdvancedBattery.java create mode 100644 src/main/java/electricexpansion/common/items/ItemEliteBattery.java create mode 100644 src/main/java/electricexpansion/common/items/ItemFuse.java create mode 100644 src/main/java/electricexpansion/common/items/ItemMultimeter.java create mode 100644 src/main/java/electricexpansion/common/items/ItemParts.java create mode 100644 src/main/java/electricexpansion/common/items/ItemUltimateBattery.java create mode 100644 src/main/java/electricexpansion/common/items/ItemUpgrade.java create mode 100644 src/main/java/electricexpansion/common/misc/DistributionNetworks.java create mode 100644 src/main/java/electricexpansion/common/misc/EENetwork.java create mode 100644 src/main/java/electricexpansion/common/misc/EETab.java create mode 100644 src/main/java/electricexpansion/common/misc/EventHandler.java create mode 100644 src/main/java/electricexpansion/common/misc/InsulationRecipes.java create mode 100644 src/main/java/electricexpansion/common/misc/WireMillRecipes.java create mode 100644 src/main/java/electricexpansion/common/nei/EEMachineRecipeHandler.java create mode 100644 src/main/java/electricexpansion/common/nei/InsulatingMachineRecipeHandler.java create mode 100644 src/main/java/electricexpansion/common/nei/NEIElextricExpansionConfig.java create mode 100644 src/main/java/electricexpansion/common/nei/WireMillRecipeHandler.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityAdvancedBatteryBox.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityFuseBox.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityInsulatingMachine.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityMultimeter.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityQuantumBatteryBox.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityRedstoneNetworkCore.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityTransformer.java create mode 100644 src/main/java/electricexpansion/common/tile/TileEntityWireMill.java create mode 100644 src/main/resources/EELogo.png create mode 100644 src/main/resources/assets/electricexpansion/lang/en_US.properties create mode 100644 src/main/resources/assets/electricexpansion/lang/pl_PL.properties create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/CamoWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Aluminum.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Copper.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Silver.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Superconductor.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Tin.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/LeadBlock.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Aluminum.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Copper.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Silver.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Superconductor.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Tin.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Aluminum.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Copper.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Silver.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Superconductor.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Tin.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Aluminum.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Copper.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Silver.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Superconductor.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Tin.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/SilverOre.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Aluminum.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Copper.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Silver.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Superconductor.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Tin.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/batBoxT1.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/batBoxT2.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/batBoxT3.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/batBoxT4.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/darkMachine.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/darkMachineInput.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/darkMachineOutput.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/darkMachineTop.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/insulatorFront.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/insulatorTop.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/machine.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/machineInput.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/machineOutput.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/machineTop.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/multimeter.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/rsMachine.png create mode 100644 src/main/resources/assets/electricexpansion/textures/blocks/rsMachineOutput.png create mode 100644 src/main/resources/assets/electricexpansion/textures/gui/GuiBatBox.png create mode 100644 src/main/resources/assets/electricexpansion/textures/gui/GuiEEMachine.png create mode 100644 src/main/resources/assets/electricexpansion/textures/gui/GuiFuseBox.png create mode 100644 src/main/resources/assets/electricexpansion/textures/gui/GuiLogistics.png create mode 100644 src/main/resources/assets/electricexpansion/textures/gui/GuiWPT.png create mode 100644 src/main/resources/assets/electricexpansion/textures/gui/SwitchButton.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/AdvancedBattery.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/CamoPaste.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Coil.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/CondensedElectrumDust.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/DoubleVoltage.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/DrawPlates.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/ElectrumIngot.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/EliteBattery.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/HVAlloyIngot.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/HVInputUpgrade.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/HVUpgrade.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/HalfVoltage.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Insulation.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/LeadIngot.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Multimeter.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/RawHVAlloy.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/SilverIngot.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Storage1.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Storage2.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Storage3.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Storage4.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/UltimateBattery.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Unlimiter1.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Unlimiter2.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Unlimiter3.png create mode 100644 src/main/resources/assets/electricexpansion/textures/items/Unlimiter4.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/CopperLogisticsWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/CopperRSWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/CopperSwitchWireOff.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/CopperSwitchWireOn.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/HVLogisticsWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/HVRSWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/HVSwitchWireOff.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/HVSwitchWireOn.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/InsulatedCopperWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/InsulatedHVWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/InsulatedSCWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/InsulatedSilverWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/InsulatedTinWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/RawCopperWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/RawHVWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/RawSCWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/RawSilverWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/RawTinWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SCLogisticsWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SCRSWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SCSwitchWireOff.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SCSwitchWireOn.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SilverLogisticsWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SilverRSWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SilverSwitchWireOff.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/SilverSwitchWireOn.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/TinLogisticsWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/TinRSWire.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/TinSwitchWireOff.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/TinSwitchWireOn.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/WirePaintOverlay.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/transformer1.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/transformer2.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/transformer3.png create mode 100644 src/main/resources/assets/electricexpansion/textures/models/wiremill.png diff --git a/.gitignore b/.gitignore index 8d16946..bbc8ac8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +.project +.classpath +bin +.settings .gradle .idea build diff --git a/build.gradle b/build.gradle index 7c2d31b..4cd3db9 100644 --- a/build.gradle +++ b/build.gradle @@ -17,17 +17,36 @@ buildscript { apply plugin: 'forge' +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 + +sourceSets { + api {} +} + version = "1.0" -group= "modgroup" -archivesBaseName = "modid" +group = "universalelectricity" +archivesBaseName = "electricexpansion" minecraft { version = "1.7.10-10.13.4.1614-1.7.10" runDir = "run" } -dependencies { +repositories { + maven { url = "https://maven.tilera.xyz" } + maven { + name 'central' + url 'https://maven.thorfusion.com/artifactory/central/' + } +} + +dependencies { + compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev" + compile "codechicken:CodeChickenCore:1.7.10-1.0.7.48:dev" + compile "codechicken:CodeChickenLib:1.7.10-1.1.3.141:dev" + compile "universalelectricity:basiccomponents:1.0.2-dirty:deobf" } processResources diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java new file mode 100755 index 0000000..4f84caa --- /dev/null +++ b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java @@ -0,0 +1,315 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api; + +import dan200.computercraft.api.filesystem.IMount; +import dan200.computercraft.api.filesystem.IWritableMount; +import dan200.computercraft.api.media.IMediaProvider; +import dan200.computercraft.api.peripheral.IPeripheralProvider; +import dan200.computercraft.api.permissions.ITurtlePermissionProvider; +import dan200.computercraft.api.redstone.IBundledRedstoneProvider; +import dan200.computercraft.api.turtle.ITurtleUpgrade; +import net.minecraft.world.World; + +import java.lang.reflect.Method; + +/** + * The static entry point to the ComputerCraft API. + * Members in this class must be called after mod_ComputerCraft has been initialised, + * but may be called before it is fully loaded. + */ +public final class ComputerCraftAPI +{ + public static boolean isInstalled() + { + findCC(); + return computerCraft != null; + } + + public static String getInstalledVersion() + { + findCC(); + if( computerCraft_getVersion != null ) + { + try { + return (String)computerCraft_getVersion.invoke( null ); + } catch (Exception e) { + // It failed + } + } + return ""; + } + + public static String getAPIVersion() + { + return "1.75"; + } + + /** + * Creates a numbered directory in a subfolder of the save directory for a given world, and returns that number.
+ * Use in conjuction with createSaveDirMount() to create a unique place for your peripherals or media items to store files.
+ * @param world The world for which the save dir should be created. This should be the serverside world object. + * @param parentSubPath The folder path within the save directory where the new directory should be created. eg: "computercraft/disk" + * @return The numerical value of the name of the new folder, or -1 if the folder could not be created for some reason.
+ * eg: if createUniqueNumberedSaveDir( world, "computer/disk" ) was called returns 42, then "computer/disk/42" is now available for writing. + * @see #createSaveDirMount(World, String, long) + */ + public static int createUniqueNumberedSaveDir( World world, String parentSubPath ) + { + findCC(); + if( computerCraft_createUniqueNumberedSaveDir != null ) + { + try { + return (Integer)computerCraft_createUniqueNumberedSaveDir.invoke( null, world, parentSubPath ); + } catch (Exception e) { + // It failed + } + } + return -1; + } + + /** + * Creates a file system mount that maps to a subfolder of the save directory for a given world, and returns it.
+ * Use in conjuction with IComputerAccess.mount() or IComputerAccess.mountWritable() to mount a folder from the + * users save directory onto a computers file system.
+ * @param world The world for which the save dir can be found. This should be the serverside world object. + * @param subPath The folder path within the save directory that the mount should map to. eg: "computer/disk/42".
+ * Use createUniqueNumberedSaveDir() to create a new numbered folder to use. + * @param capacity The ammount of data that can be stored in the directory before it fills up, in bytes. + * @return The mount, or null if it could be created for some reason. Use IComputerAccess.mount() or IComputerAccess.mountWritable() + * to mount this on a Computers' file system. + * @see #createUniqueNumberedSaveDir(World, String) + * @see dan200.computercraft.api.peripheral.IComputerAccess#mount(String, dan200.computercraft.api.filesystem.IMount) + * @see dan200.computercraft.api.peripheral.IComputerAccess#mountWritable(String, dan200.computercraft.api.filesystem.IWritableMount) + * @see dan200.computercraft.api.filesystem.IMount + * @see IWritableMount + */ + public static IWritableMount createSaveDirMount( World world, String subPath, long capacity ) + { + findCC(); + if( computerCraft_createSaveDirMount != null ) + { + try { + return (IWritableMount)computerCraft_createSaveDirMount.invoke( null, world, subPath, capacity ); + } catch (Exception e){ + // It failed + } + } + return null; + } + + /** + * Creates a file system mount to a resource folder, and returns it.
+ * Use in conjuction with IComputerAccess.mount() or IComputerAccess.mountWritable() to mount a resource folder onto a computers file system.
+ * The files in this mount will be a combination of files in the specified mod jar, and resource packs that contain resources with the same domain and path.
+ * @param modClass A class in whose jar to look first for the resources to mount. Using your main mod class is recommended. eg: MyMod.class + * @param domain The domain under which to look for resources. eg: "mymod" + * @param subPath The domain under which to look for resources. eg: "mymod/lua/myfiles" + * @return The mount, or null if it could be created for some reason. Use IComputerAccess.mount() or IComputerAccess.mountWritable() + * to mount this on a Computers' file system. + * @see dan200.computercraft.api.peripheral.IComputerAccess#mount(String, dan200.computercraft.api.filesystem.IMount) + * @see dan200.computercraft.api.peripheral.IComputerAccess#mountWritable(String, IWritableMount) + * @see dan200.computercraft.api.filesystem.IMount + */ + public static IMount createResourceMount( Class modClass, String domain, String subPath ) + { + findCC(); + if( computerCraft_createResourceMount != null ) + { + try { + return (IMount)computerCraft_createResourceMount.invoke( null, modClass, domain, subPath ); + } catch (Exception e){ + // It failed + } + } + return null; + } + + /** + * Registers a peripheral handler to convert blocks into IPeripheral implementations. + * @see dan200.computercraft.api.peripheral.IPeripheral + * @see dan200.computercraft.api.peripheral.IPeripheralProvider + */ + public static void registerPeripheralProvider( IPeripheralProvider handler ) + { + findCC(); + if ( computerCraft_registerPeripheralProvider != null) + { + try { + computerCraft_registerPeripheralProvider.invoke( null, handler ); + } catch (Exception e){ + // It failed + } + } + } + + /** + * Registers a new turtle turtle for use in ComputerCraft. After calling this, + * users should be able to craft Turtles with your new turtle. It is recommended to call + * this during the load() method of your mod. + * @see dan200.computercraft.api.turtle.ITurtleUpgrade + */ + public static void registerTurtleUpgrade( ITurtleUpgrade upgrade ) + { + if( upgrade != null ) + { + findCC(); + if( computerCraft_registerTurtleUpgrade != null ) + { + try { + computerCraft_registerTurtleUpgrade.invoke( null, upgrade ); + } catch( Exception e ) { + // It failed + } + } + } + } + + /** + * Registers a bundled redstone handler to provide bundled redstone output for blocks + * @see dan200.computercraft.api.redstone.IBundledRedstoneProvider + */ + public static void registerBundledRedstoneProvider( IBundledRedstoneProvider handler ) + { + findCC(); + if( computerCraft_registerBundledRedstoneProvider != null ) + { + try { + computerCraft_registerBundledRedstoneProvider.invoke( null, handler ); + } catch (Exception e) { + // It failed + } + } + } + + /** + * If there is a Computer or Turtle at a certain position in the world, get it's bundled redstone output. + * @see dan200.computercraft.api.redstone.IBundledRedstoneProvider + * @return If there is a block capable of emitting bundled redstone at the location, it's signal (0-65535) will be returned. + * If there is no block capable of emitting bundled redstone at the location, -1 will be returned. + */ + public static int getBundledRedstoneOutput( World world, int x, int y, int z, int side ) + { + findCC(); + if( computerCraft_getDefaultBundledRedstoneOutput != null ) + { + try { + return (Integer)computerCraft_getDefaultBundledRedstoneOutput.invoke( null, world, x, y, z, side ); + } catch (Exception e){ + // It failed + } + } + return -1; + } + + /** + * Registers a media handler to provide IMedia implementations for Items + * @see dan200.computercraft.api.media.IMediaProvider + */ + public static void registerMediaProvider( IMediaProvider handler ) + { + findCC(); + if( computerCraft_registerMediaProvider != null ) + { + try { + computerCraft_registerMediaProvider.invoke( null, handler ); + } catch (Exception e){ + // It failed + } + } + } + + /** + * Registers a permission handler to restrict where turtles can move or build + * @see dan200.computercraft.api.permissions.ITurtlePermissionProvider + */ + public static void registerPermissionProvider( ITurtlePermissionProvider handler ) + { + findCC(); + if( computerCraft_registerPermissionProvider != null ) + { + try { + computerCraft_registerPermissionProvider.invoke( null, handler ); + } catch (Exception e) { + // It failed + } + } + } + + // The functions below here are private, and are used to interface with the non-API ComputerCraft classes. + // Reflection is used here so you can develop your mod without decompiling ComputerCraft and including + // it in your solution, and so your mod won't crash if ComputerCraft is installed. + + private static void findCC() + { + if( !ccSearched ) { + try { + computerCraft = Class.forName( "dan200.computercraft.ComputerCraft" ); + computerCraft_getVersion = findCCMethod( "getVersion", new Class[]{ + } ); + computerCraft_createUniqueNumberedSaveDir = findCCMethod( "createUniqueNumberedSaveDir", new Class[]{ + World.class, String.class + } ); + computerCraft_createSaveDirMount = findCCMethod( "createSaveDirMount", new Class[] { + World.class, String.class, Long.TYPE + } ); + computerCraft_createResourceMount = findCCMethod( "createResourceMount", new Class[] { + Class.class, String.class, String.class + } ); + computerCraft_registerPeripheralProvider = findCCMethod( "registerPeripheralProvider", new Class[] { + IPeripheralProvider.class + } ); + computerCraft_registerTurtleUpgrade = findCCMethod( "registerTurtleUpgrade", new Class[] { + ITurtleUpgrade.class + } ); + computerCraft_registerBundledRedstoneProvider = findCCMethod( "registerBundledRedstoneProvider", new Class[] { + IBundledRedstoneProvider.class + } ); + computerCraft_getDefaultBundledRedstoneOutput = findCCMethod( "getDefaultBundledRedstoneOutput", new Class[] { + World.class, Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE + } ); + computerCraft_registerMediaProvider = findCCMethod( "registerMediaProvider", new Class[] { + IMediaProvider.class + } ); + computerCraft_registerPermissionProvider = findCCMethod( "registerPermissionProvider", new Class[] { + ITurtlePermissionProvider.class + } ); + } catch( Exception e ) { + System.out.println( "ComputerCraftAPI: ComputerCraft not found." ); + } finally { + ccSearched = true; + } + } + } + + private static Method findCCMethod( String name, Class[] args ) + { + try { + if( computerCraft != null ) + { + return computerCraft.getMethod( name, args ); + } + return null; + } catch( NoSuchMethodException e ) { + System.out.println( "ComputerCraftAPI: ComputerCraft method " + name + " not found." ); + return null; + } + } + + private static boolean ccSearched = false; + private static Class computerCraft = null; + private static Method computerCraft_getVersion = null; + private static Method computerCraft_createUniqueNumberedSaveDir = null; + private static Method computerCraft_createSaveDirMount = null; + private static Method computerCraft_createResourceMount = null; + private static Method computerCraft_registerPeripheralProvider = null; + private static Method computerCraft_registerTurtleUpgrade = null; + private static Method computerCraft_registerBundledRedstoneProvider = null; + private static Method computerCraft_getDefaultBundledRedstoneOutput = null; + private static Method computerCraft_registerMediaProvider = null; + private static Method computerCraft_registerPermissionProvider = null; +} diff --git a/src/main/java/dan200/computercraft/api/filesystem/IMount.java b/src/main/java/dan200/computercraft/api/filesystem/IMount.java new file mode 100755 index 0000000..cf884d9 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/filesystem/IMount.java @@ -0,0 +1,57 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.filesystem; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +/** + * Represents a read only part of a virtual filesystem that can be mounted onto a computercraft using IComputerAccess.mount(). + * Ready made implementations of this interface can be created using ComputerCraftAPI.createSaveDirMount() or ComputerCraftAPI.createResourceMount(), or you're free to implement it yourselves! + * @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String) + * @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String) + * @see dan200.computercraft.api.peripheral.IComputerAccess#mount(String, IMount) + * @see IWritableMount + */ +public interface IMount +{ + /** + * Returns whether a file with a given path exists or not. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram" + * @return true if the file exists, false otherwise + */ + public boolean exists( String path ) throws IOException; + + /** + * Returns whether a file with a given path is a directory or not. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myprograms" + * @return true if the file exists and is a directory, false otherwise + */ + public boolean isDirectory( String path ) throws IOException; + + /** + * Returns the file names of all the files in a directory. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myprograms" + * @param contents A list of strings. Add all the file names to this list + */ + public void list( String path, List contents ) throws IOException; + + /** + * Returns the size of a file with a given path, in bytes + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram" + * @return the size of the file, in bytes + */ + public long getSize( String path ) throws IOException; + + /** + * Opens a file with a given path, and returns an inputstream representing it's contents. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram" + * @return a stream representing the contents of the file + */ + public InputStream openForRead( String path ) throws IOException; +} diff --git a/src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java b/src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java new file mode 100755 index 0000000..ffe3290 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/filesystem/IWritableMount.java @@ -0,0 +1,52 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.filesystem; + +import java.io.IOException; +import java.io.OutputStream; + +/** + * Represents a part of a virtual filesystem that can be mounted onto a computercraft using IComputerAccess.mount() or IComputerAccess.mountWritable(), that can also be written to. + * Ready made implementations of this interface can be created using ComputerCraftAPI.createSaveDirMount(), or you're free to implement it yourselves! + * @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String) + * @see dan200.computercraft.api.peripheral.IComputerAccess#mountWritable(String, dan200.computercraft.api.filesystem.IMount) + * @see dan200.computercraft.api.filesystem.IMount + */ +public interface IWritableMount extends IMount +{ + /** + * Creates a directory at a given path inside the virtual file system. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/mynewprograms" + */ + public void makeDirectory( String path ) throws IOException; + + /** + * Deletes a directory at a given path inside the virtual file system. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myoldprograms" + */ + public void delete( String path ) throws IOException; + + /** + * Opens a file with a given path, and returns an outputstream for writing to it. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram" + * @return a stream for writing to + */ + public OutputStream openForWrite( String path ) throws IOException; + + /** + * Opens a file with a given path, and returns an outputstream for appending to it. + * @param path A file path in normalised format, relative to the mount location. ie: "programs/myprogram" + * @return a stream for writing to + */ + public OutputStream openForAppend( String path ) throws IOException; + + /** + * Get the ammount of free space on the mount, in bytes. You should decrease this value as the user writes to the mount, and write operations should fail once it reaches zero. + * @return The ammount of free space, in bytes. + */ + public long getRemainingSpace() throws IOException; +} diff --git a/src/main/java/dan200/computercraft/api/filesystem/package-info.java b/src/main/java/dan200/computercraft/api/filesystem/package-info.java new file mode 100755 index 0000000..d7a2d59 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/filesystem/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API|FileSystem", apiVersion="1.75" ) +package dan200.computercraft.api.filesystem; + +import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/dan200/computercraft/api/lua/ILuaContext.java b/src/main/java/dan200/computercraft/api/lua/ILuaContext.java new file mode 100755 index 0000000..1ffbeea --- /dev/null +++ b/src/main/java/dan200/computercraft/api/lua/ILuaContext.java @@ -0,0 +1,58 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.lua; + +/** + * An interface passed to peripherals and ILuaObjects' by computers or turtles, providing methods + * that allow the peripheral call to wait for events before returning, just like in lua. + * This is very useful if you need to signal work to be performed on the main thread, and don't want to return + * until the work has been completed. + */ +public interface ILuaContext +{ + /** + * Wait for an event to occur on the computercraft, suspending the thread until it arises. This method is exactly equivalent to os.pullEvent() in lua. + * @param filter A specific event to wait for, or null to wait for any event + * @return An object array containing the name of the event that occurred, and any event parameters + * @throws Exception If the user presses CTRL+T to terminate the current program while pullEvent() is waiting for an event, a "Terminated" exception will be thrown here. + * Do not attempt to common this exception, unless you wish to prevent termination, which is not recommended. + * @throws InterruptedException If the user shuts down or reboots the computercraft while pullEvent() is waiting for an event, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state. + */ + public Object[] pullEvent( String filter ) throws LuaException, InterruptedException; + + /** + * The same as pullEvent(), except "terminated" events are ignored. Only use this if you want to prevent program termination, which is not recommended. This method is exactly equivalent to os.pullEventRaw() in lua. + * @param filter A specific event to wait for, or null to wait for any event + * @return An object array containing the name of the event that occurred, and any event parameters + * @throws InterruptedException If the user shuts down or reboots the computercraft while pullEventRaw() is waiting for an event, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state. + * @see #pullEvent(String) + */ + public Object[] pullEventRaw( String filter ) throws InterruptedException; + + /** + * Yield the current coroutine with some arguments until it is resumed. This method is exactly equivalent to coroutine.yield() in lua. Use pullEvent() if you wish to wait for events. + * @param arguments An object array containing the arguments to pass to coroutine.yield() + * @return An object array containing the return values from coroutine.yield() + * @throws InterruptedException If the user shuts down or reboots the computercraft the coroutine is suspended, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state. + * @see #pullEvent(String) + */ + public Object[] yield( Object[] arguments ) throws InterruptedException; + + /** + * TODO: Document me + * @param task + * @return + */ + public Object[] executeMainThreadTask( ILuaTask task ) throws LuaException, InterruptedException; + + /** + * TODO: Document me + * @param task + * @return + */ + public long issueMainThreadTask( ILuaTask task ) throws LuaException; +} diff --git a/src/main/java/dan200/computercraft/api/lua/ILuaObject.java b/src/main/java/dan200/computercraft/api/lua/ILuaObject.java new file mode 100755 index 0000000..abd8b40 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/lua/ILuaObject.java @@ -0,0 +1,26 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.lua; + +/** + * An interface for representing custom objects returned by IPeripheral.callMethod() calls. + * Return objects implementing this interface to expose objects with methods to lua. + */ +public interface ILuaObject +{ + /** + * Get the names of the methods that this object implements. This works the same as IPeripheral.getMethodNames(). See that method for detailed documentation. + * @see dan200.computercraft.api.peripheral.IPeripheral#getMethodNames() + */ + public String[] getMethodNames(); + + /** + * Called when a user calls one of the methods that this object implements. This works the same as IPeripheral.callMethod(). See that method for detailed documentation. + * @see dan200.computercraft.api.peripheral.IPeripheral#callMethod(dan200.computercraft.api.peripheral.IComputerAccess, ILuaContext, int, Object[]) + */ + public Object[] callMethod( ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException; +} diff --git a/src/main/java/dan200/computercraft/api/lua/ILuaTask.java b/src/main/java/dan200/computercraft/api/lua/ILuaTask.java new file mode 100755 index 0000000..45feead --- /dev/null +++ b/src/main/java/dan200/computercraft/api/lua/ILuaTask.java @@ -0,0 +1,12 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.lua; + +public interface ILuaTask +{ + public Object[] execute() throws LuaException; +} diff --git a/src/main/java/dan200/computercraft/api/lua/LuaException.java b/src/main/java/dan200/computercraft/api/lua/LuaException.java new file mode 100755 index 0000000..6683c4b --- /dev/null +++ b/src/main/java/dan200/computercraft/api/lua/LuaException.java @@ -0,0 +1,36 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.lua; + +/** + * An exception representing an error in Lua, like that raised by the error() function + */ +public class LuaException extends Exception +{ + private final int m_level; + + public LuaException() + { + this( "error", 1 ); + } + + public LuaException( String message ) + { + this( message, 1 ); + } + + public LuaException( String message, int level ) + { + super( message ); + m_level = level; + } + + public int getLevel() + { + return m_level; + } +} diff --git a/src/main/java/dan200/computercraft/api/lua/package-info.java b/src/main/java/dan200/computercraft/api/lua/package-info.java new file mode 100755 index 0000000..3ea3d91 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/lua/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API|Lua", apiVersion="1.75" ) +package dan200.computercraft.api.lua; + +import cpw.mods.fml.common.API; diff --git a/src/main/java/dan200/computercraft/api/media/IMedia.java b/src/main/java/dan200/computercraft/api/media/IMedia.java new file mode 100755 index 0000000..57ebc08 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/media/IMedia.java @@ -0,0 +1,59 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.media; + +import dan200.computercraft.api.filesystem.IMount; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +/** + * Represents an item that can be placed in a disk drive and used by a Computer. + * Implement this interface on your Item class to allow it to be used in the drive. + */ +public interface IMedia +{ + /** + * Get a string representing the label of this item. Will be called vi disk.getLabel() in lua. + * @param stack The itemstack to inspect + * @return The label. ie: "Dan's Programs" + */ + public String getLabel( ItemStack stack ); + + /** + * Set a string representing the label of this item. Will be called vi disk.setLabel() in lua. + * @param stack The itemstack to modify. + * @param label The string to set the label to. + * @return true if the label was updated, false if the label may not be modified. + */ + public boolean setLabel( ItemStack stack, String label ); + + /** + * If this disk represents an item with audio (like a record), get the readable name of the audio track. ie: "Jonathon Coulton - Still Alive" + * @param stack The itemstack to inspect. + * @return The name, or null if this item does not represent an item with audio. + */ + public String getAudioTitle( ItemStack stack ); + + /** + * If this disk represents an item with audio (like a record), get the resource name of the audio track to play. + * @param stack The itemstack to inspect. + * @return The name, or null if this item does not represent an item with audio. + */ + public String getAudioRecordName( ItemStack stack ); + + /** + * If this disk represents an item with data (like a floppy disk), get a mount representing it's contents. This will be mounted onto the filesystem of the computercraft while the media is in the disk drive. + * @param stack The itemstack to inspect. + * @param world The world in which the item and disk drive reside. + * @return The mount, or null if this item does not represent an item with data. If the IMount returned also implements IWritableMount, it will mounted using mountWritable() + * @see dan200.computercraft.api.filesystem.IMount + * @see dan200.computercraft.api.filesystem.IWritableMount + * @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String, long) + * @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String) + */ + public IMount createDataMount( ItemStack stack, World world ); +} diff --git a/src/main/java/dan200/computercraft/api/media/IMediaProvider.java b/src/main/java/dan200/computercraft/api/media/IMediaProvider.java new file mode 100755 index 0000000..c0aabd5 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/media/IMediaProvider.java @@ -0,0 +1,23 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.media; + +import net.minecraft.item.ItemStack; + +/** + * This interface is used to provide IMedia implementations for ItemStack + * @see dan200.computercraft.api.ComputerCraftAPI#registerMediaProvider(IMediaProvider) + */ +public interface IMediaProvider +{ + /** + * Produce an IMedia implementation from an ItemStack. + * @see dan200.computercraft.api.ComputerCraftAPI#registerMediaProvider(IMediaProvider) + * @return an IMedia implementation, or null if the item is not something you wish to handle + */ + public IMedia getMedia( ItemStack stack ); +} diff --git a/src/main/java/dan200/computercraft/api/media/package-info.java b/src/main/java/dan200/computercraft/api/media/package-info.java new file mode 100755 index 0000000..9e2f507 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/media/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API|Media", apiVersion="1.75" ) +package dan200.computercraft.api.media; + +import cpw.mods.fml.common.API; diff --git a/src/main/java/dan200/computercraft/api/package-info.java b/src/main/java/dan200/computercraft/api/package-info.java new file mode 100755 index 0000000..f3a706a --- /dev/null +++ b/src/main/java/dan200/computercraft/api/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API", apiVersion="1.75" ) +package dan200.computercraft.api; + +import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java b/src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java new file mode 100755 index 0000000..2458c06 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/peripheral/IComputerAccess.java @@ -0,0 +1,102 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.peripheral; + +import dan200.computercraft.api.filesystem.IMount; +import dan200.computercraft.api.filesystem.IWritableMount; + +/** + * The interface passed to peripherals by computers or turtles, providing methods + * that they can call. This should not be implemented by your classes. Do not interact + * with computers except via this interface. + */ +public interface IComputerAccess +{ + /** + * Mount a mount onto the computers' file system in a read only mode.
+ * @param desiredLocation The location on the computercraft's file system where you would like the mount to be mounted. + * @param mount The mount object to mount on the computercraft. These can be obtained by calling ComputerCraftAPI.createSaveDirMount(), ComputerCraftAPI.createResourceMount() or by creating your own objects that implement the IMount interface. + * @return The location on the computercraft's file system where you the mount mounted, or null if there was already a file in the desired location. Store this value if you wish to unmount the mount later. + * @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String) + * @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String) + * @see #mountWritable(String, dan200.computercraft.api.filesystem.IWritableMount) + * @see #unmount(String) + * @see dan200.computercraft.api.filesystem.IMount + */ + public String mount( String desiredLocation, IMount mount ); + + /** + * TODO: Document me + */ + public String mount( String desiredLocation, IMount mount, String driveName ); + + /** + * Mount a mount onto the computers' file system in a writable mode.
+ * @param desiredLocation The location on the computercraft's file system where you would like the mount to be mounted. + * @param mount The mount object to mount on the computercraft. These can be obtained by calling ComputerCraftAPI.createSaveDirMount() or by creating your own objects that implement the IWritableMount interface. + * @return The location on the computercraft's file system where you the mount mounted, or null if there was already a file in the desired location. Store this value if you wish to unmount the mount later. + * @see dan200.computercraft.api.ComputerCraftAPI#createSaveDirMount(World, String) + * @see dan200.computercraft.api.ComputerCraftAPI#createResourceMount(Class, String, String) + * @see #mount(String, IMount) + * @see #unmount(String) + * @see IMount + */ + public String mountWritable( String desiredLocation, IWritableMount mount ); + + /** + * TODO: Document me + */ + public String mountWritable( String desiredLocation, IWritableMount mount, String driveName ); + + /** + * Unmounts a directory previously mounted onto the computers file system by mount() or mountWritable().
+ * When a directory is unmounted, it will disappear from the computers file system, and the user will no longer be able to + * access it. All directories mounted by a mount or mountWritable are automatically unmounted when the peripheral + * is attached if they have not been explicitly unmounted. + * @param location The desired location in the computers file system of the directory to unmount. + * This must be the location of a directory previously mounted by mount() or mountWritable(), as + * indicated by their return value. + * @see #mount(String, IMount) + * @see #mountWritable(String, IWritableMount) + */ + public void unmount( String location ); + + /** + * Returns the numerical ID of this computercraft.
+ * This is the same number obtained by calling os.getComputerID() or running the "id" program from lua, + * and is guarunteed unique. This number will be positive. + * @return The identifier. + */ + public int getID(); + + /** + * Causes an event to be raised on this computercraft, which the computercraft can respond to by calling + * os.pullEvent(). This can be used to notify the computercraft when things happen in the world or to + * this peripheral. + * @param event A string identifying the type of event that has occurred, this will be + * returned as the first value from os.pullEvent(). It is recommended that you + * you choose a name that is unique, and recognisable as originating from your + * peripheral. eg: If your peripheral type is "button", a suitable event would be + * "button_pressed". + * @param arguments In addition to a name, you may pass an array of extra arguments to the event, that will + * be supplied as extra return values to os.pullEvent(). Objects in the array will be converted + * to lua data types in the same fashion as the return values of IPeripheral.callMethod().
+ * You may supply null to indicate that no arguments are to be supplied. + * @see dan200.computercraft.api.peripheral.IPeripheral#callMethod + */ + public void queueEvent( String event, Object[] arguments ); + + /** + * Get a string, unique to the computercraft, by which the computercraft refers to this peripheral. + * For directly attached peripherals this will be "left","right","front","back",etc, but + * for peripherals attached remotely it will be different. It is good practice to supply + * this string when raising events to the computercraft, so that the computercraft knows from + * which peripheral the event came. + * @return A string unique to the computercraft, but not globally. + */ + public String getAttachmentName(); +} diff --git a/src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java b/src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java new file mode 100755 index 0000000..a28d656 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/peripheral/IPeripheral.java @@ -0,0 +1,100 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.peripheral; + +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.lua.LuaException; + +/** + * The interface that defines a peripheral. This should be implemented by the + * TileEntity of any common that you wish to be interacted with by + * computercraft or turtle. + */ +public interface IPeripheral +{ + /** + * Should return a string that uniquely identifies this type of peripheral. + * This can be queried from lua by calling peripheral.getType() + * @return A string identifying the type of peripheral. + */ + public String getType(); + + /** + * Should return an array of strings that identify the methods that this + * peripheral exposes to Lua. This will be called once before each attachment, + * and should not change when called multiple times. + * @return An array of strings representing method names. + * @see #callMethod + */ + public String[] getMethodNames(); + + /** + * This is called when a lua program on an attached computercraft calls peripheral.call() with + * one of the methods exposed by getMethodNames().
+ *
+ * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe + * when interacting with minecraft objects. + * @param computer The interface to the computercraft that is making the call. Remember that multiple + * computers can be attached to a peripheral at once. + * @param context The context of the currently running lua thread. This can be used to wait for events + * or otherwise yield. + * @param method An integer identifying which of the methods from getMethodNames() the computercraft + * wishes to call. The integer indicates the index into the getMethodNames() table + * that corresponds to the string passed into peripheral.call() + * @param arguments An array of objects, representing the arguments passed into peripheral.call().
+ * Lua values of type "string" will be represented by Object type String.
+ * Lua values of type "number" will be represented by Object type Double.
+ * Lua values of type "boolean" will be represented by Object type Boolean.
+ * Lua values of any other type will be represented by a null object.
+ * This array will be empty if no arguments are passed. + * @return An array of objects, representing values you wish to return to the lua program.
+ * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.
+ * All other types will be converted to nil.
+ * You may return null to indicate no values should be returned. + * @throws Exception If you throw any exception from this function, a lua error will be raised with the + * same message as your exception. Use this to throw appropriate errors if the wrong + * arguments are supplied to your method. + * @see #getMethodNames + */ + public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException; + + /** + * Is called when canAttachToSide has returned true, and a computercraft is attaching to the peripheral. + * This will occur when a peripheral is placed next to an active computercraft, when a computercraft is turned on next to a peripheral, + * or when a turtle travels into a square next to a peripheral. + * Between calls to attach() and detach(), the attached computercraft can make method calls on the peripheral using peripheral.call(). + * This method can be used to keep track of which computers are attached to the peripheral, or to take action when attachment + * occurs.
+ *
+ * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe + * when interacting with minecraft objects. + * @param computer The interface to the computercraft that is being attached. Remember that multiple + * computers can be attached to a peripheral at once. + * @see #detach + */ + public void attach( IComputerAccess computer ); + + /** + * Is called when a computercraft is detaching from the peripheral. + * This will occur when a computercraft shuts down, when the peripheral is removed while attached to computers, + * or when a turtle moves away from a square attached to a peripheral. + * This method can be used to keep track of which computers are attached to the peripheral, or to take action when detachment + * occurs.
+ *
+ * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe + * when interacting with minecraft objects. + * @param computer The interface to the computercraft that is being detached. Remember that multiple + * computers can be attached to a peripheral at once. + * @see #detach + */ + public void detach( IComputerAccess computer ); + + /** + * TODO: Document me + */ + public boolean equals( IPeripheral other ); +} diff --git a/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java b/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java new file mode 100755 index 0000000..a2775f9 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java @@ -0,0 +1,23 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.peripheral; + +import net.minecraft.world.World; + +/** + * This interface is used to create peripheral implementations for blocks + * @see dan200.computercraft.api.ComputerCraftAPI#registerPeripheralProvider(IPeripheralProvider) + */ +public interface IPeripheralProvider +{ + /** + * Produce an peripheral implementation from a block location. + * @see dan200.computercraft.api.ComputerCraftAPI#registerPeripheralProvider(IPeripheralProvider) + * @return a peripheral, or null if there is not a peripheral here you'd like to handle. + */ + public IPeripheral getPeripheral( World world, int x, int y, int z, int side ); +} diff --git a/src/main/java/dan200/computercraft/api/peripheral/package-info.java b/src/main/java/dan200/computercraft/api/peripheral/package-info.java new file mode 100755 index 0000000..10ea4da --- /dev/null +++ b/src/main/java/dan200/computercraft/api/peripheral/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API|Peripheral", apiVersion="1.75" ) +package dan200.computercraft.api.peripheral; + +import cpw.mods.fml.common.API; diff --git a/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java b/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java new file mode 100644 index 0000000..476b4fc --- /dev/null +++ b/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java @@ -0,0 +1,19 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.permissions; + +import net.minecraft.world.World; + +/** + * This interface is used to restrict where turtles can move or build + * @see dan200.computercraft.api.ComputerCraftAPI#registerPermissionProvider(ITurtlePermissionProvider) + */ +public interface ITurtlePermissionProvider +{ + public boolean isBlockEnterable( World world, int x, int y, int z ); + public boolean isBlockEditable( World world, int x, int y, int z ); +} diff --git a/src/main/java/dan200/computercraft/api/permissions/package-info.java b/src/main/java/dan200/computercraft/api/permissions/package-info.java new file mode 100644 index 0000000..a51e7ec --- /dev/null +++ b/src/main/java/dan200/computercraft/api/permissions/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API|Permissions", apiVersion="1.75" ) +package dan200.computercraft.api.permissions; + +import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java b/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java new file mode 100755 index 0000000..b85f2ef --- /dev/null +++ b/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java @@ -0,0 +1,23 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.redstone; + +import net.minecraft.world.World; + +/** + * This interface is used to provide bundled redstone output for blocks + * @see dan200.computercraft.api.ComputerCraftAPI#registerBundledRedstoneProvider(IBundledRedstoneProvider) + */ +public interface IBundledRedstoneProvider +{ + /** + * Produce an bundled redstone output from a block location. + * @see dan200.computercraft.api.ComputerCraftAPI#registerBundledRedstoneProvider(IBundledRedstoneProvider) + * @return a number in the range 0-65535 to indicate this block is providing output, or -1 if you do not wish to handle this block + */ + public int getBundledRedstoneOutput( World world, int x, int y, int z, int side ); +} diff --git a/src/main/java/dan200/computercraft/api/redstone/package-info.java b/src/main/java/dan200/computercraft/api/redstone/package-info.java new file mode 100755 index 0000000..e01c623 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/redstone/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API|Redstone", apiVersion="1.75" ) +package dan200.computercraft.api.redstone; + +import cpw.mods.fml.common.API; diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java new file mode 100755 index 0000000..96c6159 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java @@ -0,0 +1,168 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +/** + * The interface passed to turtle by turtles, providing methods that they can call. + * This should not be implemented by your classes. Do not interact with turtles except via this interface and ITurtleUpgrade. + */ +public interface ITurtleAccess +{ + /** + * Returns the world in which the turtle resides. + * @return the world in which the turtle resides. + */ + public World getWorld(); + + /** + * Returns a vector containing the integer co-ordinates at which the turtle resides. + * @return a vector containing the integer co-ordinates at which the turtle resides. + */ + public ChunkCoordinates getPosition(); + + /** + * TODO: Document me + */ + public boolean teleportTo( World world, int x, int y, int z ); + + /** + * Returns a vector containing the floating point co-ordinates at which the turtle is rendered. + * This will shift when the turtle is moving. + * @param f The subframe fraction + * @return a vector containing the floating point co-ordinates at which the turtle resides. + */ + public Vec3 getVisualPosition( float f ); + + /** + * TODO: Document me + */ + public float getVisualYaw( float f ); + + /** + * Returns the world direction the turtle is currently facing. + * @return the world direction the turtle is currently facing. + */ + public int getDirection(); + + /** + * TODO: Document me + */ + public void setDirection( int dir ); + + /** + * TODO: Document me + */ + public int getSelectedSlot(); + + /** + * TODO: Document me + */ + public void setSelectedSlot( int slot ); + + /** + * Sets the colour of the turtle, as if the player had dyed it with a dye item. + * @param dyeColour 0-15 to dye the turtle one of the 16 standard minecraft colours, or -1 to remove the dye from the turtle. + */ + public void setDyeColour( int dyeColour ); + + /** + * Gets the colour the turtle has been dyed. + * @return 0-15 if the turtle has been dyed one of the 16 standard minecraft colours, -1 if the turtle is clean. + */ + public int getDyeColour(); + + /** + * TODO: Document me + */ + public IInventory getInventory(); + + /** + * TODO: Document me + */ + public boolean isFuelNeeded(); + + /** + * TODO: Document me + */ + public int getFuelLevel(); + + /** + * TODO: Document me + */ + public void setFuelLevel( int fuel ); + + /** + * TODO: Document me + */ + public int getFuelLimit(); + + /** + * Removes some fuel from the turtles fuel supply. Negative numbers can be passed in to INCREASE the fuel level of the turtle. + * @return Whether the turtle was able to consume the ammount of fuel specified. Will return false if you supply a number + * greater than the current fuel level of the turtle. + */ + public boolean consumeFuel( int fuel ); + + /** + * TODO: Document me + */ + public void addFuel( int fuel ); + + /** + * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed + * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up + * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will + * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the + * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. + * @param command an object which will execute the custom command when its point in the queue is reached + * @return the objects the command returned when executed. you should probably return these to the player + * unchanged if called from a peripheral method. + * @see ITurtleCommand + */ + public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException; + + /** + * TODO: Document me + */ + public void playAnimation( TurtleAnimation animation ); + + /** + * Returns the turtle on the specified side of the turtle, if there is one. + * @return the turtle on the specified side of the turtle, if there is one. + */ + public ITurtleUpgrade getUpgrade( TurtleSide side ); + + /** + * TODO: Document me + */ + public void setUpgrade( TurtleSide side, ITurtleUpgrade upgrade ); + + /** + * Returns the peripheral created by the upgrade on the specified side of the turtle, if there is one. + * @return the peripheral created by the upgrade on the specified side of the turtle, if there is one. + */ + public IPeripheral getPeripheral( TurtleSide side ); + + /** + * TODO: Document me + */ + public NBTTagCompound getUpgradeNBTData( TurtleSide side ); + + /** + * TODO: Document me + */ + public void updateUpgradeNBTData( TurtleSide side ); +} diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java new file mode 100755 index 0000000..17d113e --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleCommand.java @@ -0,0 +1,25 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +/** + * An interface for objects executing custom turtle commands, used with ITurtleAccess.issueCommand + * @see ITurtleAccess#executeCommand(dan200.computercraft.api.lua.ILuaContext,ITurtleCommand) + */ +public interface ITurtleCommand +{ + /** + * Will be called by the turtle on the main thread when it is time to execute the custom command. + * The handler should either perform the work of the command, and return success, or return + * failure with an error message to indicate the command cannot be executed at this time. + * @param turtle access to the turtle for whom the command was issued + * @return TurtleCommandResult.success() or TurtleCommandResult.failure( errorMessage ) + * @see ITurtleAccess#executeCommand(dan200.computercraft.api.lua.ILuaContext,ITurtleCommand) + * @see dan200.computercraft.api.turtle.TurtleCommandResult + */ + public TurtleCommandResult execute( ITurtleAccess turtle ); +} diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java new file mode 100755 index 0000000..0dcc6e6 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java @@ -0,0 +1,94 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +/** + * The primary interface for defining an turtle for Turtles. A turtle turtle + * can either be a new tool, or a new peripheral. + * @see dan200.computercraft.api.ComputerCraftAPI#registerTurtleUpgrade( dan200.computercraft.api.turtle.ITurtleUpgrade ) + */ +public interface ITurtleUpgrade +{ + /** + * Gets a unique numerical identifier representing this type of turtle turtle. + * Like Minecraft common and item IDs, you should strive to make this number unique + * among all turtle turtle that have been released for ComputerCraft. + * The ID must be in the range 64 to 255, as the ID is stored as an 8-bit value, + * and 0-64 is reserved for future use by ComputerCraft. The turtle will + * fail registration if an already used ID is specified. + * @see dan200.computercraft.api.ComputerCraftAPI#registerTurtleUpgrade( dan200.computercraft.api.turtle.ITurtleUpgrade ) + */ + public int getUpgradeID(); + + /** + * Return a String to describe this type of turtle in turtle item names. + * Examples of built-in adjectives are "Wireless", "Mining" and "Crafty". + */ + public String getUnlocalisedAdjective(); + + /** + * Return whether this turtle adds a tool or a peripheral to the turtle. + * Currently, turtle crafting is restricted to one tool & one peripheral per turtle. + * @see TurtleUpgradeType for the differences between the two. + */ + public TurtleUpgradeType getType(); + + /** + * Return an item stack representing the type of item that a turtle must be crafted + * with to create a turtle which holds this turtle. + * Currently, turtle crafting is restricted to one tool & one peripheral per turtle. + */ + public ItemStack getCraftingItem(); + + /** + * Will only be called for Peripheral turtle. Creates a peripheral for a turtle + * being placed using this turtle. The peripheral created will be stored + * for the lifetime of the turtle, will have update() called once-per-tick, and will be + * attach'd detach'd and have methods called in the same manner as a Computer peripheral. + * + * @param turtle Access to the turtle that the peripheral is being created for. + * @param side Which side of the turtle (left or right) that the turtle resides on. + * @return The newly created peripheral. You may return null if this turtle is a Tool + * and this method is not expected to be called. + */ + public IPeripheral createPeripheral( ITurtleAccess turtle, TurtleSide side ); + + /** + * Will only be called for Tool turtle. Called when turtle.dig() or turtle.attack() is called + * by the turtle, and the tool is required to do some work. + * @param turtle Access to the turtle that the tool resides on. + * @param side Which side of the turtle (left or right) the tool resides on. + * @param verb Which action (dig or attack) the turtle is being called on to perform. + * @param direction Which world direction the action should be performed in, relative to the turtles + * position. This will either be up, down, or the direction the turtle is facing, depending on + * whether dig, digUp or digDown was called. + * @return Whether the turtle was able to perform the action, and hence whether the turtle.dig() + * or turtle.attack() lua method should return true. If true is returned, the tool will perform + * a swinging animation. You may return null if this turtle is a Peripheral + * and this method is not expected to be called. + */ + public TurtleCommandResult useTool( ITurtleAccess turtle, TurtleSide side, TurtleVerb verb, int direction ); + + /** + * Called to obtain the IIcon to be used when rendering a turtle peripheral. Needs to be a "common" + * type IIcon for now, as there is no way to determine which texture sheet an IIcon is from by the + * IIcon itself. + * @param turtle Access to the turtle that the peripheral resides on. + * @param side Which side of the turtle (left or right) the peripheral resides on. + * @return The IIcon that you wish to be used to render your turtle peripheral. + */ + public IIcon getIcon( ITurtleAccess turtle, TurtleSide side ); + + /** + * TODO: Document me + */ + public void update( ITurtleAccess turtle, TurtleSide side ); +} diff --git a/src/main/java/dan200/computercraft/api/turtle/TurtleAnimation.java b/src/main/java/dan200/computercraft/api/turtle/TurtleAnimation.java new file mode 100755 index 0000000..abb4134 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/TurtleAnimation.java @@ -0,0 +1,22 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +public enum TurtleAnimation +{ + None, + MoveForward, + MoveBack, + MoveUp, + MoveDown, + TurnLeft, + TurnRight, + SwingLeftTool, + SwingRightTool, + Wait, + ShortWait, +} diff --git a/src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java b/src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java new file mode 100755 index 0000000..67046bd --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/TurtleCommandResult.java @@ -0,0 +1,73 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +public final class TurtleCommandResult +{ + private static final TurtleCommandResult s_success = new TurtleCommandResult( true, null, null ); + private static final TurtleCommandResult s_emptyFailure = new TurtleCommandResult( false, null, null ); + + public static TurtleCommandResult success() + { + return success( null ); + } + + public static TurtleCommandResult success( Object[] results ) + { + if( results == null || results.length == 0 ) + { + return s_success; + } + else + { + return new TurtleCommandResult( true, null, results ); + } + } + + public static TurtleCommandResult failure() + { + return failure( null ); + } + + public static TurtleCommandResult failure( String errorMessage ) + { + if( errorMessage == null ) + { + return s_emptyFailure; + } + else + { + return new TurtleCommandResult( false, errorMessage, null ); + } + } + + private final boolean m_success; + private final String m_errorMessage; + private final Object[] m_results; + + private TurtleCommandResult( boolean success, String errorMessage, Object[] results ) + { + m_success = success; + m_errorMessage = errorMessage; + m_results = results; + } + + public boolean isSuccess() + { + return m_success; + } + + public String getErrorMessage() + { + return m_errorMessage; + } + + public Object[] getResults() + { + return m_results; + } +} diff --git a/src/main/java/dan200/computercraft/api/turtle/TurtleSide.java b/src/main/java/dan200/computercraft/api/turtle/TurtleSide.java new file mode 100755 index 0000000..5fc7c61 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/TurtleSide.java @@ -0,0 +1,23 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +/** + * An enum representing the two sides of the turtle that a turtle turtle might reside. + */ +public enum TurtleSide +{ + /** + * The turtles left side (where the pickaxe usually is on a Wireless Mining Turtle) + */ + Left, + + /** + * The turtles right side (where the modem usually is on a Wireless Mining Turtle) + */ + Right, +} diff --git a/src/main/java/dan200/computercraft/api/turtle/TurtleUpgradeType.java b/src/main/java/dan200/computercraft/api/turtle/TurtleUpgradeType.java new file mode 100755 index 0000000..e5fd1af --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/TurtleUpgradeType.java @@ -0,0 +1,27 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +/** + * An enum representing the two different types of turtle that an ITurtleUpgrade + * implementation can add to a turtle. + * @see ITurtleUpgrade + */ +public enum TurtleUpgradeType +{ + /** + * A tool is rendered as an item on the side of the turtle, and responds to the turtle.dig() + * and turtle.attack() methods (Such as pickaxe or sword on Mining and Melee turtles). + */ + Tool, + + /** + * A peripheral adds a special peripheral which is attached to the side of the turtle, + * and can be interacted with the peripheral API (Such as the modem on Wireless Turtles). + */ + Peripheral, +} diff --git a/src/main/java/dan200/computercraft/api/turtle/TurtleVerb.java b/src/main/java/dan200/computercraft/api/turtle/TurtleVerb.java new file mode 100755 index 0000000..566fa48 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/TurtleVerb.java @@ -0,0 +1,26 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +package dan200.computercraft.api.turtle; + +/** + * An enum representing the two different actions that an ITurtleUpgrade of type + * Tool may be called on to perform by a turtle. + * @see ITurtleUpgrade + * @see ITurtleUpgrade#useTool + */ +public enum TurtleVerb +{ + /** + * The turtle called turtle.dig(), turtle.digUp() or turtle.digDown() + */ + Dig, + + /** + * The turtle called turtle.attack(), turtle.attackUp() or turtle.attackDown() + */ + Attack, +} diff --git a/src/main/java/dan200/computercraft/api/turtle/package-info.java b/src/main/java/dan200/computercraft/api/turtle/package-info.java new file mode 100755 index 0000000..7825971 --- /dev/null +++ b/src/main/java/dan200/computercraft/api/turtle/package-info.java @@ -0,0 +1,10 @@ +/** + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2015. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ + +@API( owner="ComputerCraft", provides="ComputerCraft|API|Turtle", apiVersion="1.75" ) +package dan200.computercraft.api.turtle; + +import cpw.mods.fml.common.API; diff --git a/src/main/java/electricexpansion/api/ElectricExpansionItems.java b/src/main/java/electricexpansion/api/ElectricExpansionItems.java new file mode 100644 index 0000000..32a24d8 --- /dev/null +++ b/src/main/java/electricexpansion/api/ElectricExpansionItems.java @@ -0,0 +1,31 @@ +package electricexpansion.api; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import universalelectricity.core.item.ItemElectric; + +public class ElectricExpansionItems { + public static Block blockRawWire; + public static Block blockInsulatedWire; + public static Block blockWireBlock; + public static Block blockSwitchWire; + public static Block blockSwitchWireBlock; + public static Block blockLogisticsWire; + public static Block blockRedstonePaintedWire; + public static Block blockAdvBatteryBox; + public static Block blockMultimeter; + public static Block blockWireMill; + public static Block blockTransformer; + public static Block blockDistribution; + public static Block blockLead; + public static Block blockSilverOre; + public static Block blockInsulationMachine; + public static Block blockRedstoneNetworkCore; + public static Item itemParts; + public static Item itemUpgrade; + public static ItemElectric itemEliteBat; + public static ItemElectric itemAdvBat; + public static ItemElectric itemUltimateBat; + public static Item itemMultimeter; + public static Item itemFuse; +} diff --git a/src/main/java/electricexpansion/api/EnumWireMaterial.java b/src/main/java/electricexpansion/api/EnumWireMaterial.java new file mode 100644 index 0000000..8dc4109 --- /dev/null +++ b/src/main/java/electricexpansion/api/EnumWireMaterial.java @@ -0,0 +1,23 @@ +package electricexpansion.api; + +public enum EnumWireMaterial { + COPPER("Copper", 0.0125f, 3, 200), + TIN("Tin", 0.01f, 2, 30), + SILVER("Silver", 0.005f, 1, 300), + ALUMINUM("Aluminum", 0.025f, 8, 15), + SUPERCONDUCTOR("Superconductor", 0.0f, 5, Integer.MAX_VALUE), + UNKNOWN("Unknown", 0.4f, 2, 60); + + public final String name; + public final float resistance; + public final int electrocutionDamage; + public final int maxAmps; + + private EnumWireMaterial(final String name, final float resistance, + final int electrocutionDamage, final int maxAmps) { + this.name = name; + this.resistance = resistance; + this.electrocutionDamage = electrocutionDamage; + this.maxAmps = maxAmps; + } +} diff --git a/src/main/java/electricexpansion/api/EnumWireType.java b/src/main/java/electricexpansion/api/EnumWireType.java new file mode 100644 index 0000000..3e45dfd --- /dev/null +++ b/src/main/java/electricexpansion/api/EnumWireType.java @@ -0,0 +1,10 @@ +package electricexpansion.api; + +public enum EnumWireType { + UNINSULATED, + INSULATED, + SWITCH, + BLOCK_INSULATED, + BLOCK_SWITCH, + LOGISTICS; +} diff --git a/src/main/java/electricexpansion/api/IAdvancedConductor.java b/src/main/java/electricexpansion/api/IAdvancedConductor.java new file mode 100644 index 0000000..4173298 --- /dev/null +++ b/src/main/java/electricexpansion/api/IAdvancedConductor.java @@ -0,0 +1,9 @@ +package electricexpansion.api; + +import universalelectricity.core.block.IConductor; + +public interface IAdvancedConductor extends IConductor { + EnumWireMaterial getWireMaterial(final int p0); + + EnumWireType getWireType(final int p0); +} diff --git a/src/main/java/electricexpansion/api/IItemFuse.java b/src/main/java/electricexpansion/api/IItemFuse.java new file mode 100644 index 0000000..cebc900 --- /dev/null +++ b/src/main/java/electricexpansion/api/IItemFuse.java @@ -0,0 +1,17 @@ +package electricexpansion.api; + +import net.minecraft.item.ItemStack; + +public interface IItemFuse { + double getMaxVolts(final ItemStack p0); + + ItemStack onFuseTrip(final ItemStack p0); + + boolean isValidFuse(final ItemStack p0); + + boolean canReset(final ItemStack p0); + + ItemStack onReset(final ItemStack p0); + + String getUnlocalizedName(final ItemStack p0); +} diff --git a/src/main/java/electricexpansion/api/IRedstoneNetAccessor.java b/src/main/java/electricexpansion/api/IRedstoneNetAccessor.java new file mode 100644 index 0000000..f081ab9 --- /dev/null +++ b/src/main/java/electricexpansion/api/IRedstoneNetAccessor.java @@ -0,0 +1,8 @@ +package electricexpansion.api; + +import universalelectricity.core.block.INetworkProvider; + +public interface IRedstoneNetAccessor extends INetworkProvider +{ + int getRsSignalFromBlock(); +} diff --git a/src/main/java/electricexpansion/api/IWirelessPowerMachine.java b/src/main/java/electricexpansion/api/IWirelessPowerMachine.java new file mode 100644 index 0000000..15c201c --- /dev/null +++ b/src/main/java/electricexpansion/api/IWirelessPowerMachine.java @@ -0,0 +1,16 @@ +package electricexpansion.api; + +import net.minecraft.entity.player.EntityPlayer; +import universalelectricity.core.block.IElectricityStorage; + +public interface IWirelessPowerMachine extends IElectricityStorage { + byte getFrequency(); + + void setFrequency(final byte p0); + + String getType(); + + void removeJoules(final double p0); + + void setPlayer(final EntityPlayer p0); +} diff --git a/src/main/java/electricexpansion/api/Recipes.java b/src/main/java/electricexpansion/api/Recipes.java new file mode 100644 index 0000000..67fc780 --- /dev/null +++ b/src/main/java/electricexpansion/api/Recipes.java @@ -0,0 +1,60 @@ +package electricexpansion.api; + +import cpw.mods.fml.common.Loader; +import electricexpansion.common.misc.InsulationRecipes; +import electricexpansion.common.misc.WireMillRecipes; +import net.minecraft.item.ItemStack; + +public class Recipes { + public boolean addInsulationRecipe(final ItemStack input, final int output, + final int ticks) { + if (Loader.isModLoaded("ElectricExpansion")) { + try { + InsulationRecipes.INSTANCE.addProcessing(input, output, ticks); + return true; + } catch (final Exception e) { + return false; + } + } + return false; + } + + public boolean addInsulationRecipe(final String input, final int output, + final int ticks) { + if (Loader.isModLoaded("ElectricExpansion")) { + try { + InsulationRecipes.INSTANCE.addProcessing(input, output, ticks); + return true; + } catch (final Exception e) { + return false; + } + } + return false; + } + + public boolean addDrawingRecipe(final ItemStack input, final ItemStack output, + final int ticks) { + if (Loader.isModLoaded("ElectricExpansion")) { + try { + WireMillRecipes.INSTANCE.addProcessing(input, output, ticks); + return true; + } catch (final Exception e) { + return false; + } + } + return false; + } + + public boolean addDrawingRecipe(final String input, final ItemStack output, + final int ticks) { + if (Loader.isModLoaded("ElectricExpansion")) { + try { + WireMillRecipes.INSTANCE.addProcessing(input, output, ticks); + return true; + } catch (final Exception e) { + return false; + } + } + return false; + } +} diff --git a/src/main/java/electricexpansion/client/ClientProxy.java b/src/main/java/electricexpansion/client/ClientProxy.java new file mode 100644 index 0000000..6cbcf58 --- /dev/null +++ b/src/main/java/electricexpansion/client/ClientProxy.java @@ -0,0 +1,95 @@ +package electricexpansion.client; + +import net.minecraft.tileentity.TileEntity; +import electricexpansion.client.gui.GuiFuseBox; +import electricexpansion.common.tile.TileEntityFuseBox; +import electricexpansion.client.gui.GuiInsulationMachine; +import electricexpansion.client.gui.GuiQuantumBatteryBox; +import electricexpansion.client.gui.GuiLogisticsWire; +import electricexpansion.client.gui.GuiWireMill; +import electricexpansion.client.gui.GuiAdvancedBatteryBox; +import net.minecraft.world.World; +import net.minecraft.entity.player.EntityPlayer; +import electricexpansion.common.tile.TileEntityAdvancedBatteryBox; +import electricexpansion.client.render.RenderMultimeter; +import electricexpansion.common.tile.TileEntityMultimeter; +import electricexpansion.client.render.RenderTransformer; +import electricexpansion.common.tile.TileEntityTransformer; +import electricexpansion.common.tile.TileEntityRedstoneNetworkCore; +import electricexpansion.common.tile.TileEntityInsulatingMachine; +import electricexpansion.common.tile.TileEntityQuantumBatteryBox; +import electricexpansion.common.cables.TileEntitySwitchWireBlock; +import cpw.mods.fml.common.registry.GameRegistry; +import electricexpansion.common.cables.TileEntityWireBlock; +import electricexpansion.common.cables.TileEntityRedstonePaintedWire; +import electricexpansion.common.cables.TileEntityLogisticsWire; +import electricexpansion.common.cables.TileEntitySwitchWire; +import electricexpansion.common.cables.TileEntityInsulatedWire; +import electricexpansion.client.render.RenderRawWire; +import electricexpansion.common.cables.TileEntityRawWire; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import cpw.mods.fml.client.registry.ClientRegistry; +import electricexpansion.client.render.RenderWireMill; +import electricexpansion.common.tile.TileEntityWireMill; +import electricexpansion.client.render.RenderInsulatedWire; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import electricexpansion.client.render.RenderHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.CommonProxy; + +@SideOnly(Side.CLIENT) +public class ClientProxy extends CommonProxy +{ + public static int RENDER_ID; + + @Override + public void init() { + ClientProxy.RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + RenderingRegistry.registerBlockHandler((ISimpleBlockRenderingHandler)new RenderHandler()); + final RenderInsulatedWire insulatedWireRenderer = new RenderInsulatedWire(); + ClientRegistry.registerTileEntity(TileEntityWireMill.class, "TileEntityWireMill", (TileEntitySpecialRenderer)new RenderWireMill()); + ClientRegistry.registerTileEntity(TileEntityRawWire.class, "TileEntityRawWire", (TileEntitySpecialRenderer)new RenderRawWire()); + ClientRegistry.registerTileEntity(TileEntityInsulatedWire.class, "TileEntityInsulatedWire", (TileEntitySpecialRenderer)insulatedWireRenderer); + ClientRegistry.registerTileEntity(TileEntitySwitchWire.class, "TileEntitySwitchWire", (TileEntitySpecialRenderer)insulatedWireRenderer); + ClientRegistry.registerTileEntity(TileEntityLogisticsWire.class, "TileEntityLogisticsWire", (TileEntitySpecialRenderer)insulatedWireRenderer); + ClientRegistry.registerTileEntity(TileEntityRedstonePaintedWire.class, "TileEntityRedstonePaintedWire", (TileEntitySpecialRenderer)insulatedWireRenderer); + GameRegistry.registerTileEntity(TileEntityWireBlock.class, "TileEntityWireBlock"); + GameRegistry.registerTileEntity(TileEntitySwitchWireBlock.class, "TileEntitySwitchWireBlock"); + GameRegistry.registerTileEntity(TileEntityQuantumBatteryBox.class, "TileEntityDistribution"); + GameRegistry.registerTileEntity(TileEntityInsulatingMachine.class, "TileEntityInsulatingMachine"); + GameRegistry.registerTileEntity(TileEntityRedstoneNetworkCore.class, "TileEntityRedstoneNetworkCore"); + ClientRegistry.registerTileEntity(TileEntityTransformer.class, "TileEntityTransformer", (TileEntitySpecialRenderer)new RenderTransformer()); + ClientRegistry.registerTileEntity(TileEntityMultimeter.class, "TileEntityMultimeter", (TileEntitySpecialRenderer)new RenderMultimeter()); + GameRegistry.registerTileEntity(TileEntityAdvancedBatteryBox.class, "TileEntityAdvBox"); + } + + @Override + public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x, final int y, final int z) { + final TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity != null) { + switch (ID) { + case 0: { + return new GuiAdvancedBatteryBox(player.inventory, (TileEntityAdvancedBatteryBox)tileEntity); + } + case 2: { + return new GuiWireMill(player.inventory, (TileEntityWireMill)tileEntity); + } + case 3: { + return new GuiLogisticsWire((TileEntityLogisticsWire)tileEntity); + } + case 4: { + return new GuiQuantumBatteryBox(player.inventory, (TileEntityQuantumBatteryBox)tileEntity); + } + case 5: { + return new GuiInsulationMachine(player.inventory, (TileEntityInsulatingMachine)tileEntity); + } + case 6: { + return new GuiFuseBox(player.inventory, (TileEntityFuseBox)tileEntity); + } + } + } + return null; + } +} diff --git a/src/main/java/electricexpansion/client/gui/GuiAdvancedBatteryBox.java b/src/main/java/electricexpansion/client/gui/GuiAdvancedBatteryBox.java new file mode 100644 index 0000000..c0ce796 --- /dev/null +++ b/src/main/java/electricexpansion/client/gui/GuiAdvancedBatteryBox.java @@ -0,0 +1,79 @@ +package electricexpansion.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.containers.ContainerAdvBatteryBox; +import electricexpansion.common.tile.TileEntityAdvancedBatteryBox; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; +import universalelectricity.core.electricity.ElectricityDisplay; +import universalelectricity.prefab.TranslationHelper; + +@SideOnly(Side.CLIENT) +public class GuiAdvancedBatteryBox extends GuiContainer { + private TileEntityAdvancedBatteryBox tileEntity; + private int containerWidth; + private int containerHeight; + + public GuiAdvancedBatteryBox(final InventoryPlayer par1InventoryPlayer, + final TileEntityAdvancedBatteryBox AdvBatteryBox) { + super((Container) new ContainerAdvBatteryBox(par1InventoryPlayer, + AdvBatteryBox)); + this.tileEntity = AdvBatteryBox; + } + + @Override + protected void drawGuiContainerForegroundLayer(final int par1, + final int par2) { + this.fontRendererObj.drawString( + TranslationHelper.getLocal(this.tileEntity.getInventoryName()), 22, 6, + 4210752); + final String displayJoules = ElectricityDisplay.getDisplayShort( + this.tileEntity.getJoules(), ElectricityDisplay.ElectricUnit.JOULES); + String displayMaxJoules = ElectricityDisplay.getDisplayShort( + this.tileEntity.getMaxJoules(), ElectricityDisplay.ElectricUnit.JOULES); + final String displayInputVoltage = ElectricityDisplay.getDisplayShort( + this.tileEntity.getInputVoltage(), + ElectricityDisplay.ElectricUnit.VOLTAGE); + final String displayOutputVoltage = ElectricityDisplay.getDisplayShort( + this.tileEntity.getVoltage(), ElectricityDisplay.ElectricUnit.VOLTAGE); + if (this.tileEntity.isDisabled()) { + displayMaxJoules = "Disabled"; + } + this.fontRendererObj.drawString(displayJoules + " of", + 73 - displayJoules.length(), 25, 4210752); + this.fontRendererObj.drawString(displayMaxJoules, 70, 35, 4210752); + this.fontRendererObj.drawString("Voltage: " + displayOutputVoltage, 65, 55, + 4210752); + this.fontRendererObj.drawString("Input: " + displayInputVoltage, 65, 65, + 4210752); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("container.inventory"), 8, + this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float par1, + final int par2, + final int par3) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(getTexture()); + this.containerWidth = (this.width - this.xSize) / 2; + this.containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(this.containerWidth, this.containerHeight, 0, 0, + this.xSize, this.ySize); + final int scale = (int) (this.tileEntity.getJoules() / + this.tileEntity.getMaxJoules() * 72.0); + this.drawTexturedModalRect(this.containerWidth + 64, + this.containerHeight + 46, 176, 0, scale, 20); + } + + public static ResourceLocation getTexture() { + return new ResourceLocation("electricexpansion", + "textures/gui/GuiBatBox.png"); + } +} diff --git a/src/main/java/electricexpansion/client/gui/GuiFuseBox.java b/src/main/java/electricexpansion/client/gui/GuiFuseBox.java new file mode 100644 index 0000000..32e54c5 --- /dev/null +++ b/src/main/java/electricexpansion/client/gui/GuiFuseBox.java @@ -0,0 +1,67 @@ +package electricexpansion.client.gui; + +import electricexpansion.api.IItemFuse; +import electricexpansion.common.containers.ContainerFuseBox; +import electricexpansion.common.tile.TileEntityFuseBox; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; +import universalelectricity.core.electricity.ElectricityDisplay; +import universalelectricity.prefab.TranslationHelper; + +public class GuiFuseBox extends GuiContainer { + public final TileEntityFuseBox tileEntity; + private int containerWidth; + private int containerHeight; + + public GuiFuseBox(final InventoryPlayer par1InventoryPlayer, + final TileEntityFuseBox tileEntity) { + super((Container) new ContainerFuseBox(par1InventoryPlayer, tileEntity)); + this.tileEntity = tileEntity; + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float var1, + final int var2, + final int var3) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(getTexture()); + this.containerWidth = (this.width - this.xSize) / 2; + this.containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(this.containerWidth, this.containerHeight, 0, 0, + this.xSize, this.ySize); + } + + @Override + protected void drawGuiContainerForegroundLayer(final int par1, + final int par2) { + this.fontRendererObj.drawString( + TranslationHelper.getLocal(this.tileEntity.getInventoryName()), 8, 6, + 4210752); + final String displayVoltage = ElectricityDisplay.getDisplayShort( + this.tileEntity.getVoltage(), ElectricityDisplay.ElectricUnit.VOLTAGE); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("container.voltage") + ": " + + displayVoltage, + 65, 55, 4210752); + if (this.tileEntity.getStackInSlot(0) != null) { + final ItemStack fuseStack = this.tileEntity.getStackInSlot(0); + final IItemFuse fuse = (IItemFuse) fuseStack.getItem(); + this.fontRendererObj.drawString( + this.tileEntity.getStackInSlot(0).getUnlocalizedName(), 30, 18, + 4210752); + this.fontRendererObj.drawString( + TranslationHelper.getLocal(fuse.getUnlocalizedName(fuseStack)), 30, + 18, 4210752); + } + } + + public static ResourceLocation getTexture() { + return new ResourceLocation("electricexpansion", + "textures/gui/GuiFuseBox.png"); + } +} diff --git a/src/main/java/electricexpansion/client/gui/GuiInsulationMachine.java b/src/main/java/electricexpansion/client/gui/GuiInsulationMachine.java new file mode 100644 index 0000000..8de48ec --- /dev/null +++ b/src/main/java/electricexpansion/client/gui/GuiInsulationMachine.java @@ -0,0 +1,88 @@ +package electricexpansion.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.containers.ContainerInsulationMachine; +import electricexpansion.common.tile.TileEntityInsulatingMachine; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; +import universalelectricity.core.electricity.ElectricityDisplay; + +@SideOnly(Side.CLIENT) +public class GuiInsulationMachine extends GuiContainer { + private TileEntityInsulatingMachine tileEntity; + private int containerWidth; + private int containerHeight; + + public GuiInsulationMachine(final InventoryPlayer par1InventoryPlayer, + final TileEntityInsulatingMachine tileEntity) { + super((Container) new ContainerInsulationMachine(par1InventoryPlayer, + tileEntity)); + this.tileEntity = tileEntity; + } + + @Override + protected void drawGuiContainerForegroundLayer(final int par1, + final int par2) { + this.fontRendererObj.drawString("Insulation Refiner", 60, 6, 4210752); + String displayText = ""; + if (this.tileEntity.isDisabled()) { + displayText = "Disabled!"; + } else if (this.tileEntity.getProcessTimeLeft() > 0) { + displayText = "Working"; + } else { + displayText = "Idle"; + } + this.fontRendererObj.drawString("Status: " + displayText, 82, 45, 4210752); + this.fontRendererObj.drawString( + "Voltage: " + ElectricityDisplay.getDisplayShort( + this.tileEntity.getVoltage(), + ElectricityDisplay.ElectricUnit.VOLTAGE), + 82, 56, 4210752); + final StringBuilder append = new StringBuilder().append("Require: "); + this.fontRendererObj.drawString( + append + .append(ElectricityDisplay.getDisplayShort( + 500.0 * 20.0, ElectricityDisplay.ElectricUnit.WATT)) + .toString(), + 82, 68, 4210752); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("container.inventory"), 8, + this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float par1, + final int par2, + final int par3) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(getTexture()); + this.containerWidth = (this.width - this.xSize) / 2; + this.containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(this.containerWidth, this.containerHeight, 0, 0, + this.xSize, this.ySize); + if (this.tileEntity.getProcessTimeLeft() >= 0) { + final int scale = (int) (this.tileEntity.getProcessTimeLeft() / + (double) this.tileEntity.getProcessingTime() * 23.0); + this.drawTexturedModalRect(this.containerWidth + 77, + this.containerHeight + 27, 176, 0, 23 - scale, + 13); + } + if (this.tileEntity.getJoules() >= 0.0) { + final int scale = (int) (this.tileEntity.getJoules() / + this.tileEntity.getMaxJoules() * 50.0); + this.drawTexturedModalRect(this.containerWidth + 35, + this.containerHeight + 20, 176, 13, 4, + 50 - scale); + } + } + + public static ResourceLocation getTexture() { + return new ResourceLocation("electricexpansion", + "textures/gui/GuiEEMachine.png"); + } +} diff --git a/src/main/java/electricexpansion/client/gui/GuiLogisticsWire.java b/src/main/java/electricexpansion/client/gui/GuiLogisticsWire.java new file mode 100644 index 0000000..a55589c --- /dev/null +++ b/src/main/java/electricexpansion/client/gui/GuiLogisticsWire.java @@ -0,0 +1,110 @@ +package electricexpansion.client.gui; + +import electricexpansion.common.ElectricExpansion; +import electricexpansion.common.cables.TileEntityLogisticsWire; +import electricexpansion.common.helpers.PacketLogisticsWireButton; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import universalelectricity.core.vector.Vector3; + +public class GuiLogisticsWire extends GuiScreen { + private TileEntityLogisticsWire tileEntity; + public final int xSizeOfTexture = 176; + public final int ySizeOfTexture = 88; + + public GuiLogisticsWire(final TileEntityLogisticsWire LogisticsWire) { + this.tileEntity = LogisticsWire; + } + + @Override + public void drawScreen(final int x, final int y, final float f) { + this.drawDefaultBackground(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(getTexture()); + final int field_73880_f = this.width; + this.getClass(); + final int posX = (field_73880_f - 176) / 2; + final int field_73881_g = this.height; + this.getClass(); + final int posY = (field_73881_g - 88) / 2; + final int n = posX; + final int n2 = posY; + final int n3 = 0; + final int n4 = 0; + this.getClass(); + final int n5 = 176; + this.getClass(); + this.drawTexturedModalRect(n, n2, n3, n4, n5, 88); + final String s = "Logistics Wire"; + final int n6 = posX; + this.getClass(); + this.fontRendererObj.drawString(s, n6 + 176 / 2 - 35, posY + 4, 4210752); + super.drawScreen(x, y, f); + } + + @Override + public void onGuiClosed() { + super.onGuiClosed(); + // TODO: WTF + // PacketDispatcher.sendPacketToServer(PacketManager.getPacket("ElecEx", + // this.tileEntity, 7, false)); + } + + @Override + public void actionPerformed(final GuiButton button) { + boolean status = false; + + switch (button.id) { + case 0: + this.tileEntity.buttonStatus0 = !this.tileEntity.buttonStatus0; + status = this.tileEntity.buttonStatus0; + break; + + case 1: + this.tileEntity.buttonStatus1 = !this.tileEntity.buttonStatus1; + status = this.tileEntity.buttonStatus1; + break; + + case 2: + this.tileEntity.buttonStatus2 = !this.tileEntity.buttonStatus2; + status = this.tileEntity.buttonStatus2; + break; + } + + ElectricExpansion.channel.sendToServer(new PacketLogisticsWireButton( + new Vector3(this.tileEntity), button.id, status)); + } + + @Override + public void updateScreen() { + super.updateScreen(); + this.buttonList.clear(); + final int field_73880_f = this.width; + this.getClass(); + final int posX = (field_73880_f - 176) / 2; + final int field_73881_g = this.height; + this.getClass(); + final int posY = (field_73881_g - 88) / 2; + this.buttonList.add(new GuiSwitchButton(0, posX + 13, posY + 15, 150, 16, + "Output to World", + this.tileEntity.buttonStatus0)); + this.buttonList.add(new GuiSwitchButton(1, posX + 13, posY + 38, 150, 16, + "Output to RS Network", + this.tileEntity.buttonStatus1)); + this.buttonList.add(new GuiSwitchButton(2, posX + 13, posY + 61, 150, 16, + "Unused", + this.tileEntity.buttonStatus2)); + if (!this.mc.thePlayer.isEntityAlive() || + ((Entity) this.mc.thePlayer).isDead) { + this.mc.thePlayer.closeScreen(); + } + } + + public static ResourceLocation getTexture() { + return new ResourceLocation("electricexpansion", + "textures/gui/GuiLogistics.png"); + } +} diff --git a/src/main/java/electricexpansion/client/gui/GuiQuantumBatteryBox.java b/src/main/java/electricexpansion/client/gui/GuiQuantumBatteryBox.java new file mode 100644 index 0000000..37f01a5 --- /dev/null +++ b/src/main/java/electricexpansion/client/gui/GuiQuantumBatteryBox.java @@ -0,0 +1,134 @@ +package electricexpansion.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.ElectricExpansion; +import electricexpansion.common.containers.ContainerDistribution; +import electricexpansion.common.helpers.PacketUpdateQuantumBatteryBoxFrequency; +import electricexpansion.common.tile.TileEntityQuantumBatteryBox; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import universalelectricity.core.electricity.ElectricityDisplay; +import universalelectricity.core.vector.Vector3; +import universalelectricity.prefab.TranslationHelper; + +@SideOnly(Side.CLIENT) +public class GuiQuantumBatteryBox extends GuiContainer { + private TileEntityQuantumBatteryBox tileEntity; + private GuiTextField textFieldFrequency; + private int containerWidth; + private int containerHeight; + private byte frequency; + + public GuiQuantumBatteryBox(final InventoryPlayer par1InventoryPlayer, + final TileEntityQuantumBatteryBox tileEntity) { + super( + (Container) new ContainerDistribution(par1InventoryPlayer, tileEntity)); + this.tileEntity = tileEntity; + } + + @Override + public void initGui() { + super.initGui(); + final int var1 = (this.width - this.xSize) / 2; + final int var2 = (this.height - this.ySize) / 2; + (this.textFieldFrequency = new GuiTextField(this.fontRendererObj, 6, 45, 49, 13)) + .setMaxStringLength(3); + this.textFieldFrequency.setText(this.tileEntity.getFrequency() + ""); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, var1 + 6, var2 + 60, 50, 20, "Set")); + } + + @Override + protected void drawGuiContainerForegroundLayer(final int par1, + final int par2) { + this.textFieldFrequency.drawTextBox(); + final String displayJoules = ElectricityDisplay.getDisplayShort( + this.tileEntity.getJoulesForDisplay(new Object[0]), + ElectricityDisplay.ElectricUnit.JOULES); + this.fontRendererObj.drawString( + TranslationHelper.getLocal(this.tileEntity.getInventoryName()), 42, 6, + 4210752); + this.fontRendererObj.drawString("Current Frequency: " + + this.tileEntity.getFrequency(), + 10, 20, 4210752); + this.fontRendererObj.drawString("Current Storage: " + displayJoules, 10, 30, + 4210752); + if (this.tileEntity.getOwningPlayer() != null) { + this.fontRendererObj.drawString( + "Player: " + this.tileEntity.getOwningPlayer(), 65, 66, 4210752); + } else { + this.fontRendererObj.drawString("I have no owner. BUG!", 62, 66, 4210752); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float par1, + final int par2, + final int par3) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(getTexture()); + this.containerWidth = (this.width - this.xSize) / 2; + this.containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(this.containerWidth, this.containerHeight, 0, 0, + this.xSize, this.ySize); + if (this.tileEntity.getJoulesForDisplay(new Object[0]) > 0.0) { + final int scale = (int) (this.tileEntity.getJoulesForDisplay(new Object[0]) / + this.tileEntity.getMaxJoules() * 72.0); + this.drawTexturedModalRect(this.containerWidth + 70, + this.containerHeight + 51, 0, 166, scale, 5); + } + } + + @Override + protected void mouseClicked(final int par1, final int par2, final int par3) { + super.mouseClicked(par1, par2, par3); + this.textFieldFrequency.mouseClicked(par1 - this.containerWidth, + par2 - this.containerHeight, par3); + } + + @Override + protected void keyTyped(final char par1, final int par2) { + super.keyTyped(par1, par2); + if (par2 == 28) { + ElectricExpansion.channel.sendToServer( + new PacketUpdateQuantumBatteryBoxFrequency( + new Vector3(this.tileEntity), this.frequency)); + } + this.textFieldFrequency.textboxKeyTyped(par1, par2); + try { + final byte newFrequency = (byte) Math.max(Byte.parseByte(this.textFieldFrequency.getText()), 0); + this.frequency = newFrequency; + } catch (final Exception ex) { + } + } + + @Override + public void actionPerformed(final GuiButton button) { + switch (button.id) { + case 0: + ElectricExpansion.channel.sendToServer( + new PacketUpdateQuantumBatteryBoxFrequency( + new Vector3(this.tileEntity), this.frequency)); + break; + } + } + + @Override + public void updateScreen() { + if (!this.textFieldFrequency.isFocused()) { + this.textFieldFrequency.setText(this.tileEntity.getFrequency() + ""); + } + } + + public static ResourceLocation getTexture() { + return new ResourceLocation("electricexpansion", + "textures/gui/GuiLogistics.png"); + } +} diff --git a/src/main/java/electricexpansion/client/gui/GuiSwitchButton.java b/src/main/java/electricexpansion/client/gui/GuiSwitchButton.java new file mode 100644 index 0000000..181a6fa --- /dev/null +++ b/src/main/java/electricexpansion/client/gui/GuiSwitchButton.java @@ -0,0 +1,76 @@ +package electricexpansion.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiSwitchButton extends GuiButton { + private boolean isActive; + + public GuiSwitchButton(final int par1, final int par2, final int par3, + final String par4Str, final boolean initState) { + this(par1, par2, par3, 200, 16, par4Str, initState); + } + + public GuiSwitchButton(final int par1, final int par2, final int par3, + final int par4, final int par5, final String par6Str, + final boolean initState) { + super(par1, par2, par3, par4, par5, par6Str); + this.width = 200; + this.height = 16; + this.enabled = true; + // TODO: WTF + // this.drawButton = true; + this.id = par1; + this.xPosition = par2; + this.yPosition = par3; + this.width = par4; + this.height = par5; + this.displayString = par6Str; + this.isActive = initState; + } + + @Override + public void drawButton(final Minecraft par1Minecraft, final int xpos, + final int ypos) { + final FontRenderer fontrenderer = par1Minecraft.fontRenderer; + par1Minecraft.renderEngine.bindTexture(new ResourceLocation( + "electricexpansion", "textures/gui/SwitchButton.png")); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + // TODO: WTF + // field_82253_i + this.field_146123_n = (xpos >= this.xPosition && ypos >= this.yPosition && + xpos < this.xPosition + this.width && + ypos < this.yPosition + this.height); + int var5 = 0; + if (this.isActive) { + var5 = 16; + } + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, var5, + this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, + 200 - this.width / 2, var5, this.width / 2, + this.height); + this.mouseDragged(par1Minecraft, xpos, ypos); + this.drawCenteredString(fontrenderer, this.displayString, + this.xPosition + this.width / 2, + this.yPosition + (this.height - 8) / 2, + this.isActive ? 25600 : 16711680); + } + + @Override + public boolean mousePressed(final Minecraft par1Minecraft, final int par2, + final int par3) { + if (this.getHoverState(this.field_146123_n) == 2) { + this.isActive = !this.isActive; + } + return this.enabled /* && this.drawButton */ && par2 >= this.xPosition && + par3 >= this.yPosition && par2 < this.xPosition + this.width && + par3 < this.yPosition + this.height; + } +} diff --git a/src/main/java/electricexpansion/client/gui/GuiWireMill.java b/src/main/java/electricexpansion/client/gui/GuiWireMill.java new file mode 100644 index 0000000..0b10d4c --- /dev/null +++ b/src/main/java/electricexpansion/client/gui/GuiWireMill.java @@ -0,0 +1,89 @@ +package electricexpansion.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.containers.ContainerWireMill; +import electricexpansion.common.tile.TileEntityWireMill; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import org.lwjgl.opengl.GL11; +import universalelectricity.core.electricity.ElectricityDisplay; + +@SideOnly(Side.CLIENT) +public class GuiWireMill extends GuiContainer { + private TileEntityWireMill tileEntity; + private int containerWidth; + private int containerHeight; + + public GuiWireMill(final InventoryPlayer par1InventoryPlayer, + final TileEntityWireMill tileEntity) { + super((Container) new ContainerWireMill(par1InventoryPlayer, tileEntity)); + this.tileEntity = tileEntity; + } + + @Override + protected void drawGuiContainerForegroundLayer(final int par1, + final int par2) { + this.fontRendererObj.drawString("Wire Mill", 60, 6, 4210752); + String displayText = ""; + if (this.tileEntity.isDisabled()) { + displayText = "Disabled!"; + } else if (this.tileEntity.getDrawingTimeLeft() > 0) { + displayText = "Working"; + } else { + displayText = "Idle"; + } + this.fontRendererObj.drawString("Status: " + displayText, 82, 45, 4210752); + this.fontRendererObj.drawString( + "Voltage: " + ElectricityDisplay.getDisplayShort( + this.tileEntity.getVoltage(), + ElectricityDisplay.ElectricUnit.VOLTAGE), + 82, 56, 4210752); + final FontRenderer fontRendererObj = this.fontRendererObj; + final StringBuilder append = new StringBuilder().append("Require: "); + fontRendererObj.drawString( + append + .append(ElectricityDisplay.getDisplayShort( + 500.0 * 20.0, ElectricityDisplay.ElectricUnit.WATT)) + .toString(), + 82, 68, 4210752); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("container.inventory"), 8, + this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(final float par1, + final int par2, + final int par3) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.renderEngine.bindTexture(getTexture()); + this.containerWidth = (this.width - this.xSize) / 2; + this.containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(this.containerWidth, this.containerHeight, 0, 0, + this.xSize, this.ySize); + if (this.tileEntity.getDrawingTimeLeft() > 0) { + final int scale = (int) (this.tileEntity.getDrawingTimeLeft() / + (double) this.tileEntity.getDrawingTime() * 23.0); + this.drawTexturedModalRect(this.containerWidth + 77, + this.containerHeight + 27, 176, 0, 23 - scale, + 13); + } + if (this.tileEntity.getJoules() >= 0.0) { + final int scale = (int) (this.tileEntity.getJoules() / + this.tileEntity.getMaxJoules() * 50.0); + this.drawTexturedModalRect(this.containerWidth + 35, + this.containerHeight + 20, 176, 13, 4, + 50 - scale); + } + } + + public static ResourceLocation getTexture() { + return new ResourceLocation("electricexpansion", + "textures/gui/GuiEEMachine.png"); + } +} diff --git a/src/main/java/electricexpansion/client/model/ModelInsulatedWire.java b/src/main/java/electricexpansion/client/model/ModelInsulatedWire.java new file mode 100644 index 0000000..5986a3e --- /dev/null +++ b/src/main/java/electricexpansion/client/model/ModelInsulatedWire.java @@ -0,0 +1,106 @@ +package electricexpansion.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelInsulatedWire extends ModelBase { + ModelRenderer Middle; + ModelRenderer Right; + ModelRenderer Left; + ModelRenderer Back; + ModelRenderer Front; + ModelRenderer Top; + ModelRenderer Bottom; + + public ModelInsulatedWire() { + super.textureWidth = 64; + super.textureHeight = 32; + (this.Middle = new ModelRenderer((ModelBase) this, 0, 0)) + .addBox(0.0f, 0.0f, 0.0f, 4, 4, 4); + this.Middle.setRotationPoint(-2.0f, 14.0f, -2.0f); + this.Middle.setTextureSize(super.textureWidth, super.textureHeight); + this.Middle.mirror = true; + this.setRotation(this.Middle, 0.0f, 0.0f, 0.0f); + (this.Right = new ModelRenderer((ModelBase) this, 22, 0)) + .addBox(0.0f, 0.0f, 0.0f, 6, 4, 4); + this.Right.setRotationPoint(2.0f, 14.0f, -2.0f); + this.Right.setTextureSize(super.textureWidth, super.textureHeight); + this.Right.mirror = true; + this.setRotation(this.Right, 0.0f, 0.0f, 0.0f); + (this.Left = new ModelRenderer((ModelBase) this, 44, 0)) + .addBox(0.0f, 0.0f, 0.0f, 6, 4, 4); + this.Left.setRotationPoint(-8.0f, 14.0f, -2.0f); + this.Left.setTextureSize(super.textureWidth, super.textureHeight); + this.Left.mirror = true; + this.setRotation(this.Left, 0.0f, 0.0f, 0.0f); + (this.Back = new ModelRenderer((ModelBase) this, 0, 10)) + .addBox(0.0f, 0.0f, 0.0f, 4, 4, 6); + this.Back.setRotationPoint(-2.0f, 14.0f, 2.0f); + this.Back.setTextureSize(super.textureWidth, super.textureHeight); + this.Back.mirror = true; + this.setRotation(this.Back, 0.0f, 0.0f, 0.0f); + (this.Front = new ModelRenderer((ModelBase) this, 0, 22)) + .addBox(0.0f, 0.0f, 0.0f, 4, 4, 6); + this.Front.setRotationPoint(-2.0f, 14.0f, -8.0f); + this.Front.setTextureSize(super.textureWidth, super.textureHeight); + this.Front.mirror = true; + this.setRotation(this.Front, 0.0f, 0.0f, 0.0f); + (this.Top = new ModelRenderer((ModelBase) this, 22, 22)) + .addBox(0.0f, 0.0f, 0.0f, 4, 6, 4); + this.Top.setRotationPoint(-2.0f, 8.0f, -2.0f); + this.Top.setTextureSize(super.textureWidth, super.textureHeight); + this.Top.mirror = true; + this.setRotation(this.Top, 0.0f, 0.0f, 0.0f); + (this.Bottom = new ModelRenderer((ModelBase) this, 22, 10)) + .addBox(0.0f, 0.0f, 0.0f, 4, 6, 4); + this.Bottom.setRotationPoint(-2.0f, 18.0f, -2.0f); + this.Bottom.setTextureSize(super.textureWidth, super.textureHeight); + this.Bottom.mirror = true; + this.setRotation(this.Bottom, 0.0f, 0.0f, 0.0f); + } + + public void renderMiddle() { + this.Middle.render(0.0625f); + } + + public void renderBottom() { + this.Bottom.render(0.0625f); + } + + public void renderTop() { + this.Top.render(0.0625f); + } + + public void renderLeft() { + this.Left.render(0.0625f); + } + + public void renderRight() { + this.Right.render(0.0625f); + } + + public void renderBack() { + this.Back.render(0.0625f); + } + + public void renderFront() { + this.Front.render(0.0625f); + } + + private void setRotation(final ModelRenderer model, final float x, + final float y, final float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(final float f, final float f1, final float f2, + final float f3, final float f4, final float f5, + final Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/src/main/java/electricexpansion/client/model/ModelRawWire.java b/src/main/java/electricexpansion/client/model/ModelRawWire.java new file mode 100644 index 0000000..f0f1c16 --- /dev/null +++ b/src/main/java/electricexpansion/client/model/ModelRawWire.java @@ -0,0 +1,99 @@ +package electricexpansion.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; + +@SideOnly(Side.CLIENT) +public class ModelRawWire extends ModelBase { + ModelRenderer Middle; + ModelRenderer Right; + ModelRenderer Back; + ModelRenderer Left; + ModelRenderer Front; + ModelRenderer Bottom; + ModelRenderer Top; + + public ModelRawWire() { + super.textureWidth = 64; + super.textureHeight = 32; + (this.Middle = new ModelRenderer((ModelBase) this, 0, 0)) + .addBox(0.0f, 0.0f, 0.0f, 2, 2, 2); + this.Middle.setRotationPoint(-1.0f, 15.0f, -1.0f); + this.Middle.setTextureSize(64, 32); + this.Middle.mirror = true; + this.setRotation(this.Middle, 0.0f, 0.0f, 0.0f); + (this.Right = new ModelRenderer((ModelBase) this, 22, 0)) + .addBox(0.0f, 0.0f, 0.0f, 7, 2, 2); + this.Right.setRotationPoint(1.0f, 15.0f, -1.0f); + this.Right.setTextureSize(64, 32); + this.Right.mirror = true; + this.setRotation(this.Right, 0.0f, 0.0f, 0.0f); + (this.Back = new ModelRenderer((ModelBase) this, 0, 10)) + .addBox(0.0f, 0.0f, 0.0f, 2, 2, 7); + this.Back.setRotationPoint(-1.0f, 15.0f, 1.0f); + this.Back.setTextureSize(64, 32); + this.Back.mirror = true; + this.setRotation(this.Back, 0.0f, 0.0f, 0.0f); + (this.Left = new ModelRenderer((ModelBase) this, 44, 0)) + .addBox(0.0f, 0.0f, 0.0f, 7, 2, 2); + this.Left.setRotationPoint(-8.0f, 15.0f, -1.0f); + this.Left.setTextureSize(64, 32); + this.Left.mirror = true; + this.setRotation(this.Left, 0.0f, 0.0f, 0.0f); + (this.Front = new ModelRenderer((ModelBase) this, 0, 22)) + .addBox(0.0f, 0.0f, 0.0f, 2, 2, 7); + this.Front.setRotationPoint(-1.0f, 15.0f, -8.0f); + this.Front.setTextureSize(64, 32); + this.Front.mirror = true; + this.setRotation(this.Front, 0.0f, 0.0f, 0.0f); + (this.Bottom = new ModelRenderer((ModelBase) this, 22, 10)) + .addBox(0.0f, 0.0f, 0.0f, 2, 7, 2); + this.Bottom.setRotationPoint(-1.0f, 17.0f, -1.0f); + this.Bottom.setTextureSize(64, 32); + this.Bottom.mirror = true; + this.setRotation(this.Bottom, 0.0f, 0.0f, 0.0f); + (this.Top = new ModelRenderer((ModelBase) this, 22, 22)) + .addBox(0.0f, 0.0f, 0.0f, 2, 7, 2); + this.Top.setRotationPoint(-1.0f, 8.0f, -1.0f); + this.Top.setTextureSize(64, 32); + this.Top.mirror = true; + this.setRotation(this.Top, 0.0f, 0.0f, 0.0f); + } + + public void renderMiddle() { + this.Middle.render(0.0625f); + } + + public void renderBottom() { + this.Bottom.render(0.0625f); + } + + public void renderTop() { + this.Top.render(0.0625f); + } + + public void renderLeft() { + this.Left.render(0.0625f); + } + + public void renderRight() { + this.Right.render(0.0625f); + } + + public void renderBack() { + this.Back.render(0.0625f); + } + + public void renderFront() { + this.Front.render(0.0625f); + } + + private void setRotation(final ModelRenderer model, final float x, + final float y, final float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/electricexpansion/client/model/ModelTransformer.java b/src/main/java/electricexpansion/client/model/ModelTransformer.java new file mode 100644 index 0000000..b5adc05 --- /dev/null +++ b/src/main/java/electricexpansion/client/model/ModelTransformer.java @@ -0,0 +1,148 @@ +package electricexpansion.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelTransformer extends ModelBase { + ModelRenderer a; + ModelRenderer b; + ModelRenderer c; + ModelRenderer d; + ModelRenderer out2; + ModelRenderer out1; + ModelRenderer out3; + ModelRenderer out4; + ModelRenderer i; + ModelRenderer j; + ModelRenderer in1; + ModelRenderer in2; + ModelRenderer in3; + ModelRenderer in4; + + public ModelTransformer() { + super.textureWidth = 70; + super.textureHeight = 45; + (this.a = new ModelRenderer((ModelBase) this, 0, 0)) + .addBox(-8.0f, 0.0f, -8.0f, 16, 2, 16); + this.a.setRotationPoint(0.0f, 22.0f, 0.0f); + this.a.setTextureSize(70, 45); + this.a.mirror = true; + this.setRotation(this.a, 0.0f, 0.0f, 0.0f); + (this.b = new ModelRenderer((ModelBase) this, 0, 19)) + .addBox(0.0f, 0.0f, -2.0f, 3, 11, 4); + this.b.setRotationPoint(5.0f, 11.0f, 0.0f); + this.b.setTextureSize(70, 45); + this.b.mirror = true; + this.setRotation(this.b, 0.0f, 0.0f, 0.0f); + (this.c = new ModelRenderer((ModelBase) this, 0, 19)) + .addBox(0.0f, 0.0f, -2.0f, 3, 11, 4); + this.c.setRotationPoint(-8.0f, 11.0f, 0.0f); + this.c.setTextureSize(70, 45); + this.c.mirror = true; + this.setRotation(this.c, 0.0f, 0.0f, 0.0f); + (this.d = new ModelRenderer((ModelBase) this, 15, 19)) + .addBox(0.0f, 0.0f, -2.0f, 16, 1, 4); + this.d.setRotationPoint(-8.0f, 10.0f, 0.0f); + this.d.setTextureSize(70, 45); + this.d.mirror = true; + this.setRotation(this.d, 0.0f, 0.0f, 0.0f); + (this.out2 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.out2.setRotationPoint(-9.0f, 16.0f, 0.0f); + this.out2.setTextureSize(70, 45); + this.out2.mirror = true; + this.setRotation(this.out2, 0.0f, 0.0f, 0.0f); + (this.out1 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.out1.setRotationPoint(-9.0f, 15.0f, 0.0f); + this.out1.setTextureSize(70, 45); + this.out1.mirror = true; + this.setRotation(this.out1, 0.0f, 0.0f, 0.0f); + (this.out3 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.out3.setRotationPoint(-9.0f, 17.0f, 0.0f); + this.out3.setTextureSize(70, 45); + this.out3.mirror = true; + this.setRotation(this.out3, 0.0f, 0.0f, 0.0f); + (this.out4 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.out4.setRotationPoint(-9.0f, 18.0f, 0.0f); + this.out4.setTextureSize(70, 45); + this.out4.mirror = true; + this.setRotation(this.out4, 0.0f, 0.0f, 0.0f); + (this.i = new ModelRenderer((ModelBase) this, 34, 35)) + .addBox(0.0f, 0.0f, -1.0f, 2, 5, 2); + this.i.setRotationPoint(-10.0f, 14.0f, 0.0f); + this.i.setTextureSize(70, 45); + this.i.mirror = true; + this.setRotation(this.i, 0.0f, 0.0f, 0.0f); + (this.j = new ModelRenderer((ModelBase) this, 24, 35)) + .addBox(0.0f, 0.0f, -1.0f, 2, 5, 2); + this.j.setRotationPoint(8.0f, 14.0f, 0.0f); + this.j.setTextureSize(70, 45); + this.j.mirror = true; + this.setRotation(this.j, 0.0f, 0.0f, 0.0f); + (this.in1 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.in1.setRotationPoint(4.0f, 15.0f, 0.0f); + this.in1.setTextureSize(70, 45); + this.in1.mirror = true; + this.setRotation(this.in1, 0.0f, 0.0f, 0.0f); + (this.in2 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.in2.setRotationPoint(4.0f, 16.0f, 0.0f); + this.in2.setTextureSize(70, 45); + this.in2.mirror = true; + this.setRotation(this.in2, 0.0f, 0.0f, 0.0f); + (this.in3 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.in3.setRotationPoint(4.0f, 17.0f, 0.0f); + this.in3.setTextureSize(70, 45); + this.in3.mirror = true; + this.setRotation(this.in3, 0.0f, 0.0f, 0.0f); + (this.in4 = new ModelRenderer((ModelBase) this, 0, 35)) + .addBox(0.0f, 0.0f, -3.0f, 5, 0, 6); + this.in4.setRotationPoint(4.0f, 18.0f, 0.0f); + this.in4.setTextureSize(70, 45); + this.in4.mirror = true; + this.setRotation(this.in4, 0.0f, 0.0f, 0.0f); + } + + public void render(final Entity entity, final float f, final float f1, + final float f2, final float f3, final float f4, + final float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.a.render(f5); + this.b.render(f5); + this.c.render(f5); + this.d.render(f5); + this.out2.render(f5); + this.out1.render(f5); + this.out3.render(f5); + this.out4.render(f5); + this.i.render(f5); + this.j.render(f5); + this.in1.render(f5); + this.in2.render(f5); + this.in3.render(f5); + this.in4.render(f5); + } + + private void setRotation(final ModelRenderer model, final float x, + final float y, final float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(final float f, final float f1, final float f2, + final float f3, final float f4, final float f5, + final Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/src/main/java/electricexpansion/client/model/ModelWireMill.java b/src/main/java/electricexpansion/client/model/ModelWireMill.java new file mode 100644 index 0000000..b84f865 --- /dev/null +++ b/src/main/java/electricexpansion/client/model/ModelWireMill.java @@ -0,0 +1,148 @@ +package electricexpansion.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelWireMill extends ModelBase { + ModelRenderer base; + ModelRenderer plug; + ModelRenderer part1; + ModelRenderer part2; + ModelRenderer part3; + ModelRenderer part4; + ModelRenderer support; + ModelRenderer support2; + ModelRenderer container; + ModelRenderer support3; + ModelRenderer support4; + ModelRenderer gear1rot; + ModelRenderer gear2rot; + ModelRenderer output; + + public ModelWireMill() { + super.textureWidth = 128; + super.textureHeight = 128; + (this.base = new ModelRenderer((ModelBase) this, 0, 0)) + .addBox(0.0f, 0.0f, 0.0f, 16, 1, 16); + this.base.setRotationPoint(-8.0f, 23.0f, -8.0f); + this.base.setTextureSize(128, 128); + this.base.mirror = true; + this.setRotation(this.base, 0.0f, 0.0f, 0.0f); + (this.plug = new ModelRenderer((ModelBase) this, 0, 19)) + .addBox(0.0f, 0.0f, 0.0f, 5, 12, 12); + this.plug.setRotationPoint(-7.0f, 11.0f, -4.0f); + this.plug.setTextureSize(128, 128); + this.plug.mirror = true; + this.setRotation(this.plug, 0.0f, 0.0f, 0.0f); + (this.part1 = new ModelRenderer((ModelBase) this, 0, 20)) + .addBox(0.0f, -1.0f, 0.0f, 1, 2, 1); + this.part1.setRotationPoint(-8.0f, 14.0f, 0.0f); + this.part1.setTextureSize(128, 128); + this.part1.mirror = true; + this.setRotation(this.part1, 0.0f, 0.0f, 0.0f); + (this.part2 = new ModelRenderer((ModelBase) this, 0, 20)) + .addBox(0.0f, -1.0f, -3.0f, 1, 2, 1); + this.part2.setRotationPoint(-8.0f, 14.0f, 0.0f); + this.part2.setTextureSize(128, 128); + this.part2.mirror = true; + this.setRotation(this.part2, 0.0f, 0.0f, 0.0f); + (this.part3 = new ModelRenderer((ModelBase) this, 0, 20)) + .addBox(0.0f, -2.0f, -1.0f, 1, 1, 2); + this.part3.setRotationPoint(-8.0f, 14.0f, -1.0f); + this.part3.setTextureSize(128, 128); + this.part3.mirror = true; + this.setRotation(this.part3, 0.0f, 0.0f, 0.0f); + (this.part4 = new ModelRenderer((ModelBase) this, 0, 20)) + .addBox(0.0f, 1.0f, -1.0f, 1, 1, 2); + this.part4.setRotationPoint(-8.0f, 14.0f, -1.0f); + this.part4.setTextureSize(128, 128); + this.part4.mirror = true; + this.setRotation(this.part4, 0.0f, 0.0f, 0.0f); + (this.support = new ModelRenderer((ModelBase) this, 0, 46)) + .addBox(0.0f, 0.0f, 0.0f, 5, 5, 4); + this.support.setRotationPoint(-7.0f, 18.0f, -8.0f); + this.support.setTextureSize(128, 128); + this.support.mirror = true; + this.setRotation(this.support, 0.0f, 0.0f, 0.0f); + (this.support2 = new ModelRenderer((ModelBase) this, 19, 46)) + .addBox(0.0f, 0.0f, 0.0f, 5, 8, 4); + this.support2.setRotationPoint(-7.0f, 11.0f, -4.0f); + this.support2.setTextureSize(128, 128); + this.support2.mirror = true; + this.setRotation(this.support2, -0.5235988f, 0.0f, 0.0f); + (this.container = new ModelRenderer((ModelBase) this, 48, 36)) + .addBox(0.0f, 0.0f, 0.0f, 10, 15, 5); + this.container.setRotationPoint(-2.0f, 8.0f, 3.0f); + this.container.setTextureSize(128, 128); + this.container.mirror = true; + this.setRotation(this.container, 0.0f, 0.0f, 0.0f); + (this.support3 = new ModelRenderer((ModelBase) this, 80, 20)) + .addBox(0.0f, 0.0f, 0.0f, 2, 12, 4); + this.support3.setRotationPoint(6.0f, 11.0f, -1.0f); + this.support3.setTextureSize(128, 128); + this.support3.mirror = true; + this.setRotation(this.support3, 0.0f, 0.0f, 0.0f); + (this.support4 = new ModelRenderer((ModelBase) this, 80, 20)) + .addBox(0.0f, 0.0f, 0.0f, 2, 12, 4); + this.support4.setRotationPoint(-2.0f, 11.0f, -1.0f); + this.support4.setTextureSize(128, 128); + this.support4.mirror = true; + this.setRotation(this.support4, 0.0f, 0.0f, 0.0f); + (this.gear1rot = new ModelRenderer((ModelBase) this, 67, 13)) + .addBox(0.0f, -1.0f, -1.0f, 6, 2, 2); + this.gear1rot.setRotationPoint(0.0f, 14.0f, 1.0f); + this.gear1rot.setTextureSize(128, 128); + this.gear1rot.mirror = true; + this.setRotation(this.gear1rot, 0.7853982f, 0.0f, 0.0f); + (this.gear2rot = new ModelRenderer((ModelBase) this, 67, 13)) + .addBox(0.0f, -1.0f, -1.0f, 6, 2, 2); + this.gear2rot.setRotationPoint(0.0f, 17.0f, 1.0f); + this.gear2rot.setTextureSize(128, 128); + this.gear2rot.mirror = true; + this.setRotation(this.gear2rot, 0.7853982f, 0.0f, 0.0f); + (this.output = new ModelRenderer((ModelBase) this, 36, 20)) + .addBox(0.0f, 0.0f, 0.0f, 10, 4, 11); + this.output.setRotationPoint(-2.0f, 19.0f, -8.0f); + this.output.setTextureSize(128, 128); + this.output.mirror = true; + this.setRotation(this.output, 0.0f, 0.0f, 0.0f); + } + + public void render(final Entity entity, final float f, final float f1, + final float f2, final float f3, final float f4, + final float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.base.render(f5); + this.plug.render(f5); + this.part1.render(f5); + this.part2.render(f5); + this.part3.render(f5); + this.part4.render(f5); + this.support.render(f5); + this.support2.render(f5); + this.container.render(f5); + this.support3.render(f5); + this.support4.render(f5); + this.gear1rot.render(f5); + this.gear2rot.render(f5); + this.output.render(f5); + } + + private void setRotation(final ModelRenderer model, final float x, + final float y, final float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(final float f, final float f1, final float f2, + final float f3, final float f4, final float f5, + final Entity entity) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/src/main/java/electricexpansion/client/render/RenderFloatingText.java b/src/main/java/electricexpansion/client/render/RenderFloatingText.java new file mode 100644 index 0000000..5056bb8 --- /dev/null +++ b/src/main/java/electricexpansion/client/render/RenderFloatingText.java @@ -0,0 +1,60 @@ +package electricexpansion.client.render; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import org.lwjgl.opengl.GL11; + +public class RenderFloatingText { + public static void renderFloatingText(final String text, final float x, + final float y, final float z) { + renderFloatingText(text, x, y, z, 16777215); + } + + public static void renderFloatingText(final String text, final float x, + final float y, final float z, + final int color) { + final RenderManager renderManager = RenderManager.instance; + final FontRenderer fontRenderer = renderManager.getFontRenderer(); + final float scale = 0.027f; + GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.5f); + GL11.glPushMatrix(); + GL11.glTranslatef(x + 0.0f, y + 2.3f, z); + GL11.glNormal3f(0.0f, 1.0f, 0.0f); + GL11.glRotatef(-renderManager.playerViewY, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(renderManager.playerViewX, 1.0f, 0.0f, 0.0f); + GL11.glScalef(-scale, -scale, scale); + GL11.glDisable(2896); + GL11.glDepthMask(false); + GL11.glDisable(2929); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + final Tessellator tessellator = Tessellator.instance; + final int yOffset = 0; + GL11.glDisable(3553); + tessellator.startDrawingQuads(); + final int stringMiddle = fontRenderer.getStringWidth(text) / 2; + tessellator.setColorRGBA_F(0.0f, 0.0f, 0.0f, 0.5f); + tessellator.addVertex((double) (-stringMiddle - 1), (double) (-1 + yOffset), + 0.0); + tessellator.addVertex((double) (-stringMiddle - 1), (double) (8 + yOffset), + 0.0); + tessellator.addVertex((double) (stringMiddle + 1), (double) (8 + yOffset), + 0.0); + tessellator.addVertex((double) (stringMiddle + 1), (double) (-1 + yOffset), + 0.0); + tessellator.draw(); + GL11.glEnable(3553); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.5f); + fontRenderer.drawString(text, -fontRenderer.getStringWidth(text) / 2, + yOffset, color); + GL11.glEnable(2929); + GL11.glDepthMask(true); + fontRenderer.drawString(text, -fontRenderer.getStringWidth(text) / 2, + yOffset, color); + GL11.glEnable(2896); + GL11.glDisable(3042); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/electricexpansion/client/render/RenderHandler.java b/src/main/java/electricexpansion/client/render/RenderHandler.java new file mode 100644 index 0000000..58ff694 --- /dev/null +++ b/src/main/java/electricexpansion/client/render/RenderHandler.java @@ -0,0 +1,88 @@ +package electricexpansion.client.render; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.client.ClientProxy; +import electricexpansion.client.model.ModelTransformer; +import electricexpansion.client.model.ModelWireMill; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderHandler implements ISimpleBlockRenderingHandler { + public ModelWireMill wireMill; + public ModelTransformer transformer; + + public RenderHandler() { + this.wireMill = new ModelWireMill(); + this.transformer = new ModelTransformer(); + } + + @Override + public void renderInventoryBlock(final Block block, final int metadata, + final int modelID, + final RenderBlocks renderer) { + GL11.glPushMatrix(); + if (block == ElectricExpansionItems.blockWireMill) { + FMLClientHandler.instance().getClient().renderEngine.bindTexture( + new ResourceLocation("electricexpansion", + "textures/models/wiremill.png")); + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + GL11.glTranslatef(0.5f, 0.8f, 0.5f); + GL11.glScalef(1.0f, -1.0f, -1.0f); + this.wireMill.render(null, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0625f); + GL11.glPopMatrix(); + } + if (block == ElectricExpansionItems.blockTransformer) { + switch (metadata / 4) { + case 0: { + FMLClientHandler.instance().getClient().renderEngine.bindTexture( + new ResourceLocation("electricexpansion", + "textures/models/transformer1.png")); + break; + } + case 1: { + FMLClientHandler.instance().getClient().renderEngine.bindTexture( + new ResourceLocation("electricexpansion", + "textures/models/transformer2.png")); + break; + } + case 2: { + FMLClientHandler.instance().getClient().renderEngine.bindTexture( + new ResourceLocation("electricexpansion", + "textures/models/transformer3.png")); + break; + } + } + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + GL11.glTranslatef(0.5f, 0.8f, 0.5f); + GL11.glScalef(1.0f, -1.0f, -1.0f); + this.transformer.render(null, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0625f); + GL11.glPopMatrix(); + } + } + + @Override + public boolean renderWorldBlock(final IBlockAccess world, final int x, + final int y, final int z, final Block block, + final int modelId, + final RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return ClientProxy.RENDER_ID; + } +} diff --git a/src/main/java/electricexpansion/client/render/RenderInsulatedWire.java b/src/main/java/electricexpansion/client/render/RenderInsulatedWire.java new file mode 100644 index 0000000..0d5a603 --- /dev/null +++ b/src/main/java/electricexpansion/client/render/RenderInsulatedWire.java @@ -0,0 +1,309 @@ +package electricexpansion.client.render; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.client.model.ModelInsulatedWire; +import electricexpansion.common.cables.TileEntityInsulatedWire; +import electricexpansion.common.cables.TileEntitySwitchWire; +import electricexpansion.common.helpers.TileEntityConductorBase; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderInsulatedWire extends TileEntitySpecialRenderer { + private static final ModelInsulatedWire model; + + public void renderAModelAt(final TileEntity t, final double x, final double y, + final double z, final float f) { + String textureToUse = "textures/models/"; + final Block block = t.getWorldObj().getBlock(t.xCoord, t.yCoord, t.zCoord); + final int metadata = t.getWorldObj().getBlockMetadata(t.xCoord, t.yCoord, t.zCoord); + if (metadata != -1) { + if (block == ElectricExpansionItems.blockInsulatedWire) { + switch (metadata) { + case 0: { + textureToUse += "InsulatedCopperWire.png"; + break; + } + case 1: { + textureToUse += "InsulatedTinWire.png"; + break; + } + case 2: { + textureToUse += "InsulatedSilverWire.png"; + break; + } + case 3: { + textureToUse += "InsulatedHVWire.png"; + break; + } + case 4: { + textureToUse += "InsulatedSCWire.png"; + break; + } + } + } else if (block == ElectricExpansionItems.blockLogisticsWire) { + switch (metadata) { + case 0: { + textureToUse += "CopperLogisticsWire.png"; + break; + } + case 1: { + textureToUse += "TinLogisticsWire.png"; + break; + } + case 2: { + textureToUse += "SilverLogisticsWire.png"; + break; + } + case 3: { + textureToUse += "HVLogisticsWire.png"; + break; + } + case 4: { + textureToUse += "SCLogisticsWire.png"; + break; + } + } + } else if (block == ElectricExpansionItems.blockSwitchWire) { + if (t.getWorldObj().isBlockIndirectlyGettingPowered(t.xCoord, t.yCoord, + t.zCoord)) { + switch (metadata) { + case 0: { + textureToUse += "CopperSwitchWireOn.png"; + break; + } + case 1: { + textureToUse += "TinSwitchWireOn.png"; + break; + } + case 2: { + textureToUse += "SilverSwitchWireOn.png"; + break; + } + case 3: { + textureToUse += "HVSwitchWireOn.png"; + break; + } + case 4: { + textureToUse += "SCSwitchWireOn.png"; + break; + } + } + } else { + switch (metadata) { + case 0: { + textureToUse += "CopperSwitchWireOff.png"; + break; + } + case 1: { + textureToUse += "TinSwitchWireOff.png"; + break; + } + case 2: { + textureToUse += "SilverSwitchWireOff.png"; + break; + } + case 3: { + textureToUse += "HVSwitchWireOff.png"; + break; + } + case 4: { + textureToUse += "SCSwitchWireOff.png"; + break; + } + } + } + } else if (block == ElectricExpansionItems.blockRedstonePaintedWire) { + switch (metadata) { + case 0: { + textureToUse += "CopperRSWire.png"; + break; + } + case 1: { + textureToUse += "TinRSWire.png"; + break; + } + case 2: { + textureToUse += "SilverRSWire.png"; + break; + } + case 3: { + textureToUse += "HVRSWire.png"; + break; + } + case 4: { + textureToUse += "SCRSWire.png"; + break; + } + } + } + } + final TileEntityConductorBase tileEntity = (TileEntityConductorBase) t; + final boolean[] connectedSides = tileEntity.visuallyConnected; + if (textureToUse != null && textureToUse != "" && + !textureToUse.equals("textures/models/")) { + this.bindTexture(new ResourceLocation("electricexpansion", textureToUse)); + } + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f); + GL11.glScalef(1.0f, -1.0f, -1.0f); + if (tileEntity instanceof TileEntitySwitchWire) { + if (tileEntity.getWorldObj().isBlockIndirectlyGettingPowered( + t.xCoord, t.yCoord, t.zCoord)) { + if (connectedSides[0]) { + RenderInsulatedWire.model.renderBottom(); + } + if (connectedSides[1]) { + RenderInsulatedWire.model.renderTop(); + } + if (connectedSides[2]) { + RenderInsulatedWire.model.renderBack(); + } + if (connectedSides[3]) { + RenderInsulatedWire.model.renderFront(); + } + if (connectedSides[4]) { + RenderInsulatedWire.model.renderLeft(); + } + if (connectedSides[5]) { + RenderInsulatedWire.model.renderRight(); + } + } + } else { + if (connectedSides[0]) { + RenderInsulatedWire.model.renderBottom(); + } + if (connectedSides[1]) { + RenderInsulatedWire.model.renderTop(); + } + if (connectedSides[2]) { + RenderInsulatedWire.model.renderBack(); + } + if (connectedSides[3]) { + RenderInsulatedWire.model.renderFront(); + } + if (connectedSides[4]) { + RenderInsulatedWire.model.renderLeft(); + } + if (connectedSides[5]) { + RenderInsulatedWire.model.renderRight(); + } + } + RenderInsulatedWire.model.renderMiddle(); + GL11.glPopMatrix(); + if (tileEntity instanceof TileEntityInsulatedWire) { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f); + GL11.glScalef(1.0f, -1.0f, -1.0f); + this.bindTexture(new ResourceLocation( + "electricexpansion", "textures/models/WirePaintOverlay.png")); + final byte colorByte = ((TileEntityInsulatedWire) tileEntity).colorByte; + switch (colorByte) { + case -1: { + GL11.glColor4f(0.2f, 0.2f, 0.2f, 1.0f); + break; + } + case 0: { + GL11.glColor4f(0.1f, 0.1f, 0.1f, 1.0f); + break; + } + case 1: { + GL11.glColor4f(1.0f, 0.0f, 0.0f, 1.0f); + break; + } + case 2: { + GL11.glColor4f(0.0f, 0.2f, 0.0f, 1.0f); + break; + } + case 3: { + GL11.glColor4f(0.2f, 0.0f, 0.0f, 1.0f); + break; + } + case 4: { + GL11.glColor4f(0.0f, 0.0f, 1.0f, 1.0f); + break; + } + case 5: { + GL11.glColor4f(0.6f, 0.0f, 0.4f, 1.0f); + break; + } + case 6: { + GL11.glColor4f(0.2f, 0.8f, 1.0f, 1.0f); + break; + } + case 7: { + GL11.glColor4f(0.6f, 0.6f, 0.6f, 1.0f); + break; + } + case 8: { + GL11.glColor4f(0.4f, 0.4f, 0.4f, 1.0f); + break; + } + case 9: { + GL11.glColor4f(1.0f, 0.2f, 0.6f, 1.0f); + break; + } + case 10: { + GL11.glColor4f(0.0f, 1.0f, 0.0f, 1.0f); + break; + } + case 11: { + GL11.glColor4f(1.0f, 1.0f, 0.0f, 1.0f); + break; + } + case 12: { + GL11.glColor4f(0.3f, 0.3f, 0.8f, 1.0f); + break; + } + case 13: { + GL11.glColor4f(0.8f, 0.2f, 0.4f, 1.0f); + break; + } + case 14: { + GL11.glColor4f(0.8f, 0.3f, 0.0f, 1.0f); + break; + } + case 15: { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + break; + } + } + if (connectedSides[0]) { + RenderInsulatedWire.model.renderBottom(); + } + if (connectedSides[1]) { + RenderInsulatedWire.model.renderTop(); + } + if (connectedSides[2]) { + RenderInsulatedWire.model.renderBack(); + } + if (connectedSides[3]) { + RenderInsulatedWire.model.renderFront(); + } + if (connectedSides[4]) { + RenderInsulatedWire.model.renderLeft(); + } + if (connectedSides[5]) { + RenderInsulatedWire.model.renderRight(); + } + RenderInsulatedWire.model.renderMiddle(); + GL11.glPopMatrix(); + } + } + + @Override + public void renderTileEntityAt(final TileEntity tileEntity, final double var2, + final double var4, final double var6, + final float var8) { + this.renderAModelAt(tileEntity, var2, var4, var6, var8); + } + + static { + model = new ModelInsulatedWire(); + } +} diff --git a/src/main/java/electricexpansion/client/render/RenderMultimeter.java b/src/main/java/electricexpansion/client/render/RenderMultimeter.java new file mode 100644 index 0000000..f71a43e --- /dev/null +++ b/src/main/java/electricexpansion/client/render/RenderMultimeter.java @@ -0,0 +1,120 @@ +package electricexpansion.client.render; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.tile.TileEntityMultimeter; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; +import org.lwjgl.opengl.GL11; +import universalelectricity.core.electricity.ElectricityDisplay; +import universalelectricity.core.vector.VectorHelper; + +@SideOnly(Side.CLIENT) +public class RenderMultimeter extends TileEntitySpecialRenderer { + @Override + public void renderTileEntityAt(final TileEntity var1, final double x, + final double y, final double z, + final float var8) { + final TileEntityMultimeter te = (TileEntityMultimeter) var1; + final ForgeDirection direction = te.getDirection( + (IBlockAccess) te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord); + for (int side = 0; side < 6; ++side) { + final ForgeDirection relativeSide = VectorHelper.getOrientationFromSide( + direction, ForgeDirection.getOrientation(side)); + if (relativeSide == ForgeDirection.EAST || + relativeSide == ForgeDirection.WEST || + relativeSide == ForgeDirection.UP || + relativeSide == ForgeDirection.DOWN || + relativeSide == ForgeDirection.SOUTH) { + GL11.glPushMatrix(); + GL11.glPolygonOffset(-10.0f, -10.0f); + GL11.glEnable(32823); + final float dx = 0.0625f; + final float dz = 0.0625f; + final float displayWidth = 0.875f; + final float displayHeight = 0.875f; + GL11.glTranslatef((float) x, (float) y, (float) z); + switch (side) { + case 0: { + GL11.glTranslatef(1.0f, 1.0f, 0.0f); + GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + break; + } + case 3: { + GL11.glTranslatef(0.0f, 1.0f, 0.0f); + GL11.glRotatef(0.0f, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + break; + } + case 2: { + GL11.glTranslatef(1.0f, 1.0f, 1.0f); + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + break; + } + case 5: { + GL11.glTranslatef(0.0f, 1.0f, 1.0f); + GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + break; + } + case 4: { + GL11.glTranslatef(1.0f, 1.0f, 0.0f); + GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + break; + } + } + GL11.glTranslatef(dx + displayWidth / 2.0f, 1.0f, + dz + displayHeight / 2.0f); + GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + final FontRenderer fontRenderer = this.func_147498_b(); + int maxWidth = 1; + final String amperes = ElectricityDisplay.getDisplay( + te.electricityReading.amperes, + ElectricityDisplay.ElectricUnit.AMPERE); + final String voltage = ElectricityDisplay.getDisplay( + te.electricityReading.voltage, + ElectricityDisplay.ElectricUnit.VOLTAGE); + final String watt = ElectricityDisplay.getDisplay(te.electricityReading.getWatts(), + ElectricityDisplay.ElectricUnit.WATT); + maxWidth = Math.max(fontRenderer.getStringWidth(amperes), maxWidth); + maxWidth = Math.max(fontRenderer.getStringWidth(voltage), maxWidth); + maxWidth = Math.max(fontRenderer.getStringWidth(watt), maxWidth); + maxWidth += 4; + final int lineHeight = fontRenderer.FONT_HEIGHT + 2; + final int requiredHeight = lineHeight * 1; + final float scaleX = displayWidth / maxWidth; + final float scaleY = displayHeight / requiredHeight; + final float scale = (float) (Math.min(scaleX, scaleY) * 0.8); + GL11.glScalef(scale, -scale, scale); + GL11.glDepthMask(false); + final int realHeight = (int) Math.floor(displayHeight / scale); + final int realWidth = (int) Math.floor(displayWidth / scale); + final int offsetY = (realHeight - requiredHeight) / 2; + final int offsetX = (realWidth - maxWidth) / 2 + 2 + 5; + GL11.glDisable(2896); + fontRenderer.drawString(amperes, offsetX - realWidth / 2, + 1 + offsetY - realHeight / 2 - 1 * lineHeight, + 1); + fontRenderer.drawString(voltage, offsetX - realWidth / 2, + 1 + offsetY - realHeight / 2 + 0 * lineHeight, + 1); + fontRenderer.drawString(watt, offsetX - realWidth / 2, + 1 + offsetY - realHeight / 2 + 1 * lineHeight, + 1); + GL11.glEnable(2896); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glDepthMask(true); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glDisable(32823); + GL11.glPopMatrix(); + } + } + } +} diff --git a/src/main/java/electricexpansion/client/render/RenderRawWire.java b/src/main/java/electricexpansion/client/render/RenderRawWire.java new file mode 100644 index 0000000..c9eff26 --- /dev/null +++ b/src/main/java/electricexpansion/client/render/RenderRawWire.java @@ -0,0 +1,73 @@ +package electricexpansion.client.render; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.client.model.ModelRawWire; +import electricexpansion.common.cables.TileEntityRawWire; +import electricexpansion.common.helpers.TileEntityConductorBase; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderRawWire extends TileEntitySpecialRenderer { + private ModelRawWire model; + + public RenderRawWire() { + this.model = new ModelRawWire(); + } + + public void renderAModelAt(final TileEntityRawWire t, final double x, + final double y, final double z, final float f) { + String textureToUse = "textures/models/"; + final int meta = t.getBlockMetadata(); + if (meta != -1) { + if (meta == 0) { + textureToUse += "RawCopperWire.png"; + } else if (meta == 1) { + textureToUse += "RawTinWire.png"; + } else if (meta == 2) { + textureToUse += "RawSilverWire.png"; + } else if (meta == 3) { + textureToUse += "RawHVWire.png"; + } else if (meta == 4) { + textureToUse += "RawSCWire.png"; + } + } + this.bindTexture(new ResourceLocation("electricexpansion", textureToUse)); + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f); + GL11.glScalef(1.0f, -1.0f, -1.0f); + final TileEntityConductorBase tileEntity = t; + final boolean[] connectedSides = tileEntity.visuallyConnected; + if (connectedSides[0]) { + this.model.renderBottom(); + } + if (connectedSides[1]) { + this.model.renderTop(); + } + if (connectedSides[2]) { + this.model.renderBack(); + } + if (connectedSides[3]) { + this.model.renderFront(); + } + if (connectedSides[4]) { + this.model.renderLeft(); + } + if (connectedSides[5]) { + this.model.renderRight(); + } + this.model.renderMiddle(); + GL11.glPopMatrix(); + } + + @Override + public void renderTileEntityAt(final TileEntity tileEntity, final double var2, + final double var4, final double var6, + final float var8) { + this.renderAModelAt((TileEntityRawWire) tileEntity, var2, var4, var6, var8); + } +} diff --git a/src/main/java/electricexpansion/client/render/RenderTransformer.java b/src/main/java/electricexpansion/client/render/RenderTransformer.java new file mode 100644 index 0000000..c461625 --- /dev/null +++ b/src/main/java/electricexpansion/client/render/RenderTransformer.java @@ -0,0 +1,91 @@ +package electricexpansion.client.render; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.client.model.ModelTransformer; +import electricexpansion.common.tile.TileEntityTransformer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import universalelectricity.core.vector.Vector3; + +@SideOnly(Side.CLIENT) +public class RenderTransformer extends TileEntitySpecialRenderer { + private ModelTransformer model; + private String textureToUse; + + public RenderTransformer() { + this.model = new ModelTransformer(); + } + + @Override + public void renderTileEntityAt(final TileEntity tileEntity, final double x, + final double y, final double z, + final float var5) { + this.textureToUse = "textures/models/"; + final String status = ((TileEntityTransformer) tileEntity).stepUp ? "Step Up" : "Step Down"; + final EntityPlayer player = (EntityPlayer) Minecraft.getMinecraft().thePlayer; + final MovingObjectPosition movingPosition = player.rayTrace(5.0, 1.0f); + if (movingPosition != null && + new Vector3(tileEntity).equals(new Vector3(movingPosition))) { + RenderFloatingText.renderFloatingText(status, (float) ((float) x + 0.5), + (float) y - 1.0f, + (float) ((float) z + 0.5)); + } + final int metadata = tileEntity.getWorldObj().getBlockMetadata( + tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + switch (metadata) { + case 0: + case 1: + case 2: + case 3: + this.textureToUse += "transformer1.png"; + break; + + case 4: + case 5: + case 6: + case 7: + // case 8: + this.textureToUse += "transformer2.png"; + break; + + case 8: + case 9: + case 10: + case 11: + // case 12: + this.textureToUse += "transformer3.png"; + break; + } + this.bindTexture( + new ResourceLocation("electricexpansion", this.textureToUse)); + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f); + switch (metadata % 4) { + case 0: { + GL11.glRotatef(270.0f, 0.0f, 1.0f, 0.0f); + break; + } + case 1: { + GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + break; + } + case 2: { + GL11.glRotatef(0.0f, 0.0f, 1.0f, 0.0f); + break; + } + case 3: { + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + break; + } + } + GL11.glScalef(1.0f, -1.0f, -1.0f); + this.model.render(null, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0625f); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/electricexpansion/client/render/RenderWireMill.java b/src/main/java/electricexpansion/client/render/RenderWireMill.java new file mode 100644 index 0000000..64dc338 --- /dev/null +++ b/src/main/java/electricexpansion/client/render/RenderWireMill.java @@ -0,0 +1,51 @@ +package electricexpansion.client.render; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.client.model.ModelWireMill; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderWireMill extends TileEntitySpecialRenderer { + private ModelWireMill model; + + public RenderWireMill() { + this.model = new ModelWireMill(); + } + + @Override + public void renderTileEntityAt(final TileEntity var1, final double var2, + final double var3, final double var4, + final float var5) { + this.bindTexture(new ResourceLocation("electricexpansion", "textures/models/wiremill.png")); + GL11.glPushMatrix(); + GL11.glTranslatef((float) var2 + 0.5f, (float) var3 + 1.5f, + (float) var4 + 0.5f); + switch (var1.getWorldObj().getBlockMetadata(var1.xCoord, var1.yCoord, + var1.zCoord)) { + case 0: { + GL11.glRotatef(0.0f, 0.0f, 1.0f, 0.0f); + break; + } + case 1: { + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + break; + } + case 2: { + GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + break; + } + case 3: { + GL11.glRotatef(270.0f, 0.0f, 1.0f, 0.0f); + break; + } + } + GL11.glScalef(1.0f, -1.0f, -1.0f); + this.model.render(null, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0625f); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/electricexpansion/common/CommonProxy.java b/src/main/java/electricexpansion/common/CommonProxy.java new file mode 100644 index 0000000..aaf8ecc --- /dev/null +++ b/src/main/java/electricexpansion/common/CommonProxy.java @@ -0,0 +1,99 @@ +package electricexpansion.common; + +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.registry.GameRegistry; +import electricexpansion.common.cables.TileEntityInsulatedWire; +import electricexpansion.common.cables.TileEntityLogisticsWire; +import electricexpansion.common.cables.TileEntityRawWire; +import electricexpansion.common.cables.TileEntityRedstonePaintedWire; +import electricexpansion.common.cables.TileEntitySwitchWire; +import electricexpansion.common.cables.TileEntitySwitchWireBlock; +import electricexpansion.common.cables.TileEntityWireBlock; +import electricexpansion.common.containers.ContainerAdvBatteryBox; +import electricexpansion.common.containers.ContainerDistribution; +import electricexpansion.common.containers.ContainerFuseBox; +import electricexpansion.common.containers.ContainerInsulationMachine; +import electricexpansion.common.containers.ContainerWireMill; +import electricexpansion.common.tile.TileEntityAdvancedBatteryBox; +import electricexpansion.common.tile.TileEntityFuseBox; +import electricexpansion.common.tile.TileEntityInsulatingMachine; +import electricexpansion.common.tile.TileEntityMultimeter; +import electricexpansion.common.tile.TileEntityQuantumBatteryBox; +import electricexpansion.common.tile.TileEntityRedstoneNetworkCore; +import electricexpansion.common.tile.TileEntityTransformer; +import electricexpansion.common.tile.TileEntityWireMill; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class CommonProxy implements IGuiHandler { + public void init() { + GameRegistry.registerTileEntity(TileEntityRawWire.class, + "TileEntityRawWire"); + GameRegistry.registerTileEntity(TileEntityInsulatedWire.class, + "TileEntityInsulatedWire"); + GameRegistry.registerTileEntity(TileEntityWireBlock.class, + "TileEntityWireBlock"); + GameRegistry.registerTileEntity(TileEntitySwitchWire.class, + "TileEntitySwitchWire"); + GameRegistry.registerTileEntity(TileEntitySwitchWireBlock.class, + "TileEntitySwitchWireBlock"); + GameRegistry.registerTileEntity(TileEntityLogisticsWire.class, + "TileEntityLogisticsWire"); + GameRegistry.registerTileEntity(TileEntityWireMill.class, + "TileEntityWireMill"); + GameRegistry.registerTileEntity(TileEntityRedstonePaintedWire.class, + "TileEntityRedstonePaintedWire"); + GameRegistry.registerTileEntity(TileEntityAdvancedBatteryBox.class, + "TileEntityAdvBox"); + GameRegistry.registerTileEntity(TileEntityMultimeter.class, + "TileEntityVoltDet"); + GameRegistry.registerTileEntity(TileEntityTransformer.class, + "TileEntityTransformer"); + GameRegistry.registerTileEntity(TileEntityQuantumBatteryBox.class, + "TileEntityDistribution"); + GameRegistry.registerTileEntity(TileEntityInsulatingMachine.class, + "TileEntityInsulatingMachine"); + GameRegistry.registerTileEntity(TileEntityRedstoneNetworkCore.class, + "TileEntityRedstoneNetworkCore"); + GameRegistry.registerTileEntity(TileEntityFuseBox.class, + "TileEntityFuseBox"); + } + + public Object getClientGuiElement(final int ID, final EntityPlayer player, + final World world, final int x, final int y, + final int z) { + return null; + } + + public Object getServerGuiElement(final int ID, final EntityPlayer player, + final World world, final int x, final int y, + final int z) { + final TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity != null) { + switch (ID) { + case 0: { + return new ContainerAdvBatteryBox( + player.inventory, (TileEntityAdvancedBatteryBox)tileEntity); + } + case 2: { + return new ContainerWireMill(player.inventory, + (TileEntityWireMill)tileEntity); + } + case 4: { + return new ContainerDistribution( + player.inventory, (TileEntityQuantumBatteryBox)tileEntity); + } + case 5: { + return new ContainerInsulationMachine( + player.inventory, (TileEntityInsulatingMachine)tileEntity); + } + case 6: { + return new ContainerFuseBox(player.inventory, + (TileEntityFuseBox)tileEntity); + } + } + } + return null; + } +} diff --git a/src/main/java/electricexpansion/common/ElectricExpansion.java b/src/main/java/electricexpansion/common/ElectricExpansion.java new file mode 100644 index 0000000..947d368 --- /dev/null +++ b/src/main/java/electricexpansion/common/ElectricExpansion.java @@ -0,0 +1,337 @@ +package electricexpansion.common; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.common.blocks.BlockAdvancedBatteryBox; +import electricexpansion.common.blocks.BlockBasic; +import electricexpansion.common.blocks.BlockInsulatedWire; +import electricexpansion.common.blocks.BlockInsulationMachine; +import electricexpansion.common.blocks.BlockLogisticsWire; +import electricexpansion.common.blocks.BlockMultimeter; +import electricexpansion.common.blocks.BlockQuantumBatteryBox; +import electricexpansion.common.blocks.BlockRawWire; +import electricexpansion.common.blocks.BlockRedstoneNetworkCore; +import electricexpansion.common.blocks.BlockRedstonePaintedWire; +import electricexpansion.common.blocks.BlockSwitchWire; +import electricexpansion.common.blocks.BlockSwitchWireBlock; +import electricexpansion.common.blocks.BlockTransformer; +import electricexpansion.common.blocks.BlockWireBlock; +import electricexpansion.common.blocks.BlockWireMill; +import electricexpansion.common.helpers.PacketHandlerLogisticsWireButton; +import electricexpansion.common.helpers.PacketHandlerUpdateQuantumBatteryBoxFrequency; +import electricexpansion.common.helpers.PacketLogisticsWireButton; +import electricexpansion.common.helpers.PacketUpdateQuantumBatteryBoxFrequency; +import electricexpansion.common.itemblocks.ItemBlockInsulatedWire; +import electricexpansion.common.itemblocks.ItemBlockLogisticsWire; +import electricexpansion.common.itemblocks.ItemBlockRawWire; +import electricexpansion.common.itemblocks.ItemBlockRedstonePaintedWire; +import electricexpansion.common.itemblocks.ItemBlockSwitchWire; +import electricexpansion.common.itemblocks.ItemBlockSwitchWireBlock; +import electricexpansion.common.itemblocks.ItemBlockTransformer; +import electricexpansion.common.itemblocks.ItemBlockWireBlock; +import electricexpansion.common.items.ItemAdvancedBattery; +import electricexpansion.common.items.ItemEliteBattery; +import electricexpansion.common.items.ItemMultimeter; +import electricexpansion.common.items.ItemParts; +import electricexpansion.common.items.ItemUltimateBattery; +import electricexpansion.common.items.ItemUpgrade; +import electricexpansion.common.misc.DistributionNetworks; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.misc.EventHandler; +import java.io.File; +import java.util.Arrays; +import java.util.logging.Level; +import java.util.logging.Logger; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.oredict.OreDictionary; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.TranslationHelper; +import universalelectricity.prefab.ore.OreGenBase; +import universalelectricity.prefab.ore.OreGenReplaceStone; +import universalelectricity.prefab.ore.OreGenerator; + +@Mod( + modid = "ElectricExpansion", name = "Electric Expansion", version = "2.1.0", + dependencies = + "after:basiccomponents;after:AtomicScience;after:ICBM|Contraption;after:MineFactoryReloaded;after:IC2", + useMetadata = true) +public class ElectricExpansion { + public static final String MAJOR_VERSION = "2"; + public static final String MINOR_VERSION = "1"; + public static final String REVIS_VERSION = "0"; + public static final String BUILD_VERSION = "43"; + public static final String MOD_ID = "ElectricExpansion"; + public static final String MOD_NAME = "Electric Expansion"; + public static final String VERSION = "2.1.0"; + public static final boolean USE_METADATA = true; + public static final boolean USES_CLIENT = true; + public static final boolean USES_SERVER = false; + @Mod.Metadata("ElectricExpansion") public static ModMetadata meta; + public static final String TEXTURE_NAME_PREFIX = "electricexpansion:"; + private static final String[] LANGUAGES_SUPPORTED; + public static OreGenBase silverOreGeneration; + public static final Configuration CONFIG; + public static boolean configLoaded; + static boolean debugRecipes; + public static boolean useHashCodes; + private static boolean useUeVoltageSensitivity; + public static DistributionNetworks DistributionNetworksInstance; + public static Logger eeLogger; + @Mod.Instance("ElectricExpansion") public static ElectricExpansion instance; + @SidedProxy(clientSide = "electricexpansion.client.ClientProxy", + serverSide = "electricexpansion.common.CommonProxy") + public static CommonProxy proxy; + public static SimpleNetworkWrapper channel; + + public static void log(final Level level, String msg, + final String... replacements) { + for (final String replace : replacements) { + msg = msg.replace("%s", replace); + } + ElectricExpansion.eeLogger.log(level, msg); + } + + public static boolean configLoad(final Configuration config) { + config.load(); + ElectricExpansionItems.blockRawWire = (Block) new BlockRawWire(); + ElectricExpansionItems.blockInsulatedWire = + (Block) new BlockInsulatedWire(); + ElectricExpansionItems.blockWireBlock = (Block) new BlockWireBlock(); + ElectricExpansionItems.blockSwitchWire = (Block) new BlockSwitchWire(); + ElectricExpansionItems.blockSwitchWireBlock = + (Block) new BlockSwitchWireBlock(); + ElectricExpansionItems.blockRedstonePaintedWire = + new BlockRedstonePaintedWire(); + ElectricExpansionItems.blockAdvBatteryBox = + (Block) new BlockAdvancedBatteryBox(); + ElectricExpansionItems.blockMultimeter = (Block) new BlockMultimeter(); + ElectricExpansionItems.blockSilverOre = + new BlockBasic(Material.rock, EETab.INSTANCE, 2.0f, "SilverOre"); + ElectricExpansionItems.blockInsulationMachine = + (Block) new BlockInsulationMachine(); + ElectricExpansionItems.blockWireMill = (Block) new BlockWireMill(); + ElectricExpansionItems.blockTransformer = (Block) new BlockTransformer(); + ElectricExpansionItems.blockDistribution = + (Block) new BlockQuantumBatteryBox(); + ElectricExpansionItems.blockLead = + new BlockBasic(Material.iron, EETab.INSTANCE, 2.0f, "LeadBlock"); + ElectricExpansionItems.blockLogisticsWire = + (Block) new BlockLogisticsWire(0); + ElectricExpansionItems.blockRedstoneNetworkCore = + (Block) new BlockRedstoneNetworkCore(); + ElectricExpansionItems.itemUpgrade = new ItemUpgrade(0); + ElectricExpansionItems.itemEliteBat = new ItemEliteBattery(); + ElectricExpansionItems.itemUltimateBat = new ItemUltimateBattery(); + ElectricExpansionItems.itemParts = new ItemParts(); + ElectricExpansionItems.itemAdvBat = new ItemAdvancedBattery(); + ElectricExpansionItems.itemMultimeter = new ItemMultimeter(); + + GameRegistry.registerItem(ElectricExpansionItems.itemUpgrade, + "itemUpgrade"); + GameRegistry.registerItem(ElectricExpansionItems.itemEliteBat, + "itemEliteBat"); + GameRegistry.registerItem(ElectricExpansionItems.itemUltimateBat, + "itemUltimateBat"); + GameRegistry.registerItem(ElectricExpansionItems.itemParts, "itemParts"); + GameRegistry.registerItem(ElectricExpansionItems.itemAdvBat, "itemAdvBat"); + GameRegistry.registerItem(ElectricExpansionItems.itemMultimeter, + "itemMultimeter"); + + GameRegistry.registerBlock(ElectricExpansionItems.blockSilverOre, + ItemBlock.class, "blockSilverOre"); + ElectricExpansion.silverOreGeneration = + new OreGenReplaceStone( + "Silver Ore", "oreSilver", + new ItemStack(ElectricExpansionItems.blockSilverOre), 36, 10, 3) + .enable(config); + ElectricExpansion.debugRecipes = + config + .get("General", "Debug_Recipes", false, + "Set to true for debug Recipes. This is considdered cheating.") + .getBoolean(false); + ElectricExpansion.useHashCodes = + config + .get( + "General", "Use_Hashcodes", true, + "Set to true to make clients use hash codes for the Quantum Battery Box Owner data.") + .getBoolean(true); + ElectricExpansion.useUeVoltageSensitivity = + config + .get( + "General", "Use_UeVoltageSensitivity", false, + "Set to true to use the setting in the UE config file for Voltage Sensitivity.") + .getBoolean(false); + if (config.hasChanged()) { + config.save(); + } + return ElectricExpansion.configLoaded = true; + } + + @Mod.EventHandler + public void preInit(final FMLPreInitializationEvent event) { + ElectricExpansion.meta.modId = "ElectricExpansion"; + ElectricExpansion.meta.name = "Electric Expansion"; + ElectricExpansion.meta.description = + "Electric Expansion is a Universal Electricity mod that focuses mainly on energy storage and transfer as well as adding more cables for better energy transfer. This mod will make Universal Electricity more complex and realistic. We try to make all aspects as realistic as possible, whether that means the items and block names or the processes and materials for each aspect of Electric Expansion."; + ElectricExpansion.meta.url = + "http://universalelectricity.com/electric%20expansion"; + ElectricExpansion.meta.logoFile = "/EELogo.png"; + ElectricExpansion.meta.version = "2.1.0.43"; + ElectricExpansion.meta.authorList = + Arrays.asList("Mattredsox & Alex_hawks"); + ElectricExpansion.meta.credits = "Please see the website."; + ElectricExpansion.meta.autogenerated = false; + if (!ElectricExpansion.configLoaded) { + configLoad(ElectricExpansion.CONFIG); + } + log(Level.INFO, "PreInitializing ElectricExpansion v.2.1.0", new String[0]); + GameRegistry.registerBlock(ElectricExpansionItems.blockAdvBatteryBox, + ItemBlock.class, "blockAdvBatteryBox"); + GameRegistry.registerBlock(ElectricExpansionItems.blockWireMill, + ItemBlock.class, "blockWireMill"); + GameRegistry.registerBlock(ElectricExpansionItems.blockInsulationMachine, + ItemBlock.class, "blockInsulationMachine"); + GameRegistry.registerBlock(ElectricExpansionItems.blockMultimeter, + ItemBlock.class, "blockMultimeter"); + GameRegistry.registerBlock(ElectricExpansionItems.blockLead, + ItemBlock.class, "blockLead"); + GameRegistry.registerBlock(ElectricExpansionItems.blockTransformer, + ItemBlockTransformer.class, "blockTransformer"); + GameRegistry.registerBlock(ElectricExpansionItems.blockDistribution, + ItemBlock.class, "blockDistribution"); + GameRegistry.registerBlock(ElectricExpansionItems.blockRedstoneNetworkCore, + ItemBlock.class, "blockRsNetworkCore"); + GameRegistry.registerBlock(ElectricExpansionItems.blockRawWire, + ItemBlockRawWire.class, "blockRawWire"); + GameRegistry.registerBlock(ElectricExpansionItems.blockInsulatedWire, + ItemBlockInsulatedWire.class, + "blockInsulatedWire"); + GameRegistry.registerBlock(ElectricExpansionItems.blockSwitchWire, + ItemBlockSwitchWire.class, "blockSwitchWire"); + GameRegistry.registerBlock(ElectricExpansionItems.blockSwitchWireBlock, + ItemBlockSwitchWireBlock.class, + "blockSwitchWireBlock"); + GameRegistry.registerBlock(ElectricExpansionItems.blockWireBlock, + ItemBlockWireBlock.class, "blockWireBlock"); + GameRegistry.registerBlock(ElectricExpansionItems.blockLogisticsWire, + ItemBlockLogisticsWire.class, + "blockLogisticsWire"); + GameRegistry.registerBlock(ElectricExpansionItems.blockRedstonePaintedWire, + ItemBlockRedstonePaintedWire.class, + "blockRedstonePaintedWire"); + OreDictionary.registerOre("blockLead", ElectricExpansionItems.blockLead); + OreDictionary.registerOre("advancedBattery", + (Item)ElectricExpansionItems.itemAdvBat); + OreDictionary.registerOre("eliteBattery", + (Item)ElectricExpansionItems.itemEliteBat); + OreDictionary.registerOre("advancedBattery", + (Item)ElectricExpansionItems.itemAdvBat); + OreDictionary.registerOre("transformer", + ElectricExpansionItems.blockTransformer); + OreDictionary.registerOre("wireMill", ElectricExpansionItems.blockWireMill); + OreDictionary.registerOre("multimeter", + ElectricExpansionItems.blockMultimeter); + OreDictionary.registerOre("itemMultimeter", + ElectricExpansionItems.itemMultimeter); + OreDictionary.registerOre( + "ingotElectrum", new ItemStack(ElectricExpansionItems.itemParts, 1, 2)); + OreDictionary.registerOre( + "ingotLead", new ItemStack(ElectricExpansionItems.itemParts, 1, 7)); + OreDictionary.registerOre( + "coil", new ItemStack(ElectricExpansionItems.itemParts, 1, 8)); + OreDictionary.registerOre( + "ingotSilver", new ItemStack(ElectricExpansionItems.itemParts, 1, 9)); + OreDictionary.registerOre( + "copperWire", + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0)); + OreDictionary.registerOre( + "tinWire", + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1)); + OreDictionary.registerOre( + "silverWire", + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2)); + OreDictionary.registerOre( + "aluminumWire", + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3)); + OreDictionary.registerOre( + "superconductor", + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4)); + OreDictionary.registerOre("insulation", RecipeRegistery.getInsulationIS()); + NetworkRegistry.INSTANCE.registerGuiHandler( + (Object)this, (IGuiHandler)ElectricExpansion.proxy); + if (!Loader.isModLoaded("BasicComponents")) { + ElectricExpansion.eeLogger.fine( + "Basic Components NOT detected! Basic Components is REQUIRED for survival crafting and gameplay!"); + } + + channel = NetworkRegistry.INSTANCE.newSimpleChannel("ElectricExpansion"); + int pkgId = 0; + channel.registerMessage(PacketHandlerUpdateQuantumBatteryBoxFrequency.class, + PacketUpdateQuantumBatteryBoxFrequency.class, + pkgId++, Side.SERVER); + + channel.registerMessage(PacketHandlerLogisticsWireButton.class, + PacketLogisticsWireButton.class, pkgId++, + Side.SERVER); + } + + @Mod.EventHandler + public void load(final FMLInitializationEvent event) { + log(Level.INFO, "Initializing ElectricExpansion v.2.1.0", new String[0]); + ElectricExpansion.proxy.init(); + RecipeRegistery.crafting(); + EETab.INSTANCE.setItemStack( + new ItemStack(ElectricExpansionItems.blockTransformer)); + TranslationHelper.loadLanguages("/assets/electricexpansion/lang/", + ElectricExpansion.LANGUAGES_SUPPORTED); + ElectricExpansion.eeLogger.info("Loaded languages"); + if (!ElectricExpansion.useUeVoltageSensitivity) { + UniversalElectricity.isVoltageSensitive = true; + ElectricExpansion.eeLogger.finest( + "Successfully toggled Voltage Sensitivity!"); + } + OreGenerator.addOre(ElectricExpansion.silverOreGeneration); + UniversalElectricity.isNetworkActive = true; + } + + @Mod.EventHandler + public void postInit(final FMLPostInitializationEvent event) { + log(Level.INFO, "PostInitializing ElectricExpansion v.2.1.0", + new String[0]); + MinecraftForge.EVENT_BUS.register((Object) new EventHandler()); + RecipeRegistery.drawing(); + RecipeRegistery.insulation(); + } + + @Mod.EventHandler + public void onServerStarting(final FMLServerStartingEvent event) { + ElectricExpansion.DistributionNetworksInstance = new DistributionNetworks(); + } + + static { + LANGUAGES_SUPPORTED = new String[] {"en_US", "pl_PL"}; + CONFIG = new Configuration( + new File(Loader.instance().getConfigDir(), + "UniversalElectricity/ElectricExpansion.cfg")); + ElectricExpansion.configLoaded = false; + ElectricExpansion.eeLogger = Logger.getLogger("ElectricExpansion"); + } +} diff --git a/src/main/java/electricexpansion/common/RecipeRegistery.java b/src/main/java/electricexpansion/common/RecipeRegistery.java new file mode 100644 index 0000000..3601823 --- /dev/null +++ b/src/main/java/electricexpansion/common/RecipeRegistery.java @@ -0,0 +1,639 @@ +package electricexpansion.common; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.common.misc.InsulationRecipes; +import electricexpansion.common.misc.WireMillRecipes; +import java.util.logging.Level; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import universalelectricity.prefab.RecipeHelper; + +public class RecipeRegistery { + private static ItemStack camo; + private static final ItemStack insulationIS; + + public static void crafting() { + if (Loader.isModLoaded("BasicComponents")) { + for (final ItemStack wire : OreDictionary.getOres("copperWire")) { + RecipeHelper.removeRecipe(wire); + } + } + FurnaceRecipes.smelting().func_151396_a( + ElectricExpansionItems.itemParts, // 3, + new ItemStack(ElectricExpansionItems.itemParts, 4, 4), 0.0f); + try { + RecipeRegistery.camo = + GameRegistry.findItemStack("ICBM|Contraption", "camouflage", 1); + } catch (final NullPointerException ex) { + } + if (RecipeRegistery.camo == null) { + ElectricExpansion.log(Level.INFO, "Failed to detect ICBM|Contraption", + new String[0]); + ElectricExpansion.log(Level.INFO, "Using %s's items instead.", + "Electric Expansion"); + RecipeRegistery.camo = new ItemStack(ElectricExpansionItems.itemParts, 1, 5); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + RecipeRegistery.camo, + new Object[] {Blocks.wool, Items.bucket, Items.slime_ball, + Items.redstone, "dyeRed", "dyeBlue", "dyeYellow", + "dyeBlack", "dyeWhite"})); + } + registerRawCables(); + registerInsulatedCables(); + registerSwitchCables(); + registerLogisticsCables(); + registerCamoCables(); + registerCamoSwitchCables(); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockWireMill), + new Object[] {"#$#", "!%!", "@!@", '!', "motor", '#', "plateSteel", '@', + "plateBronze", '$', "circuitBasic", '%', + new ItemStack(ElectricExpansionItems.itemParts, 1, 0)})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockMultimeter), + new Object[] {"$^$", "!@!", "$%$", '!', "plateCopper", '$', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + '%', "circuitBasic", '^', Blocks.glass, '@', + Items.stick})); + System.out.println("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALEC " + ElectricExpansionItems.blockInsulatedWire); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockAdvBatteryBox), + new Object[] {"!!!", "@@@", "!#!", '!', "battery", '@', "copperWire", + '#', "circuitBasic"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockInsulationMachine), + new Object[] {"!@!", "@#@", "!$!", '!', "plateSteel", '@', + Blocks.obsidian, '#', Items.lava_bucket, '$', + Blocks.furnace})); + if (OreDictionary.getOres("antimatterGram").size() > 0) { + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockDistribution), + new Object[] {"!!!", "!@!", "!!!", '@', + new ItemStack(ElectricExpansionItems.blockAdvBatteryBox), '!', + "antimatterGram"})); + } else { + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockDistribution), + new Object[] {"!!!", "!@!", "!!!", '@', + new ItemStack(ElectricExpansionItems.blockAdvBatteryBox), '!', + new ItemStack(ElectricExpansionItems.itemParts, 1, 1)})); + } + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 0), + new Object[] {"$&$", "#x#", "@@@", '@', "plateSteel", '#', + new ItemStack(ElectricExpansionItems.itemParts, 1, 6), + '$', + new ItemStack(ElectricExpansionItems.itemParts, 1, 8), + '&', "ingotCopper", 'x', "dyeGreen"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 4), + new Object[] { + "$&$", "#x#", "@!@", '!', + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 0), '@', + "plateSteel", '#', + new ItemStack(ElectricExpansionItems.itemParts, 1, 6), '$', + new ItemStack(ElectricExpansionItems.itemParts, 1, 8), '&', + "ingotCopper", 'x', "dyeRed"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 8), + new Object[] { + "$&$", "#x#", "@!@", '!', + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 4), '@', + "plateSteel", '#', + new ItemStack(ElectricExpansionItems.itemParts, 1, 6), '$', + new ItemStack(ElectricExpansionItems.itemParts, 1, 8), '&', + "ingotCopper", 'x', "dyeBlue"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 0), + new Object[] {"$!$", "!@!", "#!#", '!', + new ItemStack((Item)ElectricExpansionItems.itemAdvBat, 1, + Integer.MIN_VALUE), + '@', new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 0), + '#', "circuitAdvanced", '$', "plateSteel"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 1), + new Object[] {"$!$", "!@!", "#!#", '!', + new ItemStack((Item)ElectricExpansionItems.itemAdvBat, 1, + Integer.MIN_VALUE), + '@', new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 0), + '#', "circuitAdvanced", '$', "plateSteel"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 2), + new Object[] {"#!#", "!@!", "#!#", '!', + new ItemStack((Item)ElectricExpansionItems.itemEliteBat, + 1, Integer.MIN_VALUE), + '@', new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 1), + '#', "circuitElite"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 3), + new Object[] {"#!#", "!@!", "#!#", '!', "antimatterMilligram", '@', + new ItemStack((Item)ElectricExpansionItems.itemUltimateBat, 1, + Integer.MIN_VALUE), + '#', "circuitElite"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 4), + new Object[] { + "#$#", "#!#", "#$#", '!', + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 4), '#', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), '$', + "circuitBasic"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 5), + new Object[] { + "#$#", "#!#", "#$#", '!', + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 8), '#', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), '$', + "circuitElite"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemUpgrade, 1, 6), + new Object[] { + "@$#", "@!#", "@$#", '!', + new ItemStack(ElectricExpansionItems.blockTransformer, 1, 4), '#', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), '$', + "circuitAdvanced"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack((Item)ElectricExpansionItems.itemAdvBat), + new Object[] {" T ", "TRT", "TRT", 'T', "ingotSilver", 'R', + Items.glowstone_dust})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack((Item)ElectricExpansionItems.itemEliteBat), + new Object[] {"!@!", "#$#", "!@!", '!', "plateSteel", '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + '#', "ingotLead", '$', Items.ghast_tear})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack((Item)ElectricExpansionItems.itemUltimateBat), + new Object[] {"!@!", "#$#", "!@!", '!', "plateGold", '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + '#', "antimatterMilligram", '$', "strangeMatter"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemParts, 1, 0), + new Object[] {" # ", "! !", " ! ", '!', Items.iron_ingot, '#', + Items.diamond})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemParts, 1, 1), + new Object[] {"!#!", "#@#", "!#!", '!', Items.gold_ingot, '#', + "ingotSilver", '@', Items.ender_eye})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemParts, 1, 1), + new Object[] {"!#!", "#@#", "!#!", '#', Items.gold_ingot, '!', + "ingotSilver", '@', Items.ender_eye})); + FurnaceRecipes.smelting().func_151396_a( + ElectricExpansionItems.itemParts, // 1, + new ItemStack(ElectricExpansionItems.itemParts, 4, 2), 0.0f); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.itemParts, 9, 7), + new Object[] {ElectricExpansionItems.blockLead}); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemParts, 1, 8), + new Object[] { + "AAA", "ABA", "AAA", 'B', Items.iron_ingot, 'A', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0)})); + GameRegistry.addSmelting( + ElectricExpansionItems.blockSilverOre, + new ItemStack(ElectricExpansionItems.itemParts, 1, 9), 0.8f); + GameRegistry.addRecipe( + new ItemStack(ElectricExpansionItems.blockLead, 1), + new Object[] {"@@@", "@@@", "@@@", '@', + new ItemStack(ElectricExpansionItems.itemParts, 1, 7)}); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.itemMultimeter), + new Object[] {"$^$", "!@!", "$%$", '!', "plateCopper", '$', + "copperWire", '%', "circuitAdvanced", '^', Blocks.glass, + '@', "battery"})); + } + + public static void drawing() { + if (!ElectricExpansion.debugRecipes) { + WireMillRecipes.INSTANCE.addProcessing( + "ingotCopper", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 0), 60); + WireMillRecipes.INSTANCE.addProcessing( + "ingotTin", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 1), 60); + WireMillRecipes.INSTANCE.addProcessing( + "ingotSilver", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 2), 60); + WireMillRecipes.INSTANCE.addProcessing( + "ingotAluminum", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 3), + 60); + WireMillRecipes.INSTANCE.addProcessing( + new ItemStack(ElectricExpansionItems.itemParts, 64, 2), + new ItemStack(ElectricExpansionItems.blockRawWire, 64, 4), 24000); + for (int i = 0; i < 16; ++i) { + WireMillRecipes.INSTANCE.addProcessing( + new ItemStack(Blocks.wool, 10, i), new ItemStack(Items.string, 40), + 300); + } + } else { + WireMillRecipes.INSTANCE.addProcessing( + "ingotCopper", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 0), 20); + WireMillRecipes.INSTANCE.addProcessing( + "ingotTin", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 1), 20); + WireMillRecipes.INSTANCE.addProcessing( + "ingotSilver", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 2), 20); + WireMillRecipes.INSTANCE.addProcessing( + "ingotAluminum", new ItemStack(ElectricExpansionItems.blockRawWire, 3, 3), + 20); + WireMillRecipes.INSTANCE.addProcessing( + new ItemStack(ElectricExpansionItems.itemParts, 64, 2), + new ItemStack(ElectricExpansionItems.blockRawWire, 64, 4), 20); + for (int i = 0; i < 16; ++i) { + WireMillRecipes.INSTANCE.addProcessing( + new ItemStack(Blocks.wool, 10, i), new ItemStack(Items.string, 40), + 30); + } + } + } + + public static void insulation() { + final int ticks = ElectricExpansion.debugRecipes ? 1 : 8; + for (int i = 0; i < 16; ++i) { + InsulationRecipes.INSTANCE.addProcessing( + new ItemStack(Blocks.wool, 32, i), 32, ticks * 80); + } + InsulationRecipes.INSTANCE.addProcessing(new ItemStack(Items.leather, 8), + 24, ticks * 25); + InsulationRecipes.INSTANCE.addProcessing( + new ItemStack(Items.rotten_flesh, 8), 16, ticks * 25); + FurnaceRecipes.smelting().func_151396_a(Items.leather, + RecipeRegistery.insulationIS, 0.7f); + GameRegistry.addShapelessRecipe( + RecipeRegistery.insulationIS, + new Object[] {Blocks.wool, Blocks.wool, Blocks.wool, Blocks.wool}); + for (final ItemStack is : OreDictionary.getOres("itemRubber")) { + if (!is.isItemEqual(RecipeRegistery.insulationIS)) { + final ItemStack is2 = is.copy(); + is2.stackSize = 8; + InsulationRecipes.INSTANCE.addProcessing( + is2, is2.stackSize, + (int)Math.floor(is2.stackSize * ticks * 10.0 / 8.0 + 0.5)); + } + } + } + + public static void registerRawCables() { + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRawWire, 6, 0), + new Object[] {" @ ", " @ ", " @ ", '@', "ingotCopper"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRawWire, 6, 1), + new Object[] {" @ ", " @ ", " @ ", '@', "ingotTin"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRawWire, 6, 2), + new Object[] {" @ ", " @ ", " @ ", '@', "ingotSilver"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRawWire, 6, 3), + new Object[] {" @ ", " @ ", " @ ", '@', "ingotAluminum"})); + } + + public static void registerInsulatedCables() { + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 6, 0), + new Object[] {"#@#", "#@#", "#@#", '#', RecipeRegistery.insulationIS, + '@', "ingotCopper"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 6, 1), + new Object[] {"#@#", "#@#", "#@#", '#', RecipeRegistery.insulationIS, + '@', "ingotTin"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 6, 2), + new Object[] {"#@#", "#@#", "#@#", '#', RecipeRegistery.insulationIS, + '@', "ingotSilver"})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 6, 3), + new Object[] {"#@#", "#@#", "#@#", '#', RecipeRegistery.insulationIS, + '@', "ingotAluminum"})); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 0), + RecipeRegistery.insulationIS}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 1), + RecipeRegistery.insulationIS}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 2), + RecipeRegistery.insulationIS}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 3), + RecipeRegistery.insulationIS}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 4), + new ItemStack(ElectricExpansionItems.itemParts, 3, 7)}); + } + + public static void registerSwitchCables() { + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 0), + RecipeRegistery.insulationIS, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 1), + RecipeRegistery.insulationIS, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 2), + RecipeRegistery.insulationIS, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 3), + RecipeRegistery.insulationIS, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 4), + new ItemStack(ElectricExpansionItems.itemParts, 3, 7), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + Blocks.lever}); + } + + public static void registerLogisticsCables() { + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 0), + RecipeRegistery.insulationIS, Blocks.lever, + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 1), + RecipeRegistery.insulationIS, Blocks.lever, + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 2), + RecipeRegistery.insulationIS, Blocks.lever, + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 3), + RecipeRegistery.insulationIS, Blocks.lever, + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 4), + new ItemStack(ElectricExpansionItems.itemParts, 3, 7), + Blocks.lever, Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + Blocks.lever, Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1), + Blocks.lever, Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2), + Blocks.lever, Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), + Blocks.lever, Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + Blocks.lever, Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 0), + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 1), + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 2), + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 3), + Items.redstone})); + GameRegistry.addRecipe((IRecipe) new ShapelessOreRecipe( + new ItemStack(ElectricExpansionItems.blockLogisticsWire, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 4), + Items.redstone})); + } + + public static void registerCamoCables() { + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 0), + RecipeRegistery.insulationIS, RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 1), + RecipeRegistery.insulationIS, RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 2), + RecipeRegistery.insulationIS, RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 3), + RecipeRegistery.insulationIS, RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 4), + new ItemStack(ElectricExpansionItems.itemParts, 3, 7), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + RecipeRegistery.camo}); + } + + public static void registerCamoSwitchCables() { + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 0), + RecipeRegistery.insulationIS, RecipeRegistery.camo, + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 1), + RecipeRegistery.insulationIS, RecipeRegistery.camo, + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 2), + RecipeRegistery.insulationIS, RecipeRegistery.camo, + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 3), + RecipeRegistery.insulationIS, RecipeRegistery.camo, + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockRawWire, 1, 4), + new ItemStack(ElectricExpansionItems.itemParts, 3, 7), + RecipeRegistery.camo, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + RecipeRegistery.camo, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1), + RecipeRegistery.camo, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2), + RecipeRegistery.camo, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), + RecipeRegistery.camo, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + RecipeRegistery.camo, Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 0), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 1), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 2), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 3), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockSwitchWire, 1, 4), + RecipeRegistery.camo}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 0), + new Object[] {new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 0), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 1), + new Object[] {new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 1), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 2), + new Object[] {new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 2), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 3), + new Object[] {new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 3), + Blocks.lever}); + GameRegistry.addShapelessRecipe( + new ItemStack(ElectricExpansionItems.blockSwitchWireBlock, 1, 4), + new Object[] {new ItemStack(ElectricExpansionItems.blockWireBlock, 1, 4), + Blocks.lever}); + } + + public static void registerRedstoneCables() { + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 0), + new Object[] {"!@!", "@#@", "!@!", '!', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + '@', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 1), + new Object[] {"!@!", "@#@", "!@!", '!', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1), + '@', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 2), + new Object[] {"!@!", "@#@", "!@!", '!', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2), + '@', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 3), + new Object[] {"!@!", "@#@", "!@!", '!', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), + '@', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 4), + new Object[] {"!@!", "@#@", "!@!", '!', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + '@', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 0), + new Object[] {"!@!", "@#@", "!@!", '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 0), + '!', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 1), + new Object[] {"!@!", "@#@", "!@!", '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 1), + '!', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 2), + new Object[] {"!@!", "@#@", "!@!", '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 2), + '!', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 3), + new Object[] {"!@!", "@#@", "!@!", '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 3), + '!', Items.redstone, '#', Items.slime_ball})); + GameRegistry.addRecipe((IRecipe) new ShapedOreRecipe( + new ItemStack(ElectricExpansionItems.blockRedstonePaintedWire, 4, 4), + new Object[] {"!@!", "@#@", "!@!", '@', + new ItemStack(ElectricExpansionItems.blockInsulatedWire, 1, 4), + '!', Items.redstone, '#', Items.slime_ball})); + } + + public static ItemStack getInsulationIS() { + return RecipeRegistery.insulationIS; + } + + static { + insulationIS = new ItemStack(ElectricExpansionItems.itemParts, 1, 6); + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockAdvancedBatteryBox.java b/src/main/java/electricexpansion/common/blocks/BlockAdvancedBatteryBox.java new file mode 100644 index 0000000..4e91e22 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockAdvancedBatteryBox.java @@ -0,0 +1,226 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.ElectricExpansion; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.tile.TileEntityAdvancedBatteryBox; +import java.util.HashMap; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.block.BlockAdvanced; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public class BlockAdvancedBatteryBox extends BlockAdvanced { + private HashMap icons; + + public BlockAdvancedBatteryBox() { + super(UniversalElectricity.machine); + this.icons = new HashMap<>(); + this.setStepSound(BlockAdvancedBatteryBox.soundTypeMetal); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + this.setBlockName("advbatbox"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.icons.put( + "top", par1IconRegister.registerIcon("electricexpansion:machineTop")); + this.icons.put("out", par1IconRegister.registerIcon( + "electricexpansion:machineOutput")); + this.icons.put("input", par1IconRegister.registerIcon( + "electricexpansion:machineInput")); + this.icons.put("tier1", + par1IconRegister.registerIcon("electricexpansion:batBoxT1")); + this.icons.put("tier2", + par1IconRegister.registerIcon("electricexpansion:batBoxT2")); + this.icons.put("tier3", + par1IconRegister.registerIcon("electricexpansion:batBoxT3")); + this.icons.put("tier4", + par1IconRegister.registerIcon("electricexpansion:batBoxT4")); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess iBlockAccess, final int x, + final int y, final int z, final int side) { + final int metadata = iBlockAccess.getBlockMetadata(x, y, z); + final TileEntityAdvancedBatteryBox tileEntity = (TileEntityAdvancedBatteryBox) iBlockAccess.getTileEntity(x, y, + z); + if (side == 0 || side == 1) { + return this.icons.get("top"); + } + if (side == metadata + 2) { + return this.icons.get("out"); + } + if (side == ForgeDirection.getOrientation(metadata + 2).getOpposite().ordinal()) { + return this.icons.get("input"); + } + if (tileEntity.getMaxJoules() <= 8000000.0) { + return this.icons.get("tier1"); + } + if (tileEntity.getMaxJoules() > 8000000.0 && + tileEntity.getMaxJoules() <= 1.2E7) { + return this.icons.get("tier2"); + } + if (tileEntity.getMaxJoules() > 1.2E7 && + tileEntity.getMaxJoules() <= 1.6E7) { + return this.icons.get("tier3"); + } + if (tileEntity.getMaxJoules() > 1.6E7) { + return this.icons.get("tier4"); + } + return this.icons.get("tier1"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int side, final int metadata) { + if (side == 0 || side == 1) { + return this.icons.get("top"); + } + if (side == metadata + 2) { + return this.icons.get("out"); + } + if (side == ForgeDirection.getOrientation(metadata + 2).getOpposite().ordinal()) { + return this.icons.get("input"); + } + return this.icons.get("tier1"); + } + + @Override + public void onBlockPlacedBy(final World par1World, final int x, final int y, + final int z, final EntityLivingBase entity, + final ItemStack itemStack) { + final int angle = MathHelper.floor_double( + ((Entity) entity).rotationYaw * 4.0f / 360.0f + 0.5) & + 0x3; + switch (angle) { + case 0: { + par1World.setBlock(x, y, z, this, 3, 0); + break; + } + case 1: { + par1World.setBlock(x, y, z, this, 1, 0); + break; + } + case 2: { + par1World.setBlock(x, y, z, this, 2, 0); + break; + } + case 3: { + par1World.setBlock(x, y, z, this, 0, 0); + break; + } + } + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + par1World.notifyBlocksOfNeighborChange(x, y, z, this); + } + + @Override + public boolean onUseWrench(final World par1World, final int x, final int y, + final int z, final EntityPlayer par5EntityPlayer, + final int side, final float hitX, final float hitY, + final float hitZ) { + final int metadata = par1World.getBlockMetadata(x, y, z); + int change = 0; + switch (metadata) { + case 0: { + change = 3; + break; + } + case 3: { + change = 1; + break; + } + case 1: { + change = 2; + break; + } + case 2: { + change = 0; + break; + } + } + par1World.setBlock(x, y, z, this, change, 0); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + return true; + } + + @Override + public boolean onMachineActivated(final World par1World, final int x, + final int y, final int z, + final EntityPlayer par5EntityPlayer, + final int side, final float hitX, + final float hitY, final float hitZ) { + if (!par1World.isRemote) { + par5EntityPlayer.openGui((Object) ElectricExpansion.instance, 0, par1World, + x, y, z); + return true; + } + return true; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public TileEntity createNewTileEntity(final World world, final int metadata) { + return new TileEntityAdvancedBatteryBox(); + } + + // TODO: WTF + // @Override + // public ItemStack getPickBlock(final MovingObjectPosition target, + // final World world, final int x, final int y, + // final int z) { + // final int id = this.func_71922_a(world, x, y, z); + // if (id == 0) { + // return null; + // } + // final Item item = Item.field_77698_e[id]; + // if (item == null) { + // return null; + // } + // return new ItemStack(id, 1, 0); + // } + + @Override + public boolean hasComparatorInputOverride() { + return true; + } + + @Override + public int getComparatorInputOverride(final World par1World, final int x, + final int y, final int z, + final int meta) { + final TileEntity tileEntity = par1World.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityAdvancedBatteryBox) { + final TileEntityAdvancedBatteryBox te = (TileEntityAdvancedBatteryBox) tileEntity; + final double max = te.getMaxJoules(); + final double current = te.getJoules(); + return (int) (current / max * 15.0); + } + return 0; + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockBasic.java b/src/main/java/electricexpansion/common/blocks/BlockBasic.java new file mode 100644 index 0000000..2bf5572 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockBasic.java @@ -0,0 +1,64 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockBasic extends Block { + public BlockBasic(final Material material, final CreativeTabs tab, + final float hardness, final float resistance, + final String name, final float lightValue, + final SoundType sound) { + super(material); + this.setCreativeTab(tab); + this.setHardness(hardness); + this.setResistance(resistance); + this.setBlockName(name); + this.setStepSound(sound); + this.setLightLevel(lightValue); + } + + public BlockBasic(final Material material, final CreativeTabs tab, + final float hardness, final float resistance, + final String name, final float lightValue) { + this(material, tab, hardness, resistance, name, lightValue, + BlockBasic.soundTypeMetal); + } + + public BlockBasic(final Material material, final CreativeTabs tab, + final float hardness, final float resistance, + final String name) { + this(material, tab, hardness, resistance, name, 0.0f, + BlockBasic.soundTypeMetal); + } + + public BlockBasic(final Material material, final CreativeTabs tab, + final float hardness, final String name) { + this(material, tab, hardness, 1.0f, name, 0.0f, BlockBasic.soundTypeMetal); + } + + public BlockBasic(final CreativeTabs tab, final float hardness, + final float resistance, final String name) { + this(Material.iron, tab, hardness, resistance, name, 0.0f, + BlockBasic.soundTypeMetal); + } + + public BlockBasic(final CreativeTabs tab, final float hardness, + final String name) { + this(Material.iron, tab, hardness, 1.0f, name, 0.0f, + BlockBasic.soundTypeMetal); + } + + public BlockBasic(final CreativeTabs tab, final String name) { + this(Material.iron, tab, 1.0f, 1.0f, name, 0.0f, BlockBasic.soundTypeMetal); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister reg) { + this.blockIcon = reg.registerIcon( + this.getUnlocalizedName().replace("tile.", "electricexpansion:")); + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockFuseBox.java b/src/main/java/electricexpansion/common/blocks/BlockFuseBox.java new file mode 100644 index 0000000..047b33b --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockFuseBox.java @@ -0,0 +1,186 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.ElectricExpansion; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.tile.TileEntityFuseBox; +import java.util.HashMap; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.block.BlockAdvanced; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public class BlockFuseBox extends BlockAdvanced { + private HashMap icons; + + public BlockFuseBox() { + super(UniversalElectricity.machine); + this.icons = new HashMap<>(); + this.setBlockName("FuseBox"); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + this.setStepSound(BlockFuseBox.soundTypeMetal); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess iBlockAccess, final int x, + final int y, final int z, final int side) { + final int metadata = iBlockAccess.getBlockMetadata(x, y, z); + if (side == 0 || side == 1) { + return this.icons.get("top"); + } + if (side == metadata + 2) { + return this.icons.get("output"); + } + if (side == ForgeDirection.getOrientation(metadata + 2).getOpposite().ordinal()) { + return this.icons.get("input"); + } + return this.icons.get("side"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.icons.put( + "top", par1IconRegister.registerIcon("electricexpansion:machineTop")); + this.icons.put("output", par1IconRegister.registerIcon( + "electricexpansion:machineOutput")); + this.icons.put("input", par1IconRegister.registerIcon( + "electricexpansion:machineInput")); + this.icons.put("side", + par1IconRegister.registerIcon("electricexpansion:fusebox")); + } + + @Override + public void onBlockPlacedBy(final World world, final int x, final int y, + final int z, final EntityLivingBase player, + final ItemStack itemStack) { + final int angle = MathHelper.floor_double( + ((Entity) player).rotationYaw * 4.0f / 360.0f + 0.5) & + 0x3; + switch (angle) { + case 0: { + world.setBlock(x, y, z, this, 3, 0); + break; + } + case 1: { + world.setBlock(x, y, z, this, 1, 0); + break; + } + case 2: { + world.setBlock(x, y, z, this, 2, 0); + break; + } + case 3: { + world.setBlock(x, y, z, this, 0, 0); + break; + } + } + ((TileEntityAdvanced) world.getTileEntity(x, y, z)).initiate(); + world.notifyBlocksOfNeighborChange(x, y, z, this); + } + + @Override + public boolean onUseWrench(final World par1World, final int x, final int y, + final int z, final EntityPlayer par5EntityPlayer, + final int side, final float hitX, final float hitY, + final float hitZ) { + final int original = par1World.getBlockMetadata(x, y, z); + int change = 0; + switch (original) { + case 0: { + change = 3; + break; + } + case 3: { + change = 1; + break; + } + case 1: { + change = 2; + break; + } + case 2: { + change = 0; + break; + } + } + par1World.setBlock(x, y, z, this, change, 0); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + return true; + } + + @Override + public boolean onSneakUseWrench(final World par1World, final int x, final int y, final int z, + final EntityPlayer par5EntityPlayer, final int side, + final float hitX, final float hitY, final float hitZ) { + return false; + } + + @Override + public boolean isOpaqueCube() { + return true; + } + + public boolean isBlockSolidOnSide(final World world, final int x, final int y, + final int z, final ForgeDirection side) { + return true; + } + + @Override + public boolean renderAsNormalBlock() { + return true; + } + + @Override + public TileEntity createNewTileEntity(final World var1, final int metadata) { + return new TileEntityFuseBox(); + } + + @Override + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + par3List.add(new ItemStack(this, 1, 0)); + } + + // TODO: WTF + // @Override + // public ItemStack getPickBlock(final MovingObjectPosition target, + // final World world, final int x, final int y, + // final int z) { + // final int id = this.func_71922_a(world, x, y, z); + // if (id == 0) { + // return null; + // } + // return new ItemStack(id, 1, 0); + // } + + @Override + public boolean onMachineActivated(final World par1World, final int x, + final int y, final int z, + final EntityPlayer par5EntityPlayer, + final int side, final float hitX, + final float hitY, final float hitZ) { + if (!par1World.isRemote) { + par5EntityPlayer.openGui((Object) ElectricExpansion.instance, 6, par1World, + x, y, z); + return true; + } + return true; + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockInsulatedWire.java b/src/main/java/electricexpansion/common/blocks/BlockInsulatedWire.java new file mode 100644 index 0000000..76bff54 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockInsulatedWire.java @@ -0,0 +1,164 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.cables.TileEntityInsulatedWire; +import electricexpansion.common.helpers.TileEntityConductorBase; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import universalelectricity.core.block.IConductor; +import universalelectricity.prefab.block.BlockConductor; + +public class BlockInsulatedWire extends BlockConductor { + public BlockInsulatedWire() { + super(Material.cloth); + this.setBlockName("InsulatedWire"); + this.setStepSound(BlockInsulatedWire.soundTypeCloth); + this.setResistance(0.2f); + this.setHardness(0.1f); + this.setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int damageDropped(final int i) { + return i; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public TileEntity createNewTileEntity(final World var1, int meta) { + return new TileEntityInsulatedWire(); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < 5; ++var4) { + par3List.add(new ItemStack(par1, 1, var4)); + } + } + + @Override + public void onBlockAdded(final World world, final int x, final int y, + final int z) { + super.onBlockAdded(world, x, y, z); + final TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity != null && tileEntity instanceof IConductor) { + ((IConductor) tileEntity).updateAdjacentConnections(); + this.updateWireSwitch(world, x, y, z); + } + } + + @Override + public boolean onBlockActivated(final World par1World, final int x, final int y, final int z, + final EntityPlayer par5EntityPlayer, final int par6, + final float par7, final float par8, final float par9) { + final TileEntityInsulatedWire tileEntity = (TileEntityInsulatedWire) par1World.getTileEntity(x, y, z); + if (!par1World.isRemote && + par5EntityPlayer.inventory.getCurrentItem() != null && + par5EntityPlayer.inventory.getCurrentItem().getItem() instanceof ItemDye) { + final int dyeColor = par5EntityPlayer.inventory.getCurrentItem().getItemDamageForDisplay(); + tileEntity.colorByte = (byte) dyeColor; + --par5EntityPlayer.inventory.getCurrentItem().stackSize; + // TODO: WTF + // PacketManager.sendPacketToClients(PacketManager.getPacket( + // "ElecEx", tileEntity, 0, tileEntity.colorByte)); + tileEntity.updateAdjacentConnections(); + this.updateWireSwitch(par1World, x, y, z); + return true; + } + return false; + } + + private void updateWireSwitch(final World world, final int x, final int y, + final int z) { + final TileEntityInsulatedWire tileEntity = (TileEntityInsulatedWire) world.getTileEntity(x, y, z); + if (!world.isRemote && tileEntity != null) { + for (byte i = 0; i < 6; ++i) { + TileEntity tileEntity2 = null; + switch (i) { + case 0: { + tileEntity2 = world.getTileEntity(x + 1, y, z); + break; + } + case 1: { + tileEntity2 = world.getTileEntity(x - 1, y, z); + break; + } + case 2: { + tileEntity2 = world.getTileEntity(x, y + 1, z); + break; + } + case 3: { + tileEntity2 = world.getTileEntity(x, y - 1, z); + break; + } + case 4: { + tileEntity2 = world.getTileEntity(x, y, z + 1); + break; + } + case 5: { + tileEntity2 = world.getTileEntity(x, y, z - 1); + break; + } + default: { + tileEntity2 = world.getTileEntity(x, y, z); + break; + } + } + if (tileEntity2 instanceof IConductor) { + ((IConductor) tileEntity2).updateAdjacentConnections(); + tileEntity2.getWorldObj().markBlockForUpdate( + tileEntity2.xCoord, tileEntity2.yCoord, tileEntity2.zCoord); + } + } + } + } + + @Override + public void setBlockBoundsBasedOnState(final IBlockAccess par1IBlockAccess, + final int x, final int y, + final int z) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityConductorBase) { + final TileEntityConductorBase te = (TileEntityConductorBase) tileEntity; + this.minX = ((te.connectedBlocks[4] != null) ? 0.0 : 0.30000001192092896); + this.minY = ((te.connectedBlocks[0] != null) ? 0.0 : 0.30000001192092896); + this.minZ = ((te.connectedBlocks[2] != null) ? 0.0 : 0.30000001192092896); + this.maxX = ((te.connectedBlocks[5] != null) ? 1.0 : 0.699999988079071); + this.maxY = ((te.connectedBlocks[1] != null) ? 1.0 : 0.699999988079071); + this.maxZ = ((te.connectedBlocks[3] != null) ? 1.0 : 0.699999988079071); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockInsulationMachine.java b/src/main/java/electricexpansion/common/blocks/BlockInsulationMachine.java new file mode 100644 index 0000000..b74db4b --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockInsulationMachine.java @@ -0,0 +1,179 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.ElectricExpansion; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.tile.TileEntityInsulatingMachine; +import java.util.HashMap; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.block.BlockAdvanced; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public class BlockInsulationMachine extends BlockAdvanced { + private HashMap icons; + + public BlockInsulationMachine() { + super(UniversalElectricity.machine); + this.icons = new HashMap<>(); + this.setStepSound(BlockInsulationMachine.soundTypeMetal); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + this.setBlockName("insulator"); + } + + @Override + public void onBlockPlacedBy(final World par1World, final int x, final int y, + final int z, + final EntityLivingBase par5EntityLiving, + final ItemStack itemStack) { + final int angle = MathHelper.floor_double( + ((Entity) par5EntityLiving).rotationYaw * 4.0f / 360.0f + 0.5) & + 0x3; + switch (angle) { + case 0: { + par1World.setBlock(x, y, z, this, 1, 0); + break; + } + case 1: { + par1World.setBlock(x, y, z, this, 2, 0); + break; + } + case 2: { + par1World.setBlock(x, y, z, this, 0, 0); + break; + } + case 3: { + par1World.setBlock(x, y, z, this, 3, 0); + break; + } + } + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + par1World.notifyBlocksOfNeighborChange(x, y, z, this); + } + + @Override + public boolean onUseWrench(final World par1World, final int x, final int y, + final int z, final EntityPlayer par5EntityPlayer, + final int side, final float hitX, final float hitY, + final float hitZ) { + final int metadata = par1World.getBlockMetadata(x, y, z); + int change = 0; + switch (metadata) { + case 0: { + change = 3; + break; + } + case 3: { + change = 1; + break; + } + case 1: { + change = 2; + break; + } + case 2: { + change = 0; + break; + } + } + par1World.setBlock(x, y, z, this, change, 0); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + return true; + } + + @Override + public boolean onMachineActivated(final World par1World, final int x, + final int y, final int z, + final EntityPlayer par5EntityPlayer, + final int side, final float hitX, + final float hitY, final float hitZ) { + if (!par1World.isRemote) { + par5EntityPlayer.openGui((Object) ElectricExpansion.instance, 5, par1World, + x, y, z); + return true; + } + return true; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public TileEntity createNewTileEntity(final World var1, final int metadata) { + return new TileEntityInsulatingMachine(); + } + + // TODO: WTF + // @Override + // public ItemStack getPickBlock(final MovingObjectPosition target, + // final World world, final int x, final int y, + // final int z) { + // final int id = this.func_71922_a(world, x, y, z); + // if (id == 0) { + // return null; + // } + // final Item item = Item.field_77698_e[id]; + // if (item == null) { + // return null; + // } + // return new ItemStack(id, 1, 0); + // } + + @Override + public boolean hasTileEntity(final int metadata) { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() { + return 0; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.icons.put( + "top", par1IconRegister.registerIcon("electricexpansion:insulatorTop")); + this.icons.put("input", par1IconRegister.registerIcon( + "electricexpansion:machineInput")); + this.icons.put("insulator", par1IconRegister.registerIcon( + "electricexpansion:insulatorFront")); + this.icons.put( + "", par1IconRegister.registerIcon("electricexpansion:machineTop")); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int side, final int metadata) { + if (side == 1) { + return this.icons.get("top"); + } + if (side == metadata + 2) { + return this.icons.get("input"); + } + if (ForgeDirection.getOrientation(side).getOpposite().ordinal() == metadata + 2) { + return this.icons.get("insulator"); + } + return this.icons.get(""); + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockLogisticsWire.java b/src/main/java/electricexpansion/common/blocks/BlockLogisticsWire.java new file mode 100644 index 0000000..63fb87a --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockLogisticsWire.java @@ -0,0 +1,144 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.cables.TileEntityLogisticsWire; +import electricexpansion.common.helpers.TileEntityConductorBase; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.prefab.block.BlockConductor; +import universalelectricity.prefab.implement.IRedstoneProvider; + +public class BlockLogisticsWire extends BlockConductor { + public BlockLogisticsWire(final int meta) { + super(Material.cloth); + this.setBlockName("LogisticsWire"); + this.setStepSound(BlockLogisticsWire.soundTypeCloth); + this.setResistance(0.2f); + this.setHardness(0.1f); + this.setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int damageDropped(final int i) { + return i; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public TileEntity createNewTileEntity(final World var1, int meta) { + return new TileEntityLogisticsWire(); + } + + @Override + public boolean canProvidePower() { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < 5; ++var4) { + par3List.add(new ItemStack(par1, 1, var4)); + } + } + + // TODO: WTF + // @Override + // public boolean onBlockActivated(final World par1World, final int par2, + // final int par3, final int par4, + // final EntityPlayer par5EntityPlayer, + // final int par6, final float par7, + // final float par8, final float par9) { + // final TileEntityLogisticsWire tileEntity = + // (TileEntityLogisticsWire)par1World.getTileEntity(par2, par3, par4); + // if (!par1World.isRemote) { + // PacketManager.sendPacketToClients( + // PacketManager.getPacket( + // "ElecEx", tileEntity, 3, tileEntity.buttonStatus0, + // tileEntity.buttonStatus1, tileEntity.buttonStatus2), + // tileEntity.field_70331_k, new Vector3(tileEntity), 12.0); + // return true; + // } + // PacketDispatcher.sendPacketToServer( + // PacketManager.getPacket("ElecEx", tileEntity, 7, true)); + // par5EntityPlayer.openGui((Object)ElectricExpansion.instance, 3, + // par1World, + // par2, par3, par4); + // return true; + // } + + @Override + public int isProvidingStrongPower(final IBlockAccess par1IBlockAccess, + final int x, final int y, final int z, + final int side) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof IRedstoneProvider) { + return ((IRedstoneProvider) tileEntity) + .isPoweringTo(ForgeDirection.getOrientation(side)) + ? 15 + : 0; + } + return 0; + } + + @Override + public int isProvidingWeakPower(final IBlockAccess par1IBlockAccess, + final int x, final int y, final int z, + final int side) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof IRedstoneProvider) { + return ((IRedstoneProvider) tileEntity) + .isIndirectlyPoweringTo(ForgeDirection.getOrientation(side)) + ? 15 + : 0; + } + return 0; + } + + @Override + public void setBlockBoundsBasedOnState(final IBlockAccess par1IBlockAccess, + final int x, final int y, + final int z) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityConductorBase) { + final TileEntityConductorBase te = (TileEntityConductorBase) tileEntity; + this.minX = ((te.connectedBlocks[4] != null) ? 0.0 : 0.30000001192092896); + this.minY = ((te.connectedBlocks[0] != null) ? 0.0 : 0.30000001192092896); + this.minZ = ((te.connectedBlocks[2] != null) ? 0.0 : 0.30000001192092896); + this.maxX = ((te.connectedBlocks[5] != null) ? 1.0 : 0.699999988079071); + this.maxY = ((te.connectedBlocks[1] != null) ? 1.0 : 0.699999988079071); + this.maxZ = ((te.connectedBlocks[3] != null) ? 1.0 : 0.699999988079071); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockMultimeter.java b/src/main/java/electricexpansion/common/blocks/BlockMultimeter.java new file mode 100644 index 0000000..80e7f29 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockMultimeter.java @@ -0,0 +1,163 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.tile.TileEntityMultimeter; +import java.util.HashMap; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.block.BlockAdvanced; +import universalelectricity.prefab.implement.IRedstoneProvider; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public class BlockMultimeter extends BlockAdvanced { + private HashMap icons; + + public BlockMultimeter() { + super(UniversalElectricity.machine); + this.icons = new HashMap<>(); + this.setStepSound(Block.soundTypeMetal); + this.setCreativeTab((CreativeTabs)EETab.INSTANCE); + this.setBlockName("multimeter"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int side, final int metadata) { + if (side == 3) { + return this.icons.get("front"); + } + return this.icons.get("top"); + } + + @Override + public IIcon getIcon(final IBlockAccess par1IBlockAccess, final int x, + final int y, final int z, final int side) { + final int metadata = par1IBlockAccess.getBlockMetadata(x, y, z); + if (side == + ForgeDirection.getOrientation(metadata).getOpposite().ordinal()) { + return this.icons.get("output"); + } + return this.icons.get("top"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.icons.put( + "top", par1IconRegister.registerIcon("electricexpansion:machineTop")); + this.icons.put("output", par1IconRegister.registerIcon( + "electricexpansion:machineOutput")); + this.icons.put("machine", + par1IconRegister.registerIcon("electricexpansion:machine")); + this.icons.put( + "front", par1IconRegister.registerIcon("electricexpansion:multimeter")); + } + + @Override + public void onBlockPlacedBy(final World world, final int x, final int y, + final int z, + final EntityLivingBase par5EntityLiving, + final ItemStack itemStack) { + final int angle = + MathHelper.floor_double( + ((Entity)par5EntityLiving).rotationYaw * 4.0f / 360.0f + 0.5) & + 0x3; + int change = 2; + switch (angle) { + case 0: { + change = 2; + break; + } + case 1: { + change = 5; + break; + } + case 2: { + change = 3; + break; + } + case 3: { + change = 4; + break; + } + } + world.setBlock(x, y, z, this, change, 0); + ((TileEntityAdvanced)world.getTileEntity(x, y, z)).initiate(); + world.notifyBlocksOfNeighborChange(x, y, z, this); + } + + @Override + public boolean onUseWrench(final World world, final int x, final int y, + final int z, final EntityPlayer par5EntityPlayer, + final int side, final float hitX, final float hitY, + final float hitZ) { + final int original = world.getBlockMetadata(x, y, z); + int change = 2; + switch (original) { + case 2: { + change = 5; + break; + } + case 5: { + change = 4; + break; + } + case 4: { + change = 3; + break; + } + case 3: { + change = 2; + break; + } + } + world.setBlock(x, y, z, this, change, 0); + world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + ((TileEntityAdvanced)world.getTileEntity(x, y, z)).initiate(); + world.notifyBlocksOfNeighborChange(x, y, z, this); + return true; + } + + @Override + public int isProvidingStrongPower(final IBlockAccess par1IBlockAccess, + final int x, final int y, final int z, + final int side) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof IRedstoneProvider) { + return ((IRedstoneProvider)tileEntity) + .isPoweringTo(ForgeDirection.getOrientation(side)) + ? 15 + : 0; + } + return 0; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public TileEntity createNewTileEntity(final World var1, final int metadata) { + return new TileEntityMultimeter(); + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockQuantumBatteryBox.java b/src/main/java/electricexpansion/common/blocks/BlockQuantumBatteryBox.java new file mode 100644 index 0000000..892691b --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockQuantumBatteryBox.java @@ -0,0 +1,205 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.ElectricExpansion; +import electricexpansion.common.helpers.PlayerHelper; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.tile.TileEntityAdvancedBatteryBox; +import electricexpansion.common.tile.TileEntityQuantumBatteryBox; +import java.util.HashMap; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.prefab.block.BlockAdvanced; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public class BlockQuantumBatteryBox extends BlockAdvanced { + private HashMap icons; + + public BlockQuantumBatteryBox() { + super(Material.iron); + this.icons = new HashMap<>(); + this.setBlockName("Distribution"); + this.setStepSound(BlockQuantumBatteryBox.soundTypeMetal); + this.setHardness(1.5f); + this.setResistance(10.0f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean isOpaqueCube() { + return true; + } + + @Override + public int damageDropped(final int i) { + return 0; + } + + @Override + public boolean renderAsNormalBlock() { + return true; + } + + @Override + public IIcon getIcon(final int side, final int metadata) { + if (side == metadata + 2) { + return this.icons.get("output"); + } + if (side == ForgeDirection.getOrientation(metadata + 2).getOpposite().ordinal()) { + return this.icons.get("input"); + } + return this.icons.get("default"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.icons.put("output", par1IconRegister.registerIcon( + "electricexpansion:darkMachineOutput")); + this.icons.put("input", par1IconRegister.registerIcon( + "electricexpansion:darkMachineInput")); + this.icons.put("default", par1IconRegister.registerIcon( + "electricexpansion:darkMachineTop")); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + par3List.add(new ItemStack(par1, 1, 0)); + } + + @Override + public TileEntity createNewTileEntity(final World var1, final int meta) { + return new TileEntityQuantumBatteryBox(); + } + + @Override + public boolean onBlockActivated(final World par1World, final int x, final int y, final int z, + final EntityPlayer player, final int par6, final float par7, + final float par8, final float par9) { + if (par1World.isRemote) { + return true; + } + if (player.getDisplayName() == ((TileEntityQuantumBatteryBox) par1World.getTileEntity(x, y, z)) + .getOwningPlayer() || + PlayerHelper.isPlayerOp(player.getDisplayName())) { + player.openGui((Object) ElectricExpansion.instance, 4, par1World, x, y, z); + return true; + } + return true; + } + + @Override + public void onBlockPlacedBy(final World par1World, final int x, final int y, + final int z, + final EntityLivingBase par5EntityLiving, + final ItemStack itemStack) { + final int angle = MathHelper.floor_double( + ((Entity) par5EntityLiving).rotationYaw * 4.0f / 360.0f + 0.5) & + 0x3; + switch (angle) { + case 0: { + par1World.setBlock(x, y, z, this, 3, 0); + break; + } + case 1: { + par1World.setBlock(x, y, z, this, 1, 0); + break; + } + case 2: { + par1World.setBlock(x, y, z, this, 2, 0); + break; + } + case 3: { + par1World.setBlock(x, y, z, this, 0, 0); + break; + } + } + if (par5EntityLiving instanceof EntityPlayer && + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)) instanceof TileEntityQuantumBatteryBox) { + ((TileEntityQuantumBatteryBox) par1World.getTileEntity(x, y, z)) + .setPlayer((EntityPlayer) par5EntityLiving); + } + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + par1World.notifyBlocksOfNeighborChange(x, y, z, this); + } + + @Override + public boolean onUseWrench(final World par1World, final int x, final int y, + final int z, final EntityPlayer par5EntityPlayer, + final int side, final float hitX, final float hitY, + final float hitZ) { + final int metadata = par1World.getBlockMetadata(x, y, z); + int change = 0; + switch (metadata) { + case 0: { + change = 3; + break; + } + case 3: { + change = 1; + break; + } + case 1: { + change = 2; + break; + } + case 2: { + change = 0; + break; + } + } + par1World.setBlock(x, y, z, this, change, 0); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + return true; + } + + // TODO: WTF + // @Override + // public ItemStack getPickBlock(final MovingObjectPosition target, final + // World world, final int x, final int y, final int z) { + // final int id = this.func_71922_a(world, x, y, z); + // if (id == 0) { + // return null; + // } + // final Item item = Item.field_77698_e[id]; + // if (item == null) { + // return null; + // } + // return new ItemStack(id, 1, 0); + // } + + @Override + public boolean hasComparatorInputOverride() { + return true; + } + + @Override + public int getComparatorInputOverride(final World par1World, final int x, + final int y, final int z, + final int meta) { + final TileEntity tileEntity = par1World.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityQuantumBatteryBox) { + final TileEntityAdvancedBatteryBox te = (TileEntityAdvancedBatteryBox) tileEntity; + final double max = te.getMaxJoules(); + final double current = te.getJoules(); + return (int) (current / max * 15.0); + } + return 0; + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockRawWire.java b/src/main/java/electricexpansion/common/blocks/BlockRawWire.java new file mode 100644 index 0000000..c5eaaf3 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockRawWire.java @@ -0,0 +1,105 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.api.EnumWireMaterial; +import electricexpansion.common.cables.TileEntityRawWire; +import electricexpansion.common.helpers.TileEntityConductorBase; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import universalelectricity.prefab.CustomDamageSource; +import universalelectricity.prefab.block.BlockConductor; + +public class BlockRawWire extends BlockConductor { + public BlockRawWire() { + super(Material.cloth); + this.setBlockName("RawWire"); + this.setStepSound(BlockRawWire.soundTypeCloth); + this.setResistance(0.2f); + this.setHardness(0.1f); + this.setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int damageDropped(final int i) { + return i; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public void onEntityCollidedWithBlock(final World par1World, final int x, + final int y, final int z, + final Entity entity) { + if (entity instanceof EntityLivingBase) { + final TileEntityRawWire tileEntity = (TileEntityRawWire) par1World.getTileEntity(x, y, z); + if (tileEntity.getNetwork().getProduced(new TileEntity[0]).getWatts() > 0.0) { + ((EntityLivingBase) entity) + .attackEntityFrom( + (DamageSource) CustomDamageSource.electrocution, + EnumWireMaterial.values()[par1World.getBlockMetadata(x, y, z)].electrocutionDamage); + } + } + } + + @Override + public TileEntity createNewTileEntity(final World var1, int meta) { + return new TileEntityRawWire(); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < 5; ++var4) { + par3List.add(new ItemStack(par1, 1, var4)); + } + } + + @Override + public void setBlockBoundsBasedOnState(final IBlockAccess par1IBlockAccess, + final int x, final int y, + final int z) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityConductorBase) { + final TileEntityConductorBase te = (TileEntityConductorBase) tileEntity; + this.minX = ((te.connectedBlocks[4] != null) ? 0.0 : 0.30000001192092896); + this.minY = ((te.connectedBlocks[0] != null) ? 0.0 : 0.30000001192092896); + this.minZ = ((te.connectedBlocks[2] != null) ? 0.0 : 0.30000001192092896); + this.maxX = ((te.connectedBlocks[5] != null) ? 1.0 : 0.699999988079071); + this.maxY = ((te.connectedBlocks[1] != null) ? 1.0 : 0.699999988079071); + this.maxZ = ((te.connectedBlocks[3] != null) ? 1.0 : 0.699999988079071); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockRedstoneNetworkCore.java b/src/main/java/electricexpansion/common/blocks/BlockRedstoneNetworkCore.java new file mode 100644 index 0000000..6634a84 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockRedstoneNetworkCore.java @@ -0,0 +1,154 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EENetwork; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.tile.TileEntityRedstoneNetworkCore; +import java.util.HashMap; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import universalelectricity.prefab.block.BlockAdvanced; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public class BlockRedstoneNetworkCore extends BlockAdvanced { + private HashMap icons; + + public BlockRedstoneNetworkCore() { + super(Material.iron); + this.icons = new HashMap<>(); + this.setStepSound(BlockRedstoneNetworkCore.soundTypeMetal); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + this.setBlockName("RsNetCore"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.icons.put( + "top", par1IconRegister.registerIcon("electricexpansion:rsMachine")); + this.icons.put("out", par1IconRegister.registerIcon( + "electricexpansion:rsMachineOutput")); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int side, final int metadata) { + return (side == metadata) ? this.icons.get("out") : this.icons.get("top"); + } + + @Override + public void onBlockPlacedBy(final World par1World, final int x, final int y, + final int z, + final EntityLivingBase par5EntityLiving, + final ItemStack itemStack) { + final int angle = MathHelper.floor_double( + ((Entity) par5EntityLiving).rotationYaw * 4.0f / 360.0f + 0.5) & + 0x3; + switch (angle) { + case 0: { + par1World.setBlock(x, y, z, this, 5, 0); + break; + } + case 1: { + par1World.setBlock(x, y, z, this, 3, 0); + break; + } + case 2: { + par1World.setBlock(x, y, z, this, 4, 0); + break; + } + case 3: { + par1World.setBlock(x, y, z, this, 2, 0); + break; + } + } + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + par1World.markBlockForUpdate(x, y, z); + } + + @Override + public boolean onUseWrench(final World par1World, final int x, final int y, + final int z, final EntityPlayer par5EntityPlayer, + final int side, final float hitX, final float hitY, + final float hitZ) { + final int metadata = par1World.getBlockMetadata(x, y, z); + int change = 0; + switch (metadata) { + case 0: { + change = 1; + break; + } + case 1: { + change = 2; + break; + } + case 2: { + change = 5; + break; + } + case 3: { + change = 4; + break; + } + case 4: { + change = 0; + break; + } + case 5: { + change = 3; + break; + } + } + par1World.setBlock(x, y, z, this, change, 0); + par1World.markBlockForUpdate(x, y, z); + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + return true; + } + + @Override + public TileEntity createNewTileEntity(final World world, final int metadata) { + return new TileEntityRedstoneNetworkCore(); + } + + // TODO: WTF + // @Override + // public ItemStack getPickBlock(final MovingObjectPosition target, final + // World world, final int x, final int y, final int z) { + // final int id = this.func_71922_a(world, x, y, z); + // if (id == 0) { + // return null; + // } + // final Item item = Item.field_77698_e[id]; + // if (item == null) { + // return null; + // } + // return new ItemStack(id, 1, 0); + // } + + @Override + public boolean onMachineActivated(final World world, final int x, final int y, + final int z, final EntityPlayer player, + final int par6, final float par7, + final float par8, final float par9) { + final TileEntityRedstoneNetworkCore te = (TileEntityRedstoneNetworkCore) world.getTileEntity(x, y, z); + if (te.getNetwork() != null) { + player.addChatMessage(new ChatComponentText( + "NetRsLevel: " + ((EENetwork) te.getNetwork()).rsLevel)); + } else { + player.addChatMessage( + new ChatComponentText("NetRsLevel: NETWORK INVALID")); + } + return true; + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockRedstonePaintedWire.java b/src/main/java/electricexpansion/common/blocks/BlockRedstonePaintedWire.java new file mode 100644 index 0000000..15f47d2 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockRedstonePaintedWire.java @@ -0,0 +1,198 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.cables.TileEntityRedstonePaintedWire; +import electricexpansion.common.helpers.TileEntityConductorBase; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import universalelectricity.core.block.IConductor; + +public class BlockRedstonePaintedWire + extends Block implements ITileEntityProvider { + public BlockRedstonePaintedWire() { + super(Material.cloth); + this.setBlockName("RedstonePaintedWire"); + this.setStepSound(BlockRedstonePaintedWire.soundTypeCloth); + this.setResistance(0.2f); + this.setHardness(0.1f); + this.setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean canConnectRedstone(final IBlockAccess world, final int x, + final int y, final int z, final int side) { + final TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityRedstonePaintedWire) { + final TileEntityRedstonePaintedWire te = (TileEntityRedstonePaintedWire) tileEntity; + return side > -1 && side < 6 && te.connectedBlocks[side] == null; + } + return false; + } + + @Override + public int isProvidingStrongPower(final IBlockAccess world, final int x, + final int y, final int z, final int side) { + if (world.getTileEntity(x, y, z) instanceof TileEntityRedstonePaintedWire) { + final TileEntityRedstonePaintedWire te = (TileEntityRedstonePaintedWire) world.getTileEntity(x, y, z); + if (te.smartNetwork != null) { + return te.smartNetwork.rsLevel; + } + } + return 0; + } + + @Override + public int isProvidingWeakPower(final IBlockAccess world, final int x, + final int y, final int z, final int side) { + if (world.getTileEntity(x, y, z) instanceof TileEntityRedstonePaintedWire) { + final TileEntityRedstonePaintedWire te = (TileEntityRedstonePaintedWire) world.getTileEntity(x, y, z); + if (te.smartNetwork != null) { + return te.smartNetwork.rsLevel; + } + } + return 0; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int damageDropped(final int i) { + return i; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public TileEntity createNewTileEntity(final World world, int meta) { + return new TileEntityRedstonePaintedWire(); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < 5; ++var4) { + par3List.add(new ItemStack(par1, 1, var4)); + } + } + + @Override + public void onBlockAdded(final World world, final int x, final int y, + final int z) { + super.onBlockAdded(world, x, y, z); + final TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity != null && tileEntity instanceof IConductor) { + ((IConductor) tileEntity).updateAdjacentConnections(); + this.updateWireSwitch(world, x, y, z); + } + } + + private void updateWireSwitch(final World world, final int x, final int y, + final int z) { + final TileEntityRedstonePaintedWire tileEntity = (TileEntityRedstonePaintedWire) world.getTileEntity(x, y, z); + if (!world.isRemote && tileEntity != null) { + for (byte i = 0; i < 6; ++i) { + TileEntity tileEntity2 = null; + switch (i) { + case 0: { + tileEntity2 = world.getTileEntity(x + 1, y, z); + break; + } + case 1: { + tileEntity2 = world.getTileEntity(x - 1, y, z); + break; + } + case 2: { + tileEntity2 = world.getTileEntity(x, y + 1, z); + break; + } + case 3: { + tileEntity2 = world.getTileEntity(x, y - 1, z); + break; + } + case 4: { + tileEntity2 = world.getTileEntity(x, y, z + 1); + break; + } + case 5: { + tileEntity2 = world.getTileEntity(x, y, z - 1); + break; + } + default: { + tileEntity2 = world.getTileEntity(x, y, z); + break; + } + } + if (tileEntity2 instanceof IConductor) { + ((IConductor) tileEntity2).updateAdjacentConnections(); + tileEntity2.getWorldObj().markBlockForUpdate( + tileEntity2.xCoord, tileEntity2.yCoord, tileEntity2.zCoord); + } + } + } + } + + @Override + public void setBlockBoundsBasedOnState(final IBlockAccess par1IBlockAccess, + final int x, final int y, + final int z) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityConductorBase) { + final TileEntityConductorBase te = (TileEntityConductorBase) tileEntity; + this.minX = ((te.connectedBlocks[4] != null) ? 0.0 : 0.30000001192092896); + this.minY = ((te.connectedBlocks[0] != null) ? 0.0 : 0.30000001192092896); + this.minZ = ((te.connectedBlocks[2] != null) ? 0.0 : 0.30000001192092896); + this.maxX = ((te.connectedBlocks[5] != null) ? 1.0 : 0.699999988079071); + this.maxY = ((te.connectedBlocks[1] != null) ? 1.0 : 0.699999988079071); + this.maxZ = ((te.connectedBlocks[3] != null) ? 1.0 : 0.699999988079071); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + } + + @Override + public boolean onBlockActivated(final World world, final int x, final int y, + final int z, final EntityPlayer player, + final int par6, final float par7, + final float par8, final float par9) { + final TileEntityRedstonePaintedWire te = (TileEntityRedstonePaintedWire) world.getTileEntity(x, y, z); + if (te.smartNetwork != null) { + player.addChatMessage( + new ChatComponentText("NetRsLevel: " + te.smartNetwork.rsLevel)); + } else { + player.addChatMessage( + new ChatComponentText("NetRsLevel: NETWORK INVALID")); + } + player.addChatMessage(new ChatComponentText( + "WldRsLevel: " + world.getBlockPowerInput(x, y, z))); + return true; + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockSwitchWire.java b/src/main/java/electricexpansion/common/blocks/BlockSwitchWire.java new file mode 100644 index 0000000..171620a --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockSwitchWire.java @@ -0,0 +1,89 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.cables.TileEntitySwitchWire; +import electricexpansion.common.helpers.TileEntityConductorBase; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import universalelectricity.prefab.block.BlockConductor; + +public class BlockSwitchWire extends BlockConductor { + public BlockSwitchWire() { + super(Material.cloth); + this.setBlockName("SwitchWire"); + this.setStepSound(BlockSwitchWire.soundTypeCloth); + this.setResistance(0.2f); + this.setHardness(0.1f); + this.setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int damageDropped(final int i) { + return i; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public TileEntity createNewTileEntity(final World var1, int meta) { + return new TileEntitySwitchWire(); + } + + @Override + public boolean canProvidePower() { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < 5; ++var4) { + par3List.add(new ItemStack(par1, 1, var4)); + } + } + + @Override + public void setBlockBoundsBasedOnState(final IBlockAccess par1IBlockAccess, + final int x, final int y, + final int z) { + final TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityConductorBase) { + final TileEntityConductorBase te = (TileEntityConductorBase) tileEntity; + this.minX = ((te.connectedBlocks[4] != null) ? 0.0 : 0.30000001192092896); + this.minY = ((te.connectedBlocks[0] != null) ? 0.0 : 0.30000001192092896); + this.minZ = ((te.connectedBlocks[2] != null) ? 0.0 : 0.30000001192092896); + this.maxX = ((te.connectedBlocks[5] != null) ? 1.0 : 0.699999988079071); + this.maxY = ((te.connectedBlocks[1] != null) ? 1.0 : 0.699999988079071); + this.maxZ = ((te.connectedBlocks[3] != null) ? 1.0 : 0.699999988079071); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockSwitchWireBlock.java b/src/main/java/electricexpansion/common/blocks/BlockSwitchWireBlock.java new file mode 100644 index 0000000..cd36b5c --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockSwitchWireBlock.java @@ -0,0 +1,106 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.cables.TileEntitySwitchWireBlock; +import electricexpansion.common.helpers.TileEntityConductorBase; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import universalelectricity.prefab.block.BlockConductor; + +public class BlockSwitchWireBlock extends BlockConductor { + public BlockSwitchWireBlock() { + super(Material.rock); + this.setBlockName("SwitchWireBlock"); + this.setStepSound(BlockSwitchWireBlock.soundTypeStone); + this.setResistance(0.2f); + this.setHardness(1.5f); + this.setResistance(10.0f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return 0; + } + + @Override + public boolean renderAsNormalBlock() { + return true; + } + + @Override + public int damageDropped(final int i) { + return i; + } + + @Override + public TileEntity createNewTileEntity(final World var1, int meta) { + return new TileEntitySwitchWireBlock(); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < 5; ++var4) { + par3List.add(new ItemStack(par1, 1, var4)); + } + } + + @Override + public boolean canConnectRedstone(final IBlockAccess world, final int x, + final int y, final int z, final int side) { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess par1IBlockAccess, final int x, + final int y, final int z, final int side) { + return (((TileEntityConductorBase) par1IBlockAccess.getTileEntity(x, y, z)).textureItemStack == null) + ? this.blockIcon + : ((TileEntityConductorBase) par1IBlockAccess.getTileEntity(x, y, z)).textureItemStack.getIconIndex(); + } + + @Override + public boolean onBlockActivated(final World world, final int x, final int y, + final int z, final EntityPlayer player, + final int par6, final float par7, + final float par8, final float par9) { + if (!(world.getTileEntity(x, y, z) instanceof TileEntityConductorBase)) { + return false; + } + if (player.inventory.getCurrentItem().getItem() != Item.getItemFromBlock(this)) { + ((TileEntityConductorBase) world.getTileEntity(x, y, z)).textureItemStack = player.inventory + .getCurrentItem(); + world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + return true; + } + ((TileEntityConductorBase) world.getTileEntity(x, y, z)).textureItemStack = null; + world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.blockIcon = par1IconRegister.registerIcon("electricexpansion:CamoWire"); + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockTransformer.java b/src/main/java/electricexpansion/common/blocks/BlockTransformer.java new file mode 100644 index 0000000..800ba87 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockTransformer.java @@ -0,0 +1,177 @@ +// +// Decompiled by Procyon v0.6.0 +// + +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.client.ClientProxy; +import electricexpansion.common.misc.EETab; +import electricexpansion.common.tile.TileEntityTransformer; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.block.BlockAdvanced; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public class BlockTransformer extends BlockAdvanced { + public BlockTransformer() { + super(UniversalElectricity.machine); + this.setStepSound(BlockTransformer.soundTypeMetal); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + this.setBlockName("transformer"); + } + + @Override + public void onBlockPlacedBy(final World par1World, final int x, final int y, + final int z, + final EntityLivingBase par5EntityLiving, + final ItemStack itemStack) { + final int metadata = par1World.getBlockMetadata(x, y, z); + final int tierStart = metadata - (metadata & 0x3); + final int angle = MathHelper.floor_double( + ((Entity) par5EntityLiving).rotationYaw * 4.0f / 360.0f + 0.5) & + 0x3; + switch (angle) { + case 0: { + par1World.setBlock(x, y, z, this, tierStart + 3, 0); + break; + } + case 1: { + par1World.setBlock(x, y, z, this, tierStart + 1, 0); + break; + } + case 2: { + par1World.setBlock(x, y, z, this, tierStart + 2, 0); + break; + } + case 3: { + par1World.setBlock(x, y, z, this, tierStart + 0, 0); + break; + } + } + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + par1World.notifyBlocksOfNeighborChange(x, y, z, this); + } + + @Override + public boolean onUseWrench(final World par1World, final int x, final int y, + final int z, final EntityPlayer par5EntityPlayer, + final int side, final float hitX, final float hitY, + final float hitZ) { + final int metadata = par1World.getBlockMetadata(x, y, z); + final int tierStart = metadata - (metadata & 0x3); + final int original = metadata & 0x3; + int change = 0; + switch (original) { + case 0: { + change = 3; + break; + } + case 3: { + change = 1; + break; + } + case 1: { + change = 2; + break; + } + case 2: { + change = 0; + break; + } + } + par1World.setBlock(x, y, z, this, change + tierStart, 0); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + ((TileEntityAdvanced) par1World.getTileEntity(x, y, z)).initiate(); + return true; + } + + @Override + public boolean onSneakUseWrench(final World par1World, final int x, final int y, final int z, + final EntityPlayer par5EntityPlayer, final int side, + final float hitX, final float hitY, final float hitZ) { + if (!par1World.isRemote) { + final TileEntityTransformer tileEntity = (TileEntityTransformer) par1World.getTileEntity(x, y, z); + tileEntity.stepUp = !tileEntity.stepUp; + par1World.markBlockForUpdate(x, y, z); + } + return true; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean isBlockSolid(final IBlockAccess world, final int x, + final int y, final int z, final int side) { + return side == ForgeDirection.DOWN.ordinal(); + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() { + return ClientProxy.RENDER_ID; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public TileEntity createNewTileEntity(final World var1, final int metadata) { + return new TileEntityTransformer(); + } + + @Override + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int i = 0; i < 9; i += 4) { + par3List.add(new ItemStack((Block) this, 1, i)); + } + } + + // TODO: WTF + // @Override + // public ItemStack getPickBlock(final MovingObjectPosition target, + // final World world, final int x, final int y, + // final int z) { + // final int id = this.func_71922_a(world, x, y, z); + // if (id == 0) { + // return null; + // } + // final Item item = Item.field_77698_e[id]; + // if (item == null) { + // return null; + // } + // final int metadata = world.getBlockMetadata(x, y, z); + // final int tierStart = metadata - (metadata & 0x3); + // return new ItemStack(id, 1, tierStart); + // } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + } + + @Override + public int damageDropped(final int metadata) { + return metadata - (metadata & 0x3); + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockWireBlock.java b/src/main/java/electricexpansion/common/blocks/BlockWireBlock.java new file mode 100644 index 0000000..4baac42 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockWireBlock.java @@ -0,0 +1,119 @@ +package electricexpansion.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.cables.TileEntityWireBlock; +import electricexpansion.common.helpers.TileEntityConductorBase; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import universalelectricity.prefab.block.BlockConductor; + +public class BlockWireBlock extends BlockConductor { + public BlockWireBlock() { + super(Material.rock); + this.setBlockName("HiddenWire"); + this.setStepSound(BlockWireBlock.soundTypeStone); + this.setResistance(0.2f); + this.setHardness(1.5f); + // TODO: WTF + // this.setResistance(10.0f); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return 0; + } + + @Override + public int damageDropped(final int i) { + return i; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public int getRenderType() { + return 0; + } + + @Override + public TileEntity createNewTileEntity(final World var1, int meta) { + return new TileEntityWireBlock(); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < 5; ++var4) { + par3List.add(new ItemStack(par1, 1, var4)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess par1IBlockAccess, final int x, + final int y, final int z, final int side) { + return (((TileEntityConductorBase) par1IBlockAccess.getTileEntity(x, y, z)).textureItemStack == null) + ? this.blockIcon + : ((TileEntityConductorBase) par1IBlockAccess.getTileEntity(x, y, z)).textureItemStack.getIconIndex(); + } + + @Override + public boolean onBlockActivated(final World world, final int x, final int y, + final int z, final EntityPlayer player, + final int par6, final float par7, + final float par8, final float par9) { + final TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityConductorBase) { + final TileEntityConductorBase te = (TileEntityConductorBase) tileEntity; + if (player.inventory.getCurrentItem() != null && + player.inventory.getCurrentItem().getItem() instanceof ItemBlock) { + if (!te.isIconLocked && + player.inventory.getCurrentItem().getItem() != Item.getItemFromBlock(this) && + Block.getBlockFromItem(player.inventory.getCurrentItem().getItem()) + .isNormalCube()) { + ((TileEntityConductorBase) world.getTileEntity(x, y, z)).textureItemStack = player.inventory + .getCurrentItem(); + world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + return true; + } + ((TileEntityConductorBase) world.getTileEntity(x, y, z)).textureItemStack = null; + world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + return true; + } else if (player.isSneaking()) { + te.isIconLocked = !te.isIconLocked; + return true; + } + } + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + this.blockIcon = par1IconRegister.registerIcon("electricexpansion:CamoWire"); + } +} diff --git a/src/main/java/electricexpansion/common/blocks/BlockWireMill.java b/src/main/java/electricexpansion/common/blocks/BlockWireMill.java new file mode 100644 index 0000000..f12afa8 --- /dev/null +++ b/src/main/java/electricexpansion/common/blocks/BlockWireMill.java @@ -0,0 +1,136 @@ +package electricexpansion.common.blocks; + +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.client.ClientProxy; +import electricexpansion.common.tile.TileEntityWireMill; +import net.minecraft.tileentity.TileEntity; +import electricexpansion.common.ElectricExpansion; +import net.minecraft.entity.player.EntityPlayer; +import universalelectricity.prefab.tile.TileEntityAdvanced; +import net.minecraft.util.MathHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import electricexpansion.common.misc.EETab; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.prefab.block.BlockAdvanced; + +public class BlockWireMill extends BlockAdvanced +{ + public BlockWireMill() { + super(UniversalElectricity.machine); + this.setStepSound(BlockWireMill.soundTypeMetal); + this.setBlockName("wiremill"); + this.setCreativeTab((CreativeTabs)EETab.INSTANCE); + } + + @Override + public void onBlockPlacedBy(final World par1World, final int x, final int y, final int z, final EntityLivingBase par5EntityLiving, final ItemStack itemStack) { + final int angle = MathHelper.floor_double(((Entity)par5EntityLiving).rotationYaw * 4.0f / 360.0f + 0.5) & 0x3; + switch (angle) { + case 0: { + par1World.setBlock(x, y, z, this, 1, 0); + break; + } + case 1: { + par1World.setBlock(x, y, z, this, 2, 0); + break; + } + case 2: { + par1World.setBlock(x, y, z, this, 0, 0); + break; + } + case 3: { + par1World.setBlock(x, y, z, this, 3, 0); + break; + } + } + ((TileEntityAdvanced)par1World.getTileEntity(x, y, z)).initiate(); + par1World.notifyBlocksOfNeighborChange(x, y, z, this); + } + + @Override + public boolean onUseWrench(final World par1World, final int x, final int y, final int z, final EntityPlayer par5EntityPlayer, final int side, final float hitX, final float hitY, final float hitZ) { + final int metadata = par1World.getBlockMetadata(x, y, z); + int change = 0; + switch (metadata) { + case 0: { + change = 3; + break; + } + case 3: { + change = 1; + break; + } + case 1: { + change = 2; + break; + } + case 2: { + change = 0; + break; + } + } + par1World.setBlock(x, y, z, this, change, 0); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + ((TileEntityAdvanced)par1World.getTileEntity(x, y, z)).initiate(); + return true; + } + + @Override + public boolean onMachineActivated(final World par1World, final int x, final int y, final int z, final EntityPlayer par5EntityPlayer, final int side, final float hitX, final float hitY, final float hitZ) { + if (!par1World.isRemote) { + par5EntityPlayer.openGui((Object)ElectricExpansion.instance, 2, par1World, x, y, z); + return true; + } + return true; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public TileEntity createNewTileEntity(final World var1, final int metadata) { + return new TileEntityWireMill(); + } + + //TODO: WTF + //public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) { + // final int id = this.func_71922_a(world, x, y, z); + // if (id == 0) { + // return null; + // } + // final Item item = Item.field_77698_e[id]; + // if (item == null) { + // return null; + // } + // return new ItemStack(id, 1, 0); + //} + + @Override + public boolean hasTileEntity(final int metadata) { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderType() { + return ClientProxy.RENDER_ID; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) { + } +} diff --git a/src/main/java/electricexpansion/common/cables/TileEntityInsulatedWire.java b/src/main/java/electricexpansion/common/cables/TileEntityInsulatedWire.java new file mode 100644 index 0000000..8b2f923 --- /dev/null +++ b/src/main/java/electricexpansion/common/cables/TileEntityInsulatedWire.java @@ -0,0 +1,63 @@ +package electricexpansion.common.cables; + +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.common.helpers.TileEntityConductorBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; + +public class TileEntityInsulatedWire extends TileEntityConductorBase { + public byte colorByte; + + public TileEntityInsulatedWire() { + this.colorByte = -1; + } + + @Override + public void initiate() { + super.initiate(); + this.getWorldObj().notifyBlocksOfNeighborChange( + this.xCoord, this.yCoord, this.zCoord, + ElectricExpansionItems.blockInsulatedWire); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + this.colorByte = nbt.getByte("colorByte"); + 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"); + } + + @Override + public void readFromNBT(final NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.colorByte = nbt.getByte("colorByte"); + } + + @Override + public void writeToNBT(final NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setByte("colorByte", this.colorByte); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setByte("colorByte", this.colorByte); + 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); + } +} diff --git a/src/main/java/electricexpansion/common/cables/TileEntityLogisticsWire.java b/src/main/java/electricexpansion/common/cables/TileEntityLogisticsWire.java new file mode 100644 index 0000000..79371a2 --- /dev/null +++ b/src/main/java/electricexpansion/common/cables/TileEntityLogisticsWire.java @@ -0,0 +1,148 @@ +package electricexpansion.common.cables; + +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.common.helpers.TileEntityConductorBase; +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.minecraftforge.common.util.ForgeDirection; +import universalelectricity.prefab.implement.IRedstoneProvider; + +public class TileEntityLogisticsWire + extends TileEntityConductorBase implements IRedstoneProvider { + public boolean buttonStatus0; + public boolean buttonStatus1; + public boolean buttonStatus2; + private double networkProduced; + private byte tick; + + public TileEntityLogisticsWire() { + this.buttonStatus0 = false; + this.buttonStatus1 = false; + this.buttonStatus2 = false; + this.networkProduced = 0.0; + this.tick = 0; + } + + @Override + public void initiate() { + this.getWorldObj().notifyBlocksOfNeighborChange( + this.xCoord, this.yCoord, this.zCoord, + ElectricExpansionItems.blockLogisticsWire); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + 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"); + + this.buttonStatus0 = nbt.getBoolean("buttonStatus0"); + this.buttonStatus1 = nbt.getBoolean("buttonStatus1"); + this.buttonStatus2 = nbt.getBoolean("buttonStatus2"); + } + + @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]); + + nbt.setBoolean("buttonStatus0", this.buttonStatus0); + nbt.setBoolean("buttonStatus1", this.buttonStatus1); + nbt.setBoolean("buttonStatus2", this.buttonStatus2); + + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, + this.getBlockMetadata(), nbt); + } + + public void onButtonPacket(int buttonId, boolean status) { + switch (buttonId) { + case 0: + this.buttonStatus0 = status; + break; + + case 1: + this.buttonStatus1 = status; + break; + + case 2: + this.buttonStatus2 = status; + break; + } + } + + // TODO: WTF + // final byte id = dataStream.readByte(); + // if (id == -1) { + // this.buttonStatus0 = dataStream.readBoolean(); + // } + // if (id == 0) { + // this.buttonStatus1 = dataStream.readBoolean(); + // } + // if (id == 1) { + // this.buttonStatus2 = dataStream.readBoolean(); + // } + // if (id != 7 || dataStream.readBoolean()) {} + + @Override + public void readFromNBT(final NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.buttonStatus0 = nbt.getBoolean("buttonStatus0"); + this.buttonStatus1 = nbt.getBoolean("buttonStatus1"); + this.buttonStatus2 = nbt.getBoolean("buttonStatus2"); + } + + @Override + public void writeToNBT(final NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setBoolean("buttonStatus0", this.buttonStatus0); + nbt.setBoolean("buttonStatus1", this.buttonStatus1); + nbt.setBoolean("buttonStatus2", this.buttonStatus2); + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (!this.getWorldObj().isRemote) { + ++this.tick; + if (this.tick == 20) { + this.tick = 0; + if (this.networkProduced == 0.0 && + this.getNetwork().getProduced(new TileEntity[0]).getWatts() != 0.0) { + this.getWorldObj().notifyBlocksOfNeighborChange( + this.xCoord, this.yCoord, this.zCoord, this.blockType); + } + if (this.networkProduced != 0.0 && + this.getNetwork().getProduced(new TileEntity[0]).getWatts() == 0.0) { + this.getWorldObj().notifyBlocksOfNeighborChange( + this.xCoord, this.yCoord, this.zCoord, this.blockType); + } + this.networkProduced = this.getNetwork().getProduced(new TileEntity[0]).getWatts(); + } + } + } + + @Override + public boolean isPoweringTo(final ForgeDirection side) { + return this.buttonStatus0 && + this.getNetwork().getProduced(new TileEntity[0]).getWatts() > 0.0; + } + + @Override + public boolean isIndirectlyPoweringTo(final ForgeDirection side) { + return this.isPoweringTo(side); + } +} diff --git a/src/main/java/electricexpansion/common/cables/TileEntityRawWire.java b/src/main/java/electricexpansion/common/cables/TileEntityRawWire.java new file mode 100644 index 0000000..16388cc --- /dev/null +++ b/src/main/java/electricexpansion/common/cables/TileEntityRawWire.java @@ -0,0 +1,11 @@ +package electricexpansion.common.cables; + +import electricexpansion.common.helpers.TileEntityConductorBase; + +public class TileEntityRawWire extends TileEntityConductorBase { + // TODO: WTF + @Override + public double getResistance() { + return super.getResistance() * 2.0; + } +} diff --git a/src/main/java/electricexpansion/common/cables/TileEntityRedstonePaintedWire.java b/src/main/java/electricexpansion/common/cables/TileEntityRedstonePaintedWire.java new file mode 100644 index 0000000..ec9f7e3 --- /dev/null +++ b/src/main/java/electricexpansion/common/cables/TileEntityRedstonePaintedWire.java @@ -0,0 +1,48 @@ +package electricexpansion.common.cables; + +import electricexpansion.api.IRedstoneNetAccessor; +import electricexpansion.common.helpers.TileEntityConductorBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileEntityRedstonePaintedWire + extends TileEntityConductorBase implements IRedstoneNetAccessor { + private boolean isRegistered; + + public TileEntityRedstonePaintedWire() { + this.isRegistered = false; + } + + @Override + public void initiate() { + super.initiate(); + if (super.smartNetwork != null) { + super.smartNetwork.addRsInterfacer(this); + this.isRegistered = true; + } + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (!this.isRegistered && super.smartNetwork != null) { + super.smartNetwork.addRsInterfacer(this); + this.isRegistered = true; + } + } + + public boolean canUpdate() { + return true; + } + + @Override + public int getRsSignalFromBlock() { + int i = 0; + for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { + i = Math.max( + i, this.getWorldObj().getBlockPowerInput(this.xCoord + side.offsetX, + this.yCoord + side.offsetY, + this.zCoord + side.offsetZ)); + } + return i; + } +} diff --git a/src/main/java/electricexpansion/common/cables/TileEntitySwitchWire.java b/src/main/java/electricexpansion/common/cables/TileEntitySwitchWire.java new file mode 100644 index 0000000..15df197 --- /dev/null +++ b/src/main/java/electricexpansion/common/cables/TileEntitySwitchWire.java @@ -0,0 +1,12 @@ +package electricexpansion.common.cables; + +import electricexpansion.common.helpers.TileEntityConductorBase; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileEntitySwitchWire extends TileEntityConductorBase { + @Override + public boolean canConnect(final ForgeDirection direction) { + return this.getWorldObj().isBlockIndirectlyGettingPowered( + this.xCoord, this.yCoord, this.zCoord); + } +} diff --git a/src/main/java/electricexpansion/common/cables/TileEntitySwitchWireBlock.java b/src/main/java/electricexpansion/common/cables/TileEntitySwitchWireBlock.java new file mode 100644 index 0000000..d64ee59 --- /dev/null +++ b/src/main/java/electricexpansion/common/cables/TileEntitySwitchWireBlock.java @@ -0,0 +1,4 @@ +package electricexpansion.common.cables; + +public class TileEntitySwitchWireBlock extends TileEntitySwitchWire { +} diff --git a/src/main/java/electricexpansion/common/cables/TileEntityWireBlock.java b/src/main/java/electricexpansion/common/cables/TileEntityWireBlock.java new file mode 100644 index 0000000..ea2b6e1 --- /dev/null +++ b/src/main/java/electricexpansion/common/cables/TileEntityWireBlock.java @@ -0,0 +1,6 @@ +package electricexpansion.common.cables; + +import electricexpansion.common.helpers.TileEntityConductorBase; + +public class TileEntityWireBlock extends TileEntityConductorBase { +} diff --git a/src/main/java/electricexpansion/common/containers/ContainerAdvBatteryBox.java b/src/main/java/electricexpansion/common/containers/ContainerAdvBatteryBox.java new file mode 100644 index 0000000..138e371 --- /dev/null +++ b/src/main/java/electricexpansion/common/containers/ContainerAdvBatteryBox.java @@ -0,0 +1,90 @@ +package electricexpansion.common.containers; + +import electricexpansion.common.tile.TileEntityAdvancedBatteryBox; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.IItemElectric; + +public class ContainerAdvBatteryBox extends Container { + private TileEntityAdvancedBatteryBox tileEntity; + + public ContainerAdvBatteryBox(final InventoryPlayer par1InventoryPlayer, + final TileEntityAdvancedBatteryBox advBatteryBox) { + this.tileEntity = advBatteryBox; + this.addSlotToContainer((Slot) new SlotUniversalElectricItem( + (IInventory) advBatteryBox, 0, 11, 24)); + this.addSlotToContainer((Slot) new SlotUniversalElectricItem( + (IInventory) advBatteryBox, 1, 11, 48)); + // TODO: WTF + // this.addSlotToContainer((Slot)new SlotModifier((IInventory)advBatteryBox, + // 2, 149, 7)); this.addSlotToContainer((Slot)new + // SlotModifier((IInventory)advBatteryBox, 3, 149, 31)); + // this.addSlotToContainer((Slot)new SlotModifier((IInventory)advBatteryBox, + // 4, 149, 55)); + this.addSlotToContainer(new Slot((IInventory) advBatteryBox, 2, 149, 7)); + this.addSlotToContainer(new Slot((IInventory) advBatteryBox, 3, 149, 31)); + this.addSlotToContainer(new Slot((IInventory) advBatteryBox, 4, 149, 55)); + for (int var3 = 0; var3 < 3; ++var3) { + for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot((IInventory) par1InventoryPlayer, + var4 + var3 * 9 + 9, 8 + var4 * 18, + 84 + var3 * 18)); + } + } + for (int var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer( + new Slot((IInventory) par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + this.tileEntity.openInventory(); + } + + public void onContainerClosed(final EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.tileEntity.closeInventory(); + } + + public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { + return this.tileEntity.isUseableByPlayer(par1EntityPlayer); + } + + public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, + final int par1) { + ItemStack var2 = null; + final Slot var3 = (Slot) super.inventorySlots.get(par1); + if (var3 != null && var3.getHasStack()) { + final ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + if (par1 > 4) { + if (var4.getItem() instanceof IItemElectric) { + if (((IItemElectric) var4.getItem()) + .getProvideRequest(var2) + .getWatts() > 0.0) { + if (!this.mergeItemStack(var4, 1, 2, false)) { + return null; + } + } else if (!this.mergeItemStack(var4, 0, 1, false)) { + return null; + } + } else if (!this.mergeItemStack(var4, 2, 4, false)) { + return null; + } + } else if (!this.mergeItemStack(var4, 5, 38, false)) { + return null; + } + if (var4.stackSize == 0) { + var3.putStack((ItemStack) null); + } else { + var3.onSlotChanged(); + } + if (var4.stackSize == var2.stackSize) { + return null; + } + var3.onPickupFromSlot(par1EntityPlayer, var4); + } + return var2; + } +} diff --git a/src/main/java/electricexpansion/common/containers/ContainerDistribution.java b/src/main/java/electricexpansion/common/containers/ContainerDistribution.java new file mode 100644 index 0000000..3882e3f --- /dev/null +++ b/src/main/java/electricexpansion/common/containers/ContainerDistribution.java @@ -0,0 +1,46 @@ +package electricexpansion.common.containers; + +import electricexpansion.common.tile.TileEntityQuantumBatteryBox; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerDistribution extends Container { + private TileEntityQuantumBatteryBox tileEntity; + + public ContainerDistribution(final InventoryPlayer par1InventoryPlayer, + final TileEntityQuantumBatteryBox tileEntity2) { + this.tileEntity = tileEntity2; + // TODO: WTF + //for (int var3 = 0; var3 < 3; ++var3) { + //for (int var4 = 0; var4 < 9; ++var4) { + //this.addSlotToContainer(new Slot((IInventory) + //par1InventoryPlayer, + //var4 + var3 * 9 + 9, 8 + var4 * 18, + //84 + var3 * 18)); + //} + //} + //for (int var3 = 0; var3 < 9; ++var3) { + //this.addSlotToContainer( + //new Slot((IInventory) par1InventoryPlayer, var3, 8 + var3 * + //18, 142)); + //} + tileEntity2.openInventory(); + } + + public void onContainerClosed(final EntityPlayer entityplayer) { + this.tileEntity.closeInventory(); + } + + public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { + return this.tileEntity.isUseableByPlayer(par1EntityPlayer); + } + + public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, + final int par1) { + return null; + } +} diff --git a/src/main/java/electricexpansion/common/containers/ContainerFuseBox.java b/src/main/java/electricexpansion/common/containers/ContainerFuseBox.java new file mode 100644 index 0000000..c9b9f2f --- /dev/null +++ b/src/main/java/electricexpansion/common/containers/ContainerFuseBox.java @@ -0,0 +1,88 @@ +package electricexpansion.common.containers; + +import electricexpansion.api.IItemFuse; +import electricexpansion.common.tile.TileEntityFuseBox; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import universalelectricity.prefab.SlotSpecific; + +public class ContainerFuseBox extends Container { + private TileEntityFuseBox tileEntity; + + public ContainerFuseBox(final InventoryPlayer par1InventoryPlayer, + final TileEntityFuseBox tileEntity) { + this.tileEntity = tileEntity; + this.addSlotToContainer((Slot) new SlotSpecific( + (IInventory) tileEntity, 0, 8, 16, new Class[] { IItemFuse.class })); + for (int var3 = 0; var3 < 3; ++var3) { + for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot((IInventory) par1InventoryPlayer, + var4 + var3 * 9 + 9, 8 + var4 * 18, + 84 + var3 * 18)); + } + } + for (int var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer( + new Slot((IInventory) par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + tileEntity.openInventory(); + } + + public void onContainerClosed(final EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.tileEntity.closeInventory(); + } + + public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { + return this.tileEntity.isUseableByPlayer(par1EntityPlayer); + } + + public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, + final int par1) { + System.out.println("Slot: " + par1); + ItemStack var2 = null; + ItemStack var3 = null; + ItemStack var4 = null; + final Slot var5 = (Slot) super.inventorySlots.get(par1); + final Slot var6 = (Slot) super.inventorySlots.get(0); + if (var5 != null && var5.getHasStack()) { + var2 = var5.getStack(); + var3 = var2.copy(); + var4 = var2.copy(); + --var4.stackSize; + var3.stackSize = 1; + System.out.println("StackSize: " + var4.stackSize); + if (par1 == 0) { + if (!this.mergeItemStack(var3, 1, 37, true)) { + return var4; + } + var5.onSlotChange(var3, var2); + } else if (par1 != 0 && !var6.getHasStack()) { + if (var3.getItem() instanceof IItemFuse) { + if (!this.mergeItemStack(var3, 0, 1, false)) { + return var4; + } + } else if (par1 >= 28 && par1 < 37 && + !this.mergeItemStack(var3, 1, 28, false)) { + return var4; + } + } else if (!this.mergeItemStack(var3, 1, 37, false)) { + return var4; + } + if (var4.stackSize == 0) { + var5.putStack((ItemStack) null); + } else { + var5.onSlotChanged(); + } + if (var3.stackSize == var2.stackSize) { + return null; + } + var5.onPickupFromSlot(par1EntityPlayer, var2); + } + return var2; + } +} diff --git a/src/main/java/electricexpansion/common/containers/ContainerInsulationMachine.java b/src/main/java/electricexpansion/common/containers/ContainerInsulationMachine.java new file mode 100644 index 0000000..37aeac3 --- /dev/null +++ b/src/main/java/electricexpansion/common/containers/ContainerInsulationMachine.java @@ -0,0 +1,92 @@ +package electricexpansion.common.containers; + +import electricexpansion.common.misc.InsulationRecipes; +import electricexpansion.common.tile.TileEntityInsulatingMachine; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.IItemElectric; +import universalelectricity.prefab.SlotSpecific; + +public class ContainerInsulationMachine extends Container { + private TileEntityInsulatingMachine tileEntity; + + public ContainerInsulationMachine(final InventoryPlayer par1InventoryPlayer, + final TileEntityInsulatingMachine tileEntity) { + this.tileEntity = tileEntity; + this.addSlotToContainer((Slot) new SlotUniversalElectricItem( + (IInventory) tileEntity, 0, 55, 49)); + this.addSlotToContainer(new Slot((IInventory) tileEntity, 1, 55, 25)); + this.addSlotToContainer((Slot) new SlotSpecific( + (IInventory) tileEntity, 2, 108, 25, new ItemStack[] { null })); + for (int var3 = 0; var3 < 3; ++var3) { + for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot((IInventory) par1InventoryPlayer, + var4 + var3 * 9 + 9, 8 + var4 * 18, + 84 + var3 * 18)); + } + } + for (int var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer( + new Slot((IInventory) par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + tileEntity.openInventory(); + } + + public void onContainerClosed(final EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.tileEntity.closeInventory(); + } + + public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { + return this.tileEntity.isUseableByPlayer(par1EntityPlayer); + } + + public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, + final int par1) { + ItemStack var2 = null; + final Slot var3 = (Slot) super.inventorySlots.get(par1); + if (var3 != null && var3.getHasStack()) { + final ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + if (par1 == 2) { + if (!this.mergeItemStack(var4, 3, 39, true)) { + return null; + } + var3.onSlotChange(var4, var2); + } else if (par1 != 1 && par1 != 0) { + if (var4.getItem() instanceof IItemElectric) { + if (!this.mergeItemStack(var4, 0, 1, false)) { + return null; + } + } else if (InsulationRecipes.INSTANCE.getProcessResult(var4) > 0) { + if (!this.mergeItemStack(var4, 1, 2, false)) { + return null; + } + } else if (par1 >= 3 && par1 < 30) { + if (!this.mergeItemStack(var4, 30, 39, false)) { + return null; + } + } else if (par1 >= 30 && par1 < 39 && + !this.mergeItemStack(var4, 3, 30, false)) { + return null; + } + } else if (!this.mergeItemStack(var4, 3, 39, false)) { + return null; + } + if (var4.stackSize == 0) { + var3.putStack((ItemStack) null); + } else { + var3.onSlotChanged(); + } + if (var4.stackSize == var2.stackSize) { + return null; + } + var3.onPickupFromSlot(par1EntityPlayer, var4); + } + return var2; + } +} diff --git a/src/main/java/electricexpansion/common/containers/ContainerWireMill.java b/src/main/java/electricexpansion/common/containers/ContainerWireMill.java new file mode 100644 index 0000000..e316c81 --- /dev/null +++ b/src/main/java/electricexpansion/common/containers/ContainerWireMill.java @@ -0,0 +1,92 @@ +package electricexpansion.common.containers; + +import electricexpansion.common.misc.WireMillRecipes; +import electricexpansion.common.tile.TileEntityWireMill; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.IItemElectric; +import universalelectricity.prefab.SlotSpecific; + +public class ContainerWireMill extends Container { + private TileEntityWireMill tileEntity; + + public ContainerWireMill(final InventoryPlayer par1InventoryPlayer, + final TileEntityWireMill tileEntity) { + this.tileEntity = tileEntity; + this.addSlotToContainer((Slot) new SlotUniversalElectricItem( + (IInventory) tileEntity, 0, 55, 49)); + this.addSlotToContainer(new Slot((IInventory) tileEntity, 1, 55, 25)); + this.addSlotToContainer((Slot) new SlotSpecific( + (IInventory) tileEntity, 2, 108, 25, new ItemStack[] { null })); + for (int var3 = 0; var3 < 3; ++var3) { + for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot((IInventory) par1InventoryPlayer, + var4 + var3 * 9 + 9, 8 + var4 * 18, + 84 + var3 * 18)); + } + } + for (int var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer( + new Slot((IInventory) par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + tileEntity.openInventory(); + } + + public void onContainerClosed(final EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + this.tileEntity.closeInventory(); + } + + public boolean canInteractWith(final EntityPlayer par1EntityPlayer) { + return this.tileEntity.isUseableByPlayer(par1EntityPlayer); + } + + public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, + final int par1) { + ItemStack var2 = null; + final Slot var3 = (Slot) super.inventorySlots.get(par1); + if (var3 != null && var3.getHasStack()) { + final ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + if (par1 == 2) { + if (!this.mergeItemStack(var4, 3, 39, true)) { + return null; + } + var3.onSlotChange(var4, var2); + } else if (par1 != 1 && par1 != 0) { + if (var4.getItem() instanceof IItemElectric) { + if (!this.mergeItemStack(var4, 0, 1, false)) { + return null; + } + } else if (WireMillRecipes.INSTANCE.getDrawingResult(var4) != null) { + if (!this.mergeItemStack(var4, 1, 2, false)) { + return null; + } + } else if (par1 >= 3 && par1 < 30) { + if (!this.mergeItemStack(var4, 30, 39, false)) { + return null; + } + } else if (par1 >= 30 && par1 < 39 && + !this.mergeItemStack(var4, 3, 30, false)) { + return null; + } + } else if (!this.mergeItemStack(var4, 3, 39, false)) { + return null; + } + if (var4.stackSize == 0) { + var3.putStack((ItemStack) null); + } else { + var3.onSlotChanged(); + } + if (var4.stackSize == var2.stackSize) { + return null; + } + var3.onPickupFromSlot(par1EntityPlayer, var4); + } + return var2; + } +} diff --git a/src/main/java/electricexpansion/common/containers/SlotUniversalElectricItem.java b/src/main/java/electricexpansion/common/containers/SlotUniversalElectricItem.java new file mode 100644 index 0000000..e20c1fe --- /dev/null +++ b/src/main/java/electricexpansion/common/containers/SlotUniversalElectricItem.java @@ -0,0 +1,18 @@ +package electricexpansion.common.containers; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.IItemElectric; + +public class SlotUniversalElectricItem extends Slot { + public SlotUniversalElectricItem(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 IItemElectric; + } +} diff --git a/src/main/java/electricexpansion/common/helpers/ItemBlockCableHelper.java b/src/main/java/electricexpansion/common/helpers/ItemBlockCableHelper.java new file mode 100644 index 0000000..47877f7 --- /dev/null +++ b/src/main/java/electricexpansion/common/helpers/ItemBlockCableHelper.java @@ -0,0 +1,70 @@ +package electricexpansion.common.helpers; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.api.EnumWireMaterial; +import java.util.HashMap; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import universalelectricity.core.electricity.ElectricityDisplay; + +public abstract class ItemBlockCableHelper extends ItemBlock { + protected HashMap icons; + + public ItemBlockCableHelper(final Block id) { + super(id); + this.icons = new HashMap<>(); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + public int getMetadata(final int damage) { + return damage; + } + + public String getUnlocalizedName(final ItemStack itemStack) { + return this.getUnlocalizedName() + "." + + EnumWireMaterial.values()[itemStack.getItemDamage()].name; + } + + @SideOnly(Side.CLIENT) + public void addInformation(final ItemStack itemstack, + final EntityPlayer player, final List par3List, + final boolean par4) { + par3List.add( + "Resistance: " + + ElectricityDisplay.getDisplay( + EnumWireMaterial.values()[itemstack.getItemDamage()].resistance, + ElectricityDisplay.ElectricUnit.RESISTANCE)); + par3List.add( + "Max Amps: " + + ElectricityDisplay.getDisplay( + EnumWireMaterial.values()[itemstack.getItemDamage()].maxAmps, + ElectricityDisplay.ElectricUnit.AMPERE)); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister par1IconRegister) { + if (this.getUnlocalizedName().equals("tile.HiddenWire") || + this.getUnlocalizedName().equals("tile.SwitchWireBlock")) { + return; + } + for (int i = 0; i < EnumWireMaterial.values().length - 1; ++i) { + this.icons.put(this.getUnlocalizedName(new ItemStack(this, 1, i)), + par1IconRegister.registerIcon( + this.getUnlocalizedName(new ItemStack(this, 1, i)) + .replaceAll("tile.", "electricexpansion:"))); + } + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(final int meta) { + return this.icons.get( + this.getUnlocalizedName(new ItemStack(this, 1, meta))); + } +} diff --git a/src/main/java/electricexpansion/common/helpers/PacketHandlerLogisticsWireButton.java b/src/main/java/electricexpansion/common/helpers/PacketHandlerLogisticsWireButton.java new file mode 100644 index 0000000..bfd4b7d --- /dev/null +++ b/src/main/java/electricexpansion/common/helpers/PacketHandlerLogisticsWireButton.java @@ -0,0 +1,26 @@ +package electricexpansion.common.helpers; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import electricexpansion.common.cables.TileEntityLogisticsWire; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class PacketHandlerLogisticsWireButton + implements IMessageHandler { + + @Override + public IMessage onMessage(PacketLogisticsWireButton message, + MessageContext ctx) { + World world = ctx.getServerHandler().playerEntity.worldObj; + TileEntity te = message.pos.getTileEntity(world); + + if (te instanceof TileEntityLogisticsWire) { + ((TileEntityLogisticsWire) te) + .onButtonPacket(message.buttonId, message.status); + } + + return null; + } +} diff --git a/src/main/java/electricexpansion/common/helpers/PacketHandlerUpdateQuantumBatteryBoxFrequency.java b/src/main/java/electricexpansion/common/helpers/PacketHandlerUpdateQuantumBatteryBoxFrequency.java new file mode 100644 index 0000000..0b141d9 --- /dev/null +++ b/src/main/java/electricexpansion/common/helpers/PacketHandlerUpdateQuantumBatteryBoxFrequency.java @@ -0,0 +1,25 @@ +package electricexpansion.common.helpers; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import electricexpansion.common.tile.TileEntityQuantumBatteryBox; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class PacketHandlerUpdateQuantumBatteryBoxFrequency + implements IMessageHandler { + + @Override + public IMessage onMessage(PacketUpdateQuantumBatteryBoxFrequency message, + MessageContext ctx) { + World world = ctx.getServerHandler().playerEntity.worldObj; + TileEntity te = message.pos.getTileEntity(world); + + if (te instanceof TileEntityQuantumBatteryBox) { + ((TileEntityQuantumBatteryBox) te).setFrequency(message.freq); + } + + return null; + } +} diff --git a/src/main/java/electricexpansion/common/helpers/PacketLogisticsWireButton.java b/src/main/java/electricexpansion/common/helpers/PacketLogisticsWireButton.java new file mode 100644 index 0000000..d9e4fd8 --- /dev/null +++ b/src/main/java/electricexpansion/common/helpers/PacketLogisticsWireButton.java @@ -0,0 +1,37 @@ +package electricexpansion.common.helpers; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import io.netty.buffer.ByteBuf; +import universalelectricity.core.vector.Vector3; + +public class PacketLogisticsWireButton implements IMessage { + Vector3 pos; + int buttonId; + boolean status; + + public PacketLogisticsWireButton(Vector3 pos, int buttonId, boolean status) { + this.pos = pos; + this.buttonId = buttonId; + this.status = status; + } + + public PacketLogisticsWireButton() { + this(null, 0, false); + } + + @Override + public void fromBytes(ByteBuf buf) { + this.pos = new Vector3(buf.readInt(), buf.readInt(), buf.readInt()); + this.buttonId = buf.readInt(); + this.status = buf.readBoolean(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(this.pos.intX()); + buf.writeInt(this.pos.intY()); + buf.writeInt(this.pos.intZ()); + buf.writeInt(this.buttonId); + buf.writeBoolean(this.status); + } +} diff --git a/src/main/java/electricexpansion/common/helpers/PacketUpdateQuantumBatteryBoxFrequency.java b/src/main/java/electricexpansion/common/helpers/PacketUpdateQuantumBatteryBoxFrequency.java new file mode 100644 index 0000000..5c35ccd --- /dev/null +++ b/src/main/java/electricexpansion/common/helpers/PacketUpdateQuantumBatteryBoxFrequency.java @@ -0,0 +1,33 @@ +package electricexpansion.common.helpers; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import io.netty.buffer.ByteBuf; +import universalelectricity.core.vector.Vector3; + +public class PacketUpdateQuantumBatteryBoxFrequency implements IMessage { + Vector3 pos; + byte freq; + + public PacketUpdateQuantumBatteryBoxFrequency() { + this(null, (byte) 0); + } + + public PacketUpdateQuantumBatteryBoxFrequency(Vector3 pos, byte freq) { + this.pos = pos; + this.freq = freq; + } + + @Override + public void fromBytes(ByteBuf buf) { + this.pos = new Vector3(buf.readInt(), buf.readInt(), buf.readInt()); + this.freq = buf.readByte(); + } + + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(this.pos.intX()); + buf.writeInt(this.pos.intY()); + buf.writeInt(this.pos.intZ()); + buf.writeByte(this.freq); + } +} diff --git a/src/main/java/electricexpansion/common/helpers/PlayerHelper.java b/src/main/java/electricexpansion/common/helpers/PlayerHelper.java new file mode 100644 index 0000000..892c031 --- /dev/null +++ b/src/main/java/electricexpansion/common/helpers/PlayerHelper.java @@ -0,0 +1,18 @@ +package electricexpansion.common.helpers; + +import cpw.mods.fml.common.FMLCommonHandler; + +public class PlayerHelper { + public static boolean isPlayerOp(String playerName) { + String[] ops = FMLCommonHandler.instance() + .getMinecraftServerInstance() + .getConfigurationManager() + .func_152606_n(); + + for (String op : ops) { + if (playerName.equalsIgnoreCase(op)) + return true; + } + return false; + } +} diff --git a/src/main/java/electricexpansion/common/helpers/TileEntityConductorBase.java b/src/main/java/electricexpansion/common/helpers/TileEntityConductorBase.java new file mode 100644 index 0000000..4460da2 --- /dev/null +++ b/src/main/java/electricexpansion/common/helpers/TileEntityConductorBase.java @@ -0,0 +1,249 @@ +package electricexpansion.common.helpers; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.api.EnumWireMaterial; +import electricexpansion.api.EnumWireType; +import electricexpansion.api.IAdvancedConductor; +import electricexpansion.common.cables.TileEntityInsulatedWire; +import electricexpansion.common.misc.EENetwork; +import java.util.Arrays; +import net.minecraft.item.ItemStack; +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.core.block.IConductor; +import universalelectricity.core.block.IConnector; +import universalelectricity.core.block.INetworkProvider; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.tile.TileEntityAdvanced; + +public abstract class TileEntityConductorBase + extends TileEntityAdvanced implements IAdvancedConductor { + public ItemStack textureItemStack; + public boolean isIconLocked; + public EENetwork smartNetwork; + protected final String channel; + public boolean[] visuallyConnected; + public TileEntity[] connectedBlocks; + + @Override + public IElectricityNetwork getNetwork() { + if (this.smartNetwork == null) { + this.setNetwork(new EENetwork(new IConductor[] { this })); + } + return this.smartNetwork; + } + + @Override + public void setNetwork(final IElectricityNetwork network) { + if (network instanceof EENetwork) { + this.smartNetwork = (EENetwork) network; + } else { + this.smartNetwork = new EENetwork(network); + } + } + + public TileEntityConductorBase() { + this.isIconLocked = false; + this.visuallyConnected = new boolean[] { false, false, false, false, false, false }; + this.connectedBlocks = new TileEntity[] { null, null, null, null, null, null }; + this.channel = "ElecEx"; + } + + @Override + public void initiate() { + super.initiate(); + this.updateAdjacentConnections(); + this.getWorldObj().markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, + this.zCoord, this.xCoord, + this.yCoord, this.zCoord); + } + + @Override + public double getResistance() { + return this + .getWireMaterial(this.getWorldObj().getBlockMetadata( + this.xCoord, this.yCoord, this.zCoord)).resistance; + } + + @Override + public void writeToNBT(final NBTTagCompound tag) { + super.writeToNBT(tag); + tag.setBoolean("isIconLocked", this.isIconLocked); + if (this.textureItemStack != null) { + this.textureItemStack.writeToNBT(tag); + } + } + + @Override + public void readFromNBT(final NBTTagCompound tag) { + super.readFromNBT(tag); + try { + this.textureItemStack = ItemStack.loadItemStackFromNBT(tag); + } catch (final Exception e) { + this.textureItemStack = null; + } + try { + this.isIconLocked = tag.getBoolean("isIconLocked"); + } catch (final Exception e) { + this.isIconLocked = false; + } + } + + @Override + public double getCurrentCapcity() { + final int meta = this.getWorldObj().getBlockMetadata( + this.xCoord, this.yCoord, this.zCoord); + if (meta < EnumWireMaterial.values().length - 1) { + return EnumWireMaterial.values()[meta].maxAmps; + } + return EnumWireMaterial.UNKNOWN.maxAmps; + } + + @Override + public EnumWireType getWireType(final int metadata) { + return EnumWireType.values()[metadata]; + } + + @Override + public EnumWireMaterial getWireMaterial(final int metadata) { + if (metadata < EnumWireMaterial.values().length - 1) { + return EnumWireMaterial.values()[metadata]; + } + return EnumWireMaterial.UNKNOWN; + } + + public void updateConnection(final TileEntity tileEntity, + final ForgeDirection side) { + if (!this.getWorldObj().isRemote && tileEntity != null) { + if (tileEntity instanceof TileEntityInsulatedWire && + this instanceof TileEntityInsulatedWire) { + final TileEntityInsulatedWire tileEntityIns = (TileEntityInsulatedWire) tileEntity; + if ((tileEntityIns.colorByte == ((TileEntityInsulatedWire) this).colorByte || + ((TileEntityInsulatedWire) this).colorByte == -1 || + tileEntityIns.colorByte == -1) && + tileEntityIns.getWireMaterial(tileEntity.getBlockMetadata()) == this + .getWireMaterial(this.getBlockMetadata()) + && + ((IConnector) tileEntity).canConnect(side.getOpposite())) { + this.connectedBlocks[side.ordinal()] = tileEntity; + this.visuallyConnected[side.ordinal()] = true; + if (tileEntity.getClass() == this.getClass() && + tileEntity instanceof INetworkProvider) { + this.getNetwork().mergeConnection( + ((INetworkProvider) tileEntity).getNetwork()); + } + return; + } + } else if (tileEntity instanceof IAdvancedConductor) { + final IAdvancedConductor tileEntityWire = (IAdvancedConductor) tileEntity; + if (tileEntityWire.getWireMaterial(tileEntity.getBlockMetadata()) == this + .getWireMaterial(this.getBlockMetadata()) && + ((IConnector) tileEntity).canConnect(side.getOpposite())) { + this.connectedBlocks[side.ordinal()] = tileEntity; + this.visuallyConnected[side.ordinal()] = true; + if (tileEntity.getClass() == this.getClass() && + tileEntity instanceof INetworkProvider) { + this.getNetwork().mergeConnection( + ((INetworkProvider) tileEntity).getNetwork()); + } + return; + } + } else if (((IConnector) tileEntity).canConnect(side.getOpposite())) { + this.connectedBlocks[side.ordinal()] = tileEntity; + this.visuallyConnected[side.ordinal()] = true; + if (tileEntity.getClass() == this.getClass() && tileEntity instanceof INetworkProvider) { + this.getNetwork().mergeConnection( + ((INetworkProvider) tileEntity).getNetwork()); + } + return; + } + } + this.connectedBlocks[side.ordinal()] = null; + this.visuallyConnected[side.ordinal()] = false; + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + 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"); + } + + @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); + } + + @Override + public void invalidate() { + if (!this.getWorldObj().isRemote) { + this.getNetwork().splitNetwork(this); + } + super.invalidate(); + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (!this.getWorldObj().isRemote && super.ticks % 300L == 0L) { + this.updateAdjacentConnections(); + } + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + return true; + } + + @Override + @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)); + } + + @Override + public TileEntity[] getAdjacentConnections() { + return this.connectedBlocks; + } + + public void updateAdjacentConnections() { + if (this.getWorldObj() != null && !this.worldObj.isRemote) { + final boolean[] previousConnections = this.visuallyConnected.clone(); + for (byte i = 0; i < 6; ++i) { + this.updateConnection(VectorHelper.getConnectorFromSide( + this.getWorldObj(), new Vector3(this), + ForgeDirection.getOrientation((int) i)), + ForgeDirection.getOrientation((int) i)); + } + if (!Arrays.equals(previousConnections, this.visuallyConnected)) { + this.getWorldObj().markBlockForUpdate(this.xCoord, this.yCoord, + this.zCoord); + } + } + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockInsulatedWire.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockInsulatedWire.java new file mode 100644 index 0000000..621d148 --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockInsulatedWire.java @@ -0,0 +1,21 @@ +package electricexpansion.common.itemblocks; + +import electricexpansion.common.helpers.ItemBlockCableHelper; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ItemBlockInsulatedWire extends ItemBlockCableHelper { + public ItemBlockInsulatedWire(final Block block) { + super(block); + } + + @Override + public void addInformation(final ItemStack par1ItemStack, + final EntityPlayer par2EntityPlayer, + final List par3List, final boolean par4) { + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + par3List.add("Normal wire, does not shock you"); + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockLogisticsWire.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockLogisticsWire.java new file mode 100644 index 0000000..32b6cdc --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockLogisticsWire.java @@ -0,0 +1,21 @@ +package electricexpansion.common.itemblocks; + +import electricexpansion.common.helpers.ItemBlockCableHelper; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ItemBlockLogisticsWire extends ItemBlockCableHelper { + public ItemBlockLogisticsWire(final Block block) { + super(block); + } + + @Override + public void addInformation(final ItemStack par1ItemStack, + final EntityPlayer par2EntityPlayer, + final List par3List, final boolean par4) { + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + par3List.add("Can do awesome things"); + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockRawWire.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockRawWire.java new file mode 100644 index 0000000..91119e3 --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockRawWire.java @@ -0,0 +1,27 @@ +package electricexpansion.common.itemblocks; + +import electricexpansion.api.EnumWireMaterial; +import electricexpansion.common.helpers.ItemBlockCableHelper; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ItemBlockRawWire extends ItemBlockCableHelper { + public ItemBlockRawWire(final Block block) { + super(block); + } + + @Override + public void addInformation(final ItemStack par1ItemStack, + final EntityPlayer par2EntityPlayer, + final List par3List, final boolean par4) { + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + par3List.add("Will shock you when near"); + par3List.add("Shock Damage: " + + EnumWireMaterial.values()[par1ItemStack.getItemDamage()].electrocutionDamage / + 2.0 + + + " Hearts"); + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockRedstonePaintedWire.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockRedstonePaintedWire.java new file mode 100644 index 0000000..344ae29 --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockRedstonePaintedWire.java @@ -0,0 +1,22 @@ +package electricexpansion.common.itemblocks; + +import electricexpansion.common.helpers.ItemBlockCableHelper; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ItemBlockRedstonePaintedWire extends ItemBlockCableHelper { + public ItemBlockRedstonePaintedWire(final Block id) { + super(id); + } + + @Override + public void addInformation(final ItemStack par1ItemStack, + final EntityPlayer par2EntityPlayer, + final List par3List, final boolean par4) { + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + par3List.add("Normal wire, does not shock you"); + par3List.add("Conveys redstone signal, and does it very well."); + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWire.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWire.java new file mode 100644 index 0000000..a7ab12f --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWire.java @@ -0,0 +1,22 @@ +package electricexpansion.common.itemblocks; + +import electricexpansion.common.helpers.ItemBlockCableHelper; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ItemBlockSwitchWire extends ItemBlockCableHelper { + public ItemBlockSwitchWire(Block block) { + super(block); + } + + @Override + public void addInformation(final ItemStack par1ItemStack, + final EntityPlayer par2EntityPlayer, + final List par3List, final boolean par4) { + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + par3List.add("Only conducts when redstone powered"); + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWireBlock.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWireBlock.java new file mode 100644 index 0000000..dfe01f9 --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockSwitchWireBlock.java @@ -0,0 +1,10 @@ +package electricexpansion.common.itemblocks; + +import electricexpansion.common.helpers.ItemBlockCableHelper; +import net.minecraft.block.Block; + +public class ItemBlockSwitchWireBlock extends ItemBlockCableHelper { + public ItemBlockSwitchWireBlock(final Block id) { + super(id); + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockTransformer.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockTransformer.java new file mode 100644 index 0000000..ffd2f6f --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockTransformer.java @@ -0,0 +1,32 @@ +package electricexpansion.common.itemblocks; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBlockTransformer extends ItemBlock { + public ItemBlockTransformer(final Block par1) { + super(par1); + this.setHasSubtypes(true); + } + + public int getMetadata(final int par1) { + return par1; + } + + public String getUnlocalizedName(final ItemStack i) { + String name = null; + final int j = i.getItemDamage(); + final int tier = j - (j & 0x3); + if (tier == 0) { + name = "2x"; + } + if (tier == 4) { + name = "4x"; + } + if (tier == 8) { + name = "8x"; + } + return i.getItem().getUnlocalizedName() + "." + name; + } +} diff --git a/src/main/java/electricexpansion/common/itemblocks/ItemBlockWireBlock.java b/src/main/java/electricexpansion/common/itemblocks/ItemBlockWireBlock.java new file mode 100644 index 0000000..c819d0f --- /dev/null +++ b/src/main/java/electricexpansion/common/itemblocks/ItemBlockWireBlock.java @@ -0,0 +1,10 @@ +package electricexpansion.common.itemblocks; + +import electricexpansion.common.helpers.ItemBlockCableHelper; +import net.minecraft.block.Block; + +public class ItemBlockWireBlock extends ItemBlockCableHelper { + public ItemBlockWireBlock(final Block id) { + super(id); + } +} diff --git a/src/main/java/electricexpansion/common/items/ItemAdvancedBattery.java b/src/main/java/electricexpansion/common/items/ItemAdvancedBattery.java new file mode 100644 index 0000000..b3135ae --- /dev/null +++ b/src/main/java/electricexpansion/common/items/ItemAdvancedBattery.java @@ -0,0 +1,31 @@ +package electricexpansion.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EETab; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.ItemElectric; + +public class ItemAdvancedBattery extends ItemElectric { + public ItemAdvancedBattery() { + super(); + this.setUnlocalizedName("AdvancedBattery"); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + public double getMaxJoules(final ItemStack itemStack) { + return 2000000.0; + } + + public double getVoltage(final ItemStack itemStack) { + return 30.0; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon( + this.getUnlocalizedName().replaceAll("item.", "electricexpansion:")); + } +} diff --git a/src/main/java/electricexpansion/common/items/ItemEliteBattery.java b/src/main/java/electricexpansion/common/items/ItemEliteBattery.java new file mode 100644 index 0000000..f5f813a --- /dev/null +++ b/src/main/java/electricexpansion/common/items/ItemEliteBattery.java @@ -0,0 +1,31 @@ +package electricexpansion.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EETab; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.ItemElectric; + +public class ItemEliteBattery extends ItemElectric { + public ItemEliteBattery() { + super(); + this.setUnlocalizedName("EliteBattery"); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + public double getMaxJoules(final ItemStack i) { + return 3000000.0; + } + + public double getVoltage(final ItemStack i) { + return 45.0; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon( + this.getUnlocalizedName().replaceAll("item.", "electricexpansion:")); + } +} diff --git a/src/main/java/electricexpansion/common/items/ItemFuse.java b/src/main/java/electricexpansion/common/items/ItemFuse.java new file mode 100644 index 0000000..3ba1193 --- /dev/null +++ b/src/main/java/electricexpansion/common/items/ItemFuse.java @@ -0,0 +1,130 @@ +package electricexpansion.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.api.IItemFuse; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class ItemFuse extends Item implements IItemFuse { + private IIcon[] icons; + + public ItemFuse() { + super(); + this.icons = new IIcon[16]; + this.setHasSubtypes(true); + this.setUnlocalizedName("fuse"); + } + + @Override + public double getMaxVolts(final ItemStack itemStack) { + switch (itemStack.getItemDamage()) { + case 0: + case 1: { + return 60.0; + } + case 2: + case 3: { + return 120.0; + } + case 4: + case 5: { + return 240.0; + } + case 6: + case 7: { + return 480.0; + } + case 8: + case 9: { + return 60.0; + } + case 10: + case 11: { + return 120.0; + } + case 12: + case 13: { + return 240.0; + } + case 14: + case 15: { + return 480.0; + } + default: { + return 0.0; + } + } + } + + @Override + public ItemStack onFuseTrip(final ItemStack itemStack) { + final ItemStack toReturn = itemStack.copy(); + toReturn.setItemDamage(itemStack.getItemDamage() + 1); + return toReturn; + } + + @Override + public boolean isValidFuse(final ItemStack itemStack) { + return itemStack.getItemDamage() % 2 == 0; + } + + @Override + public boolean canReset(final ItemStack itemStack) { + return itemStack.getItemDamage() / 8 == 1; + } + + @Override + public ItemStack onReset(final ItemStack itemStack) { + if (this.canReset(itemStack)) { + final ItemStack toReturn = itemStack.copy(); + toReturn.setItemDamage(itemStack.getItemDamage() - 1); + return toReturn; + } + return null; + } + + @Override + public String getUnlocalizedName(final ItemStack itemStack) { + final double volts = this.getMaxVolts(itemStack); + final String type = this.canReset(itemStack) + ? (this.isValidFuse(itemStack) ? "+cb" : "-cb") + : (this.isValidFuse(itemStack) ? "+f" : "-f"); + return this.getUnlocalizedName() + "." + type + "." + (int) volts; + } + + @Override + public IIcon getIconFromDamage(final int meta) { + if (meta >= this.icons.length) + return null; + return this.icons[meta]; + } + + @Override + public int getMetadata(final int meta) { + return meta; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < this.icons.length; ++var4) { + par3List.add(new ItemStack((Item) this, 1, var4)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister par1IconRegister) { + for (int i = 0; i < this.icons.length; ++i) { + this.icons[i] = par1IconRegister.registerIcon( + this.getUnlocalizedName(new ItemStack(this, 0, i)) + .replaceAll("item.", "electricexpansion:")); + } + } +} diff --git a/src/main/java/electricexpansion/common/items/ItemMultimeter.java b/src/main/java/electricexpansion/common/items/ItemMultimeter.java new file mode 100644 index 0000000..b7ae185 --- /dev/null +++ b/src/main/java/electricexpansion/common/items/ItemMultimeter.java @@ -0,0 +1,130 @@ +package electricexpansion.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EETab; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import universalelectricity.core.block.IConductor; +import universalelectricity.core.block.IElectricityStorage; +import universalelectricity.core.block.IVoltage; +import universalelectricity.core.electricity.ElectricityDisplay; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.item.ItemElectric; + +public class ItemMultimeter extends ItemElectric { + public final int JOULES_PER_USE = 5000; + + public ItemMultimeter() { + super(); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + this.setUnlocalizedName("Multimeter"); + this.setMaxDamage(200); + } + + public boolean onItemUseFirst(final ItemStack stack, + final EntityPlayer player, final World worldObj, + final int x, final int y, final int z, + final int side, final float hitX, + final float hitY, final float hitZ) { + if (worldObj.isRemote || !this.onUse(stack)) { + return false; + } + final TileEntity tileEntity = worldObj.getTileEntity(x, y, z); + if (tileEntity instanceof IConductor) { + final IConductor wireTile = (IConductor) tileEntity; + final ElectricityPack getProduced = wireTile.getNetwork().getProduced(new TileEntity[0]); + player.addChatMessage(new ChatComponentText( + "Electric Expansion: " + + ElectricityDisplay.getDisplay( + getProduced.amperes * 20.0, ElectricityDisplay.ElectricUnit.AMPERE) + + + ", " + + ElectricityDisplay.getDisplay( + getProduced.voltage, ElectricityDisplay.ElectricUnit.VOLTAGE) + + + ", " + + ElectricityDisplay.getDisplay(getProduced.getWatts() * 20.0, + ElectricityDisplay.ElectricUnit.WATT))); + return true; + } + if (tileEntity instanceof IElectricityStorage) { + final IElectricityStorage tileStorage = (IElectricityStorage) tileEntity; + player.addChatMessage(new ChatComponentText( + "Electric Expansion: " + + ElectricityDisplay.getDisplay( + tileStorage.getJoules(), ElectricityDisplay.ElectricUnit.JOULES) + + + "/" + + ElectricityDisplay.getDisplay( + tileStorage.getMaxJoules(), + ElectricityDisplay.ElectricUnit.JOULES))); + } + if (tileEntity instanceof IVoltage) { + player.addChatMessage( + new ChatComponentText("Electric Expansion: " + + ElectricityDisplay.getDisplay( + ((IVoltage) tileEntity).getVoltage(), + ElectricityDisplay.ElectricUnit.VOLTAGE))); + } + return true; + } + + private boolean onUse(final ItemStack itemStack) { + final double joules = this.getJoules(itemStack); + this.getClass(); + if (joules >= 5000.0) { + final double joules2 = this.getJoules(itemStack); + this.getClass(); + this.setJoules(joules2 - 5000.0, itemStack); + return true; + } + return false; + } + + public double getMaxJoules(final ItemStack itemStack) { + return 1000000.0; + } + + public double getVoltage(final ItemStack itemStack) { + return 35.0; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister reg) { + this.itemIcon = reg.registerIcon( + this.getUnlocalizedName().replaceAll("item.", "electricexpansion:")); + } + + @Override + public void setJoules(final double joules, final ItemStack itemStack) { + if (itemStack.getTagCompound() == null) { + itemStack.setTagCompound(new NBTTagCompound()); + } + final double electricityStored = Math.max(Math.min(joules, this.getMaxJoules(itemStack)), 0.0); + itemStack.getTagCompound().setDouble("electricity", electricityStored); + itemStack.setItemDamage( + (int) (this.getMaxDamage() - electricityStored / + this.getMaxJoules(itemStack) * + this.getMaxDamage())); + } + + @Override + public double getJoules(final ItemStack itemStack) { + if (itemStack.getTagCompound() == null) { + return 0.0; + } + final double electricityStored = itemStack.getTagCompound().getDouble("electricity"); + itemStack.setItemDamage( + (int) (this.getMaxDamage() - electricityStored / + this.getMaxJoules(itemStack) * + this.getMaxDamage())); + return electricityStored; + } +} diff --git a/src/main/java/electricexpansion/common/items/ItemParts.java b/src/main/java/electricexpansion/common/items/ItemParts.java new file mode 100644 index 0000000..726e1f6 --- /dev/null +++ b/src/main/java/electricexpansion/common/items/ItemParts.java @@ -0,0 +1,71 @@ +package electricexpansion.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EETab; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class ItemParts extends Item { + private static String[] names; + private IIcon[] icons; + + public ItemParts() { + super(); + this.icons = new IIcon[ItemParts.names.length]; + this.setHasSubtypes(true); + this.setUnlocalizedName("Parts"); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(final int meta) { + if (meta >= this.icons.length) + return null; + return this.icons[meta]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister par1IconRegister) { + for (int i = 0; i < ItemParts.names.length; ++i) { + this.icons[i] = par1IconRegister.registerIcon("electricexpansion:" + + ItemParts.names[i]); + } + } + + @Override + public int getMetadata(final int meta) { + return meta; + } + + @Override + public String getUnlocalizedName(final ItemStack i) { + return i.getItem().getUnlocalizedName() + "." + + ((i.getItemDamage() < ItemParts.names.length) + ? ItemParts.names[i.getItemDamage()] + : "Unknown"); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int var4 = 0; var4 < ItemParts.names.length; ++var4) { + par3List.add(new ItemStack((Item) this, 1, var4)); + } + } + + static { + ItemParts.names = new String[] { "DrawPlates", "CondensedElectrumDust", + "ElectrumIngot", "RawHVAlloy", + "HVAlloyIngot", "CamoPaste", + "Insulation", "LeadIngot", + "Coil", "SilverIngot" }; + } +} diff --git a/src/main/java/electricexpansion/common/items/ItemUltimateBattery.java b/src/main/java/electricexpansion/common/items/ItemUltimateBattery.java new file mode 100644 index 0000000..13871c6 --- /dev/null +++ b/src/main/java/electricexpansion/common/items/ItemUltimateBattery.java @@ -0,0 +1,31 @@ +package electricexpansion.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EETab; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.ItemElectric; + +public class ItemUltimateBattery extends ItemElectric { + public ItemUltimateBattery() { + super(); + this.setUnlocalizedName("UltimateBattery"); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + } + + public double getMaxJoules(final ItemStack i) { + return 5000000.0; + } + + public double getVoltage(final ItemStack i) { + return 75.0; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister reg) { + this.itemIcon = reg.registerIcon( + this.getUnlocalizedName().replaceAll("item.", "electricexpansion:")); + } +} diff --git a/src/main/java/electricexpansion/common/items/ItemUpgrade.java b/src/main/java/electricexpansion/common/items/ItemUpgrade.java new file mode 100644 index 0000000..e3ac226 --- /dev/null +++ b/src/main/java/electricexpansion/common/items/ItemUpgrade.java @@ -0,0 +1,217 @@ +package electricexpansion.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.common.misc.EETab; +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +// TODO: WTF +// import universalelectricity.prefab.modifier.IModifier; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import universalelectricity.core.electricity.ElectricityDisplay; + +public class ItemUpgrade extends Item /* implements IModifier */ { + private String[] names; + private IIcon[] icons; + @SideOnly(Side.CLIENT) + private IIcon defaultIcon; + + public ItemUpgrade(final int texture) { + super(); + this.names = new String[] { "Storage1", "Storage2", "Storage3", + "Storage4", "HalfVoltage", "HVUpgrade", + "HVInputUpgrade", "DoubleVoltage", "Unlimiter1", + "Unlimiter2", "Unlimiter3", "Unlimiter4" }; + this.icons = new IIcon[this.names.length]; + this.setMaxDamage(0); + this.setMaxStackSize(16); + this.setHasSubtypes(true); + this.setCreativeTab((CreativeTabs) EETab.INSTANCE); + this.setUnlocalizedName("Upgrade"); + } + + @Override + public int getMetadata(final int damage) { + return damage; + } + + @Override + public String getUnlocalizedName(final ItemStack itemstack) { + return this.getUnlocalizedName() + "." + + this.names[itemstack.getItemDamage()]; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(final int i) { + if (i <= this.icons.length) { + return this.icons[i]; + } + return this.defaultIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, + final List par3List) { + for (int i = 0; i < this.names.length; ++i) { + par3List.add(new ItemStack((Item) this, 1, i)); + } + } + + //@Override + public String getType(final ItemStack itemstack) { + switch (itemstack.getItemDamage()) { + case 0: + case 1: + case 2: + case 3: { + return "Capacity"; + } + case 4: + case 5: { + return "VoltageModifier"; + } + case 6: { + return "InputVoltageModifier"; + } + case 7: { + return "VoltageModifier"; + } + case 8: + case 9: + case 10: + case 11: { + return "Unlimiter"; + } + default: { + return "Unknown"; + } + } + } + + //@Override + public double getEffectiveness(final ItemStack itemstack) { + switch (itemstack.getItemDamage()) { + case 0: { + return 1000000.0; + } + case 1: { + return 2000000.0; + } + case 2: { + return 3000000.0; + } + case 3: { + return 5000000.0; + } + case 4: { + return 0.5; + } + case 5: { + return 20.0; + } + case 6: { + return 20.0; + } + case 7: { + return 2.0; + } + case 8: { + return 5.0; + } + case 9: { + return 10.0; + } + case 10: { + return 20.0; + } + case 11: { + return 40.0; + } + default: { + return 0.0; + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(final ItemStack itemstack, + final EntityPlayer player, final List par3List, + final boolean par4) { + String strength = ""; + final double effectiveness = this.getEffectiveness(itemstack); + if (this.getType(itemstack).equals("Capacity")) { + strength = ElectricityDisplay.getDisplay(this.getEffectiveness(itemstack), + ElectricityDisplay.ElectricUnit.JOULES); + } else if (effectiveness < 0.0) { + strength = "1/" + String.valueOf(effectiveness * -1.0); + } else { + strength = effectiveness + ""; + } + par3List.add("§2" + StatCollector + .translateToLocal("upgrades.description." + + this.getType(itemstack)) + .replaceAll("<>", strength)); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(final IIconRegister iconRegister) { + for (int i = 0; i < this.names.length; ++i) { + this.icons[i] = iconRegister.registerIcon("electricexpansion:" + this.names[i]); + } + } + + //@Override + public int getTier(final ItemStack i) { + switch (i.getItemDamage()) { + case 0: { + return 0; + } + case 1: { + return 1; + } + case 2: { + return 2; + } + case 3: { + return 3; + } + case 4: { + return 0; + } + case 5: { + return 1; + } + case 6: { + return 1; + } + case 7: { + return 0; + } + case 8: { + return 0; + } + case 9: { + return 1; + } + case 10: { + return 2; + } + case 11: { + return 3; + } + default: { + return -1; + } + } + } +} diff --git a/src/main/java/electricexpansion/common/misc/DistributionNetworks.java b/src/main/java/electricexpansion/common/misc/DistributionNetworks.java new file mode 100644 index 0000000..a603144 --- /dev/null +++ b/src/main/java/electricexpansion/common/misc/DistributionNetworks.java @@ -0,0 +1,169 @@ +package electricexpansion.common.misc; + +import electricexpansion.common.ElectricExpansion; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraftforge.event.world.WorldEvent; + +public class DistributionNetworks { + private MinecraftServer server; + public static final byte maxFrequencies = Byte.MIN_VALUE; + private Map playerFrequencies; + + public DistributionNetworks() { + this.server = MinecraftServer.getServer(); + this.playerFrequencies = new HashMap<>(); + } + + public double getJoules(final String player, final byte frequency) { + if (player != null) { + if (!this.playerFrequencies.containsKey(player)) { + this.playerFrequencies.put(player, new double[128]); + } + return ((double[]) this.playerFrequencies.get(player))[frequency]; + } + return 0.0; + } + + public void setJoules(final String player, final short frequency, + final double newJoules) { + if (player != null) { + if (!this.playerFrequencies.containsKey(player)) { + this.playerFrequencies.put(player, new double[128]); + } + ((double[]) this.playerFrequencies.get(player))[frequency] = newJoules; + } + } + + public void addJoules(final String player, final short frequency, + final double addedJoules) { + if (player != null) { + if (!this.playerFrequencies.containsKey(player)) { + this.playerFrequencies.put(player, new double[128]); + } + ((double[]) this.playerFrequencies.get(player))[frequency] += addedJoules; + } + } + + public void removeJoules(final String player, final short frequency, + final double removedJoules) { + try { + if (player != null) { + ((double[]) this.playerFrequencies.get(player))[frequency] -= removedJoules; + } + } catch (final Exception ex) { + } + } + + public static double getMaxJoules() { + return 5000000.0; + } + + public void onWorldSave(final WorldEvent event) { + String folder = ""; + if (this.server.isDedicatedServer()) { + folder = this.server.getFolderName(); + } else { + folder = Minecraft.getMinecraft().mcDataDir + File.separator + "saves" + + File.separator + this.server.getFolderName(); + } + if (!event.world.isRemote) { + try { + final File file = new File(folder + File.separator + "ElectricExpansion"); + if (!file.exists()) { + file.mkdirs(); + } + String[] players = new String[this.playerFrequencies.size()]; + players = (String[]) this.playerFrequencies.keySet().toArray(players); + for (int i = 0; i < this.playerFrequencies.size(); ++i) { + final File var3 = new File(file + File.separator + players[i] + "_tmp.dat"); + final File var4 = new File(file + File.separator + players[i] + ".dat"); + final File var5 = new File(file + File.separator + players[i] + "_Backup.dat"); + final NBTTagCompound nbt = new NBTTagCompound(); + for (int j = 0; j < ((double[]) this.playerFrequencies.get(players[i])).length; ++j) { + if (((double[]) this.playerFrequencies.get(players[i]))[j] > 0.0) { + nbt.setDouble(j + "", ((double[]) this.playerFrequencies.get( + players[i]))[j]); + CompressedStreamTools.writeCompressed( + nbt, (OutputStream) new FileOutputStream(var3)); + } + } + if (var5.exists()) { + var5.delete(); + } + if (var4.exists()) { + var4.renameTo(var5); + } + var3.renameTo(var4); + } + } catch (final Exception e) { + ElectricExpansion.eeLogger.severe( + "Failed to save the Quantum Battery Box Electricity Storage Data!"); + } + } + if (event instanceof WorldEvent.Unload) { + this.playerFrequencies.clear(); + } + } + + public void onWorldLoad() { + try { + for (final File playerFile : this.ListSaves()) { + if (playerFile.exists()) { + String name = playerFile.getName(); + if (!name.contains("_Backup")) { + if (name.endsWith(".dat")) { + name = name.substring(0, name.length() - 4); + } + this.playerFrequencies.put(name, new double[128]); + for (int i = 0; i < 128; ++i) { + try { + ((double[]) this.playerFrequencies.get(name))[i] = CompressedStreamTools + .readCompressed( + (InputStream) new FileInputStream(playerFile)) + .getDouble(i + ""); + } catch (final Exception e) { + ((double[]) this.playerFrequencies.get(name))[i] = 0.0; + } + } + } + } + } + } catch (final Exception e2) { + ElectricExpansion.eeLogger.warning( + "Failed to load the Quantum Battery Box Electricity Storage Data!"); + ElectricExpansion.eeLogger.warning( + "If this is the first time loading the world after the mod was installed, there are no problems."); + } + String[] players = new String[this.playerFrequencies.size()]; + players = (String[]) this.playerFrequencies.keySet().toArray(players); + String playerString = ""; + for (final String player : players) { + playerString = playerString + ", " + player; + } + ElectricExpansion.eeLogger.warning(playerString); + } + + public File[] ListSaves() { + String folder = ""; + if (this.server.isDedicatedServer()) { + folder = this.server.getFolderName() + File.separator + "ElectricExpansion"; + } else if (!this.server.isDedicatedServer()) { + folder = Minecraft.getMinecraft().mcDataDir + File.separator + "saves" + + File.separator + this.server.getFolderName() + File.separator + + "ElectricExpansion"; + } + final File folderToUse = new File(folder); + final File[] listOfFiles = folderToUse.listFiles(); + return listOfFiles; + } +} diff --git a/src/main/java/electricexpansion/common/misc/EENetwork.java b/src/main/java/electricexpansion/common/misc/EENetwork.java new file mode 100644 index 0000000..61151cd --- /dev/null +++ b/src/main/java/electricexpansion/common/misc/EENetwork.java @@ -0,0 +1,356 @@ +package electricexpansion.common.misc; + +import cpw.mods.fml.common.FMLLog; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.path.Pathfinder; +import universalelectricity.core.block.INetworkProvider; +import net.minecraft.world.IBlockAccess; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.path.PathfinderChecker; +import universalelectricity.core.block.IConnectionProvider; +import java.util.Iterator; +import electricexpansion.api.IRedstoneNetAccessor; +import net.minecraft.tileentity.TileEntity; +import java.util.Map; +import java.util.Collection; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.HashSet; +import universalelectricity.core.block.IConductor; +import electricexpansion.common.tile.TileEntityRedstoneNetworkCore; +import java.util.List; +import java.util.Set; +import java.util.HashMap; +import universalelectricity.core.electricity.IElectricityNetwork; + +public class EENetwork implements IElectricityNetwork +{ + private final HashMap producers; + private final HashMap consumers; + private final Set conductors; + private final List redstoneInterfacers; + public byte rsLevel; + public TileEntityRedstoneNetworkCore coreProcessor; + + public EENetwork(final IConductor... conductors) { + this.producers = new HashMap<>(); + this.consumers = new HashMap<>(); + this.conductors = new HashSet<>(); + this.redstoneInterfacers = new ArrayList<>(); + this.rsLevel = 0; + this.conductors.addAll(Arrays.asList(conductors)); + this.cleanUpConductors(); + } + + public EENetwork(final IElectricityNetwork oldNetwork) { + this.producers = new HashMap<>(); + this.consumers = new HashMap<>(); + this.conductors = new HashSet<>(); + this.redstoneInterfacers = new ArrayList<>(); + this.rsLevel = 0; + this.conductors.addAll(oldNetwork.getConductors()); + this.consumers.putAll(oldNetwork.getConsumers()); + this.producers.putAll(oldNetwork.getProducers()); + this.cleanUpConductors(); + } + + @Override + public void cleanUpConductors() { + final Iterator it = this.conductors.iterator(); + this.redstoneInterfacers.clear(); + while (it.hasNext()) { + final IConductor conductor = it.next(); + if (conductor == null) { + it.remove(); + } + else if (((TileEntity)conductor).isInvalid()) { + it.remove(); + } + else if (conductor instanceof IRedstoneNetAccessor) { + conductor.setNetwork(this); + this.redstoneInterfacers.add(conductor); + } + else { + conductor.setNetwork(this); + } + } + } + + @Override + public void mergeConnection(final IElectricityNetwork network) { + if (network != null && network != this && network instanceof EENetwork) { + final EENetwork newNetwork = new EENetwork(new IConductor[0]); + newNetwork.getConductors().addAll(this.getConductors()); + newNetwork.getConductors().addAll(network.getConductors()); + newNetwork.cleanUpConductors(); + if (this.coreProcessor != null && ((EENetwork)network).coreProcessor == null) { + newNetwork.coreProcessor = this.coreProcessor; + } + else if (this.coreProcessor == null && ((EENetwork)network).coreProcessor != null) { + newNetwork.coreProcessor = ((EENetwork)network).coreProcessor; + } + } + } + + @Override + public void splitNetwork(final IConnectionProvider splitPoint) { + if (splitPoint instanceof TileEntity) { + this.getConductors().remove(splitPoint); + final TileEntity[] connectedBlocks = splitPoint.getAdjacentConnections(); + for (int i = 0; i < connectedBlocks.length; ++i) { + final TileEntity connectedBlockA = connectedBlocks[i]; + if (connectedBlockA instanceof IConnectionProvider) { + for (int ii = 0; ii < connectedBlocks.length; ++ii) { + final TileEntity connectedBlockB = connectedBlocks[ii]; + if (connectedBlockA != connectedBlockB && connectedBlockB instanceof IConnectionProvider) { + final Pathfinder finder = new PathfinderChecker(((TileEntity)splitPoint).getWorldObj(), (IConnectionProvider)connectedBlockB, new IConnectionProvider[] { splitPoint }); + finder.init(new Vector3(connectedBlockA)); + if (finder.results.size() > 0) { + for (final Vector3 node : (Iterable)finder.closedSet) { + final TileEntity nodeTile = node.getTileEntity((IBlockAccess)((TileEntity)splitPoint).getWorldObj()); + if (nodeTile instanceof INetworkProvider && nodeTile != splitPoint) { + ((INetworkProvider)nodeTile).setNetwork(this); + } + } + } + else { + final IElectricityNetwork newNetwork = new EENetwork(new IConductor[0]); + for (final Vector3 node2 : (Iterable)finder.closedSet) { + final TileEntity nodeTile2 = node2.getTileEntity((IBlockAccess)((TileEntity)splitPoint).getWorldObj()); + if (nodeTile2 instanceof INetworkProvider && nodeTile2 != splitPoint) { + newNetwork.getConductors().add(nodeTile2); + } + } + newNetwork.cleanUpConductors(); + } + } + } + } + } + } + } + + @Override + public String toString() { + return "RedstoneNetwork[" + this.hashCode() + "|Wires:" + this.getConductors().size() + "]"; + } + + @Override + public void startProducing(final TileEntity tileEntity, final ElectricityPack electricityPack) { + if (tileEntity != null && electricityPack.getWatts() > 0.0) { + this.producers.put(tileEntity, electricityPack); + } + } + + @Override + public void startProducing(final TileEntity tileEntity, final double amperes, final double voltage) { + this.startProducing(tileEntity, new ElectricityPack(amperes, voltage)); + } + + @Override + public boolean isProducing(final TileEntity tileEntity) { + return this.producers.containsKey(tileEntity); + } + + @Override + public void stopProducing(final TileEntity tileEntity) { + this.producers.remove(tileEntity); + } + + @Override + public void startRequesting(final TileEntity tileEntity, final ElectricityPack electricityPack) { + if (tileEntity != null && electricityPack.getWatts() > 0.0) { + this.consumers.put(tileEntity, electricityPack); + } + } + + @Override + public void startRequesting(final TileEntity tileEntity, final double amperes, final double voltage) { + this.startRequesting(tileEntity, new ElectricityPack(amperes, voltage)); + } + + @Override + public boolean isRequesting(final TileEntity tileEntity) { + return this.consumers.containsKey(tileEntity); + } + + @Override + public void stopRequesting(final TileEntity tileEntity) { + this.consumers.remove(tileEntity); + } + + @Override + public ElectricityPack getProduced(final TileEntity... ignoreTiles) { + final ElectricityPack totalElectricity = new ElectricityPack(0.0, 0.0); + final Iterator> it = this.producers.entrySet().iterator(); + Label_0023: + while (it.hasNext()) { + final Map.Entry pairs = it.next(); + if (pairs != null) { + final 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) { + for (final TileEntity ignoreTile : ignoreTiles) { + if (tileEntity == ignoreTile) { + continue Label_0023; + } + } + } + final ElectricityPack pack = pairs.getValue(); + if (pairs.getKey() == null || pairs.getValue() == null || pack == null) { + continue; + } + final double newWatts = totalElectricity.getWatts() + pack.getWatts(); + final double newVoltage = Math.max(totalElectricity.voltage, pack.voltage); + totalElectricity.amperes = newWatts / newVoltage; + totalElectricity.voltage = newVoltage; + } + } + } + return totalElectricity; + } + + @Override + public ElectricityPack getRequest(final TileEntity... ignoreTiles) { + final ElectricityPack totalElectricity = this.getRequestWithoutReduction(); + totalElectricity.amperes = Math.max(totalElectricity.amperes - this.getProduced(ignoreTiles).amperes, 0.0); + return totalElectricity; + } + + @Override + public ElectricityPack getRequestWithoutReduction() { + final ElectricityPack totalElectricity = new ElectricityPack(0.0, 0.0); + final Iterator> it = this.consumers.entrySet().iterator(); + while (it.hasNext()) { + final Map.Entry pairs = it.next(); + if (pairs != null) { + final 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 { + final ElectricityPack pack = pairs.getValue(); + if (pack == null) { + continue; + } + final ElectricityPack electricityPack = totalElectricity; + electricityPack.amperes += pack.amperes; + totalElectricity.voltage = Math.max(totalElectricity.voltage, pack.voltage); + } + } + } + return totalElectricity; + } + + @Override + public ElectricityPack consumeElectricity(final TileEntity tileEntity) { + ElectricityPack totalElectricity = new ElectricityPack(0.0, 0.0); + try { + final ElectricityPack tileRequest = this.consumers.get(tileEntity); + if (this.consumers.containsKey(tileEntity) && tileRequest != null) { + totalElectricity = this.getProduced(new TileEntity[0]); + if (totalElectricity.getWatts() > 0.0) { + final ElectricityPack totalRequest = this.getRequestWithoutReduction(); + final ElectricityPack electricityPack = totalElectricity; + electricityPack.amperes *= tileRequest.amperes / totalRequest.amperes; + final double ampsReceived = totalElectricity.amperes - totalElectricity.amperes * totalElectricity.amperes * this.getTotalResistance() / totalElectricity.voltage; + final double voltsReceived = totalElectricity.voltage - totalElectricity.amperes * this.getTotalResistance(); + totalElectricity.amperes = ampsReceived; + totalElectricity.voltage = voltsReceived; + return totalElectricity; + } + } + } + catch (final Exception e) { + FMLLog.severe("Failed to consume electricity!", new Object[0]); + e.printStackTrace(); + } + return totalElectricity; + } + + @Override + public HashMap getProducers() { + return this.producers; + } + + @Override + public List getProviders() { + final List providers = new ArrayList(); + providers.addAll(this.producers.keySet()); + return providers; + } + + @Override + public HashMap getConsumers() { + return this.consumers; + } + + @Override + public List getReceivers() { + final List receivers = new ArrayList(); + receivers.addAll(this.consumers.keySet()); + return receivers; + } + + @Override + public void refreshConductors() { + this.cleanUpConductors(); + try { + for (final IConductor conductor : this.conductors) { + conductor.updateAdjacentConnections(); + } + } + catch (final Exception e) { + FMLLog.severe("Universal Electricity: Failed to refresh conductor.", new Object[0]); + e.printStackTrace(); + } + } + + @Override + public double getTotalResistance() { + double resistance = 0.0; + for (final IConductor conductor : this.conductors) { + resistance += conductor.getResistance(); + } + return resistance; + } + + @Override + public double getLowestCurrentCapacity() { + double lowestAmp = 0.0; + for (final IConductor conductor : this.conductors) { + if (lowestAmp == 0.0 || conductor.getCurrentCapcity() < lowestAmp) { + lowestAmp = conductor.getCurrentCapcity(); + } + } + return lowestAmp; + } + + @Override + public Set getConductors() { + return this.conductors; + } + + public List getRedstoneInterfacers() { + return this.redstoneInterfacers; + } + + public void addRsInterfacer(final IRedstoneNetAccessor interfacer) { + this.redstoneInterfacers.add(interfacer); + } +} diff --git a/src/main/java/electricexpansion/common/misc/EETab.java b/src/main/java/electricexpansion/common/misc/EETab.java new file mode 100644 index 0000000..eb3b0a2 --- /dev/null +++ b/src/main/java/electricexpansion/common/misc/EETab.java @@ -0,0 +1,37 @@ +package electricexpansion.common.misc; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class EETab extends CreativeTabs { + public static final EETab INSTANCE; + private ItemStack itemStack; + + public EETab(final String par2Str) { + super(CreativeTabs.getNextID(), par2Str); + LanguageRegistry.instance().addStringLocalization( + "itemGroup.ElectricExpansion", "en_US", "Electric Expansion"); + } + + public void setItemStack(final ItemStack newItemStack) { + if (this.itemStack == null) { + this.itemStack = newItemStack; + } + } + + @Override + public Item getTabIconItem() { + return this.itemStack.getItem(); + } + + @Override + public ItemStack getIconItemStack() { + return this.itemStack; + } + + static { + INSTANCE = new EETab("ElectricExpansion"); + } +} diff --git a/src/main/java/electricexpansion/common/misc/EventHandler.java b/src/main/java/electricexpansion/common/misc/EventHandler.java new file mode 100644 index 0000000..6d6a894 --- /dev/null +++ b/src/main/java/electricexpansion/common/misc/EventHandler.java @@ -0,0 +1,53 @@ +package electricexpansion.common.misc; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.common.ElectricExpansion; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.EntityEvent; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.event.world.WorldEvent; + +public class EventHandler { + @SubscribeEvent + public void onEntityDropItems(final LivingDropsEvent event) { + if (((EntityEvent) event).entity != null && + ((EntityEvent) event).entity instanceof EntitySkeleton && + ((EntitySkeleton) ((EntityEvent) event).entity).getSkeletonType() == 1) { + final Random dropNumber = new Random(); + final int numberOfDrops = dropNumber.nextInt(4) + 1; + final ItemStack leadIS = new ItemStack(ElectricExpansionItems.itemParts, numberOfDrops, 7); + event.drops.add(new EntityItem( + ((Entity) event.entityLiving).worldObj, + ((Entity) event.entityLiving).posX, ((Entity) event.entityLiving).posY, + ((Entity) event.entityLiving).posZ, leadIS.copy())); + } + } + + @SubscribeEvent + @SideOnly(Side.SERVER) + public void onWorldSave(final WorldEvent.Save event) { + ElectricExpansion.DistributionNetworksInstance.onWorldSave( + (WorldEvent) event); + } + + @SubscribeEvent + @SideOnly(Side.SERVER) + public void onWorldLoad(final WorldEvent.Load event) { + (ElectricExpansion.DistributionNetworksInstance = new DistributionNetworks()) + .onWorldLoad(); + } + + @SubscribeEvent + @SideOnly(Side.SERVER) + public void onWorldUnload(final WorldEvent.Unload event) { + ElectricExpansion.DistributionNetworksInstance.onWorldSave( + (WorldEvent) event); + } +} diff --git a/src/main/java/electricexpansion/common/misc/InsulationRecipes.java b/src/main/java/electricexpansion/common/misc/InsulationRecipes.java new file mode 100644 index 0000000..f1b2bfd --- /dev/null +++ b/src/main/java/electricexpansion/common/misc/InsulationRecipes.java @@ -0,0 +1,129 @@ +package electricexpansion.common.misc; + +import electricexpansion.common.RecipeRegistery; +import electricexpansion.common.nei.EEMachineRecipeHandler.RecipeOutput; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class InsulationRecipes { + public static final InsulationRecipes INSTANCE; + private HashMap inputToRecipe; + private HashMap recipeToInput; + private HashMap recipeToOutput; + private HashMap recipeToTicks; + private HashMap recipeToInputQTY; + + private InsulationRecipes() { + this.inputToRecipe = new HashMap<>(); + this.recipeToInput = new HashMap<>(); + this.recipeToOutput = new HashMap<>(); + this.recipeToTicks = new HashMap<>(); + this.recipeToInputQTY = new HashMap<>(); + } + + public void addProcessing(final ItemStack input, int output, int ticks) { + try { + if (ticks <= 0) { + ticks = 60; + } + if (output <= 0) { + output = 1; + } + if (input != null && output > 0 && ticks > 0) { + final int nextRecipeID = this.recipeToOutput.size(); + this.inputToRecipe.put(stackSizeToOne(input) + "", nextRecipeID); + this.recipeToInput.put(nextRecipeID, stackSizeToOne(input)); + this.recipeToOutput.put(nextRecipeID, output); + this.recipeToTicks.put(nextRecipeID, ticks); + this.recipeToInputQTY.put(nextRecipeID, input.stackSize); + } else if (input == null) { + throw new IOException("Error: Input cannot be null."); + } + } catch (final IOException e) { + e.printStackTrace(); + } + } + + public void addProcessing(final String input, final int output, + final int ticks) { + for (final ItemStack input2 : OreDictionary.getOres(input)) { + this.addProcessing(input2, output, ticks); + } + } + + public int getProcessResult(final ItemStack input) { + try { + int recipeID = 0; + recipeID = this.inputToRecipe.get(stackSizeToOne(input) + ""); + if (input.stackSize >= this.recipeToInputQTY.get(recipeID)) { + return this.recipeToOutput.get(recipeID); + } + return -1; + } catch (final NullPointerException e) { + return -1; + } + } + + public int getInputQTY(final ItemStack input) { + try { + int recipeID = 0; + recipeID = this.inputToRecipe.get(stackSizeToOne(input) + ""); + if (input.stackSize >= this.recipeToInputQTY.get(recipeID)) { + return this.recipeToInputQTY.get(recipeID); + } + return 0; + } catch (final NullPointerException e) { + return 0; + } + } + + public Integer getProcessTicks(final ItemStack input) { + try { + int recipeID = 0; + recipeID = this.inputToRecipe.get(stackSizeToOne(input) + ""); + if (input.stackSize >= this.recipeToInputQTY.get(recipeID)) { + return this.recipeToTicks.get(recipeID); + } + return 0; + } catch (final NullPointerException e) { + return 0; + } + } + + public static ItemStack stackSizeToOne(final ItemStack i) { + if (i != null) { + return new ItemStack(i.getItem(), 1, i.getItemDamage()); + } + return null; + } + + public static ItemStack stackSizeChange(final ItemStack i, final int j) { + if (i != null && j + "" != "") { + return new ItemStack(i.getItem(), j, i.getItemDamage()); + } + return null; + } + + public Map getRecipesForNEI() { + final Map recipes = new HashMap<>(); + for (int i = 0; i < this.recipeToInput.size(); ++i) { + final ItemStack input = stackSizeChange(this.recipeToInput.get(i), + this.recipeToInputQTY.get(i)); + RecipeOutput output = new RecipeOutput( + new ItemStack(RecipeRegistery.getInsulationIS().getItem(), + this.recipeToOutput.get(i), + RecipeRegistery.getInsulationIS().getItemDamage()), + this.getProcessTicks(input)); + + recipes.put(input, output); + } + return recipes; + } + + static { + INSTANCE = new InsulationRecipes(); + } +} diff --git a/src/main/java/electricexpansion/common/misc/WireMillRecipes.java b/src/main/java/electricexpansion/common/misc/WireMillRecipes.java new file mode 100644 index 0000000..ff16449 --- /dev/null +++ b/src/main/java/electricexpansion/common/misc/WireMillRecipes.java @@ -0,0 +1,129 @@ +package electricexpansion.common.misc; + +import electricexpansion.common.nei.EEMachineRecipeHandler.RecipeOutput; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class WireMillRecipes { + public static final WireMillRecipes INSTANCE; + private HashMap inputToRecipe; + private HashMap recipeToInput; + private HashMap recipeToOutput; + private HashMap recipeToTicks; + private HashMap recipeToInputQTY; + + private WireMillRecipes() { + this.inputToRecipe = new HashMap<>(); + this.recipeToInput = new HashMap<>(); + this.recipeToOutput = new HashMap<>(); + this.recipeToTicks = new HashMap<>(); + this.recipeToInputQTY = new HashMap<>(); + } + + public void addProcessing(final ItemStack input, final ItemStack output, + final int ticks) { + try { + if (input != null && output != null && ticks > 0) { + final int nextRecipeID = this.recipeToOutput.size(); + this.inputToRecipe.put(stackSizeToOne(input) + "", nextRecipeID); + this.recipeToInput.put(nextRecipeID, stackSizeToOne(input)); + this.recipeToOutput.put(nextRecipeID, output); + this.recipeToTicks.put(nextRecipeID, ticks); + this.recipeToInputQTY.put(nextRecipeID, input.stackSize); + } else { + if (input == null) { + throw new IOException("Error: Input cannot be null."); + } + if (output == null) { + throw new IOException("Error: Output cannot be null."); + } + if (ticks <= 0) { + throw new IOException("Error: Ticks must be greater than 0."); + } + } + } catch (final IOException e) { + e.printStackTrace(); + } + } + + public void addProcessing(final String input, final ItemStack output, + final int ticks) { + for (final ItemStack input2 : OreDictionary.getOres(input)) { + this.addProcessing(input2, output, ticks); + } + } + + public ItemStack getDrawingResult(final ItemStack input) { + try { + int recipeID = 0; + recipeID = this.inputToRecipe.get(stackSizeToOne(input) + ""); + if (input.stackSize >= this.recipeToInputQTY.get(recipeID)) { + return this.recipeToOutput.get(recipeID); + } + return null; + } catch (final NullPointerException e) { + return null; + } + } + + public int getInputQTY(final ItemStack input) { + try { + int recipeID = 0; + recipeID = this.inputToRecipe.get(stackSizeToOne(input) + ""); + if (input.stackSize >= this.recipeToInputQTY.get(recipeID)) { + return this.recipeToInputQTY.get(recipeID); + } + return 0; + } catch (final NullPointerException e) { + return 0; + } + } + + public Integer getDrawingTicks(final ItemStack input) { + try { + int recipeID = 0; + recipeID = this.inputToRecipe.get(stackSizeToOne(input) + ""); + if (input.stackSize >= this.recipeToInputQTY.get(recipeID)) { + return this.recipeToTicks.get(recipeID); + } + return 0; + } catch (final NullPointerException e) { + return 0; + } + } + + public static ItemStack stackSizeToOne(final ItemStack i) { + if (i != null) { + return new ItemStack(i.getItem(), 1, i.getItemDamage()); + } + return null; + } + + public static ItemStack stackSizeChange(final ItemStack i, final int j) { + if (i != null && j + "" != "") { + return new ItemStack(i.getItem(), j, i.getItemDamage()); + } + return null; + } + + public Map getRecipesForNEI() { + final Map recipes = new HashMap<>(); + for (int i = 0; i < this.recipeToInput.size(); ++i) { + final ItemStack input = stackSizeChange(this.recipeToInput.get(i), + this.recipeToInputQTY.get(i)); + + RecipeOutput output = new RecipeOutput(this.recipeToOutput.get(i), + this.getDrawingTicks(input)); + + recipes.put(input, output); + } + return recipes; + } + + static { + INSTANCE = new WireMillRecipes(); + } +} diff --git a/src/main/java/electricexpansion/common/nei/EEMachineRecipeHandler.java b/src/main/java/electricexpansion/common/nei/EEMachineRecipeHandler.java new file mode 100644 index 0000000..1c54edb --- /dev/null +++ b/src/main/java/electricexpansion/common/nei/EEMachineRecipeHandler.java @@ -0,0 +1,160 @@ +package electricexpansion.common.nei; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; +import java.util.Map; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public abstract class EEMachineRecipeHandler extends TemplateRecipeHandler { + @Override + public abstract String getRecipeName(); + + @Override + public abstract String getOverlayIdentifier(); + + @Override + public abstract Class getGuiClass(); + + @Override + public abstract void loadTransferRects(); + + public abstract double getWattsPerTick(); + + public abstract Map getRecipes(); + + @Override + public String getGuiTexture() { + return "electricexpansion:textures/gui/GuiEEMachine.png"; + } + + @Override + public void loadCraftingRecipes(final String outputId, + final Object... results) { + if (outputId.equals(this.getOverlayIdentifier())) { + boolean woolAdded = false; + for (final Map.Entry recipe : this.getRecipes().entrySet()) { + if (recipe.getKey().getItem() == Item.getItemFromBlock(Blocks.wool)) { + if (woolAdded) { + continue; + } + this.arecipes.add( + new EEMachineRecipe(recipe, this.getWattsPerTick())); + woolAdded = true; + } else { + this.arecipes.add( + new EEMachineRecipe(recipe, this.getWattsPerTick())); + } + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(final ItemStack result) { + boolean woolAdded = false; + for (final Map.Entry recipe : this.getRecipes().entrySet()) { + final ItemStack item = recipe.getValue().stack; + if (recipe.getKey().getItem() == Item.getItemFromBlock(Blocks.wool)) { + if (woolAdded || + !NEIServerUtils.areStacksSameTypeCrafting(item, result)) { + continue; + } + this.arecipes.add(new EEMachineRecipe(recipe, this.getWattsPerTick())); + woolAdded = true; + } else { + if (!NEIServerUtils.areStacksSameTypeCrafting(item, result)) { + continue; + } + this.arecipes.add(new EEMachineRecipe(recipe, this.getWattsPerTick())); + } + } + } + + @Override + public void loadUsageRecipes(final ItemStack ingredient) { + boolean woolAdded = false; + for (final Map.Entry recipe : this.getRecipes().entrySet()) { + if (recipe.getKey().getItem() == Item.getItemFromBlock(Blocks.wool)) { + if (woolAdded || !NEIServerUtils.areStacksSameTypeCrafting( + (ItemStack) recipe.getKey(), ingredient)) { + continue; + } + this.arecipes.add(new EEMachineRecipe(recipe, this.getWattsPerTick())); + woolAdded = true; + } else { + if (!NEIServerUtils.areStacksSameTypeCrafting( + (ItemStack) recipe.getKey(), ingredient)) { + continue; + } + this.arecipes.add(new EEMachineRecipe(recipe, this.getWattsPerTick())); + } + } + } + + @Override + public void drawExtras(final int recipe) { + this.drawProgressBar(72, 16, 176, 0, 22, 13, 48, 0); + this.drawProgressBar(30, 9, 176, 13, 4, 10, 48, 1); + final double energy = ((EEMachineRecipe) this.arecipes.get(recipe)).getEnergy(); + String energyString = "Uses "; + if (energy >= 2000000.0) { + energyString = energyString + String.valueOf(energy / 1000000.0) + " MJ"; + } else if (energy >= 2000.0) { + energyString = energyString + String.valueOf(energy / 1000.0) + " kJ"; + } else { + energyString = energyString + String.valueOf(energy) + " J"; + } + GuiDraw.drawStringC(energyString, 115, 42, -1); + } + + public class EEMachineRecipe extends TemplateRecipeHandler.CachedRecipe { + private PositionedStack input; + private PositionedStack output; + private double energy; + + public double getEnergy() { + return this.energy; + } + + @Override + public PositionedStack getResult() { + return this.output; + } + + @Override + public PositionedStack getIngredient() { + if (this.input.item.getItem() == Item.getItemFromBlock(Blocks.wool)) { + final int cycle = EEMachineRecipeHandler.this.cycleticks / 48; + final PositionedStack stack = this.input.copy(); + stack.item.setItemDamage(cycle % 14); + return stack; + } + return this.input; + } + + public EEMachineRecipe(final Map.Entry recipe, + final double wattsPerTick) { + super(); + this.input = new PositionedStack(recipe.getKey(), 50, 14); + this.output = new PositionedStack(recipe.getValue().stack, + 103, 14); + this.energy = recipe.getValue().processingTime * wattsPerTick; + } + } + + public static class RecipeOutput { + public ItemStack stack; + public int processingTime; + + public RecipeOutput(ItemStack stack, int processingTime) { + this.stack = stack; + this.processingTime = processingTime; + } + } +} diff --git a/src/main/java/electricexpansion/common/nei/InsulatingMachineRecipeHandler.java b/src/main/java/electricexpansion/common/nei/InsulatingMachineRecipeHandler.java new file mode 100644 index 0000000..74217fd --- /dev/null +++ b/src/main/java/electricexpansion/common/nei/InsulatingMachineRecipeHandler.java @@ -0,0 +1,48 @@ +package electricexpansion.common.nei; + +import electricexpansion.common.misc.InsulationRecipes; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; + +import java.util.Map; +import electricexpansion.client.gui.GuiInsulationMachine; +import codechicken.nei.recipe.TemplateRecipeHandler; +import java.awt.Rectangle; + +public class InsulatingMachineRecipeHandler extends EEMachineRecipeHandler +{ + @Override + public String getRecipeName() { + return "Insulation Refiner"; + } + + @Override + public String getOverlayIdentifier() { + return "insulation"; + } + + @Override + public String getGuiTexture() { + return "electricexpansion:textures/gui/GuiEEMachine.png"; + } + + @Override + public void loadTransferRects() { + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(77, 27, 22, 12), "insulation", new Object[0])); + } + + @Override + public Class getGuiClass() { + return GuiInsulationMachine.class; + } + + @Override + public double getWattsPerTick() { + return 500.0; + } + + @Override + public Map getRecipes() { + return InsulationRecipes.INSTANCE.getRecipesForNEI(); + } +} diff --git a/src/main/java/electricexpansion/common/nei/NEIElextricExpansionConfig.java b/src/main/java/electricexpansion/common/nei/NEIElextricExpansionConfig.java new file mode 100644 index 0000000..d1f633a --- /dev/null +++ b/src/main/java/electricexpansion/common/nei/NEIElextricExpansionConfig.java @@ -0,0 +1,32 @@ +package electricexpansion.common.nei; + +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; +import codechicken.nei.recipe.ICraftingHandler; +import codechicken.nei.recipe.IUsageHandler; +import electricexpansion.client.gui.GuiInsulationMachine; +import electricexpansion.client.gui.GuiWireMill; + +public class NEIElextricExpansionConfig implements IConfigureNEI { + @Override + public void loadConfig() { + API.registerRecipeHandler( + (ICraftingHandler) new InsulatingMachineRecipeHandler()); + API.registerUsageHandler( + (IUsageHandler) new InsulatingMachineRecipeHandler()); + API.setGuiOffset(GuiInsulationMachine.class, 0, 0); + API.registerRecipeHandler((ICraftingHandler) new WireMillRecipeHandler()); + API.registerUsageHandler((IUsageHandler) new WireMillRecipeHandler()); + API.setGuiOffset(GuiWireMill.class, 0, 0); + } + + @Override + public String getName() { + return "Electric Expansion plugin"; + } + + @Override + public String getVersion() { + return "1.0.0"; + } +} diff --git a/src/main/java/electricexpansion/common/nei/WireMillRecipeHandler.java b/src/main/java/electricexpansion/common/nei/WireMillRecipeHandler.java new file mode 100644 index 0000000..3adda9e --- /dev/null +++ b/src/main/java/electricexpansion/common/nei/WireMillRecipeHandler.java @@ -0,0 +1,48 @@ +package electricexpansion.common.nei; + +import electricexpansion.common.misc.WireMillRecipes; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; + +import java.util.Map; +import electricexpansion.client.gui.GuiWireMill; +import codechicken.nei.recipe.TemplateRecipeHandler; +import java.awt.Rectangle; + +public class WireMillRecipeHandler extends EEMachineRecipeHandler +{ + @Override + public String getRecipeName() { + return "Wire Mill"; + } + + @Override + public String getOverlayIdentifier() { + return "wireMill"; + } + + @Override + public String getGuiTexture() { + return "electricexpansion:textures/gui/GuiEEMachine.png"; + } + + @Override + public void loadTransferRects() { + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(77, 27, 22, 12), "wireMill", new Object[0])); + } + + @Override + public Class getGuiClass() { + return GuiWireMill.class; + } + + @Override + public double getWattsPerTick() { + return 500.0; + } + + @Override + public Map getRecipes() { + return WireMillRecipes.INSTANCE.getRecipesForNEI(); + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityAdvancedBatteryBox.java b/src/main/java/electricexpansion/common/tile/TileEntityAdvancedBatteryBox.java new file mode 100644 index 0000000..b8ef6a8 --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityAdvancedBatteryBox.java @@ -0,0 +1,445 @@ +package electricexpansion.common.tile; + +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; +import java.util.EnumSet; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +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.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.UniversalElectricity; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.core.item.ElectricItemHelper; +import universalelectricity.core.item.IItemElectric; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.implement.IRedstoneProvider; +import universalelectricity.prefab.tile.TileEntityElectricityStorage; + +public class TileEntityAdvancedBatteryBox extends TileEntityElectricityStorage + implements IRedstoneProvider, ISidedInventory, IPeripheral { + private ItemStack[] containingItems; + private int playersUsing; + + public TileEntityAdvancedBatteryBox() { + this.containingItems = new ItemStack[5]; + this.playersUsing = 0; + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (!this.isDisabled()) { + if (this.containingItems[0] != null && this.getJoules() > 0.0) { + if (this.containingItems[0].getItem() instanceof IItemElectric) { + this.setJoules(this.getJoules() - + ElectricItemHelper.chargeItem(this.containingItems[0], + this.getJoules(), + this.getVoltage())); + } + } + if (this.containingItems[1] != null && + this.getJoules() < this.getMaxJoules()) { + if (this.containingItems[1].getItem() instanceof IItemElectric) { + final IItemElectric electricItem = (IItemElectric) this.containingItems[1].getItem(); + if (electricItem.getProvideRequest(this.containingItems[1]) + .getWatts() > 0.0) { + final ElectricityPack packRecieved = electricItem.onProvide( + ElectricityPack.getFromWatts( + this.getMaxJoules() - this.getJoules(), this.getVoltage()), + this.containingItems[1]); + this.setJoules(this.getJoules() + packRecieved.getWatts()); + } + } + } + final ForgeDirection outputDirection = ForgeDirection.getOrientation(this.getBlockMetadata() + 2); + final TileEntity outputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), outputDirection); + final TileEntity inputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), outputDirection.getOpposite()); + final IElectricityNetwork inputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity( + inputTile, outputDirection.getOpposite()); + final IElectricityNetwork outputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity(outputTile, + outputDirection); + if (outputNetwork != null && inputNetwork != outputNetwork) { + final ElectricityPack actualOutput = new ElectricityPack( + Math.min( + outputNetwork.getLowestCurrentCapacity(), + Math.min( + this.getOutputCap(), + outputNetwork.getRequest(new TileEntity[0]).getWatts()) / + this.getVoltage()), + this.getVoltage()); + if (this.getJoules() > 0.0 && actualOutput.getWatts() > 0.0) { + outputNetwork.startProducing(this, actualOutput); + this.setJoules(this.getJoules() - actualOutput.getWatts()); + } else { + outputNetwork.stopProducing(this); + } + } + } + if (!this.getWorldObj().isRemote && super.ticks % 3L == 0L && + this.playersUsing > 0) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + } + + @Override + public ElectricityPack getRequest() { + return new ElectricityPack( + Math.min((this.getMaxJoules() - this.getJoules()) / this.getVoltage(), + this.getOutputCap() / 2.0), + this.getVoltage()); + } + + @Override + protected EnumSet getConsumingSides() { + return EnumSet.of(ForgeDirection.getOrientation(this.getBlockMetadata() + 2) + .getOpposite()); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + + nbt.setDouble("joules", this.getJoules()); + nbt.setInteger("disabledTicks", super.disabledTicks); + + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, + this.getBlockMetadata(), nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + + this.setJoules(nbt.getDouble("joules")); + super.disabledTicks = nbt.getInteger("disabledTicks"); + } + + @Override + public void openInventory() { + ++this.playersUsing; + } + + @Override + public void closeInventory() { + --this.playersUsing; + } + + @Override + public void readFromNBT(final NBTTagCompound par1NBTTagCompound) { + super.readFromNBT(par1NBTTagCompound); + final NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10); + this.containingItems = new ItemStack[this.getSizeInventory()]; + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + final NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3); + final byte var5 = var4.getByte("Slot"); + if (var5 >= 0 && var5 < this.containingItems.length) { + this.containingItems[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + } + + @Override + public void writeToNBT(final NBTTagCompound par1NBTTagCompound) { + super.writeToNBT(par1NBTTagCompound); + final NBTTagList var2 = new NBTTagList(); + for (int var3 = 0; var3 < this.containingItems.length; ++var3) { + if (this.containingItems[var3] != null) { + final NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte) var3); + this.containingItems[var3].writeToNBT(var4); + var2.appendTag((NBTBase) var4); + } + } + par1NBTTagCompound.setTag("Items", (NBTBase) var2); + } + + @Override + public int[] getAccessibleSlotsFromSide(int orientation) { + ForgeDirection side = ForgeDirection.getOrientation(orientation); + + if (side == ForgeDirection.DOWN) { + return new int[] { 1 }; + } + if (side == ForgeDirection.UP) { + return new int[] { 1 }; + } + return new int[] { 0 }; + } + + @Override + public int getSizeInventory() { + return this.containingItems.length; + } + + @Override + public ItemStack getStackInSlot(final int par1) { + return this.containingItems[par1]; + } + + @Override + public ItemStack decrStackSize(final int par1, final int par2) { + if (this.containingItems[par1] == null) { + return null; + } + if (this.containingItems[par1].stackSize <= par2) { + final ItemStack var3 = this.containingItems[par1]; + this.containingItems[par1] = null; + return var3; + } + final ItemStack var3 = this.containingItems[par1].splitStack(par2); + if (this.containingItems[par1].stackSize == 0) { + this.containingItems[par1] = null; + } + return var3; + } + + @Override + public ItemStack getStackInSlotOnClosing(final int par1) { + if (this.containingItems[par1] != null) { + final ItemStack var2 = this.containingItems[par1]; + this.containingItems[par1] = null; + return var2; + } + return null; + } + + @Override + public void setInventorySlotContents(final int par1, + final ItemStack par2ItemStack) { + this.containingItems[par1] = par2ItemStack; + if (par2ItemStack != null && + par2ItemStack.stackSize > this.getInventoryStackLimit()) { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return StatCollector.translateToLocal("tile.advbatbox.name"); + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public double getMaxJoules() { + double slot1 = 0.0; + double slot2 = 0.0; + double slot3 = 0.0; + // TODO: austri3Fix + // if (this.containingItems[2] != null && + // this.containingItems[2].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[2].getItem()) + // .getType(this.containingItems[2]) == "Capacity") { + // slot1 = ((IModifier) this.containingItems[2].getItem()) + // .getEffectiveness(this.containingItems[2]); + // } + // if (this.containingItems[3] != null && + // this.containingItems[3].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[3].getItem()) + // .getType(this.containingItems[3]) == "Capacity") { + // slot2 = ((IModifier) this.containingItems[3].getItem()) + // .getEffectiveness(this.containingItems[3]); + // } + // if (this.containingItems[4] != null && + // this.containingItems[4].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[4].getItem()) + // .getType(this.containingItems[4]) == "Capacity") { + // slot3 = ((IModifier) this.containingItems[4].getItem()) + // .getEffectiveness(this.containingItems[4]); + // } + return 5000000.0 + slot1 + slot2 + slot3; + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer par1EntityPlayer) { + return this.getWorldObj().getTileEntity(this.xCoord, this.yCoord, + this.zCoord) == this; + } + + @Override + public boolean isPoweringTo(final ForgeDirection side) { + return this.getJoules() >= this.getMaxJoules(); + } + + @Override + public boolean isIndirectlyPoweringTo(final ForgeDirection side) { + return this.isPoweringTo(side); + } + + @Override + public double getVoltage() { + return 120.0 * this.getVoltageModifier("VoltageModifier"); + } + + public double getInputVoltage() { + return Math.max( + this.getVoltage(), + Math.max(120.0, this.getVoltageModifier("InputVoltageModifier") * + this.getVoltageModifier("VoltageModifier") * + 120.0)); + } + + @Override + public void onReceive(final ElectricityPack electricityPack) { + if (UniversalElectricity.isVoltageSensitive && + electricityPack.voltage > this.getInputVoltage()) { + this.getWorldObj().createExplosion((Entity) null, (double) this.xCoord, + (double) this.yCoord, + (double) this.zCoord, 1.5f, true); + return; + } + this.setJoules(this.getJoules() + electricityPack.getWatts()); + } + + private double getVoltageModifier(final String type) { + double slot1 = 1.0; + double slot2 = 1.0; + double slot3 = 1.0; + // TODO: austri3Fix + // if (this.containingItems[2] != null && + // this.containingItems[2].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[2].getItem()) + // .getType(this.containingItems[2]) == type) { + // slot1 = ((IModifier) this.containingItems[2].getItem()) + // .getEffectiveness(this.containingItems[2]); + // } + // if (this.containingItems[3] != null && + // this.containingItems[3].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[3].getItem()) + // .getType(this.containingItems[3]) == type) { + // slot2 = ((IModifier) this.containingItems[3].getItem()) + // .getEffectiveness(this.containingItems[3]); + // } + // if (this.containingItems[4] != null && + // this.containingItems[4].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[4].getItem()) + // .getType(this.containingItems[4]) == type) { + // slot3 = ((IModifier) this.containingItems[4].getItem()) + // .getEffectiveness(this.containingItems[4]); + // } + return slot1 * slot2 * slot3; + } + + private double getOutputCap() { + double slot1 = 0.0; + double slot2 = 0.0; + double slot3 = 0.0; + // TODO: austri3Fix + // if (this.containingItems[2] != null && + // this.containingItems[2].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[2].getItem()) + // .getType(this.containingItems[2]) == "Unlimiter") { + // slot1 = ((IModifier) this.containingItems[2].getItem()) + // .getEffectiveness(this.containingItems[2]); + // } + // if (this.containingItems[3] != null && + // this.containingItems[3].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[3].getItem()) + // .getType(this.containingItems[3]) == "Unlimiter") { + // slot2 = ((IModifier) this.containingItems[3].getItem()) + // .getEffectiveness(this.containingItems[3]); + // } + // if (this.containingItems[4] != null && + // this.containingItems[4].getItem() instanceof IModifier && + // ((IModifier) this.containingItems[4].getItem()) + // .getType(this.containingItems[4]) == "Unlimiter") { + // slot3 = ((IModifier) this.containingItems[4].getItem()) + // .getEffectiveness(this.containingItems[4]); + // } + return (100.0 + slot1) * (100.0 + slot2) * (100.0 + slot3) / 1000000.0 * + 10000.0; + } + + @Override + public String getType() { + return this.getInventoryName().replaceAll(" ", ""); + } + + @Override + public String[] getMethodNames() { + return new String[] { "getVoltage", "getEnergy", "isFull" }; + } + + @Override + public Object[] callMethod(final IComputerAccess computer, ILuaContext lctx, + final int method, final Object[] arguments) + throws LuaException { + switch (method) { + case 0: { + return new Object[] { this.getVoltage() }; + } + case 1: { + return new Object[] { this.getJoules() }; + } + case 2: { + return new Object[] { this.getJoules() >= this.getMaxJoules() }; + } + default: { + throw new LuaException("Function unimplemented"); + } + } + } + + @Override + public void attach(final IComputerAccess computer) { + } + + @Override + public void detach(final IComputerAccess computer) { + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + return this.getBlockMetadata() + 2 == direction.ordinal() || + this.getBlockMetadata() + 2 == direction.getOpposite().ordinal(); + } + + @Override + public boolean hasCustomInventoryName() { + return true; + } + + @Override + public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { + return false; + } + + @Override + public boolean equals(IPeripheral other) { + return this == other; + } + + @Override + public boolean canInsertItem(int slot, ItemStack item, int side) { + return getAccessibleSlotsFromSide(side)[0] == slot && + this.containingItems[side] == null; + } + + @Override + public boolean canExtractItem(int slot, ItemStack item, int side) { + int slotIdx = getAccessibleSlotsFromSide(side)[0]; + return getAccessibleSlotsFromSide(side)[0] == slot && + this.containingItems[slotIdx] != null && + this.containingItems[slotIdx].stackSize != 0 && + this.containingItems[slotIdx].getItem() == item.getItem(); + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityFuseBox.java b/src/main/java/electricexpansion/common/tile/TileEntityFuseBox.java new file mode 100644 index 0000000..c36aa3d --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityFuseBox.java @@ -0,0 +1,180 @@ +package electricexpansion.common.tile; + +import electricexpansion.api.IItemFuse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.tile.TileEntityElectrical; + +public class TileEntityFuseBox + extends TileEntityElectrical implements IInventory { + public ItemStack[] inventory; + + public TileEntityFuseBox() { + this.inventory = new ItemStack[1]; + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (!this.getWorldObj().isRemote) { + if (this.hasFuse()) { + final ForgeDirection inputDirection = ForgeDirection.getOrientation(this.getBlockMetadata() + 2) + .getOpposite(); + final TileEntity inputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), inputDirection); + final ForgeDirection outputDirection = ForgeDirection.getOrientation(this.getBlockMetadata() + 2); + final TileEntity outputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), outputDirection); + final IElectricityNetwork inputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity( + inputTile, outputDirection.getOpposite()); + final IElectricityNetwork outputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity(outputTile, + outputDirection); + if (outputNetwork != null && inputNetwork != null && + outputNetwork != inputNetwork) { + final ElectricityPack request = outputNetwork.getRequest(new TileEntity[0]); + inputNetwork.startRequesting(this, request); + final ElectricityPack recieved = inputNetwork.consumeElectricity(this); + outputNetwork.startProducing(this, recieved); + if (recieved.amperes > ((IItemFuse) this.inventory[0].getItem()) + .getMaxVolts(this.inventory[0])) { + ((IItemFuse) this.inventory[0].getItem()) + .onFuseTrip(this.inventory[0]); + } + } else if (outputNetwork != null && inputNetwork == null) { + outputNetwork.stopProducing(this); + } else if (outputNetwork == null && inputNetwork != null) { + inputNetwork.stopRequesting(this); + } + } + if (!this.getWorldObj().isRemote) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + } + } + + @Override + public void readFromNBT(final NBTTagCompound par1NBTTagCompound) { + super.readFromNBT(par1NBTTagCompound); + final NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10); + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + final NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3); + final byte var5 = var4.getByte("Slot"); + if (var5 >= 0 && var5 < this.inventory.length) { + this.inventory[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + } + + @Override + public void writeToNBT(final NBTTagCompound par1NBTTagCompound) { + super.writeToNBT(par1NBTTagCompound); + final NBTTagList var2 = new NBTTagList(); + for (int var3 = 0; var3 < this.inventory.length; ++var3) { + if (this.inventory[var3] != null) { + final NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte) var3); + this.inventory[var3].writeToNBT(var4); + var2.appendTag((NBTBase) var4); + } + } + par1NBTTagCompound.setTag("Items", (NBTBase) var2); + } + + public boolean hasFuse() { + return this.inventory[0] != null && + this.inventory[0].getItem() instanceof IItemFuse && + ((IItemFuse) this.inventory[0].getItem()).isValidFuse(this.inventory[0]); + } + + @Override + public String getInventoryName() { + return "tile.FuseBox.name"; + } + + @Override + public int getSizeInventory() { + return 1; + } + + @Override + public ItemStack getStackInSlot(final int var1) { + return this.inventory[var1]; + } + + @Override + public ItemStack decrStackSize(final int var1, final int var2) { + if (var1 < this.inventory.length && + this.inventory[var1].stackSize >= var2) { + final ItemStack copy; + final ItemStack toReturn = copy = this.inventory[var1].copy(); + copy.stackSize -= var2; + if (this.inventory[var1].stackSize == 0) { + this.inventory = null; + } + return toReturn; + } + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(final int var1) { + return this.inventory[var1]; + } + + @Override + public void setInventorySlotContents(final int var1, final ItemStack var2) { + if (var1 < this.inventory.length) { + this.inventory[var1] = var2; + } + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer par1EntityPlayer) { + return this.getWorldObj().getTileEntity(this.xCoord, this.yCoord, + this.zCoord) == this && + par1EntityPlayer.getDistanceSq(this.xCoord + 0.5, this.yCoord + 0.5, + this.zCoord + 0.5) <= 64.0; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + final int meta = this.getWorldObj().getBlockMetadata( + this.xCoord, this.yCoord, this.zCoord); + return direction.ordinal() == meta + 2 || + direction.getOpposite().ordinal() == meta + 2; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { + return false; + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityInsulatingMachine.java b/src/main/java/electricexpansion/common/tile/TileEntityInsulatingMachine.java new file mode 100644 index 0000000..02eb736 --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityInsulatingMachine.java @@ -0,0 +1,383 @@ +package electricexpansion.common.tile; + +import electricexpansion.api.ElectricExpansionItems; +import electricexpansion.common.misc.InsulationRecipes; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +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.StatCollector; +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.core.electricity.IElectricityNetwork; +import universalelectricity.core.item.IItemElectric; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.tile.TileEntityElectricityRunnable; + +public class TileEntityInsulatingMachine extends TileEntityElectricityRunnable + implements ISidedInventory, IElectricityStorage { + public static final double WATTS_PER_TICK = 500.0; + public static final double TRANSFER_LIMIT = 1250.0; + private int processTicks; + private double joulesStored; + private int recipeTicks; + public static double maxJoules; + private ItemStack[] inventory; + private int playersUsing; + public int orientation; + private Item baseItem; + private int baseMeta; + + public TileEntityInsulatingMachine() { + this.processTicks = 0; + this.joulesStored = 0.0; + this.recipeTicks = 0; + this.inventory = new ItemStack[3]; + this.playersUsing = 0; + this.baseItem = Item.getItemFromBlock(Blocks.air); + this.baseMeta = 0; + } + + @Override + public void updateEntity() { + // TODO: WTF + // super.updateEntity(); + if (!this.getWorldObj().isRemote) { + final ForgeDirection inputDirection = ForgeDirection.getOrientation(this.getBlockMetadata() + 2); + final TileEntity inputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), inputDirection); + final IElectricityNetwork inputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity( + inputTile, inputDirection.getOpposite()); + if (inputNetwork != null) { + if (this.joulesStored < TileEntityInsulatingMachine.maxJoules) { + inputNetwork.startRequesting( + this, + Math.min(this.getMaxJoules() - this.getJoules(), 1250.0) / + this.getVoltage(), + this.getVoltage()); + final ElectricityPack electricityPack = inputNetwork.consumeElectricity(this); + this.setJoules(this.joulesStored + electricityPack.getWatts()); + if (UniversalElectricity.isVoltageSensitive && + electricityPack.voltage > this.getVoltage()) { + this.getWorldObj().createExplosion( + (Entity) null, (double) this.xCoord, (double) this.yCoord, + (double) this.zCoord, 2.0f, true); + } + } else { + inputNetwork.stopRequesting(this); + } + } + } + if (this.inventory[0] != null && this.joulesStored < this.getMaxJoules()) { + if (this.inventory[0].getItem() instanceof IItemElectric) { + final IItemElectric electricItem = (IItemElectric) this.inventory[0].getItem(); + if (electricItem.getProvideRequest(this.inventory[0]).getWatts() > 0.0) { + final double joulesReceived = electricItem + .onProvide(ElectricityPack.getFromWatts( + Math.max(electricItem.getMaxJoules( + this.inventory[0]) * + 0.005, + 1250.0), + electricItem.getVoltage(this.inventory[0])), + this.inventory[0]) + .getWatts(); + this.setJoules(this.joulesStored + joulesReceived); + } + } + } + if (this.joulesStored >= 500.0 - 50.0 && !this.isDisabled()) { + if (this.inventory[1] != null && this.canProcess() && + (this.processTicks == 0 || + this.baseItem != this.inventory[1].getItem() || + this.baseMeta != this.inventory[1].getItemDamage())) { + this.baseItem = this.inventory[1].getItem(); + this.baseMeta = this.inventory[1].getItemDamage(); + this.processTicks = this.getProcessingTime(); + this.recipeTicks = this.getProcessingTime(); + } + if (this.canProcess() && this.processTicks > 0) { + --this.processTicks; + if (this.processTicks < 1) { + this.processItem(); + this.processTicks = 0; + } + this.getClass(); + this.joulesStored -= 500.0; + } else { + this.processTicks = 0; + } + } + if (!this.getWorldObj().isRemote && super.ticks % 3L == 0L && + this.playersUsing > 0) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + this.joulesStored = Math.min(this.joulesStored, this.getMaxJoules()); + this.joulesStored = Math.max(this.joulesStored, 0.0); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + + nbt.setInteger("processTicks", this.processTicks); + nbt.setInteger("disabledTicks", super.disabledTicks); + nbt.setDouble("joulesStored", this.joulesStored); + nbt.setInteger("recipeTicks", this.recipeTicks); + + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, + this.getBlockMetadata(), nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + + this.processTicks = nbt.getInteger("processTicks"); + super.disabledTicks = nbt.getInteger("disabledTicks"); + this.joulesStored = nbt.getDouble("joulesStored"); + this.recipeTicks = nbt.getInteger("recipeTicks"); + } + + @Override + public void openInventory() { + if (!this.getWorldObj().isRemote) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + ++this.playersUsing; + } + + @Override + public void closeInventory() { + --this.playersUsing; + } + + public boolean canProcess() { + boolean canWork = false; + final ItemStack inputSlot = this.inventory[1]; + final int outputSlot = (this.inventory[2] != null) ? this.inventory[2].stackSize : 0; + if (inputSlot != null && + InsulationRecipes.INSTANCE.getProcessResult(inputSlot) > 0 && + InsulationRecipes.INSTANCE.getProcessResult(inputSlot) + outputSlot <= 64) { + canWork = true; + } + return canWork; + } + + public void processItem() { + if (this.canProcess()) { + final int result = InsulationRecipes.INSTANCE.getProcessResult(this.inventory[1]); + if (this.inventory[2] == null) { + this.inventory[2] = new ItemStack(ElectricExpansionItems.itemParts, result, 6); + } else if (this.inventory[2].stackSize + result <= 64) { + final ItemStack itemStack = this.inventory[2]; + itemStack.stackSize += result; + } + final ItemStack itemStack2 = this.inventory[1]; + itemStack2.stackSize -= InsulationRecipes.INSTANCE.getInputQTY(this.inventory[1]); + if (this.inventory[1].stackSize <= 0) { + this.inventory[1] = null; + } + } + } + + @Override + public void readFromNBT(final NBTTagCompound par1NBTTagCompound) { + super.readFromNBT(par1NBTTagCompound); + this.processTicks = par1NBTTagCompound.getInteger("processTicks"); + final NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10); + this.inventory = new ItemStack[this.getSizeInventory()]; + try { + this.joulesStored = par1NBTTagCompound.getDouble("joulesStored"); + } catch (final Exception ex) { + } + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + final NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3); + final byte var5 = var4.getByte("Slot"); + if (var5 >= 0 && var5 < this.inventory.length) { + this.inventory[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + } + + @Override + public void writeToNBT(final NBTTagCompound par1NBTTagCompound) { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("processTicks", this.processTicks); + final NBTTagList var2 = new NBTTagList(); + par1NBTTagCompound.setDouble("joulesStored", this.getJoules()); + for (int var3 = 0; var3 < this.inventory.length; ++var3) { + if (this.inventory[var3] != null) { + final NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte) var3); + this.inventory[var3].writeToNBT(var4); + var2.appendTag((NBTBase) var4); + } + } + par1NBTTagCompound.setTag("Items", (NBTBase) var2); + } + + @Override + public int[] getAccessibleSlotsFromSide(int p_94128_1_) { + ForgeDirection side = ForgeDirection.getOrientation(p_94128_1_); + + if (side == ForgeDirection.DOWN || side == ForgeDirection.UP) { + return new int[] { side.ordinal() }; + } + return new int[] { 2 }; + } + + @Override + public int getSizeInventory() { + return this.inventory.length; + } + + @Override + public ItemStack getStackInSlot(final int par1) { + return this.inventory[par1]; + } + + @Override + public ItemStack decrStackSize(final int par1, final int par2) { + if (this.inventory[par1] == null) { + return null; + } + if (this.inventory[par1].stackSize <= par2) { + final ItemStack var3 = this.inventory[par1]; + this.inventory[par1] = null; + return var3; + } + final ItemStack var3 = this.inventory[par1].splitStack(par2); + if (this.inventory[par1].stackSize == 0) { + this.inventory[par1] = null; + } + return var3; + } + + @Override + public ItemStack getStackInSlotOnClosing(final int par1) { + if (this.inventory[par1] != null) { + final ItemStack var2 = this.inventory[par1]; + this.inventory[par1] = null; + return var2; + } + return null; + } + + @Override + public void setInventorySlotContents(final int par1, + final ItemStack par2ItemStack) { + this.inventory[par1] = par2ItemStack; + if (par2ItemStack != null && + par2ItemStack.stackSize > this.getInventoryStackLimit()) { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return StatCollector.translateToLocal("tile.insulator.name"); + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer par1EntityPlayer) { + return this.getWorldObj().getTileEntity(this.xCoord, this.yCoord, + this.zCoord) == this; + } + + @Override + public double getVoltage() { + return 120.0; + } + + public int getProcessingTime() { + if (this.inventory[1] != null && + InsulationRecipes.INSTANCE.getProcessResult(this.inventory[1]) != 0) { + return InsulationRecipes.INSTANCE.getProcessTicks(this.inventory[1]); + } + return -1; + } + + public int getProcessTimeLeft() { + return this.processTicks; + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + return direction.ordinal() == this.getBlockMetadata() + 2; + } + + @Override + public double getJoules() { + return this.joulesStored; + } + + @Override + public void setJoules(final double joules) { + this.joulesStored = joules; + } + + @Override + public double getMaxJoules() { + return TileEntityInsulatingMachine.maxJoules; + } + + @Override + public boolean hasCustomInventoryName() { + return true; + } + + @Override + public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { + return i == 1 && + InsulationRecipes.INSTANCE.getProcessResult(itemstack) >= 1; + } + + static { + TileEntityInsulatingMachine.maxJoules = 150000.0; + } + + @Override + public boolean canInsertItem(int slot, ItemStack item, int side) { + if (!(getAccessibleSlotsFromSide(side)[0] == slot && + this.inventory[side] == null)) + return false; + + switch (slot) { + case 0: + return item.getItem() instanceof IItemElectric; + + case 1: + return true; + + default: + return false; + } + } + + @Override + public boolean canExtractItem(int slot, ItemStack item, int side) { + int slotIdx = getAccessibleSlotsFromSide(side)[0]; + return getAccessibleSlotsFromSide(side)[0] == slot && + this.inventory[slotIdx] != null && + this.inventory[slotIdx].stackSize != 0 && + this.inventory[slotIdx].getItem() == item.getItem(); + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityMultimeter.java b/src/main/java/electricexpansion/common/tile/TileEntityMultimeter.java new file mode 100644 index 0000000..1161203 --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityMultimeter.java @@ -0,0 +1,99 @@ +package electricexpansion.common.tile; + +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.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.block.IConductor; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.implement.IRotatable; +import universalelectricity.prefab.tile.TileEntityElectrical; + +public class TileEntityMultimeter + extends TileEntityElectrical implements IRotatable { + public ElectricityPack electricityReading; + private ElectricityPack lastReading; + + public TileEntityMultimeter() { + this.electricityReading = new ElectricityPack(); + this.lastReading = new ElectricityPack(); + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (super.ticks % 20L == 0L) { + this.lastReading = this.electricityReading; + if (!this.getWorldObj().isRemote) { + if (!this.isDisabled()) { + final ForgeDirection inputDirection = + ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite(); + final TileEntity inputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), inputDirection); + if (inputTile != null) { + if (inputTile instanceof IConductor) { + this.electricityReading = ((IConductor)inputTile) + .getNetwork() + .getProduced(new TileEntity[0]); + final ElectricityPack electricityReading = + this.electricityReading; + electricityReading.amperes *= 20.0; + } else { + this.electricityReading = new ElectricityPack(); + } + } else { + this.electricityReading = new ElectricityPack(); + } + } + if (this.electricityReading.amperes != this.lastReading.amperes) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, + this.zCoord); + } + } + } + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setDouble("amperes", this.electricityReading.amperes); + nbt.setDouble("voltage", this.electricityReading.voltage); + + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, + this.getBlockMetadata(), nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + + this.electricityReading.amperes = nbt.getDouble("amperes"); + this.electricityReading.voltage = nbt.getDouble("voltage"); + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + return direction.getOpposite() == + ForgeDirection.getOrientation(this.getBlockMetadata()); + } + + @Override + public void setDirection(final World world, final int x, final int y, + final int z, final ForgeDirection facingDirection) { + this.getWorldObj().setBlock(this.xCoord, this.yCoord, this.zCoord, + this.getBlockType(), facingDirection.ordinal(), + 2); + } + + @Override + public ForgeDirection getDirection(final IBlockAccess world, final int x, + final int y, final int z) { + return ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z)); + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityQuantumBatteryBox.java b/src/main/java/electricexpansion/common/tile/TileEntityQuantumBatteryBox.java new file mode 100644 index 0000000..ad20caf --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityQuantumBatteryBox.java @@ -0,0 +1,355 @@ +package electricexpansion.common.tile; + +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; +import electricexpansion.api.IWirelessPowerMachine; +import electricexpansion.common.ElectricExpansion; +import electricexpansion.common.helpers.PacketUpdateQuantumBatteryBoxFrequency; +import electricexpansion.common.misc.DistributionNetworks; +import java.util.EnumSet; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +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.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.tile.TileEntityElectricityStorage; + +public class TileEntityQuantumBatteryBox extends TileEntityElectricityStorage + implements IWirelessPowerMachine, IInventory, IPeripheral { + private ItemStack[] containingItems; + private int playersUsing; + private byte frequency; + private double joulesForDisplay; + private String owningPlayer; + + public TileEntityQuantumBatteryBox() { + this.containingItems = new ItemStack[2]; + this.playersUsing = 0; + this.frequency = 0; + this.joulesForDisplay = 0.0; + this.owningPlayer = null; + } + + @Override + public void setPlayer(final EntityPlayer player) { + this.owningPlayer = player.getDisplayName(); + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (!this.isDisabled()) { + final ForgeDirection outputDirection = + ForgeDirection.getOrientation(this.getBlockMetadata() + 2); + final TileEntity outputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), outputDirection); + final TileEntity inputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), outputDirection.getOpposite()); + final IElectricityNetwork inputNetwork = + ElectricityNetworkHelper.getNetworkFromTileEntity( + inputTile, outputDirection.getOpposite()); + final IElectricityNetwork outputNetwork = + ElectricityNetworkHelper.getNetworkFromTileEntity(outputTile, + outputDirection); + if (outputNetwork != null && inputNetwork != outputNetwork) { + final ElectricityPack actualOutput = new ElectricityPack( + Math.min( + outputNetwork.getLowestCurrentCapacity(), + Math.min( + this.getOutputCap(), + outputNetwork.getRequest(new TileEntity[0]).getWatts()) / + this.getVoltage()), + this.getVoltage()); + if (this.getJoules() > 0.0 && actualOutput.getWatts() > 0.0) { + outputNetwork.startProducing(this, actualOutput); + this.setJoules(this.getJoules() - actualOutput.getWatts()); + } else { + outputNetwork.stopProducing(this); + } + } + } + if (!this.getWorldObj().isRemote && super.ticks % 3L == 0L && + this.playersUsing > 0) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + } + + @Override + public ElectricityPack getRequest() { + return new ElectricityPack( + Math.min((this.getMaxJoules() - this.getJoules()) / this.getVoltage(), + this.getOutputCap() / 2.0), + this.getVoltage()); + } + + private double getOutputCap() { return 10000.0; } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + + nbt.setByte("frequency", this.getFrequency()); + nbt.setInteger("disabledTicks", super.disabledTicks); + nbt.setDouble("joules", this.getJoules()); + if (this.owningPlayer != null) + nbt.setString("owningPlayer", this.owningPlayer); + + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, + this.getBlockMetadata(), nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + + this.frequency = nbt.getByte("frequency"); + super.disabledTicks = nbt.getInteger("disabledTicks"); + this.joulesForDisplay = nbt.getDouble("joules"); + if (nbt.hasKey("owningPlayer")) + this.owningPlayer = nbt.getString("owningPlayer"); + } + + @Override + public void openInventory() { + ++this.playersUsing; + } + + @Override + public void closeInventory() { + --this.playersUsing; + } + + @Override + public void readFromNBT(final NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.frequency = nbt.getByte("frequency"); + if (nbt.hasKey("owner")) + this.owningPlayer = nbt.getString("owner"); + } + + @Override + public void writeToNBT(final NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setShort("frequency", (short)this.frequency); + if (this.owningPlayer != null) + nbt.setString("owner", this.owningPlayer); + } + + @Override + public double getJoules() { + return ElectricExpansion.DistributionNetworksInstance.getJoules( + this.owningPlayer, this.frequency); + } + + @Override + public void removeJoules(final double outputWatts) { + ElectricExpansion.DistributionNetworksInstance.removeJoules( + this.owningPlayer, this.frequency, outputWatts); + } + + @Override + public void setJoules(final double joules) { + ElectricExpansion.DistributionNetworksInstance.setJoules( + this.owningPlayer, this.frequency, joules); + } + + @Override + public double getMaxJoules() { + return DistributionNetworks.getMaxJoules(); + } + + public double getJoulesForDisplay(final Object... data) { + return this.joulesForDisplay; + } + + @Override + public int getSizeInventory() { + return this.containingItems.length; + } + + @Override + public ItemStack getStackInSlot(final int par1) { + return this.containingItems[par1]; + } + + @Override + public ItemStack decrStackSize(final int par1, final int par2) { + if (this.containingItems[par1] == null) { + return null; + } + if (this.containingItems[par1].stackSize <= par2) { + final ItemStack var3 = this.containingItems[par1]; + this.containingItems[par1] = null; + return var3; + } + final ItemStack var3 = this.containingItems[par1].splitStack(par2); + if (this.containingItems[par1].stackSize == 0) { + this.containingItems[par1] = null; + } + return var3; + } + + @Override + public ItemStack getStackInSlotOnClosing(final int par1) { + if (this.containingItems[par1] != null) { + final ItemStack var2 = this.containingItems[par1]; + this.containingItems[par1] = null; + return var2; + } + return null; + } + + @Override + public void setInventorySlotContents(final int par1, + final ItemStack par2ItemStack) { + this.containingItems[par1] = par2ItemStack; + if (par2ItemStack != null && + par2ItemStack.stackSize > this.getInventoryStackLimit()) { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return "tile.Distribution.name"; + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer par1EntityPlayer) { + return this.getWorldObj().getTileEntity(this.xCoord, this.yCoord, + this.zCoord) == this && + par1EntityPlayer.getDistanceSq(this.xCoord + 0.5, this.yCoord + 0.5, + this.zCoord + 0.5) <= 64.0; + } + + @Override + public byte getFrequency() { + return this.frequency; + } + + @Override + public void setFrequency(final byte newFrequency) { + this.frequency = newFrequency; + if (this.getWorldObj().isRemote) { + ElectricExpansion.channel.sendToServer( + new PacketUpdateQuantumBatteryBoxFrequency(new Vector3(this), + newFrequency)); + } + } + + public void setFrequency(final int frequency) { + this.setFrequency((byte)frequency); + } + + public void setFrequency(final short frequency) { + this.setFrequency((byte)frequency); + } + + private int setFrequency(final Object frequency) { + if (frequency instanceof Double) { + final Double freq = (Double)frequency; + this.setFrequency((int)Math.floor(freq)); + } + return this.frequency; + } + + public String getOwningPlayer() { return this.owningPlayer; } + + @Override + public String getType() { + return this.getInventoryName().replaceAll(" ", ""); + } + + @Override + public String[] getMethodNames() { + return new String[] {"getVoltage", "isFull", "getJoules", + "getFrequency", "setFrequency", "getPlayer"}; + } + + @Override + public void attach(final IComputerAccess computer) {} + + @Override + public void detach(final IComputerAccess computer) {} + + @Override + public Object[] callMethod(final IComputerAccess computer, ILuaContext lctx, + final int method, final Object[] arguments) + throws LuaException { + if (this.isDisabled()) { + throw new LuaException("Please wait for the EMP to run out."); + } + switch (method) { + case 0: { + return new Object[] {this.getVoltage()}; + } + case 1: { + return new Object[] {this.getJoules() >= this.getMaxJoules()}; + } + case 2: { + return new Object[] {this.getJoules()}; + } + case 3: { + return new Object[] {this.getFrequency()}; + } + case 4: { + return new Object[] { + (arguments.length == 1) + ? Integer.valueOf(this.setFrequency(arguments[0])) + : "Expected args for this function is 1. You have provided %s." + .replace("%s", arguments.length + "")}; + } + case 5: { + return new Object[] {this.getOwningPlayer()}; + } + default: { + throw new LuaException("Function unimplemented"); + } + } + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + return direction == + ForgeDirection.getOrientation(this.getBlockMetadata() + 2) || + direction == ForgeDirection.getOrientation(this.getBlockMetadata() + 2) + .getOpposite(); + } + + @Override + protected EnumSet getConsumingSides() { + return EnumSet.of(ForgeDirection.getOrientation(this.getBlockMetadata() + 2) + .getOpposite()); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { + return false; + } + + @Override + public boolean equals(IPeripheral other) { + return this == other; + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityRedstoneNetworkCore.java b/src/main/java/electricexpansion/common/tile/TileEntityRedstoneNetworkCore.java new file mode 100644 index 0000000..61f88b1 --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityRedstoneNetworkCore.java @@ -0,0 +1,72 @@ +package electricexpansion.common.tile; + +import electricexpansion.api.IRedstoneNetAccessor; +import electricexpansion.common.misc.EENetwork; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.block.INetworkProvider; +import universalelectricity.core.electricity.ElectricityNetwork; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.prefab.tile.TileEntityElectrical; + +public class TileEntityRedstoneNetworkCore + extends TileEntityElectrical implements INetworkProvider { + private EENetwork network; + + public boolean canUpdate() { + return true; + } + + @Override + public void updateEntity() { + if (super.ticks % 5L == 0L) { + if (this.network != null) { + final int netRs = this.network.rsLevel; + for (final IRedstoneNetAccessor rsCable : this.network.getRedstoneInterfacers()) { + final int worldRs = rsCable.getRsSignalFromBlock(); + this.network.rsLevel = (byte) Math.max(netRs, worldRs); + } + } else { + final ForgeDirection facing = ForgeDirection.getOrientation(this.blockMetadata); + if (this.getWorldObj().getTileEntity(this.xCoord + facing.offsetX, + this.yCoord + facing.offsetY, + this.zCoord + facing.offsetZ) instanceof INetworkProvider && + ((INetworkProvider) this.worldObj.getTileEntity( + this.xCoord + facing.offsetX, this.yCoord + facing.offsetY, + this.zCoord + facing.offsetZ)) + .getNetwork() != null) { + this.setNetwork( + ((INetworkProvider) this.getWorldObj().getTileEntity( + this.xCoord + facing.offsetX, this.yCoord + facing.offsetY, + this.zCoord + facing.offsetZ)) + .getNetwork()); + } + } + } + if (super.ticks % 300L == 0L && this.network != null) { + this.network.cleanUpConductors(); + } + } + + @Override + public IElectricityNetwork getNetwork() { + return this.network; + } + + @Override + public void setNetwork(final IElectricityNetwork network) { + if (network instanceof EENetwork && + ((EENetwork) network).coreProcessor == null) { + this.network = (EENetwork) network; + ((EENetwork) network).coreProcessor = this; + this.network.cleanUpConductors(); + } else if (network instanceof ElectricityNetwork) { + this.network = new EENetwork(network); + this.network.coreProcessor = this; + } + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + return direction.ordinal() == this.getBlockMetadata(); + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityTransformer.java b/src/main/java/electricexpansion/common/tile/TileEntityTransformer.java new file mode 100644 index 0000000..2266638 --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityTransformer.java @@ -0,0 +1,148 @@ +package electricexpansion.common.tile; + +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.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import universalelectricity.core.electricity.ElectricityNetworkHelper; +import universalelectricity.core.electricity.ElectricityPack; +import universalelectricity.core.electricity.IElectricityNetwork; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.implement.IRotatable; +import universalelectricity.prefab.tile.TileEntityElectrical; + +public class TileEntityTransformer + extends TileEntityElectrical implements IRotatable { + public boolean stepUp; + public int type; + + public TileEntityTransformer() { + this.stepUp = false; + } + + @Override + public void initiate() { + final int meta = this.getWorldObj().getBlockMetadata( + this.xCoord, this.yCoord, this.zCoord); + this.type = meta - (meta & 0x3); + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (!this.getWorldObj().isRemote) { + final ForgeDirection inputDirection = ForgeDirection.getOrientation(this.getBlockMetadata() - this.type + 2) + .getOpposite(); + final TileEntity inputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), inputDirection); + final ForgeDirection outputDirection = ForgeDirection.getOrientation( + this.getBlockMetadata() - this.type + 2); + final TileEntity outputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), outputDirection); + final IElectricityNetwork inputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity( + inputTile, outputDirection.getOpposite()); + final IElectricityNetwork outputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity(outputTile, + outputDirection); + if (outputNetwork != null && inputNetwork == null) { + outputNetwork.stopProducing(this); + } else if (outputNetwork == null && inputNetwork != null) { + inputNetwork.stopRequesting(this); + } + if (outputNetwork != null && inputNetwork != null) { + if (outputNetwork != inputNetwork) { + if (outputNetwork.getRequest(new TileEntity[0]).getWatts() > 0.0) { + inputNetwork.startRequesting( + this, outputNetwork.getRequest(new TileEntity[0])); + final ElectricityPack actualEnergy = inputNetwork.consumeElectricity(this); + if (actualEnergy.getWatts() > 0.0) { + double typeChange = 0.0; + if (this.type == 0) { + typeChange = 2.0; + } else if (this.type == 4) { + typeChange = 4.0; + } else if (this.type == 8) { + typeChange = 8.0; + } + double newVoltage = actualEnergy.voltage * typeChange; + if (!this.stepUp) { + newVoltage = actualEnergy.voltage / typeChange; + } + outputNetwork.startProducing( + this, actualEnergy.getWatts() / newVoltage, newVoltage); + } else { + outputNetwork.stopProducing(this); + } + } else { + inputNetwork.stopRequesting(this); + outputNetwork.stopProducing(this); + } + } else { + inputNetwork.stopRequesting(this); + outputNetwork.stopProducing(this); + } + } + } + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + + nbt.setBoolean("stepUp", this.stepUp); + nbt.setInteger("type", this.type); + + System.out.println("get description packet; stepUp: " + this.stepUp); + + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, + this.getBlockMetadata(), nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + + this.stepUp = nbt.getBoolean("stepUp"); + this.type = nbt.getInteger("type"); + } + + @Override + public void readFromNBT(final NBTTagCompound par1NBTTagCompound) { + super.readFromNBT(par1NBTTagCompound); + this.stepUp = par1NBTTagCompound.getBoolean("stepUp"); + this.type = par1NBTTagCompound.getInteger("type"); + } + + @Override + public void writeToNBT(final NBTTagCompound par1NBTTagCompound) { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("stepUp", this.stepUp); + par1NBTTagCompound.setInteger("type", this.type); + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + final int meta = this.getWorldObj().getBlockMetadata( + this.xCoord, this.yCoord, this.zCoord); + return direction.ordinal() - 2 + this.type == meta || + direction.getOpposite().ordinal() - 2 + this.type == meta; + } + + @Override + public void setDirection(final World world, final int x, final int y, + final int z, final ForgeDirection facingDirection) { + this.getWorldObj().setBlock(this.xCoord, this.yCoord, this.zCoord, + this.getBlockType(), + facingDirection.ordinal() - 2 + this.type, 0); + } + + @Override + public ForgeDirection getDirection(final IBlockAccess world, final int x, + final int y, final int z) { + return ForgeDirection.getOrientation(this.getBlockMetadata() - this.type); + } +} diff --git a/src/main/java/electricexpansion/common/tile/TileEntityWireMill.java b/src/main/java/electricexpansion/common/tile/TileEntityWireMill.java new file mode 100644 index 0000000..b2145a3 --- /dev/null +++ b/src/main/java/electricexpansion/common/tile/TileEntityWireMill.java @@ -0,0 +1,392 @@ +package electricexpansion.common.tile; + +import electricexpansion.common.misc.WireMillRecipes; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +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.core.electricity.IElectricityNetwork; +import universalelectricity.core.item.IItemElectric; +import universalelectricity.core.vector.Vector3; +import universalelectricity.core.vector.VectorHelper; +import universalelectricity.prefab.tile.TileEntityElectricityRunnable; + +public class TileEntityWireMill extends TileEntityElectricityRunnable + implements ISidedInventory, IElectricityStorage { + public static final double WATTS_PER_TICK = 500.0; + public static final double TRANSFER_LIMIT = 1250.0; + private int drawingTicks; + private double joulesStored; + public static double maxJoules; + private ItemStack[] inventory; + private int playersUsing; + public int orientation; + private Item targetItem; + private int targetMeta; + + public TileEntityWireMill() { + this.drawingTicks = 0; + this.joulesStored = 0.0; + this.inventory = new ItemStack[3]; + this.playersUsing = 0; + this.targetItem = Item.getItemFromBlock(Blocks.air); + this.targetMeta = 0; + } + + @Override + public void updateEntity() { + // TODO: WTF + // super.updateEntity(); + if (!this.getWorldObj().isRemote) { + final ForgeDirection inputDirection = ForgeDirection.getOrientation(this.getBlockMetadata() + 2); + final TileEntity inputTile = VectorHelper.getTileEntityFromSide( + this.getWorldObj(), new Vector3(this), inputDirection); + final IElectricityNetwork inputNetwork = ElectricityNetworkHelper.getNetworkFromTileEntity( + inputTile, inputDirection.getOpposite()); + if (inputNetwork != null) { + if (this.joulesStored < TileEntityWireMill.maxJoules) { + inputNetwork.startRequesting( + this, + Math.min(this.getMaxJoules() - this.getJoules(), 1250.0) / + this.getVoltage(), + this.getVoltage()); + final ElectricityPack electricityPack = inputNetwork.consumeElectricity(this); + this.setJoules(this.joulesStored + electricityPack.getWatts()); + if (UniversalElectricity.isVoltageSensitive && + electricityPack.voltage > this.getVoltage()) { + this.getWorldObj().createExplosion( + (Entity) null, (double) this.xCoord, (double) this.yCoord, + (double) this.zCoord, 2.0f, true); + } + } else { + inputNetwork.stopRequesting(this); + } + } + } + if (this.inventory[0] != null && this.joulesStored < this.getMaxJoules()) { + if (this.inventory[0].getItem() instanceof IItemElectric) { + final IItemElectric electricItem = (IItemElectric) this.inventory[0].getItem(); + if (electricItem.getProvideRequest(this.inventory[0]).getWatts() > 0.0) { + final double joulesReceived = electricItem + .onProvide(ElectricityPack.getFromWatts( + Math.max(electricItem.getMaxJoules( + this.inventory[0]) * + 0.005, + 1250.0), + electricItem.getVoltage(this.inventory[0])), + this.inventory[0]) + .getWatts(); + this.setJoules(this.joulesStored + joulesReceived); + } + } + } + if (this.joulesStored >= 500.0 - 50.0 && !this.isDisabled()) { + if (this.inventory[1] != null && this.canDraw() && + (this.drawingTicks == 0 || + this.targetItem != this.inventory[1].getItem() || + this.targetMeta != this.inventory[1].getItemDamage())) { + this.targetItem = this.inventory[1].getItem(); + this.targetMeta = this.inventory[1].getItemDamage(); + this.drawingTicks = this.getDrawingTime(); + } + if (this.canDraw() && this.drawingTicks > 0) { + --this.drawingTicks; + if (this.drawingTicks < 1) { + this.drawItem(); + this.drawingTicks = 0; + } + this.joulesStored -= 500.0; + } else { + this.drawingTicks = 0; + } + } + if (!this.getWorldObj().isRemote && super.ticks % 3L == 0L && + this.playersUsing > 0) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + this.joulesStored = Math.min(this.joulesStored, this.getMaxJoules()); + this.joulesStored = Math.max(this.joulesStored, 0.0); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + + nbt.setInteger("drawingTicks", this.drawingTicks); + nbt.setInteger("disabledTicks", super.disabledTicks); + nbt.setDouble("joulesStored", this.joulesStored); + + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, + this.getBlockMetadata(), nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + + this.drawingTicks = nbt.getInteger("drawingTicks"); + super.disabledTicks = nbt.getInteger("disabledTicks"); + this.joulesStored = nbt.getDouble("joulesStored"); + } + + @Override + public void openInventory() { + if (!this.getWorldObj().isRemote) { + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + } + ++this.playersUsing; + } + + @Override + public void closeInventory() { + --this.playersUsing; + } + + public boolean canDraw() { + boolean canWork = false; + final ItemStack inputSlot = this.inventory[1]; + final ItemStack outputSlot = this.inventory[2]; + if (inputSlot != null) { + if (WireMillRecipes.INSTANCE.getDrawingResult(inputSlot) == null) { + canWork = false; + } else if (WireMillRecipes.INSTANCE.getDrawingResult(inputSlot) != null && + outputSlot == null) { + canWork = true; + } else if (outputSlot != null) { + final String result = WireMillRecipes.stackSizeToOne( + WireMillRecipes.INSTANCE.getDrawingResult(inputSlot)) + + ""; + final String output2 = WireMillRecipes.stackSizeToOne(outputSlot) + ""; + final int maxSpaceForSuccess = Math.min(outputSlot.getMaxStackSize(), + inputSlot.getMaxStackSize()) - + WireMillRecipes.INSTANCE.getDrawingResult(inputSlot).stackSize; + if (result.equals(output2) && + outputSlot.stackSize > maxSpaceForSuccess) { + canWork = false; + } else if (result.equals(output2) && + outputSlot.stackSize <= maxSpaceForSuccess) { + canWork = true; + } + } + } + return canWork; + } + + public void drawItem() { + if (this.canDraw()) { + final ItemStack resultItemStack = WireMillRecipes.INSTANCE.getDrawingResult(this.inventory[1]); + if (this.inventory[2] == null) { + this.inventory[2] = resultItemStack.copy(); + } else if (this.inventory[2].isItemEqual(resultItemStack)) { + this.inventory[2].stackSize += resultItemStack.stackSize; + } + this.inventory[1].stackSize -= WireMillRecipes.INSTANCE.getInputQTY(this.inventory[1]); + if (this.inventory[1].stackSize <= 0) { + this.inventory[1] = null; + } + } + } + + @Override + public void readFromNBT(final NBTTagCompound par1NBTTagCompound) { + super.readFromNBT(par1NBTTagCompound); + this.drawingTicks = par1NBTTagCompound.getInteger("drawingTicks"); + this.inventory = new ItemStack[this.getSizeInventory()]; + try { + this.joulesStored = par1NBTTagCompound.getDouble("joulesStored"); + } catch (final Exception ex) { + } + final NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10); + for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + final NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3); + final byte var5 = var4.getByte("Slot"); + if (var5 >= 0 && var5 < this.inventory.length) { + this.inventory[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + } + + @Override + public void writeToNBT(final NBTTagCompound par1NBTTagCompound) { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("drawingTicks", this.drawingTicks); + par1NBTTagCompound.setDouble("joulesStored", this.getJoules()); + final NBTTagList var2 = new NBTTagList(); + for (int var3 = 0; var3 < this.inventory.length; ++var3) { + if (this.inventory[var3] != null) { + final NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte) var3); + this.inventory[var3].writeToNBT(var4); + var2.appendTag((NBTBase) var4); + } + } + par1NBTTagCompound.setTag("Items", (NBTBase) var2); + } + + @Override + public int[] getAccessibleSlotsFromSide(int p_94128_1_) { + ForgeDirection side = ForgeDirection.getOrientation(p_94128_1_); + + if (side == ForgeDirection.DOWN || side == ForgeDirection.UP) { + return new int[] { side.ordinal() }; + } + return new int[] { 2 }; + } + + @Override + public int getSizeInventory() { + return this.inventory.length; + } + + @Override + public ItemStack getStackInSlot(final int par1) { + return this.inventory[par1]; + } + + @Override + public ItemStack decrStackSize(final int par1, final int par2) { + if (this.inventory[par1] == null) { + return null; + } + if (this.inventory[par1].stackSize <= par2) { + final ItemStack var3 = this.inventory[par1]; + this.inventory[par1] = null; + return var3; + } + final ItemStack var3 = this.inventory[par1].splitStack(par2); + if (this.inventory[par1].stackSize == 0) { + this.inventory[par1] = null; + } + return var3; + } + + @Override + public ItemStack getStackInSlotOnClosing(final int par1) { + if (this.inventory[par1] != null) { + final ItemStack var2 = this.inventory[par1]; + this.inventory[par1] = null; + return var2; + } + return null; + } + + @Override + public void setInventorySlotContents(final int par1, + final ItemStack par2ItemStack) { + this.inventory[par1] = par2ItemStack; + if (par2ItemStack != null && + par2ItemStack.stackSize > this.getInventoryStackLimit()) { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return "tile.wiremill.name"; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(final EntityPlayer par1EntityPlayer) { + return this.getWorldObj().getTileEntity(this.xCoord, this.yCoord, + this.zCoord) == this && + par1EntityPlayer.getDistanceSq(this.xCoord + 0.5, this.yCoord + 0.5, + this.zCoord + 0.5) <= 64.0; + } + + @Override + public double getVoltage() { + return 120.0; + } + + public int getDrawingTime() { + if (this.inventory[1] != null && + WireMillRecipes.INSTANCE.getDrawingResult(this.inventory[1]) != null) { + return WireMillRecipes.INSTANCE.getDrawingTicks(this.inventory[1]); + } + return -1; + } + + public int getDrawingTimeLeft() { + return this.drawingTicks; + } + + @Override + public double getJoules() { + return this.joulesStored; + } + + @Override + public void setJoules(final double joules) { + this.joulesStored = joules; + } + + @Override + public double getMaxJoules() { + return TileEntityWireMill.maxJoules; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public boolean isItemValidForSlot(final int i, final ItemStack itemstack) { + return false; + } + + static { + TileEntityWireMill.maxJoules = 150000.0; + } + + @Override + public boolean canConnect(final ForgeDirection direction) { + return direction.ordinal() == this.getBlockMetadata() + 2; + } + + @Override + public boolean canInsertItem(int slot, ItemStack item, int side) { + if (!(getAccessibleSlotsFromSide(side)[0] == slot && + this.inventory[side] == null)) + return false; + + switch (slot) { + case 0: + return item.getItem() instanceof IItemElectric; + + case 1: + return true; + + default: + return false; + } + } + + @Override + public boolean canExtractItem(int slot, ItemStack item, int side) { + int slotIdx = getAccessibleSlotsFromSide(side)[0]; + return getAccessibleSlotsFromSide(side)[0] == slot && + this.inventory[slotIdx] != null && + this.inventory[slotIdx].stackSize != 0 && + this.inventory[slotIdx].getItem() == item.getItem(); + } +} diff --git a/src/main/resources/EELogo.png b/src/main/resources/EELogo.png new file mode 100644 index 0000000000000000000000000000000000000000..0034c6b073e83ecdfff9ea5814576ab3d9e11f6c GIT binary patch literal 13152 zcmb7rRZtvE(Cxwki@UqKTX1)m;10pvo!}NE!Gi^NcW3e7t^tC(yDm51|G(e5_hIy5 zs%NTus!pFiF={HZD2RlJ0000*UQS8_0DxluHy4M8``2sVJW>4{pxiZNB>**3#K->@ zFxKMA;s8K>BGQ`~?7uaFi=3W20DwC1UxONPF8lItlh8w2*F)3U%EQ~t%@UwyX6xj^ zsv`ZF+>48qhn0h!{mv~P0N|XKmlFT%V|;D|(#6$T%B`KLgr_7C?~}k`rjJI{tuq7F zKjuZR{E?B0r(LZYby8C0=HPgq=blww94w2`(_G-*wKG4XVWig{^Zt0uN$i7yBEmPa z&ON;1;A)-x=|7!)o9lj=N_{@Vm**g!Fs?N{Bb-8}B5ijIzI*G2{d7Pu(P&Tn#smx=NDTqd6(?~PwC*A_`w<`x4gn=pC) z$4E6;(4Zt5|9K`qm*shztBLCItfW+U)VD}4uYU0)R|et~19 zF)^x+c55ED!&_T+wvuWy2Y3Mi+Sxyfu!|4AEiEya3=a1|)WyIDL)zMs5!9>eLI3RI zMtvJ1W@pi@bD63$I}BLgh=}MTPogd#luv3gP?!@aq!tc4n1n%r^Mo4;)ekKYuNJ?~ zyTC^%{C+52^tGd#I`B4Fh3-r}t+dg7bm9B=xB2{hHmaQJlAMjT@yNPk(XUsgvlUuQ z+h=FY#KgoEG_ta?W`GY_1HRtrrqO;uPISTt$*nW=)bd zLzld`e-F#Vxp?v@Kiv3P7FOC*URWU8j>NkFLWg$-zN2fNE>&CROZmd2Y6p*MVH#&Y zMN#7%ZtsR6R~tLb%Y=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W_mQsIRT$5DsY-24$KnfRpO7D<2)F-!T$x1u+h~pN<@K-%_6mIbHo3i7UcgX gA8~Ofe)^jA(*!&9WSRV*00tm0ts+$;VH)~>0LtoG6951J literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/lang/en_US.properties b/src/main/resources/assets/electricexpansion/lang/en_US.properties new file mode 100644 index 0000000..40014b8 --- /dev/null +++ b/src/main/resources/assets/electricexpansion/lang/en_US.properties @@ -0,0 +1,131 @@ +# Electric Expansion Language Properties +# @author Alex_Hawks, and Mattredsox + +death.attack.electrocution=%s was Electrocuted + +# Uninsulated Cable Names +tile.RawWire.Copper.name=Uninsulated Copper Wire +tile.RawWire.Tin.name=Uninsulated Tin Wire +tile.RawWire.Silver.name=Uninsulated Silver Wire +tile.RawWire.Aluminum.name=Uninsulated HV Wire +tile.RawWire.Superconductor.name=Uninsulated Superconductor + +# Insulated Cable Names +tile.InsulatedWire.Copper.name=Insulated Copper Wire +tile.InsulatedWire.Tin.name=Insulated Tin Wire +tile.InsulatedWire.Silver.name=Insulated Silver Wire +tile.InsulatedWire.Aluminum.name=Insulated HV Wire +tile.InsulatedWire.Superconductor.name=Insulated Superconductor + +# Hidden Wire Names +tile.HiddenWire.Copper.name=Hidden Copper Wire +tile.HiddenWire.Tin.name=Hidden Tin Wire +tile.HiddenWire.Silver.name=Hidden Silver Wire +tile.HiddenWire.Aluminum.name=Hidden HV Wire +tile.HiddenWire.Superconductor.name=Hidden Superconductor + +# Switch Wire Names +tile.SwitchWire.Copper.name=Copper Switch Wire +tile.SwitchWire.Tin.name=Tin Switch Wire +tile.SwitchWire.Silver.name=Silver Switch Wire +tile.SwitchWire.Aluminum.name=HV Switch Wire +tile.SwitchWire.Superconductor.name=Superconductor Switch + +# Hidden Switch Wire Names +tile.SwitchWireBlock.Copper.name=Hidden Copper Switch Wire +tile.SwitchWireBlock.Tin.name=Hidden Tin Switch Wire +tile.SwitchWireBlock.Silver.name=Hidden Silver Switch Wire +tile.SwitchWireBlock.Aluminum.name=Hidden HV Switch Wire +tile.SwitchWireBlock.Superconductor.name=Hidden Superconductor Switch + +# Logistics Wire Names +tile.LogisticsWire.Copper.name=Copper Logistics Wire +tile.LogisticsWire.Tin.name=Tin Logistics Wire +tile.LogisticsWire.Silver.name=Silver Logistics Wire +tile.LogisticsWire.Aluminum.name=HV Logistics Wire +tile.LogisticsWire.Superconductor.name=Logistics Superconductor + +# Redstone Wire Names +tile.RedstonePaintedWire.Copper.name=Redstone Painted Copper Wire +tile.RedstonePaintedWire.Tin.name=Redstone Painted Tin Wire +tile.RedstonePaintedWire.Silver.name=Redstone Painted Silver Wire +tile.RedstonePaintedWire.Aluminum.name=Redstone Painted HV Wire +tile.RedstonePaintedWire.Superconductor.name=Redstone Painted Superconductor + +# Machines +tile.advbatbox.name=Advanced Battery Box +tile.multimeter.name=Multimeter +tile.wiremill.name=Wire Mill +tile.transformer.2x.name=2x Transformer +tile.transformer.4x.name=4x Transformer +tile.transformer.8x.name=8x Transformer +tile.Distribution.name=Quantum Battery Box +tile.FuseBox.name=Fuse Box +tile.insulator.name=Insulation Refiner +tile.RsNetCore.name=Redstone Processing Core + +# Tools, etc... +item.AdvancedBattery.name=Advanced Battery +item.EliteBattery.name=Elite Battery +item.UltimateBattery.name=Ultimate Battery +item.Multimeter.name=Handheld Multimeter + +# Upgrades +item.Upgrade.Storage1.name=Basic Storage Upgrade +item.Upgrade.Storage2.name=Advanced Storage Upgrade +item.Upgrade.Storage3.name=Elite Storage Upgrade +item.Upgrade.Storage4.name=Ultimate Storage Upgrade +item.Upgrade.HalfVoltage.name=Down Transformer Upgrade +item.Upgrade.HVUpgrade.name=HV Upgrade +item.Upgrade.HVInputUpgrade.name=HV Acceptor Upgrade +item.Upgrade.DoubleVoltage.name=Up Transformer Upgrade +item.Upgrade.Unlimiter1.name=Tier 1 Unlimiter +item.Upgrade.Unlimiter2.name=Tier 2 Unlimiter +item.Upgrade.Unlimiter3.name=Tier 3 Unlimiter +item.Upgrade.Unlimiter4.name=Tier 4 Unlimiter + +# Resources +item.Parts.DrawPlates.name=Draw Plates +item.Parts.CondensedElectrumDust.name=Electrum Dust +item.Parts.ElectrumIngot.name=Electrum Ingot +item.Parts.RawHVAlloy.name=High Voltage Alloy Dust +item.Parts.HVAlloyIngot.name=High Voltage Alloy Ingot +item.Parts.CamoPaste.name=Camouflage Paste +item.Parts.Insulation.name=Insulation +item.Parts.LeadIngot.name=Lead Ingot +item.Parts.Coil.name=Coil +item.Parts.SilverIngot.name=Silver Ingot +item.Parts.Unknown.name=Unknown Item + +tile.LeadBlock.name=Lead Block +tile.SilverOre.name=Silver Ore + +# Fuses +item.fuse.+cb.30.name=30v Circuit Breaker (Good) +item.fuse.-cb.30.name=30v Circuit Breaker (Tripped) +item.fuse.+cb.60.name=60v Circuit Breaker (Good) +item.fuse.-cb.60.name=60v Circuit Breaker (Tripped) +item.fuse.+cb.120.name=120v Circuit Breaker (Good) +item.fuse.-cb.120.name=120v Circuit Breaker (Tripped) +item.fuse.+cb.240.name=240v Circuit Breaker (Good) +item.fuse.-cb.240.name=240v Circuit Breaker (Tripped) +item.fuse.+cb.480.name=480v Circuit Breaker (Good) +item.fuse.-cb.480.name=480v Circuit Breaker (Tripped) +item.fuse.+f.30.name=30v Fuse (Good) +item.fuse.-f.30.name=30v Fuse (Blown) +item.fuse.+f.60.name=60v Fuse (Good) +item.fuse.-f.60.name=60v Fuse (Blown) +item.fuse.+f.120.name=120v Fuse (Good) +item.fuse.-f.120.name=120v Fuse (Blown) +item.fuse.+f.240.name=240v Fuse (Good) +item.fuse.-f.240.name=240v Fuse (Blown) +item.fuse.+f.480.name=480v Fuse (Good) +item.fuse.-f.480.name=480v Fuse (Blown) + +# Misc. +container.voltage=Voltage +upgrades.description.Capacity=Increases energy storage capacity by <> +upgrades.description.VoltageModifier=Multiplies machine voltage by <> +upgrades.description.InputVoltageModifier=Multiplies input voltage by <> +upgrades.description.Unlimiter=Increases output wattage by <>% +upgrades.description.Unknown=THIS UPGRADE HAS AN INVALID METADATA! BUG! diff --git a/src/main/resources/assets/electricexpansion/lang/pl_PL.properties b/src/main/resources/assets/electricexpansion/lang/pl_PL.properties new file mode 100644 index 0000000..b3c6530 --- /dev/null +++ b/src/main/resources/assets/electricexpansion/lang/pl_PL.properties @@ -0,0 +1,83 @@ +# Plik jezykowy Electric Expansion +# @author unekpl + +# Uninsulated Cable Names +tile.RawWire.Copper.name=Nieizolowany miedziany kabel +tile.RawWire.Tin.name=Nieizolowany cynowy kabel +tile.RawWire.Silver.name=Nieizolowany srebrny kabel +tile.RawWire.Aluminum.name=Nieizolowany kabel wysokiego napiecia +tile.RawWire.Superconductor.name=Nieizolowany nadprzewodnik + +# Insulated Cable Names +tile.InsulatedWire.Copper.name=Izolowany miedziany kabel +tile.InsulatedWire.Tin.name=Izolowany cynowy kabel +tile.InsulatedWire.Silver.name=Izolowany srebrny kabel +tile.InsulatedWire.Aluminum.name=Izolowany kabel wysokiego napiecia +tile.InsulatedWire.Superconductor.name=Izolowany nadprzewodnik + +# Hidden Wire Names (Mattredsox mówil, ze usunie ukryte kable) +tile.HiddenWire.Copper.name=Hidden Copper Wire +tile.HiddenWire.Tin.name=Hidden Tin Wire +tile.HiddenWire.Silver.name=Hidden Silver Wire +tile.HiddenWire.Aluminum.name=Hidden HV Wire +tile.HiddenWire.Superconductor.name=Hidden Superconductor + +# Switch Wire Names +tile.SwitchWire.Copper.name=Miedziany przelaczany kabel +tile.SwitchWire.Tin.name=Cynowy przelaczany kabel +tile.SwitchWire.Silver.name=Srebrny przelaczany kabel +tile.SwitchWire.Aluminum.name=Przelaczany kabel wysokiego napiecia +tile.SwitchWire.Superconductor.name=Przelaczany nadprzewodnik + +# Hidden Switch Wire Names (Mattredsox mówil, ze usunie ukryte kable) +tile.SwitchWireBlock.Copper.name=Hidden Copper Switch Wire +tile.SwitchWireBlock.Tin.name=Hidden Tin Switch Wire +tile.SwitchWireBlock.Silver.name=Hidden Silver Switch Wire +tile.SwitchWireBlock.Aluminum.name=Hidden HV Switch Wire +tile.SwitchWireBlock.Superconductor.name=Hidden Superconductor Switch + +# Logistics Wire Names +tile.LogisticsWire.Copper.name=Miedziany detektor +tile.LogisticsWire.Tin.name=Cynowy detektor +tile.LogisticsWire.Silver.name=Srebrny detektor +tile.LogisticsWire.Aluminum.name=Detektor wysokiego napiecia +tile.LogisticsWire.Superconductor.name=Nadprzewodniczy detektor + +# Machines +tile.advbatbox.name=Zaawansowany akumulator +tile.multimeter.name=Miernik +tile.wiremill.name=Skrecarka kabli +tile.transformer.60v.name=Transformator 60 wolt +tile.transformer.120v.name=Transformator 120 wolt +tile.transformer.240v.name=Transformator 240 wolt +tile.Distribution.name=Akumulator kwantowy +item.itemMultimeter.name=Kieszonkowy miernik + +# Upgrades (HV Upgrade - z aku wychodzi HV, HVInputUpgrade - wchodzi maks. HV) +item.Upgrade.Storage1.name=Ulepszenie akumulatora +item.Upgrade.Storage2.name=Wyzsze ulepszenie akumulatora +item.Upgrade.Storage3.name=Zaawansowane ulepszenie akumulatora +item.Upgrade.Storage4.name=Najwyzsze ulepszenie akumulatora +item.Upgrade.HalfVoltage.name=Ulepszenie obnizenia wyjsciowego napiecia +item.Upgrade.HVUpgrade.name=Ulepszenie wyjscia wysokiego napiecia +item.Upgrade.HVInputUpgrade.name=Ulepszenie akceptacji wysokiego napiecia + +# Resources (obsada ciagadla - plytka do zwezania kabli (ciagnienia drutu).) +item.LeadIngot.name=Sztabka olowiu +item.AdvancedBattery.name=Wyzsze ogniwo +item.EliteBattery.name=Zaawansowane ogniwo +item.UltimateBattery.name=Najwyzsze ogniwo +item.Parts.DrawPlates.name=Obsada ciagadla +item.Parts.RawSuperConductorAlloy.name=Pyl stopu nadprzewodniczego +item.Parts.SuperConductorAlloyIngot.name=Sztabka stopu nadprzewodniczego +item.Parts.GoldPlate.name=Pozlacanie +item.LeadGear.name=Olowiana przekladnia +tile.LeadBlock.name=Blok olowiu +item.coil.name=Uzwojenie +tile.silverore.name=Ruda srebra +item.silveringot.name=Sztabka srebra +item.infinitebattery.name=Nieskonczona bateria + + + +# Insulator machine would be: Izolator przewodów diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/CamoWire.png b/src/main/resources/assets/electricexpansion/textures/blocks/CamoWire.png new file mode 100644 index 0000000000000000000000000000000000000000..879dbae32c693448cc16c2156113e9aa6d5ed00d GIT binary patch literal 2088 zcmV+@2-o+CP)WFU8GbZ8()Nlj2>E@cM*00)doL_t(o!!4KDl_aqZ z1Oo@j>fV(r^53x8=_(S3K3X2&;USQb!hiqUui4!9rsF~^7#OLAJxxrdX>>xSG6dqI zOg*F)F&CDFNudW?gyW9zkUE)nAeZta3{!}rj}ha+xbU?%nHQ!n!i$M=1Ud?R8`gr{ zPHU18h)rHIdCEwE^(g&n(jBr8g{z8Bf|8uo(83r^MU_4bAS)h zP2~Xr8_g``c+&wEFCvl%*nB8+&e@#5MrSf?p~o3jbQju&wL@M=3H_UB6rBV43`7i- zpw-ZP3W-IU66yp=U5hOn$qN?v`>?!_fNp12QGWz`ib!KW55t6(7epi8v;^r&{cY3+ zNl^|mo3^Ip53?IBG1?1Bn3`b5>Vw$g>cUHiY$}{VgE^Uj1w?PC0c{+VkPkYV51K6;orEN6MscI3IaY`!(gRgv^hPO=WW54_ z7)Ff2iKKGy{CzVYh#i;}+b%Z2tR^+Nw;_>)CH-5JIhs1LELIIn1sO&AK=*(Wo)#*L zXEfvAL2UA*ev!)Lx({N-Sc&aJPC%f#`4b8%942Ol)uJ9@RAP2vVL0a|#Na-}W$=4p zvN`KuA>=CjEb6zoFQ=toD{Vq)Q5J|yG79s;5vn1c;LJqJC~uO({F6iqb%cHg@?7W` zikqNI@O1PQoTO`L+x@dJq6tRst2l9f-H<~~h{RyHjdNhrYR{W8`Z$q(W zTe5G%tg&$X+W3AUr;!cQ2G~W*8##hl(%jTMSb^Oe$z=Tb5DM`btPa$LISnvG4jxVB zVARd83VSB%N0~hk38X;=+#-m6s8QTgkuWNL=qzf&`MemY(7Oqrv;d{Bp=6_dP2^70nxV<2(OU?c&<$*!*Cy2ziUT;FV8 zjmW?m$WW{T^@;ol-a?u(fi?c3%b2d*t`J{3+TNU#j3ua?1J-E6x(m8+b?<*6Q+HE$LN|wE-3B~gpOAxwys3n}oAPF?Mn+&X zc^Z>I<`4S+*v?PmQXEmbUYyrOn=sNz52OYri2+BIIf_P+5(Z7qL~X!u_P>GF{6VrY zDUjf3lgG(a#Ep~zkC6MYhcbskd`-!;m<^SQUV;?N3ED+RGqX6^q&F`)1WEeqo2b&P zbx_TV>_SwCXTTOT3QCbGL=W*EwAA;?y@5hY$reJBYZO#{|NQx-T^Os0nY0_+u*=Yd zRY^TYKTYCjMWd^zTJ(S={+(E1w&OM67I0-qQyDZxj!9{vcM&Y8MDF6~A7U$?M`>+1 zpf3;vTSC-9|8r0iQVZ`HC{0RW4c&#wi;r)RLK;RpDS%8?6}Ja3e%LYy0ea&OJ(AZ4 z%HX(DpF&;_@;f=ZfX2% SylK|}0000<>&kwYnU7spJb7=TJWxnBGbEzKIX^cyHLnE7WngeFN=+gTe~DWM4f#SmXV literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Copper.png b/src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Copper.png new file mode 100644 index 0000000000000000000000000000000000000000..f4778c7baac9312067093ab2c9c61d7cf1fdf656 GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7uB_@M0y2cS@mr;B4q#Np%w307tviNv1&|NmdU zp5)eX)rVP@X)&Kf>46o@Zn6iQ);Q(n=1%H5wK{yg(WJKx+bV>+PN(Lih3MKGwlG=r z;O6aoiKO@U_Nt$Jke<)l?xv)&%WB$`DJq(=HueAJOq}tm;=nCt1NR;=7r2=QTnuM@ W<>&kwYnU7spIOW1pkO8upArU3c`MJ5Nc_lzD1A}u>YGO%h zib8p2Nrr;Er*A-tUMf3Kyx!BrF(l$}a)JaaGmk`K&;S4bFJDh`>$vK}EX%Z*Pong| z3T8Li15Rt4a&vPhb)8xrzTRlk+lI~4=Lg2oCFK>9{-rj2WNe6G7 zNl2I=Rns})#jA**ph-(gKK}Vx?3T3ZF=ICW0U5(6fnKYGD~w>HH5eFP%}{jz=%Dr) O<>&kwYnU7sp=1cyL=|Cab%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6^dC|={~;usQfI5|Orm6=B(vFHE)|Cg^PxpiFiVU}fD%qLNL zU;b1WPPw_cle$i=4qtCH>3u`Jwx<5{jWZ95oU<@l^x$0Ud5NU=_x38EOvp)F zA;Ejd#iOKDM^n=?XjjF*KbFddS3fpvWl!jn(Cu)OHF(t!$lha>AOiG_u)N)Ss}L`c O13g{+T-G@yGywqOj9T^p literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Tin.png b/src/main/resources/assets/electricexpansion/textures/blocks/InsulatedWire.Tin.png new file mode 100644 index 0000000000000000000000000000000000000000..2a58406f089e4ee81552541c485e9731bb6daddf GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sXeaf;|zkotDo-U3d5r>l#Bv_ewBocf6|Nnpa zdXihmRUc+qrp0^`r3Y3pyU8AKTH}(rN)avl{Mw8w)xSrk~7^9bLtgLsbyD-D$ z;PdnI4UgR0TkSsS;Egj9Q#vQScoh*8G-*l6$3H)d-I7*4X3XY4AY&LM&})@&g%ND7 b1_Q&XD1|LvHzt(>-NE4L>gTe~DWM4fI4o6E literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/LeadBlock.png b/src/main/resources/assets/electricexpansion/textures/blocks/LeadBlock.png new file mode 100644 index 0000000000000000000000000000000000000000..09ebb656dbdd05257db5ec969d404e7177e410d2 GIT binary patch literal 546 zcmV+-0^R+IP)WFU8GbZ8()Nlj2>E@cM*00D+cL_t(o!@XB+u7ofM zY$*rv{%2HpKMXFCLTT04#O$uJW%!s5)@|FEnF}))yK1f7&&=}nv}+P?+F3&^DP!GuZ@yUkQYl zQ3jr*I%I(`;f)5&f+M2yBoyb_t_FZ1fJ`uA7ixix#){G#r9f${9t-5V2gK|2-jQyX z^c(7^EDLI_VU(VFX4Ud`5RF*yxfVqH&vv_)F?~;$kD13>umZsDWdUfrp%!@edosPk zlA9JF;wvMURl;5gB=a{dSegC2vSnt%Ybez$m>oPnXTckjkbNeyo?^iYfM{mW0G1{q zYd0D~mRO)0C_9$x%hLkA=S>SN3v?IHvSUUIYOOH~#OO;lTociM3(>^_{bS`Ec=GCY kv0(P~t9P_Uq807^2iY;_ICP;DfdBvi07*qoM6N<$g4xa7#Q*>R literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Aluminum.png b/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Aluminum.png new file mode 100644 index 0000000000000000000000000000000000000000..e537b71e0bb74397cb64e6706eb5b52c39d618fb GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sZ;b1WPPw_cQx<)Sx)v%@xi<5b#-G*U>y0M8ZOFbpFEB2k@ z{Dw#F?X7Ot+OU>!y^Wc%gv63I52YgTe~DWM4fSvz1; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Copper.png b/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Copper.png new file mode 100644 index 0000000000000000000000000000000000000000..537383bacea036ba35894c8105b2148ca6699011 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7uB`usD6BB0PzPZ!6Kh{MSV60FQT5{W(k|Np;y zJ;|-(st>a)(_%h}(gQ1)-DD3qt#QiD&7HF7Q`EIkk;=81w>18&4qtCH>21Td3gNEP zsX1vOx;BR`Ocp)3c{^Vs>HWRE?xHuYHK_gPJIix$;Y5zkb$zO;s(~VV47}VYPPZ@@ zZvFq~XR%w-s>h7k{0C$VqXc@b60R_UE!1FOh_%r;Wf|>~3UnZYr>mdKI;Vst0Bo^b AT>t<8 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Silver.png b/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..68a22c98bb76e73c3b3f299762451a3546ab1275 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sXe$SGi6rfOtr;B4q#Np%w307tviNv1&|NmdU zp5)eX)rVP@X)&Kf>46o@Zn6iQ);Q(n=1y7kDe79NNafnhTN-~>hp#u9^tNI1^!b4? zddbFzBf`51Gh7a~_sbg|xwp5vU2DTy#`QL4#u5@s+B}p>wp~0jt--@f+~SOc&0EHZ m*$G<|q#%YHylMz!VEBAdc{Ydd|9?O?F?hQAxvX=s& literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Superconductor.png b/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Superconductor.png new file mode 100644 index 0000000000000000000000000000000000000000..c5e3951b7e3ddd5d266aaf4c63265ac89602398e GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7tC*I!my2Po9*>Eaj?aX2|af|Z#^BC+TH|Nob- zC%JW8^ing+!`H{9D&1%NAGT=v z>3Yv^Qp+THczhoAI4g6#i}}%``0d?Y>yXA=-ioIiXD&=K2@zV@709K$EJN4xt7(}r tTVOTAH8ly{4mVkYR}F#eJyr=K3=9SQDh9D1EkJ%{@O1TaS?83{1OV+JRFD7w literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Tin.png b/src/main/resources/assets/electricexpansion/textures/blocks/LogisticsWire.Tin.png new file mode 100644 index 0000000000000000000000000000000000000000..59d735f544c1e3bd13af8272c1b3e5f8feffc6d1 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sXg?IgK2cXboPZ!6Kh{MSV60FQT5{W(k|Np;y zJ;|-(st>a)(_%h}(gQ1)-DD3qt#QiD&7HF7Q`EIkk;=81w>18&4qtCH>1~7S>Ft3r zddbGhdY8HjGh7ZnKR@5_$i2PQ?OGewGOo8VGiFOwQrTrSZORmvzz>HsWL@JP-SH9m z_xbsG$}zZpijQPCn!IWVWbd&`xWc%Yfg#FEYs=|Z&51zgF?hQAxvX<>&kwYnU7tUkNw)o`#>St%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6^dC|>C4;usQfI5|Orm6=B(vFHE)|Cg^PxpiFiVU}fD%qLNL zU;b1WhqABFn-~(3mFa0XDOO~1mZW8$l!>e1HI0hj-xPb-OqQzYobck+j}H$Y zt1RV?j`ns-TJ@MQoBx1}VU$3xRl*fUuwfbu4D|uhJQ4A`<>&kwYnU7tC)1%O-L}JhX|Nk#v zPjc(H>ccF{w3tt#^uP*cH`xPDYYuIz5T4X^YE^5x#7Vs_&#gT&?!2=WNo0%IRR7L> zqT;k@^^)WqR~Q#FFv!SDGgv?Vx*upU NgQu&X%Q~loCIEbJNHYKc literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Silver.png b/src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..43a7598eae390da639b0f9b7176346921d0ffb72 GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7tUbLOU)8laGDW=KSdbAE1aYF-JD%fR4Vl$uzQ znxasiS(2gP?&%wlqL<1J6fg92aSVw#oSY!R%FH8?*z^DY|I62t+&ZrMFv~J6=94Hr zu!7l5_JGrxLz}11pBNG%_1epDQmn}2EJ@2gDHB)2YZ^a3d{pjTGg+#pbHa;P74Ij$ zR$0oOF74}p{UmA%@G%|Wj6boFyt=akR{002l- A8~^|S literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Superconductor.png b/src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Superconductor.png new file mode 100644 index 0000000000000000000000000000000000000000..73bf0e7f00b05f445aaa4ddcbc74fadae8d4f971 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7tW`=!0WJ)lsYr;B4q#Np%w307tviNv1&|NmdU zp5)eX)rVP@X)&Kf>46o@Zn6iQww$Wh_SDvzc}Vi4ewXLg9v*kzS&JmHMegkUFjH;X zN(tUWE*>SNHP7$N`M>0+S?k0ZuPP4QVm5H^5p#i?V!*|~{X|mdVt?ffpv?@Pu6{1- HoD!M<_!ddJ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Tin.png b/src/main/resources/assets/electricexpansion/textures/blocks/RawWire.Tin.png new file mode 100644 index 0000000000000000000000000000000000000000..654dccfcd972a6a4fb20d4707945bdcb70e09a96 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7t`(&BT0JWwdt)5S3);&5_;1S>O-L}JhX|Nk#v zPjc(H>ccF{w3tt#^uP*cH`xPDYYw@d-aauT!lvI6;>1s;*b3=G^tAk28_ZrvZCAbW|YuPggqW*ARs=V?9$nLj!{^MGJwdHhQ`^hD5l(?b|4L*nsDVNn6?nElI82 zJ5R95DHa=qsecN*arAYNMEMGipe+7+XBVB&1t(TIObl*RTF&I^$J#ZAOTd;+t)`g~xZri#~f;ShLuwZ{PVhU5l4Wf0jOEv*hVg`5WK;L#p3@wA!rQH!bf> zKF8+?)27!o$hg0c_`aISHBVS%hi||GGsni;EUef#-xhAYR#$v?Qbnt&ei_j544$rj JF6*2UngEG+dRPDe literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Copper.png b/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Copper.png new file mode 100644 index 0000000000000000000000000000000000000000..7baac2fc00909bd42992035fa768126c3b96ea81 GIT binary patch literal 342 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=G^tAk28_ZrvZCAbW|YuPggqW{7tY#sM@^$(_JRYsO-$Q4xv+8G`ev{F%P?<2#EMtDeWQS`XYh3O Kb6Mw<&;$V45_}Z^ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Silver.png b/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..14398ad7d59de103f3d37b1d4358c36eda077da3 GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=G^tAk28_ZrvZCAbW|YuPggqWzV2q8W?;jS_o9N#nZ(xB*Oh|-$p?uLmrmcw(K8a8ePXu zcyw~SXs|kBJ-J5u5Bqb)A9HVdXy1JMD8Hj)DVK<)s78@iz>|;#CssO43~p3f&gAOH z+BF9(aVqb&So)mr>8&<3d-oe!_uc#crepC^>7Trc{F#+6+2zjrpZRw0@wRk#8Qr@l z@;NF!PJ7!s^eqNyVePsjrcn^R;6QF8({@%aY@D~Q*=zqYys({=a)%{g8qoa=p00i_ I>zopr02Fn4iU0rr literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Superconductor.png b/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Superconductor.png new file mode 100644 index 0000000000000000000000000000000000000000..548207d68f426f32eb3b8f71d5fc0d1d6bdffe88 GIT binary patch literal 343 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=G^tAk28_ZrvZCAbW|YuPggqWdGrT_o{ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Tin.png b/src/main/resources/assets/electricexpansion/textures/blocks/RedstonePaintedWire.Tin.png new file mode 100644 index 0000000000000000000000000000000000000000..47283e2a8e760f7e01792c6b6635d72ee02f1dbc GIT binary patch literal 343 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=G^tAk28_ZrvZCAbW|YuPggqWRHc_WxidM_szvC9ksGKctnCRx-Kzv3AYj60sE3DAEde60+dLN{5NT zjY`YG5}R&sJ1Y77Z=@oB{QLYfeT%=_T0hEo=~m}_!Z|ALSL5-|!khPg-|_aQpu4yE zCut|SOP?bpLUsTE03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00Fc~L_t(o!_}8DuR%c& zg+DK%K%o;6jSz)sG&+S}<6roDG$K(65s8TC6i76vPV#1Q*XC7s-!$&pxyzh6=ghr@ z*=+XaSJY}X{t~Ct34ms^nYq8&Yyha&>*o9W{SLqnIY&_!m&?WcGexJ<0bsY=Wgei) zg+!%NG5h237=Ti#1i*T|HhJkF(ChU8xL&U&;e0*=aJ$`1FB^@9$x}rh!R2z9`NQcU z;8mcWDyr40sW8TgSV$eYBanX!1gSnn4lk$CXavCH@c>{xpPM|%xYcTz`;@2fWX>M} zPa4TkvJ@#*xnejRezn>dDU%^#(Hl?9KtiG3dLs%MP&ypYg}2t#YGt?(8a7hLcDn`O z^?Lm?AJB!jR#~sNWc65jSLNMq*Q}4n<5yLPd+8vc-uhwG@Aosuv?>()wN`~8fAQz! zjzD2LoxZ<0nV%7%@$D;>Iu3^e0MF+$Q72U8F$W9n4+aAO%H?uquZ57-`~5yGCrn3% z{`r0~nV7`IVv*SrJ#e(!ZL=?^J$b!6^OvE2H;j=kG+tw}^yj7XUJ$EPR;#h>EAtVm eID}a42z&tjKI1}?4d2E90000<>&kwYnU7spcj?9*Yk@+tnIRD+&iT2ysd*(pE(3#eQEFmI zYKlU6W=V#EyQgnJie4%^P`uOA#W5t}aB_kKD>IKoV$c8o|1V!pa_hM2!z|0Rm`|eg zzzSwJ*#k~%oN{w>rz|SE`c+!vQ{pTsjX$fy*BecG+mL;IUSNz~vaz$bcUNJC%fZ{* z`3;ZU+gsg!X#cq{^6PEPj3p$Nw0S6P*}C<}v<43^af>q&Hg6dtW+!Y>kb;zopr06^AaOaK4? literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Copper.png b/src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Copper.png new file mode 100644 index 0000000000000000000000000000000000000000..5c0704481f84467bcf40d1bf1dad6efe7776749c GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7uBY-4!Ld7#iVPZ!6Kh{MSV60FQT5{W(k|Np;y zJ;|-(st>a)(_%h}(gQ1)-DD3qt#QiD&7HES=;~K#jZcZQq%{7l4qtCH>21Td3gNEP zsX1vOx;BR`Ocp)3c{^Vs>HWRE?hoVBfAy>V=R3=DaN$Ib&UJmNs;Yq^K6QVETh|U7*bzr=6q&9*9CMTgQu&X%Q~loCIHE3 BUM~Ou literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Silver.png b/src/main/resources/assets/electricexpansion/textures/blocks/SwitchWire.Silver.png new file mode 100644 index 0000000000000000000000000000000000000000..8f371cadb47d8d73b31dc5aba845bbe09b9bed84 GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sp<>&kwYnU7u9blY8p-#{VR%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`^o-P1Q9MK6^dC_cs0#W5t}aB_kKD>IKoV$c8o|1V!pa_hM2!z|0Rm`|eg zzzSwJ*#k~%oN{w>rz|SE`c+!vQ{pTsjX$fy*BecG-%ziusXu+=%!4B5EKC+XIM;e! zBI*6Tz0MEg(|`4c%gvV5a%(ma6pEGg_VQY!G2_oK)vlU#D=fJF|NQ*C=SawL=4)~d lmPuO_q#za<>&kwYnU7spaSi*IHlUDfW=KSdbAE1aYF-JD%fR4Vl$uzQ znxasiS(2gP?&%wlqL<1J6rbYh;usQfI5|Orm6=B(vFHE)|Cg^PxpiFiVU}fD%qLNL zU;b1WPPw_cQx+9n{VJ{TDRGvR#-G*U>y0M8ZE!ukJupTu*;rZcQg>m7%faX8 z=Nlfmx3{|e(Ef8@WFU8GbZ8()Nlj2>E@cM*00*f_L_t(o!+n?EZ(PL{ z$3OGy{@7i6cO8egG(Zjc*|d~EArcZG@dQ$yP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o4C>l~trv`y{N}<=o~drMUjpjZ#{jqucE= z91iJryG_jMxO(q-_POI+d+#EzzVag1QVq`Wr$20R{qsHEKK~EuM(Fcv*XVV-42DC_ zzw{D9P<6=yJsORg54N^+%j)VX#u)D3zYoyNv*XmMQ+OA+@x^tXSw7BS42Sz)Z8UqM9IaK^mV3Y7l4V&&tJT6&m>xHs_ z!Ii&VskFopLg3Q-ml}Bn_^|3DW(g{Uz&Ve0u1tx@d7?OK7M_*TPN(xd4@fD|k>QL32@!nJ9 z1wzgUP6$Y$SnT&%TwKI^&-&^H0Dn1ihTq-12|&N!XE2zQo$=DrvGDV=%RGPL99nC3 zws)|$U@{qV*y#1T42Qc1I-4g)9LE%eB?Q6R+S>Q<^Dn=|#{IjjtZt#}l!%PMhroC; zrj@psOb*Za-Q5v~+1A>ilx$8(^?c&Q3-o$Dq>>FM>hocBdQv1w#5cFTY!0E$?pEFI z_YbGe9ey~SPJZ}sy8USF(8DQ!7D96S&VvIkl~Oi~rD@u*9bhonK?sR4nxjXbVzf8m v;lqc7P?lzaXr8avtXV%x>^O;;OeXvv$wdmfQng-!00000NkvXXu0mjfn!4w8 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/batBoxT2.png b/src/main/resources/assets/electricexpansion/textures/blocks/batBoxT2.png new file mode 100644 index 0000000000000000000000000000000000000000..dc34d064596511f4909c602a2f4d4e76ee9b1834 GIT binary patch literal 2132 zcmV-a2&?yrP)WFU8GbZ8()Nlj2>E@cM*00+29L_t(o!+n>}j~vAn z$3OL}dwOPeXJ);|8)6^}{((b6Fa#`F0whi#`4mOTDVH2_%pa9oqzEMvvVDpmk#I0l zFkmYigN=9NwY}c;?#z02X1c4ZDu@0tGxkDBqweW%cfD8jzTfv=iItU=03fAAN`d!* z;(u}9XvCyxMm2;eu2B>bfZzjC3AEAxgb+s&sJ*&oKlFdD<=KA*+H_=)vCX_Tc%A`>BmptT?oK)2hY-|u5>P81my7Z=&u+9Hr6rKH(PS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9Qo)Q)I?W-GxMLu3jE zy4`O5a^*-Bs>&JfJ$aTR$6z(ChW+_s2zN zys~mE{PfH!FP?Y>tu=eQdsv$@9*;O|bh{k}gZ;VA=E)JqF?ntYL9n^G`4oQk_1D`=X)&`|yeM+jXCr-RXx7$T3S#zQ~AC{*l zMWYe%&CRdsL#VU+Ww-nE;ncaq52usy_a9DoA8j6bI0eu`NWQ)GU~WsLl=WmulGJPm z==b*!LSl^O=+S2w9*lYT@F5`-rCA{A_p3Q8*3S|-0000< KMNUMnLSTaGedzE2 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/batBoxT3.png b/src/main/resources/assets/electricexpansion/textures/blocks/batBoxT3.png new file mode 100644 index 0000000000000000000000000000000000000000..6c8ced855a16d6fbe364f502e10ffa1a507f2c25 GIT binary patch literal 2138 zcmV-g2&MOlP)03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00+KFL_t(o!+n?Aj~vAn z#(#C|?z!yF%zBMC#6T8&!66|m1S}x|5>FuUgrejv4|&LA{;0e~iclgU+fNZB5(Fa! z1GcglY`h!R_Fn9rSc|kpdh;x!81R(f;R06Fu03ifsvl$@-(llib?H+*>$wmirK8-*y2e- z2(&sth*ro=PGS;-5On4w0_gV#42MIkElCo?{QNwdo0|kmq?EKfE!Ni7>GyjO1l?|j zR$HL7LJC2@KR^ih`udjuXelLGmLR3%#;tD{?>@j7Q)yc8*xOV~#B>AcR0`O<@btB*i(87vQ|ZXibu6lu~E}l+IJwg7I+7>elZ;C~!MaUZ>Of zjuSsw`cbUa$(T-N5CT~{A)i?wFv}l+2~?AQXc>Ojsq?r(0BwL9c_jxh>^j58pWl1yhg#+aypoq`{MXoDXz zna)s39bhg8xd7?}lWB~1TR4nLt1v9FHU~nLFH)Q@NVBvG=>(%S(^(Dzq?Cd*O>o{3 zLI51N+tJ*j#ay?;z0KVN3=2q*1LnG&1MeUK=nWQ0TAjvqLIi{`?CuOHONaN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Gz}$Xdxuu+_-zhq*BUe zvsSCsupMAH+(ih9F`DDYA7i{fWov7T5MpT-i01ox&zkjziJfLC)9IA|17&t9&ehh~ Qb^rhX07*qoM6N<$f=D<5R{#J2 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/batBoxT4.png b/src/main/resources/assets/electricexpansion/textures/blocks/batBoxT4.png new file mode 100644 index 0000000000000000000000000000000000000000..964337ad2a8524def04ec8be6f9820dd38b8bced GIT binary patch literal 2046 zcmVWFU8GbZ8()Nlj2>E@cM*00&}8L_t(o!+n?Aj}*rh z#(#C|o}QWAnSsR+2Vd4)Y(hf7iH&5*M#_^d@f1bLdmi$bKPqpLB9urL@D$mJWXD(v z*anFJM(oB5EG+EKGCMQf)m4>;?yjAI4JD1Lr@!htr_TA#rNp5_hXR0<5-A1V2de+o zbE}n-=LO9WqMDN=AppS#q!MVQ0SF;5olXfMkftf)@q{EX04SvZm`-y-2!!C#0PmhT zj9m-8*X;H0tGCcvE2h(e{Y!@l zA&_-|P+1{2If+RSLeN=|2%z5|u(h>?wIxYnSX^9WeSMukiIkFdCu3!0m43emLD21X z$l3y>6;cTL{Q*M2?OWdgprw?wS_x80zQ1>e(dILZF}0=zuP?ueR))t<*Z0IWH#ehc zz4wfsjo80$A3_MU))clNO;Vimcmd8kjMgNHMk$3xK zjdPX1XE9?8#+ZneWl6xZvGIuEvn{%d875KOy>pM9ohfB*qyO_fXSltMlma1SMM76r z7N}S*;v7Q2dp{EaBI4eAy!QwRCe@rc^)_kJqOdu4|MNYf@(NPH;J^XKqcPJWr_<@s z$OO=n$pm8*0)bL03J4(}gg{D3e`yhQx5AWCyK%*JLGweF$#pNWnM`wxF({>WPgYxCJei`DirB1T<4G0ows07g z)_94vIS}f6k>Y$o+Dhw?PB2{C+nLLYi1z?3*An1 zk3<5{8!VAzo#;9t0zw!zH?}BChxegQQV9f*O_q~FHsOzyG78G`ycRr{TaZ#ltkwX4 zjg7}-?G`3U0qQxRGzhV~Z$)xh!6@wd02oc@XU;su}KGliBTFXy= zev z2S+>0aL)18u_GuU2m#6hq*Q35flwE(fHuaUbVZJ`_UUXGHVT#2#`n)-UwrW;)>_gu zjl@jTbT0cfSemAsJNIFfsY3|3(lglCW5s#OvYb<(8Kv`cVHn9**ZT1v1mpV?cvXQ7 zj7splJ+HrU zm}|d2&wIZ(#kEX>bNuo5kGXzzhhLrfJ53{W_1ZQ1y&hY`A!kmXMhNOIS)fOwQ9Q7< zm04C-S24!$;K2icIM0sb$B*M(;Kn!Cd2RVHH@>;fkz>dB^e>-s{x|2jc;O<4mtTwP zw}!*rQyb0Bs6cB~wdLOLwq$vp({8u1*2dm%w(8AVp(|)AMB+S2n#7G~Q)#!`eZc}!N_3)m=fugm(EHh$Q#{^y%)x`NP!tvz z^4W9W?u>S#A{wCG$uP!{m`Z_uzaJMjiZrfjl=0qE79~Q?B%BbCLa{U$u(Y&<_n!N! z>j3=uop<=%&6@xW1_QRXCRJyA=+MFNlM~Clb@U`!Yc`*5Vr|J}GG?#Q@AnuEw_m6U zvm;GY%F+^oU~O&f1^mprr&)h+mzC8GbQ2PZG58P|PsX&fHj~NTF~7Y%VlUZR8r^bc^Zmm)lS(P$W?7a+wgYT!Z6buk7|nqLuQ1w~@aWMaLa0i!K*aU49kdW)j@W4{ cWipxYKlR)#8+)&~1ONa407*qoM6N<$f^cuqp#T5? literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/darkMachine.png b/src/main/resources/assets/electricexpansion/textures/blocks/darkMachine.png new file mode 100644 index 0000000000000000000000000000000000000000..c14324f84e93e25ba4be82a2178d9f51fcbeb7a0 GIT binary patch literal 1418 zcmV;51$Fv~P)7t5N^}03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00izyL_t(o!*!Q!bKEuz zgdc#=d6K&S|97S{iPIAa^aH?`vr|nnzB@`Ju-IKd^8WrF03w2j5E0Dp5rLU8#^CeS zS_2>=5EWFkR)XF;5n$H1?@nu4d*H*08p){0yzyNFouML6!h0$3S~R)&FyV3%Rm@ZpFGV~j+Q zU1C+m5KwJg*M+sVGVWD(5y=C|L(iaQNhWGu>#a4+8mbw<<`qZK8L(Y;Au3$g#brio z4R%>4Uz;)$_vKuwvJjbU z-*N;W10SPcl@}>aBt$ifSlmf;eaROx2#bjF=JNCM?Ii5(4H1EtN=EN%6IEU0PPhXk zOGWX92#_-=$3539BAY{Ib8(`5X0(DBW6N%pPs-~L1m=MSyozK(1X5Cu2s9-VjB!|O znMc6UjM9waa50e#BHT+fvdl|l%UDI3B9=wf>V~c9s!#7dVVPvCh|hMdB6#hfsztn% zK@@8Hh&*;98LOnzDRnL+tSQ5O->Vm#@VC|yjo8k1dd76pS)$c7UjpN$ZQJV)jq7?; z#2M77hIvnGRC{%1JLeQy1v2laO2?sw-gDhD+9{>kT4mL9tALf=WO{0TPCBuA$O(0X z1JhRo@Rt&qnbm=@TZZhzCn4R(YXAo?<`9z1KdE-`LDJ~l=ibLaGEHWC{Nic;3mC&! zr+gXT)-1`Fa!ts!OleP2zWRpkY;--aVPZLq zV@}-*$ihfzNB`PA>V)^TkpJo zJN<@QJ_+;i8{2Sh{6zLkMn>z%v|*&iG(n3m?Pyq2G1EhI1+}{)V-U5!O?ccLZJO}8 zfARNSs%kJQt2fLysxgPr8sXg?^c--LfFU&xn(c|GHA9ffU@+*%%c?95@A+O!wy%MX z)rc~YUX#|$KIg@$l7oa1!SF$NlK-r6 zXeMJK!mnQ+U)*d;?7A*KK7OyY-@iYq4J+Tj|Ao8r^XJc0LenDYsjBUc=ZkK$M(;QO Y0p+*?g^4rgO#lD@07*qoM6N<$g2|nry8r+H literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/darkMachineInput.png b/src/main/resources/assets/electricexpansion/textures/blocks/darkMachineInput.png new file mode 100644 index 0000000000000000000000000000000000000000..576282a149ced80b9be88d7c3ffe2654ef2f7b0f GIT binary patch literal 1636 zcmV-q2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}Y^#TW@8G=Z84LD=_wjOMl-BfE|t5p859w-K&jJJUWh3&a*zu%{izq*>rUykI_-WZT$abp zx%G4-VCU;DGMC(LPnll2P>oByd_LbD#wFzDDV%p~pP&2}K_;^aGD<|z P00000NkvXXu0mjffaMSV literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/darkMachineTop.png b/src/main/resources/assets/electricexpansion/textures/blocks/darkMachineTop.png new file mode 100644 index 0000000000000000000000000000000000000000..3ccb549396f1206e923c6dc964f40520284335fe GIT binary patch literal 1530 zcmVWFU8GbZ8()Nlj2>E@cM*00mx2L_t(o!@ZZ?jw3e? zMh_{L%QHQg33jjY{tuU%-Pt4qe z5yAXFA}}+0?|i&UDF8$SqJoN!UxL;e5nxuRwNZ+WcjjknZ9QuMKmYtsygOQy-knmE z2=MNR@Td24tH3M`@g79P%e{HE)?e<;cm49qzcE#%wa%}<{r>XMITHWx{`_Amwfj%7Tf z5{i~pnh2OkLZx>{Rd^f^F587|v*9yL#@GN#AEg%Y8i9!5{f~EAYwXu6y){G>Gvjvq zgNWdA*#-v+1lXipmQOBjtz}ir2=wV)tVq4TzYjG(je%Gd@_0Njv+=v|_Vz{qtsXPG zSp_0Ocs#+P!e!slk+aw96-w?g?ghPfTC12@VttgYY5~%y{L8&k_+Sx%mSjNh9jVEJ zP?l)Up0*LOS}WVgx%*Xzom%TME+SBO$9t?Mksd~pYvffmu^9`kwz^?GD&d~xDzBY# z8ZtG;!1cL#X(@^f36cgdpW;55lx22hgT=b!#=5M1H=%1;4+cvJ(Pb)3wHVh2f zu>iJsF{9Y~7&>A>DIzk(V;ET}n%(Ve-F)X%`B^j*JTg4XPd&Bh=XxLPFJ{@|)t9lk zMlds@`#|xSd}e;0wLVyXJeG&7I)5Fvc**NPGdFz=ByVqTr{S{FT0*4ON z5lK#n=t#?eo}5HDODEINSH86rTC0c(R&va;p^X>$%5$=wA?ZEAla(RM`?Ka0Ku7IP zW}i{pYUS}bo-i71^*q9VB&BXC)uiTas_EMLKn<2ZStW1)`?@+F@>e;N=er-t-2 zc8YQ0b{RM*+I#0X9&2!o2wLl7j#OQqsLI$R*7t3*LAk+h6^iLexX-3Di8|M*=rY30 zKxENVMs!kyqa+aFII>yPF-*)59>*~>VhD;B#jH?DSuOq84TRRP(@$4V+dbY4h zK9DtVisbkE{e3CDch8P6G(eD@aHOQWk8WCsaC+-hKXN`8-7?(Q`aE|G4xG!-!-<}U zkKD9NdUwPagPfB)sRsCqa9#S(D;1)4-GWf_g{SpWb407*qoM6N<$f;{WVX8-^I literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/insulatorFront.png b/src/main/resources/assets/electricexpansion/textures/blocks/insulatorFront.png new file mode 100644 index 0000000000000000000000000000000000000000..a2aadf6c38fa66faf1f8136b24684f791f2a30e4 GIT binary patch literal 2092 zcmV+{2-Ek8P)yQ8d03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00)psL_t(o!@ZYHkDNyl z$A4Ab{k+VM*YQT1-9(NZ$5NDlka!XAk#Y!96b`^4m*kUhL~uaj8z4S_5f~0!KmjZy zNF<5^ut;y`J59Ub?$D^vuL7Ih-O|8qIV+&vaFF{r~@}mhJ6r15i~| zg`ABtFTb0nrtb%qL!^9HRfPeT4RwNd9so0=>pIMgx~@4onp0H)0OuS4UDsn~m}NY` z=Rfxd;}{9SGYpZc@?|ci%3#h$&iUBdxib%z_f(apsmR%A>vg<$ zn1K%tRV9vz`(J+pvkWRE12tpRaspFe?i6oE&O(DDkr)N+i6=NZI-;s7Ku9Sv3_btZ zzd==boO5^t;=+69l%{EE+ZH32C|`JynZTwfy%}H#(4s^$GC~y%GYASjiEHN`pzC_- zf4xOcM%`5O-9X0CC^o%!=%igkRZ8yKmZoh;DRSb(38vF2DP<}VNQq!ZBaT{? z$_y37y9@}yIh+$(aSX%A&z|~_KRo>&-F)E3U%AeuZ|zXm0p}fNhN>W<1%xT)l0#KC zc3&hL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00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/machine.png b/src/main/resources/assets/electricexpansion/textures/blocks/machine.png new file mode 100644 index 0000000000000000000000000000000000000000..16210e45946e50e0aa024dca53b09ae400c986fa GIT binary patch literal 1794 zcmV+d2mSboP)e03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00w4BL_t(o!)=$_lH<4y zhChI$WcN&FYcDo6dH*-t%GFlwp=x^DmPi1(07cIvQI}h`M2R5qA3*u~^=kmADyo8e zkiYZ$?Y46qC)Xj8=WW{vAUx0_)KUS62%gU;5y8Iie0)6Ewgx~c1%T)CAR>rxD!|V_ z|4b#$b%j zufP7AT5Ca7Xl-NPH&hi-K_ox7eV;2A+#NH+-Ej{h0(YmBO09)b%6e|wHun3DTVS6C zkH?cSIuN+)%4k*99DLg;^Lv{q6A@ainE6Vd*Z#M*Z9tRgT`WS?PyCXm?l~AXT4CKn1xuYU%`^N3I zQ)^?K9e01>CoKWy?+I4(b#{WPb(W$ir7Dl-2m8KrzujrAWxPU81eBtv zDrT=0xd(s0|Gj=k1jljkcziI%;2&SU(9fRbYLzj9$K#Qdyk|M8s!&UzwT8LVd!MVE zR57^UZ|GE@qRQC^@9*CTj~qWI&vWX<7=v%$-l?q-Zioo?`y2ay!@}vu0Rc5tPS8@Q ztx;4drA}d*;1RtvW}VFpH(z7SjNUsDj!r#D+$cz0zaxUMq;M&kI$$;!qp)q;R4k>| zy69t;D=;%Wf_|Qi-YKOnfx4vJY-Xw!l0-7c7-oi9irEFu>h3%q&qQ!(Fl#O#BrD3J-#auTrTh)jiFl)=H2nwo6 zIwuoJ1r7oa=Muk&pk{pyv#|oXCVji#UnuvWwJj<3d@i%vwr!1ZH{5IjvSE`YqL&Zw z!%=IYzPKf{*7)@4(?o61`=GUoO*SB}$kSf){Ni@0q2!+KA*Tk!d^6&Uv0mqbbu` zN`h9hgry|?*7T9MD5aoN2|awV={SxQqKH?+c&+YwL(*?xZuHR?`c)O-zmBPTtM8E1 zwKO*vW{fd%VbgEwCB65z&$L#7n9@8@%@rQU$=T2Kq6_I)(EtC)EM9sbA}hm)E+46v zYPDKc(>ccA?48e_KPOrRTCGcD{&(r$t7hb1su{g^%myN_e(}{o3wkvS+3jYn-JMn| z$MebixA#m{$rj5eF7!KhGxtf=Shc_0G0n_>C~fbZG5Xc=zku{=9tDvs;^)twxqvDn zOUWXVV%O1XTWm6O!UIHznc+(t&huO#G;^w%qeUsRiM-Nz@%!2e$pnpZ(Jtl=$0r+P zPLy3tL{Kh<2tSw{!t$4efzJVbqo_SVa6FtLJ%AYo#?^j#sL(?>p|!w&jlM?0s&#(pRjXgx47y z%Oy?IJ#V)gRkbk2VB2;?6dQwncFyBKX6*!Fm{G=9UN2HPufP68L}{(^%P;?AjLvVr{YC_|ts%&g>a`)6 k3c1gXF2H`R07*qoM6N<$f_=wWZ2$lO literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/machineInput.png b/src/main/resources/assets/electricexpansion/textures/blocks/machineInput.png new file mode 100644 index 0000000000000000000000000000000000000000..4e4ee29bdc274174358151f7be8bca0582fd1d9a GIT binary patch literal 2010 zcmV<02POE4P)WFU8GbZ8()Nlj2>E@cM*00%xvL_t(o!;P2Aj$^kG zhQBJ3=OU@Q)faaR&%*J*7$dtN>-e4WB0*lod7UIk77pOa#M4rbq;umf3m%!*DA<(C;iRZ$gE%9QWrbJNs}YzP#uxyGVI=2F&It?f{rA5I@)D@3Dss-e9wNf^^)<#CR1|>2;c)Sv5Cej+ z+wbt+qoQoL+hzWCyG4yI^MCl^KqYYiY&RfT&Me4NJRv#4-99!h}Sjt?LHO^lKC zdd=~8WVhRMI(DR-*zccl&S8vQ=BrVT#{(*g$P1EIRY^Ics!V=DMKRV8Lj+**6LnRS zQbwel@_h1P82Iqv15MKakW%7!IC6h?hpJ+XS?0%>NCGiMoV80zEb~q#KP@?oAtE9e zwM^4U7kU6be*BrcyE}5uq!dvVtaYT6QI&JD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zaLzFdT`5Qr#_`1wy>?S)cWsSj9H-(5izR=tWROWI^UXKEepQyQr6#jlt?9Z`fzVlk zFG4m=p6BNsBEs9ZZ)YBv*}Mv_s!P>Kv2QUZG|tMDV!~RBwU+-;@;IkBSMl(0N87eo zYgw;0i-5Il%U55$;r{;NLZFNERygZeuh*Q8r#Tf;IB_RIUOCDOH?KCvt|W zGUO~w)5QJ#7i>10<@VI~JAZ%)sFG4DSFW5Hr;+t$&GYk~tE(#>A0O$5uCRKx<}nsUJC9); zFYc6;D^B}-C){pt7p~+C>-Dn3QOTT#4ii_lzQ8zUofBu>O0MD)`^e0+w1^@s607*qoM6N<$f&d85$^ZZW literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/machineOutput.png b/src/main/resources/assets/electricexpansion/textures/blocks/machineOutput.png new file mode 100644 index 0000000000000000000000000000000000000000..1a3c85322b0a544dfbd30365fac3f6c3511b97df GIT binary patch literal 1966 zcmV;f2T}NmP)WFU8GbZ8()Nlj2>E@cM*00$CDL_t(o!;P0qm*ch( zMsMN4hoqL&t@e0gFC2T}Wb1wWpPj$sbF%WnlgV^T8a+smcz6MjEuA?|f?kL%3LsGR z)vb^6{{8y|pp-%>A;v`hKVLUZjdKIj5XqlaRgr)c6G{t48vs&D^nFiCiMp=2UOTGF z0-&`9pzj?iB~pqQfS-T<2ax6mRaHewiQ6F}tk-L_(I`;>oKB~^-}vAWg#BU9IF2Y$ zY`5Ea{&u@XX*JLP<(Ge=jL{gQ0imiY?9Id7;O1*l!ufp457_Vd`0+o45LhmkoX=gc60wTO^HAikK2gDTZ-Ci9#Dq@Bx5f9H^_B7!xA- zl+(%kzUSk|k2FmKK#Y;|>CEow38fTT>v?_%kth&iz#22B#87rJjKiG6-~%FpR)%44 zTzv|6e5ao90AxqZV_M@22Q6F#%RoKxauBY2O9 zVxBQYpzC_Hw*2#;lsZ<91f(E_0#u`s>)}sY%WcswW6vjMDhllbBv=SgurgMk5NMjZ zM4-oq04Xt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#ubQDLoN96c#TwAQ@5ydaWL%5c4QcUDVod{$M} zct4Vo@ch*dYqCKBP?D?dbUNi$uasuFT%t-jUb`!cc7gYv^?Ji%DIE5Pxinv2k8j~C z9a1Sho7JhMPsF^OFZ281^iEh;HA6j2YiP8}e(rQSK}xv6v0N=V9uGV`Jn-(_JG%Zl zyB(!6evNs9R`1;1J7s0F)1KZ5x7)`X>jul^GRykA@4icQUEi4zRW_7TqHWumhyaJf z9uf7{TuM2LC~RfR2G#uiZ7a^m&!cW?UOs)|50w)nhixvB8UO$Q07*qoM6N<$f@}n< A+5i9m literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/machineTop.png b/src/main/resources/assets/electricexpansion/textures/blocks/machineTop.png new file mode 100644 index 0000000000000000000000000000000000000000..a56ef080486dc8a8461101d04399fa6605e09317 GIT binary patch literal 1939 zcmV;E2WP)WFU8GbZ8()Nlj2>E@cM*00#F-L_t(o!@ZYDj~vGl zg};c*tfhNqnv}r-50YTRfbZ7-{|)xlFf7=Bbs#B`9L{vtl3VzY)ioSJz8Nl{(bd^i z8QXg=BIWJdw+5i9s0y_j?RUE$hMskeTrZLK-E|!XST)oM-gyAbjAdCcGy1+~nr6B# z0N|VhU|Cko46}*{_~FlgBBe|So)|M-=c#6-m{FDAT)!F{h7N#~3boc3Yu9U8;)}KG zUVr)P-|^l%mL>A9fB%HpbA+YT&1?P5byY+ zo>NtZp`%t~?Cj0sYOpGfZKfkBzJkB{h0(tY^Ib|3|#&N``Ta?0K95FMTbEK50wNgrNL%;Lky6IF zfU0ASE2=^%M%T5q5CUdKt%ZK*>AH?&5ig^~-R!Z38CoOiaA z+_2>5dEV0J2wlg`&5>zZK(v9-yXFL-!0FYA+uOSxP>)|8cVOjGxV^nWL@BipLI49n zFjc(wRFbD@-qS>5El37x+-pIVKlr!&rZ zR2%Y*`of9p_3-&K0GG?e;W*;FqvS%@^%!lxp&u|aQc4_;H|;(r=4s;DW<^WMq*M@T z;96tEtTqv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Ap0y@@l zL4oeU@%e#ZK(`X&lRuC(hY*pdPE5RskzVAUtBSe(@ z&<6tnA)}MQ9d{%23&m&0Dx7e80cB|?!hl*s!ZB-$azkZ47V2rX)n4$%u*GMB5tVy)D5>j zI4Z+g`Vyijcz=KQGG&37-~?Iio6>S?x6_r<>h3pZr8B7G=M89Yg6CaQ9ClWw5a_al zz{`{zPykp2jb0;m7@Zdu=v0XM?yfrup;rhC1CM<_Do$`5olheOfPIFDoKRbOW!r5| z5c!Ik&1Xhqqbyz{hOoqbeMY6kWJ_*|55qpZHiQU*&(C?lC#rn;;zRMz8B9U`@zasc z?LQs)F+N@S>&#a_$I0Jx5s>KqQ``pMVLZ7*_%_v-s15qXwk4DY?xQo3kHq);kx}o@ fa5rx^NfQ4Aiav=L5NX_900000NkvXXu0mjfK0t=X literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/blocks/rsMachineOutput.png b/src/main/resources/assets/electricexpansion/textures/blocks/rsMachineOutput.png new file mode 100644 index 0000000000000000000000000000000000000000..0327cffa64adf502a926575dcb16c3840999390d GIT binary patch literal 1480 zcmV;(1vmPMP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf5&!@T5&_cPe*6Fc00(qQO+^RY0}cof zIo{u6Qvd(}8gxZibW?9;ba!ELWdKlNX>N2bPDNB8b~7$DE-^4L^m3s900ksTL_t(Y zOO2Lka^gr3g&B{-9bpef64+p5?Hgi|#11~mTwpFR_x~|pRwCi{(mfevxs+7BSGksY ze;Mib`;U*0JiCc)+f3dI8pN_J+p&iiaRvkV$#HD9Sk{1{%M4Nz+FK zQuEzwr~EJ%0{D5coyTricAxQ`#u*M6mMs(2tA?Q~yH{X^U@#a!#fGw+&FAG}x!{=> zIfKa@SyS_yz9B)!pS1QphC5C#OYL+}JEHq!pT3L3-F4Us(0SF0ri zO;ZCXje!7x+;~as#bMfL0~Mf zd^L-rs^hB6O1i~ua+T^wDnGBR-V`l0=GK4%cE=uaUcB2sg{F;DxkOEl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H}_l!mat6Un{>*Ib|U+*z>F0tPkM}MrgQ{ynzD#n|3YLtEl*mq(x z8|ZkvOuRnD=`OiB1DwG`tabl7t0B28BC&K-Y8*UN;Mqv$on{t```4A`Y^2NjRgVN?QP1bWG~M({f-W%-%m_T)p^}GTnXM&TrzT F{sX16nh5{^ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/gui/GuiEEMachine.png b/src/main/resources/assets/electricexpansion/textures/gui/GuiEEMachine.png new file mode 100644 index 0000000000000000000000000000000000000000..d86dc12b42754befe1b9db29f5f869564a5efeb9 GIT binary patch literal 2376 zcmeHI2~$%C5Z)w@91 z1W|-4S|CNHiX$o#MnTl6pj42f5Ka%IAYdt!qmTZK>dx$ZJA2IRe6vToM7-W)p7lHc zFcAp@f&oZ`Ndh{BfEZn5C;^;Z!r&l)qe}tsB!G!o0^b50;sLzF0KByT3uIY4YSsZz zK=O5HAWii(Pgi;HV(Yy0~8W@m}`XZg&)|BZoJ z_d?sbB~k^8Lx>^&lm$Y@X~f+ChFrM$Ab{zeIVG{HR=psc)~dirRfz06)!`_m6eLm6 z2UM=&z)()CyQ_z*8;>`pEC4{%q5$8}xb1@%yOfuC%;acp^HtI0OlEG9D$CDswX~AV zotY|mfUCn@9*6I1-FE$A{q1Luq+P8t*F(*JHttawgQY`*SIg{?ye0CAv-Wa|;XQx* zjy?1-u(aoaVdu=mlpSnfl~J(azrUYy8Vnlxg8>sZuNYwBW@!0+i)U|JXMJL<8Zmy~ zX#`9E8Y1Bi{~QK1XZi%#Om5mc+N-$hNCzIy;?Q&#kR2x#Kkxjlotr8UCUWB^H?403 zz`$N2GQGXD_JdHAwb?8vOSZ<#AeBFiyW;p*mkQWvd@-eC*-VU@G-QFCN3hdqE}UlV zwZvtJH5iU7+TEjWK)YANin*35qU9NBk7}q^Wr%*fd=<$m>V+fh65phw12GBF;#U?F z(;Jm3jBP!-ROdmOqjr&E2ejFP(zAiEW&x z{Tp7B`hL8#VkL%pNLf@hvV~^+54w@No~(Yf;+@S-^sAJpst8l#dKrmISl6n zpKrRCN~Bz2t~*!V|CL{&|8bWz`URRUztX@4)_9{W3x%3j)hvjQ{`u literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/gui/GuiFuseBox.png b/src/main/resources/assets/electricexpansion/textures/gui/GuiFuseBox.png new file mode 100644 index 0000000000000000000000000000000000000000..d4fdad59786b63124269781845c06dad2ef7dc2d GIT binary patch literal 1845 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fn+H>=ES4z)+>iz|hdl!0_`w zkbcR)P-?)y@G60U!DR2bLQQoCO|{#S9F5dqJ4d{r7~mKtZVz*NBqf z{Irtt#G+J&fW*wa5hJyShH1A{L`3mF)gYCT;XLn`9l-Z_{h?I_@Su`}iG ze|3MQm#)ckdIdsLW?7YgP7r(h&GDFl;=OOR(aZPl%e|lX`ijDawO{_;-}j1Djv;<^ z$<8Ut2 z@7fIg>nk<^xf80VvoahIe(>wh^XvJx`yQRlVu?@&ia)uR3Mw-l{Nfd;#H(fad0Nr^ z`kRaOb(eT2{MY{as%)D&&})$-t6NX)|8IR@zI=0PRot#kZOYfV9LjPSHYGDpkdKav4M@OO4qV9awC zctjR6F!1dMVMYtqU=^Ssdx@v7EBhS|ZXQE%rn3h@>ZD3sBT9nv(@M${i&7Z^5;OBk z^!!{y6v~YCO!W*6489aCWME)=>gnPbQW5v|&cVV%0V2*9{eAxHTBkX)o_gfh$9;k0 zW!v%zJkR&}Ki~QN{Lb^cKhLq}Sn%c7{p)s(pE)0_vRQxKrqQ2a>h$_pCWi+3#;>v; z^mvlZMVAR5+=&Uih0c>8|1q(*7 zdAbMB@O_#%1881U(_`5u_AXF+bPxJ4fvo`wBiWta1hsp@c@|wqZ-Xr?@%2S)=Z*EP z&i~`GxvzD*^5<{Kf_kC1HEZAP`TzXr`uADB{tR1>U8@t^;J0O2dqY%m_I{2C^{C6v z4r@1Vjb~XSy!NHyf@?Q!=`&sHy!J&PAUo%+IOA)V>?)2GrrW-CH?75&@w yfYrrWa!gshYyT=G%+2uSXB;(_Zh`QBUPC-rP^-qILN8%Z!RhJh=d#Wzp$P!-*o6B4 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/gui/GuiWPT.png b/src/main/resources/assets/electricexpansion/textures/gui/GuiWPT.png new file mode 100644 index 0000000000000000000000000000000000000000..f3781517067c4cc520edba8a79bd994b02cbb161 GIT binary patch literal 2006 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fn+H>=ES4z)+>iz|hdl!0_`w zkbcR)P-?)y@G60U!D5OWSF6O{z{1q0Le zNCphS-`RoX1_Nh-M`SSr1K&OnW_;ze@c>Xzs>C&-Bsf2)`vZp7)pDKttn$=ln|+z{^eVXoW*FK2f117L0Mm!5OAjaRaA3Xgj*|&!bIH3z zP&vnt@tp-kTYcXE;xTNgZURwrt0O=Z!!27!AlY!vRtL;|J5K>fJ3N;Y192P5`~zeh zetTb$zry$B4HM&+=QqByIapuV%*@ar&T28=Z~5n!cUDb*8nyVU-S*SJ_MSfVX=U%y zDrf1s%cq%Y-jwbByYJ8DZ`YUC{#@Xndgb)Dt#>j`zg~WY;q>Myr;4|*XZK&7U;MIa z+H1;q*u0mGkLwkF6QU<`ztc_R=@SS`g#k4{MPfSTVCIOwYTj5{mjGpRgn$p ztPU~<{Il7s$_g1gN%CnU!~Q($tZ)B5dzl>gxa{=mwIEM|0W5UDoW5VeH}0)o%fkF( zuebh(yM1Zz*GpuhgZ6F)L;KiN8a5h6n^!bH3VC&6s{Ya{aw~x2~22+fOOIt9dnlRs7RxGwHX}*S-Ayd&0I``mqcdx7Zq%rRu zMWfL^K0dy_zW)CHSSU0Pk;&xv_;@OnN~6&r2ue;)PDx2gO-*Gm7)&OU#bTwUrKP8*v)Sy7jEv08%-q~u z4u_MMmzSTPUr+0(Ge7-;+sIRZTfB$|%LqlU@qfjUmi9}6JP0h{CVzIcTrKPpCRU(l{rP4=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>j3zOzGJvkS zao700@cxT0)B9x(Zd~JFSVD$} zUB|LqJ+RdP)G${H*rtR;!SNrzBX|Qqhrl8!iv&E-M-i$8w;JkKO_(AujbXw-DbSCw zK%l3>5HP148m=RJ-5Mi+)|$856O<@KAj;s6Ej@tAQ6vZ!VUoZxvhi1emL{*Y)79%- z;A+%d!*T`74J;1fgCu3=)a-bxpw()LCZ$%ZvAsQo@j_>Do-8l%-mmUUC)-#HS(Z_T zWxCz&_^QA;hf)eep%es_V4NYCVsIb8d!p8qSqaIQQy?NZ#JHAr9hcv zAjY8v?nwl?S(ntM#25)-;Nd6*5{lI-aLR2-1C{04&oi#p1#*!qC5W;HCi=rTgKs`+n z5n>2f=VUaJg%Id;I<(vE+m3p-02FzFu?DlocnATlH3&qBhzP+4YW3Q>PO0_ni)!T1 k+Hr3LqQ)_v-_3OWANXGg-edlo-v9sr07*qoM6N<$g3zj1G5`Po literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/CamoPaste.png b/src/main/resources/assets/electricexpansion/textures/items/CamoPaste.png new file mode 100644 index 0000000000000000000000000000000000000000..77031c30690e7b28e0f6d0b47accba95a4eaeb90 GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={W7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`0h7I;J!GcfQS24TkI`72U@f>I@}5hcO-X(i=}MX3w{iJ5sNdVa1U3T4K6 zrh0}3249L6f>e3BIEHw5zdgvv3*;SI@ZJAy8lM6KL&IuD9t8$QGbOIIKye07S3j3^ HP6BNY=cExiB$1cpgO zK~z}7?Uqky6jvO_KeLy}i#3H4B{EiFhJFI9?o z(2GY!1f>T(=%pAu#EQ@mrqyoSkaW8uQmv_yvZx{WFT1m|yR);KOb_qP{z;`uj>C^if!BCKv7oopcbwjk7lvsez>ATepXz&(bv~-e=?a|643Ip z%Fm>+!>b_fhja!;f$e@UEAV{|HYAgLaPAxcZqww%+?<`beqDL#1RTfp;4^6muY!S2 z`0hSLRCxb2cw)kh9LxZlrHD#f8^@0yUzCJvC5}h4*k6Q&<7*lCYAwuWU_1k#gg`go zrUBhv@r(z!yk`%Uwl)Cv@83^fU!UDn0t+2)?|`!pp~nw#6)ru5H`<}U6@JY^yBFT> zfJ@K7r^1HS;GTz{?t=kryl|oV?)oHL%Q@b=4rVg&n+|(}P{_icv+!{M+6(Y^9yY9j zYzh7-LOdi=7@HLWoEqM>tKt2Q@kIh+v6vl;#q6CIFOtr{k2>rQ!(Tbjim+oH+%CY4 z0=(4)cPj$;ZV-}17|+4yYvGm-SMsna4BNu+Ixw+>2-iaR;lqbHc<>;)uJhiB6WqoACIh#gz|J5{nY_4X1yf1Y#(e#q6pquJ)7 z&X%D9SowT&0wR$J`}XZ4kw^fbsw#fJpAV%72ORf5-!VWzj&rsUFjp=wFCY?$RFC8F zIH^<$pU;P?s;pnXo;Qyip`2M7>;Q{$d|Z+VSVDliwY8z~xt<4~oSbBGa)Y1vgETQmIruw=4@qZl|ntZb+ah9qaP; zc9A%P&%`Fs!VpWZ@P9zpb+M1<=dmQ%>E$Jv!2Mz^YR54qeEGBneqkfhG)>vMb!&rb zfCmpAG(6z(cqo_4%t!$TVHCigPHGy+V% zw!rG)EB+WcH8L`y96frpdakM}SFc{h>-FLf1Xv@%Lv<~_8Q_Y4N@KB@4Uo;&n!elZ jW_)~H;Z?n=|DgT_*a#B@aJlFU00000NkvXXu0mjf)4x~b literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/CondensedElectrumDust.png b/src/main/resources/assets/electricexpansion/textures/items/CondensedElectrumDust.png new file mode 100644 index 0000000000000000000000000000000000000000..0356e0ba1ccd9f68439fc951034887b8ab4338a4 GIT binary patch literal 608 zcmV-m0-ybfP)Bm=0W4l4iv0qsdd zK~z}7?Um1K({LEZKWP%lQlxCFjw)poX;GZwO&H=uz09L0FN%L!{{;`DAbOBq1P_Ci z6|zNzI*ZUc+Wa<2<6%o?Ry3_{Lom-RFFg4?-}il!FXYOVE7$)n;ZKe2W<5GtyZ3xo zIF|tJW<9#Ob~{z`T$8=M54e*O4_~|&&MZI-_gs@O^ihk8Nq{i)5k;AfHbg0mX6lGE zFMMS~V*se#2dKqGJl6zB;9=+kP^(pGH;J-FQiL&RO^f9Yp_ zoBb>J8tkLdHqPdvH1E}Yt*@K=g~ uM1XQmx8cc!18{6RRnIzou3WkP3H<!lvI6;>1s;*b3=G^tAk28_ZrvZCAbW|YuPggqW*ARs=V?9$nLj!{^MGJwdW_h|ehD5l(?c2+FKtaGw_ORrfLx(Oc zl+lU36{5Mx@tMIKg(IIQcoYdew5z!Kx5nS|-xP}(T33YBLoXeumS4M7=fL|r%&iug z4Bd(>Vh_sSH9E-%3NQ+0a7iTZT2NQQne#i+Vd|Cx-#>HeybfHj^&Qjw^Xd%?y`lo_ z<2Y*?IXW6RY=jEVEp_Ds>z(tvfF*Q=s-H@IN04}7Tcu7)<<9#+S2B3I`njxgN@xNA D0Bdc- literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/DrawPlates.png b/src/main/resources/assets/electricexpansion/textures/items/DrawPlates.png new file mode 100644 index 0000000000000000000000000000000000000000..f6233f59790d0791b9441d6b0bb0e99b071ba283 GIT binary patch literal 1797 zcmV+g2m1JlP)A}J+AV0!=n29ilc zK~z}7?U&7O9akB~f9GRn?!9&s#~)3cI8G{(rY2Pp6)u4VQkONhuWy=!s3Zc>MHfKW z6bXS8P*o`cDnURjK&^_PQsdy**LK|WFK9|5q>_c}QV4Fo!0|`p*!SL^_ zpt4-KVSk#|*KKC8*^RLI=S^R2kldi>anj{Iku3p93jLdrey8d3GC{n*zx6a)Xflr$J z(xpq{NDw-mBs@Gf3&18JXw57ay(d^$U~&c$zqGax<#PJxjg9t>5qNrO$x9(cu4YNblo`SZka%$7Cx(7w3H*w{Eq zDJCW+C>D!2=O~p*IPVY$HabgAMdVG&+RC!e=kod)rR=H;_(8Sm=NIPbUU&~@9j(r? zAxREX(lDA%s8(f%l%)IHp#s(N(Q+w!Qr(ByNJ`Thr5`rLEPa zNy-=I=ec@ykq!a(Y0c=^C;~ybT&Aa|hbW3D7K`;jLJ-F>N-2bp3=STnv}Z5l86O{K zpg4fXW3vny1ZXKS*0GQana(VeotvpHSG9VjyW4-grIq#9uF;mJbU9C3K8HzCCQhB= z?Wrk_965qilBuaFx<1l|7sMn^~KdF(MxPE63-+l$s3 z?;JV|Fo{728k5$a*4B|4A0MZ`zsUIb82!b5lvJdtAqWG!bNtg}ylXAZ&FeV)+G{j4 z6cF3~_y=K3=6=}SO^0`M0K$XAGC z5}b1s3Wb%4@JJ=O2+V{5jSUSPns|jmp@5W9)vECaTHwKu9Zb=fJ^_#jqdA1>X7G zPv3kqKD_G@lv8YUjx3O}VK$0rXl&rn&AP22l7Z-Ff1+0&rhiad8nT z>t{6xLriK=O5&{L|0Y&w_WCTRNs7`6wepSMhgnJq9-Mb8P+Ov0bVD%b{);O<>&kwYnU7sXLg~Qq;|vUp9-c0aArXg@fBgS%f7pRZt&Ndw zF<-*MZH?*Q{2e?))cRO^O1K$IP8W76G9UZ@|G%+;kx|f5BQ_wglr$9iw^)7shc*`B ztuc>DTO2S8xmr};|rS4n($bhZ53g#>QK z3J;FI4J}7x`KC-zxW2r@!#(_a(uURp=XYxe)rTl39%SI<{8Vd|a*LTMCL`#+#;1>S zf1eNdWNnu4DB^%cf+B-^E1>{an^LB{Ts5ly0`! literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/EliteBattery.png b/src/main/resources/assets/electricexpansion/textures/items/EliteBattery.png new file mode 100644 index 0000000000000000000000000000000000000000..28b8cc5f4eb41c7cb0c6a85544573655b7b9b642 GIT binary patch literal 1244 zcmV<21S9*2P)A{caWJ~Dk!?v#I0Kc zE7xvZ5j9a0ooGN2(P)gAaqRhmX?musy6b(osOg!8ftjArR8oto+`N14x#!%fE8ctI zJ}(jRgU`dBDIz`?W#YTN-wBND7;ujyySeVnF?i+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2lgB*s<~*j6Tkof002ovPDHLkV1hvKuvY*8 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/HVInputUpgrade.png b/src/main/resources/assets/electricexpansion/textures/items/HVInputUpgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..b7dab49fa6a1b0a217f4652e11a9b9d1fae24e6f GIT binary patch literal 284 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sr#p#`HJ5Xq)r;B4q#Np%w307tviHSGwR>CMRFW;sgzwg2kBRM&_Hr?oL56TZr*N>Nwk&(%G)WFQnm(ammA<|=&aD}mX zz03jDu(eUHlMW^(CQh+z_c#e{Z$_q=WhQ?PMNx z23#?b34QQ}XA;l7?fK%R#g1-n$1)sEUNr==Usx`akeGPzR@vgNR2`kgf13ggelRfD YO;^3JX!V}8Ku0rpy85}Sb4q9e00c&3?EnA( literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/HVUpgrade.png b/src/main/resources/assets/electricexpansion/textures/items/HVUpgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..c3b2910b1a84dc39679cd6b20b33468fd1b12237 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sZIa+ARYoL&9W=KSdbAE1aYF-JD%fR4Vl$uzQ znxasiS(2gP?&%wlqL<1J6kp)!;usQfI5|Orm6=Ck;*J08hw_#+@-d2)Fv`ozx9P|4 zyKuxvPEM{(H+tKH@&nWL<0WKdWHKH#FthU|bnsS)^jIZaVQgM6bAUB$ZItVzgNccW zQ!EusOr|QaFL)ilx9XcfchmNK`9&Y@@2z&9bnwNm_Bf?G+w;X;*@Rcme-Sfb;zYwJ yfnJayUo_bxA|f_yySpMulKXVV{sa*oI|c?r1@#Q^`!UiWPk6fexvX literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/HalfVoltage.png b/src/main/resources/assets/electricexpansion/textures/items/HalfVoltage.png new file mode 100644 index 0000000000000000000000000000000000000000..6334d92d25bce368761d010dca8a009129972023 GIT binary patch literal 283 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwYnU7sbXo`PlJWyzbr;B4q#Np%w307tviHSGwR>CMRFW;sgzwg2kBRM&_Hr?oL56TZr*N>Nwk&(%G)WFQnm(ammA<|=&aD}mX zz03jDu(eUHlMW^(CQh+z_BMrKNUckxCE+6^`6EO z5kd$60AtKx;z0%gAjSx01`%PgSjhSLIhZ+vGsfWh`kF+f1EvHI03if0^M^oo0Hl<_ z%<$fWnQ?Y@CLsh|US7g`pLaz>@ZQ5Y2Wu_1+bx`PxVgEZeN29t0RX7$S}rawvbv2i zc_+FvV+=wFnSN_6QcAeJy`_EH8QljKi-nX4tE$SbD4n9Ls4heV&N*CNU5U;u-7}g2 z-F@i@6_;wET-;ilZOP17E|*zLP1BGuW*h^mVzr>suXPV0KrgBCA_}AW=53m7$b}^u-0ZKoO2z=jCMf?0mc}J2#$}B#W|N3nNFv9 z=P^cDYcZeCvlW-iWwz(R!2y^Vo6QD~kB{`NMpTxguIn6lczC#@mDy~D`}=#myu46d z*P>!hDdG9~c{~86wO|tWxFb`4YU|FVBc?+3@eh<>&kwYnU7sXdiTj`wG0f5Or9=|ArXh)PPOK0F%WTGZ?veR zw^S_Q^|hD=>jLvU7jEll&&-$WPlz}>JXSY$IU)U_Op4c1UBB|cWc6u}?^sGE`>dJ2 zd)?)8?{ArX*wq}O)|dQs>V=sLavj`frAjg^&^dkh|Ltv8XBBwPY0CFZJ=bww$@fd` zerwrpyavZwo>ww7*qrCL|21{Ty4R;a7RoR(%qea^ra9q>Yaj!|Bo#xYueJZRnZLYa z^o$D?Wl-=9Rt}n3Ij{3O)7DdqHEzw|XgV-s%C^R3nR$1k6_2dDb^YNS;a!~9_bTul zKKo#k&iv3_*I&!DIeL3-W1F-1pT6%3HXo1wha0k-%1&m^>hU}&Rgq+y|8`1YSU6A6 R5nuo@c)I$ztaD0e0s!ZSmR$e< literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/Multimeter.png b/src/main/resources/assets/electricexpansion/textures/items/Multimeter.png new file mode 100644 index 0000000000000000000000000000000000000000..4790b7e7c9ff555ff1cf156188fcf782a6cd2b36 GIT binary patch literal 952 zcmV;p14sOcP)BnPj^$}#`|14T(h zK~z}7?UqkyTvZgtfA`;;_mY~KL{lo!pe@G4g_ux+3zzEBja9_1x^Uwnh?JP5HEk13 zFt`^%v#hIH>#i!gt)wO(G#O{oP{mRyw4|B*nLqE|<08Qnb-)LLF6LVu?!BDzalUiE zd!dCETKJElnr#dW3@B?&y9gEQ3|ec_hR0fibB+)^X&MM2-AkiTTH&lk8;u0e8mx6X ziX*=L<~#YjI<^@BV{}IxC+kU)AOy75D5Ypi5<~=J42?#E5CYzNLJ++7SnF`kV67vB zKrWXHNqf=;>|`PkC&`UCiSa%qU&y1BLPW5}&}gI>>PL2Z!-Awv-se%6Np?yt=a(Ky|d@&>pMaS!pX5yIOkaVd5ylqPq2P( zgRQMCj4^a|7WnXk_c6vWH#5uV#5lEjoqD~V{d&Cc;`1_iv|lb>n3vV^qLhjY^6G0Z zNx5`Y%0Dg0Gs6S2eC>*qOFzhJc~Och-^*(0s*Jq#hOAv*l(p+ia`D2v3?A*5W3Rj{ z&Fbi;64?Fbgb+A=cADukrwQH@Lg4)Tr@VgR1jZPG_b3#`7~URvlaD_B1f}*z{{Il~MJANEv4N5734*HvfnxC&n;FW3;AJDx$UCb;dLW zpt!QUx2AZq|0zNUoSU4WxU#(KDRG?Liid`Vq$A(Ky~=M)j*k-iYNjEsnwY8CIeL5g zK*6OizRYGsB0{}ZBo$n7yLtcs0h~!h zK~z}7?Ug-C!%!54pV(CDbQhN@rIR42Q0yT16S6qC7sS;;*KQ8&Pv~#xl(A#Cjs>Zc zLQ%0&6h8=!=>^+fhuCPMrA-MUn0L#`J$c@od+xaqD^{#n|6SU=iN#`31!LuMIrR7R zdEtdZ0o%5NuT)qgT7+;=waZ8rBh%4fFO@` z(?n$R09ZFoq?A~e<>h>s08o=mgzka2TQ?<{86e0r?7MN1%_A=w2qC<+U(HO?LRfe* zGa#86ct)&LmzTvmAJ8xiYPDK4r=VJ`Du7n2>7jj7G3O@rrh zIk)F*8`Ct|J3d0lG*;>pzMNR)?zQdZIXxR=E2l*^2ZBe=N_7Ez@bzrgx2AS}re-mr zhlK--Mk9c4@ZO`&un&o)2uE?HQc;~w$J@(#`_eaprQ@)@x#5Ek`)-wYDwXT`lsvAgD1A1*CrIHVif#K;LnE@o9e_D^{#Op?8z2#e{vS Rj->zq002ovPDHLkV1hVn<>&kwYnU7sr!#g5z4Fdxslc$SgNW|gfAOHW`A9i3;Yhz?v z%$KlmTO;@Me0R@~j}zzhG+VJq{Qv*|{DBiEJU03#Iz+k2wf_Hd(s_@f;ScAA3I0!) z%#f4-0=vHzy`lfx%bhBmlRmUCY_w}-jIle$TF`prKs&>k=R0b=R`wS%MtJbdnSozB&_AGh>&xxRqGZKdh$zz?M7t9#o((7+>Pby*%P|KaKysB*7n;hE$9@tYSsDK9ao@N)XH>%f^1nXBsOEfq?eUdZoZ zn``x7WW9g8UpI%X$_3|!nE8Br%@nJ2Jy+zKr~GE+SzLQq@I3>AoonOthfnJ-0RxD^ M)78&qol`;+0Dw}G0ssI2 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/Storage1.png b/src/main/resources/assets/electricexpansion/textures/items/Storage1.png new file mode 100644 index 0000000000000000000000000000000000000000..40a458d9796050900ca8f11281033a56d51f54f1 GIT binary patch literal 1068 zcmV+{1k?M8P)A_QQYJPrT=1Gz~= zK~z}7?Uze$8&w#FpPBJ^#*>NdiQ^<{f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eXlz{zC zh8a7BAq->$XpIguPQt|?!9f4e>Hz?1a(#ScDvnr+FN_4=O37gJ7G`U*C}n~WgaQx> z!jOtz!M1G-kzinjI4*e_-uY}F?<6b++zijT4V*G9Y&W%-yOKyD(P$8$bwK2YByAf@ zIUGFr?&<*mdV6~b!UAC!Q(Pz#=#W$@MU7K~p$rVeAc{d5iYN>Sv_=4arBoe&3lKUg z;A@|9v5XEhNhgWpIw+}7(nLpkDH4dq@~h7OT1XZ<;pviJq)_nieILhh$YyI1N+1k@ zjN?V)7?fpH7hnlO1!18SR4NqC7l?>3Ek)fGbr^;slz+W;PtX0;2Uvng`f>4m5cqic z0>mJN#7bHi!dx8bwQ1_>Yu5%~2_o&s-t6?;6q8fGF+V>~rCj;*{NYC)LP~l0v*0oz z>Hyw6@D`Q8XVd0Z=H}+vy?c4{|6I$vy1LL>ugwOm6r-b~7kO{|7i?(V^#_^3Rl6fX R%X0t#002ovPDHLkV1l}A*^>YO literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/Storage3.png b/src/main/resources/assets/electricexpansion/textures/items/Storage3.png new file mode 100644 index 0000000000000000000000000000000000000000..b769d7822c9fcba46116718f48490b8997da99cb GIT binary patch literal 984 zcmV;}11J26P)BOGe%l^Fm417%4> zK~z}7?bpw19Ay~5@$Wmoc4mJhbazW5$-yG_Am-qjgH%j55YR)s=uHr8RdUfiH2;9~ z9`FZR3X0&(gW@4#rE3$d2N8@Knl$aEtxaM!jcnF*XEQrHGwh8ixB+xaTYPHItOqz#|JxeOp#hYiQIs*`L^H|KZ zsBUa<{z8#h%)xdn<}c5Y&h!BqrfCw7+e}PMv={L9*{^3nFh75ZrKOwLhDEu&!p-Z~ zF-?b19;M+2=(R3y zC6mcuS|*lbqZ|635xZ_dVQh$v+F_LTD39fy$FLuy@95Ly9)FI8=b>pDN`VaPq>>4Q zt|66b?=dWl4Y9UX=E~J&D!+r*h_Eb+L?VIbd91F?vi!?8_`Z*2nwXZcr!2JeA$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zyum&=!58^Auq=Ef#r7}0LGiQ^d0^YDHDAQeib$d07l4xOHh z@MREN|85dR5sgNJIF1R!@SripQAD%RWPWarQvm>2SXf|dbBkuP$@ca(jYgAp>j~{A zZ5oXxGcz;2FC<54er}$6tp$JMcIqfgYpDPL002ovPDHLkV1n#$$2kB1 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/UltimateBattery.png b/src/main/resources/assets/electricexpansion/textures/items/UltimateBattery.png new file mode 100644 index 0000000000000000000000000000000000000000..7d7911f0c3f83defd067a47a3d175143af588248 GIT binary patch literal 1146 zcmV-=1cm#FP)AQVp;PUrvt1P4h( zK~z}7wUgRgGewwKooHy2!4d@+$tD1f{TEPy9g5f2JYOr z@f)}i+z19D2*Je+E)q2oqv%ZN>7?)LJY4i6J((nPhjdQU9B%jF{Qp(;uewzdV-y~7 ziAY?0?s}()M6*ob`~AKj8QJ&113(V4?!{QVbB_nAsv^rWTu_k>RZ^%DTmQH$Rgf9$*ZVWx0F;*4jz@qaXra613HL-Q0a6 zI!927wrn9;atLCKSh2(yaZ2#waX4%Q6DIC&V>@j!++)yyQoFKX{*n?9onS)5U?xS# zn&lG+A>eRxGFB{B?A$x8aQA;L%O@~%^NfI-egM39Yy>NoRHp}O*E$nui0G*2p;%nn z2U?kEpp7lA^~)z<#Zvp4EX(Fvn1w)eG7;lc1CPZ6qjE%Ub3zDsKe2EYg6Nxh7Fe+d z(m-dqR&`0)mXv>$D5WqMn$Tb)I5qKzQi|HwjBamH6vgry5`dy8qAwjf?ayDo&N&i< zhDZnj5ut7>(o7hQM)KgQ>Xp_C5eWwx%Zj3ixz4yY?DX z<((64Oq9BABuOR~dGGPglcWjGIohVB*YCv#5%D@qvp{tQF2`e)2ZZ>EP)T7010qNS#tmY3ljhU3ljkVnw%H_000McNliru-2)U22^mM;pOXLp03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00!SlL_t(o!|j({h^A#3 z$A9O2C>#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rBghO+9KZSU zT^xDoH2RMRHy1-wMoeDa=9lk|Ile5MT+H#6XMTIe&TWd6l$?^w zW(^1THc?WeQ^PF_=X!tVjxCgH71sLA0iXlYP_&4#u^=jdfy2jh9%*eSw3}2?V{?z3 z@kA;xp&R_9j2S*ZMmL1VuL2(_woJ8neQk)00@m7#&jJ9i6u~PFejve!qIpG=Ad1U& z#n{R+Gx#J2u1&c6x+%VS{R~&Q1MIb5;&WH#>{z)8@1QTBmC)Z9lg0+LMnpE3gjxr5 z6(O17(f30n30YGkq6jO3HiqB+=_`Enns4#s;UA%615>Nqjq`(U9h|ukJ)kPPRPNyTA zT{cAI4R^o!h9c(%mDZXN0wTiN+M0T27yQ4|zX23m!3qW>)^z{?002ovPDHLkV1lP$ BjTry{ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/Unlimiter2.png b/src/main/resources/assets/electricexpansion/textures/items/Unlimiter2.png new file mode 100644 index 0000000000000000000000000000000000000000..f23eb32db46f18aaf1598fb0d7e2a9f560c3688e GIT binary patch literal 1939 zcmV;E2WP)T7010qNS#tmY3ljhU3ljkVnw%H_000McNliru-2)U22?<(hkM{ro03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00#F-L_t(o!|j(_j9q0F z$A9bF-`;1RGjnE2r!AcWg%R5rixMs-no3B87ZooU4Iv7K2SS2qxI`eu%LoyqieSJ8 z60Z+L2!se4fe-#cUcO)c z>%Z2@g8#>VIpj#mty{OMa}HIdC<>~odh>bj|Krc*=H}$609&?f(Je-(x;>mKnFx|v zqK^y)UEHuDK}hnHZoi;uGwQV(HqR(a$G}$@n__&0AtlBVje?cPgQY(V!oC$C#)uyd z`PgS1dtT}A(B93AHtHNa)S=(ETyfR`#v8)@KMpLEj)l^(PCX|znxu&`IX+IBWem$c za|1_`juJZ^oCu;=3!3PT?mx0Z^CmW~CRaPid*{#-0^{a4oV;&8}S zH?O5%DF!ILTOL3zKsH{9oO2U07z_v+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LLW1BFp4G_w{Jb3XFln_~y3%7qRo`^Ci2O_5dyg@O7$d4myWN)m--7>h Z@prh#xGxIT(Io%?002ovPDHLkV1kBFY})_; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/Unlimiter3.png b/src/main/resources/assets/electricexpansion/textures/items/Unlimiter3.png new file mode 100644 index 0000000000000000000000000000000000000000..f336956ff5adcab4d5be1db89d6520a4dfe5a11b GIT binary patch literal 1976 zcmV;p2S@mcP)T7010qNS#tmY3ljhU3ljkVnw%H_000McNliru-2)U22sve|jv4>}03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00$gNL_t(o!|j(@j9kSP zhQC_w?b|(zjn{FTfq@tZpnzC{gmH`)61;?fP{bAyp)5#(3g<-QW0Y?r28xI(mVeEE$dZxQ?_q}ziP97`~WM;%9FUbSHR4?bD>Z?3=LWU2xT^RpOjOL`c(=JkQ@7MN$0Mi;azqePBI%bYS`N<>Ho}ODoHf!l86b z*(hQaXiavYa42htlp#%<#65kK%4K3>aV{fIJ49BKdyPpnt`ks32*Fb25jh&-0{|fe zx_QB!=WSmM0I(5*{hptXY(Oa(uT7zJiTa@f-1PT#3=TwyF~pTV zRPgB7;&nmna%!XRaA^N1V|zwOM@Knat6^M@Hg?)$`9RcKOPXb@e`GaE7kD3d?z!hM z#xQ^097-k4C6BEpG7*LIn536T8`@Ypg{R)?Vsx9rdnkm=Pv8{j;HL%90CFGl`mc~D ze}H)J$@4Dvto{?Xp1B2u6vGNPd>(lI8aV5=n_F|%FW`Osr z*=!P2VBG^NF-e&`&)B_tH))!pwL!<0OCJ3cuJC9A#zYttnG>25f@B$K+956{Or?Pk zK)lDdo3rykmSyxr6@Gp8A2`^BJ2sc-sgwvlp(s4JEZfTQOCr9seI-v^w-euWpkofV zQfiGO(={?76ghcr&=zbIQJS-mbT$A0MV517wZe@LpN|^S^!N6{REqbWTVI2%=RS*# zD~J;|ZaSYl1S;izoDv8rjZEV*M+gCBN+b)9rJJQQXF%>l_Km~-8eDrf#F6Eit*eQ9 zEJY{daIMDNzPYFte3+hc_&!;<$(BU)+Ix?G(fb)>y_y zJ>TE?8C-BE@33iwtkXsWio65eF4k6N1~^(BCnU{`U3a{!2CpBId%rxwRNe9mzm#o1 z+N$PXF<*+jOW}p0C|EGJMDPXot^W%hABdHrKQ@?tOQ}-99aa=B2jFkFBlG)VUN7`r zhng0^XDtp)j^)#inLW=t!4bM0~Ha9Nlcuu?dqpcUh($0i`Ems(A1VlUsCk3kw5?Am(XYD=b5cl-+laFt~=Wga(aI^_E z&?a!@BWobmC=A|Z1Ud3pSqX@V5TBtW!xuR^v2?tkw8tbRtRxgcc5-*KmN@7nF`9T)bErg-rTElL097)4{UO)0WyG$Jy)N*JuhxC}`w4{UfE zBal=yB7N{;KwHbhPv6MuGj3wbj$fi9#qYO#kxp9Yv_-#R{Oyf2Y7PWG`<-3feDV{7 zaPogu7P(R+DnX*0GmiZ+k8N8+xth}O3MInk zD_-EucO(1^pIJTa5h#UL1%vrMyp9;`ya7Q|ZSJ9+<<#p9ChG?&oFL-xJ}2!=@$~Mm zbN-o65^_hond7pI4Vym6*PdE|1ULIzP;^q_IA(Zwm=o8X&hYRsLl>XK@bEAvZ9EmF zHOK@tp6TvW literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/items/Unlimiter4.png b/src/main/resources/assets/electricexpansion/textures/items/Unlimiter4.png new file mode 100644 index 0000000000000000000000000000000000000000..b04ee570b58879147bbec2aa5cb9a0e071d2b19f GIT binary patch literal 1813 zcmV+w2kQ8VP)T7010qNS#tmY3ljhU3ljkVnw%H_000McNliru-2)U22rA(f&%^)#03B&m zSad^gZEa<4bN~PV002XBWnpw>WFU8GbZ8()Nlj2>E@cM*00wzUL_t(o!|j(_h+S71 z$A4?BeVa44bkfP?I1|T^AoQWW=Ru=IG0`*?B&iikAJn21t5(z|CJn?1H4!PIphD5A zv{h?MOmJdB1g98-Xj@2WNt(pe%q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kKa)jM~=|GV)Y!riGKWEz*|00000NkvXXu0mjf D2CZ6o literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/CopperLogisticsWire.png b/src/main/resources/assets/electricexpansion/textures/models/CopperLogisticsWire.png new file mode 100644 index 0000000000000000000000000000000000000000..8b2d57b8894baca6d61fec63037f625c8898fc11 GIT binary patch literal 1023 zcmVN2bPDNB8 zb~7$DE-^4L^m3s900VnTL_t(&L+zQ{joUB~MOB932Vfh18~$;+*zI8(ND)Ck(m`5D zeTpwvM;X(UNNOnqN!9>CQ5+4)J8!zGyx(H6sMqUtt$s3@xM$n@^r_>+;ox{(uUFSs zKkK`3`~KzI`+VY0e8r3J?K;(s7w^yKa~fYA{Ojwn{_*yuKAlbu2*!F&+}8uyd_J$I z)2VBE)~08(nR{NXR<3vaGXa1Xd^Luzc)?eoCIKrV9bSh90LC8yK)ld^<#Oo&(559J z+vfrxzG#5>N(11B2579gBmkuDG#waIz%+(xfHrEiK%2JGLJNihV6_Xr;$^if2tdr{ zWAj~rXhS+Qk_P}u+-kt(a&Z!qjUp)|sSl0bqTQ;~TU2*nA%V_zo>>ZPOjH zadwgvbZ7#$%XjLn23Q~EqCn&A@d4U%h%Xx8_}#v7eaz-#^C>2P+DfAM0X%e{ALs%A z(}FL&LVm!HGKBROfT2$9^Sgf?0jv6Cf+Q13@$^X<=6G_rg$a3Anw*VoxeE`CCb{br zqqou~JlQ^Xp`p6Z>pj9|v#HgzIrG^m(w(s=JTxfG84=-Nsr^As;OXaPE?45v> zpy;;Stpi7Gx7)Qn8@KdbQnz;v4;mLhU=#qzy|H&~RtHj3%K7X2%iX02C9Qyi&gSy$ zJLW@T^YAHsXv^=91~j=e8lZ#efc9VlMp7rAwi-ZguJ2mG`933e+%Os)016W%f+}(s z;F|#epaIqdY=VR>+uT9#G)8l5Z|N+MqXSSZY>dPx2LNp$MnBRvpU1ZK-eWKM-`4^U zxqoIN}M>nA~)3uS_#S|DaZvH66pmm%RVBMU%REnxr9jMW0x=KWIG zFMRA6+A^n0;G%;dRe_+IzpEDDD%r0FL$v_5Oo{84zMA*TV_P~WY`qMLG{6S{^|${G tx;(%6GeH2vYJpH9-@EfTr>BlE)ey{)l002ovPDHLkV1jKH+4TSb literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/CopperRSWire.png b/src/main/resources/assets/electricexpansion/textures/models/CopperRSWire.png new file mode 100644 index 0000000000000000000000000000000000000000..4345ecdbffbfb665c4374361df9dddfafa5656ec GIT binary patch literal 877 zcmV-z1CsoSP)N2bPDNB8 zb~7$DE-^4L^m3s900QYrL_t(&L+zMLj@vK{hJB16?>F)Ug7g-h3v|_8SKajjgD$%0 z1$vX7PxUA8A1JC~*-nE59TOl#iqvnB5~V0bOrz1reJKj}spMX-=jQXddnsl5(9Nwe zZ8jT^bv~bc8|!NK`@L^%SeC$9EEeu?IJn(z=a$Q*Td&u??{qr3)oS%-L*8z;)%XPd z^=0dReE#5GEfLa@&8;ypmPEqH(rJ}&$*>K}l5j%oSPwaikC9*rS_zPjY;KJSEUIq z*=*)pzSrbC;7%r!H(X(ZE5<$^k9|Mw1%9sP+nxzbgv`T?f%!NS!lsEFk4KM(AN^In zx8f!-39PE-b9NtXg7~=nw7p@*D52=c@=a} zfOTg!NdQU1R|%93OIL!y3+;9A{~0MbZF44~39&sjK{5UKNv2hzSXG0~mQYSNnER8m zu8$M2wkn6z@9!VIo&L}lyL@$;V>8%`npg6Kq2z^j>9QNl{YinO5)cNae)+18R;M|3 zgZ0nUu%`K^C)8tmtQ*YziR(?<8rEuXN>c(bI{mWYr_zB5JYG4iD6H`*UE^Tn7^kC- z9z>}ve9IQ?-U8(~9jai2Ix=wTK2HU*_w4$)ar*w^jkz<_uQc?T?sQUE+(swzV00000NkvXXu0mjf DV(Xx~ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/CopperSwitchWireOff.png b/src/main/resources/assets/electricexpansion/textures/models/CopperSwitchWireOff.png new file mode 100644 index 0000000000000000000000000000000000000000..6d733b317b263bdbbf4924e41e65608d11059157 GIT binary patch literal 961 zcmV;y13vtTP)N2bPDNB8 zb~7$DE-^4L^m3s900TWqL_t(&L+zPsj@vK{gma7_4^{yWLX%IhlMJ z^Zs~$UxO>G$M0<&Ve$TQxuo@qxH|aH&r|d3$47HMpA!*`^;`sK5m+o1&1^PHP0!l& zd_GUl>-9SI!mlL&EO0djS6JZc@GlV{Ast?ah5*LjAwXDIz-qNh1ZdOJkoUC&2p0_cD z%|n1R?iO&pUX#Y;qi70^CYQMTH0$JWa~6=pm14ENaJhpfC7&+0i=ARM3-JyluHMdP1)@m2-8ck}~=}q3XO?dLYcA>7( zq;{R&5Ez1u^!@670B^$NkbegUxTZ+eS^Bqp!IH ziPhdK-BshAo=>OK_XawjWe1lEpA z1ot*ip@Yfuy<8?6lOWCIGQnIeP;#Ntd~XLV0r4**C!nns@PBBQY6188SPI9&$H&N) z_TAgO4uV!ig2G)}Ex@PbSPkZC0eqPfHon2`JS9 jxkM^jMebwk*cR{`b>`DZAhtmH00000NkvXXu0mjf_L{;~ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/CopperSwitchWireOn.png b/src/main/resources/assets/electricexpansion/textures/models/CopperSwitchWireOn.png new file mode 100644 index 0000000000000000000000000000000000000000..d1cf23123b6ede15eee708532b84ec7ebf3d3899 GIT binary patch literal 962 zcmV;z13mnSP)N2bPDNB8 zb~7$DE-^4L^m3s900TZrL_t(&L+zPsj@vK{gtOgC1bF~Skav(j=`nhTUZCgbX?mUB z$HfTvf>}b2EU#mrZ59w@Sqvo&ha%~nOv2xCxokF@O{0D~ou+5+qkPx#@pw$SZns&! zo28~_ZF)YRr|0#0oqFl71pr;>)fm0fg%Ad5Q#uGed_n0ypVVNtD(PqR)=Z;k;uy)vxUmtO9mNy+C+^N#@F?ttd< zO&Sc4g^-hl931@DT~7cYe>fZxXxt~#jm2|%1%Tf{NpH#LOY@Ha;O@}E?wdL!RF|cY zg9-R9zf?K3o^yI(fO`EV=`HzuX}*gKKwDXqdw?7I(LK-x0Ir2zbmi`W z7-b0ScL4fcYOmk@>j*gY$plFzI>pnGGR&vhK{u;6T{hlo7w#KPYS$S|-mOh|^1gPV zzR{$1ox$W4yC1dMh5AO5+I0q#CtR>`g$-||g(8C(du564xR%HL(mGF@-)^^!nl?vY za|sfwy;r)c#ydTqPN(}jJu~;TgGI$U9J#b8?-ufJ0&YRc?RL8aj@o{|zxU{O`8KQj zw}!}q(EuR##^1GB9Z1b{bPt7+6>vE@HeR|zO7o)upo5T0!vGyj@5#Bbj;u~T?F>Lp zzhmR^&Zr%a1^|T#7U8gb3y5w205HH^z!M~V*>eZI(-`J>?{W_0Xh6IcdLi%;f&ac1 zh`E1lA`}Vrss*0(wfSkDJ9M1>>uP~m4#(WSguFso3~e#|X`axC?C7a*+d)2C3q$~G z$0dLVo2Sr$@_a8BWn&Vgxm+fgs|89fRGJ^`fF(uz%g6y}s|EZYnx$I6eLj}LvGDOR zvZZ|wHm`$VRe_*z*H#PgDLGbyxmo~Uro@e-~Tr#%Qyg~ kS|FE5MONfKwvNq!KN?R2!63FTU;qFB07*qoM6N<$f?2Y)_W%F@ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/HVLogisticsWire.png b/src/main/resources/assets/electricexpansion/textures/models/HVLogisticsWire.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba14c5b37e04b670d9865f5b2918c5e5b647c4d GIT binary patch literal 964 zcmV;#13UbQP)N2bPDNB8 zb~7$DE-^4L^m3s900TftL_t(&L+zPuZrd;nhI5P{A3zf1s|oTa$JnKIiJhoFc7q;a z=kWTfdkmJ5BU5z@Y)b(_Rzy?c%a;=APA2Yexm-4z&8AU5oleuU?Y(^8@$q;}x~|vj z-G1`zdzz2vl}_~9b+m7OKcCP2^vdwp*PqSX+pp$yIwc?&>$&g7yxd~3XlAonYI@ej z=JR=aUa!}wPx^xZpbNbkqgMc+SD^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)yTWIG`Zw4*DkqO{&!u^e6r@p~zOX)Ug+!>)g zioWLz;6>)Q3_d?xQ0z4Bw-`TfjppNody>vFVBMLy1XRr&Ndv0{%17lZ!SMNbodn-a zG&n7DI-(A-Jk>!d_26VvDpAa;(H6H*$v2wEi?XhdGhi)Mozldq_gLb>dYsXo?Rh0n z97>*#%U9fJ9xob5E&)2F>6Ge)RUM^p#EmvSQ~jRipC0e0@zgh(#|zh+mNlx`;FM+y zp!n1)22NWCW#H+|X+}}C&-rSHVy8SGCja&C@~700+!DTJi9X)~$9B3c;P5`S!I~rK zj6dH3iEpsl;CF)bY z1yGMO+RyP8;D2>|;fNdU^DUqmMb$p%s~w7+@;p{rtv~inj;tMnW~%@I002ovPDHLk FV1mlhz)%1H literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/HVSwitchWireOff.png b/src/main/resources/assets/electricexpansion/textures/models/HVSwitchWireOff.png new file mode 100644 index 0000000000000000000000000000000000000000..8706ebcbb1c86c23da61b1ca460bbeeadaac9ff9 GIT binary patch literal 964 zcmV;#13UbQP)N2bPDNB8 zb~7$DE-^4L^m3s900TftL_t(&L+zPsj@vK{gma7_4(`kD4KFW6;ACJd`b-UeC|6?-w zGUom9{=NoRSdZV^I>O@p<#I{u6>)X&kB^_t=jX5Hd_E^480)zR&?2x{ESlMDmYSZm z>G^z~p4aPj>V;oR09fE^46d-i)!{o4AR!%IhlT*g-yuL)SiowvN(5-r(vbJH1PB)k z5Uwl@JS;$C&2=I`=1$XraRpqXuLWqMZUx%3YYQvrOMqJ!xWaPl$`VlW`OslakMu=ARM3-GQ0QH)&Xa zG=!WqcHX6_2iU7ZZ5^l-oOY_eN;O@}E?wiS1@3*})g&dZE z@A5nKZUKHr2^V?p0PQ)4iv=XyKkFyllFygsySM;mD~)mwa6>=42ige0wZH`{cMrrU zLs)+h(Dzb%|L$LBz)hb_kYu7$JRK>+e3>3}vwBOHjkVf^`$m)6bq14nZ4;inuU)8b zG^t%@FnPu9XRUUjzR{$1ox$V@7i?T%!&_;gXhDp<#E5X&dcVv+ijz!&C%Cf zg2Za?mF}wXPS2;)>G4j_%)RVj5m<*KmzK%9hWwj=Yfy5#-7b-%w%_j`J@_u)rgi_; z5UpS|0?57bcWqV&Qu7?$L!o3vTuzRSm+p|#{AdK|Amq|mfDWejxNy?0_X8{$=C@wABLs56x07;65Kq;aK?i z7}?Uk2bN2bPDNB8 zb~7$DE-^4L^m3s900S{eL_t(&L+zPsZrd;rgp>9Xh97`!_-*))uiabZM^Dfkq32LB zEIwnppiEJb1tfIL-&)diFl9?>asl4oTMadcE8K z`2L#aYvf8Ma(y42oA>AQxtm-m{`U5>d4K=ioKB|%1Yj?nX@Avx~-I0sMb8-a$cZC2*a!Wp6n!g7CcZW81-;|O>7FmjQFab;PJN3>0 zzoR6V_1pnEb4jjTEy*qUd}+Rm3qV_0lzV_1I(H9v*hRsd3m_L+xqBc+8N&JvfWDX7 z^LJkz0jEBcB$?uWda8%=8W8Eie_f`cn;cq?rb8N}E_9J1qH9`{T8JZyfm*)(c89DU6tNE+G^m(-rnh%xrZqh1xq3-iL>7z&fYQeZ zfD}^m9Nj~q01$AwbsW5Ohm__=13-$%x19k}Oz+9Lv5u@x-t7!voqor`RAgs z=xg)CJa_0g{po6fSPsYBzJ$C&SqyD4{Ar%h$lB3U;WkA+S_?z~YsV#k2b-tRf%1GW z7iD7-q`6!sn5zX!E>xNyOu>>M{$=CGHsuWYW zYpVtLlpL$UTrGevQ{u+bSM#wv_R@JU1xteXCj|^Z$y_bq0F-KhTp|@&k^9&>HUs_u XFRx`iFmQbQ00000NkvXXu0mjfr~9BN literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/InsulatedCopperWire.png b/src/main/resources/assets/electricexpansion/textures/models/InsulatedCopperWire.png new file mode 100644 index 0000000000000000000000000000000000000000..15e4313846ace9c2a2aa5a4b615eecacf046943f GIT binary patch literal 851 zcmV-Z1FZasP)N2bPDNB8 zb~7$DE-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a/src/main/resources/assets/electricexpansion/textures/models/InsulatedSCWire.png b/src/main/resources/assets/electricexpansion/textures/models/InsulatedSCWire.png new file mode 100644 index 0000000000000000000000000000000000000000..78f34a2de5e3dd1ddb142ffff8b0f54d8f540eee GIT binary patch literal 820 zcmV-41Izr0P)N2bPDNB8 zb~7$DE-^4L^m3s900OW{L_t(&L+zOhjvFBihI5Q4@3-<&6y>_TKrho1^eh$4NA{1r z2nNW`Y`5Bpgn+^MG4^i{P6mVE$N+d&+d3Uy3JEOF48Q<9hZPthiC;o{$>fX>!$Q#-7UcHOI=CEC>=MI5 z7T|r$f+v2>!Bes&c?7Sb1d5@g=on%u1Y)x66O%8+jber|UOP{DD#Wqz4-HXEKmec3c*SV-P zwOWO8ZjqVOQ+vmN4sMv88G)!L7Xn`{N5FuO3mileJyaOdS45?mALwg8iRb7THr6ElIN2bPDNB8 zb~7$DE-^4L^m3s900N*%L_t(&L+zQ#ZUZ3X2xOeT5xY?#fnX#rrz*8;%l$O2}wnYRGI z;N)$~Tnzxol?CW@IcWgE0sw&LSOp+t<+tSmC|Y9$r9dN>P0G4tVWAap`qm2G<>xkB zG9Obme2-H_2^2#~nPZGE#mhRk$c?T4$;Wdspfo0geAfRlLzLlJ$k*@pKg0^lD*$Xv zDwUh!^8hsYd~QBvs^NR5)5*ms1G*7?H|R|b{M zq!OB4`!#8Oqp1Z*QJbh%v78J1x)^~4+!6!Gy{!u|4vBeESkD-Yd=mm)Ezs2hZ`aeJt`-Pt zgIZ6_)dIEhTIcU-fvy(#_#dHSfvp8nNfYLo%k^{ft(&+OxTO~0t{p)BZ7slEI{^Ia iS|GgJmu3BxTHpm<@XIoFQ^Iio0000N2bPDNB8 zb~7$DE-^4L^m3s900OQ_L_t(&L+zN$jw2xqMe`X^-f!ilD9X3aW|qBa^$*PVF>`3$ zmWP1?YLavoL_$E}GUoc)!8I5JKj+*a*TQ#7=KKBLtyU{{yWM;r&h`9sI{EbyoyeeP zyf1ZMWO6HO7a-p<6$P|MBy~y}keXGyDW2oR=DBKp00y47J!>@ppjQl#ckwg;zyJW?IjjJLfAr_*o?5Q~K>*aSpj1Bqa7eLB3=3I+ z_bm&)^!Eio@5Ky_>BOrTfngXaI)<_eftW0N#pFx%Ms=3Nd{<8B0>Hj!;~yGg49~*- zhr{7txx&f{fIfOt`+G!lG2gY`1%Q3;a=Exz3-gqc^GZSs_4T;xCGXr7?7m zQ930X3xQI-Nu8kq)}yI7x9_BqRf$Y#qU$5a{x9`=IfHWO5R0}cJJ()Rv`;S7a`rrZ zor_9Wt2HS1Z&R!9;qsx!b%UzCsaXcp{+m4fkX;*aMeS;}#^plb<#GfJ_@5lW-P?u` z^RThbRo2Qer_};{cX|G^X#k<#hJ~eeY;(X%ff!4$lJA>jdjp`uiSE{L%E-_#=E!of zkg<4{F}OmM3*!WcA?zSu3agW8q`L4A(XP76!rC z;(*H90syba7$7;`699^3YH`MV>0wN-HO6+X=TFT6Fu($!!$Ni3su^dy&=qBF~xDx`c7HGA==jUm)Rtp5RL2abvYJpmP50`JXKw&MA@zd)ET7YA}@#UZEEF4UK)SE+N2bPDNB8 zb~7$DE-^4L^m3s9009I^L_t(&L+zE(4Z<)CM6(XxjKK~pz#PmS1Ud&Ry;MrBQX24+ z-cMy8wh=TL&-*pMecUb|@mR)knf6&sv^QaSCd)I?zNK!)V;MhKtskrw?M+yo$?{CJ ze_;V$ly$?hMnqhJ)r^R^l-QNLDC>r0jfl7cs~Hh-K@bE%(8AuC%B$mujA_IHgyF5H zCCbiC9ANSRa?Xd_MI7KC4q!{FBCf!e_M&VTwt(seHr$AaE3g_b%64H3s4fLtKy@kD z0;)^F7EtZN{@{9kw>3%zTR^po*$0@8GQ9P+MA^BqVdDUCfH=VK9)JxuBH{|H#*4D~ m*te^SxB^?+i?U!YDZK!w`&zjzEBP7#00004V=yZ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/RawHVWire.png b/src/main/resources/assets/electricexpansion/textures/models/RawHVWire.png new file mode 100644 index 0000000000000000000000000000000000000000..62dec77b4de43196d93df7411e9cd23639814dfb GIT binary patch literal 390 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!3HE3&8=$zQY`6?zK#qG8~eHcB(eheoCO|{ z#S9F52SJ!|$HeTnKtZVz*NBqf{Irtt#G+J&fW*wa5hJyShH1A{L`3mF&~ znLJ$_Lo%G-PQA!`$biRX^Z$sy3C(>6WE>alPFOnKt5bU^qy5XjA>R_E9ffaxPp{jZ z+uvXDrfsKJ-87-Mz9Dj8~- ztI}MKEM2lL#Wm7gE8FFWXvo=)4(=uejwZ31^r|@7@Dv|qz6TQXY;^<6@*gow=ATf! z?~dLhhW`Z&dM`x_S+{NxO bPjfGWVb_ZG=NlqG0n6a&>gTe~DWM4f)2N)C literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/RawSCWire.png b/src/main/resources/assets/electricexpansion/textures/models/RawSCWire.png new file mode 100644 index 0000000000000000000000000000000000000000..b070b233c7060444662894b4e61aaee80a32fc33 GIT binary patch literal 393 zcmV;40e1e0P)<{98gxZibW?9;ba!ELWdKlNX>N2bPDNB8 zb~7$DE-^4L^m3s9009L_L_t(&L+zQ-4Z|P|MA?6ZF3@E+#fMpp}0AQv`S04)iw0w5Gah13OF#Ij@49M_mAXHh}RcDDQfKrvUxBkNF n8o3s6cCU~8rUlRf>yEx(LSD14Yh`T=00000NkvXXu0mjf!)%&F literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/RawSilverWire.png b/src/main/resources/assets/electricexpansion/textures/models/RawSilverWire.png new file mode 100644 index 0000000000000000000000000000000000000000..10af6af31a7efc45719687d80a3cea84489bac5a GIT binary patch literal 392 zcmV;30eAk1P)N2bPDNB8 zb~7$DE-^4L^m3s9009I^L_t(&L+zD84#F@D1oQtlapTH~13%y$L7;W8(oLmgE2ROC zG?&U=Y$IqgZue(?d$~S7;<1e7GVQaNXm7&uOqOS&eM{Yp$1;AfT0dAV+MBREljWIc z|H1;iDC>r0jfl7cs~Hh-DX}YgQPvI18WC{?Rx={vf*=TjpoP6Nl~>0R8PkXZ2*X=X zOO&0PIKboslN2bPDNB8 zb~7$DE-^4L^m3s9009F@L_t(&L+zEp3IZ_xN~Gh`0i)84+D0;CgN2bPDNB8 zb~7$DE-^4L^m3s900US_L_t(&L+zPsuG%mVg;@sTApzoz_`@=~sj`Uv>jt`+uApnF zQjRYlIv5AXxgkU>W9N&c=kS~Z#v#?w}IE`bPE08 zTXi?Sz5nv{W4_@}e8r3PzR%#oi}#1ap&4IY{MXO#RrUKvwcqc9AQ-tJaYw-McnlhojiMDL)WL8N&Ka0BxPxd)>b-0f#=BAjw3dc-m8j`8qvZ!i2mlP0q$!>BeoNN$EbF z(Yv+@Pu`bq)Ha%w?$a5)V)wIFx>4I`Qo2uP^n?ozuCQ^}GCRcxV(gVAyyLw*?ss;f zQbx<=vQpFG=u4a+vD$m3yK21C^KQ4hz0)&urRQx;ugj533-YcZ|0duX6y0jI3c^ua zuh+MpgE)Pi*8N+<1L9iWsBj^>OyLsqkAY6tpt~%WBZ&B$;}sDqdj>*z%`c! z0lJvplXIgTX`Ou95dfXm-A)qwjM8!YE0wLJFhL_+mTv*E86W@<;3nV+61MEQgWhQj za=drCJ3*FR=S}^VKvxp@?`wgF+`ljpiWTv$1zz;Exhup!@aZ~E|8=#1m%@BOElGtH z%Hq%#hd<2|8lmky6|RHOXKR62fW_mNVLM_>p#$X6wjdiPL7Gctf~i^{XF|F8zV1KZ zFC!N~T`k~$Xy$4GxB0jfjtd_jL))7GbP=>FA*e2>s|EO!99M&>S^!(7#EnZ|&Bx`j zm(INjKnREh0Q~*G!I0-)|4i^|u&x$JB~mdeQXgCUM8NrcuKobzDVMyH`hKqf0000< KMNUMnLSTY1k<0o3 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/SCRSWire.png b/src/main/resources/assets/electricexpansion/textures/models/SCRSWire.png new file mode 100644 index 0000000000000000000000000000000000000000..1e2a026b6a22fd012f65659e3cae4bd3e7595509 GIT binary patch literal 973 zcmV;;12X)HP)N2bPDNB8 zb~7$DE-^4L^m3s900T)$L_t(&L+zOBt=ljRg*`@)_ZxWvLDuL3U7!nef&T6S{nG`y zOeg3ph3ZexxnNY;vh%nxaB~1cq)44elqlONVvI&3_oXP@=TdsTo}16-?o+ALhh3sT z+G4ZWc&_vL?AzE@yWj798-`^8&tkD~hr_|`c00FRF5P;)_I;<*$*oqaHy`?TyRGJD zVJ!U5@1M^7{pG%uy0y_mXlpQ*L?Y<2X_av4NEnudcr15pTdCzI0XSJKi&g?;qleJe zfD7&)p~Yr`*tV^mU;^U(UW)XurHGR`(@$S*0(7)F<_tzC2LzqL935hE5SJB>;BYu} z{eIsIIx-jxd^?-Xe9P~(DFJvVlgS&exZ#!HACJerpZ0=3SMyEogc$TO5i*Z32I0q< z5I#-hcszPO;^?o7h5HuXBqs~2tNEPYuQ&mITyZ+y2xF8`Y;?t;D=rlq^XjOlVyk%n zmwj z+yQ)%*^Z4U0{y^(LQ*BN2Pmi@@e{2Vu$Aib4jy0m);FhKY z5N!J8BaYJH$kWHdw7>IntlsZfus?u1j7@*Ysu_2Vp9M^(2pe)?@Je(j)*3$!2OTY&%7 vu@#3u(7wI}w4;c|r)-Tw&|{v*qA30W&&S)LUFSz-00000NkvXXu0mjfvF_0} literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/SCSwitchWireOff.png b/src/main/resources/assets/electricexpansion/textures/models/SCSwitchWireOff.png new file mode 100644 index 0000000000000000000000000000000000000000..0c108bbcd7e4fcf82ae468feff1843141e48b255 GIT binary patch literal 965 zcmV;$13LVPP)N2bPDNB8 zb~7$DE-^4L^m3s900TiuL_t(&L+zPsjv6r#ggFM{Apzoz_`@}F#9Sbk$q90nXp*w{ zP;JYD$Lug62`gD1k4@XIu71sqM&WNhpEs-3s!=~4kJGdFaedeEe!ow$E|*K{zl=s7 z#=PHO-`B{MtlRHxAIakV>2yl_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H)PvH+BPzBJzk zh&H4{V|f6O#hn4y>or+SK8mHVsMf}(StqAA$AFw(8CL5{FL%(Sx8(Ds`9}b7cW7bvO&t=d%Tma} z1bmm@sdonW9VNZUa|dY8IlVAIy?&GQmVCZ6-^B%>tt`qtzzzNA9%usq*FrD4a`!-t zGKBRz0DUjD*YEyy1f2S0f+Q22;^{~k=F{w;o7I~x8*jA>_l+jC>kKCE)+Ri8U%OD> zXi~e*VDgIHk6P_QeWOY3I)lj*F4(xjhPTo}kwJ{TvP5@W%j14&ou|!jx7$Wdo1?F} z1c}w&E8SJ&ot{sp)BT;EnS0v7qGBD6Tw0WO3;8zzx1i*9yIlfDZNJ~&d-S_}o7MeW zLuA2d0FZm*@7k;mq~zL$%#F$vOKE)&ev0wotJ%@20Kk|O?POZf^RYbk(s{50mK2Er5di4#{~MHL9Dq_S jkV~W@D{>!O$7aAE7lUremapMy00000NkvXXu0mjf#?{4S literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/SilverLogisticsWire.png b/src/main/resources/assets/electricexpansion/textures/models/SilverLogisticsWire.png new file mode 100644 index 0000000000000000000000000000000000000000..45908585dda6355b921c98e4df1574f751f86edb GIT binary patch literal 985 zcmV;~119{5P)N2bPDNB8 zb~7$DE-^4L^m3s900UJ?L_t(&L+zPc&e|{#g|iIAMFPYf@xn5?scxdn>04j>)Q9e% z>qt2+A37KZ$N58~wjf!KjopxF1@W4Fz4 z$*Z%Irl11}*e>hTI|AHCg(z_K_V@suImH(Q1b&w_q0iZTZoZ8P09$DkKY)jR<_DSt zfN8-OUMW8iM;XHUO#oe;+I!u7gQxi|K%!|Fn6o}+sx6s-i8qGS7<56R6JUZXpCK)^MZ z1_8R5-jj2q9ci6>+7SSq*4<7L`;5|Y_bZjHq%c7vT$XPEu^Au$5a1@@2@5Sb)Xjmti|%OrZnh(Y7EPCqbG^WrC?%AZJ3k`JwJ# z@t2Vcps5z{KQwc-fZKdr3deN2bPDNB8 zb~7$DE-^4L^m3s900SpUL_t(&L+zN!jTJKQIYIe6qGd*w@P+%47^EX-CMD=1BkH_vyujf7&+VA(>VzF?a3Y$87 zgVmPpcI&w=my0iBU*+L&@TE1&3Ovi@(jAXSx8LvGYPE8k&BoWA&u6z@uU}%=yWOsw zpMn4U_1FFW^W?r+BIIKmthUgWM55U8DV1>9s5Q%qctY;j4>ikAkijx&B|tv5!Dd5JI z@_gW^FT>u;o8)9*WqUps_oGb+9~Vx`8>NjBijOTEws0wI%&VoI!rtQjhZ6@7U=2{d zz-4hi+JrzZ95#FOmWH@8Y|Kl4QaEXq?`QXXE}q%~)P+kGn=6Pbit9->?b(;&;~b#w z78dTNyk(r7yoKC4EL$t#(%0$Fd4M)qI=S1#VC@lpVrs8p$G*WT3j^ms;$VU!^sx=r z9*JjsHk)1f2CFQz3r}wbEx(ls;BmtJjbg{X!759W+vHtEdlYSQ2Jj*aw+uc%Tu|&d z9&Ryy-WtvO3HKzOWx%>K>m-1rfmH(KqwG;!)fEOB8&oY7wGc_mLAN?sV3uei}XUNn$Y0(45# zDb)+BI!fV)8?Aq)hI^WSdO|;r$G*`#Ubx=0tWnJdr!-pt#iw2|aN0U31CM7;Gm5Hx z%2zuSJLdT?!Zr5ce(rWsBB>>O&l2t40!2IB7I1_MdZf z_K5Z<+T;xA-U3C^z$$_AQTa+Rd||u_|EtM8ZvpvA6tk+|0`Zoq>wA*75M^B-XTVyj zI;DwIA7Y7X21A_D{vU4v{#VBrj=0fwZvo9Hs`e>g?NIEP=dsf3Jp&CLbEBpj1WW(` N002ovPDHLkV1muMw^aZD literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/SilverSwitchWireOff.png b/src/main/resources/assets/electricexpansion/textures/models/SilverSwitchWireOff.png new file mode 100644 index 0000000000000000000000000000000000000000..60834b63075175bef17f27ef252ff3f1dbf1cf93 GIT binary patch literal 959 zcmV;w13>(VP)N2bPDNB8 zb~7$DE-^4L^m3s900TQoL_t(&L+zPKj@vL0MSTpz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pB{B<>=UW=?*Eaj|PAaLN1L3=wO;B=SDlyI{CC)0Cakf zjmJBqc03vY6eeiI&ELNVL>IsU+yy*A!k0aF(459tj`vRIK#m5)OVA5}_Xzy=wLr}M zYZIYpP_J6xNne|v=D9=1>A$WPh~;q1?Muijl*P~%!=Kg(jnIys3b!5PqqRT;uy$Mm zc(8Q}9Za6@EOjDI5zQA46N( z_h9Qf2wD{g3U_U_0H2a$HJGaf@MTKeSo&%`md9Q?4|c#3BUwNM0P~NvfCEsf1#*d0 gw2Iuv*0C+%4^#bZO~fQzr~m)}07*qoM6N<$f~O_BH2?qr literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/TinLogisticsWire.png b/src/main/resources/assets/electricexpansion/textures/models/TinLogisticsWire.png new file mode 100644 index 0000000000000000000000000000000000000000..c6523284a3500927011c882d39111b4fbc6d3de5 GIT binary patch literal 983 zcmV;|11S87P)N2bPDNB8 zb~7$DE-^4L^m3s900UD=L_t(&L+zPc&e|{#g|iIAMFPYf@xn5?sczzb>0@82ZlLQ+ zIW8YM7zfAsL!`DKS&rlJ*q%9a3sn{UX0utnTrO+%qtPfldmq!c9q)F#!0UWIhrar# z@5Z9ih? z$D!$2hn`F(;d!xGgg)>u6ac*7t1*1V3%(L+E5V9Lm)E5c0OQXHK)gV}d_E5X(4nOv z?@I+Bz92w+g#h@00F5=*N&td8O&7)#FpaJV&_NvqI<#vG6m%7UqYJ*`<>*QZAZPQr z`6hwrK)N)VM*z~eBj9v81&zr@(G(ih-q4x=(NP zu5H4T_oW+kjV7i0^hU4P{j8O4)HRxv?$aAR;evxJY}~cXPBDTQdu0jlcrTCpyWkY(3-Q@AD6;$;p1ay2NQrUf>tF2)dfwp0H2cMYA{s`V9S)aap|l1xIFgK zc`yM80kHspzyCKF^8D+c30@60)dHzRDn>=>W9!fe_zk9UZYAswhROf{002ovPDHLk FV1hIf&=&vz literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/TinRSWire.png b/src/main/resources/assets/electricexpansion/textures/models/TinRSWire.png new file mode 100644 index 0000000000000000000000000000000000000000..cb55aff34e9d5add1a53b0a2e69002accd0671e9 GIT binary patch literal 956 zcmV;t14I0YP)N2bPDNB8 zb~7$DE-^4L^m3s900THlL_t(&L+zMbj@vK{MYD_`?>F)Uf^4H3=mxrhZlK@&FADUt zKSeh%>(lrMx&ua)BiorwTqFbtk>b^jM2oVOPAtRW(0%E2+~-2O-L9L>X6{pA(}!P3 zK-QD>dhNMRr;~4EU+r$U^KBTG6?o?Jx!dpeZoA#O#bV)BtCjCN9*=IhT)xGyH=E66 zeir`Y*I)Ph&x`vO5+NVEX#yBaB2jGlv`V;aGz`m%cr179Tg~zlWU(w-36PK7Bms

sK(QIj))B6bfM*L11_RgY z^}J%E{eIuK)9KW={9c_BfOk9|zwwG2UMca>Xyp58&-imSpNj{YGhx9@gv_IiLHThe zL`)Mo91flj9Q~KDa9_ilhk=c^L=fefXj^nn(_`D4?_Y>ZeOqK=fota8N*^?t_V3k1m zsC*?DJ{zx+;CB-(PTQP`XhLjHO;AcdI6fxSr$q5om5{h(>iVAKBScx(kF#KHRh`nr z>9<(o!dhIQJ*#;oN*qe0jmuX&(A-|MkW>P6N;4_-3#&d_;fM!Xe@(SD%|AWXkK?f) zXl^gO-n6YzJq=E2N&v;DUomi$4qKi+7Op3!63`PxH9qBQ9EvU9lRV`q_mk8XzGjO) z?*hd*y)EFdK6Ze$N8%^`ybDBrfK?V-QmMN@fVD?dqiB;eApX|J*Y^c>9JeL*q2B>z zQuQuSCL|545-1;)uLQ$q<5l?IO|HEQ;44u))rY$apcWTsALA~-|LXX{5f8MFdlv|_ e|H)mT(|HBCvYerVa)^5X0000N2bPDNB8 zb~7$DE-^4L^m3s900WarL_t(&L(N%Bt{O2AoMRw95+MGF4cBzZUX~ImdAEa+g<&04_#+|i^ZZ}uh%{L$z+nAwYT)O6C!r7|$+)0>OMf@2AsgYIw%sX0us( zUaeNC2mdGlkzz#eK{SpYnr_tr~*;6MH_(HMRAAA{uI?w05^?Lv?cF@eBZ8ll}G(?DJW)PfedUL0%@R^65x7%$EUx$f_*`8)?-@-UwT> z$-RA|!iOwCwaxUTeH4J!Y-0Cm5&GUcMLCd$?zJcYt=Xgm0Oma~_-+#bOcy*j(uOt< z0Bb=UYh_8^b}!BQxqUprx&9CUo6V+2!{OLRf*^CX_PFk%aSqSN<8he7GuNK&`z6pi z2*Iw=qZc8&NwgMd5v=x|DgZvA7N`{{N>>Gdm#3?k2vM{ahzb>r9QL)vItss0gih_O$+JEnoqRj%%vDh|o&=4FDE8GY*h<*l@(|V_yN2bPDNB8 zb~7$DE-^4L^m3s900TNnL_t(&L+zQ(sv9v3g>&1N2>F2|Cgx_+xY&M%sqkcM_rf2UXeb@2vcuc%*w_ECe zzkPZ)X8z~rw=`eFSG;)N<@o&Na_Pob2mkW*NAvCbujYI{Cmx$DLv-D0t5X0usp zde-LV^Lct+uh*#;|5^ax1z(NfD;e+=sGWcnkq)mz0|4WX03cpiz-qNh0BF#ipNpg$ZA2{i5#@kZl0z5>ASpv1T2^QHAi0C0Cmu=}PCiK$Cd&|wK$ z6KK4r-YvlIDDj1!J3xER@x=nv>z%~6NW-ZW}dij=ts+ zBvyN`bXSczJ)cge`<$Lxd)mPwV;zoMn(PaW_%{L9py+nHT>?jKzu(_`_&a@@*8N*U zw1Uw9Aos@KwOJiV&2w}Qg`yR3IXX68x3dh37$IzDc zJ=nSqf>s5B!d+V}z^CL`4d!YAe3=qAmcCk#<*}E}gB`HMNEQ$Q!2Dw^-~g0rfm|XL gts?iab!-dx19?bDQMY?9KL7v#07*qoM6N<$f{UBI+yDRo literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/WirePaintOverlay.png b/src/main/resources/assets/electricexpansion/textures/models/WirePaintOverlay.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d6721c8517ec12a1fdfd77f4ba5d4e9c0279c9 GIT binary patch literal 528 zcmV+r0`L8aP)N2bPDNB8 zb~7$DE-^4L^m3s900E3iL_t(&L+w~ej>I4gZJ(>V9_OFSRbMKJ9=-HlutWr~y>#ilUzlaZ!gbg-*3Uuvj8f6-{MfM9S;I(!4syW)|ISk)TO8-#u#g;4dT|_SSQqUmPO8tg(9G8jG^%a zva+(WC)O~=JX>!CccIYkV}TH8aYhq1!IFSz@@V+a%RRD zDkS7O8fyq@X=%xyV?rlg>oyvY*`IBZ%TG6)F~+JT&$aY`r$&a(C>DtBU}Lc>!7T_z zV~d`8Ehui+RsmWMoq!p4c&|$L$|Gmy$u|T+4|eu?pkUOc_B-flFdmC50WXETNWy4d z7LoHJsh3HV?cpv2g{rZ)@_+tHpeNIi8-#X}BK;IdC>RrBq~P<1Z#}%@x}B=)v=)78 zRIa&J?S?OF-fdSM68j+sls7N>u5JKH!17Qi-?2{bf@>(O-q zz8zzqt2Usl&(ywbXa8i1E6v1>>b!qDOE<5K4qt<{W}y>iy4WHxf z^3sS!U|g@)8^x2w#cT_I(suLn^WG)wHNhH!-{7s6binjQw#$z6%tYme#2PbJ(5(OjD*Ez6IVW~!4phv42j=|eQy$EbOgR^`AWZl1E;Y;o@B3MI`NP@rfhi=b x0-fx?Y1{vw$0>^TEAYs}E{6mT3H&<*z60)NS06J;;CTQ5002ovPDHLkV1k}Qou>c* literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/transformer2.png b/src/main/resources/assets/electricexpansion/textures/models/transformer2.png new file mode 100644 index 0000000000000000000000000000000000000000..991ae1352294161a5234e1df4147c9dfab8387a9 GIT binary patch literal 1435 zcmV;M1!Ve(P)<{92XskIMF-pr2Lc!{R!QI20000QbVXQn zQ*UN;cVTj608n9RZgehAMN}YmGcGkQF)%Rna-jeK1q4Y%K~!i%?V3$bQ$ZAlDJao} zQI{r07p@iY18C`o#TK=sG$>a5AQ~6Of8ozF8rSYz_yb(vLO1Am-+{NjoXn+HhDj`i zWHKL}Gk4B&-#IgLbz&m&@5Q6L4(avN2YZsXu@C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OVK_>4S<NP z`wM0}i!*r+4tv;<1M~U9)Bwh>3=C9bo!p)rz9}6UFsgvesgl;Aq+h0Om}2a|Y1{vw pNBg4vhCT22_hSOb1pX@me*n&2e9d7|lkNZj002ovPDHLkV1hCKoK^q; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/transformer3.png b/src/main/resources/assets/electricexpansion/textures/models/transformer3.png new file mode 100644 index 0000000000000000000000000000000000000000..7a6eb878c357fe08c011deaeaab4d6d0ea2a33f5 GIT binary patch literal 1479 zcmV;&1vvVNP)<{92XskIMF-pr2Lc!{R!QI20000QbVXQn zQ*UN;cVTj608n9RZgehAMN}YmGcGkQF)%Rna-jeK1u#iOK~!i%?OIK5Q%4kaplT&5 zBsPczm7qe65d=bLNNmR+HQ0eVa;%ipNr9-ei>g1P|Em2BUGTB1)b6ToDpjbJy5Ylv z&(Px@U(E{-CL`5-K^o16@11w=dFS4l`$DM{`S0HC8xHO3FFu`Wx<(oF-|Y2$Q+dwO ztE}CZb6t-#Kb<;^tk>(V-EIdPe$(H(-L99zngT^Yb_cBq&=y>Pi8aWurSmLuXBY}c zhr^+7TU%R`@y5o6W8*q{H0Y2u1c0Dqu}uLXkdfx6Q-^bS`*fH+0MYT@-rkgq0;5de zn7xLU0!Q%Dc^0`d8Dkltb23T61DKj?tkarL6dVg&r1|O8VWU!Te~%rSSi+QCyOboy982xz4F>C}}maM*$pVhcb7 zV?w}Wff72pv6jxW$em#v7-K=<9Bk3t!hDkjj3!--H4kyD;6<9BPMygY%+QeGJnOVV zUJ9|pUhotcn}h*eI?p0^W{x34LZPF%hCo#+6@QNj-E?i(XhNnu*CNeNr_LN>*^(7n zdcjjCLw6Jlh@N0GaVjA!2#n?yz4cn4cwAcs=sa`-X5L|4mF|^C?#!ES2n4;@+44Yv z(U98jqNmAtCQ1Spg)AiDG>b*_EF`s<#MoZ$LZFZ}wkrS6mjrq<4TVAIB*`PEfP|7U zL5w7Pw))-AuDf2h=DO`w-4< z$l}@9gL*25wZW~1*R%U`jryEluV3|hp+{?0FMD0CQ;z+x-^f1hVHh63Mh4hoZlB>y%H%xWa7QtS$MsQ(3+=xqJ;bTe)tS zjYh+VR;$%=yDG|Cb>gNprnj9Epd}Ykt+ud9bg=2X800wM;^XwHUvI#w8 zp#!#&F_tw7k}WxOo)nn+>Z1S9{5HVAISWiyNO2vELFf_~TXTgzWiXs9NCyhcU@-7+ zmVL9?^v+eQRlkO|y}j*wyj>QJFamo0et(irR#(SI_)fkS8oK1PH*~-?`~!q8>U6%A_>j0D-|- zk1IQwL}0)oe07U{8?yimoelv*HX)P%62H0?78v9au!Ffpfk7x01{j7D7=mgTIR@+? zFigx?D_oAD^8kk5Shz;u3K>dto~KeM`4)~bOu%GFh%xvLcMY6Mg*mPj7|k(yTw@Gi zSn$oli5q33g2LoW#@OV`n{Oc)6NPFKl}}v$-JQJhn>)VnhdaIei(78};N~lj+^MU- zx})W1?nwEC`>68JmClad&4Z7vn6q^9%H?_H!ONT-ohi*bH`U5!KKXq#m&bs-m2h6U zJkLxbQ?5O5N9JF+x%tsFKx06-Hdh}1_Tm1(=w|~v#+=6Il}qC6n{0aY{PPJQ@0@@7 z?|2+W$1eWm=hgQ2udTAj0%NLWH?awO?bqJK{6w=>M<5$3h!s#_8{J(%1 zJ9~WLi3bDW^3~3Fe*E5rzum?9kM7LMPwxGNKivn*KNpNK2S`NwH*Nd>^Z2N|atCPI h;Z}zT93qe&ftUV}eIshj5vu?I002ovPDHLkV1mUizGeUb literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/electricexpansion/textures/models/wiremill.png b/src/main/resources/assets/electricexpansion/textures/models/wiremill.png new file mode 100644 index 0000000000000000000000000000000000000000..4fe25684254aa2cf999e1a40785937dbad926b10 GIT binary patch literal 2658 zcmcImi#OAa8~+m0+!qSvUdbiB?)Oo1ONeUal1oK|$bD`bX(o-bL~dycugj((#7uc} zTP)W#hEOg^bJ^P5fBGYSpL0IX=RD7O&U2n~p7T8CNx$S|D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