diff --git a/models/WIP/battery box.tcn b/models/WIP/battery box.tcn new file mode 100644 index 000000000..d8e3c81b7 Binary files /dev/null and b/models/WIP/battery box.tcn differ diff --git a/models/WIP/battery.tcn b/models/WIP/battery.tcn new file mode 100644 index 000000000..89f2eaf30 Binary files /dev/null and b/models/WIP/battery.tcn differ diff --git a/models/WIP/coilSide.tcn b/models/WIP/coilSide.tcn new file mode 100644 index 000000000..159a15461 Binary files /dev/null and b/models/WIP/coilSide.tcn differ diff --git a/models/WIP/lightning rod.tcn b/models/WIP/lightning rod.tcn new file mode 100644 index 000000000..43c4c581c Binary files /dev/null and b/models/WIP/lightning rod.tcn differ diff --git a/models/WIP/switch 2 down.tcn b/models/WIP/switch 2 down.tcn new file mode 100644 index 000000000..809675d35 Binary files /dev/null and b/models/WIP/switch 2 down.tcn differ diff --git a/models/WIP/switch 3 down.tcn b/models/WIP/switch 3 down.tcn new file mode 100644 index 000000000..b048d9932 Binary files /dev/null and b/models/WIP/switch 3 down.tcn differ diff --git a/models/WIP/switch down.tcn b/models/WIP/switch down.tcn new file mode 100644 index 000000000..42600ac6a Binary files /dev/null and b/models/WIP/switch down.tcn differ diff --git a/models/WIP/transformerCoil.tcn b/models/WIP/transformerCoil.tcn new file mode 100644 index 000000000..ad9c8cac0 Binary files /dev/null and b/models/WIP/transformerCoil.tcn differ diff --git a/models/laserTransmitter.tcn b/models/laserTransmitter.tcn new file mode 100644 index 000000000..bdce78f79 Binary files /dev/null and b/models/laserTransmitter.tcn differ diff --git a/resources/mods/dark/languages/en_US.properties b/resources/mods/dark/languages/en_US.properties new file mode 100644 index 000000000..42c8086ba --- /dev/null +++ b/resources/mods/dark/languages/en_US.properties @@ -0,0 +1,109 @@ +# FluidMechanics Language Properties +# @author DarkGuardsman + +item.dark\:WoodDust.name = Wood Dust +item.dark\:WoodPlate.name = Plank +item.dark\:WoodGears.name = Wooden Gears +item.dark\:WoodTube.name = Wooden Tube +item.dark\:WoodScraps.name = Wood Fragments + +item.dark\:StoneRubble.name = Stone Cobble +item.dark\:StoneDust.name = Stone Dust +item.dark\:StonePlate.name = Stone Sheet +item.dark\:StoneGears.name = Stone Gears +item.dark\:StoneTube.name = Stone Tube +item.dark\:StoneRod.name = Stone Rod +item.dark\:StoneScraps.name = Stone Shards + +item.dark\:CopperRubble.name = Copper Rubble +item.dark\:CopperDust.name = Copper Dust +item.dark\:CopperIngot.name = Copper Ingot +item.dark\:CopperPlate.name = Copper Plate +item.dark\:CopperGears.name = Copper Gears +item.dark\:CopperTube.name = Copper Tube +item.dark\:CopperRod.name = Copper Rod +item.dark\:CopperScraps.name = Copper Fragments + +item.dark\:TinRubble.name = Tin Rubble +item.dark\:TinDust.name = Tin Dust +item.dark\:TinIngot.name = Tin Ingot +item.dark\:TinPlate.name = Tin Plate +item.dark\:TinTube.name = Tin Tube +item.dark\:TinRod.name = Tin Rod +item.dark\:TinScraps.name = Tin Fragments + +item.dark\:IronRubble.name = Iron Rubble +item.dark\:IronDust.name = Iron Dust +item.dark\:IronIngot.name = Iron Ingot +item.dark\:IronPlate.name = Iron Plate +item.dark\:IronGears.name = Iron Gears +item.dark\:IronTube.name = Iron Tube +item.dark\:IronRod.name = Iron Rod +item.dark\:IronScraps.name = Iron Fragments + +item.dark\:ObbyRubble.name = Obby Chunks +item.dark\:ObbyDust.name = Obby Dust +item.dark\:ObbyIngot.name = Obby Brick +item.dark\:ObbyPlate.name = Obby Sheet +item.dark\:ObbyGears.name = Obby Gears +item.dark\:ObbyTube.name = Obby Tube +item.dark\:ObbyRod.name = Obby Rod +item.dark\:ObbyScraps.name = Obby Shards + +item.dark\:LeadRubble.name = Lead Rubble +item.dark\:LeadDust.name = Lead Dust +item.dark\:LeadIngot.name = Lead Ingot +item.dark\:LeadPlate.name = Lead Plate +item.dark\:LeadTube.name = Lead Tube +item.dark\:LeadRod.name = Lead Rod +item.dark\:LeadScraps.name = Lead Fragments + +item.dark\:AluminumRubble.name = Bauxite Rocks +item.dark\:AluminumDust.name = Bauxite dust +item.dark\:AluminumIngot.name = Aluminum Ingot +item.dark\:AluminumPlate.name = Aluminum Plate +item.dark\:AluminumRod.name = Aluminum Rod +item.dark\:AluminumScraps.name = Aluminum Fragments + +item.dark\:SilverRubble.name = Silver Rubble +item.dark\:SilverDust.name = Silver Dust +item.dark\:SilverIngot.name = Silver Ingot +item.dark\:SilverPlate.name = Silver Plate +item.dark\:SilverTube.name = Silver Tube +item.dark\:SilverRod.name = Silver Rod +item.dark\:SilverScraps.name = Silver Fragments + +item.dark\:GoldRubble.name = Gold Rubble +item.dark\:GoldDust.name = Gold Dust +item.dark\:GoldIngot.name = Gold Ingot +item.dark\:GoldPlate.name = Gold Plate +item.dark\:GoldTube.name = Gold Tube +item.dark\:GoldRod.name = Gold Rod +item.dark\:GoldScraps.name = Gold Fragments + +item.dark\:CoalDust.name = Coal Dust +item.dark\:CoalIngot.name = Coal Brick + +item.dark\:SteelRubble.name = Steel Rubble +item.dark\:SteelDust.name = Steel Dust +item.dark\:SteelIngot.name = Steel Ingot +item.dark\:SteelPlate.name = Steel Plate +item.dark\:SteelGears.name = Steel Gears +item.dark\:SteelTube.name = Steel Tube +item.dark\:SteelRod.name = Steel Rod +item.dark\:SteelScraps.name = Steel Fragments + +item.dark\:BronzeRubble.name = Bronze Rubble +item.dark\:BronzeDust.name = Bronze Dust +item.dark\:BronzeIngot.name = Bronze Ingot +item.dark\:BronzePlate.name = Bronze Plate +item.dark\:BronzeGears.name = Bronze Gears +item.dark\:BronzeTube.name = Bronze Tube +item.dark\:BronzeRod.name = Bronze Rod +item.dark\:BronzeScraps.name = Bronze Fragments + +tile.dark\:CopperOre.name = Copper Ore +tile.dark\:TinOre.name = Tin Ore +tile.dark\:LeadOre.name = Lead Ore +tile.dark\:AluminumOre.name = Bauxite Stone +tile.dark\:SilverOre.name = Silver Ore diff --git a/resources/mods/dark/textures/blocks/AluminumOre.png b/resources/mods/dark/textures/blocks/AluminumOre.png new file mode 100644 index 000000000..6836cd1b3 Binary files /dev/null and b/resources/mods/dark/textures/blocks/AluminumOre.png differ diff --git a/resources/mods/dark/textures/blocks/CopperOre.png b/resources/mods/dark/textures/blocks/CopperOre.png new file mode 100644 index 000000000..3a72f7429 Binary files /dev/null and b/resources/mods/dark/textures/blocks/CopperOre.png differ diff --git a/resources/mods/dark/textures/blocks/LeadOre.png b/resources/mods/dark/textures/blocks/LeadOre.png new file mode 100644 index 000000000..bb89a9d75 Binary files /dev/null and b/resources/mods/dark/textures/blocks/LeadOre.png differ diff --git a/resources/mods/dark/textures/blocks/SilverOre.png b/resources/mods/dark/textures/blocks/SilverOre.png new file mode 100644 index 000000000..745595154 Binary files /dev/null and b/resources/mods/dark/textures/blocks/SilverOre.png differ diff --git a/resources/mods/dark/textures/blocks/TinOre.png b/resources/mods/dark/textures/blocks/TinOre.png new file mode 100644 index 000000000..7ae1f9a74 Binary files /dev/null and b/resources/mods/dark/textures/blocks/TinOre.png differ diff --git a/resources/mods/dark/textures/blocks/copperWire.png b/resources/mods/dark/textures/blocks/copperWire.png new file mode 100644 index 000000000..bd54ce5c5 Binary files /dev/null and b/resources/mods/dark/textures/blocks/copperWire.png differ diff --git a/resources/mods/dark/textures/blocks/machine.png b/resources/mods/dark/textures/blocks/machine.png new file mode 100644 index 000000000..28e43c0fd Binary files /dev/null and b/resources/mods/dark/textures/blocks/machine.png differ diff --git a/resources/mods/dark/textures/blocks/machine_input.png b/resources/mods/dark/textures/blocks/machine_input.png new file mode 100644 index 000000000..df5fde3c9 Binary files /dev/null and b/resources/mods/dark/textures/blocks/machine_input.png differ diff --git a/resources/mods/dark/textures/blocks/machine_output.png b/resources/mods/dark/textures/blocks/machine_output.png new file mode 100644 index 000000000..763489434 Binary files /dev/null and b/resources/mods/dark/textures/blocks/machine_output.png differ diff --git a/resources/mods/dark/textures/blocks/machine_side.png b/resources/mods/dark/textures/blocks/machine_side.png new file mode 100644 index 000000000..ed5713e10 Binary files /dev/null and b/resources/mods/dark/textures/blocks/machine_side.png differ diff --git a/resources/mods/dark/textures/blocks/ore.xcf b/resources/mods/dark/textures/blocks/ore.xcf new file mode 100644 index 000000000..712b3273b Binary files /dev/null and b/resources/mods/dark/textures/blocks/ore.xcf differ diff --git a/resources/mods/dark/textures/gui/battery_box.png b/resources/mods/dark/textures/gui/battery_box.png new file mode 100644 index 000000000..f3ab2bdc0 Binary files /dev/null and b/resources/mods/dark/textures/gui/battery_box.png differ diff --git a/resources/mods/dark/textures/gui/coal_generator.png b/resources/mods/dark/textures/gui/coal_generator.png new file mode 100644 index 000000000..aaa65afb3 Binary files /dev/null and b/resources/mods/dark/textures/gui/coal_generator.png differ diff --git a/resources/mods/dark/textures/gui/electric_furnace.png b/resources/mods/dark/textures/gui/electric_furnace.png new file mode 100644 index 000000000..3563c6b0e Binary files /dev/null and b/resources/mods/dark/textures/gui/electric_furnace.png differ diff --git a/resources/mods/dark/textures/items/aluminumDust.png b/resources/mods/dark/textures/items/aluminumDust.png new file mode 100644 index 000000000..1b20b3df4 Binary files /dev/null and b/resources/mods/dark/textures/items/aluminumDust.png differ diff --git a/resources/mods/dark/textures/items/aluminumIngot.png b/resources/mods/dark/textures/items/aluminumIngot.png new file mode 100644 index 000000000..b891470e4 Binary files /dev/null and b/resources/mods/dark/textures/items/aluminumIngot.png differ diff --git a/resources/mods/dark/textures/items/aluminumPlate.png b/resources/mods/dark/textures/items/aluminumPlate.png new file mode 100644 index 000000000..4209be477 Binary files /dev/null and b/resources/mods/dark/textures/items/aluminumPlate.png differ diff --git a/resources/mods/dark/textures/items/aluminumRubble.png b/resources/mods/dark/textures/items/aluminumRubble.png new file mode 100644 index 000000000..e159c2da1 Binary files /dev/null and b/resources/mods/dark/textures/items/aluminumRubble.png differ diff --git a/resources/mods/dark/textures/items/battery.png b/resources/mods/dark/textures/items/battery.png new file mode 100644 index 000000000..60fcdb629 Binary files /dev/null and b/resources/mods/dark/textures/items/battery.png differ diff --git a/resources/mods/dark/textures/items/bronzeDust.png b/resources/mods/dark/textures/items/bronzeDust.png new file mode 100644 index 000000000..b384235c0 Binary files /dev/null and b/resources/mods/dark/textures/items/bronzeDust.png differ diff --git a/resources/mods/dark/textures/items/bronzeGears.png b/resources/mods/dark/textures/items/bronzeGears.png new file mode 100644 index 000000000..58d75360b Binary files /dev/null and b/resources/mods/dark/textures/items/bronzeGears.png differ diff --git a/resources/mods/dark/textures/items/bronzeIngot.png b/resources/mods/dark/textures/items/bronzeIngot.png new file mode 100644 index 000000000..660c8b5d4 Binary files /dev/null and b/resources/mods/dark/textures/items/bronzeIngot.png differ diff --git a/resources/mods/dark/textures/items/bronzePlate.png b/resources/mods/dark/textures/items/bronzePlate.png new file mode 100644 index 000000000..676e03642 Binary files /dev/null and b/resources/mods/dark/textures/items/bronzePlate.png differ diff --git a/resources/mods/dark/textures/items/circuitAdvanced.png b/resources/mods/dark/textures/items/circuitAdvanced.png new file mode 100644 index 000000000..1402e4f32 Binary files /dev/null and b/resources/mods/dark/textures/items/circuitAdvanced.png differ diff --git a/resources/mods/dark/textures/items/circuitBasic.png b/resources/mods/dark/textures/items/circuitBasic.png new file mode 100644 index 000000000..a23511526 Binary files /dev/null and b/resources/mods/dark/textures/items/circuitBasic.png differ diff --git a/resources/mods/dark/textures/items/circuitElite.png b/resources/mods/dark/textures/items/circuitElite.png new file mode 100644 index 000000000..5c77472b9 Binary files /dev/null and b/resources/mods/dark/textures/items/circuitElite.png differ diff --git a/resources/mods/dark/textures/items/coalDust.png b/resources/mods/dark/textures/items/coalDust.png new file mode 100644 index 000000000..bb0d420fa Binary files /dev/null and b/resources/mods/dark/textures/items/coalDust.png differ diff --git a/resources/mods/dark/textures/items/coalIngot.png b/resources/mods/dark/textures/items/coalIngot.png new file mode 100644 index 000000000..e5719dbb7 Binary files /dev/null and b/resources/mods/dark/textures/items/coalIngot.png differ diff --git a/resources/mods/dark/textures/items/copperDust.png b/resources/mods/dark/textures/items/copperDust.png new file mode 100644 index 000000000..2a647c0be Binary files /dev/null and b/resources/mods/dark/textures/items/copperDust.png differ diff --git a/resources/mods/dark/textures/items/copperGears.png b/resources/mods/dark/textures/items/copperGears.png new file mode 100644 index 000000000..7406a43c6 Binary files /dev/null and b/resources/mods/dark/textures/items/copperGears.png differ diff --git a/resources/mods/dark/textures/items/copperGears.xcf b/resources/mods/dark/textures/items/copperGears.xcf new file mode 100644 index 000000000..18569eeb6 Binary files /dev/null and b/resources/mods/dark/textures/items/copperGears.xcf differ diff --git a/resources/mods/dark/textures/items/copperIngot.png b/resources/mods/dark/textures/items/copperIngot.png new file mode 100644 index 000000000..43282748f Binary files /dev/null and b/resources/mods/dark/textures/items/copperIngot.png differ diff --git a/resources/mods/dark/textures/items/copperPlate.png b/resources/mods/dark/textures/items/copperPlate.png new file mode 100644 index 000000000..1eaf99f3e Binary files /dev/null and b/resources/mods/dark/textures/items/copperPlate.png differ diff --git a/resources/mods/dark/textures/items/copperRubble.png b/resources/mods/dark/textures/items/copperRubble.png new file mode 100644 index 000000000..8638ba1ef Binary files /dev/null and b/resources/mods/dark/textures/items/copperRubble.png differ diff --git a/resources/mods/dark/textures/items/copperRubble.xcf b/resources/mods/dark/textures/items/copperRubble.xcf new file mode 100644 index 000000000..baacf20c0 Binary files /dev/null and b/resources/mods/dark/textures/items/copperRubble.xcf differ diff --git a/resources/mods/dark/textures/items/goldDust.png b/resources/mods/dark/textures/items/goldDust.png new file mode 100644 index 000000000..99ff05917 Binary files /dev/null and b/resources/mods/dark/textures/items/goldDust.png differ diff --git a/resources/mods/dark/textures/items/goldPlate.png b/resources/mods/dark/textures/items/goldPlate.png new file mode 100644 index 000000000..259e5f3d2 Binary files /dev/null and b/resources/mods/dark/textures/items/goldPlate.png differ diff --git a/resources/mods/dark/textures/items/goldRubble.png b/resources/mods/dark/textures/items/goldRubble.png new file mode 100644 index 000000000..376f06195 Binary files /dev/null and b/resources/mods/dark/textures/items/goldRubble.png differ diff --git a/resources/mods/dark/textures/items/infiniteBattery.png b/resources/mods/dark/textures/items/infiniteBattery.png new file mode 100644 index 000000000..910619bdd Binary files /dev/null and b/resources/mods/dark/textures/items/infiniteBattery.png differ diff --git a/resources/mods/dark/textures/items/ironDust.png b/resources/mods/dark/textures/items/ironDust.png new file mode 100644 index 000000000..e90a56748 Binary files /dev/null and b/resources/mods/dark/textures/items/ironDust.png differ diff --git a/resources/mods/dark/textures/items/ironGears.png b/resources/mods/dark/textures/items/ironGears.png new file mode 100644 index 000000000..88648079e Binary files /dev/null and b/resources/mods/dark/textures/items/ironGears.png differ diff --git a/resources/mods/dark/textures/items/ironPlate.png b/resources/mods/dark/textures/items/ironPlate.png new file mode 100644 index 000000000..60805bdce Binary files /dev/null and b/resources/mods/dark/textures/items/ironPlate.png differ diff --git a/resources/mods/dark/textures/items/ironRubble.png b/resources/mods/dark/textures/items/ironRubble.png new file mode 100644 index 000000000..6551c82e8 Binary files /dev/null and b/resources/mods/dark/textures/items/ironRubble.png differ diff --git a/resources/mods/dark/textures/items/leadDust.png b/resources/mods/dark/textures/items/leadDust.png new file mode 100644 index 000000000..e5c806de5 Binary files /dev/null and b/resources/mods/dark/textures/items/leadDust.png differ diff --git a/resources/mods/dark/textures/items/leadIngot.png b/resources/mods/dark/textures/items/leadIngot.png new file mode 100644 index 000000000..1e1e7defd Binary files /dev/null and b/resources/mods/dark/textures/items/leadIngot.png differ diff --git a/resources/mods/dark/textures/items/leadPlate.png b/resources/mods/dark/textures/items/leadPlate.png new file mode 100644 index 000000000..11020fa89 Binary files /dev/null and b/resources/mods/dark/textures/items/leadPlate.png differ diff --git a/resources/mods/dark/textures/items/leadRubble.png b/resources/mods/dark/textures/items/leadRubble.png new file mode 100644 index 000000000..d8d394e13 Binary files /dev/null and b/resources/mods/dark/textures/items/leadRubble.png differ diff --git a/resources/mods/dark/textures/items/motor.png b/resources/mods/dark/textures/items/motor.png new file mode 100644 index 000000000..ed206ab23 Binary files /dev/null and b/resources/mods/dark/textures/items/motor.png differ diff --git a/resources/mods/dark/textures/items/obbyDust.png b/resources/mods/dark/textures/items/obbyDust.png new file mode 100644 index 000000000..92f70f41f Binary files /dev/null and b/resources/mods/dark/textures/items/obbyDust.png differ diff --git a/resources/mods/dark/textures/items/obbyGears.png b/resources/mods/dark/textures/items/obbyGears.png new file mode 100644 index 000000000..a0aeb99ff Binary files /dev/null and b/resources/mods/dark/textures/items/obbyGears.png differ diff --git a/resources/mods/dark/textures/items/silverDust.png b/resources/mods/dark/textures/items/silverDust.png new file mode 100644 index 000000000..42ead0c8d Binary files /dev/null and b/resources/mods/dark/textures/items/silverDust.png differ diff --git a/resources/mods/dark/textures/items/silverIngot.png b/resources/mods/dark/textures/items/silverIngot.png new file mode 100644 index 000000000..de298337f Binary files /dev/null and b/resources/mods/dark/textures/items/silverIngot.png differ diff --git a/resources/mods/dark/textures/items/silverPlate.png b/resources/mods/dark/textures/items/silverPlate.png new file mode 100644 index 000000000..65b081280 Binary files /dev/null and b/resources/mods/dark/textures/items/silverPlate.png differ diff --git a/resources/mods/dark/textures/items/silverRubble.png b/resources/mods/dark/textures/items/silverRubble.png new file mode 100644 index 000000000..8b0e83f6f Binary files /dev/null and b/resources/mods/dark/textures/items/silverRubble.png differ diff --git a/resources/mods/dark/textures/items/steelDust.png b/resources/mods/dark/textures/items/steelDust.png new file mode 100644 index 000000000..6aa189871 Binary files /dev/null and b/resources/mods/dark/textures/items/steelDust.png differ diff --git a/resources/mods/dark/textures/items/steelGears.png b/resources/mods/dark/textures/items/steelGears.png new file mode 100644 index 000000000..3ba4508c0 Binary files /dev/null and b/resources/mods/dark/textures/items/steelGears.png differ diff --git a/resources/mods/dark/textures/items/steelIngot.png b/resources/mods/dark/textures/items/steelIngot.png new file mode 100644 index 000000000..ad5a9f748 Binary files /dev/null and b/resources/mods/dark/textures/items/steelIngot.png differ diff --git a/resources/mods/dark/textures/items/steelPlate.png b/resources/mods/dark/textures/items/steelPlate.png new file mode 100644 index 000000000..55e2667e9 Binary files /dev/null and b/resources/mods/dark/textures/items/steelPlate.png differ diff --git a/resources/mods/dark/textures/items/stoneDust.png b/resources/mods/dark/textures/items/stoneDust.png new file mode 100644 index 000000000..5b30bdbeb Binary files /dev/null and b/resources/mods/dark/textures/items/stoneDust.png differ diff --git a/resources/mods/dark/textures/items/stoneGears.png b/resources/mods/dark/textures/items/stoneGears.png new file mode 100644 index 000000000..6aa3c4625 Binary files /dev/null and b/resources/mods/dark/textures/items/stoneGears.png differ diff --git a/resources/mods/dark/textures/items/stonePlate.png b/resources/mods/dark/textures/items/stonePlate.png new file mode 100644 index 000000000..e7bac6ac3 Binary files /dev/null and b/resources/mods/dark/textures/items/stonePlate.png differ diff --git a/resources/mods/dark/textures/items/stoneRubble.png b/resources/mods/dark/textures/items/stoneRubble.png new file mode 100644 index 000000000..563f1d794 Binary files /dev/null and b/resources/mods/dark/textures/items/stoneRubble.png differ diff --git a/resources/mods/dark/textures/items/sulphur.png b/resources/mods/dark/textures/items/sulphur.png new file mode 100644 index 000000000..fd0ec62b1 Binary files /dev/null and b/resources/mods/dark/textures/items/sulphur.png differ diff --git a/resources/mods/dark/textures/items/tinDust.png b/resources/mods/dark/textures/items/tinDust.png new file mode 100644 index 000000000..94bafc815 Binary files /dev/null and b/resources/mods/dark/textures/items/tinDust.png differ diff --git a/resources/mods/dark/textures/items/tinIngot.png b/resources/mods/dark/textures/items/tinIngot.png new file mode 100644 index 000000000..3b7d0d283 Binary files /dev/null and b/resources/mods/dark/textures/items/tinIngot.png differ diff --git a/resources/mods/dark/textures/items/tinPlate.png b/resources/mods/dark/textures/items/tinPlate.png new file mode 100644 index 000000000..2d417eff4 Binary files /dev/null and b/resources/mods/dark/textures/items/tinPlate.png differ diff --git a/resources/mods/dark/textures/items/tinRubble.png b/resources/mods/dark/textures/items/tinRubble.png new file mode 100644 index 000000000..ad045b9a3 Binary files /dev/null and b/resources/mods/dark/textures/items/tinRubble.png differ diff --git a/resources/mods/dark/textures/items/wooddust.png b/resources/mods/dark/textures/items/wooddust.png new file mode 100644 index 000000000..25048d70b Binary files /dev/null and b/resources/mods/dark/textures/items/wooddust.png differ diff --git a/resources/mods/dark/textures/items/wrench.png b/resources/mods/dark/textures/items/wrench.png new file mode 100644 index 000000000..ad13e8a8a Binary files /dev/null and b/resources/mods/dark/textures/items/wrench.png differ diff --git a/resources/mods/dark/textures/models/copperWire.png b/resources/mods/dark/textures/models/copperWire.png new file mode 100644 index 000000000..c92754d8a Binary files /dev/null and b/resources/mods/dark/textures/models/copperWire.png differ diff --git a/src/minecraft/dark/core/api/ColorCode.java b/src/dark/api/ColorCode.java similarity index 97% rename from src/minecraft/dark/core/api/ColorCode.java rename to src/dark/api/ColorCode.java index 8d3712b9c..82ef4d7ae 100644 --- a/src/minecraft/dark/core/api/ColorCode.java +++ b/src/dark/api/ColorCode.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; public enum ColorCode diff --git a/src/minecraft/dark/core/api/IColorCoded.java b/src/dark/api/IColorCoded.java similarity index 88% rename from src/minecraft/dark/core/api/IColorCoded.java rename to src/dark/api/IColorCoded.java index 6d2c8c6e3..295b81a2b 100644 --- a/src/minecraft/dark/core/api/IColorCoded.java +++ b/src/dark/api/IColorCoded.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; public interface IColorCoded { diff --git a/src/minecraft/dark/core/api/IDisableable.java b/src/dark/api/IDisableable.java similarity index 95% rename from src/minecraft/dark/core/api/IDisableable.java rename to src/dark/api/IDisableable.java index 17bba74f3..d0a7e4307 100644 --- a/src/minecraft/dark/core/api/IDisableable.java +++ b/src/dark/api/IDisableable.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; /** This class should be applied to all tile entities (mainly machines) that can be disabled (by * things like EMP, short circuit etc.). diff --git a/src/minecraft/dark/core/api/IHeatObject.java b/src/dark/api/IHeatObject.java similarity index 96% rename from src/minecraft/dark/core/api/IHeatObject.java rename to src/dark/api/IHeatObject.java index 71acf3a80..611940d70 100644 --- a/src/minecraft/dark/core/api/IHeatObject.java +++ b/src/dark/api/IHeatObject.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; import net.minecraftforge.common.ForgeDirection; diff --git a/src/minecraft/dark/core/api/IHeatProducer.java b/src/dark/api/IHeatProducer.java similarity index 93% rename from src/minecraft/dark/core/api/IHeatProducer.java rename to src/dark/api/IHeatProducer.java index 18181b054..74d0e327f 100644 --- a/src/minecraft/dark/core/api/IHeatProducer.java +++ b/src/dark/api/IHeatProducer.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; import net.minecraftforge.common.ForgeDirection; diff --git a/src/minecraft/dark/core/api/INetworkPart.java b/src/dark/api/INetworkPart.java similarity index 96% rename from src/minecraft/dark/core/api/INetworkPart.java rename to src/dark/api/INetworkPart.java index 3029770a6..59feec7d8 100644 --- a/src/minecraft/dark/core/api/INetworkPart.java +++ b/src/dark/api/INetworkPart.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; import java.util.List; diff --git a/src/minecraft/dark/core/api/IPsiReciever.java b/src/dark/api/IPsiReciever.java similarity index 94% rename from src/minecraft/dark/core/api/IPsiReciever.java rename to src/dark/api/IPsiReciever.java index 4872636a1..215481251 100644 --- a/src/minecraft/dark/core/api/IPsiReciever.java +++ b/src/dark/api/IPsiReciever.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; diff --git a/src/minecraft/dark/core/api/IScroll.java b/src/dark/api/IScroll.java similarity index 92% rename from src/minecraft/dark/core/api/IScroll.java rename to src/dark/api/IScroll.java index 1a82ddbe4..cd4036880 100644 --- a/src/minecraft/dark/core/api/IScroll.java +++ b/src/dark/api/IScroll.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; public interface IScroll { diff --git a/src/minecraft/dark/core/api/ISpecialAccess.java b/src/dark/api/ISpecialAccess.java similarity index 98% rename from src/minecraft/dark/core/api/ISpecialAccess.java rename to src/dark/api/ISpecialAccess.java index de1702a2c..d7b393fd3 100644 --- a/src/minecraft/dark/core/api/ISpecialAccess.java +++ b/src/dark/api/ISpecialAccess.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; import java.util.List; diff --git a/src/minecraft/dark/core/api/ITerminal.java b/src/dark/api/ITerminal.java similarity index 92% rename from src/minecraft/dark/core/api/ITerminal.java rename to src/dark/api/ITerminal.java index ac5498fbd..dd5c87268 100644 --- a/src/minecraft/dark/core/api/ITerminal.java +++ b/src/dark/api/ITerminal.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; import java.util.List; diff --git a/src/minecraft/dark/core/api/ITileConnector.java b/src/dark/api/ITileConnector.java similarity index 91% rename from src/minecraft/dark/core/api/ITileConnector.java rename to src/dark/api/ITileConnector.java index 533ed28cc..d5339819f 100644 --- a/src/minecraft/dark/core/api/ITileConnector.java +++ b/src/dark/api/ITileConnector.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeDirection; diff --git a/src/minecraft/dark/core/api/IToolReadOut.java b/src/dark/api/IToolReadOut.java similarity index 96% rename from src/minecraft/dark/core/api/IToolReadOut.java rename to src/dark/api/IToolReadOut.java index b576abd89..54cd1774f 100644 --- a/src/minecraft/dark/core/api/IToolReadOut.java +++ b/src/dark/api/IToolReadOut.java @@ -1,4 +1,4 @@ -package dark.core.api; +package dark.api; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.common.ForgeDirection; diff --git a/src/minecraft/dark/core/api/PowerSystems.java b/src/dark/api/PowerSystems.java similarity index 66% rename from src/minecraft/dark/core/api/PowerSystems.java rename to src/dark/api/PowerSystems.java index 3f89f72d7..9906ecb6f 100644 --- a/src/minecraft/dark/core/api/PowerSystems.java +++ b/src/dark/api/PowerSystems.java @@ -1,29 +1,28 @@ -package dark.core.api; +package dark.api; import cpw.mods.fml.common.Loader; public enum PowerSystems { - INDUSTRIALCRAFT("IC2"), MEKANISM("Mekanism"), BUILDCRAFT("BuildCraft|Energy"); + INDUSTRIALCRAFT("IC2"), + MEKANISM("Mekanism"), + BUILDCRAFT("BuildCraft|Energy"); public String id; + public static final PowerSystems[] UE_SUPPORTED_SYSTEMS = new PowerSystems[] { INDUSTRIALCRAFT, MEKANISM, BUILDCRAFT }; private PowerSystems(String id) { this.id = id; } - public static float BC3_RATIO = 100; - public static float TO_BC_RATIO = 1 / BC3_RATIO; - + private static boolean init = false; private static Boolean[] loaded; - /** - * Checks to see if something can run powerless based on mods loaded - * + /** Checks to see if something can run powerless based on mods loaded + * * @param optional - power system that the device can use - * @return true if free power is to be generated - */ + * @return true if free power is to be generated */ public static boolean runPowerLess(PowerSystems... optional) { for (int i = 0; i < optional.length; i++) @@ -36,9 +35,7 @@ public enum PowerSystems return true; } - /** - * Check to see if one of the mods listed in the PowerSystem enum is loaded - */ + /** Check to see if one of the mods listed in the PowerSystem enum is loaded */ public static boolean isPowerSystemLoaded(PowerSystems power, boolean force) { if (!init || force) diff --git a/src/minecraft/dark/core/ClientProxy.java b/src/dark/core/ClientProxy.java similarity index 100% rename from src/minecraft/dark/core/ClientProxy.java rename to src/dark/core/ClientProxy.java diff --git a/src/minecraft/dark/core/DarkMain.java b/src/dark/core/DarkMain.java similarity index 72% rename from src/minecraft/dark/core/DarkMain.java rename to src/dark/core/DarkMain.java index 227988b95..af5d15e36 100644 --- a/src/minecraft/dark/core/DarkMain.java +++ b/src/dark/core/DarkMain.java @@ -9,6 +9,8 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.world.WorldEvent; import universalelectricity.prefab.network.PacketManager; +import universalelectricity.prefab.ore.OreGenReplaceStone; +import universalelectricity.prefab.ore.OreGenerator; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; @@ -21,9 +23,15 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStoppingEvent; import cpw.mods.fml.common.network.NetworkMod; -import dark.core.hydraulic.helpers.FluidRestrictionHandler; -import dark.library.machine.BlockMulti; +import cpw.mods.fml.common.registry.GameRegistry; +import dark.core.items.parts.BlockOre; +import dark.core.items.parts.EnumMeterials; +import dark.core.items.parts.ItemOre; +import dark.core.items.parts.ItemOreDirv; +import dark.core.recipes.RecipeManager; +import dark.helpers.FluidRestrictionHandler; import dark.library.saving.SaveManager; +import dark.prefab.machine.BlockMulti; /** @author HangCow, DarkGuardsman */ @Mod(modid = DarkMain.MOD_ID, name = DarkMain.MOD_NAME, version = DarkMain.VERSION, useMetadata = true) @@ -51,6 +59,7 @@ public class DarkMain extends ModPrefab /** Main config file */ public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "Dark/General.cfg")); + private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" }; /** Can over pressure of devices do area damage */ public static boolean overPressureDamage; /** Main mod output to console */ @@ -69,6 +78,7 @@ public class DarkMain extends ModPrefab @Override public void preInit(FMLPreInitializationEvent event) { + super.preInit(event); LOGGER.setParent(FMLLog.getLogger()); LOGGER.info("Initializing..."); @@ -76,7 +86,7 @@ public class DarkMain extends ModPrefab MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new FluidRestrictionHandler()); - this.loadConfig(); + proxy.preInit(); } @@ -85,14 +95,33 @@ public class DarkMain extends ModPrefab @Override public void init(FMLInitializationEvent event) { - proxy.init(); + super.init(event); + GameRegistry.registerBlock(RecipeManager.blockOre, ItemOre.class, "DMOre"); + BlockOre.regiserOreNames(); + + for (int i = 0; i < EnumMeterials.values().length; i++) + { + if (EnumMeterials.values()[i].doWorldGen) + { + OreGenReplaceStone gen = EnumMeterials.values()[i].getGeneratorSettings(); + if (gen != null && gen.shouldGenerate) + { + OreGenerator.addOre(gen); + } + } + } + proxy.init(); } @EventHandler @Override public void postInit(FMLPostInitializationEvent event) { + super.postInit(event); + + RecipeManager.loadRecipes(); + proxy.postInit(); } @@ -102,14 +131,23 @@ public class DarkMain extends ModPrefab { /* CONFIGS */ CONFIGURATION.load(); + /* BLOCKS */ DarkMain.blockMulti = new BlockMulti(DarkMain.CONFIGURATION.getBlock("RestrictedPipes", BLOCK_ID_PREFIX++).getInt()); + if (CONFIGURATION.get("general", "LoadOre", true).getBoolean(true)) + { + RecipeManager.blockOre = new BlockOre(BLOCK_ID_PREFIX++, CONFIGURATION); + } + /* ITEMS */ + if (CONFIGURATION.get("general", "LoadOreItems", true).getBoolean(true)) + { + RecipeManager.itemMetals = new ItemOreDirv(ITEM_ID_PREFIX++, CONFIGURATION); + } if (CONFIGURATION.hasChanged()) { CONFIGURATION.save(); } /* CONFIG END */ - proxy.preInit(); } @Override @@ -118,7 +156,7 @@ public class DarkMain extends ModPrefab /* MCMOD.INFO FILE BUILDER? */ meta.modId = MOD_ID; meta.name = MOD_NAME; - meta.description = "Main mod for several of the mods created by DarkGuardsman and his team. Doesn't add much of anything by itself but is needed for several mods to function correctly"; + meta.description = "Main mod for several of the mods created by DarkGuardsman and his team. Adds basic features, functions, ores, items, and blocks"; meta.url = "www.BuiltBroken.com"; meta.logoFile = TEXTURE_DIRECTORY + "GP_Banner.png"; diff --git a/src/minecraft/dark/core/MainProxy.java b/src/dark/core/MainProxy.java similarity index 100% rename from src/minecraft/dark/core/MainProxy.java rename to src/dark/core/MainProxy.java diff --git a/src/minecraft/dark/core/ModPrefab.java b/src/dark/core/ModPrefab.java similarity index 88% rename from src/minecraft/dark/core/ModPrefab.java rename to src/dark/core/ModPrefab.java index 976d6ebb3..b8ad94846 100644 --- a/src/minecraft/dark/core/ModPrefab.java +++ b/src/dark/core/ModPrefab.java @@ -1,5 +1,9 @@ package dark.core; +import net.minecraftforge.common.Configuration; + +import org.modstats.Modstats; + import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @@ -7,8 +11,8 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; public abstract class ModPrefab { - - + + public String DOMAIN = "dark"; public String PREFIX = DOMAIN + ":"; @@ -22,7 +26,7 @@ public abstract class ModPrefab public static final String ITEM_DIRECTORY = TEXTURE_DIRECTORY + "items/"; public static final String MODEL_DIRECTORY = TEXTURE_DIRECTORY + "models/"; public static final String GUI_DIRECTORY = TEXTURE_DIRECTORY + "gui/"; - + /* START IDS */ public static int BLOCK_ID_PREFIX = 3100; public static int ITEM_ID_PREFIX = 13200; @@ -31,12 +35,16 @@ public abstract class ModPrefab { DOMAIN = domain; this.loadModMeta(); + /* UPDATE NOTIFIER */ + Modstats.instance().getReporter().registerMod(this); + this.loadConfig(); + /* CONFIG END */ } @EventHandler public void preInit(FMLPreInitializationEvent event) { - this.loadConfig(); + } @EventHandler @@ -52,6 +60,6 @@ public abstract class ModPrefab } public abstract void loadConfig(); - + public abstract void loadModMeta(); } diff --git a/src/dark/core/ServerLoad.java b/src/dark/core/ServerLoad.java new file mode 100644 index 000000000..2323eacae --- /dev/null +++ b/src/dark/core/ServerLoad.java @@ -0,0 +1,24 @@ +package dark.core; + +public class ServerLoad +{ + + public void preInit() + { + // TODO Auto-generated method stub + + } + + public void Init() + { + // TODO Auto-generated method stub + + } + + public void postInit() + { + // TODO Auto-generated method stub + + } + +} diff --git a/src/dark/core/client/ClientLoad.java b/src/dark/core/client/ClientLoad.java new file mode 100644 index 000000000..20c24bd29 --- /dev/null +++ b/src/dark/core/client/ClientLoad.java @@ -0,0 +1,8 @@ +package dark.core.client; + +import dark.core.ServerLoad; + +public class ClientLoad extends ServerLoad +{ + +} diff --git a/src/dark/core/items/ItemBasic.java b/src/dark/core/items/ItemBasic.java new file mode 100644 index 000000000..13d6b8702 --- /dev/null +++ b/src/dark/core/items/ItemBasic.java @@ -0,0 +1,18 @@ +package dark.core.items; + +import net.minecraft.item.Item; +import net.minecraft.util.Icon; +import net.minecraftforge.common.Configuration; +import dark.core.DarkMain; + +public class ItemBasic extends Item +{ + public static final Icon[] ICONS = new Icon[256]; + + public ItemBasic(int itemID, String name, Configuration config) + { + super(config.getItem(name, itemID).getInt()); + this.setUnlocalizedName(DarkMain.instance.PREFIX + name); + } + +} diff --git a/src/dark/core/items/ItemBattery.java b/src/dark/core/items/ItemBattery.java new file mode 100644 index 000000000..69b03e546 --- /dev/null +++ b/src/dark/core/items/ItemBattery.java @@ -0,0 +1,43 @@ +package dark.core.items; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import universalelectricity.core.item.ItemElectric; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.core.DarkMain; + +public class ItemBattery extends ItemElectric +{ + public ItemBattery(String name, int id) + { + super(DarkMain.CONFIGURATION.getItem(name, id).getInt(id)); + this.setUnlocalizedName(DarkMain.instance.PREFIX + name); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + public String getUnlocalizedName(ItemStack par1ItemStack) + { + return "item." + this.getUnlocalizedName(); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().replace("item.", "")); + } + + @Override + public float getVoltage(ItemStack itemStack) + { + return 25; + } + + @Override + public float getMaxElectricityStored(ItemStack theItem) + { + return 1000000; + } +} diff --git a/src/dark/core/items/ItemParts.java b/src/dark/core/items/ItemParts.java new file mode 100644 index 000000000..f67061c5d --- /dev/null +++ b/src/dark/core/items/ItemParts.java @@ -0,0 +1,62 @@ +package dark.core.items; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.Configuration; + +/** + * Parts that are used for crafting higher up items and block. These parts have no use other that + * crafting + * + * @author DarkGuardsman + * + */ +public class ItemParts extends ItemBasic +{ + + public enum Parts + { + VALVE("Valve"), + SERVO("Servo"); + + public String name; + + private Parts(String name) + { + this.name = name; + } + } + + public ItemParts(int itemID, Configuration config) + { + super(itemID, "lmPart",config); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setMaxStackSize(64); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + return "item." + Parts.values()[itemStack.getItemDamage()].name; + } + + @Override + public int getMetadata(int meta) + { + return meta; + } + + @Override + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int i = 0; i < Parts.values().length; i++) + { + par3List.add(new ItemStack(this, 1, i)); + } + } + +} diff --git a/src/dark/core/items/ItemWrench.java b/src/dark/core/items/ItemWrench.java new file mode 100644 index 000000000..b0259cffa --- /dev/null +++ b/src/dark/core/items/ItemWrench.java @@ -0,0 +1,70 @@ +package dark.core.items; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.ForgeDirection; +import buildcraft.api.tools.IToolWrench; + +public class ItemWrench extends ItemBasic implements IToolWrench +{ + public ItemWrench(int id, Configuration config) + { + super(id, "wrench", config); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabTools); + } + + @Override + public boolean onItemUseFirst(ItemStack stack, EntityPlayer entityPlayer, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + { + int blockID = world.getBlockId(x, y, z); + + if (blockID == Block.furnaceIdle.blockID || blockID == Block.furnaceBurning.blockID || blockID == Block.dropper.blockID || blockID == Block.hopperBlock.blockID || blockID == Block.dispenser.blockID || blockID == Block.pistonBase.blockID || blockID == Block.pistonStickyBase.blockID) + { + int metadata = world.getBlockMetadata(x, y, z); + + int[] rotationMatrix = { 1, 2, 3, 4, 5, 0 }; + + if (blockID == Block.furnaceIdle.blockID || blockID == Block.furnaceBurning.blockID) + { + rotationMatrix = ForgeDirection.ROTATION_MATRIX[0]; + } + + world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.getOrientation(rotationMatrix[metadata]).ordinal(), 3); + this.wrenchUsed(entityPlayer, x, y, z); + + return true; + } + + return false; + } + + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + { + return false; + } + + @Override + public boolean shouldPassSneakingClickToBlock(World world, int x, int y, int z) + { + return true; + } + + @Override + public boolean canWrench(EntityPlayer player, int x, int y, int z) + { + return true; + } + + @Override + public void wrenchUsed(EntityPlayer player, int x, int y, int z) + { + // TODO Auto-generated method stub + + } +} diff --git a/src/dark/core/items/parts/BlockOre.java b/src/dark/core/items/parts/BlockOre.java new file mode 100644 index 000000000..08b56b9e3 --- /dev/null +++ b/src/dark/core/items/parts/BlockOre.java @@ -0,0 +1,71 @@ +package dark.core.items.parts; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraftforge.common.Configuration; +import net.minecraftforge.oredict.OreDictionary; +import dark.core.DarkMain; +import dark.core.recipes.RecipeManager; + +public class BlockOre extends Block +{ + Icon[] icons = new Icon[EnumMeterials.values().length]; + + public BlockOre(int par1, Configuration config) + { + super(config.getBlock("Ore", par1).getInt(), Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + this.setUnlocalizedName(DarkMain.instance.PREFIX + "Ore"); + } + + public static void regiserOreNames() + { + for (int i = 0; i < EnumMeterials.values().length; i++) + { + if (EnumMeterials.values()[i].doWorldGen) + { + OreDictionary.registerOre(EnumMeterials.values()[i].name + "Ore", new ItemStack(RecipeManager.blockOre.blockID, 1, i)); + } + } + } + + @Override + public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int i = 0; i < EnumMeterials.values().length; i++) + { + if (EnumMeterials.values()[i].doWorldGen) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } + } + + @Override + public void registerIcons(IconRegister par1IconRegister) + { + for (int i = 0; i < EnumMeterials.values().length; i++) + { + if (EnumMeterials.values()[i].doWorldGen) + { + this.icons[i] = par1IconRegister.registerIcon(DarkMain.instance.PREFIX + EnumMeterials.values()[i].name + "Ore"); + } + } + } + + @Override + public Icon getIcon(int side, int metadata) + { + if (this.icons[metadata] != null) + { + return this.icons[metadata]; + } + return Block.stone.getIcon(side, metadata); + } +} diff --git a/src/dark/core/items/parts/EnumMeterials.java b/src/dark/core/items/parts/EnumMeterials.java new file mode 100644 index 000000000..0e79e9bdb --- /dev/null +++ b/src/dark/core/items/parts/EnumMeterials.java @@ -0,0 +1,92 @@ +package dark.core.items.parts; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import universalelectricity.prefab.ore.OreGenReplaceStone; +import dark.core.DarkMain; +import dark.core.recipes.RecipeManager; + +/** Class for storing materials, there icon names, sub items to be made from them or there sub ores + * + * + * @author DarkGuardsman */ +public enum EnumMeterials +{ + WOOD("Wood", EnumOreParts.INGOTS, EnumOreParts.PLATES, EnumOreParts.RUBBLE, EnumOreParts.ROD), + STONE("Stone", EnumOreParts.INGOTS), + COPPER("Copper", true, true, 70, 22, 10), + TIN("Tin", true, true, 70, 22, 10, EnumOreParts.GEARS, EnumOreParts.TUBE), + IRON("Iron", EnumOreParts.INGOTS), + OBBY("Obby", EnumOreParts.INGOTS, EnumOreParts.RUBBLE), + LEAD("Lead", true, true, 50, 8, 3, EnumOreParts.GEARS, EnumOreParts.TUBE), + ALUMINIUM("Aluminum", true, true, 50, 8, 3, EnumOreParts.GEARS, EnumOreParts.TUBE), + SILVER("Silver", true, true, 40, 15, 6, EnumOreParts.GEARS), + GOLD("Gold", EnumOreParts.GEARS, EnumOreParts.INGOTS), + COAL("Coal", EnumOreParts.GEARS, EnumOreParts.TUBE, EnumOreParts.PLATES, EnumOreParts.RUBBLE), + STEEL("Steel", true, false, 0, 0, 0, EnumOreParts.RUBBLE), + BRONZE("Bronze", true, false, 0, 0, 0, EnumOreParts.RUBBLE); + + /* UNLOCALIZED NAME AND ICON PREFIX */ + public String name; + /* CREATE AN ITEM FOR THIS ORE */ + public List unneedItems; + public boolean block; + /* ORE GENERATOR OPTIONS */ + public boolean doWorldGen; + public int ammount, branch, maxY; + + private EnumMeterials(String name, boolean block, boolean canWorldGen, int ammount, int branch, int maxY, EnumOreParts... enumOreParts) + { + this.name = name; + + unneedItems = new ArrayList(); + for (int i = 0; enumOreParts != null && i < enumOreParts.length; i++) + { + unneedItems.add(enumOreParts[i]); + } + + this.block = block; + + this.doWorldGen = canWorldGen; + this.maxY = maxY; + this.ammount = ammount; + this.branch = branch; + } + + private EnumMeterials(String name, EnumOreParts... enumOreParts) + { + this.name = name; + this.block = false; + + unneedItems = new ArrayList(); + for (int i = 0; enumOreParts != null && i < enumOreParts.length; i++) + { + unneedItems.add(enumOreParts[i]); + } + this.doWorldGen = false; + this.maxY = 0; + this.ammount = 0; + this.branch = 0; + } + + public OreGenReplaceStone getGeneratorSettings() + { + if (this.doWorldGen) + { + ItemStack stack = new ItemStack(RecipeManager.blockOre, 1, this.ordinal()); + return (OreGenReplaceStone) new OreGenReplaceStone(this.name, this.name + "Ore", stack, this.maxY, this.ammount, this.branch).enable(DarkMain.instance.CONFIGURATION); + } + return null; + } + + public boolean shouldCreateItem(EnumOreParts part) + { + if (part == EnumOreParts.ROD || part == EnumOreParts.TUBE || part == EnumOreParts.RUBBLE) + { + return false; + } + return this.unneedItems == null || !this.unneedItems.contains(part); + } +} diff --git a/src/dark/core/items/parts/EnumOreParts.java b/src/dark/core/items/parts/EnumOreParts.java new file mode 100644 index 000000000..8f9b7f8b5 --- /dev/null +++ b/src/dark/core/items/parts/EnumOreParts.java @@ -0,0 +1,41 @@ +package dark.core.items.parts; + +public enum EnumOreParts +{ + + RUBBLE("Rubble", 0), + DUST("Dust", 20), + INGOTS("Ingot", 40), + PLATES("Plate", 60), + GEARS("Gears", 80), + TUBE("Tube", 100), + ROD("Rod", 120), + SCRAPS("Scraps", 140); + + public int meta; + public String name; + + private EnumOreParts(String name, int meta) + { + this.meta = meta; + this.name = name; + } + + public static String getPartName(int meta) + { + if (meta < (EnumOreParts.values().length * 20)) + { + return EnumOreParts.values()[meta / 20].name; + } + return ""; + } + + public static String getFullName(int meta) + { + if (meta < (EnumOreParts.values().length * 20)) + { + return EnumMeterials.values()[meta % 20].name + EnumOreParts.values()[meta / 20].name; + } + return ""; + } +} diff --git a/src/dark/core/items/parts/ItemOre.java b/src/dark/core/items/parts/ItemOre.java new file mode 100644 index 000000000..529f22843 --- /dev/null +++ b/src/dark/core/items/parts/ItemOre.java @@ -0,0 +1,29 @@ +package dark.core.items.parts; + +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import dark.core.DarkMain; + +public class ItemOre extends ItemBlock +{ + + public ItemOre(int par1) + { + super(par1); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public int getMetadata(int damage) + { + return damage; + } + + @Override + public String getUnlocalizedName(ItemStack par1ItemStack) + { + return "tile." + DarkMain.instance.PREFIX + EnumMeterials.values()[par1ItemStack.getItemDamage()].name + "Ore"; + } + +} diff --git a/src/dark/core/items/parts/ItemOreDirv.java b/src/dark/core/items/parts/ItemOreDirv.java new file mode 100644 index 000000000..fd41c78ae --- /dev/null +++ b/src/dark/core/items/parts/ItemOreDirv.java @@ -0,0 +1,84 @@ +package dark.core.items.parts; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraftforge.common.Configuration; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dark.core.DarkMain; +import dark.core.items.ItemBasic; + +/** A series of items that are derived from a basic ore block + * + * @author DarkGuardsman */ +public class ItemOreDirv extends ItemBasic +{ + + /* EACH SUB IS ALLOCATED 20 metadata to store items in its group */ + + public ItemOreDirv(int itemID, Configuration config) + { + super(itemID, "Metal_Parts", config); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + + if (itemStack != null) + { + int meta = itemStack.getItemDamage(); + return "item." + DarkMain.instance.PREFIX + EnumOreParts.getFullName(meta); + } + else + { + return this.getUnlocalizedName(); + } + } + + @Override + public Icon getIconFromDamage(int i) + { + return ICONS[i]; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IconRegister iconRegister) + { + for (int j = 0; j < EnumOreParts.values().length; j++) + { + String suf = EnumOreParts.values()[j].name; + int meta = EnumOreParts.values()[j].meta; + for (int i = 0; i < EnumMeterials.values().length; i++) + { + ICONS[i + meta] = iconRegister.registerIcon(DarkMain.instance.PREFIX + EnumMeterials.values()[i].name + suf); + } + } + } + + @Override + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int j = 0; j < EnumOreParts.values().length; j++) + { + String suf = EnumOreParts.values()[j].name; + int i = EnumOreParts.values()[j].meta; + for (; i < EnumMeterials.values().length + EnumOreParts.values()[j].meta; i++) + { + if (EnumMeterials.values()[i - EnumOreParts.values()[j].meta].shouldCreateItem(EnumOreParts.values()[j])) + { + par3List.add(new ItemStack(this, 1, i)); + } + } + } + } + +} diff --git a/src/dark/core/items/parts/OreGenSettings.java b/src/dark/core/items/parts/OreGenSettings.java new file mode 100644 index 000000000..9269870db --- /dev/null +++ b/src/dark/core/items/parts/OreGenSettings.java @@ -0,0 +1,178 @@ +package dark.core.items.parts; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderEnd; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.ChunkProviderHell; +import net.minecraftforge.common.Configuration; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.FMLLog; + +public class OreGenSettings +{ + public int minGenerateLevel; + public int maxGenerateLevel; + public int amountPerChunk; + public int amountPerBranch; + public int replaceID; + + public boolean ignoreSurface = false; + public boolean ignoreNether = true; + public boolean ignoreEnd = true; + + public boolean shouldGenerate = false; + + public int havestLevel; + public String harvestTool; + + public String oreName; + public ItemStack oreStack; + + /** @param name - name of the ore to be used in the config file + * @param stack - itemStack of the ore, amount doesn't matter + * @param harvestTool - tool needed to harvest tool + * @param harvestLevel - level of hardness need to harvest the ore */ + public OreGenSettings(String name, ItemStack stack, String harvestTool, int harvestLevel, int replaceID, int minGenerateLevel, int maxGenerateLevel, int amountPerChunk, int amountPerBranch) + { + if (stack != null) + { + this.harvestTool = harvestTool; + this.oreStack = stack; + this.havestLevel = harvestLevel; + + this.minGenerateLevel = minGenerateLevel; + this.maxGenerateLevel = maxGenerateLevel; + this.amountPerChunk = amountPerChunk; + this.amountPerBranch = amountPerBranch; + this.replaceID = replaceID; + + MinecraftForge.setBlockHarvestLevel(Block.blocksList[stack.itemID], stack.getItemDamage(), harvestTool, harvestLevel); + } + else + { + FMLLog.severe("ItemStack is null while registering ore generation!"); + } + } + + public OreGenSettings genStone(String name, ItemStack stack, int minGenerateLevel, int maxGenerateLevel, int amountPerChunk, int amountPerBranch) + { + return new OreGenSettings(name, stack, "pickAxe", 1, Block.stone.blockID, minGenerateLevel, maxGenerateLevel, amountPerChunk, amountPerBranch); + } + + /** Is the ore gen enabled */ + public OreGenSettings enable(Configuration config) + { + this.shouldGenerate = shouldGenerateOre(config, this.oreName); + return this; + } + + /** Checks the config file and see if Universal Electricity should generate this ore */ + private static boolean shouldGenerateOre(Configuration configuration, String oreName) + { + boolean shouldGenerate = configuration.get("Ore_Generation", "Generate_" + oreName, true).getBoolean(true); + configuration.save(); + return shouldGenerate; + } + + public void generate(World world, Random random, int chunkCoordX, int chunkCoordZ) + { + try + { + for (int i = 0; i < this.amountPerChunk; i++) + { + int x = chunkCoordX + random.nextInt(16); + int z = chunkCoordZ + random.nextInt(16); + int y = random.nextInt(Math.max(this.maxGenerateLevel - this.minGenerateLevel, 0)) + this.minGenerateLevel; + this.generateReplace(world, random, x, y, z); + } + } + catch (Exception e) + { + System.out.println("Error generating ore: " + this.oreName); + e.printStackTrace(); + } + } + + public boolean generateReplace(World world, Random random, int genX, int genY, int genZ) + { + float var6 = random.nextFloat() * (float) Math.PI; + double var7 = genX + 8 + MathHelper.sin(var6) * this.amountPerBranch / 8.0F; + double var9 = genX + 8 - MathHelper.sin(var6) * this.amountPerBranch / 8.0F; + double var11 = genZ + 8 + MathHelper.cos(var6) * this.amountPerBranch / 8.0F; + double var13 = genZ + 8 - MathHelper.cos(var6) * this.amountPerBranch / 8.0F; + double var15 = genY + random.nextInt(3) - 2; + double var17 = genY + random.nextInt(3) - 2; + + for (int branchCount = 0; branchCount <= this.amountPerBranch; ++branchCount) + { + double var20 = var7 + (var9 - var7) * branchCount / this.amountPerBranch; + double var22 = var15 + (var17 - var15) * branchCount / this.amountPerBranch; + double var24 = var11 + (var13 - var11) * branchCount / this.amountPerBranch; + double var26 = random.nextDouble() * this.amountPerBranch / 16.0D; + double var28 = (MathHelper.sin(branchCount * (float) Math.PI / this.amountPerBranch) + 1.0F) * var26 + 1.0D; + double var30 = (MathHelper.sin(branchCount * (float) Math.PI / this.amountPerBranch) + 1.0F) * var26 + 1.0D; + int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); + int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); + int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); + int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); + int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); + int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); + + for (int x = var32; x <= var35; ++x) + { + double var39 = (x + 0.5D - var20) / (var28 / 2.0D); + + if (var39 * var39 < 1.0D) + { + for (int y = var33; y <= var36; ++y) + { + double var42 = (y + 0.5D - var22) / (var30 / 2.0D); + + if (var39 * var39 + var42 * var42 < 1.0D) + { + for (int z = var34; z <= var37; ++z) + { + double var45 = (z + 0.5D - var24) / (var28 / 2.0D); + + int block = world.getBlockId(x, y, z); + if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (this.replaceID == 0 || block == this.replaceID)) + { + world.setBlock(x, y, z, this.oreStack.itemID, this.oreStack.getItemDamage(), 2); + } + } + } + } + } + } + } + + return true; + } + + public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator) + { + if (!this.shouldGenerate) + { + return false; + } + if (this.ignoreSurface && chunkGenerator instanceof ChunkProviderGenerate) + { + return false; + } + if (this.ignoreNether && chunkGenerator instanceof ChunkProviderHell) + { + return false; + } + if (this.ignoreEnd && chunkGenerator instanceof ChunkProviderEnd) + { + return false; + } + return true; + } +} diff --git a/src/dark/core/items/parts/OreGenerator.java b/src/dark/core/items/parts/OreGenerator.java new file mode 100644 index 000000000..64cce30c0 --- /dev/null +++ b/src/dark/core/items/parts/OreGenerator.java @@ -0,0 +1,47 @@ +package dark.core.items.parts; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import cpw.mods.fml.common.IWorldGenerator; +import cpw.mods.fml.common.registry.GameRegistry; + +public class OreGenerator implements IWorldGenerator +{ + public static boolean isInitiated = false; + + /** Add your ore data to this list of ores for it to automatically generate! No hassle indeed! */ + private static final List ORES_TO_GENERATE = new ArrayList(); + + /** Adds an ore to the ore generate list. Do this in pre-init. */ + public static void addOre(OreGenSettings data) + { + if (!isInitiated) + { + GameRegistry.registerWorldGenerator(new OreGenerator()); + } + + ORES_TO_GENERATE.add(data); + } + + @Override + public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) + { + chunkX = chunkX << 4; + chunkZ = chunkZ << 4; + + // Checks to make sure this is the normal + // world + for (OreGenSettings oreData : ORES_TO_GENERATE) + { + if (oreData.shouldGenerate && oreData.isOreGeneratedInWorld(world, chunkGenerator)) + { + oreData.generate(world, rand, chunkX, chunkZ); + } + + } + } +} diff --git a/src/dark/core/recipes/RecipeManager.java b/src/dark/core/recipes/RecipeManager.java new file mode 100644 index 000000000..87373cedf --- /dev/null +++ b/src/dark/core/recipes/RecipeManager.java @@ -0,0 +1,41 @@ +package dark.core.recipes; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import dark.core.items.parts.EnumMeterials; +import dark.core.items.parts.EnumOreParts; + +public class RecipeManager +{ + + /* BLOCKS */ + public static Block blockOre; + + /* ITEMS */ + public static Item itemMetals; + + public static void loadRecipes() + { + loadSmeltingRecipes(); + } + + public static void loadSmeltingRecipes() + { + if (blockOre != null && itemMetals != null) + { + for (int i = 0; i < EnumMeterials.values().length; i++) + { + if (EnumMeterials.values()[i].doWorldGen) + { + FurnaceRecipes.smelting().addSmelting(blockOre.blockID, i, new ItemStack(itemMetals.itemID, 1, 40 + i), 0.6f); + } + if (EnumMeterials.values()[i].shouldCreateItem(EnumOreParts.DUST) && EnumMeterials.values()[i] != EnumMeterials.WOOD && EnumMeterials.values()[i] != EnumMeterials.COAL) + { + FurnaceRecipes.smelting().addSmelting(itemMetals.itemID, i + 20, new ItemStack(itemMetals.itemID, 1, 40 + i), 0.6f); + } + } + } + } +} diff --git a/src/minecraft/dark/core/render/BlockRenderInfo.java b/src/dark/core/render/BlockRenderInfo.java similarity index 100% rename from src/minecraft/dark/core/render/BlockRenderInfo.java rename to src/dark/core/render/BlockRenderInfo.java diff --git a/src/minecraft/dark/core/render/EntityFakeBlock.java b/src/dark/core/render/EntityFakeBlock.java similarity index 100% rename from src/minecraft/dark/core/render/EntityFakeBlock.java rename to src/dark/core/render/EntityFakeBlock.java diff --git a/src/minecraft/dark/core/render/FluidBlockRenderer.java b/src/dark/core/render/FluidBlockRenderer.java similarity index 100% rename from src/minecraft/dark/core/render/FluidBlockRenderer.java rename to src/dark/core/render/FluidBlockRenderer.java diff --git a/src/minecraft/dark/core/render/RenderFakeBlock.java b/src/dark/core/render/RenderFakeBlock.java similarity index 100% rename from src/minecraft/dark/core/render/RenderFakeBlock.java rename to src/dark/core/render/RenderFakeBlock.java diff --git a/src/minecraft/dark/core/render/RenderMachine.java b/src/dark/core/render/RenderMachine.java similarity index 100% rename from src/minecraft/dark/core/render/RenderMachine.java rename to src/dark/core/render/RenderMachine.java diff --git a/src/minecraft/dark/core/tile/network/NetworkPathFinder.java b/src/dark/core/tile/network/NetworkPathFinder.java similarity index 97% rename from src/minecraft/dark/core/tile/network/NetworkPathFinder.java rename to src/dark/core/tile/network/NetworkPathFinder.java index 3ba7d2062..08647f61e 100644 --- a/src/minecraft/dark/core/tile/network/NetworkPathFinder.java +++ b/src/dark/core/tile/network/NetworkPathFinder.java @@ -8,7 +8,7 @@ import net.minecraft.world.World; import universalelectricity.core.path.IPathCallBack; import universalelectricity.core.path.Pathfinder; import universalelectricity.core.vector.Vector3; -import dark.core.api.INetworkPart; +import dark.api.INetworkPart; /** Check if a conductor connects with another. */ public class NetworkPathFinder extends Pathfinder diff --git a/src/minecraft/dark/core/tile/network/NetworkSharedPower.java b/src/dark/core/tile/network/NetworkSharedPower.java similarity index 97% rename from src/minecraft/dark/core/tile/network/NetworkSharedPower.java rename to src/dark/core/tile/network/NetworkSharedPower.java index af2ba5ca2..b9179bc14 100644 --- a/src/minecraft/dark/core/tile/network/NetworkSharedPower.java +++ b/src/dark/core/tile/network/NetworkSharedPower.java @@ -2,7 +2,7 @@ package dark.core.tile.network; import net.minecraft.tileentity.TileEntity; import universalelectricity.core.block.IElectricalStorage; -import dark.core.api.INetworkPart; +import dark.api.INetworkPart; /** Used for tile networks that only need to share power or act like a group battery that doesn't * store power on world save diff --git a/src/minecraft/dark/core/tile/network/NetworkTileEntities.java b/src/dark/core/tile/network/NetworkTileEntities.java similarity index 99% rename from src/minecraft/dark/core/tile/network/NetworkTileEntities.java rename to src/dark/core/tile/network/NetworkTileEntities.java index 04772c007..bf0ca173c 100644 --- a/src/minecraft/dark/core/tile/network/NetworkTileEntities.java +++ b/src/dark/core/tile/network/NetworkTileEntities.java @@ -12,7 +12,7 @@ import universalelectricity.core.path.Pathfinder; import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.VectorHelper; import cpw.mods.fml.common.FMLLog; -import dark.core.api.INetworkPart; +import dark.api.INetworkPart; import dark.helpers.ConnectionHelper; public abstract class NetworkTileEntities diff --git a/src/minecraft/dark/helpers/ConnectionHelper.java b/src/dark/helpers/ConnectionHelper.java similarity index 100% rename from src/minecraft/dark/helpers/ConnectionHelper.java rename to src/dark/helpers/ConnectionHelper.java diff --git a/src/minecraft/dark/helpers/Direction.java b/src/dark/helpers/Direction.java similarity index 100% rename from src/minecraft/dark/helpers/Direction.java rename to src/dark/helpers/Direction.java diff --git a/src/minecraft/dark/core/hydraulic/helpers/FluidHelper.java b/src/dark/helpers/FluidHelper.java similarity index 98% rename from src/minecraft/dark/core/hydraulic/helpers/FluidHelper.java rename to src/dark/helpers/FluidHelper.java index 8af10f1e7..ce5338da9 100644 --- a/src/minecraft/dark/core/hydraulic/helpers/FluidHelper.java +++ b/src/dark/helpers/FluidHelper.java @@ -1,4 +1,4 @@ -package dark.core.hydraulic.helpers; +package dark.helpers; import net.minecraft.block.Block; import net.minecraft.world.World; diff --git a/src/minecraft/dark/core/hydraulic/helpers/FluidRestrictionHandler.java b/src/dark/helpers/FluidRestrictionHandler.java similarity index 96% rename from src/minecraft/dark/core/hydraulic/helpers/FluidRestrictionHandler.java rename to src/dark/helpers/FluidRestrictionHandler.java index 9e7e98a08..efbc59751 100644 --- a/src/minecraft/dark/core/hydraulic/helpers/FluidRestrictionHandler.java +++ b/src/dark/helpers/FluidRestrictionHandler.java @@ -1,4 +1,4 @@ -package dark.core.hydraulic.helpers; +package dark.helpers; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.fluids.Fluid; @@ -8,7 +8,7 @@ import net.minecraftforge.fluids.FluidRegistry.FluidRegisterEvent; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import dark.core.api.ColorCode; +import dark.api.ColorCode; public class FluidRestrictionHandler { diff --git a/src/minecraft/dark/helpers/ItemFindingHelper.java b/src/dark/helpers/ItemFindingHelper.java similarity index 100% rename from src/minecraft/dark/helpers/ItemFindingHelper.java rename to src/dark/helpers/ItemFindingHelper.java diff --git a/src/minecraft/dark/helpers/MetaGroup.java b/src/dark/helpers/MetaGroup.java similarity index 100% rename from src/minecraft/dark/helpers/MetaGroup.java rename to src/dark/helpers/MetaGroup.java diff --git a/src/minecraft/dark/helpers/Pair.java b/src/dark/helpers/Pair.java similarity index 100% rename from src/minecraft/dark/helpers/Pair.java rename to src/dark/helpers/Pair.java diff --git a/src/minecraft/dark/helpers/PlayerMsgHelper.java b/src/dark/helpers/PlayerMsgHelper.java similarity index 100% rename from src/minecraft/dark/helpers/PlayerMsgHelper.java rename to src/dark/helpers/PlayerMsgHelper.java diff --git a/src/minecraft/dark/helpers/Time.java b/src/dark/helpers/Time.java similarity index 100% rename from src/minecraft/dark/helpers/Time.java rename to src/dark/helpers/Time.java diff --git a/src/minecraft/dark/library/access/AccessLevel.java b/src/dark/library/access/AccessLevel.java similarity index 100% rename from src/minecraft/dark/library/access/AccessLevel.java rename to src/dark/library/access/AccessLevel.java diff --git a/src/minecraft/dark/library/access/GlobalAccess.java b/src/dark/library/access/GlobalAccess.java similarity index 100% rename from src/minecraft/dark/library/access/GlobalAccess.java rename to src/dark/library/access/GlobalAccess.java diff --git a/src/minecraft/dark/library/access/GlobalAccessLoader.java b/src/dark/library/access/GlobalAccessLoader.java similarity index 100% rename from src/minecraft/dark/library/access/GlobalAccessLoader.java rename to src/dark/library/access/GlobalAccessLoader.java diff --git a/src/minecraft/dark/library/access/GlobalAccessManager.java b/src/dark/library/access/GlobalAccessManager.java similarity index 100% rename from src/minecraft/dark/library/access/GlobalAccessManager.java rename to src/dark/library/access/GlobalAccessManager.java diff --git a/src/minecraft/dark/library/access/GuiPacketManager.java b/src/dark/library/access/GuiPacketManager.java similarity index 100% rename from src/minecraft/dark/library/access/GuiPacketManager.java rename to src/dark/library/access/GuiPacketManager.java diff --git a/src/minecraft/dark/library/access/UserAccess.java b/src/dark/library/access/UserAccess.java similarity index 100% rename from src/minecraft/dark/library/access/UserAccess.java rename to src/dark/library/access/UserAccess.java diff --git a/src/minecraft/dark/library/damage/EntityTileDamage.java b/src/dark/library/damage/EntityTileDamage.java similarity index 100% rename from src/minecraft/dark/library/damage/EntityTileDamage.java rename to src/dark/library/damage/EntityTileDamage.java diff --git a/src/minecraft/dark/library/damage/IHpTile.java b/src/dark/library/damage/IHpTile.java similarity index 100% rename from src/minecraft/dark/library/damage/IHpTile.java rename to src/dark/library/damage/IHpTile.java diff --git a/src/minecraft/dark/library/damage/TileDamageSource.java b/src/dark/library/damage/TileDamageSource.java similarity index 100% rename from src/minecraft/dark/library/damage/TileDamageSource.java rename to src/dark/library/damage/TileDamageSource.java diff --git a/src/minecraft/dark/library/effects/FXBeam.java b/src/dark/library/effects/FXBeam.java similarity index 100% rename from src/minecraft/dark/library/effects/FXBeam.java rename to src/dark/library/effects/FXBeam.java diff --git a/src/minecraft/dark/library/gui/ContainerFake.java b/src/dark/library/gui/ContainerFake.java similarity index 100% rename from src/minecraft/dark/library/gui/ContainerFake.java rename to src/dark/library/gui/ContainerFake.java diff --git a/src/minecraft/dark/library/gui/GuiButtonArrow.java b/src/dark/library/gui/GuiButtonArrow.java similarity index 100% rename from src/minecraft/dark/library/gui/GuiButtonArrow.java rename to src/dark/library/gui/GuiButtonArrow.java diff --git a/src/minecraft/dark/library/gui/GuiGlobalList.java b/src/dark/library/gui/GuiGlobalList.java similarity index 99% rename from src/minecraft/dark/library/gui/GuiGlobalList.java rename to src/dark/library/gui/GuiGlobalList.java index 13116c685..77f789ac6 100644 --- a/src/minecraft/dark/library/gui/GuiGlobalList.java +++ b/src/dark/library/gui/GuiGlobalList.java @@ -19,8 +19,8 @@ import universalelectricity.core.vector.Vector2; import universalelectricity.prefab.vector.Region2; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.api.IScroll; import dark.core.DarkMain; -import dark.core.api.IScroll; import dark.library.access.UserAccess; @SideOnly(Side.CLIENT) diff --git a/src/minecraft/dark/library/gui/ISlotPickResult.java b/src/dark/library/gui/ISlotPickResult.java similarity index 100% rename from src/minecraft/dark/library/gui/ISlotPickResult.java rename to src/dark/library/gui/ISlotPickResult.java diff --git a/src/minecraft/dark/library/gui/ISlotWatcher.java b/src/dark/library/gui/ISlotWatcher.java similarity index 100% rename from src/minecraft/dark/library/gui/ISlotWatcher.java rename to src/dark/library/gui/ISlotWatcher.java diff --git a/src/minecraft/dark/library/gui/SlotCraftingResult.java b/src/dark/library/gui/SlotCraftingResult.java similarity index 100% rename from src/minecraft/dark/library/gui/SlotCraftingResult.java rename to src/dark/library/gui/SlotCraftingResult.java diff --git a/src/minecraft/dark/library/gui/SlotRestricted.java b/src/dark/library/gui/SlotRestricted.java similarity index 100% rename from src/minecraft/dark/library/gui/SlotRestricted.java rename to src/dark/library/gui/SlotRestricted.java diff --git a/src/minecraft/dark/library/gui/WatchedSlot.java b/src/dark/library/gui/WatchedSlot.java similarity index 100% rename from src/minecraft/dark/library/gui/WatchedSlot.java rename to src/dark/library/gui/WatchedSlot.java diff --git a/src/minecraft/dark/library/math/LinearAlg.java b/src/dark/library/math/LinearAlg.java similarity index 100% rename from src/minecraft/dark/library/math/LinearAlg.java rename to src/dark/library/math/LinearAlg.java diff --git a/src/minecraft/dark/library/math/MathHelper.java b/src/dark/library/math/MathHelper.java similarity index 100% rename from src/minecraft/dark/library/math/MathHelper.java rename to src/dark/library/math/MathHelper.java diff --git a/src/minecraft/dark/library/math/Matrix4.java b/src/dark/library/math/Matrix4.java similarity index 100% rename from src/minecraft/dark/library/math/Matrix4.java rename to src/dark/library/math/Matrix4.java diff --git a/src/minecraft/dark/library/math/Quaternion.java b/src/dark/library/math/Quaternion.java similarity index 100% rename from src/minecraft/dark/library/math/Quaternion.java rename to src/dark/library/math/Quaternion.java diff --git a/src/minecraft/dark/library/saving/INbtSave.java b/src/dark/library/saving/INbtSave.java similarity index 100% rename from src/minecraft/dark/library/saving/INbtSave.java rename to src/dark/library/saving/INbtSave.java diff --git a/src/minecraft/dark/library/saving/NBTFileLoader.java b/src/dark/library/saving/NBTFileLoader.java similarity index 100% rename from src/minecraft/dark/library/saving/NBTFileLoader.java rename to src/dark/library/saving/NBTFileLoader.java diff --git a/src/minecraft/dark/library/saving/SaveManager.java b/src/dark/library/saving/SaveManager.java similarity index 100% rename from src/minecraft/dark/library/saving/SaveManager.java rename to src/dark/library/saving/SaveManager.java diff --git a/src/minecraft/dark/library/machine/AutoCraftingManager.java b/src/dark/prefab/machine/AutoCraftingManager.java similarity index 99% rename from src/minecraft/dark/library/machine/AutoCraftingManager.java rename to src/dark/prefab/machine/AutoCraftingManager.java index f094ee06d..2b597ec6d 100644 --- a/src/minecraft/dark/library/machine/AutoCraftingManager.java +++ b/src/dark/prefab/machine/AutoCraftingManager.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; import java.util.ArrayList; import java.util.List; diff --git a/src/minecraft/dark/library/machine/BlockMachine.java b/src/dark/prefab/machine/BlockMachine.java similarity index 98% rename from src/minecraft/dark/library/machine/BlockMachine.java rename to src/dark/prefab/machine/BlockMachine.java index 05e1fd9ba..3e2f320a9 100644 --- a/src/minecraft/dark/library/machine/BlockMachine.java +++ b/src/dark/prefab/machine/BlockMachine.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -11,8 +11,8 @@ import net.minecraftforge.common.Configuration; import universalelectricity.prefab.block.BlockAdvanced; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import dark.api.INetworkPart; import dark.core.DarkMain; -import dark.core.api.INetworkPart; /** Basic TileEntity Container class designed to be used by generic machines. It is suggested that * each mod using this create there own basic block extending this to reduce need to input config diff --git a/src/minecraft/dark/library/machine/BlockMulti.java b/src/dark/prefab/machine/BlockMulti.java similarity index 99% rename from src/minecraft/dark/library/machine/BlockMulti.java rename to src/dark/prefab/machine/BlockMulti.java index dec3b5cd4..c69bd7f1d 100644 --- a/src/minecraft/dark/library/machine/BlockMulti.java +++ b/src/dark/prefab/machine/BlockMulti.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; import java.util.Random; diff --git a/src/minecraft/dark/library/machine/IAutoCrafter.java b/src/dark/prefab/machine/IAutoCrafter.java similarity index 80% rename from src/minecraft/dark/library/machine/IAutoCrafter.java rename to src/dark/prefab/machine/IAutoCrafter.java index 236c9ff8e..01ccdc07e 100644 --- a/src/minecraft/dark/library/machine/IAutoCrafter.java +++ b/src/dark/prefab/machine/IAutoCrafter.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; public interface IAutoCrafter { diff --git a/src/minecraft/dark/library/machine/IBlockActivate.java b/src/dark/prefab/machine/IBlockActivate.java similarity index 90% rename from src/minecraft/dark/library/machine/IBlockActivate.java rename to src/dark/prefab/machine/IBlockActivate.java index 68e934b40..e445fd4dc 100644 --- a/src/minecraft/dark/library/machine/IBlockActivate.java +++ b/src/dark/prefab/machine/IBlockActivate.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/minecraft/dark/library/machine/IMultiBlock.java b/src/dark/prefab/machine/IMultiBlock.java similarity index 95% rename from src/minecraft/dark/library/machine/IMultiBlock.java rename to src/dark/prefab/machine/IMultiBlock.java index 6c3ed6ff9..f7323aeae 100644 --- a/src/minecraft/dark/library/machine/IMultiBlock.java +++ b/src/dark/prefab/machine/IMultiBlock.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; import net.minecraft.tileentity.TileEntity; import universalelectricity.core.vector.Vector3; diff --git a/src/minecraft/dark/library/machine/TileEntityRunnableMachine.java b/src/dark/prefab/machine/TileEntityMachine.java similarity index 86% rename from src/minecraft/dark/library/machine/TileEntityRunnableMachine.java rename to src/dark/prefab/machine/TileEntityMachine.java index 658b3acb9..f5d6cfd75 100644 --- a/src/minecraft/dark/library/machine/TileEntityRunnableMachine.java +++ b/src/dark/prefab/machine/TileEntityMachine.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; import java.util.Random; @@ -9,18 +9,15 @@ import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; import universalelectricity.compatibility.TileEntityUniversalElectrical; import universalelectricity.core.electricity.ElectricityPack; -import dark.core.api.IDisableable; -import dark.core.api.PowerSystems; +import dark.api.IDisableable; +import dark.api.PowerSystems; -public class TileEntityRunnableMachine extends TileEntityUniversalElectrical implements IDisableable +public class TileEntityMachine extends TileEntityUniversalElectrical implements IDisableable { /** Forge Ore Directory name of the item to toggle power */ public static String powerToggleItemID = "battery"; - /** Power Systems this machine can support */ - protected PowerSystems[] powerList = new PowerSystems[] { PowerSystems.BUILDCRAFT, PowerSystems.MEKANISM, PowerSystems.INDUSTRIALCRAFT }; - protected Random random = new Random(); protected int ticksDisabled = 0; protected boolean runWithOutPower = false; @@ -41,7 +38,7 @@ public class TileEntityRunnableMachine extends TileEntityUniversalElectrical imp public boolean canRun() { ; - return !this.isDisabled() && (this.runWithOutPower || PowerSystems.runPowerLess(powerList)); + return !this.isDisabled() && (this.runWithOutPower || PowerSystems.runPowerLess(PowerSystems.UE_SUPPORTED_SYSTEMS)); } /** Called when a player activates the tile's block */ @@ -52,7 +49,7 @@ public class TileEntityRunnableMachine extends TileEntityUniversalElectrical imp ItemStack itemStack = player.getHeldItem(); if (itemStack != null) { - for (ItemStack stack : OreDictionary.getOres(TileEntityRunnableMachine.powerToggleItemID)) + for (ItemStack stack : OreDictionary.getOres(TileEntityMachine.powerToggleItemID)) { if (stack.isItemEqual(itemStack)) { diff --git a/src/minecraft/dark/library/machine/TileEntityMulti.java b/src/dark/prefab/machine/TileEntityMulti.java similarity index 99% rename from src/minecraft/dark/library/machine/TileEntityMulti.java rename to src/dark/prefab/machine/TileEntityMulti.java index 26540c924..ec627e32d 100644 --- a/src/minecraft/dark/library/machine/TileEntityMulti.java +++ b/src/dark/prefab/machine/TileEntityMulti.java @@ -1,4 +1,4 @@ -package dark.library.machine; +package dark.prefab.machine; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/minecraft/dark/library/machine/terminal/CommandHelp.java b/src/dark/prefab/machine/terminal/CommandHelp.java similarity index 94% rename from src/minecraft/dark/library/machine/terminal/CommandHelp.java rename to src/dark/prefab/machine/terminal/CommandHelp.java index 6e84e29ed..3bb575bbd 100644 --- a/src/minecraft/dark/library/machine/terminal/CommandHelp.java +++ b/src/dark/prefab/machine/terminal/CommandHelp.java @@ -1,12 +1,12 @@ -package dark.library.machine.terminal; +package dark.prefab.machine.terminal; import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import dark.core.api.ISpecialAccess; -import dark.core.api.ITerminal; +import dark.api.ISpecialAccess; +import dark.api.ITerminal; public class CommandHelp extends TerminalCommand { diff --git a/src/minecraft/dark/library/machine/terminal/CommandRegistry.java b/src/dark/prefab/machine/terminal/CommandRegistry.java similarity index 95% rename from src/minecraft/dark/library/machine/terminal/CommandRegistry.java rename to src/dark/prefab/machine/terminal/CommandRegistry.java index 446b8840f..fe67572fe 100644 --- a/src/minecraft/dark/library/machine/terminal/CommandRegistry.java +++ b/src/dark/prefab/machine/terminal/CommandRegistry.java @@ -1,11 +1,11 @@ -package dark.library.machine.terminal; +package dark.prefab.machine.terminal; import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import dark.core.api.ITerminal; +import dark.api.ITerminal; /** * * @author Calclavia, DarkGuardsman diff --git a/src/minecraft/dark/library/machine/terminal/CommandUser.java b/src/dark/prefab/machine/terminal/CommandUser.java similarity index 95% rename from src/minecraft/dark/library/machine/terminal/CommandUser.java rename to src/dark/prefab/machine/terminal/CommandUser.java index d9ea103b1..52e06649d 100644 --- a/src/minecraft/dark/library/machine/terminal/CommandUser.java +++ b/src/dark/prefab/machine/terminal/CommandUser.java @@ -1,11 +1,11 @@ -package dark.library.machine.terminal; +package dark.prefab.machine.terminal; import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import dark.core.api.ISpecialAccess; -import dark.core.api.ITerminal; +import dark.api.ISpecialAccess; +import dark.api.ITerminal; import dark.library.access.AccessLevel; public class CommandUser extends TerminalCommand diff --git a/src/minecraft/dark/library/machine/terminal/ContainerTerminal.java b/src/dark/prefab/machine/terminal/ContainerTerminal.java similarity index 95% rename from src/minecraft/dark/library/machine/terminal/ContainerTerminal.java rename to src/dark/prefab/machine/terminal/ContainerTerminal.java index c4b5e2df1..dd6b255ba 100644 --- a/src/minecraft/dark/library/machine/terminal/ContainerTerminal.java +++ b/src/dark/prefab/machine/terminal/ContainerTerminal.java @@ -1,4 +1,4 @@ -package dark.library.machine.terminal; +package dark.prefab.machine.terminal; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; diff --git a/src/minecraft/dark/library/machine/terminal/TerminalCommand.java b/src/dark/prefab/machine/terminal/TerminalCommand.java similarity index 92% rename from src/minecraft/dark/library/machine/terminal/TerminalCommand.java rename to src/dark/prefab/machine/terminal/TerminalCommand.java index 560694f01..08e8f7b55 100644 --- a/src/minecraft/dark/library/machine/terminal/TerminalCommand.java +++ b/src/dark/prefab/machine/terminal/TerminalCommand.java @@ -1,11 +1,11 @@ -package dark.library.machine.terminal; +package dark.prefab.machine.terminal; import java.util.List; import net.minecraft.entity.player.EntityPlayer; -import dark.core.api.ISpecialAccess; -import dark.core.api.ITerminal; +import dark.api.ISpecialAccess; +import dark.api.ITerminal; /** * * @author Calclavia, DarkGuardsman diff --git a/src/minecraft/dark/library/machine/terminal/TileEntityTerminal.java b/src/dark/prefab/machine/terminal/TileEntityTerminal.java similarity index 96% rename from src/minecraft/dark/library/machine/terminal/TileEntityTerminal.java rename to src/dark/prefab/machine/terminal/TileEntityTerminal.java index 1748521c3..82ad033cb 100644 --- a/src/minecraft/dark/library/machine/terminal/TileEntityTerminal.java +++ b/src/dark/prefab/machine/terminal/TileEntityTerminal.java @@ -1,4 +1,4 @@ -package dark.library.machine.terminal; +package dark.prefab.machine.terminal; import java.util.ArrayList; import java.util.HashSet; @@ -20,14 +20,14 @@ import com.google.common.io.ByteArrayDataInput; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; -import dark.core.api.ISpecialAccess; -import dark.core.api.ITerminal; +import dark.api.ISpecialAccess; +import dark.api.ITerminal; import dark.library.access.AccessLevel; import dark.library.access.UserAccess; -import dark.library.machine.TileEntityRunnableMachine; +import dark.prefab.machine.TileEntityMachine; /** @author Calclavia, DarkGuardsman */ -public abstract class TileEntityTerminal extends TileEntityRunnableMachine implements ISpecialAccess, IPacketReceiver, ITerminal +public abstract class TileEntityTerminal extends TileEntityMachine implements ISpecialAccess, IPacketReceiver, ITerminal { public enum PacketType diff --git a/src/dark/transmit/laser/BlockLaserEmitter.java b/src/dark/transmit/laser/BlockLaserEmitter.java new file mode 100644 index 000000000..3341347b4 --- /dev/null +++ b/src/dark/transmit/laser/BlockLaserEmitter.java @@ -0,0 +1,14 @@ +package dark.transmit.laser; + +import net.minecraft.block.material.Material; +import universalelectricity.prefab.block.BlockAdvanced; + +public class BlockLaserEmitter extends BlockAdvanced +{ + + public BlockLaserEmitter(int id) + { + super(id, Material.iron); + } + +} diff --git a/src/dark/transmit/laser/ItemBlockLaserEmitter.java b/src/dark/transmit/laser/ItemBlockLaserEmitter.java new file mode 100644 index 000000000..b9d8e5cc8 --- /dev/null +++ b/src/dark/transmit/laser/ItemBlockLaserEmitter.java @@ -0,0 +1,11 @@ +package dark.transmit.laser; + +import net.minecraft.item.ItemBlock; + +public class ItemBlockLaserEmitter extends ItemBlock +{ + public ItemBlockLaserEmitter(int par1) + { + super(par1); + } +} diff --git a/src/dark/transmit/laser/TileEntityLaserEmitter.java b/src/dark/transmit/laser/TileEntityLaserEmitter.java new file mode 100644 index 000000000..6830287ae --- /dev/null +++ b/src/dark/transmit/laser/TileEntityLaserEmitter.java @@ -0,0 +1,38 @@ +package dark.transmit.laser; + +import net.minecraftforge.common.ForgeDirection; +import dark.prefab.machine.TileEntityMachine; + +public class TileEntityLaserEmitter extends TileEntityMachine +{ + /** Facing direction of the tile and not the laser */ + public ForgeDirection getFacingDirection() + { + int meta = 0; + if (this.worldObj != null) + { + meta = (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) % 6); + } + return ForgeDirection.getOrientation(meta); + } + + @Override + public boolean canConnect(ForgeDirection direction) + { + return direction == this.getFacingDirection().getOpposite(); + } + + @Override + public float getRequest(ForgeDirection side) + { + return 0; + } + + @Override + public float getProvide(ForgeDirection direction) + { + // TODO Auto-generated method stub + return 0; + } + +} diff --git a/src/minecraft/dark/library/machine/ElectricityHandler.java b/src/minecraft/dark/library/machine/ElectricityHandler.java deleted file mode 100644 index 4de2750a0..000000000 --- a/src/minecraft/dark/library/machine/ElectricityHandler.java +++ /dev/null @@ -1,91 +0,0 @@ -package dark.library.machine; - -import net.minecraft.nbt.NBTTagCompound; -import universalelectricity.core.block.IElectrical; -import universalelectricity.core.electricity.ElectricityPack; - -/** An optional easy way for you to handle electrical storage without hassle. - * - * @author Calclavia */ -public class ElectricityHandler -{ - public IElectrical tileEntity; - public float energyStored = 0; - - public ElectricityHandler(IElectrical tileEntity) - { - this.tileEntity = tileEntity; - } - - public ElectricityHandler(IElectrical tileEntity, float energyStored) - { - this(tileEntity); - this.setEnergyStored(energyStored); - } - - public float receiveElectricity(ElectricityPack receive, boolean doReceive) - { - if (receive != null) - { - float prevEnergyStored = this.getEnergyStored(); - float newStoredEnergy = this.getEnergyStored() + receive.getWatts(); - - if (doReceive) - { - this.setEnergyStored(newStoredEnergy); - } - - return Math.max(newStoredEnergy - prevEnergyStored, 0); - } - - return 0; - } - - public float receiveElectricity(float energy, boolean doReceive) - { - return this.receiveElectricity(ElectricityPack.getFromWatts(energy, this.tileEntity.getVoltage()), doReceive); - } - - public ElectricityPack provideElectricity(ElectricityPack request, boolean doProvide) - { - if (request != null) - { - float requestedEnergy = Math.min(request.getWatts(), this.energyStored); - - if (doProvide) - { - this.setEnergyStored(this.energyStored - requestedEnergy); - } - - return ElectricityPack.getFromWatts(requestedEnergy, this.tileEntity.getVoltage()); - } - - return new ElectricityPack(); - } - - public ElectricityPack provideElectricity(float energy, boolean doProvide) - { - return this.provideElectricity(ElectricityPack.getFromWatts(energy, this.tileEntity.getVoltage()), doProvide); - } - - public ElectricityHandler setEnergyStored(float energy) - { - this.energyStored = energy; - return this; - } - - public float getEnergyStored() - { - return this.energyStored; - } - - public void readFromNBT(NBTTagCompound nbt) - { - this.energyStored = nbt.getFloat("energyStored"); - } - - public void writeToNBT(NBTTagCompound nbt) - { - nbt.setFloat("energyStored", this.energyStored); - } -}