diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index f2ce2dc12..38e7c5187 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -153,6 +153,9 @@ tile.machine_industrial_generator.name=Industrieller Generator container.iGenerator=Industrieller Generator tile.machine_cyclotron.name=Zyklotron container.cyclotron=Zyklotron +tile.machine_well.name=Ölbohrturm +tile.oil_pipe.name=Rohölrohr +container.oilWell=Ölbohrturm tile.rail_highspeed.name=Hochgeschwindigkeitsschienen tile.rail_booster.name=Hochgeschwindigkeits-Boosterschienen @@ -347,6 +350,9 @@ tile.ore_unobtainium.name=Glimmerblende tile.ore_daffergon.name=Dellit tile.ore_verticium.name=Dollargrünes Mineral +tile.ore_oil.name=Ölvorkommen +tile.ore_oil_empty.name=Leeres Ölvorkommen + tile.reinforced_brick.name=Verstärkter Stein tile.reinforced_glass.name=Verstärktes Glas tile.reinforced_sand.name=Verstärkter Sandstein @@ -483,6 +489,7 @@ item.oil_canola.name=Rohes Canola-Öl item.canister_empty.name=Leerer Kanister item.canister_canola.name=Schmiermittelkanister +item.canister_oil.name=Rohölkanister item.canister_fuel.name=Treibstoffkanister item.canister_napalm.name=Napalm B item.canister_NITAN.name=NITAN© 100 Oktan Supertreibstoff @@ -1056,6 +1063,7 @@ item.crystal_energy.name=Energiekristall item.pellet_coolant.name=Kühlcluster item.linker.name=Telelinker +item.oil_detector.name=Ölvorkommen-Detektor item.thermo_element.name=Thermoelektrisches Element item.limiter.name=Generator-Limiter diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 549948f13..74c245b4b 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -153,6 +153,9 @@ tile.machine_industrial_generator.name=Industrial Generator container.iGenerator=Industrial Generator tile.machine_cyclotron.name=Cyclotron container.cyclotron=Cyclotron +tile.machine_well.name=Oil Derrick +tile.oil_pipe.name=Cruse Oil Pipe +container.oilWell=Oil Derrick tile.rail_highspeed.name=High Speed Rail tile.rail_booster.name=High Speed Booster Rail @@ -347,6 +350,9 @@ tile.ore_unobtainium.name=Brightblende Ore tile.ore_daffergon.name=Dellite tile.ore_verticium.name=Dollar Green Mineral +tile.ore_oil.name=Oil Deposit +tile.ore_oil_empty.name=Empty Oil Deposit + tile.reinforced_brick.name=Reinforced Stone tile.reinforced_glass.name=Reinforced Glass tile.reinforced_sand.name=Reinforced Sandstone @@ -483,6 +489,7 @@ item.oil_canola.name=Raw Canola Oil item.canister_empty.name=Empty Canister item.canister_canola.name=Engine Lubricant +item.canister_oil.name=Crude Oil Canister item.canister_fuel.name=Fuel Canister item.canister_napalm.name=Napalm B item.canister_NITAN.name=NITAN© 100 Octane Super Fuel @@ -1056,6 +1063,7 @@ item.crystal_energy.name=Energy Crystal item.pellet_coolant.name=Coolant Cluster item.linker.name=Telelinker +item.oil_detector.name=Oil Reservoir Detector item.thermo_element.name=Thermoelectric Element item.limiter.name=Generator Limiter diff --git a/assets/hbm/models/derrick.obj b/assets/hbm/models/derrick.obj new file mode 100644 index 000000000..6dc32a3a7 --- /dev/null +++ b/assets/hbm/models/derrick.obj @@ -0,0 +1,1111 @@ +# Blender v2.76 (sub 0) OBJ File: 'derrick.blend' +# www.blender.org +o Plane +v -1.500000 0.000000 1.500000 +v 1.500000 0.000000 1.500000 +v -1.500000 0.000000 -1.500000 +v 1.500000 0.000000 -1.500000 +v -0.500000 6.000000 0.500000 +v 0.500000 6.000000 0.500000 +v -0.500000 6.000000 -0.500000 +v 0.500000 6.000000 -0.500000 +v -0.250000 6.000000 0.500000 +v 0.500000 6.000000 0.250000 +v 0.250000 6.000000 -0.500000 +v -0.250000 6.000000 -0.500000 +v 0.500000 6.000000 -0.250000 +v 0.250000 6.000000 0.500000 +v -0.500000 6.000000 0.250000 +v 0.250000 6.000000 0.250000 +v -0.250000 6.000000 0.250000 +v 0.250000 6.000000 -0.250000 +v 1.285714 0.000000 1.285714 +v 1.500000 0.000000 1.285714 +v 1.285714 0.000000 1.500000 +v -1.285714 0.000000 1.285714 +v -1.285714 0.000000 1.500000 +v -1.500000 0.000000 1.285714 +v -1.285714 0.000000 -1.285714 +v -1.500000 0.000000 -1.285714 +v -1.285714 0.000000 -1.500000 +v 1.285714 0.000000 -1.285714 +v -0.250000 6.000000 -0.250000 +v 1.285714 0.000000 -1.500000 +v 1.500000 0.000000 -1.285714 +v -0.500000 6.000000 -0.250000 +v -0.000000 0.000000 -0.125000 +v -0.000000 6.000000 -0.125000 +v 0.088388 0.000000 -0.088388 +v 0.088388 6.000000 -0.088388 +v 0.125000 0.000000 0.000000 +v 0.125000 6.000000 0.000000 +v 0.088388 0.000000 0.088388 +v 0.088388 6.000000 0.088388 +v -0.000000 0.000000 0.125000 +v -0.000000 6.000000 0.125000 +v -0.088388 0.000000 0.088388 +v -0.088388 6.000000 0.088388 +v -0.125000 0.000000 -0.000000 +v -0.125000 6.000000 -0.000000 +v -0.088388 0.000000 -0.088388 +v -0.088388 6.000000 -0.088388 +v 0.250000 5.750000 0.250000 +v -0.250000 5.750000 0.250000 +v 0.250000 5.750000 -0.250000 +v -0.250000 5.750000 -0.250000 +v -0.500000 0.000000 0.500000 +v -0.250000 0.250000 0.250000 +v -0.500000 0.000000 -0.500000 +v -0.250000 0.250000 -0.250000 +v 0.500000 0.000000 0.500000 +v 0.250000 0.250000 0.250000 +v 0.500000 0.000000 -0.500000 +v 0.250000 0.250000 -0.250000 +v 1.156250 0.750000 -1.156250 +v 1.156250 0.750000 -1.375000 +v 1.375000 0.750000 -1.156250 +v 1.125000 2.250000 -0.897321 +v 0.897321 2.250000 -0.897321 +v 0.897321 2.250000 -1.125000 +v 0.638393 3.750000 -0.638393 +v 0.638393 3.750000 -0.875000 +v 0.875000 3.750000 -0.638393 +v 0.625000 5.250000 -0.379464 +v 0.379464 5.250000 -0.379464 +v 0.379464 5.250000 -0.625000 +v -1.375000 0.750000 -1.156250 +v -1.156250 0.750000 -1.156250 +v -1.156250 0.750000 -1.375000 +v -0.897321 2.250000 -1.125000 +v -1.125000 2.250000 -0.897321 +v -0.897321 2.250000 -0.897321 +v -0.379464 5.250000 -0.625000 +v -0.625000 5.250000 -0.379464 +v -0.379464 5.250000 -0.379464 +v -0.875000 3.750000 -0.638393 +v -0.638393 3.750000 -0.638393 +v -0.638393 3.750000 -0.875000 +v 0.379464 5.250000 0.625000 +v 0.379464 5.250000 0.379464 +v 0.625000 5.250000 0.379464 +v 0.638393 3.750000 0.638393 +v 0.875000 3.750000 0.638393 +v 0.638393 3.750000 0.875000 +v 0.897321 2.250000 1.125000 +v 0.897321 2.250000 0.897321 +v 1.125000 2.250000 0.897321 +v 1.156250 0.750000 1.156250 +v 1.375000 0.750000 1.156250 +v 1.156250 0.750000 1.375000 +v -1.125000 2.250000 0.897321 +v -0.897321 2.250000 0.897321 +v -0.897321 2.250000 1.125000 +v -0.638393 3.750000 0.875000 +v -0.875000 3.750000 0.638393 +v -0.638393 3.750000 0.638393 +v -0.625000 5.250000 0.379464 +v -0.379464 5.250000 0.379464 +v -0.379464 5.250000 0.625000 +v -1.156250 0.750000 1.375000 +v -1.375000 0.750000 1.156250 +v -1.156250 0.750000 1.156250 +v 0.132583 6.000000 -0.132583 +v -0.000000 6.000000 -0.187500 +v 0.187500 6.000000 0.000000 +v 0.132583 6.000000 0.132583 +v -0.000000 6.000000 0.187500 +v -0.132583 6.000000 0.132583 +v -0.187500 6.000000 -0.000000 +v -0.132583 6.000000 -0.132583 +v 0.132583 6.250000 -0.132583 +v 0.000000 6.250000 -0.187500 +v 0.187500 6.250000 0.000000 +v 0.132583 6.250000 0.132583 +v 0.000000 6.250000 0.187500 +v -0.132582 6.250000 0.132583 +v -0.187500 6.250000 -0.000000 +v -0.132582 6.250000 -0.132583 +v -0.000000 6.250000 -0.125000 +v 0.088388 6.250000 -0.088388 +v 0.125000 6.250000 0.000000 +v 0.088388 6.250000 0.088388 +v -0.000000 6.250000 0.125000 +v -0.088388 6.250000 0.088388 +v -0.125000 6.250000 -0.000000 +v -0.088388 6.250000 -0.088388 +v 0.088390 6.750000 -0.088388 +v 0.000002 6.750000 -0.125000 +v 0.125002 6.750000 0.000000 +v 0.088390 6.750000 0.088388 +v 0.000002 6.750000 0.125000 +v -0.088386 6.750000 0.088388 +v -0.124998 6.750000 -0.000000 +v -0.088386 6.750000 -0.088388 +v 0.250000 6.000000 0.000000 +v 0.000000 6.000000 -0.250000 +v 0.000000 6.000000 0.250000 +v -0.250000 6.000000 0.000000 +v -0.156250 0.343750 1.500000 +v -0.156250 0.656250 1.500000 +v 0.156250 0.343750 1.500000 +v 0.156250 0.656250 1.500000 +v -0.156250 0.343750 -1.500000 +v -0.156250 0.656250 -1.500000 +v 0.156250 0.343750 -1.500000 +v 0.156250 0.656250 -1.500000 +v -1.500000 0.343750 0.156250 +v -1.500000 0.656250 0.156250 +v -1.500000 0.343750 -0.156250 +v -1.500000 0.656250 -0.156250 +v 1.500000 0.343750 0.156250 +v 1.500000 0.656250 0.156250 +v 1.500000 0.343750 -0.156250 +v 1.500000 0.656250 -0.156250 +v -0.156250 0.343750 0.156250 +v -0.156250 0.656250 0.156250 +v -0.156250 0.343750 -0.156250 +v -0.156250 0.656250 -0.156250 +v 0.156250 0.343750 0.156250 +v 0.156250 0.656250 0.156250 +v 0.156250 0.343750 -0.156250 +v 0.156250 0.656250 -0.156250 +vt 0.670241 0.761208 +vt 0.670241 0.782325 +vt 0.649296 0.782326 +vt 0.607406 0.761208 +vt 0.607406 0.782326 +vt 0.586461 0.782326 +vt 0.250943 0.755476 +vt 0.250943 0.773577 +vt 0.232990 0.773577 +vt 0.922697 0.064344 +vt 0.923066 0.000000 +vt 0.940758 0.003073 +vt 0.607406 0.697855 +vt 0.607406 0.718973 +vt 0.586461 0.718973 +vt 0.670241 0.697855 +vt 0.670241 0.718973 +vt 0.649296 0.718973 +vt 0.815734 0.812615 +vt 0.836678 0.812615 +vt 0.836730 0.823814 +vt 0.649296 0.761208 +vt 0.649296 0.740090 +vt 0.902057 0.453992 +vt 0.920117 0.450855 +vt 0.920117 0.515263 +vt 0.607406 0.740090 +vt 0.836731 0.457163 +vt 0.836731 0.522036 +vt 0.816086 0.518476 +vt 0.649296 0.697855 +vt 0.628351 0.718973 +vt 0.878725 0.518985 +vt 0.861029 0.522036 +vt 0.860661 0.457227 +vt 0.250943 0.737375 +vt 0.232990 0.755476 +vt 0.899476 0.518985 +vt 0.881780 0.522036 +vt 0.881412 0.457227 +vt 0.857728 0.518985 +vt 0.840032 0.522036 +vt 0.839664 0.457227 +vt 0.250943 0.719274 +vt 0.232990 0.737375 +vt 0.250943 0.701174 +vt 0.232990 0.719274 +vt 0.797669 0.455486 +vt 0.798038 0.390676 +vt 0.815734 0.393728 +vt 0.628351 0.761208 +vt 0.948163 0.000000 +vt 0.955569 0.000035 +vt 0.955569 0.506826 +vt 0.590516 0.782326 +vt 0.590516 0.824561 +vt 0.548626 0.824561 +vt 1.000000 0.505677 +vt 0.992595 0.505885 +vt 0.992595 0.000208 +vt 0.985190 0.505677 +vt 0.985190 0.000000 +vt 0.955569 0.000208 +vt 0.962974 0.000000 +vt 0.962974 0.505678 +vt 0.607406 0.477511 +vt 0.649296 0.477511 +vt 0.607406 0.500000 +vt 0.970379 0.000208 +vt 0.970379 0.505885 +vt 0.146615 0.021355 +vt 0.104725 0.021355 +vt 0.146615 0.000000 +vt 0.356065 0.977511 +vt 0.397955 0.977511 +vt 0.356065 1.000000 +vt 0.977784 0.505885 +vt 0.977784 0.000208 +vt 0.054435 0.806834 +vt 0.049597 0.808854 +vt 0.049597 0.796732 +vt 0.940758 0.000035 +vt 0.948164 0.506791 +vt 0.970379 0.505678 +vt 0.970379 0.000000 +vt 0.397955 0.022489 +vt 0.356065 0.022489 +vt 0.397955 0.000000 +vt 0.774286 0.720563 +vt 0.768619 0.734359 +vt 0.760603 0.714849 +vt 0.020945 0.767043 +vt 0.000000 0.788161 +vt 0.000000 0.703690 +vt 0.062835 0.767043 +vt 0.083780 0.788161 +vt 0.062835 0.724808 +vt 0.083780 0.703690 +vt 0.020945 0.724808 +vt 0.502681 0.697855 +vt 0.586461 0.697855 +vt 0.794983 0.393728 +vt 0.794983 0.458601 +vt 0.776918 0.455486 +vt 0.879937 0.197989 +vt 0.899476 0.194619 +vt 0.899476 0.324366 +vt 0.774706 0.844343 +vt 0.775443 0.714724 +vt 0.794983 0.718093 +vt 0.879200 0.068369 +vt 0.899476 0.064873 +vt 0.774337 0.909153 +vt 0.794983 0.847840 +vt 0.878831 0.003560 +vt 0.899476 0.000000 +vt 0.754936 0.870085 +vt 0.736001 0.872410 +vt 0.736743 0.697571 +vt 0.217182 0.527707 +vt 0.236257 0.527707 +vt 0.214564 0.701174 +vt 0.698918 0.746281 +vt 0.718596 0.743865 +vt 0.871166 0.525359 +vt 0.890713 0.522036 +vt 0.890713 0.653590 +vt 0.837452 0.068369 +vt 0.857728 0.064873 +vt 0.856516 0.187474 +vt 0.836731 0.064122 +vt 0.857008 0.060626 +vt 0.857728 0.194619 +vt 0.574866 0.312500 +vt 0.596559 0.437500 +vt 0.586461 0.500000 +vt 0.083780 0.000000 +vt 0.072186 0.189688 +vt 0.050492 0.316147 +vt 0.857728 0.454112 +vt 0.838926 0.327608 +vt 0.815734 0.458601 +vt 0.815734 0.588347 +vt 0.796932 0.585105 +vt 0.878725 0.064873 +vt 0.858449 0.068369 +vt 0.858080 0.003560 +vt 0.920117 0.514750 +vt 0.920486 0.450407 +vt 0.940758 0.453928 +vt 0.815734 0.718093 +vt 0.796195 0.714724 +vt 0.838189 0.197988 +vt 0.857728 0.324366 +vt 0.815734 0.847840 +vt 0.795457 0.844343 +vt 0.795089 0.909153 +vt 0.899476 0.003586 +vt 0.920117 0.000000 +vt 0.920117 0.064408 +vt 0.836731 0.003051 +vt 0.836731 0.067924 +vt 0.818667 0.064810 +vt 0.837083 0.003560 +vt 0.857728 0.000000 +vt 0.901319 0.325305 +vt 0.920117 0.322039 +vt 0.794789 0.368805 +vt 0.775714 0.368805 +vt 0.797407 0.195338 +vt 0.794789 0.217210 +vt 0.815734 0.390677 +vt 0.797407 0.390676 +vt 0.232990 0.832604 +vt 0.213425 0.835815 +vt 0.214163 0.704264 +vt 0.773844 0.346933 +vt 0.754021 0.346933 +vt 0.775714 0.217210 +vt 0.814522 0.725239 +vt 0.899845 0.067929 +vt 0.919912 0.192021 +vt 0.611087 0.782326 +vt 0.611087 0.846433 +vt 0.020571 0.852268 +vt 0.000000 0.852268 +vt 0.631658 0.782326 +vt 0.631658 0.846433 +vt 0.652229 0.782326 +vt 0.652229 0.846433 +vt 0.940553 0.326315 +vt 0.898264 0.187474 +vt 0.878725 0.190843 +vt 0.794789 0.173466 +vt 0.775714 0.173466 +vt 0.797407 0.000000 +vt 0.794789 0.021872 +vt 0.815734 0.195338 +vt 0.773844 0.151595 +vt 0.754021 0.151595 +vt 0.775714 0.021872 +vt 0.719863 0.521872 +vt 0.738938 0.521872 +vt 0.717245 0.695338 +vt 0.815734 0.457914 +vt 0.817192 0.324048 +vt 0.836731 0.327417 +vt 0.740808 0.543744 +vt 0.760631 0.543744 +vt 0.738938 0.673467 +vt 0.857728 0.064122 +vt 0.878005 0.060626 +vt 0.878725 0.194619 +vt 0.760631 0.651595 +vt 0.740808 0.651595 +vt 0.852839 0.696783 +vt 0.833904 0.699108 +vt 0.834647 0.524269 +vt 0.794983 0.588347 +vt 0.880674 0.327608 +vt 0.899476 0.454112 +vt 0.776181 0.585105 +vt 0.418901 1.000000 +vt 0.430495 0.812500 +vt 0.452188 0.687500 +vt 0.200848 0.316147 +vt 0.179155 0.189688 +vt 0.167560 0.000000 +vt 0.900582 0.196617 +vt 0.920117 0.193224 +vt 0.816454 0.453667 +vt 0.836731 0.197671 +vt 0.817929 0.194429 +vt 0.452188 0.312500 +vt 0.430495 0.187500 +vt 0.418900 0.000000 +vt 0.670241 0.500000 +vt 0.681835 0.312500 +vt 0.703528 0.187500 +vt 0.859923 0.327608 +vt 0.878725 0.324366 +vt 0.878725 0.454112 +vt 0.859186 0.197989 +vt 0.921223 0.321719 +vt 0.940758 0.325113 +vt 0.921960 0.193031 +vt 0.940758 0.196297 +vt 0.940758 0.067481 +vt 0.301833 0.687500 +vt 0.323526 0.812500 +vt 0.335120 1.000000 +vt 0.251340 0.500000 +vt 0.335120 0.000000 +vt 0.301833 0.312500 +vt 0.236257 0.679302 +vt 0.217183 0.679302 +vt 0.528803 0.782326 +vt 0.548626 0.782326 +vt 0.548626 0.890176 +vt 0.215803 0.726154 +vt 0.754021 0.390676 +vt 0.773844 0.390677 +vt 0.773844 0.498527 +vt 0.815734 0.548624 +vt 0.834669 0.546300 +vt 0.871166 0.717375 +vt 0.852839 0.717375 +vt 0.852839 0.522036 +vt 0.698918 0.500000 +vt 0.717245 0.500000 +vt 0.196237 0.505835 +vt 0.214564 0.505835 +vt 0.073785 0.806834 +vt 0.078623 0.808854 +vt 0.070122 0.817426 +vt 0.054435 0.798753 +vt 0.058099 0.788161 +vt 0.060102 0.812548 +vt 0.058099 0.817426 +vt 0.073785 0.798753 +vt 0.078623 0.796732 +vt 0.068118 0.793038 +vt 0.060102 0.793038 +vt 0.070122 0.788161 +vt 0.068118 0.812548 +vt 0.243935 0.632878 +vt 0.251340 0.632913 +vt 0.251340 0.675146 +vt 0.062985 0.839825 +vt 0.042087 0.839825 +vt 0.041778 0.828625 +vt 0.183411 0.839596 +vt 0.162513 0.839596 +vt 0.162204 0.828397 +vt 0.041778 0.839825 +vt 0.020880 0.839825 +vt 0.020571 0.828625 +vt 0.062675 0.828625 +vt 0.042087 0.817426 +vt 0.183102 0.828397 +vt 0.162513 0.817197 +vt 0.041469 0.828625 +vt 0.020880 0.817426 +vt 0.815786 0.823814 +vt 0.836678 0.835014 +vt 0.031076 0.812548 +vt 0.039092 0.812548 +vt 0.041096 0.817426 +vt 0.025409 0.806834 +vt 0.029073 0.817426 +vt 0.020571 0.796732 +vt 0.025409 0.798753 +vt 0.029073 0.788161 +vt 0.031076 0.793038 +vt 0.041096 0.788161 +vt 0.039092 0.793038 +vt 0.044759 0.798753 +vt 0.044759 0.806834 +vt 0.774286 0.701053 +vt 0.754936 0.709134 +vt 0.236530 0.632913 +vt 0.243935 0.675111 +vt 0.236530 0.548391 +vt 0.243935 0.548183 +vt 0.243935 0.590323 +vt 0.236530 0.548183 +vt 0.236530 0.506043 +vt 0.243935 0.505835 +vt 0.251340 0.632670 +vt 0.243935 0.590739 +vt 0.251340 0.548391 +vt 0.251340 0.590531 +vt 0.243935 0.547975 +vt 0.251340 0.506043 +vt 0.236530 0.632670 +vt 0.236530 0.590531 +vt 0.639459 0.751289 +vt 0.644060 0.740090 +vt 0.628351 0.755928 +vt 0.617243 0.751289 +vt 0.617243 0.728891 +vt 0.628351 0.724252 +vt 0.639459 0.728891 +vt 0.083780 0.817197 +vt 0.109902 0.817197 +vt 0.109902 0.843594 +vt 0.670241 0.811362 +vt 0.696422 0.811362 +vt 0.696422 0.837758 +vt 0.136082 0.817197 +vt 0.136082 0.843594 +vt 0.109960 0.843594 +vt 0.162204 0.817197 +vt 0.162204 0.843594 +vt 0.528803 0.895833 +vt 0.502681 0.895833 +vt 0.502681 0.782326 +vt 0.162204 0.703690 +vt 0.177724 0.703690 +vt 0.098119 0.623428 +vt 0.116632 0.604763 +vt 0.521194 0.500000 +vt 0.600799 0.580262 +vt 0.582286 0.598927 +vt 0.079606 0.604763 +vt 0.098119 0.586097 +vt 0.619312 0.598927 +vt 0.600799 0.617593 +vt 0.521194 0.697855 +vt 0.502681 0.679189 +vt 0.109960 0.817197 +vt 0.109960 0.703690 +vt 0.136082 0.703690 +vt 0.018513 0.703690 +vt 0.000000 0.685024 +vt 0.696421 0.697855 +vt 0.878961 0.717375 +vt 0.878961 0.830882 +vt 0.680405 0.697855 +vt 0.018513 0.505835 +vt 0.841856 0.699108 +vt 0.841856 0.812615 +vt 0.680405 0.500000 +vt 0.698918 0.518666 +vt 0.188326 0.703690 +vt 0.188326 0.817197 +vt 0.177724 0.505835 +vt 0.196237 0.524501 +vt 0.586461 0.761208 +vt 0.902425 0.518336 +vt 0.232990 0.701174 +vt 1.000000 0.000000 +vt 0.955569 0.505885 +vt 0.649296 0.500000 +vt 0.104725 0.000000 +vt 0.397955 1.000000 +vt 0.940758 0.506826 +vt 0.356065 0.000000 +vt 0.754936 0.728644 +vt 0.754936 0.720563 +vt 0.768619 0.714849 +vt 0.774286 0.728644 +vt 0.760603 0.734359 +vt 0.777287 0.390676 +vt 0.794983 0.912713 +vt 0.754936 0.695338 +vt 0.196237 0.701174 +vt 0.871904 0.656787 +vt 0.836977 0.190843 +vt 0.553173 0.187500 +vt 0.531480 0.062500 +vt 0.502681 0.000000 +vt 0.520634 0.000000 +vt 0.028799 0.442606 +vt 0.017953 0.505835 +vt 0.000000 0.505835 +vt 0.093879 0.063229 +vt 0.878725 0.000000 +vt 0.940758 0.518336 +vt 0.815734 0.912713 +vt 0.819035 0.000000 +vt 0.794983 0.721869 +vt 0.900377 0.195414 +vt 0.590516 0.846433 +vt 0.020571 0.788161 +vt 0.921018 0.322922 +vt 0.815734 0.000000 +vt 0.698918 0.695338 +vt 0.836011 0.461410 +vt 0.719863 0.673467 +vt 0.473881 0.562500 +vt 0.502681 0.500000 +vt 0.484728 0.500000 +vt 0.408802 0.937500 +vt 0.157462 0.063229 +vt 0.251340 0.505835 +vt 0.233387 0.505835 +vt 0.222541 0.442606 +vt 0.408802 0.062500 +vt 0.473881 0.437500 +vt 0.725222 0.062500 +vt 0.754021 0.000000 +vt 0.736068 0.000000 +vt 0.660142 0.437500 +vt 0.345219 0.937500 +vt 0.269293 0.500000 +vt 0.280140 0.562500 +vt 0.280140 0.437500 +vt 0.345219 0.062500 +vt 0.323526 0.187500 +vt 0.528803 0.890176 +vt 0.196237 0.729366 +vt 0.754021 0.498527 +vt 0.871166 0.522036 +vt 0.062985 0.817426 +vt 0.183411 0.817197 +vt 0.041778 0.817426 +vt 0.815734 0.835014 +vt 0.020571 0.808854 +vt 0.754936 0.701053 +vt 0.760603 0.695338 +vt 0.768619 0.695338 +vt 0.774286 0.709134 +vt 0.236530 0.675146 +vt 0.251340 0.548183 +vt 0.612642 0.740090 +vt 0.083780 0.843594 +vt 0.670241 0.837758 +vt 0.196237 0.685025 +vt 0.502681 0.518666 +vt 0.852839 0.830882 +vt 0.698918 0.679189 +vt 0.000000 0.524501 +vt 0.815734 0.699108 +vn 0.000000 1.000000 0.000000 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 -0.170100 -0.985400 +vn -0.382700 0.000000 -0.923900 +vn 0.985400 -0.170100 0.000000 +vn -0.985400 -0.170100 0.000000 +vn 0.000000 -0.170100 0.985400 +vn 0.382700 0.000000 -0.923900 +vn 0.923900 0.000000 -0.382700 +vn 0.923900 0.000000 0.382700 +vn 0.382700 0.000000 0.923900 +vn -0.707100 -0.707100 0.000000 +vn -0.382700 0.000000 0.923900 +vn 0.000000 -0.707100 -0.707100 +vn 0.707100 -0.707100 0.000000 +vn -0.923900 0.000000 0.382700 +vn -0.923900 0.000000 -0.382700 +vn 0.000000 -0.707100 0.707100 +vn -0.707100 0.707100 0.000000 +vn 0.000000 0.707100 -0.707100 +vn 0.707100 0.707100 0.000000 +vn 0.000000 0.707100 0.707100 +vn 0.589800 0.807500 0.000000 +vn 0.589800 -0.807500 0.000000 +vn -0.698700 0.715400 0.000000 +vn 0.698700 0.715400 0.000000 +vn 0.827500 0.561500 0.000000 +vn 0.827500 -0.561500 0.000000 +vn -0.986400 0.164400 0.000000 +vn 0.000000 0.164400 -0.986400 +vn 0.000000 0.807500 -0.589800 +vn 0.000000 0.807500 0.589800 +vn 0.000000 -0.715400 -0.698700 +vn 0.000000 0.715400 -0.698700 +vn 0.000000 0.561500 0.827500 +vn 0.000000 0.561500 -0.827500 +vn 0.000000 -0.715400 0.698700 +vn 0.000000 0.715400 0.698700 +vn -0.589800 0.807500 0.000000 +vn -0.827500 -0.561500 0.000000 +vn -0.589800 -0.807500 0.000000 +vn 0.986400 0.164400 -0.000000 +vn 0.000000 0.164400 0.986400 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.000000 -1.000000 +vn -1.000000 0.000000 0.000000 +vn 1.000000 0.000000 0.000000 +s off +f 13/1/1 8/2/1 11/3/1 +f 29/4/1 12/5/1 7/6/1 +f 20/7/2 2/8/2 21/9/2 +f 95/10/3 20/11/3 19/12/3 +f 9/13/1 17/14/1 15/15/1 +f 6/16/1 10/17/1 16/18/1 +f 116/19/4 124/20/4 118/21/4 +f 13/1/1 18/22/1 141/23/1 +f 107/24/3 108/25/3 22/26/3 +f 15/15/1 17/14/1 144/27/1 +f 104/28/5 17/29/5 9/30/5 +f 14/31/1 16/18/1 143/32/1 +f 19/33/6 21/34/6 96/35/6 +f 22/36/2 23/7/2 1/37/2 +f 28/38/7 31/39/7 63/40/7 +f 25/41/5 27/42/5 75/43/5 +f 27/44/2 25/36/2 26/45/2 +f 4/46/2 31/44/2 28/47/2 +f 73/48/7 26/49/7 25/50/7 +f 12/5/1 29/4/1 142/51/1 +f 34/52/8 36/53/8 35/54/8 +f 51/55/2 49/56/2 50/57/2 +f 36/58/9 38/59/9 37/60/9 +f 38/59/10 40/61/10 39/62/10 +f 40/63/11 42/64/11 41/65/11 +f 52/66/12 50/67/12 32/68/12 +f 42/64/13 44/69/13 43/70/13 +f 51/71/14 52/72/14 11/73/14 +f 49/74/15 51/75/15 10/76/15 +f 44/61/16 46/77/16 45/78/16 +f 44/79/2 114/80/2 115/81/2 +f 48/82/4 34/52/4 33/83/4 +f 46/77/17 48/84/17 47/85/17 +f 50/86/18 49/87/18 9/88/18 +f 39/89/2 43/90/2 35/91/2 +f 56/92/19 55/93/19 53/94/19 +f 60/95/20 59/96/20 55/93/20 +f 58/97/21 57/98/21 59/96/21 +f 54/99/22 53/94/22 57/98/22 +f 55/100/2 59/101/2 57/6/2 +f 60/95/1 56/92/1 54/99/1 +f 28/102/6 61/103/6 62/104/6 +f 69/105/7 67/106/7 65/107/7 +f 72/108/6 68/109/6 67/110/6 +f 70/111/7 71/112/7 67/106/7 +f 11/113/6 72/108/6 71/114/6 +f 13/115/7 18/116/7 71/112/7 +f 76/117/23 78/118/23 61/119/23 +f 66/120/24 65/121/24 74/122/24 +f 78/118/25 67/123/25 68/124/25 +f 84/125/26 83/126/26 65/127/26 +f 79/128/27 81/129/27 67/130/27 +f 72/131/28 71/132/28 83/133/28 +f 82/134/29 80/135/29 7/136/29 +f 7/137/30 84/138/30 76/139/30 +f 74/140/5 75/43/5 76/141/5 +f 74/142/7 78/143/7 77/144/7 +f 86/145/6 85/146/6 14/147/6 +f 10/148/3 87/149/3 86/150/3 +f 78/143/7 83/151/7 82/152/7 +f 84/153/5 83/133/5 78/154/5 +f 83/133/5 84/153/5 79/128/5 +f 83/151/7 81/155/7 80/156/7 +f 32/157/7 80/156/7 81/155/7 +f 15/158/3 17/159/3 104/160/3 +f 22/161/5 108/162/5 106/163/5 +f 12/164/5 29/165/5 81/129/5 +f 97/166/3 98/167/3 108/25/3 +f 97/168/31 98/169/31 74/170/31 +f 77/171/32 107/172/32 108/173/32 +f 82/174/33 83/175/33 98/176/33 +f 101/177/34 102/178/34 78/179/34 +f 102/180/35 81/155/35 80/156/35 +f 103/181/36 104/160/36 83/182/36 +f 72/55/2 71/183/2 81/184/2 +f 80/185/2 81/186/2 104/93/2 +f 85/183/1 86/187/1 104/188/1 +f 70/187/1 71/189/1 86/190/1 +f 67/191/36 86/150/36 87/149/36 +f 70/111/35 71/112/35 88/192/35 +f 89/193/37 88/192/37 65/107/37 +f 64/194/32 65/195/32 94/196/32 +f 93/197/31 63/198/31 61/170/31 +f 69/199/38 67/200/38 92/201/38 +f 91/202/39 92/203/39 108/204/39 +f 85/205/28 100/206/28 102/207/28 +f 90/208/25 88/209/25 98/210/25 +f 105/211/40 104/212/40 88/213/40 +f 92/203/26 102/214/26 100/215/26 +f 99/216/41 98/217/41 94/218/41 +f 65/219/6 67/110/6 68/109/6 +f 64/220/7 65/107/7 61/221/7 +f 61/103/6 65/219/6 66/222/6 +f 8/223/42 69/224/42 64/225/42 +f 66/226/30 68/227/30 8/228/30 +f 101/229/3 102/230/3 98/167/3 +f 103/181/3 104/160/3 102/230/3 +f 102/207/5 104/28/5 105/231/5 +f 98/232/5 102/207/5 100/206/5 +f 99/233/5 106/163/5 108/162/5 +f 99/234/43 100/235/43 5/236/43 +f 5/237/29 101/238/29 97/239/29 +f 91/240/6 92/241/6 94/242/6 +f 90/243/6 88/213/6 92/241/6 +f 85/146/6 86/145/6 88/213/6 +f 87/149/3 89/244/3 88/245/3 +f 89/244/3 93/246/3 92/247/3 +f 93/246/3 95/10/3 94/248/3 +f 93/249/42 89/250/42 6/251/42 +f 2/252/43 6/253/43 91/254/43 +f 78/255/2 76/256/2 66/120/2 +f 83/257/2 84/258/2 68/259/2 +f 101/260/2 82/174/2 83/175/2 +f 90/208/1 88/209/1 102/214/1 +f 89/261/2 88/262/2 67/263/2 +f 93/197/1 64/194/1 65/195/1 +f 92/264/2 91/265/2 99/216/2 +f 78/179/1 77/171/1 97/168/1 +f 108/266/2 107/267/2 73/268/2 +f 96/269/1 94/270/1 108/204/1 +f 63/198/1 61/170/1 94/196/1 +f 62/271/2 61/272/2 74/122/2 +f 38/273/2 111/274/2 112/275/2 +f 46/276/2 115/81/2 116/277/2 +f 42/278/2 113/279/2 114/80/2 +f 36/280/2 109/281/2 111/274/2 +f 34/282/2 48/283/2 116/277/2 +f 34/282/2 110/284/2 109/281/2 +f 40/285/2 112/275/2 113/279/2 +f 134/286/8 133/287/8 126/288/8 +f 114/289/16 122/290/16 123/291/16 +f 112/292/11 120/293/11 121/294/11 +f 109/295/9 117/296/9 119/297/9 +f 115/298/17 123/291/17 124/299/17 +f 113/300/13 121/294/13 122/301/13 +f 111/302/10 119/297/10 120/303/10 +f 110/304/8 118/21/8 117/305/8 +f 128/306/1 129/307/1 121/308/1 +f 127/309/1 128/306/1 120/310/1 +f 117/311/1 126/312/1 127/309/1 +f 118/313/1 125/314/1 126/312/1 +f 124/315/1 132/316/1 125/314/1 +f 123/81/1 131/317/1 132/316/1 +f 130/318/1 131/317/1 123/81/1 +f 129/307/1 130/318/1 122/80/1 +f 139/319/1 136/91/1 135/320/1 +f 140/321/4 134/286/4 125/322/4 +f 138/323/16 139/324/16 131/325/16 +f 128/326/11 136/327/11 137/328/11 +f 133/329/9 135/286/9 127/330/9 +f 139/324/17 140/331/17 132/332/17 +f 129/333/13 137/328/13 138/334/13 +f 135/286/10 136/335/10 128/336/10 +f 109/337/1 111/338/1 141/23/1 +f 142/51/1 110/339/1 109/337/1 +f 142/51/1 29/4/1 116/340/1 +f 116/340/1 29/4/1 144/27/1 +f 144/27/1 17/14/1 114/341/1 +f 143/32/1 113/342/1 114/341/1 +f 143/32/1 16/18/1 112/343/1 +f 112/343/1 16/18/1 141/23/1 +f 146/344/44 145/345/44 147/346/44 +f 151/347/45 149/348/45 150/349/45 +f 155/350/46 153/351/46 154/352/46 +f 158/350/47 157/353/47 159/354/47 +f 162/355/46 161/356/46 145/357/46 +f 147/358/47 165/353/47 166/350/47 +f 145/359/2 161/360/2 165/361/2 +f 148/362/1 166/363/1 162/364/1 +f 163/365/2 167/366/2 165/361/2 +f 168/367/1 164/368/1 162/364/1 +f 156/369/1 154/370/1 162/364/1 +f 153/371/44 161/372/44 162/373/44 +f 153/374/2 155/375/2 163/365/2 +f 156/376/45 164/348/45 163/347/45 +f 163/267/46 164/377/46 150/378/46 +f 150/379/1 164/368/1 168/367/1 +f 151/380/2 167/366/2 163/365/2 +f 152/381/47 168/382/47 167/19/47 +f 158/383/1 160/384/1 168/367/1 +f 167/98/45 168/372/45 160/371/45 +f 166/358/44 165/385/44 157/386/44 +f 159/387/2 157/388/2 165/361/2 +f 18/22/1 13/1/1 11/3/1 +f 32/389/1 29/4/1 7/6/1 +f 19/37/2 20/7/2 21/9/2 +f 94/248/3 95/10/3 19/12/3 +f 5/101/1 9/13/1 15/15/1 +f 14/31/1 6/16/1 16/18/1 +f 110/304/4 116/19/4 118/21/4 +f 141/23/1 16/18/1 10/17/1 +f 10/17/1 13/1/1 141/23/1 +f 24/390/3 107/24/3 22/26/3 +f 144/27/1 29/4/1 32/389/1 +f 32/389/1 15/15/1 144/27/1 +f 105/231/5 104/28/5 9/30/5 +f 143/32/1 17/14/1 9/13/1 +f 9/13/1 14/31/1 143/32/1 +f 94/242/6 19/33/6 96/35/6 +f 24/45/2 22/36/2 1/37/2 +f 61/221/7 28/38/7 63/40/7 +f 74/140/5 25/41/5 75/43/5 +f 3/47/2 27/44/2 26/45/2 +f 30/391/2 4/46/2 28/47/2 +f 74/142/7 73/48/7 25/50/7 +f 142/51/1 18/22/1 11/3/1 +f 11/3/1 12/5/1 142/51/1 +f 33/83/8 34/52/8 35/54/8 +f 52/258/2 51/55/2 50/57/2 +f 35/392/9 36/58/9 37/60/9 +f 37/60/10 38/59/10 39/62/10 +f 39/393/11 40/63/11 41/65/11 +f 15/394/12 32/68/12 50/67/12 +f 7/136/12 52/66/12 32/68/12 +f 50/67/12 5/237/12 15/394/12 +f 41/65/13 42/64/13 43/70/13 +f 12/395/14 11/73/14 52/72/14 +f 8/228/14 51/71/14 11/73/14 +f 52/72/14 7/137/14 12/395/14 +f 13/396/15 10/76/15 51/75/15 +f 6/251/15 49/74/15 10/76/15 +f 51/75/15 8/223/15 13/396/15 +f 43/62/16 44/61/16 45/78/16 +f 46/276/2 44/79/2 115/81/2 +f 47/397/4 48/82/4 33/83/4 +f 45/78/17 46/77/17 47/85/17 +f 14/398/18 9/88/18 49/87/18 +f 5/236/18 50/86/18 9/88/18 +f 49/87/18 6/253/18 14/398/18 +f 47/399/2 33/400/2 35/91/2 +f 35/91/2 37/401/2 39/89/2 +f 39/89/2 41/402/2 43/90/2 +f 43/90/2 45/403/2 47/399/2 +f 47/399/2 35/91/2 43/90/2 +f 54/99/19 56/92/19 53/94/19 +f 56/92/20 60/95/20 55/93/20 +f 60/95/21 58/97/21 59/96/21 +f 58/97/22 54/99/22 57/98/22 +f 53/357/2 55/100/2 57/6/2 +f 58/97/1 60/95/1 54/99/1 +f 30/404/6 28/102/6 62/104/6 +f 64/220/7 69/105/7 65/107/7 +f 71/114/6 72/108/6 67/110/6 +f 69/105/7 70/111/7 67/106/7 +f 18/405/6 11/113/6 71/114/6 +f 70/111/7 13/115/7 71/112/7 +f 62/406/23 76/117/23 61/119/23 +f 75/407/24 66/120/24 74/122/24 +f 76/117/25 78/118/25 68/124/25 +f 66/408/26 84/125/26 65/127/26 +f 68/409/27 79/128/27 67/130/27 +f 84/153/28 72/131/28 83/133/28 +f 7/136/29 77/410/29 82/134/29 +f 73/411/29 77/410/29 3/412/29 +f 3/412/29 26/413/29 73/411/29 +f 80/135/29 32/68/29 7/136/29 +f 3/412/29 77/410/29 7/136/29 +f 75/414/30 27/415/30 3/416/30 +f 3/416/30 7/137/30 76/139/30 +f 79/417/30 84/138/30 7/137/30 +f 7/137/30 12/395/30 79/417/30 +f 76/139/30 75/414/30 3/416/30 +f 78/154/5 74/140/5 76/141/5 +f 73/48/7 74/142/7 77/144/7 +f 16/418/6 86/145/6 14/147/6 +f 16/419/3 10/148/3 86/150/3 +f 77/144/7 78/143/7 82/152/7 +f 76/141/5 84/153/5 78/154/5 +f 81/129/5 83/133/5 79/128/5 +f 82/152/7 83/151/7 80/156/7 +f 29/420/7 32/157/7 81/155/7 +f 103/181/3 15/158/3 104/160/3 +f 23/421/5 22/161/5 106/163/5 +f 79/128/5 12/164/5 81/129/5 +f 107/24/3 97/166/3 108/25/3 +f 73/198/31 97/168/31 74/170/31 +f 78/179/32 77/171/32 108/173/32 +f 97/391/33 82/174/33 98/176/33 +f 77/171/34 101/177/34 78/179/34 +f 101/422/35 102/180/35 80/156/35 +f 82/423/36 103/181/36 83/182/36 +f 79/424/2 72/55/2 81/184/2 +f 103/425/2 80/185/2 104/93/2 +f 105/184/1 85/183/1 104/188/1 +f 87/188/1 70/187/1 86/190/1 +f 69/426/36 67/191/36 87/149/36 +f 89/193/35 70/111/35 88/192/35 +f 64/220/37 89/193/37 65/107/37 +f 95/427/32 64/194/32 94/196/32 +f 92/201/31 93/197/31 61/170/31 +f 93/197/38 69/199/38 92/201/38 +f 106/428/39 91/202/39 108/204/39 +f 86/429/28 85/205/28 102/207/28 +f 99/430/25 90/208/25 98/210/25 +f 90/243/40 105/211/40 88/213/40 +f 91/202/26 92/203/26 100/215/26 +f 96/268/41 99/216/41 94/218/41 +f 66/222/6 65/219/6 68/109/6 +f 63/40/7 64/220/7 61/221/7 +f 62/104/6 61/103/6 66/222/6 +f 64/225/42 63/431/42 4/432/42 +f 31/433/42 4/432/42 63/431/42 +f 8/223/42 13/396/42 70/434/42 +f 70/434/42 69/224/42 8/223/42 +f 64/225/42 4/432/42 8/223/42 +f 11/73/30 8/228/30 72/435/30 +f 4/436/30 30/437/30 62/438/30 +f 62/438/30 66/226/30 4/436/30 +f 68/227/30 72/435/30 8/228/30 +f 4/436/30 66/226/30 8/228/30 +f 97/166/3 101/229/3 98/167/3 +f 101/229/3 103/181/3 102/230/3 +f 100/206/5 102/207/5 105/231/5 +f 99/233/5 98/232/5 100/206/5 +f 98/232/5 99/233/5 108/162/5 +f 9/88/43 5/236/43 105/439/43 +f 1/432/43 23/433/43 106/440/43 +f 106/440/43 99/234/43 1/432/43 +f 100/235/43 105/439/43 5/236/43 +f 1/432/43 99/234/43 5/236/43 +f 97/239/29 107/441/29 1/442/29 +f 24/443/29 1/442/29 107/441/29 +f 5/237/29 15/394/29 103/444/29 +f 103/444/29 101/238/29 5/237/29 +f 97/239/29 1/442/29 5/237/29 +f 96/35/6 91/240/6 94/242/6 +f 91/240/6 90/243/6 92/241/6 +f 90/243/6 85/146/6 88/213/6 +f 86/150/3 87/149/3 88/245/3 +f 88/245/3 89/244/3 92/247/3 +f 92/247/3 93/246/3 94/248/3 +f 10/76/42 6/251/42 87/445/42 +f 2/252/42 20/446/42 95/447/42 +f 95/447/42 93/249/42 2/252/42 +f 87/445/42 6/251/42 89/250/42 +f 2/252/42 93/249/42 6/251/42 +f 91/254/43 96/448/43 2/252/43 +f 21/446/43 2/252/43 96/448/43 +f 6/253/43 14/398/43 85/449/43 +f 90/450/43 91/254/43 6/253/43 +f 6/253/43 85/449/43 90/450/43 +f 65/121/2 78/255/2 66/120/2 +f 67/451/2 83/257/2 68/259/2 +f 102/452/2 101/260/2 83/175/2 +f 100/215/1 90/208/1 102/214/1 +f 69/453/2 89/261/2 67/263/2 +f 92/201/1 93/197/1 65/195/1 +f 98/217/2 92/264/2 99/216/2 +f 98/169/1 78/179/1 97/168/1 +f 74/454/2 108/266/2 73/268/2 +f 106/428/1 96/269/1 108/204/1 +f 95/427/1 63/198/1 94/196/1 +f 75/407/2 62/271/2 74/122/2 +f 40/285/2 38/273/2 112/275/2 +f 48/283/2 46/276/2 116/277/2 +f 44/79/2 42/278/2 114/80/2 +f 38/273/2 36/280/2 111/274/2 +f 110/284/2 34/282/2 116/277/2 +f 36/280/2 34/282/2 109/281/2 +f 42/278/2 40/285/2 113/279/2 +f 125/322/8 134/286/8 126/288/8 +f 115/298/16 114/289/16 123/291/16 +f 113/300/11 112/292/11 121/294/11 +f 111/302/9 109/295/9 119/297/9 +f 116/455/17 115/298/17 124/299/17 +f 114/456/13 113/300/13 122/301/13 +f 112/457/10 111/302/10 120/303/10 +f 109/458/8 110/304/8 117/305/8 +f 120/310/1 128/306/1 121/308/1 +f 119/459/1 127/309/1 120/310/1 +f 119/459/1 117/311/1 127/309/1 +f 117/311/1 118/313/1 126/312/1 +f 118/313/1 124/315/1 125/314/1 +f 124/315/1 123/81/1 132/316/1 +f 122/80/1 130/318/1 123/81/1 +f 121/308/1 129/307/1 122/80/1 +f 135/320/1 133/460/1 139/319/1 +f 134/461/1 140/462/1 139/319/1 +f 139/319/1 138/463/1 137/401/1 +f 137/401/1 136/91/1 139/319/1 +f 133/460/1 134/461/1 139/319/1 +f 132/464/4 140/321/4 125/322/4 +f 130/336/16 138/323/16 131/325/16 +f 129/333/11 128/326/11 137/328/11 +f 126/332/9 133/329/9 127/330/9 +f 131/325/17 139/324/17 132/332/17 +f 130/465/13 129/333/13 138/334/13 +f 127/330/10 135/286/10 128/336/10 +f 18/22/1 109/337/1 141/23/1 +f 18/22/1 142/51/1 109/337/1 +f 110/339/1 142/51/1 116/340/1 +f 115/466/1 116/340/1 144/27/1 +f 115/466/1 144/27/1 114/341/1 +f 17/14/1 143/32/1 114/341/1 +f 113/342/1 143/32/1 112/343/1 +f 111/338/1 112/343/1 141/23/1 +f 148/467/44 146/344/44 147/346/44 +f 152/468/45 151/347/45 150/349/45 +f 156/371/46 155/350/46 154/352/46 +f 160/351/47 158/350/47 159/354/47 +f 146/257/46 162/355/46 145/357/46 +f 148/373/47 147/358/47 166/350/47 +f 147/469/2 145/359/2 165/361/2 +f 146/470/1 148/362/1 162/364/1 +f 161/360/2 163/365/2 165/361/2 +f 166/363/1 168/367/1 162/364/1 +f 164/368/1 156/369/1 162/364/1 +f 154/350/44 153/371/44 162/373/44 +f 161/360/2 153/374/2 163/365/2 +f 155/16/45 156/376/45 163/347/45 +f 149/471/46 163/267/46 150/378/46 +f 152/472/1 150/379/1 168/367/1 +f 149/473/2 151/380/2 163/365/2 +f 151/474/47 152/381/47 167/19/47 +f 166/363/1 158/383/1 168/367/1 +f 159/344/45 167/98/45 160/371/45 +f 158/353/44 166/358/44 157/386/44 +f 167/366/2 159/387/2 165/361/2 diff --git a/assets/hbm/textures/blocks/machine_well.png b/assets/hbm/textures/blocks/machine_well.png new file mode 100644 index 000000000..d6b5997d9 Binary files /dev/null and b/assets/hbm/textures/blocks/machine_well.png differ diff --git a/assets/hbm/textures/blocks/oil_pipe.png b/assets/hbm/textures/blocks/oil_pipe.png new file mode 100644 index 000000000..5b62b611a Binary files /dev/null and b/assets/hbm/textures/blocks/oil_pipe.png differ diff --git a/assets/hbm/textures/blocks/ore_oil.png b/assets/hbm/textures/blocks/ore_oil.png new file mode 100644 index 000000000..92723b59e Binary files /dev/null and b/assets/hbm/textures/blocks/ore_oil.png differ diff --git a/assets/hbm/textures/blocks/ore_oil_empty.png b/assets/hbm/textures/blocks/ore_oil_empty.png new file mode 100644 index 000000000..9ac4fe089 Binary files /dev/null and b/assets/hbm/textures/blocks/ore_oil_empty.png differ diff --git a/assets/hbm/textures/gui/generic_54.png b/assets/hbm/textures/gui/generic_54.png index bf232c7ae..489c84a9b 100644 Binary files a/assets/hbm/textures/gui/generic_54.png and b/assets/hbm/textures/gui/generic_54.png differ diff --git a/assets/hbm/textures/gui/gui_well.png b/assets/hbm/textures/gui/gui_well.png new file mode 100644 index 000000000..a9091eafa Binary files /dev/null and b/assets/hbm/textures/gui/gui_well.png differ diff --git a/assets/hbm/textures/items/canister_oil.png b/assets/hbm/textures/items/canister_oil.png new file mode 100644 index 000000000..8df5b504d Binary files /dev/null and b/assets/hbm/textures/items/canister_oil.png differ diff --git a/assets/hbm/textures/items/oil_crude.png b/assets/hbm/textures/items/oil_crude.png new file mode 100644 index 000000000..9c922060a Binary files /dev/null and b/assets/hbm/textures/items/oil_crude.png differ diff --git a/assets/hbm/textures/items/oil_detector.png b/assets/hbm/textures/items/oil_detector.png new file mode 100644 index 000000000..0b7e34834 Binary files /dev/null and b/assets/hbm/textures/items/oil_detector.png differ diff --git a/assets/hbm/textures/items/spill1.png b/assets/hbm/textures/items/spill1.png new file mode 100644 index 000000000..df02a1978 Binary files /dev/null and b/assets/hbm/textures/items/spill1.png differ diff --git a/assets/hbm/textures/items/spill2.png b/assets/hbm/textures/items/spill2.png new file mode 100644 index 000000000..71543c6a5 Binary files /dev/null and b/assets/hbm/textures/items/spill2.png differ diff --git a/assets/hbm/textures/items/spill3.png b/assets/hbm/textures/items/spill3.png new file mode 100644 index 000000000..c3849264e Binary files /dev/null and b/assets/hbm/textures/items/spill3.png differ diff --git a/assets/hbm/textures/items/spill4.png b/assets/hbm/textures/items/spill4.png new file mode 100644 index 000000000..ca7feae44 Binary files /dev/null and b/assets/hbm/textures/items/spill4.png differ diff --git a/assets/hbm/textures/items/spill5.png b/assets/hbm/textures/items/spill5.png new file mode 100644 index 000000000..2229332ed Binary files /dev/null and b/assets/hbm/textures/items/spill5.png differ diff --git a/assets/hbm/textures/items/spill6.png b/assets/hbm/textures/items/spill6.png new file mode 100644 index 000000000..ab1e426a8 Binary files /dev/null and b/assets/hbm/textures/items/spill6.png differ diff --git a/assets/hbm/textures/items/spill7.png b/assets/hbm/textures/items/spill7.png new file mode 100644 index 000000000..d2abb95c6 Binary files /dev/null and b/assets/hbm/textures/items/spill7.png differ diff --git a/assets/hbm/textures/items/spill8.png b/assets/hbm/textures/items/spill8.png new file mode 100644 index 000000000..324a56ed9 Binary files /dev/null and b/assets/hbm/textures/items/spill8.png differ diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index 70f53750e..b9bda600c 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -29,6 +29,7 @@ import com.hbm.blocks.generic.BlockCrate; import com.hbm.blocks.generic.BlockGeneric; import com.hbm.blocks.generic.BlockMush; import com.hbm.blocks.generic.BlockMushHuge; +import com.hbm.blocks.generic.BlockNoDrop; import com.hbm.blocks.generic.BlockOre; import com.hbm.blocks.generic.BlockPlasma; import com.hbm.blocks.generic.DecoBlock; @@ -53,6 +54,7 @@ import com.hbm.blocks.machine.BlockSeal; import com.hbm.blocks.machine.DummyBlockCentrifuge; import com.hbm.blocks.machine.DummyBlockCyclotron; import com.hbm.blocks.machine.DummyBlockIGenerator; +import com.hbm.blocks.machine.DummyBlockWell; import com.hbm.blocks.machine.FWatzCore; import com.hbm.blocks.machine.FWatzHatch; import com.hbm.blocks.machine.FactoryCoreAdvanced; @@ -72,6 +74,7 @@ import com.hbm.blocks.machine.MachineElectricFurnace; import com.hbm.blocks.machine.MachineGenerator; import com.hbm.blocks.machine.MachineIGenerator; import com.hbm.blocks.machine.MachineNukeFurnace; +import com.hbm.blocks.machine.MachineOilWell; import com.hbm.blocks.machine.MachinePuF6Tank; import com.hbm.blocks.machine.MachineRTG; import com.hbm.blocks.machine.MachineReactor; @@ -165,6 +168,9 @@ public class ModBlocks { public static Block ore_daffergon; public static Block ore_verticium; + public static Block ore_oil; + public static Block ore_oil_empty; + public static Block block_uranium; public static Block block_titanium; public static Block block_sulfur; @@ -404,7 +410,7 @@ public class ModBlocks { public static final int guiID_machine_reix_mainframe = 38; public static Block machine_rtg_grey; - public static final int guiID_machine_rtg = 40; + public static final int guiID_machine_rtg = 42; //public static Block machine_rtg_red; //public static Block machine_rtg_orange; //public static Block machine_rtg_yellow; @@ -413,6 +419,10 @@ public class ModBlocks { //public static Block machine_rtg_blue; //public static Block machine_rtg_purple; + public static Block machine_well; + public static Block oil_pipe; + public static final int guiID_machine_well = 40; + public static Block launch_pad; public static Block launch_pad_generic; public static Block launch_pad_incendiary; @@ -466,6 +476,8 @@ public class ModBlocks { public static Block dummy_block_centrifuge; public static Block dummy_block_cyclotron; public static Block dummy_port_cyclotron; + public static Block dummy_block_well; + public static Block dummy_port_well; private static void initializeBlock() { @@ -510,6 +522,9 @@ public class ModBlocks { ore_unobtainium = new BlockGeneric(Material.rock).setBlockName("ore_unobtainium").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_unobtainium"); ore_daffergon = new BlockGeneric(Material.rock).setBlockName("ore_daffergon").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_daffergon"); ore_verticium = new BlockGeneric(Material.rock).setBlockName("ore_verticium").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_verticium"); + + ore_oil = new BlockOre(Material.rock).setBlockName("ore_oil").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil"); + ore_oil_empty = new BlockGeneric(Material.rock).setBlockName("ore_oil_empty").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil_empty"); block_uranium = new BlockGeneric(Material.iron).setBlockName("block_uranium").setCreativeTab(MainRegistry.tabBlock).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_uranium"); block_titanium = new BlockGeneric(Material.iron).setBlockName("block_titanium").setCreativeTab(MainRegistry.tabBlock).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_titanium"); @@ -726,9 +741,12 @@ public class ModBlocks { rail_highspeed = new RailHighspeed().setBlockName("rail_highspeed").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_highspeed"); rail_booster = new RailBooster().setBlockName("rail_booster").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_booster"); - + crate = new BlockCrate(Material.iron).setBlockName("crate").setStepSound(Block.soundTypeWood).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":crate"); + machine_well = new MachineOilWell(Material.iron).setBlockName("machine_well").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_well"); + oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":oil_pipe"); + machine_schrabidium_transmutator = new MachineSchrabidiumTransmutator(Material.iron).setBlockName("machine_schrabidium_transmutator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock); machine_reix_mainframe = new MachineReiXMainframe(Material.iron).setBlockName("machine_reix_mainframe").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock); @@ -761,6 +779,8 @@ public class ModBlocks { dummy_block_centrifuge = new DummyBlockCentrifuge(Material.iron).setBlockName("dummy_block_centrifuge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); dummy_block_cyclotron = new DummyBlockCyclotron(Material.iron).setBlockName("dummy_block_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); dummy_port_cyclotron = new DummyBlockCyclotron(Material.iron).setBlockName("dummy_port_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); + dummy_block_well = new DummyBlockWell(Material.iron).setBlockName("dummy_block_well").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); + dummy_port_well = new DummyBlockWell(Material.iron).setBlockName("dummy_port_well").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); } private static void registerBlock() { @@ -789,6 +809,8 @@ public class ModBlocks { GameRegistry.registerBlock(ore_fluorite, ore_fluorite.getUnlocalizedName()); GameRegistry.registerBlock(ore_beryllium, ore_beryllium.getUnlocalizedName()); GameRegistry.registerBlock(ore_lead, ore_lead.getUnlocalizedName()); + GameRegistry.registerBlock(ore_oil, ore_oil.getUnlocalizedName()); + GameRegistry.registerBlock(ore_oil_empty, ore_oil_empty.getUnlocalizedName()); GameRegistry.registerBlock(ore_schrabidium, ItemSchrabidiumBlock.class, ore_schrabidium.getUnlocalizedName()); //Rare Minerals @@ -946,6 +968,7 @@ public class ModBlocks { GameRegistry.registerBlock(machine_electric_furnace_on, machine_electric_furnace_on.getUnlocalizedName()); GameRegistry.registerBlock(machine_shredder, machine_shredder.getUnlocalizedName()); GameRegistry.registerBlock(machine_deuterium, machine_deuterium.getUnlocalizedName()); + GameRegistry.registerBlock(machine_well, machine_well.getUnlocalizedName()); GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName()); GameRegistry.registerBlock(machine_combine_factory, machine_combine_factory.getUnlocalizedName()); GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName()); @@ -1042,6 +1065,11 @@ public class ModBlocks { GameRegistry.registerBlock(dummy_block_centrifuge, dummy_block_centrifuge.getUnlocalizedName()); GameRegistry.registerBlock(dummy_block_cyclotron, dummy_block_cyclotron.getUnlocalizedName()); GameRegistry.registerBlock(dummy_port_cyclotron, dummy_port_cyclotron.getUnlocalizedName()); + GameRegistry.registerBlock(dummy_block_well, dummy_block_well.getUnlocalizedName()); + GameRegistry.registerBlock(dummy_port_well, dummy_port_well.getUnlocalizedName()); + + //Other Technical Blocks + GameRegistry.registerBlock(oil_pipe, oil_pipe.getUnlocalizedName()); //??? GameRegistry.registerBlock(crystal_virus, crystal_virus.getUnlocalizedName()); diff --git a/com/hbm/blocks/generic/BlockNoDrop.java b/com/hbm/blocks/generic/BlockNoDrop.java new file mode 100644 index 000000000..bb8eb2914 --- /dev/null +++ b/com/hbm/blocks/generic/BlockNoDrop.java @@ -0,0 +1,20 @@ +package com.hbm.blocks.generic; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; + +public class BlockNoDrop extends Block { + + public BlockNoDrop(Material p_i45394_1_) { + super(p_i45394_1_); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return null; + } +} diff --git a/com/hbm/blocks/generic/BlockOre.java b/com/hbm/blocks/generic/BlockOre.java index 098b2843b..44cb651da 100644 --- a/com/hbm/blocks/generic/BlockOre.java +++ b/com/hbm/blocks/generic/BlockOre.java @@ -20,6 +20,7 @@ import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntityMooshroom; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.potion.Potion; @@ -214,4 +215,14 @@ public class BlockOre extends Block { } } + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) + { + if (world.getBlock(x, y - 1, z) == ModBlocks.ore_oil_empty) + { + world.setBlock(x, y, z, ModBlocks.ore_oil_empty); + world.setBlock(x, y - 1, z, ModBlocks.ore_oil); + } + } + } diff --git a/com/hbm/blocks/machine/DummyBlockWell.java b/com/hbm/blocks/machine/DummyBlockWell.java new file mode 100644 index 000000000..27815c749 --- /dev/null +++ b/com/hbm/blocks/machine/DummyBlockWell.java @@ -0,0 +1,106 @@ +package com.hbm.blocks.machine; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.interfaces.IDummy; +import com.hbm.main.MainRegistry; +import com.hbm.tileentity.TileEntityDummy; +import com.hbm.tileentity.TileEntityMachineIGenerator; +import com.hbm.tileentity.TileEntityMachineOilWell; +import com.hbm.tileentity.TileEntityMachineCyclotron; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class DummyBlockWell extends BlockContainer implements IDummy { + + public static boolean safeBreak = false; + + public DummyBlockWell(Material p_i45386_1_) { + super(p_i45386_1_); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityDummy(); + } + + public void breakBlock(World world, int x, int y, int z, Block block, int i) + { + if(!safeBreak) { + TileEntity te = world.getTileEntity(x, y, z); + if(te != null && te instanceof TileEntityDummy) { + int a = ((TileEntityDummy)te).targetX; + int b = ((TileEntityDummy)te).targetY; + int c = ((TileEntityDummy)te).targetZ; + + //world.getBlock(a, b, c).breakBlock(world, a, b, c, block, i); + if(!world.isRemote) + world.func_147480_a(a, b, c, true); + } + } + world.removeTileEntity(x, y, z); + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public Item getItem(World world, int x, int y, int z) + { + return Item.getItemFromBlock(ModBlocks.machine_well); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + if(world.isRemote) + { + return true; + } else if(!player.isSneaking()) + { + TileEntity te = world.getTileEntity(x, y, z); + if(te != null && te instanceof TileEntityDummy) { + int a = ((TileEntityDummy)te).targetX; + int b = ((TileEntityDummy)te).targetY; + int c = ((TileEntityDummy)te).targetZ; + + TileEntityMachineOilWell entity = (TileEntityMachineOilWell) world.getTileEntity(a, b, c); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_well, world, a, b, c); + } + } + return true; + } else { + return false; + } + } +} diff --git a/com/hbm/blocks/machine/MachineOilWell.java b/com/hbm/blocks/machine/MachineOilWell.java new file mode 100644 index 000000000..9e2c20f24 --- /dev/null +++ b/com/hbm/blocks/machine/MachineOilWell.java @@ -0,0 +1,177 @@ +package com.hbm.blocks.machine; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.handler.MultiblockHandler; +import com.hbm.interfaces.IMultiblock; +import com.hbm.main.MainRegistry; +import com.hbm.tileentity.TileEntityDummy; +import com.hbm.tileentity.TileEntityMachineCyclotron; +import com.hbm.tileentity.TileEntityMachineOilWell; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class MachineOilWell extends BlockContainer implements IMultiblock { + + private final Random field_149933_a = new Random(); + private Random rand; + private static boolean keepInventory; + + public MachineOilWell(Material p_i45386_1_) { + super(p_i45386_1_); + rand = new Random(); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return Item.getItemFromBlock(ModBlocks.machine_well); + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + if(world.isRemote) + { + return true; + } else if(!player.isSneaking()) + { + TileEntityMachineOilWell entity = (TileEntityMachineOilWell) world.getTileEntity(x, y, z); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_well, world, x, y, z); + } + return true; + } else { + return false; + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityMachineOilWell(); + } + + /*@Override + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { + if (!keepInventory) + { + TileEntityMachineOilWell tileentityfurnace = (TileEntityMachineOilWell)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (tileentityfurnace != null) + { + for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149933_a.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3; + entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3; + p_149749_1_.spawnEntityInWorld(entityitem); + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + }*/ + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { + + if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.wellDimension)) { + MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.wellDimension, ModBlocks.dummy_block_well); + + DummyBlockWell.safeBreak = true; + world.setBlock(x, y, z + 1, ModBlocks.dummy_port_well); + TileEntity te = world.getTileEntity(x, y, z + 1); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x, y, z - 1, ModBlocks.dummy_port_well); + TileEntity te2 = world.getTileEntity(x, y, z - 1); + if(te instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te2; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x + 1, y, z, ModBlocks.dummy_port_well); + TileEntity te3 = world.getTileEntity(x + 1, y, z); + if(te3 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te3; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x - 1, y, z, ModBlocks.dummy_port_well); + TileEntity te4 = world.getTileEntity(x - 1, y, z); + if(te4 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te4; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + DummyBlockWell.safeBreak = false; + + } else + world.func_147480_a(x, y, z, true); + } +} diff --git a/com/hbm/calc/UnionOfTileEntitiesAndBooleans.java b/com/hbm/calc/UnionOfTileEntitiesAndBooleans.java index 70fb2947f..a7892648b 100644 --- a/com/hbm/calc/UnionOfTileEntitiesAndBooleans.java +++ b/com/hbm/calc/UnionOfTileEntitiesAndBooleans.java @@ -1,15 +1,17 @@ package com.hbm.calc; +import com.hbm.interfaces.ISource; + import net.minecraft.tileentity.TileEntity; public class UnionOfTileEntitiesAndBooleans { - public UnionOfTileEntitiesAndBooleans(TileEntity tileentity, boolean bool) + public UnionOfTileEntitiesAndBooleans(ISource tileentity, boolean bool) { source = tileentity; ticked = bool; } - - public TileEntity source; + + public ISource source; public boolean ticked = false; } diff --git a/com/hbm/entity/particle/EntityOilSpillFX.java b/com/hbm/entity/particle/EntityOilSpillFX.java new file mode 100644 index 000000000..f045b63fe --- /dev/null +++ b/com/hbm/entity/particle/EntityOilSpillFX.java @@ -0,0 +1,81 @@ +package com.hbm.entity.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class EntityOilSpillFX extends EntityModFX +{ + float smokeParticleScale; + public int particleAge; + public int maxAge; + private static final String __OBFID = "CL_00000924"; + + public EntityOilSpillFX(World world) { + super(world, 0, 0, 0); + } + + public EntityOilSpillFX(World p_i1225_1_, double p_i1225_2_, double p_i1225_4_, double p_i1225_6_, double p_i1225_8_, double p_i1225_10_, double p_i1225_12_) + { + this(p_i1225_1_, p_i1225_2_, p_i1225_4_, p_i1225_6_, p_i1225_8_, p_i1225_10_, p_i1225_12_, 1.0F); + } + + public EntityOilSpillFX(World p_i1226_1_, double p_i1226_2_, double p_i1226_4_, double p_i1226_6_, double p_i1226_8_, double p_i1226_10_, double p_i1226_12_, float p_i1226_14_) + { + super(p_i1226_1_, p_i1226_2_, p_i1226_4_, p_i1226_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1226_8_; + this.motionY += p_i1226_10_; + this.motionZ += p_i1226_12_; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= p_i1226_14_; + this.smokeParticleScale = this.particleScale; + //this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + //this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1226_14_); + this.noClip = false; + } + + /** + * Called to update the entity's position/logic. + */ + + @Override + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if(maxAge < 15) + { + maxAge = rand.nextInt(4) + 15; + } + + this.particleAge++; + + if (this.particleAge >= maxAge) + { + this.setDead(); + } + + this.motionX *= 0.7599999785423279D; + this.motionY *= 0.7599999785423279D; + this.motionZ *= 0.7599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + } +} diff --git a/com/hbm/entity/projectile/EntityOilSpill.java b/com/hbm/entity/projectile/EntityOilSpill.java new file mode 100644 index 000000000..b27c9800b --- /dev/null +++ b/com/hbm/entity/projectile/EntityOilSpill.java @@ -0,0 +1,67 @@ +package com.hbm.entity.projectile; + +import com.hbm.entity.effect.EntityCloudFleija; +import com.hbm.entity.logic.EntityNukeExplosionAdvanced; +import com.hbm.entity.particle.EntityOilSpillFX; +import com.hbm.entity.particle.EntitySSmokeFX; +import com.hbm.explosion.ExplosionChaos; +import com.hbm.lib.ModDamageSource; +import com.hbm.main.MainRegistry; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityOilSpill extends EntityThrowable { + + public EntityOilSpill(World p_i1773_1_) + { + super(p_i1773_1_); + } + + public EntityOilSpill(World p_i1774_1_, EntityLivingBase p_i1774_2_) + { + super(p_i1774_1_, p_i1774_2_); + } + + public void entityInit() { + } + + public EntityOilSpill(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) + { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } + + @Override + public void onUpdate() { + super.onUpdate(); + if(!worldObj.isRemote) { + worldObj.spawnEntityInWorld(new EntityOilSpillFX(worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0)); + if(this.isBurning()) { + this.setDead(); + worldObj.createExplosion(null, posX, posY, posZ, 1.5F, true); + } + } + } + + @Override + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (p_70184_1_.entityHit != null) + { + byte b0 = 0; + + p_70184_1_.entityHit.attackEntityFrom(ModDamageSource.shrapnel, b0); + } + + if(this.ticksExisted > 5) { + this.setDead(); + } + } +} diff --git a/com/hbm/explosion/ExplosionLarge.java b/com/hbm/explosion/ExplosionLarge.java index b2e43e89c..824c216b6 100644 --- a/com/hbm/explosion/ExplosionLarge.java +++ b/com/hbm/explosion/ExplosionLarge.java @@ -3,6 +3,7 @@ package com.hbm.explosion; import java.util.Random; import com.hbm.entity.particle.EntityDSmokeFX; +import com.hbm.entity.projectile.EntityOilSpill; import com.hbm.entity.projectile.EntityRubble; import com.hbm.entity.projectile.EntityShrapnel; @@ -73,6 +74,20 @@ public class ExplosionLarge { } } + public static void spawnOilSpills(World world, double x, double y, double z, int count) { + + for(int i = 0; i < count; i++) { + EntityOilSpill shrapnel = new EntityOilSpill(world); + shrapnel.posX = x; + shrapnel.posY = y; + shrapnel.posZ = z; + shrapnel.motionY = ((rand.nextFloat() * 0.5) + 0.5) * (1 + (count / (15 + rand.nextInt(21)))) + (rand.nextFloat() / 50 * count) * 0.25F; + shrapnel.motionX = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F; + shrapnel.motionZ = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F; + world.spawnEntityInWorld(shrapnel); + } + } + public static void explode(World world, double x, double y, double z, float strength, boolean cloud, boolean rubble, boolean shrapnel) { world.createExplosion(null, x, y, z, strength, true); if(cloud) diff --git a/com/hbm/handler/GUIHandler.java b/com/hbm/handler/GUIHandler.java index 934427071..f82ffa4c3 100644 --- a/com/hbm/handler/GUIHandler.java +++ b/com/hbm/handler/GUIHandler.java @@ -20,6 +20,7 @@ import com.hbm.inventory.container.ContainerMachineCoal; import com.hbm.inventory.container.ContainerMachineCyclotron; import com.hbm.inventory.container.ContainerMachineDeuterium; import com.hbm.inventory.container.ContainerMachineDiesel; +import com.hbm.inventory.container.ContainerMachineOilWell; import com.hbm.inventory.container.ContainerMachineRTG; import com.hbm.inventory.container.ContainerMachineSchrabidiumTransmutator; import com.hbm.inventory.container.ContainerMachineShredder; @@ -59,6 +60,7 @@ import com.hbm.inventory.gui.GUIMachineDeuterium; import com.hbm.inventory.gui.GUIMachineDiesel; import com.hbm.inventory.gui.GUIMachineElectricFurnace; import com.hbm.inventory.gui.GUIMachineGenerator; +import com.hbm.inventory.gui.GUIMachineOilWell; import com.hbm.inventory.gui.GUIMachinePuF6Tank; import com.hbm.inventory.gui.GUIMachineRTG; import com.hbm.inventory.gui.GUIMachineReactor; @@ -90,6 +92,7 @@ import com.hbm.tileentity.TileEntityDiFurnace; import com.hbm.tileentity.TileEntityFWatzCore; import com.hbm.tileentity.TileEntityFusionMultiblock; import com.hbm.tileentity.TileEntityMachineIGenerator; +import com.hbm.tileentity.TileEntityMachineOilWell; import com.hbm.tileentity.TileEntityLaunchPad; import com.hbm.tileentity.TileEntityMachineBattery; import com.hbm.tileentity.TileEntityMachineCMBFactory; @@ -455,6 +458,14 @@ public class GUIHandler implements IGuiHandler { return new ContainerMachineCyclotron(player.inventory, (TileEntityMachineCyclotron) entity); } } + + case ModBlocks.guiID_machine_well: + { + if(entity instanceof TileEntityMachineOilWell) + { + return new ContainerMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity); + } + } } return null; } @@ -787,6 +798,14 @@ public class GUIHandler implements IGuiHandler { return new GUIMachineCyclotron(player.inventory, (TileEntityMachineCyclotron) entity); } } + + case ModBlocks.guiID_machine_well: + { + if(entity instanceof TileEntityMachineOilWell) + { + return new GUIMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity); + } + } } } return null; diff --git a/com/hbm/handler/MultiblockHandler.java b/com/hbm/handler/MultiblockHandler.java index bf5286168..628a7738a 100644 --- a/com/hbm/handler/MultiblockHandler.java +++ b/com/hbm/handler/MultiblockHandler.java @@ -46,6 +46,7 @@ public class MultiblockHandler { public static final int[] iGenDimensionWest = new int[] { 3, 2, 2, 0, 1, 1 }; public static final int[] centDimension = new int[] { 0, 0, 2, 0, 0, 0 }; public static final int[] cyclDimension = new int[] { 1, 1, 5, 0, 1, 1 }; + public static final int[] wellDimension = new int[] { 1, 1, 5, 0, 1, 1 }; //Approved! public static boolean checkSpace(World world, int x, int y, int z, int[] i) { diff --git a/com/hbm/interfaces/ISource.java b/com/hbm/interfaces/ISource.java index f7e8ce4a3..873b34bda 100644 --- a/com/hbm/interfaces/ISource.java +++ b/com/hbm/interfaces/ISource.java @@ -1,8 +1,16 @@ package com.hbm.interfaces; +import java.util.List; + public interface ISource { void ffgeuaInit(); void ffgeua(int x, int y, int z, boolean newTact); + + boolean getTact(); + int getSPower(); + void setSPower(int i); + List getList(); + void clearList(); } diff --git a/com/hbm/inventory/SlotDiFurnace.java b/com/hbm/inventory/SlotMachineOutput.java similarity index 67% rename from com/hbm/inventory/SlotDiFurnace.java rename to com/hbm/inventory/SlotMachineOutput.java index d771d2ae6..d58efae39 100644 --- a/com/hbm/inventory/SlotDiFurnace.java +++ b/com/hbm/inventory/SlotMachineOutput.java @@ -5,9 +5,9 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class SlotDiFurnace extends Slot { +public class SlotMachineOutput extends Slot { - public SlotDiFurnace(EntityPlayer player, IInventory inventory, int i, int j, int k) { + public SlotMachineOutput(EntityPlayer player, IInventory inventory, int i, int j, int k) { super(inventory, i, j, k); } diff --git a/com/hbm/inventory/container/ContainerCentrifuge.java b/com/hbm/inventory/container/ContainerCentrifuge.java index 10eb8b529..9621b981b 100644 --- a/com/hbm/inventory/container/ContainerCentrifuge.java +++ b/com/hbm/inventory/container/ContainerCentrifuge.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineCentrifuge; import net.minecraft.entity.player.EntityPlayer; @@ -22,10 +22,10 @@ public class ContainerCentrifuge extends Container { this.addSlotToContainer(new Slot(tedf, 0, 26, 17)); this.addSlotToContainer(new Slot(tedf, 1, 26, 53)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 134, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 152, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 134, 53)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 5, 152, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 17)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 152, 17)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 134, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 5, 152, 53)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerCoreAdvanced.java b/com/hbm/inventory/container/ContainerCoreAdvanced.java index 6efccaa23..41790ea7e 100644 --- a/com/hbm/inventory/container/ContainerCoreAdvanced.java +++ b/com/hbm/inventory/container/ContainerCoreAdvanced.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityCoreAdvanced; import com.hbm.tileentity.TileEntityCoreTitanium; @@ -35,26 +35,26 @@ public class ContainerCoreAdvanced extends Container { this.addSlotToContainer(new Slot(tedf, 9, 8, 54)); this.addSlotToContainer(new Slot(tedf, 10, 8, 72)); //Outputs - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 134, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 134, 72)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 134, 54)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 134, 72)); //Output Storage - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 8, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 26, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 44, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 16, 62, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 17, 80, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 18, 98, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 19, 116, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 20, 134, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 21, 152, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 8, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 26, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 44, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 16, 62, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 17, 80, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 18, 98, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 19, 116, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 20, 134, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 21, 152, 108)); //Power Cell this.addSlotToContainer(new Slot(tedf, 22, 44, 72)); //More Inputs this.addSlotToContainer(new Slot(tedf, 23, 26, 54)); this.addSlotToContainer(new Slot(tedf, 24, 26, 72)); //More Outputs - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 25, 152, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 26, 152, 72)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 25, 152, 54)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 26, 152, 72)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerCoreTitanium.java b/com/hbm/inventory/container/ContainerCoreTitanium.java index 31fd3e66e..62a4f7a58 100644 --- a/com/hbm/inventory/container/ContainerCoreTitanium.java +++ b/com/hbm/inventory/container/ContainerCoreTitanium.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityCoreTitanium; import com.hbm.tileentity.TileEntityMachineGenerator; @@ -35,18 +35,18 @@ public class ContainerCoreTitanium extends Container { this.addSlotToContainer(new Slot(tedf, 9, 8, 54)); this.addSlotToContainer(new Slot(tedf, 10, 8, 72)); //Outputs - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 152, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 152, 72)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 152, 54)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 152, 72)); //Output Storage - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 8, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 26, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 44, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 16, 62, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 17, 80, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 18, 98, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 19, 116, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 20, 134, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 21, 152, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 8, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 26, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 44, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 16, 62, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 17, 80, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 18, 98, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 19, 116, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 20, 134, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 21, 152, 108)); //Power Cell this.addSlotToContainer(new Slot(tedf, 22, 44, 72)); diff --git a/com/hbm/inventory/container/ContainerDiFurnace.java b/com/hbm/inventory/container/ContainerDiFurnace.java index f4c297238..5f49e5289 100644 --- a/com/hbm/inventory/container/ContainerDiFurnace.java +++ b/com/hbm/inventory/container/ContainerDiFurnace.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityDiFurnace; import net.minecraft.entity.player.EntityPlayer; @@ -29,7 +29,7 @@ public class ContainerDiFurnace extends Container { this.addSlotToContainer(new Slot(tedf, 0, 80, 18)); this.addSlotToContainer(new Slot(tedf, 1, 80, 54)); this.addSlotToContainer(new Slot(tedf, 2, 8, 36)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 134, 36)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 134, 36)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerElectricFurnace.java b/com/hbm/inventory/container/ContainerElectricFurnace.java index dcd21acc4..7172cfd98 100644 --- a/com/hbm/inventory/container/ContainerElectricFurnace.java +++ b/com/hbm/inventory/container/ContainerElectricFurnace.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineElectricFurnace; import net.minecraft.entity.player.EntityPlayer; @@ -26,7 +26,7 @@ public class ContainerElectricFurnace extends Container { this.addSlotToContainer(new Slot(tedf, 0, 56, 53)); this.addSlotToContainer(new Slot(tedf, 1, 56, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 116, 35)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 116, 35)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerMachineCMBFactory.java b/com/hbm/inventory/container/ContainerMachineCMBFactory.java index c4166b156..6b8d27da0 100644 --- a/com/hbm/inventory/container/ContainerMachineCMBFactory.java +++ b/com/hbm/inventory/container/ContainerMachineCMBFactory.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineCMBFactory; import com.hbm.tileentity.TileEntityMachineShredder; @@ -28,7 +28,7 @@ public class ContainerMachineCMBFactory extends Container { this.addSlotToContainer(new Slot(tedf, 1, 80, 17)); this.addSlotToContainer(new Slot(tedf, 2, 62, 53)); this.addSlotToContainer(new Slot(tedf, 3, 80, 53)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 134, 35)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 134, 35)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerMachineCyclotron.java b/com/hbm/inventory/container/ContainerMachineCyclotron.java index aad051f1d..c552b81da 100644 --- a/com/hbm/inventory/container/ContainerMachineCyclotron.java +++ b/com/hbm/inventory/container/ContainerMachineCyclotron.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineCyclotron; import com.hbm.tileentity.TileEntityMachineRTG; @@ -40,11 +40,11 @@ public class ContainerMachineCyclotron extends Container { //Cell this.addSlotToContainer(new Slot(tedf, 10, 8, 108)); //Output - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 44, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 62, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 80, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 98, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 116, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 44, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 62, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 80, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 98, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 116, 108)); for(int i = 0; i < 3; i++) { @@ -78,13 +78,13 @@ public class ContainerMachineCyclotron extends Container { ItemStack var5 = var4.getStack(); var3 = var5.copy(); - if (par2 <= 14) { - if (!this.mergeItemStack(var5, 15, this.inventorySlots.size(), true)) + if (par2 <= 15) { + if (!this.mergeItemStack(var5, 16, this.inventorySlots.size(), true)) { return null; } } - else if (!this.mergeItemStack(var5, 0, 15, false)) + else if (!this.mergeItemStack(var5, 0, 16, false)) { return null; } diff --git a/com/hbm/inventory/container/ContainerMachineDeuterium.java b/com/hbm/inventory/container/ContainerMachineDeuterium.java index 05ffd3ed9..a6e3be8cf 100644 --- a/com/hbm/inventory/container/ContainerMachineDeuterium.java +++ b/com/hbm/inventory/container/ContainerMachineDeuterium.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineDeuterium; import net.minecraft.entity.player.EntityPlayer; @@ -27,7 +27,7 @@ private TileEntityMachineDeuterium nukeBoy; this.addSlotToContainer(new Slot(tedf, 1, 26, 90)); this.addSlotToContainer(new Slot(tedf, 2, 44, 90)); this.addSlotToContainer(new Slot(tedf, 3, 80, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 140, 54)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 140, 54)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerMachineDiesel.java b/com/hbm/inventory/container/ContainerMachineDiesel.java index 1468e8164..bb06dd52c 100644 --- a/com/hbm/inventory/container/ContainerMachineDiesel.java +++ b/com/hbm/inventory/container/ContainerMachineDiesel.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineCoal; import com.hbm.tileentity.TileEntityMachineDiesel; @@ -26,7 +26,7 @@ public class ContainerMachineDiesel extends Container { diFurnace = tedf; this.addSlotToContainer(new Slot(tedf, 0, 44, 53)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 80, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 80, 53)); this.addSlotToContainer(new Slot(tedf, 2, 116, 53)); for(int i = 0; i < 3; i++) diff --git a/com/hbm/inventory/container/ContainerMachineOilWell.java b/com/hbm/inventory/container/ContainerMachineOilWell.java new file mode 100644 index 000000000..5285d6d2b --- /dev/null +++ b/com/hbm/inventory/container/ContainerMachineOilWell.java @@ -0,0 +1,140 @@ +package com.hbm.inventory.container; + +import com.hbm.inventory.SlotMachineOutput; +import com.hbm.tileentity.TileEntityMachineOilWell; +import com.hbm.tileentity.TileEntityMachineRTG; +import com.hbm.tileentity.TileEntityMachineUF6Tank; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerMachineOilWell extends Container { + + private TileEntityMachineOilWell testNuke; + private int oil; + private int power; + private int warning; + + public ContainerMachineOilWell(InventoryPlayer invPlayer, TileEntityMachineOilWell tedf) { + oil = 0; + power = 0; + warning = 0; + + testNuke = tedf; + + //Battery + this.addSlotToContainer(new Slot(tedf, 0, 44, 53)); + //Canister Input + this.addSlotToContainer(new Slot(tedf, 1, 134, 17)); + //Canister Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 53)); + + for(int i = 0; i < 3; i++) + { + for(int j = 0; j < 9; j++) + { + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for(int i = 0; i < 9; i++) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting crafting) { + super.addCraftingToCrafters(crafting); + crafting.sendProgressBarUpdate(this, 0, this.testNuke.oil); + crafting.sendProgressBarUpdate(this, 1, this.testNuke.power); + crafting.sendProgressBarUpdate(this, 2, this.testNuke.warning); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if (var4 != null && var4.getHasStack()) + { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (par2 <= 14) { + if (!this.mergeItemStack(var5, 15, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(var5, 0, 15, false)) + { + return null; + } + + if (var5.stackSize == 0) + { + var4.putStack((ItemStack) null); + } + else + { + var4.onSlotChanged(); + } + } + + return var3; + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return testNuke.isUseableByPlayer(player); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for(int i = 0; i < this.crafters.size(); i++) + { + ICrafting par1 = (ICrafting)this.crafters.get(i); + + if(this.oil != this.testNuke.oil) + { + par1.sendProgressBarUpdate(this, 0, this.testNuke.oil); + } + if(this.power != this.testNuke.power) + { + par1.sendProgressBarUpdate(this, 1, this.testNuke.power); + } + if(this.power != this.testNuke.warning) + { + par1.sendProgressBarUpdate(this, 2, this.testNuke.warning); + } + } + + this.oil = this.testNuke.oil; + this.power = this.testNuke.power; + this.warning = this.testNuke.warning; + } + + @Override + public void updateProgressBar(int i, int j) { + if(i == 0) + { + testNuke.oil = j; + } + if(i == 1) + { + testNuke.power = j; + } + if(i == 2) + { + testNuke.warning = j; + } + } +} diff --git a/com/hbm/inventory/container/ContainerMachineRTG.java b/com/hbm/inventory/container/ContainerMachineRTG.java index 0c7dc4afb..6e2295756 100644 --- a/com/hbm/inventory/container/ContainerMachineRTG.java +++ b/com/hbm/inventory/container/ContainerMachineRTG.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineRTG; import com.hbm.tileentity.TileEntityMachineUF6Tank; diff --git a/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java b/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java index 70474cd2e..bddd8badc 100644 --- a/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java +++ b/com/hbm/inventory/container/ContainerMachineSchrabidiumTransmutator.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineDeuterium; import com.hbm.tileentity.TileEntityMachineSchrabidiumTransmutator; @@ -25,7 +25,7 @@ private TileEntityMachineSchrabidiumTransmutator nukeBoy; nukeBoy = tedf; this.addSlotToContainer(new Slot(tedf, 0, 44, 63)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 134, 63)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 134, 63)); this.addSlotToContainer(new Slot(tedf, 2, 26, 18)); this.addSlotToContainer(new Slot(tedf, 3, 8, 108)); diff --git a/com/hbm/inventory/container/ContainerMachineShredder.java b/com/hbm/inventory/container/ContainerMachineShredder.java index b74ac68c1..d20dbae8e 100644 --- a/com/hbm/inventory/container/ContainerMachineShredder.java +++ b/com/hbm/inventory/container/ContainerMachineShredder.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineDiesel; import com.hbm.tileentity.TileEntityMachineShredder; @@ -31,24 +31,24 @@ public class ContainerMachineShredder extends Container { this.addSlotToContainer(new Slot(tedf, 6, 44, 54)); this.addSlotToContainer(new Slot(tedf, 7, 62, 54)); this.addSlotToContainer(new Slot(tedf, 8, 80, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 9, 116, 18)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 10, 134, 18)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 152, 18)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 116, 36)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 134, 36)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 152, 36)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 116, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 16, 134, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 17, 152, 54)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 18, 116, 72)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 19, 134, 72)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 20, 152, 72)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 21, 116, 90)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 22, 134, 90)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 23, 152, 90)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 24, 116, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 25, 134, 108)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 26, 152, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 9, 116, 18)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 10, 134, 18)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 152, 18)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 116, 36)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 134, 36)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 152, 36)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 116, 54)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 16, 134, 54)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 17, 152, 54)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 18, 116, 72)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 19, 134, 72)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 20, 152, 72)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 21, 116, 90)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 22, 134, 90)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 23, 152, 90)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 24, 116, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 25, 134, 108)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 26, 152, 108)); this.addSlotToContainer(new Slot(tedf, 27, 44, 108)); this.addSlotToContainer(new Slot(tedf, 28, 80, 108)); this.addSlotToContainer(new Slot(tedf, 29, 8, 108)); diff --git a/com/hbm/inventory/container/ContainerNukeFurnace.java b/com/hbm/inventory/container/ContainerNukeFurnace.java index 378fd53ea..50832dd94 100644 --- a/com/hbm/inventory/container/ContainerNukeFurnace.java +++ b/com/hbm/inventory/container/ContainerNukeFurnace.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityNukeFurnace; import net.minecraft.entity.player.EntityPlayer; @@ -26,7 +26,7 @@ public class ContainerNukeFurnace extends Container { this.addSlotToContainer(new Slot(tedf, 0, 56, 53)); this.addSlotToContainer(new Slot(tedf, 1, 56, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 116, 35)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 116, 35)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerPuF6Tank.java b/com/hbm/inventory/container/ContainerPuF6Tank.java index ebccfa9a5..77ed7543e 100644 --- a/com/hbm/inventory/container/ContainerPuF6Tank.java +++ b/com/hbm/inventory/container/ContainerPuF6Tank.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachinePuF6Tank; import net.minecraft.entity.player.EntityPlayer; @@ -21,9 +21,9 @@ public class ContainerPuF6Tank extends Container { testNuke = tedf; this.addSlotToContainer(new Slot(tedf, 0, 44, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 44, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 44, 53)); this.addSlotToContainer(new Slot(tedf, 2, 116, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 116, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 116, 53)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerReactor.java b/com/hbm/inventory/container/ContainerReactor.java index c45241467..6e3d0249d 100644 --- a/com/hbm/inventory/container/ContainerReactor.java +++ b/com/hbm/inventory/container/ContainerReactor.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineReactor; import net.minecraft.entity.player.EntityPlayer; @@ -26,7 +26,7 @@ public class ContainerReactor extends Container { this.addSlotToContainer(new Slot(tedf, 0, 56, 53)); this.addSlotToContainer(new Slot(tedf, 1, 56, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 116, 35)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 116, 35)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerRtgFurnace.java b/com/hbm/inventory/container/ContainerRtgFurnace.java index 4b0772f7f..805af8352 100644 --- a/com/hbm/inventory/container/ContainerRtgFurnace.java +++ b/com/hbm/inventory/container/ContainerRtgFurnace.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityRtgFurnace; import net.minecraft.entity.player.EntityPlayer; @@ -26,7 +26,7 @@ public class ContainerRtgFurnace extends Container { this.addSlotToContainer(new Slot(tedf, 1, 38, 53)); this.addSlotToContainer(new Slot(tedf, 2, 56, 53)); this.addSlotToContainer(new Slot(tedf, 3, 74, 53)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 116, 35)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 116, 35)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/container/ContainerUF6Tank.java b/com/hbm/inventory/container/ContainerUF6Tank.java index c1be7080b..f442568dd 100644 --- a/com/hbm/inventory/container/ContainerUF6Tank.java +++ b/com/hbm/inventory/container/ContainerUF6Tank.java @@ -1,6 +1,6 @@ package com.hbm.inventory.container; -import com.hbm.inventory.SlotDiFurnace; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineUF6Tank; import net.minecraft.entity.player.EntityPlayer; @@ -21,9 +21,9 @@ public class ContainerUF6Tank extends Container { testNuke = tedf; this.addSlotToContainer(new Slot(tedf, 0, 44, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 44, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 44, 53)); this.addSlotToContainer(new Slot(tedf, 2, 116, 17)); - this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 116, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 116, 53)); for(int i = 0; i < 3; i++) { diff --git a/com/hbm/inventory/gui/GUIMachineOilWell.java b/com/hbm/inventory/gui/GUIMachineOilWell.java new file mode 100644 index 000000000..068df8952 --- /dev/null +++ b/com/hbm/inventory/gui/GUIMachineOilWell.java @@ -0,0 +1,58 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.container.ContainerMachineOilWell; +import com.hbm.inventory.container.ContainerMachineRTG; +import com.hbm.inventory.container.ContainerUF6Tank; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.TileEntityMachineOilWell; +import com.hbm.tileentity.TileEntityMachineRTG; +import com.hbm.tileentity.TileEntityMachineUF6Tank; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUIMachineOilWell extends GuiContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well.png"); + private TileEntityMachineOilWell derrick; + + public GUIMachineOilWell(InventoryPlayer invPlayer, TileEntityMachineOilWell tedf) { + super(new ContainerMachineOilWell(invPlayer, tedf)); + derrick = tedf; + + this.xSize = 176; + this.ySize = 166; + } + + @Override + protected void drawGuiContainerForegroundLayer( int i, int j) { + String name = this.derrick.hasCustomInventoryName() ? this.derrick.getInventoryName() : I18n.format(this.derrick.getInventoryName()); + + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + int i = derrick.getPowerScaled(52); + drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i); + + int j = derrick.getOilScaled(52); + drawTexturedModalRect(guiLeft + 80, guiTop + 69 - j, 192, 52 - j, 34, j); + + int k = derrick.warning; + if(k == 2) + drawTexturedModalRect(guiLeft + 44, guiTop + 17, 176, 52, 16, 16); + if(k == 1) + drawTexturedModalRect(guiLeft + 44, guiTop + 17, 192, 52, 16, 16); + } +} diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index e79040deb..a8c13bc2a 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -66,6 +66,7 @@ import com.hbm.items.tool.ItemMatch; import com.hbm.items.tool.ItemModBucket; import com.hbm.items.tool.ItemMultitoolPassive; import com.hbm.items.tool.ItemMultitoolTool; +import com.hbm.items.tool.ItemOilDetector; import com.hbm.items.tool.ItemRamManipulator; import com.hbm.items.tool.ItemWand; import com.hbm.items.tool.ItemWandD; @@ -417,6 +418,7 @@ public class ModItems { public static Item oil_canola; public static Item canister_empty; public static Item canister_canola; + public static Item canister_oil; public static Item canister_fuel; public static Item canister_napalm; public static Item canister_NITAN; @@ -566,6 +568,7 @@ public class ModItems { public static Item designator; public static Item designator_range; public static Item linker; + public static Item oil_detector; public static Item missile_generic; public static Item missile_anti_ballistic; @@ -933,6 +936,14 @@ public class ModItems { public static Item d_smoke6; public static Item d_smoke7; public static Item d_smoke8; + public static Item spill1; + public static Item spill2; + public static Item spill3; + public static Item spill4; + public static Item spill5; + public static Item spill6; + public static Item spill7; + public static Item spill8; public static Item energy_ball; public static Item discharge; public static Item empblast; @@ -1257,6 +1268,7 @@ public class ModItems { oil_canola = new Item().setUnlocalizedName("oil_canola").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":oil_canola"); canister_empty = new ItemCustomLore().setUnlocalizedName("canister_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":canister_empty"); canister_canola = new ItemCustomLore().setUnlocalizedName("canister_canola").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_canola"); + canister_oil = new ItemCustomLore().setUnlocalizedName("canister_oil").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_oil"); canister_fuel = new ItemCustomLore().setUnlocalizedName("canister_fuel").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_fuel"); canister_napalm = new ItemCustomLore().setUnlocalizedName("canister_napalm").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_napalm"); canister_NITAN = new ItemCustomLore().setUnlocalizedName("canister_NITAN").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_superfuel"); @@ -1612,6 +1624,7 @@ public class ModItems { remote = new ItemRamManipulator().setUnlocalizedName("remote").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":remote"); chopper = new ItemChopper().setUnlocalizedName("chopper").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":chopper"); linker = new ItemTeleLink().setUnlocalizedName("linker").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":linker"); + oil_detector = new ItemOilDetector().setUnlocalizedName("oil_detector").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":oil_detector"); euphemium_helmet = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 0).setUnlocalizedName("astatine_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_helmet"); euphemium_plate = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 1).setUnlocalizedName("astatine_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_plate"); @@ -1770,6 +1783,14 @@ public class ModItems { d_smoke6 = new Item().setUnlocalizedName("d_smoke6").setTextureName(RefStrings.MODID + ":d_smoke6"); d_smoke7 = new Item().setUnlocalizedName("d_smoke7").setTextureName(RefStrings.MODID + ":d_smoke7"); d_smoke8 = new Item().setUnlocalizedName("d_smoke8").setTextureName(RefStrings.MODID + ":d_smoke8"); + spill1 = new Item().setUnlocalizedName("spill1").setTextureName(RefStrings.MODID + ":spill1"); + spill2 = new Item().setUnlocalizedName("spill2").setTextureName(RefStrings.MODID + ":spill2"); + spill3 = new Item().setUnlocalizedName("spill3").setTextureName(RefStrings.MODID + ":spill3"); + spill4 = new Item().setUnlocalizedName("spill4").setTextureName(RefStrings.MODID + ":spill4"); + spill5 = new Item().setUnlocalizedName("spill5").setTextureName(RefStrings.MODID + ":spill5"); + spill6 = new Item().setUnlocalizedName("spill6").setTextureName(RefStrings.MODID + ":spill6"); + spill7 = new Item().setUnlocalizedName("spill7").setTextureName(RefStrings.MODID + ":spill7"); + spill8 = new Item().setUnlocalizedName("spill8").setTextureName(RefStrings.MODID + ":spill8"); energy_ball = new Item().setUnlocalizedName("energy_ball").setTextureName(RefStrings.MODID + ":energy_ball"); discharge = new Item().setUnlocalizedName("discharge").setTextureName(RefStrings.MODID + ":discharge"); empblast = new Item().setUnlocalizedName("empblast").setTextureName(RefStrings.MODID + ":empblast"); @@ -2133,6 +2154,7 @@ public class ModItems { //Canisters GameRegistry.registerItem(canister_empty, canister_empty.getUnlocalizedName()); GameRegistry.registerItem(canister_canola, canister_canola.getUnlocalizedName()); + GameRegistry.registerItem(canister_oil, canister_oil.getUnlocalizedName()); GameRegistry.registerItem(canister_fuel, canister_fuel.getUnlocalizedName()); GameRegistry.registerItem(canister_napalm, canister_napalm.getUnlocalizedName()); GameRegistry.registerItem(canister_NITAN, canister_NITAN.getUnlocalizedName()); @@ -2294,6 +2316,7 @@ public class ModItems { GameRegistry.registerItem(designator, designator.getUnlocalizedName()); GameRegistry.registerItem(designator_range, designator_range.getUnlocalizedName()); GameRegistry.registerItem(linker, linker.getUnlocalizedName()); + GameRegistry.registerItem(oil_detector, oil_detector.getUnlocalizedName()); //Missiles GameRegistry.registerItem(missile_generic, missile_generic.getUnlocalizedName()); @@ -2692,6 +2715,14 @@ public class ModItems { GameRegistry.registerItem(d_smoke6, d_smoke6.getUnlocalizedName()); GameRegistry.registerItem(d_smoke7, d_smoke7.getUnlocalizedName()); GameRegistry.registerItem(d_smoke8, d_smoke8.getUnlocalizedName()); + GameRegistry.registerItem(spill1, spill1.getUnlocalizedName()); + GameRegistry.registerItem(spill2, spill2.getUnlocalizedName()); + GameRegistry.registerItem(spill3, spill3.getUnlocalizedName()); + GameRegistry.registerItem(spill4, spill4.getUnlocalizedName()); + GameRegistry.registerItem(spill5, spill5.getUnlocalizedName()); + GameRegistry.registerItem(spill6, spill6.getUnlocalizedName()); + GameRegistry.registerItem(spill7, spill7.getUnlocalizedName()); + GameRegistry.registerItem(spill8, spill8.getUnlocalizedName()); GameRegistry.registerItem(energy_ball, energy_ball.getUnlocalizedName()); GameRegistry.registerItem(discharge, discharge.getUnlocalizedName()); GameRegistry.registerItem(empblast, empblast.getUnlocalizedName()); diff --git a/com/hbm/items/tool/ItemOilDetector.java b/com/hbm/items/tool/ItemOilDetector.java new file mode 100644 index 000000000..667cb87fe --- /dev/null +++ b/com/hbm/items/tool/ItemOilDetector.java @@ -0,0 +1,70 @@ +package com.hbm.items.tool; + +import java.util.List; + +import com.hbm.blocks.ModBlocks; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; + +public class ItemOilDetector extends Item { + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) + { + list.add("Right click to scan for oil."); + list.add("Scanner can only detect larger deposits!"); + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + + boolean oil = false; + boolean direct = false; + int x = (int)player.posX; + int y = (int)player.posY; + int z = (int)player.posZ; + + for(int i = y + 15; i > 5; i--) + if(world.getBlock(x, i, z) == ModBlocks.ore_oil) + direct = true; + for(int i = y + 15; i > 5; i--) + if(world.getBlock(x + 5, i, z) == ModBlocks.ore_oil) + oil = true; + for(int i = y + 15; i > 5; i--) + if(world.getBlock(x - 5, i, z) == ModBlocks.ore_oil) + oil = true; + for(int i = y + 15; i > 5; i--) + if(world.getBlock(x, i, z + 5) == ModBlocks.ore_oil) + oil = true; + for(int i = y + 15; i > 5; i--) + if(world.getBlock(x, i, z - 5) == ModBlocks.ore_oil) + oil = true; + + if(direct) + oil = true; + + if(world.isRemote) + { + if(oil) { + player.addChatMessage(new ChatComponentText("Oil deposit detected!")); + if(direct) + player.addChatMessage(new ChatComponentText("Oil deposit directly below!")); + } else { + player.addChatMessage(new ChatComponentText("No oil detected.")); + } + } + + world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F); + + player.swingItem(); + + return stack; + + } + +} diff --git a/com/hbm/items/weapon/GunRpg.java b/com/hbm/items/weapon/GunRpg.java index 45a775e33..4cb23fdae 100644 --- a/com/hbm/items/weapon/GunRpg.java +++ b/com/hbm/items/weapon/GunRpg.java @@ -90,6 +90,7 @@ public class GunRpg extends Item if (!p_77615_2_.isRemote) { + entityarrow.canBePickedUp = 2; p_77615_2_.spawnEntityInWorld(entityarrow); } } diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index c047057bb..a8116e062 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -13,6 +13,7 @@ import com.hbm.interfaces.IConsumer; import com.hbm.interfaces.ISource; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; +import com.hbm.tileentity.TileEntityCable; import com.hbm.tileentity.TileEntityLaunchPad; import com.hbm.tileentity.TileEntityMachineBattery; import com.hbm.tileentity.TileEntityMachineDeuterium; @@ -256,14 +257,15 @@ public class Library { world.getBlock(x, y, z) == ModBlocks.watz_conductor || world.getBlock(x, y, z) == ModBlocks.fwatz_hatch || world.getBlock(x, y, z) == ModBlocks.dummy_port_igenerator || - world.getBlock(x, y, z) == ModBlocks.dummy_port_cyclotron) + world.getBlock(x, y, z) == ModBlocks.dummy_port_cyclotron || + world.getBlock(x, y, z) == ModBlocks.dummy_port_well) { return true; } return false; } - public static boolean checkUnionList(List list, TileEntity that) { + public static boolean checkUnionList(List list, ISource that) { for(UnionOfTileEntitiesAndBooleans union : list) { @@ -425,26 +427,63 @@ public class Library { power -= 100; slots[index].setItemDamage(slots[index].getItemDamage() - 1); } - if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() > 0) - { - power -= 100; - slots[index].setItemDamage(slots[index].getItemDamage() - 1); - } - if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() > 0) - { - power -= 100; - slots[index].setItemDamage(slots[index].getItemDamage() - 1); - } - if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_titanium && slots[index].getItemDamage() > 0) - { - power -= 100; - slots[index].setItemDamage(slots[index].getItemDamage() - 1); - } - if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_advanced && slots[index].getItemDamage() > 0) - { - power -= 100; - slots[index].setItemDamage(slots[index].getItemDamage() - 1); - } + + for(int i = 0; i < 5; i++) + if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() > 0) + { + power -= 100; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + + for(int i = 0; i < 15; i++) + if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() > 0) + { + power -= 100; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + + for(int i = 0; i < 10; i++) + if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_titanium && slots[index].getItemDamage() > 0) + { + power -= 100; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + + for(int i = 0; i < 10; i++) + if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_advanced && slots[index].getItemDamage() > 0) + { + power -= 100; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + + for(int i = 0; i < 50; i++) + if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_sword && slots[index].getItemDamage() > 0) + { + power -= 1; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + + for(int i = 0; i < 50; i++) + if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_pickaxe && slots[index].getItemDamage() > 0) + { + power -= 1; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + + for(int i = 0; i < 50; i++) + if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_axe && slots[index].getItemDamage() > 0) + { + power -= 1; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + + for(int i = 0; i < 50; i++) + if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_shovel && slots[index].getItemDamage() > 0) + { + power -= 1; + slots[index].setItemDamage(slots[index].getItemDamage() - 1); + } else break; + return power; } @@ -452,7 +491,7 @@ public class Library { if(slots[index] != null && slots[index].getItem() == ModItems.battery_creative) { - power = maxPower; + return maxPower; } if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_generic && slots[index].getItemDamage() < 50) @@ -461,29 +500,155 @@ public class Library { slots[index].setItemDamage(slots[index].getItemDamage() + 1); } - if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() < 200) - { - power += 100; - slots[index].setItemDamage(slots[index].getItemDamage() + 1); - } + for(int i = 0; i < 5; i++) + if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() < 200) + { + power += 100; + slots[index].setItemDamage(slots[index].getItemDamage() + 1); + } else break; + + for(int i = 0; i < 15; i++) + if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() < 10000) + { + power += 100; + slots[index].setItemDamage(slots[index].getItemDamage() + 1); + } else break; - if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() < 10000) - { - power += 100; - slots[index].setItemDamage(slots[index].getItemDamage() + 1); - } + for(int i = 0; i < 25; i++) + if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.fusion_core && slots[index].getItemDamage() < 5000) + { + power += 100; + slots[index].setItemDamage(slots[index].getItemDamage() + 1); + } else break; - if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.fusion_core && slots[index].getItemDamage() < 5000) - { - power += 100; - slots[index].setItemDamage(slots[index].getItemDamage() + 1); - } + for(int i = 0; i < 10; i++) + if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.energy_core && slots[index].getItemDamage() < 5000) + { + power += 100; + slots[index].setItemDamage(slots[index].getItemDamage() + 1); + } else break; - if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.energy_core && slots[index].getItemDamage() < 5000) - { - power += 100; - slots[index].setItemDamage(slots[index].getItemDamage() + 1); - } return power; } + + //Flut-Füll gesteuerter Energieübertragungsalgorithmus + //Flood fill controlle energy transmission algorithm + public static void ffgeua(int x, int y, int z, boolean newTact, ISource that, World worldObj) { + Block block = worldObj.getBlock(x, y, z); + TileEntity tileentity = worldObj.getTileEntity(x, y, z); + + if(block == ModBlocks.factory_titanium_conductor && worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) + { + tileentity = worldObj.getTileEntity(x, y + 1, z); + } + if(block == ModBlocks.factory_titanium_conductor && worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) + { + tileentity = worldObj.getTileEntity(x, y - 1, z); + } + if(block == ModBlocks.factory_advanced_conductor && worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) + { + tileentity = worldObj.getTileEntity(x, y + 1, z); + } + if(block == ModBlocks.factory_advanced_conductor && worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) + { + tileentity = worldObj.getTileEntity(x, y - 1, z); + } + if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x + 1, y, z) == ModBlocks.machine_well) + { + tileentity = worldObj.getTileEntity(x + 1, y, z); + } + if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x - 1, y, z) == ModBlocks.machine_well) + { + tileentity = worldObj.getTileEntity(x - 1, y, z); + } + if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x, y, z + 1) == ModBlocks.machine_well) + { + tileentity = worldObj.getTileEntity(x, y, z + 1); + } + if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x, y, z - 1) == ModBlocks.machine_well) + { + tileentity = worldObj.getTileEntity(x, y, z - 1); + } + + if(tileentity instanceof IConductor) + { + if(tileentity instanceof TileEntityCable) + { + if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) + { + if(((TileEntityCable)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; + that.ffgeua(x, y + 1, z, that.getTact()); + that.ffgeua(x, y - 1, z, that.getTact()); + that.ffgeua(x - 1, y, z, that.getTact()); + that.ffgeua(x + 1, y, z, that.getTact()); + that.ffgeua(x, y, z - 1, that.getTact()); + that.ffgeua(x, y, z + 1, that.getTact()); + } + } + } + } else { + ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(that, newTact)); + } + } + if(tileentity instanceof TileEntityWireCoated) + { + if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) + { + if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; + that.ffgeua(x, y + 1, z, that.getTact()); + that.ffgeua(x, y - 1, z, that.getTact()); + that.ffgeua(x - 1, y, z, that.getTact()); + that.ffgeua(x + 1, y, z, that.getTact()); + that.ffgeua(x, y, z - 1, that.getTact()); + that.ffgeua(x, y, z + 1, that.getTact()); + } + } + } + } else { + ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(that, newTact)); + } + } + } + + if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) + { + that.getList().add((IConsumer)tileentity); + } + + if(!newTact) + { + int size = that.getList().size(); + if(size > 0) + { + int part = that.getSPower() / size; + for(IConsumer consume : that.getList()) + { + if(consume.getPower() < consume.getMaxPower()) + { + if(consume.getMaxPower() - consume.getPower() >= part) + { + that.setSPower(that.getSPower()-part); + consume.setPower(consume.getPower() + part); + } else { + that.setSPower(that.getSPower() - (consume.getMaxPower() - consume.getPower())); + consume.setPower(consume.getMaxPower()); + } + } + } + } + that.clearList(); + } + } } diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index 8aa9aa120..a32cf9c4d 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -57,6 +57,7 @@ import com.hbm.entity.mob.EntityHunterChopper; import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.particle.EntityBSmokeFX; import com.hbm.entity.particle.EntityDSmokeFX; +import com.hbm.entity.particle.EntityOilSpillFX; import com.hbm.entity.particle.EntitySSmokeFX; import com.hbm.entity.particle.EntitySmokeFX; import com.hbm.entity.projectile.EntityBaleflare; @@ -71,6 +72,7 @@ import com.hbm.entity.projectile.EntityMinerBeam; import com.hbm.entity.projectile.EntityMiniMIRV; import com.hbm.entity.projectile.EntityMiniNuke; import com.hbm.entity.projectile.EntityNightmareBlast; +import com.hbm.entity.projectile.EntityOilSpill; import com.hbm.entity.projectile.EntityPlasmaBeam; import com.hbm.entity.projectile.EntityRainbow; import com.hbm.entity.projectile.EntityRocket; @@ -91,6 +93,7 @@ import com.hbm.render.entity.RenderBlackHole; import com.hbm.render.entity.RenderChopperMine; import com.hbm.render.entity.RenderCloudFleija; import com.hbm.render.entity.RenderEMPBlast; +import com.hbm.render.entity.RenderEmpty; import com.hbm.render.entity.RenderFallout; import com.hbm.render.entity.RenderFireball; import com.hbm.render.entity.RenderFlare; @@ -114,6 +117,7 @@ import com.hbm.render.entity.RenderRubble; import com.hbm.render.entity.RenderShrapnel; import com.hbm.render.entity.RenderSmallNukeAlt; import com.hbm.render.entity.SSmokeRenderer; +import com.hbm.render.entity.SpillRenderer; import com.hbm.render.item.ItemRenderBFLauncher; import com.hbm.render.item.ItemRenderBaleflare; import com.hbm.render.item.ItemRenderBigSword; @@ -157,6 +161,7 @@ import com.hbm.render.tileentity.RenderCrashedBomb; import com.hbm.render.tileentity.RenderCyclotron; import com.hbm.render.tileentity.RenderDecoBlock; import com.hbm.render.tileentity.RenderDecoBlockAlt; +import com.hbm.render.tileentity.RenderDerrick; import com.hbm.render.tileentity.RenderIGenerator; import com.hbm.render.tileentity.RenderLaunchPadTier1; import com.hbm.render.tileentity.RenderNukeBoy; @@ -194,6 +199,7 @@ import com.hbm.tileentity.TileEntityDecoPoleTop; import com.hbm.tileentity.TileEntityDecoSteelPoles; import com.hbm.tileentity.TileEntityDecoTapeRecorder; import com.hbm.tileentity.TileEntityMachineIGenerator; +import com.hbm.tileentity.TileEntityMachineOilWell; import com.hbm.tileentity.TileEntityLaunchPad; import com.hbm.tileentity.TileEntityMachineCentrifuge; import com.hbm.tileentity.TileEntityMachineCyclotron; @@ -248,6 +254,7 @@ public class ClientProxy extends ServerProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePuF6Tank.class, new RenderPuF6Tank()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineIGenerator.class, new RenderIGenerator()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCyclotron.class, new RenderCyclotron()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineOilWell.class, new RenderDerrick()); //RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderRocket()); RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderSnowball(ModItems.man_core)); @@ -410,11 +417,13 @@ public class ClientProxy extends ServerProxy RenderingRegistry.registerEntityRenderingHandler(EntityChopperMine.class, new RenderChopperMine()); RenderingRegistry.registerEntityRenderingHandler(EntityRubble.class, new RenderRubble()); RenderingRegistry.registerEntityRenderingHandler(EntityShrapnel.class, new RenderShrapnel()); + RenderingRegistry.registerEntityRenderingHandler(EntityOilSpill.class, new RenderEmpty()); RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new ModEffectRenderer(ModItems.nuclear_waste)); RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new BSmokeRenderer(ModItems.nuclear_waste)); RenderingRegistry.registerEntityRenderingHandler(EntityDSmokeFX.class, new DSmokeRenderer(ModItems.nuclear_waste)); RenderingRegistry.registerEntityRenderingHandler(EntitySSmokeFX.class, new SSmokeRenderer(ModItems.nuclear_waste)); + RenderingRegistry.registerEntityRenderingHandler(EntityOilSpillFX.class, new SpillRenderer(ModItems.nuclear_waste)); RenderingRegistry.registerEntityRenderingHandler(EntityCombineBall.class, new RenderSnowball(ModItems.energy_ball)); RenderingRegistry.registerEntityRenderingHandler(EntityDischarge.class, new ElectricityRenderer(ModItems.discharge)); RenderingRegistry.registerEntityRenderingHandler(EntityEMPBlast.class, new RenderEMPBlast()); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 410f75be0..f5727111b 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -891,6 +891,8 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_steel, 2), new Object[] { "dustIron", "dustCoal" })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { "dustSteel", "dustTungsten" })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { "dustSteel", ModItems.powder_cobalt })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { "dustIron", "dustCoal", "dustTungsten", "dustTungsten" })); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { "dustIron", "dustCoal", ModItems.powder_cobalt, ModItems.powder_cobalt })); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_polymer, 2), new Object[] { "dustCoal", "dustSalpeter" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.saw, 1), new Object[] { "IIL", "PP ", 'P', "plateSteel", 'I', "ingotSteel", 'L', Items.leather })); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index dde922701..80cb55845 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -81,6 +81,7 @@ import com.hbm.entity.mob.EntityHunterChopper; import com.hbm.entity.mob.EntityNuclearCreeper; import com.hbm.entity.particle.EntityBSmokeFX; import com.hbm.entity.particle.EntityDSmokeFX; +import com.hbm.entity.particle.EntityOilSpillFX; import com.hbm.entity.particle.EntitySSmokeFX; import com.hbm.entity.particle.EntitySmokeFX; import com.hbm.entity.projectile.EntityBaleflare; @@ -95,6 +96,7 @@ import com.hbm.entity.projectile.EntityMinerBeam; import com.hbm.entity.projectile.EntityMiniMIRV; import com.hbm.entity.projectile.EntityMiniNuke; import com.hbm.entity.projectile.EntityNightmareBlast; +import com.hbm.entity.projectile.EntityOilSpill; import com.hbm.entity.projectile.EntityPlasmaBeam; import com.hbm.entity.projectile.EntityRainbow; import com.hbm.entity.projectile.EntityRocket; @@ -127,6 +129,7 @@ import com.hbm.tileentity.TileEntityFWatzCore; import com.hbm.tileentity.TileEntityFusionMultiblock; import com.hbm.tileentity.TileEntityHatch; import com.hbm.tileentity.TileEntityMachineIGenerator; +import com.hbm.tileentity.TileEntityMachineOilWell; import com.hbm.tileentity.TileEntityLaunchPad; import com.hbm.tileentity.TileEntityMachineBattery; import com.hbm.tileentity.TileEntityMachineCMBFactory; @@ -189,7 +192,7 @@ public class MainRegistry //Tool Materials public static ToolMaterial enumToolMaterialSchrabidium = EnumHelper.addToolMaterial("SCHRABIDIUM", 3, 10000, 50.0F, 100.0F, 200); public static ToolMaterial enumToolMaterialHammer = EnumHelper.addToolMaterial("SCHRABIDIUMHAMMER", 3, 0, 50.0F, 999999996F, 200); - public static ToolMaterial enumToolMaterialChainsaw = EnumHelper.addToolMaterial("CHAINSAW", 3, 5000, 50.0F, 47.0F, 0); + public static ToolMaterial enumToolMaterialChainsaw = EnumHelper.addToolMaterial("CHAINSAW", 3, 1500, 50.0F, 22.0F, 0); public static ToolMaterial enumToolMaterialSteel = EnumHelper.addToolMaterial("STEEL", 2, 500, 7.5F, 2.0F, 10); public static ToolMaterial enumToolMaterialTitanium = EnumHelper.addToolMaterial("TITANIUM", 3, 750, 9.0F, 2.5F, 15); public static ToolMaterial enumToolMaterialAlloy= EnumHelper.addToolMaterial("ALLOY", 3, 2000, 15.0F, 5.0F, 5); @@ -379,6 +382,7 @@ public class MainRegistry GameRegistry.registerTileEntity(TileEntityMachineIGenerator.class, "tileentity_igenerator"); GameRegistry.registerTileEntity(TileEntityDummy.class, "tileentity_dummy"); GameRegistry.registerTileEntity(TileEntityMachineCyclotron.class, "tileentity_cyclotron"); + GameRegistry.registerTileEntity(TileEntityMachineOilWell.class, "tileentity_derrick"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true); @@ -452,6 +456,8 @@ public class MainRegistry EntityRegistry.registerModEntity(EntityGrenadeShrapnel.class, "entity_grenade_shrapnel", 69, this, 250, 1, true); EntityRegistry.registerModEntity(EntityBlackHole.class, "entity_black_hole", 70, this, 250, 1, true); EntityRegistry.registerModEntity(EntityGrenadeBlackHole.class, "entity_grenade_black_hole", 71, this, 250, 1, true); + EntityRegistry.registerModEntity(EntityOilSpillFX.class, "entity_spill_fx", 72, this, 1000, 1, true); + EntityRegistry.registerModEntity(EntityOilSpill.class, "entity_oil_spill", 73, this, 1000, 1, true); EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00); EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0x000020, 0x2D2D72); diff --git a/com/hbm/render/entity/RenderEmpty.java b/com/hbm/render/entity/RenderEmpty.java new file mode 100644 index 000000000..6fcf27124 --- /dev/null +++ b/com/hbm/render/entity/RenderEmpty.java @@ -0,0 +1,51 @@ +package com.hbm.render.entity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import com.hbm.entity.particle.EntityBSmokeFX; +import com.hbm.entity.particle.EntitySmokeFX; +import com.hbm.items.ModItems; +import com.hbm.lib.RefStrings; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class RenderEmpty extends Render { + + public RenderEmpty() {} + + public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, + float p_76986_9_) { + } + + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return null; + } +} diff --git a/com/hbm/render/entity/SpillRenderer.java b/com/hbm/render/entity/SpillRenderer.java new file mode 100644 index 000000000..ddc875385 --- /dev/null +++ b/com/hbm/render/entity/SpillRenderer.java @@ -0,0 +1,147 @@ +package com.hbm.render.entity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import com.hbm.entity.particle.EntityOilSpillFX; +import com.hbm.entity.particle.EntitySSmokeFX; +import com.hbm.entity.particle.EntitySmokeFX; +import com.hbm.items.ModItems; +import com.hbm.lib.RefStrings; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class SpillRenderer extends Render { + private Item field_94151_a; + private int field_94150_f; + private static final String __OBFID = "CL_00001008"; + + public SpillRenderer(Item p_i1259_1_, int p_i1259_2_) { + this.field_94151_a = p_i1259_1_; + this.field_94150_f = p_i1259_2_; + } + + public SpillRenderer(Item p_i1260_1_) { + this(p_i1260_1_, 0); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, + * always casting down its argument and then handing it off to a worker + * function which does the actual work. In all probabilty, the class Render + * is generic (Render= fx.maxAge / 8 * 7) { + field_94151_a = ModItems.spill8; + } + + if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) { + field_94151_a = ModItems.spill7; + } + + if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) { + field_94151_a = ModItems.spill6; + } + + if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) { + field_94151_a = ModItems.spill5; + } + + if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) { + field_94151_a = ModItems.spill4; + } + + if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) { + field_94151_a = ModItems.spill3; + } + + if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) { + field_94151_a = ModItems.spill2; + } + + if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) { + field_94151_a = ModItems.spill1; + } + + IIcon iicon = field_94151_a.getIconFromDamage(0); + + if (iicon != null) { + GL11.glPushMatrix(); + GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glScalef(7.5F, 7.5F, 7.5F); + // + GL11.glScalef(0.25F, 0.25F, 0.25F); + // + this.bindEntityTexture(p_76986_1_); + Tessellator tessellator = Tessellator.instance; + + this.func_77026_a(tessellator, iicon); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called + * unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return TextureMap.locationItemsTexture; + } + + private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) { + float f = p_77026_2_.getMinU(); + float f1 = p_77026_2_.getMaxU(); + float f2 = p_77026_2_.getMinV(); + float f3 = p_77026_2_.getMaxV(); + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + p_77026_1_.startDrawingQuads(); + p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); + p_77026_1_.addVertexWithUV((double) (0.0F - f5), (double) (0.0F - f6), 0.0D, (double) f, (double) f3); + p_77026_1_.addVertexWithUV((double) (f4 - f5), (double) (0.0F - f6), 0.0D, (double) f1, (double) f3); + p_77026_1_.addVertexWithUV((double) (f4 - f5), (double) (f4 - f6), 0.0D, (double) f1, (double) f2); + p_77026_1_.addVertexWithUV((double) (0.0F - f5), (double) (f4 - f6), 0.0D, (double) f, (double) f2); + p_77026_1_.draw(); + } +} diff --git a/com/hbm/render/tileentity/RenderDerrick.java b/com/hbm/render/tileentity/RenderDerrick.java new file mode 100644 index 000000000..969391e2a --- /dev/null +++ b/com/hbm/render/tileentity/RenderDerrick.java @@ -0,0 +1,40 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; + +public class RenderDerrick extends TileEntitySpecialRenderer { + + private static final ResourceLocation body = new ResourceLocation(RefStrings.MODID, "models/derrick.obj"); + private IModelCustom genModel; + private ResourceLocation genTexture; + + public RenderDerrick() + { + genModel = AdvancedModelLoader.loadModel(body); + genTexture = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png"); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) + { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5D, y, z + 0.5D); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glRotatef(180, 0F, 1F, 0F); + + bindTexture(genTexture); + + genModel.renderAll(); + + GL11.glPopMatrix(); + } +} diff --git a/com/hbm/tileentity/TileEntityConverterRfHe.java b/com/hbm/tileentity/TileEntityConverterRfHe.java index aff5667c3..395290d90 100644 --- a/com/hbm/tileentity/TileEntityConverterRfHe.java +++ b/com/hbm/tileentity/TileEntityConverterRfHe.java @@ -93,106 +93,8 @@ public class TileEntityConverterRfHe extends TileEntity implements ISource, IEne @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -222,4 +124,24 @@ public class TileEntityConverterRfHe extends TileEntity implements ISource, IEne return (storage.getEnergyStored() * i) / storage.getMaxEnergyStored(); } + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } + } diff --git a/com/hbm/tileentity/TileEntityFWatzCore.java b/com/hbm/tileentity/TileEntityFWatzCore.java index 2a0e3a9c7..51db964fa 100644 --- a/com/hbm/tileentity/TileEntityFWatzCore.java +++ b/com/hbm/tileentity/TileEntityFWatzCore.java @@ -404,106 +404,8 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -522,4 +424,24 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, return false; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } } diff --git a/com/hbm/tileentity/TileEntityFusionMultiblock.java b/com/hbm/tileentity/TileEntityFusionMultiblock.java index d788b76a9..1c89b298d 100644 --- a/com/hbm/tileentity/TileEntityFusionMultiblock.java +++ b/com/hbm/tileentity/TileEntityFusionMultiblock.java @@ -1249,106 +1249,8 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -1366,4 +1268,24 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve return false; } + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } + } diff --git a/com/hbm/tileentity/TileEntityMachineBattery.java b/com/hbm/tileentity/TileEntityMachineBattery.java index 432b4f941..a36077b3d 100644 --- a/com/hbm/tileentity/TileEntityMachineBattery.java +++ b/com/hbm/tileentity/TileEntityMachineBattery.java @@ -261,7 +261,10 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); + + Library.ffgeua(x, y, z, newTact, this, worldObj); + + /*Block block = this.worldObj.getBlock(x, y, z); TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) @@ -360,7 +363,7 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent } } list.clear(); - } + }*/ } @Override @@ -387,4 +390,24 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent return maxPower; } + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } + } diff --git a/com/hbm/tileentity/TileEntityMachineCoal.java b/com/hbm/tileentity/TileEntityMachineCoal.java index dc229532f..327b493e7 100644 --- a/com/hbm/tileentity/TileEntityMachineCoal.java +++ b/com/hbm/tileentity/TileEntityMachineCoal.java @@ -367,106 +367,8 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -487,4 +389,24 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory return false; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } } diff --git a/com/hbm/tileentity/TileEntityMachineCyclotron.java b/com/hbm/tileentity/TileEntityMachineCyclotron.java index bdc10d9ef..34599b283 100644 --- a/com/hbm/tileentity/TileEntityMachineCyclotron.java +++ b/com/hbm/tileentity/TileEntityMachineCyclotron.java @@ -556,90 +556,8 @@ public class TileEntityMachineCyclotron extends TileEntity implements ISidedInve @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if (block == ModBlocks.factory_titanium_conductor - && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if (block == ModBlocks.factory_titanium_conductor - && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if (block == ModBlocks.factory_advanced_conductor - && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if (block == ModBlocks.factory_advanced_conductor - && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - - if (tileentity instanceof IConductor) { - if (tileentity instanceof TileEntityCable) { - if (Library.checkUnionList(((TileEntityCable) tileentity).uoteab, this)) { - for (int i = 0; i < ((TileEntityCable) tileentity).uoteab.size(); i++) { - if (((TileEntityCable) tileentity).uoteab.get(i).source == this) { - if (((TileEntityCable) tileentity).uoteab.get(i).ticked != newTact) { - ((TileEntityCable) tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if (tileentity instanceof TileEntityWireCoated) { - if (Library.checkUnionList(((TileEntityWireCoated) tileentity).uoteab, this)) { - for (int i = 0; i < ((TileEntityWireCoated) tileentity).uoteab.size(); i++) { - if (((TileEntityWireCoated) tileentity).uoteab.get(i).source == this) { - if (((TileEntityWireCoated) tileentity).uoteab.get(i).ticked != newTact) { - ((TileEntityWireCoated) tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if (tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery - && ((TileEntityMachineBattery) tileentity).conducts)) { - list.add((IConsumer) tileentity); - } - - if (!newTact) { - int size = list.size(); - if (size > 0) { - int part = this.power / size; - for (IConsumer consume : list) { - if (consume.getPower() < consume.getMaxPower()) { - if (consume.getMaxPower() - consume.getPower() >= part) { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -669,4 +587,24 @@ public class TileEntityMachineCyclotron extends TileEntity implements ISidedInve { return 65536.0D; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } } diff --git a/com/hbm/tileentity/TileEntityMachineDiesel.java b/com/hbm/tileentity/TileEntityMachineDiesel.java index 48986c5a3..fd04803bb 100644 --- a/com/hbm/tileentity/TileEntityMachineDiesel.java +++ b/com/hbm/tileentity/TileEntityMachineDiesel.java @@ -333,90 +333,8 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if (block == ModBlocks.factory_titanium_conductor - && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if (block == ModBlocks.factory_titanium_conductor - && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if (block == ModBlocks.factory_advanced_conductor - && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if (block == ModBlocks.factory_advanced_conductor - && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - - if (tileentity instanceof IConductor) { - if (tileentity instanceof TileEntityCable) { - if (Library.checkUnionList(((TileEntityCable) tileentity).uoteab, this)) { - for (int i = 0; i < ((TileEntityCable) tileentity).uoteab.size(); i++) { - if (((TileEntityCable) tileentity).uoteab.get(i).source == this) { - if (((TileEntityCable) tileentity).uoteab.get(i).ticked != newTact) { - ((TileEntityCable) tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if (tileentity instanceof TileEntityWireCoated) { - if (Library.checkUnionList(((TileEntityWireCoated) tileentity).uoteab, this)) { - for (int i = 0; i < ((TileEntityWireCoated) tileentity).uoteab.size(); i++) { - if (((TileEntityWireCoated) tileentity).uoteab.get(i).source == this) { - if (((TileEntityWireCoated) tileentity).uoteab.get(i).ticked != newTact) { - ((TileEntityWireCoated) tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if (tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery - && ((TileEntityMachineBattery) tileentity).conducts)) { - list.add((IConsumer) tileentity); - } - - if (!newTact) { - int size = list.size(); - if (size > 0) { - int part = this.power / size; - for (IConsumer consume : list) { - if (consume.getPower() < consume.getMaxPower()) { - if (consume.getMaxPower() - consume.getPower() >= part) { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -436,4 +354,24 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento return false; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } } diff --git a/com/hbm/tileentity/TileEntityMachineGenerator.java b/com/hbm/tileentity/TileEntityMachineGenerator.java index c69e1e7a3..d04f78da1 100644 --- a/com/hbm/tileentity/TileEntityMachineGenerator.java +++ b/com/hbm/tileentity/TileEntityMachineGenerator.java @@ -612,106 +612,8 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -732,4 +634,24 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve return false; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } } \ No newline at end of file diff --git a/com/hbm/tileentity/TileEntityMachineIGenerator.java b/com/hbm/tileentity/TileEntityMachineIGenerator.java index 39ba3c067..34b0674ba 100644 --- a/com/hbm/tileentity/TileEntityMachineIGenerator.java +++ b/com/hbm/tileentity/TileEntityMachineIGenerator.java @@ -530,90 +530,8 @@ public class TileEntityMachineIGenerator extends TileEntity implements ISidedInv @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if (block == ModBlocks.factory_titanium_conductor - && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if (block == ModBlocks.factory_titanium_conductor - && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if (block == ModBlocks.factory_advanced_conductor - && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if (block == ModBlocks.factory_advanced_conductor - && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - - if (tileentity instanceof IConductor) { - if (tileentity instanceof TileEntityCable) { - if (Library.checkUnionList(((TileEntityCable) tileentity).uoteab, this)) { - for (int i = 0; i < ((TileEntityCable) tileentity).uoteab.size(); i++) { - if (((TileEntityCable) tileentity).uoteab.get(i).source == this) { - if (((TileEntityCable) tileentity).uoteab.get(i).ticked != newTact) { - ((TileEntityCable) tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if (tileentity instanceof TileEntityWireCoated) { - if (Library.checkUnionList(((TileEntityWireCoated) tileentity).uoteab, this)) { - for (int i = 0; i < ((TileEntityWireCoated) tileentity).uoteab.size(); i++) { - if (((TileEntityWireCoated) tileentity).uoteab.get(i).source == this) { - if (((TileEntityWireCoated) tileentity).uoteab.get(i).ticked != newTact) { - ((TileEntityWireCoated) tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if (tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery - && ((TileEntityMachineBattery) tileentity).conducts)) { - list.add((IConsumer) tileentity); - } - - if (!newTact) { - int size = list.size(); - if (size > 0) { - int part = this.power / size; - for (IConsumer consume : list) { - if (consume.getPower() < consume.getMaxPower()) { - if (consume.getMaxPower() - consume.getPower() >= part) { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -657,4 +575,24 @@ public class TileEntityMachineIGenerator extends TileEntity implements ISidedInv return 65536.0D; } + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } + } diff --git a/com/hbm/tileentity/TileEntityMachineOilWell.java b/com/hbm/tileentity/TileEntityMachineOilWell.java new file mode 100644 index 000000000..cafec7ff8 --- /dev/null +++ b/com/hbm/tileentity/TileEntityMachineOilWell.java @@ -0,0 +1,398 @@ +package com.hbm.tileentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.machine.MachineElectricFurnace; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.interfaces.IConsumer; +import com.hbm.items.ModItems; +import com.hbm.items.special.ItemBattery; +import com.hbm.lib.Library; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityMachineOilWell extends TileEntity implements ISidedInventory, IConsumer { + + private ItemStack slots[]; + + public int oil; + public int power; + public int warning; + public static final int maxPower = 100000; + public static final int maxOil = 640; + + private static final int[] slots_top = new int[] {1}; + private static final int[] slots_bottom = new int[] {2, 0}; + private static final int[] slots_side = new int[] {0}; + Random rand = new Random(); + int age = 0; + + private String customName; + + public TileEntityMachineOilWell() { + slots = new ItemStack[3]; + } + + @Override + public int getSizeInventory() { + return slots.length; + } + + @Override + public ItemStack getStackInSlot(int i) { + return slots[i]; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + if(slots[i] != null) + { + ItemStack itemStack = slots[i]; + slots[i] = null; + return itemStack; + } else { + return null; + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemStack) { + slots[i] = itemStack; + if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return this.hasCustomInventoryName() ? this.customName : "container.oilWell"; + } + + @Override + public boolean hasCustomInventoryName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String name) { + this.customName = name; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) + { + return false; + }else{ + return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64; + } + } + + //You scrubs aren't needed for anything (right now) + @Override + public void openInventory() {} + @Override + public void closeInventory() {} + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemStack) { + if(i == 0) + if(itemStack.getItem() instanceof ItemBattery) + return true; + + if(i == 1) + return true; + + return false; + } + + @Override + public ItemStack decrStackSize(int i, int j) { + if(slots[i] != null) + { + if(slots[i].stackSize <= j) + { + ItemStack itemStack = slots[i]; + slots[i] = null; + return itemStack; + } + ItemStack itemStack1 = slots[i].splitStack(j); + if (slots[i].stackSize == 0) + { + slots[i] = null; + } + + return itemStack1; + } else { + return null; + } + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList list = nbt.getTagList("items", 10); + + this.power = nbt.getInteger("powerTime"); + this.oil = nbt.getInteger("oil"); + slots = new ItemStack[getSizeInventory()]; + + for(int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound nbt1 = list.getCompoundTagAt(i); + byte b0 = nbt1.getByte("slot"); + if(b0 >= 0 && b0 < slots.length) + { + slots[b0] = ItemStack.loadItemStackFromNBT(nbt1); + } + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setInteger("powerTime", power); + nbt.setInteger("oil", oil); + NBTTagList list = new NBTTagList(); + + for(int i = 0; i < slots.length; i++) + { + if(slots[i] != null) + { + NBTTagCompound nbt1 = new NBTTagCompound(); + nbt1.setByte("slot", (byte)i); + slots[i].writeToNBT(nbt1); + list.appendTag(nbt1); + } + } + nbt.setTag("items", list); + } + + @Override + public int[] getAccessibleSlotsFromSide(int p_94128_1_) + { + return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side); + } + + @Override + public boolean canInsertItem(int i, ItemStack itemStack, int j) { + return this.isItemValidForSlot(i, itemStack); + } + + @Override + public boolean canExtractItem(int i, ItemStack itemStack, int j) { + return false; + } + + public int getOilScaled(int i) { + return (oil * i) / maxOil; + } + + public int getPowerScaled(int i) { + return (power * i) / maxPower; + } + + @Override + public void updateEntity() { + + int timer = 50; + + age++; + if(age >= timer) + age -= timer; + + if(!worldObj.isRemote) { + + if(slots[1] != null && slots[1].getItem() == ModItems.canister_empty && oil >= 10) { + if(slots[2] == null) { + oil -= 10; + slots[2] = new ItemStack(ModItems.canister_oil); + slots[1].stackSize--; + if(slots[1].stackSize <= 0) + slots[1]= null; + } else if(slots[2] != null && slots[2].getItem() == ModItems.canister_oil && slots[2].stackSize < slots[2].getMaxStackSize()) { + oil -= 10; + slots[2].stackSize++; + slots[1].stackSize--; + if(slots[1].stackSize <= 0) + slots[1]= null; + } + } + + power = Library.chargeTEFromItems(slots, 0, power, maxPower); + + if(power >= 10) { + + //operation start + + if(age % timer == 0) { + warning = 0; + + //warning 0, green: derrick is operational + //warning 1, red: derrick is full, has no power or the drill is jammed + //warning 2, yellow: drill has reached max depth + + for(int i = this.yCoord - 1; i > this.yCoord - 1 - 100; i--) { + + if(i <= 5) { + //Code 2: The drilling ended + warning = 2; + break; + } + + Block b = worldObj.getBlock(this.xCoord, i, this.zCoord); + if(b == ModBlocks.oil_pipe) + continue; + + if(b == Blocks.air || b == Blocks.grass || b == Blocks.dirt || + b == Blocks.stone || b == Blocks.sand || b == Blocks.sandstone) { + worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe); + + //Code 2: The drilling ended + if(i == this.yCoord - 100) + warning = 2; + break; + + } else if((b == ModBlocks.ore_oil || b == ModBlocks.ore_oil_empty) && this.oil < this.maxOil) { + if(succ(this.xCoord, i, this.zCoord)) { + oil += 5; + if(oil > maxOil) + oil = maxOil; + + ExplosionLarge.spawnOilSpills(worldObj, xCoord + 0.5F, yCoord + 5.5F, zCoord + 0.5F, 3); + + break; + } else { + worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe); + break; + } + + } else { + //Code 1: Drill jammed + warning = 1; + break; + } + } + } + + //operation end + + power -= 10; + } else { + warning = 1; + } + } + + } + + public boolean succ(int x, int y, int z) { + + list.clear(); + + succ1(x, y, z); + succ2(x, y, z); + + if(!list.isEmpty()) { + + int i = rand.nextInt(list.size()); + int a = list.get(i)[0]; + int b = list.get(i)[1]; + int c = list.get(i)[2]; + + if(worldObj.getBlock(a, b, c) == ModBlocks.ore_oil) { + + worldObj.setBlock(a, b, c, ModBlocks.ore_oil_empty); + return true; + } + } + + return false; + } + + public void succInit1(int x, int y, int z) { + succ1(x + 1, y, z); + succ1(x - 1, y, z); + succ1(x, y + 1, z); + succ1(x, y - 1, z); + succ1(x, y, z + 1); + succ1(x, y, z - 1); + } + + public void succInit2(int x, int y, int z) { + succ2(x + 1, y, z); + succ2(x - 1, y, z); + succ2(x, y + 1, z); + succ2(x, y - 1, z); + succ2(x, y, z + 1); + succ2(x, y, z - 1); + } + + List list = new ArrayList(); + + public void succ1(int x, int y, int z) { + if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil_empty && + worldObj.getBlockMetadata(x, y, z) == 0) { + worldObj.setBlockMetadataWithNotify(x, y, z, 1, 2); + succInit1(x, y, z); + } + } + + public void succ2(int x, int y, int z) { + if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil_empty && + worldObj.getBlockMetadata(x, y, z) == 1) { + worldObj.setBlockMetadataWithNotify(x, y, z, 0, 2); + succInit2(x, y, z); + } else if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil) { + list.add(new int[] { x, y, z }); + } + } + + @Override + public void setPower(int i) { + power = i; + + } + + @Override + public int getPower() { + return power; + + } + + @Override + public int getMaxPower() { + return maxPower; + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return TileEntity.INFINITE_EXTENT_AABB; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() + { + return 65536.0D; + } + +} diff --git a/com/hbm/tileentity/TileEntityMachineRTG.java b/com/hbm/tileentity/TileEntityMachineRTG.java index be3efd9d4..572f0cb60 100644 --- a/com/hbm/tileentity/TileEntityMachineRTG.java +++ b/com/hbm/tileentity/TileEntityMachineRTG.java @@ -248,106 +248,8 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory, @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -368,4 +270,24 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory, return false; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } } diff --git a/com/hbm/tileentity/TileEntityReactorMultiblock.java b/com/hbm/tileentity/TileEntityReactorMultiblock.java index 33a5e041b..064f8b727 100644 --- a/com/hbm/tileentity/TileEntityReactorMultiblock.java +++ b/com/hbm/tileentity/TileEntityReactorMultiblock.java @@ -761,106 +761,8 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -877,4 +779,24 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv return false; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } } diff --git a/com/hbm/tileentity/TileEntityWatzCore.java b/com/hbm/tileentity/TileEntityWatzCore.java index 78e60cc18..5fbc1ed55 100644 --- a/com/hbm/tileentity/TileEntityWatzCore.java +++ b/com/hbm/tileentity/TileEntityWatzCore.java @@ -682,106 +682,8 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I @Override public void ffgeua(int x, int y, int z, boolean newTact) { - Block block = this.worldObj.getBlock(x, y, z); - TileEntity tileentity = this.worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y + 1, z); - } - if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) - { - tileentity = this.worldObj.getTileEntity(x, y - 1, z); - } - if(tileentity instanceof IConductor) - { - if(tileentity instanceof TileEntityCable) - { - if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++) - { - if(((TileEntityCable)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - if(tileentity instanceof TileEntityWireCoated) - { - if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this)) - { - for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this) - { - if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact; - ffgeua(x, y + 1, z, getTact()); - ffgeua(x, y - 1, z, getTact()); - ffgeua(x - 1, y, z, getTact()); - ffgeua(x + 1, y, z, getTact()); - ffgeua(x, y, z - 1, getTact()); - ffgeua(x, y, z + 1, getTact()); - } - } - } - } else { - ((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact)); - } - } - } - - if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts)) - { - list.add((IConsumer)tileentity); - } - - if(!newTact) - { - int size = list.size(); - if(size > 0) - { - int part = this.power / size; - for(IConsumer consume : list) - { - if(consume.getPower() < consume.getMaxPower()) - { - if(consume.getMaxPower() - consume.getPower() >= part) - { - this.power -= part; - consume.setPower(consume.getPower() + part); - } else { - this.power -= consume.getMaxPower() - consume.getPower(); - consume.setPower(consume.getMaxPower()); - } - } - } - } - list.clear(); - } + Library.ffgeua(x, y, z, newTact, this, worldObj); } @Override @@ -798,4 +700,24 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I return false; } + + @Override + public int getSPower() { + return power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return list; + } + + @Override + public void clearList() { + this.list.clear(); + } }