diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 1cc0f3aab..6fe6bfbed 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -156,6 +156,12 @@ container.cyclotron=Zyklotron tile.machine_well.name=Ölbohrturm tile.oil_pipe.name=Rohölrohr container.oilWell=Ölbohrturm +tile.machine_refinery.name=Ölraffinerie +container.machineRefinery=Ölraffinerie +tile.oil_duct.name=Ölrohr +tile.oil_duct_solid.name=Verstärktes Ölrohr +tile.machine_flare.name=Abfackelturm +container.gasFlare=Abfackelturm tile.rail_highspeed.name=Hochgeschwindigkeitsschienen tile.rail_booster.name=Hochgeschwindigkeits-Boosterschienen @@ -490,6 +496,7 @@ item.inf_antischrabidium.name=Unendlicher Antischrabidiumtank item.oil_canola.name=Rohes Canola-Öl item.canister_empty.name=Leerer Kanister +item.canister_smear.name=Industrieölkanister item.canister_canola.name=Schmiermittelkanister item.canister_oil.name=Rohölkanister item.canister_fuel.name=Treibstoffkanister diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 2c1fedad2..b95c216a2 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -154,8 +154,14 @@ 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 +tile.oil_pipe.name=Crude Oil Extraction Pipe container.oilWell=Oil Derrick +tile.machine_refinery.name=Oil Refinery +container.machineRefinery=Oil Refinery +tile.oil_duct.name=Oil Pipe +tile.oil_duct_solid.name=Coated Oil Pipe +tile.machine_flare.name=Gas Flare +container.gasFlare=Gas Flare tile.rail_highspeed.name=High Speed Rail tile.rail_booster.name=High Speed Booster Rail @@ -490,6 +496,7 @@ item.inf_antischrabidium.name=Infinite Antischrabidium Tank item.oil_canola.name=Raw Canola Oil item.canister_empty.name=Empty Canister +item.canister_smear.name=Industrial Oil Canister item.canister_canola.name=Engine Lubricant item.canister_oil.name=Crude Oil Canister item.canister_fuel.name=Fuel Canister diff --git a/assets/hbm/models/oilFlare.obj b/assets/hbm/models/oilFlare.obj new file mode 100644 index 000000000..bee555c2e --- /dev/null +++ b/assets/hbm/models/oilFlare.obj @@ -0,0 +1,1188 @@ +# Blender v2.76 (sub 0) OBJ File: 'oilFlare.blend' +# www.blender.org +o Plane +v -1.000000 10.000000 1.000000 +v 1.000000 10.000000 1.000000 +v -1.000000 10.000000 -1.000000 +v 1.000000 10.000000 -1.000000 +v 0.785714 10.000000 0.785714 +v 1.000000 10.000000 0.785714 +v 0.785714 10.000000 1.000000 +v -0.785714 10.000000 0.785714 +v -0.785714 10.000000 1.000000 +v -1.000000 10.000000 0.785714 +v -0.785714 10.000000 -0.785714 +v -1.000000 10.000000 -0.785714 +v -0.785714 10.000000 -1.000000 +v 0.785714 10.000000 -0.785714 +v 0.785714 10.000000 -1.000000 +v 1.000000 10.000000 -0.785714 +v -1.000000 -0.000000 0.785714 +v -1.000000 -0.000000 1.000000 +v 0.785714 -0.000001 -1.000000 +v 0.785714 -0.000001 -0.785714 +v 0.785714 -0.000001 0.785714 +v 1.000000 -0.000001 0.785714 +v -0.785714 -0.000000 -1.000000 +v -1.000000 -0.000000 -1.000000 +v 1.000000 -0.000001 -1.000000 +v 1.000000 -0.000001 -0.785714 +v -0.785714 -0.000000 0.785714 +v -0.785714 -0.000000 1.000000 +v -0.785714 -0.000000 -0.785714 +v -1.000000 -0.000000 -0.785714 +v 1.000000 -0.000001 1.000000 +v 0.785714 -0.000001 1.000000 +v 0.785714 2.499999 -0.785714 +v 1.000000 2.499999 -0.785714 +v 0.785714 2.499999 -1.000000 +v 0.785714 5.000000 -0.785714 +v 0.785714 5.000000 -1.000000 +v 1.000000 5.000000 -0.785714 +v 1.000000 2.499999 0.785714 +v 0.785714 2.499999 0.785714 +v 0.785714 2.499999 1.000000 +v 0.785714 7.500000 -1.000000 +v 1.000000 7.500000 -0.785714 +v 0.785714 7.500000 1.000000 +v 0.785714 7.500000 0.785714 +v 0.785714 7.500000 -0.785714 +v 1.000000 7.500000 0.785714 +v 0.785714 5.000000 1.000000 +v 1.000000 5.000000 0.785714 +v 0.785714 5.000000 0.785714 +v -1.000000 5.000000 -0.785714 +v -0.785714 5.000000 -0.785714 +v -0.785714 5.000000 -1.000000 +v -0.785714 7.500000 -0.785714 +v -1.000000 7.500000 -0.785714 +v -0.785714 7.500000 -1.000000 +v -1.000000 2.500000 -0.785714 +v -0.785714 2.500000 -1.000000 +v -0.785714 2.500000 -0.785714 +v -0.785714 5.000000 0.785714 +v -1.000000 5.000000 0.785714 +v -0.785714 5.000000 1.000000 +v -0.785714 2.500000 0.785714 +v -0.785714 2.500000 1.000000 +v -1.000000 2.500000 0.785714 +v -1.000000 2.500000 -1.000000 +v -1.000000 5.000000 -1.000000 +v -1.000000 7.500000 -1.000000 +v -1.000000 7.500000 0.785714 +v -0.785714 7.500000 0.785714 +v -0.785714 7.500000 1.000000 +v 1.000000 7.500000 1.000000 +v 1.000000 5.000000 1.000000 +v 1.000000 2.500000 1.000000 +v -1.000000 2.500000 1.000000 +v -1.000000 5.000000 1.000000 +v -1.000000 7.500000 1.000000 +v 1.000000 2.499999 -1.000000 +v 1.000000 5.000000 -1.000000 +v 1.000000 7.499999 -1.000000 +v 1.500000 5.000000 -1.500000 +v 1.500000 5.000000 1.500000 +v -1.500000 5.000000 1.500000 +v -1.500000 5.000000 -1.500000 +v 1.500000 10.000000 -1.500000 +v 1.500000 10.000000 1.500000 +v -1.500000 10.000000 1.500000 +v -1.500000 10.000000 -1.500000 +v 0.530330 2.000000 -0.530330 +v -0.000000 2.000000 -0.750000 +v 0.000000 2.000000 -0.250000 +v 0.000000 10.000000 -0.250000 +v 0.176777 2.000000 -0.176777 +v 0.176777 10.000000 -0.176777 +v 0.250000 2.000000 0.000000 +v 0.250000 10.000000 0.000000 +v 0.176777 2.000000 0.176777 +v 0.176777 10.000000 0.176777 +v -0.000000 2.000000 0.250000 +v -0.000000 10.000000 0.250000 +v -0.176777 2.000000 0.176777 +v -0.176777 10.000000 0.176777 +v -0.250000 2.000000 -0.000000 +v -0.250000 10.000000 -0.000000 +v -0.176777 2.000000 -0.176777 +v -0.176777 10.000000 -0.176777 +v 0.750000 2.000000 0.000000 +v 0.530330 2.000000 0.530330 +v -0.000000 2.000000 0.750000 +v -0.530330 2.000000 0.530330 +v -0.750000 2.000000 -0.000000 +v -0.530330 2.000000 -0.530330 +v -0.530330 0.000000 -0.530330 +v -0.000000 0.000000 -0.750000 +v -0.750000 0.000000 -0.000000 +v -0.530330 0.000000 0.530330 +v -0.000000 0.000000 0.750000 +v 0.530330 0.000000 0.530330 +v 0.750000 0.000000 0.000000 +v 0.530330 0.000000 -0.530330 +v -0.785714 5.000000 -0.000000 +v 0.000000 5.000000 -0.785714 +v 0.785714 5.000000 -0.000000 +v 0.000000 5.000000 0.785714 +v 0.000000 5.000000 -0.250000 +v 0.176777 5.000000 -0.176777 +v 0.250000 5.000000 0.000000 +v 0.176777 5.000000 0.176777 +v -0.000000 5.000000 0.250000 +v -0.176777 5.000000 0.176777 +v -0.250000 5.000000 -0.000000 +v -0.176777 5.000000 -0.176777 +v 0.176776 10.250000 -0.176777 +v -0.000000 10.250000 -0.250000 +v 0.250000 10.250000 0.000000 +v 0.176776 10.250000 0.176777 +v -0.000000 10.250000 0.250000 +v -0.176777 10.250000 0.176777 +v -0.250000 10.250000 -0.000000 +v -0.176777 10.250000 -0.176777 +v 0.353553 10.250000 -0.353553 +v -0.000000 10.250000 -0.500000 +v 0.500000 10.250000 0.000000 +v 0.353553 10.250000 0.353553 +v -0.000000 10.250000 0.500000 +v -0.353554 10.250000 0.353553 +v -0.500000 10.250000 -0.000000 +v -0.353554 10.250000 -0.353553 +v 0.353553 11.500000 -0.353553 +v -0.000000 11.500000 -0.500000 +v 0.500000 11.500000 0.000000 +v 0.353553 11.500000 0.353553 +v -0.000000 11.500000 0.500000 +v -0.353554 11.500000 0.353553 +v -0.500000 11.500000 -0.000000 +v -0.353554 11.500000 -0.353553 +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.353553 10.500002 -0.353553 +v -0.000000 10.500002 -0.500000 +v 0.500000 10.500002 0.000000 +v 0.353553 10.500002 0.353553 +v -0.000000 10.500002 0.500000 +v -0.353554 10.500002 0.353553 +v -0.500000 10.500002 -0.000000 +v -0.353554 10.500002 -0.353553 +v 0.785714 10.000000 -0.000000 +v 0.000000 10.000000 -0.785714 +v 0.000000 10.000000 0.785714 +v -0.785714 10.000000 -0.000000 +vt 0.042703 0.061626 +vt 0.042703 0.046860 +vt 0.056160 0.046860 +vt 0.042703 0.184682 +vt 0.042703 0.169915 +vt 0.056160 0.169915 +vt 0.154843 0.184682 +vt 0.154843 0.169915 +vt 0.168299 0.169915 +vt 0.154843 0.061626 +vt 0.154843 0.046860 +vt 0.168299 0.046860 +vt 0.736438 0.957560 +vt 0.736438 0.972327 +vt 0.722982 0.972327 +vt 0.700374 0.957560 +vt 0.700374 0.972327 +vt 0.686918 0.972327 +vt 0.844631 0.957493 +vt 0.844631 0.972259 +vt 0.831174 0.972259 +vt 0.808567 0.957493 +vt 0.808567 0.972259 +vt 0.795110 0.972259 +vt 0.916664 0.184682 +vt 0.903255 0.184682 +vt 0.903255 0.012404 +vt 0.903255 0.356960 +vt 0.363627 0.184682 +vt 0.363627 0.012404 +vt 0.377036 0.012404 +vt 0.614789 0.188153 +vt 0.614789 0.015968 +vt 0.628246 0.015968 +vt 0.332701 0.184682 +vt 0.319293 0.184682 +vt 0.310975 0.012404 +vt 0.222306 0.012404 +vt 0.235715 0.012404 +vt 0.244033 0.184682 +vt 0.772503 0.184606 +vt 0.772503 0.356807 +vt 0.759046 0.356807 +vt 0.772503 0.529009 +vt 0.244033 0.356960 +vt 0.244033 0.529238 +vt 0.230624 0.529238 +vt 0.244033 0.701516 +vt 0.772503 0.701210 +vt 0.759046 0.701210 +vt 0.235715 0.356960 +vt 0.222306 0.356960 +vt 0.235715 0.184682 +vt 0.230624 0.356960 +vt 0.324383 0.356960 +vt 0.332701 0.529238 +vt 0.319293 0.529238 +vt 0.324383 0.529238 +vt 0.332701 0.701516 +vt 0.319293 0.701516 +vt 0.324383 0.701516 +vt 0.310975 0.701516 +vt 0.614789 0.532523 +vt 0.614789 0.360338 +vt 0.628246 0.360338 +vt 0.363627 0.529238 +vt 0.363627 0.356960 +vt 0.377036 0.356960 +vt 0.363627 0.701516 +vt 0.377036 0.529238 +vt 0.614789 0.704707 +vt 0.628246 0.532523 +vt 0.628246 0.188153 +vt 0.377036 0.184682 +vt 0.903255 0.529238 +vt 0.916664 0.356960 +vt 0.916664 0.529238 +vt 0.916664 0.701516 +vt 0.903255 0.701516 +vt 0.578725 0.188153 +vt 0.578725 0.015968 +vt 0.592182 0.015968 +vt 0.592182 0.188153 +vt 0.592182 0.360338 +vt 0.578725 0.360338 +vt 0.592182 0.532522 +vt 0.578725 0.532522 +vt 0.578725 0.704707 +vt 0.288367 0.701516 +vt 0.274958 0.701516 +vt 0.274958 0.529238 +vt 0.274958 0.356960 +vt 0.288367 0.356960 +vt 0.274958 0.184682 +vt 0.274958 0.012404 +vt 0.288367 0.012404 +vt 0.288367 0.184682 +vt 0.650853 0.187832 +vt 0.650853 0.012404 +vt 0.664310 0.012404 +vt 0.650853 0.360034 +vt 0.650853 0.184606 +vt 0.664310 0.184606 +vt 0.664310 0.532235 +vt 0.650853 0.532235 +vt 0.650853 0.356807 +vt 0.650853 0.529009 +vt 0.664310 0.529009 +vt 0.664310 0.704437 +vt 0.614789 0.012404 +vt 0.628246 0.012404 +vt 0.664310 0.187832 +vt 0.664310 0.356807 +vt 0.650853 0.015631 +vt 0.592182 0.701143 +vt 0.578725 0.701143 +vt 0.772503 0.353581 +vt 0.759046 0.529009 +vt 0.759046 0.181379 +vt 0.772503 0.181379 +vt 0.592182 0.184589 +vt 0.578725 0.012404 +vt 0.592182 0.012404 +vt 0.578725 0.184589 +vt 0.578725 0.356773 +vt 0.592182 0.356773 +vt 0.772503 0.697984 +vt 0.759046 0.697984 +vt 0.368718 0.701516 +vt 0.355309 0.701516 +vt 0.368718 0.529238 +vt 0.377036 0.701516 +vt 0.266640 0.356960 +vt 0.280049 0.356960 +vt 0.266640 0.012404 +vt 0.355309 0.012404 +vt 0.368718 0.356960 +vt 0.355309 0.356960 +vt 0.759046 0.184606 +vt 0.759046 0.012404 +vt 0.772503 0.012404 +vt 0.244033 0.012404 +vt 0.230624 0.184682 +vt 0.319293 0.012404 +vt 0.332701 0.012404 +vt 0.664310 0.701210 +vt 0.650853 0.701210 +vt 0.332701 0.356960 +vt 0.319293 0.356960 +vt 0.056160 0.115771 +vt 0.105501 0.061626 +vt 0.056160 0.061626 +vt 0.154843 0.115771 +vt 0.168299 0.061626 +vt 0.056160 0.184682 +vt 0.105501 0.169915 +vt 0.011304 0.870083 +vt 0.024760 0.870083 +vt 0.024760 0.978372 +vt 0.449164 0.987494 +vt 0.435707 0.987494 +vt 0.435707 0.879205 +vt 0.489263 0.879307 +vt 0.502720 0.879307 +vt 0.502720 0.987596 +vt 0.211936 0.978313 +vt 0.198479 0.978313 +vt 0.198479 0.870024 +vt 0.168299 0.401457 +vt 0.154843 0.347313 +vt 0.168299 0.293168 +vt 0.042703 0.293168 +vt 0.056160 0.293168 +vt 0.056160 0.347313 +vt 0.105501 0.401457 +vt 0.154843 0.416224 +vt 0.056160 0.416224 +vt 0.105501 0.293168 +vt 0.056160 0.278401 +vt 0.399643 0.879205 +vt 0.413100 0.879205 +vt 0.413100 0.987494 +vt 0.880695 0.967710 +vt 0.867239 0.967710 +vt 0.867239 0.859421 +vt 0.867239 0.726324 +vt 0.880695 0.726324 +vt 0.880695 0.834613 +vt 0.053536 0.870083 +vt 0.066992 0.870083 +vt 0.066992 0.978372 +vt 0.939271 0.184682 +vt 0.939271 0.012404 +vt 0.952680 0.012404 +vt 0.795110 0.528958 +vt 0.808567 0.528958 +vt 0.808567 0.701143 +vt 0.952680 0.529238 +vt 0.952680 0.701516 +vt 0.939271 0.701516 +vt 0.952680 0.356960 +vt 0.939271 0.529238 +vt 0.939271 0.356960 +vt 0.952680 0.184682 +vt 0.795110 0.012404 +vt 0.808567 0.012404 +vt 0.808567 0.184589 +vt 0.808567 0.356773 +vt 0.795110 0.356773 +vt 0.795110 0.184589 +vt 0.736439 0.184606 +vt 0.722982 0.184606 +vt 0.722982 0.012404 +vt 0.736439 0.356807 +vt 0.722982 0.356807 +vt 0.736439 0.529009 +vt 0.722982 0.701210 +vt 0.722982 0.529009 +vt 0.700374 0.529009 +vt 0.700374 0.701210 +vt 0.686918 0.701210 +vt 0.686918 0.356807 +vt 0.700374 0.356807 +vt 0.700374 0.184606 +vt 0.686918 0.184606 +vt 0.686918 0.012404 +vt 0.988696 0.012404 +vt 0.988696 0.184682 +vt 0.975287 0.184682 +vt 0.988696 0.356960 +vt 0.975287 0.356960 +vt 0.988696 0.529238 +vt 0.975287 0.529238 +vt 0.988696 0.701516 +vt 0.831174 0.012404 +vt 0.844631 0.012404 +vt 0.844631 0.184589 +vt 0.831174 0.184589 +vt 0.844631 0.356773 +vt 0.831174 0.356773 +vt 0.844631 0.528958 +vt 0.844631 0.701143 +vt 0.831174 0.701143 +vt 0.831174 0.528958 +vt 0.867239 0.701516 +vt 0.867239 0.529238 +vt 0.880647 0.529238 +vt 0.880647 0.356960 +vt 0.880648 0.184682 +vt 0.867239 0.356960 +vt 0.880648 0.012404 +vt 0.867239 0.184682 +vt 0.000000 0.000000 +vt 0.011304 0.450679 +vt 0.011304 0.243946 +vt 0.199698 0.243946 +vt 0.168299 0.278401 +vt 0.199698 0.450679 +vt 0.199698 0.219138 +vt 0.011304 0.219138 +vt 0.199698 0.012404 +vt 0.011304 0.012404 +vt 0.138024 0.702173 +vt 0.126008 0.734006 +vt 0.100519 0.706035 +vt 0.410744 0.012404 +vt 0.421846 0.012554 +vt 0.421846 0.219196 +vt 0.138024 0.670341 +vt 0.126008 0.638508 +vt 0.162056 0.638508 +vt 0.489263 0.012404 +vt 0.499937 0.012404 +vt 0.499937 0.219138 +vt 0.158537 0.679664 +vt 0.187546 0.666479 +vt 0.187546 0.706035 +vt 0.511386 0.012404 +vt 0.511387 0.219138 +vt 0.129528 0.692850 +vt 0.100519 0.666479 +vt 0.455554 0.580780 +vt 0.455554 0.374158 +vt 0.466656 0.373992 +vt 0.129528 0.679664 +vt 0.444453 0.580614 +vt 0.444453 0.373992 +vt 0.150040 0.702173 +vt 0.162056 0.734006 +vt 0.100519 0.613700 +vt 0.100519 0.475938 +vt 0.133822 0.475487 +vt 0.545443 0.580921 +vt 0.545443 0.374188 +vt 0.556117 0.374188 +vt 0.499937 0.563694 +vt 0.499937 0.580921 +vt 0.489263 0.580921 +vt 0.533994 0.580921 +vt 0.533994 0.374188 +vt 0.399643 0.012554 +vt 0.410744 0.219046 +vt 0.150040 0.670341 +vt 0.158537 0.692850 +vt 0.271164 0.726324 +vt 0.332701 0.754295 +vt 0.307212 0.821823 +vt 0.555633 0.605729 +vt 0.555634 0.743552 +vt 0.523611 0.743552 +vt 0.466014 0.605628 +vt 0.466014 0.743450 +vt 0.433991 0.743450 +vt 0.523611 0.605729 +vt 0.489263 0.743552 +vt 0.011304 0.613733 +vt 0.011304 0.475986 +vt 0.044607 0.475487 +vt 0.433991 0.605628 +vt 0.399643 0.743450 +vt 0.133822 0.613249 +vt 0.167126 0.475938 +vt 0.044607 0.613235 +vt 0.077911 0.475986 +vt 0.533994 0.029632 +vt 0.545443 0.029632 +vt 0.444453 0.029623 +vt 0.455554 0.029789 +vt 0.511387 0.563694 +vt 0.489263 0.563694 +vt 0.489263 0.219138 +vt 0.421846 0.563599 +vt 0.410744 0.563449 +vt 0.399643 0.563599 +vt 0.399643 0.219196 +vt 0.056160 0.401457 +vt 0.094400 0.359494 +vt 0.105501 0.364540 +vt 0.116602 0.359494 +vt 0.154843 0.401457 +vt 0.121201 0.347313 +vt 0.116602 0.335131 +vt 0.105501 0.330085 +vt 0.094400 0.335131 +vt 0.089802 0.347313 +vt 0.268675 0.894380 +vt 0.262667 0.910296 +vt 0.245674 0.891649 +vt 0.444453 0.012404 +vt 0.455554 0.012570 +vt 0.421846 0.580819 +vt 0.410744 0.580669 +vt 0.545443 0.012404 +vt 0.556117 0.012404 +vt 0.466656 0.012404 +vt 0.399643 0.580819 +vt 0.511387 0.580921 +vt 0.533994 0.012404 +vt 0.489263 0.854499 +vt 0.489263 0.768360 +vt 0.512162 0.768360 +vt 0.280691 0.894380 +vt 0.289188 0.885056 +vt 0.303692 0.891649 +vt 0.280691 0.862547 +vt 0.286699 0.846631 +vt 0.303692 0.865278 +vt 0.260179 0.871871 +vt 0.245674 0.865278 +vt 0.262668 0.846631 +vt 0.260179 0.885056 +vt 0.286699 0.910296 +vt 0.289188 0.871871 +vt 0.268675 0.862547 +vt 0.116602 0.103589 +vt 0.144924 0.759146 +vt 0.144924 0.845239 +vt 0.122721 0.844907 +vt 0.189734 0.758814 +vt 0.189734 0.844915 +vt 0.167531 0.845216 +vt 0.512162 0.854499 +vt 0.533510 0.768360 +vt 0.122721 0.758814 +vt 0.100519 0.845239 +vt 0.422542 0.854397 +vt 0.422542 0.768258 +vt 0.443890 0.768258 +vt 0.399643 0.854397 +vt 0.399643 0.768258 +vt 0.211936 0.759115 +vt 0.211936 0.845216 +vt 0.752887 0.726018 +vt 0.772503 0.726018 +vt 0.772503 0.932752 +vt 0.265229 0.935104 +vt 0.265229 0.956639 +vt 0.245674 0.956639 +vt 0.374923 0.933058 +vt 0.355309 0.933058 +vt 0.355309 0.726324 +vt 0.307391 0.935104 +vt 0.307391 0.956639 +vt 0.287836 0.956639 +vt 0.011304 0.638542 +vt 0.030928 0.638541 +vt 0.030928 0.845275 +vt 0.814735 0.932685 +vt 0.795110 0.932685 +vt 0.795110 0.725951 +vt 0.525327 0.879307 +vt 0.544943 0.879307 +vt 0.544943 0.900842 +vt 0.578725 0.729515 +vt 0.598349 0.729515 +vt 0.598349 0.935513 +vt 0.525327 0.925650 +vt 0.544941 0.925650 +vt 0.544941 0.947185 +vt 0.620957 0.729515 +vt 0.640581 0.729515 +vt 0.640581 0.935513 +vt 0.686918 0.932752 +vt 0.686918 0.726018 +vt 0.706542 0.726018 +vt 0.073160 0.638541 +vt 0.073160 0.845275 +vt 0.053536 0.845275 +vt 0.117512 0.933712 +vt 0.100519 0.888694 +vt 0.158537 0.915065 +vt 0.094400 0.103589 +vt 0.089802 0.115771 +vt 0.094400 0.127953 +vt 0.105501 0.132999 +vt 0.116602 0.127953 +vt 0.121201 0.115771 +vt 0.168299 0.184682 +vt 0.722982 0.957560 +vt 0.686918 0.957560 +vt 0.831174 0.957493 +vt 0.795110 0.957493 +vt 0.916664 0.012404 +vt 0.324383 0.012404 +vt 0.230624 0.701516 +vt 0.222306 0.184682 +vt 0.310975 0.356960 +vt 0.310975 0.529238 +vt 0.628246 0.704707 +vt 0.592182 0.704707 +vt 0.288367 0.529238 +vt 0.664310 0.360034 +vt 0.650853 0.704437 +vt 0.664310 0.015631 +vt 0.759046 0.353581 +vt 0.355309 0.529238 +vt 0.280049 0.012404 +vt 0.368718 0.012404 +vt 0.230624 0.012404 +vt 0.011304 0.978372 +vt 0.449164 0.879205 +vt 0.489263 0.987596 +vt 0.211936 0.870024 +vt 0.154843 0.293168 +vt 0.042703 0.401457 +vt 0.154843 0.278401 +vt 0.399643 0.987494 +vt 0.880695 0.859421 +vt 0.867239 0.834613 +vt 0.053536 0.978372 +vt 0.795110 0.701143 +vt 0.736439 0.012404 +vt 0.736439 0.701210 +vt 0.686918 0.529009 +vt 0.700374 0.012404 +vt 0.975287 0.012404 +vt 0.975287 0.701516 +vt 0.880647 0.701516 +vt 0.867239 0.012404 +vt 0.042703 0.278401 +vt 0.042703 0.416224 +vt 0.168299 0.416224 +vt 0.466656 0.580614 +vt 0.556117 0.580921 +vt 0.271164 0.821823 +vt 0.245674 0.793852 +vt 0.245674 0.754295 +vt 0.307212 0.726324 +vt 0.332701 0.793852 +vt 0.489263 0.605729 +vt 0.399643 0.605628 +vt 0.167126 0.613700 +vt 0.077911 0.613733 +vt 0.556117 0.029632 +vt 0.466656 0.029623 +vt 0.105501 0.098543 +vt 0.167531 0.759115 +vt 0.533510 0.854499 +vt 0.100519 0.759146 +vt 0.443890 0.854397 +vt 0.752887 0.932752 +vt 0.245674 0.935104 +vt 0.374923 0.726324 +vt 0.287836 0.935104 +vt 0.011304 0.845275 +vt 0.814735 0.725951 +vt 0.525327 0.900842 +vt 0.578725 0.935513 +vt 0.525327 0.947185 +vt 0.620957 0.935513 +vt 0.706542 0.932752 +vt 0.053536 0.638542 +vt 0.141544 0.870047 +vt 0.158537 0.888694 +vt 0.141544 0.933712 +vt 0.100519 0.915065 +vt 0.117512 0.870047 +vn 0.000000 1.000000 0.000000 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 1.000000 +vn 1.000000 0.000000 0.000000 +vn 0.000000 0.532200 0.846600 +vn 0.000000 0.532200 -0.846600 +vn -1.000000 0.000000 0.000000 +vn 0.000000 -0.532200 -0.846600 +vn 0.000000 -0.532200 0.846600 +vn -0.846600 0.532200 0.000000 +vn 0.846600 0.532200 0.000000 +vn -0.846600 -0.532200 0.000000 +vn 0.846600 -0.532200 0.000000 +vn -0.998200 -0.059600 0.000000 +vn -0.923900 0.000000 0.382700 +vn -0.382700 0.000000 0.923900 +vn 0.382700 0.000000 0.923900 +vn 0.923900 0.000000 0.382700 +vn 0.923900 0.000000 -0.382700 +vn -0.923900 0.000000 -0.382700 +vn 0.382700 0.000000 -0.923900 +vn -0.382700 0.000000 -0.923900 +s off +f 7/1/1 2/2/1 6/3/1 +f 1/4/1 9/5/1 8/6/1 +f 12/7/1 11/8/1 13/9/1 +f 14/10/1 16/11/1 4/12/1 +f 25/13/2 26/14/2 20/15/2 +f 27/16/2 28/17/2 18/18/2 +f 23/19/2 29/20/2 30/21/2 +f 22/22/2 31/23/2 32/24/2 +f 56/25/3 68/26/3 3/27/3 +f 67/28/3 68/26/3 56/25/3 +f 57/29/4 30/30/4 29/31/4 +f 59/32/5 29/33/5 23/34/5 +f 34/35/6 33/36/6 21/37/6 +f 26/38/7 20/39/7 40/40/7 +f 41/41/8 48/42/8 50/43/8 +f 50/43/8 48/42/8 44/44/8 +f 50/45/3 45/46/3 47/47/3 +f 47/47/3 45/46/3 5/48/3 +f 44/44/8 7/49/8 5/50/8 +f 40/40/9 36/51/9 38/52/9 +f 33/53/7 50/45/7 49/54/7 +f 49/55/6 43/56/6 46/57/6 +f 47/58/6 16/59/6 14/60/6 +f 36/51/7 45/46/7 47/47/7 +f 43/56/10 6/61/10 5/62/10 +f 54/63/5 52/64/5 53/65/5 +f 55/66/4 51/67/4 52/68/4 +f 12/69/4 55/66/4 54/70/4 +f 11/71/5 54/63/5 56/72/5 +f 52/64/5 59/32/5 58/73/5 +f 51/67/4 57/29/4 59/74/4 +f 66/75/3 67/28/3 53/76/3 +f 58/77/3 23/78/3 24/79/3 +f 64/80/5 28/81/5 27/82/5 +f 63/83/5 60/84/5 62/85/5 +f 60/84/5 70/86/5 71/87/5 +f 9/88/5 71/87/5 70/86/5 +f 10/89/3 8/90/3 70/91/3 +f 70/91/3 60/92/3 61/93/3 +f 61/93/3 60/92/3 63/94/3 +f 27/95/3 17/96/3 65/97/3 +f 54/98/11 14/99/11 15/100/11 +f 52/101/11 46/102/11 42/103/11 +f 58/104/11 59/105/11 36/106/11 +f 33/107/11 35/108/11 23/109/11 +f 20/110/12 19/111/12 58/73/12 +f 35/108/13 33/107/13 52/101/13 +f 56/112/13 37/113/13 36/106/13 +f 42/103/13 46/102/13 11/114/13 +f 70/86/14 5/115/14 7/116/14 +f 62/117/11 44/44/11 45/118/11 +f 63/119/11 64/120/11 48/42/11 +f 28/81/14 27/82/14 40/121/14 +f 32/122/12 21/123/12 63/83/12 +f 41/124/12 40/121/12 60/84/12 +f 71/87/12 48/125/12 50/126/12 +f 9/127/13 8/128/13 45/118/13 +f 54/70/10 8/129/10 10/130/10 +f 70/131/6 11/132/6 12/69/6 +f 70/91/7 52/133/7 51/134/7 +f 65/97/9 51/134/9 52/133/9 +f 65/97/7 63/94/7 29/135/7 +f 59/74/6 57/29/6 17/136/6 +f 59/74/10 60/137/10 61/138/10 +f 60/137/6 54/70/6 55/66/6 +f 40/40/3 50/45/3 49/54/3 +f 40/139/8 21/140/8 32/141/8 +f 21/142/3 40/40/3 39/143/3 +f 33/36/4 20/144/4 26/145/4 +f 19/146/8 20/147/8 33/107/8 +f 38/148/4 36/149/4 33/36/4 +f 35/108/8 33/107/8 36/106/8 +f 38/148/4 43/56/4 46/57/4 +f 37/113/8 36/106/8 46/102/8 +f 16/59/4 14/60/4 46/57/4 +f 42/103/8 46/102/8 14/99/8 +f 7/1/1 183/150/1 9/5/1 +f 181/151/1 5/152/1 6/3/1 +f 13/9/1 182/153/1 15/154/1 +f 10/155/1 184/156/1 12/7/1 +f 64/157/2 63/158/2 40/159/2 +f 39/160/2 40/161/2 33/162/2 +f 59/163/1 57/164/1 65/165/1 +f 35/166/2 33/167/2 59/168/2 +f 53/169/1 122/170/1 37/171/1 +f 48/172/1 50/173/1 124/174/1 +f 121/175/1 51/176/1 61/177/1 +f 123/178/1 50/173/1 49/179/1 +f 55/180/2 54/181/2 70/182/2 +f 45/183/2 44/184/2 71/185/2 +f 46/186/1 42/187/1 56/188/1 +f 46/189/2 43/190/2 47/191/2 +f 72/192/4 2/193/4 7/194/4 +f 72/195/5 47/196/5 6/197/5 +f 41/198/4 32/199/4 31/200/4 +f 48/201/4 41/198/4 74/202/4 +f 73/203/4 72/192/4 44/204/4 +f 31/205/5 22/206/5 39/207/5 +f 49/208/5 73/209/5 74/210/5 +f 47/196/5 72/195/5 73/209/5 +f 68/211/8 55/212/8 12/213/8 +f 55/212/8 68/211/8 67/214/8 +f 51/215/8 67/214/8 66/216/8 +f 30/217/8 57/218/8 66/216/8 +f 65/219/8 17/220/8 18/221/8 +f 76/222/8 61/223/8 65/219/8 +f 69/224/8 61/223/8 76/222/8 +f 69/224/8 77/225/8 1/226/8 +f 28/227/4 64/228/4 75/229/4 +f 62/230/4 76/231/4 75/229/4 +f 71/232/4 77/233/4 76/231/4 +f 77/233/4 71/232/4 9/234/4 +f 4/235/5 16/236/5 43/237/5 +f 80/238/5 43/237/5 38/239/5 +f 79/240/5 38/239/5 34/241/5 +f 26/242/5 25/243/5 78/244/5 +f 19/245/3 35/246/3 78/247/3 +f 79/248/3 78/247/3 35/246/3 +f 80/249/3 79/248/3 37/250/3 +f 4/251/3 80/249/3 42/252/3 +f 38/253/15 49/253/15 73/253/15 +f 48/172/1 83/254/1 82/255/1 +f 82/255/1 81/256/1 79/257/1 +f 53/169/1 37/171/1 84/258/1 +f 51/176/1 83/254/1 61/177/1 +f 88/259/1 87/260/1 10/155/1 +f 85/261/1 88/259/1 13/9/1 +f 86/262/1 85/261/1 16/11/1 +f 87/260/1 86/262/1 7/1/1 +f 97/263/1 108/264/1 107/265/1 +f 103/266/16 101/267/16 130/268/16 +f 91/269/1 90/270/1 112/271/1 +f 101/272/17 99/273/17 129/274/17 +f 103/275/1 111/276/1 110/277/1 +f 97/278/18 128/279/18 129/274/18 +f 95/280/1 107/265/1 89/281/1 +f 95/282/19 127/283/19 128/284/19 +f 93/285/1 89/281/1 90/270/1 +f 93/286/20 126/287/20 127/283/20 +f 99/288/1 109/289/1 108/264/1 +f 112/290/21 113/291/21 115/292/21 +f 91/293/22 125/294/22 126/295/22 +f 100/296/17 137/297/17 138/298/17 +f 91/293/23 105/299/23 132/300/23 +f 105/301/21 103/266/21 131/302/21 +f 105/303/1 112/271/1 111/276/1 +f 101/304/1 110/277/1 109/289/1 +f 118/305/2 116/306/2 113/307/2 +f 110/308/17 116/309/17 117/310/17 +f 89/311/22 120/312/22 114/313/22 +f 109/314/18 117/310/18 118/315/18 +f 108/316/19 118/317/19 119/318/19 +f 90/319/23 114/313/23 113/320/23 +f 111/321/16 115/292/16 116/322/16 +f 107/323/20 119/318/20 120/324/20 +f 106/325/23 92/326/23 125/294/23 +f 126/295/22 125/294/22 92/326/22 +f 127/283/20 126/287/20 94/327/20 +f 128/284/19 127/283/19 96/328/19 +f 129/274/18 128/279/18 98/329/18 +f 100/296/17 102/330/17 130/331/17 +f 102/332/16 104/333/16 131/302/16 +f 104/333/21 106/334/21 132/335/21 +f 121/175/1 60/336/1 130/337/1 +f 121/175/1 131/338/1 132/339/1 +f 122/170/1 52/340/1 132/339/1 +f 122/170/1 125/341/1 126/342/1 +f 126/342/1 127/343/1 123/178/1 +f 123/178/1 127/343/1 128/344/1 +f 128/344/1 129/345/1 124/174/1 +f 124/174/1 129/345/1 130/337/1 +f 139/346/2 147/347/2 148/348/2 +f 94/327/20 133/349/20 135/350/20 +f 102/332/16 138/351/16 139/352/16 +f 92/326/22 134/353/22 133/354/22 +f 96/328/19 135/350/19 136/355/19 +f 104/333/21 139/352/21 140/356/21 +f 98/329/18 136/357/18 137/297/18 +f 106/325/23 140/358/23 134/353/23 +f 144/359/18 152/360/18 153/361/18 +f 138/362/2 137/363/2 145/364/2 +f 135/365/2 143/366/2 144/367/2 +f 134/368/2 142/369/2 141/370/2 +f 140/371/2 148/348/2 142/369/2 +f 138/362/2 146/372/2 147/347/2 +f 137/363/2 136/373/2 144/367/2 +f 135/365/2 133/374/2 141/370/2 +f 181/151/1 14/10/1 94/375/1 +f 141/376/20 149/377/20 151/378/20 +f 147/379/21 155/380/21 156/381/21 +f 145/382/17 153/361/17 154/383/17 +f 143/384/19 151/378/19 152/385/19 +f 142/386/22 150/387/22 149/388/22 +f 148/389/23 156/390/23 150/387/23 +f 146/391/16 154/392/16 155/380/16 +f 160/393/8 159/394/8 157/395/8 +f 164/396/3 163/397/3 159/398/3 +f 162/399/5 161/400/5 163/401/5 +f 158/402/4 157/403/4 161/404/4 +f 159/405/2 163/406/2 161/407/2 +f 164/408/1 160/409/1 158/410/1 +f 168/411/8 167/412/8 165/413/8 +f 172/414/3 171/415/3 167/416/3 +f 170/417/5 169/418/5 171/419/5 +f 166/420/4 165/421/4 169/422/4 +f 167/423/2 171/424/2 169/425/2 +f 172/426/1 168/427/1 166/428/1 +f 179/429/1 177/430/1 174/431/1 +f 98/432/1 5/152/1 181/151/1 +f 183/150/1 5/152/1 98/432/1 +f 183/150/1 100/433/1 102/434/1 +f 184/156/1 8/6/1 102/434/1 +f 184/156/1 104/435/1 106/436/1 +f 182/153/1 11/8/1 106/436/1 +f 182/153/1 92/437/1 94/375/1 +f 5/152/1 7/1/1 6/3/1 +f 10/155/1 1/4/1 8/6/1 +f 3/438/1 12/7/1 13/9/1 +f 15/154/1 14/10/1 4/12/1 +f 19/439/2 25/13/2 20/15/2 +f 17/440/2 27/16/2 18/18/2 +f 24/441/2 23/19/2 30/21/2 +f 21/442/2 22/22/2 32/24/2 +f 13/443/3 56/25/3 3/27/3 +f 53/76/3 67/28/3 56/25/3 +f 59/74/4 57/29/4 29/31/4 +f 58/73/5 59/32/5 23/34/5 +f 22/444/6 34/35/6 21/37/6 +f 39/143/7 26/38/7 40/40/7 +f 40/139/8 41/41/8 50/43/8 +f 45/118/8 50/43/8 44/44/8 +f 49/54/3 50/45/3 47/47/3 +f 6/445/3 47/47/3 5/48/3 +f 45/118/8 44/44/8 5/50/8 +f 39/143/9 40/40/9 38/52/9 +f 34/446/7 33/53/7 49/54/7 +f 50/447/6 49/55/6 46/57/6 +f 45/448/6 47/58/6 14/60/6 +f 38/52/7 36/51/7 47/47/7 +f 46/57/10 43/56/10 5/62/10 +f 56/72/5 54/63/5 53/65/5 +f 54/70/4 55/66/4 52/68/4 +f 11/132/4 12/69/4 54/70/4 +f 13/449/5 11/71/5 56/72/5 +f 53/65/5 52/64/5 58/73/5 +f 52/68/4 51/67/4 59/74/4 +f 58/77/3 66/75/3 53/76/3 +f 66/75/3 58/77/3 24/79/3 +f 63/83/5 64/80/5 27/82/5 +f 64/80/5 63/83/5 62/85/5 +f 62/85/5 60/84/5 71/87/5 +f 8/450/5 9/88/5 70/86/5 +f 69/451/3 10/89/3 70/91/3 +f 69/451/3 70/91/3 61/93/3 +f 65/97/3 61/93/3 63/94/3 +f 63/94/3 27/95/3 65/97/3 +f 56/112/11 54/98/11 15/100/11 +f 53/452/11 52/101/11 42/103/11 +f 37/113/11 58/104/11 36/106/11 +f 29/453/11 33/107/11 23/109/11 +f 59/32/12 20/110/12 58/73/12 +f 53/452/13 35/108/13 52/101/13 +f 54/98/13 56/112/13 36/106/13 +f 13/454/13 42/103/13 11/114/13 +f 71/87/14 70/86/14 7/116/14 +f 60/455/11 62/117/11 45/118/11 +f 50/43/11 63/119/11 48/42/11 +f 41/124/14 28/81/14 40/121/14 +f 64/80/12 32/122/12 63/83/12 +f 62/85/12 41/124/12 60/84/12 +f 70/86/12 71/87/12 50/126/12 +f 44/44/13 9/127/13 45/118/13 +f 55/66/10 54/70/10 10/130/10 +f 69/456/6 70/131/6 12/69/6 +f 69/451/7 70/91/7 51/134/7 +f 63/94/9 65/97/9 52/133/9 +f 30/457/7 65/97/7 29/135/7 +f 27/458/6 59/74/6 17/136/6 +f 57/29/10 59/74/10 61/138/10 +f 61/138/6 60/137/6 55/66/6 +f 39/143/3 40/40/3 49/54/3 +f 41/41/8 40/139/8 32/141/8 +f 22/459/3 21/142/3 39/143/3 +f 34/35/4 33/36/4 26/145/4 +f 35/108/8 19/146/8 33/107/8 +f 34/35/4 38/148/4 33/36/4 +f 37/113/8 35/108/8 36/106/8 +f 36/149/4 38/148/4 46/57/4 +f 42/103/8 37/113/8 46/102/8 +f 43/56/4 16/59/4 46/57/4 +f 15/100/8 42/103/8 14/99/8 +f 8/6/1 9/5/1 183/150/1 +f 7/1/1 5/152/1 183/150/1 +f 6/3/1 16/11/1 181/151/1 +f 14/10/1 181/151/1 16/11/1 +f 14/10/1 15/154/1 182/153/1 +f 13/9/1 11/8/1 182/153/1 +f 11/8/1 12/7/1 184/156/1 +f 10/155/1 8/6/1 184/156/1 +f 41/460/2 64/157/2 40/159/2 +f 34/461/2 39/160/2 33/162/2 +f 63/462/1 59/163/1 65/165/1 +f 58/463/2 35/166/2 59/168/2 +f 36/464/1 37/171/1 122/170/1 +f 53/169/1 52/340/1 122/170/1 +f 124/174/1 60/336/1 62/465/1 +f 62/465/1 48/172/1 124/174/1 +f 61/177/1 60/336/1 121/175/1 +f 121/175/1 52/340/1 51/176/1 +f 49/179/1 38/466/1 123/178/1 +f 36/464/1 123/178/1 38/466/1 +f 69/467/2 55/180/2 70/182/2 +f 70/468/2 45/183/2 71/185/2 +f 54/469/1 46/186/1 56/188/1 +f 45/470/2 46/189/2 47/191/2 +f 44/204/4 72/192/4 7/194/4 +f 2/471/5 72/195/5 6/197/5 +f 74/202/4 41/198/4 31/200/4 +f 73/203/4 48/201/4 74/202/4 +f 48/201/4 73/203/4 44/204/4 +f 74/210/5 31/205/5 39/207/5 +f 39/207/5 49/208/5 74/210/5 +f 49/208/5 47/196/5 73/209/5 +f 3/472/8 68/211/8 12/213/8 +f 51/215/8 55/212/8 67/214/8 +f 57/218/8 51/215/8 66/216/8 +f 24/473/8 30/217/8 66/216/8 +f 75/474/8 65/219/8 18/221/8 +f 75/474/8 76/222/8 65/219/8 +f 77/225/8 69/224/8 76/222/8 +f 10/475/8 69/224/8 1/226/8 +f 18/476/4 28/227/4 75/229/4 +f 64/228/4 62/230/4 75/229/4 +f 62/230/4 71/232/4 76/231/4 +f 1/477/4 77/233/4 9/234/4 +f 80/238/5 4/235/5 43/237/5 +f 79/240/5 80/238/5 38/239/5 +f 78/244/5 79/240/5 34/241/5 +f 34/241/5 26/242/5 78/244/5 +f 25/478/3 19/245/3 78/247/3 +f 37/250/3 79/248/3 35/246/3 +f 42/252/3 80/249/3 37/250/3 +f 15/479/3 4/251/3 42/252/3 +f 79/253/8 38/253/8 73/253/8 +f 82/255/1 73/480/1 48/172/1 +f 48/172/1 62/465/1 83/254/1 +f 76/481/1 83/254/1 62/465/1 +f 73/480/1 82/255/1 79/257/1 +f 81/256/1 84/258/1 37/171/1 +f 67/482/1 53/169/1 84/258/1 +f 37/171/1 79/257/1 81/256/1 +f 51/176/1 67/482/1 84/258/1 +f 76/481/1 61/177/1 83/254/1 +f 84/258/1 83/254/1 51/176/1 +f 12/7/1 3/438/1 88/259/1 +f 87/260/1 1/4/1 10/155/1 +f 10/155/1 12/7/1 88/259/1 +f 13/9/1 15/154/1 85/261/1 +f 4/12/1 85/261/1 15/154/1 +f 88/259/1 3/438/1 13/9/1 +f 16/11/1 6/3/1 86/262/1 +f 2/2/1 86/262/1 6/3/1 +f 85/261/1 4/12/1 16/11/1 +f 7/1/1 9/5/1 87/260/1 +f 1/4/1 87/260/1 9/5/1 +f 86/262/1 2/2/1 7/1/1 +f 95/280/1 97/263/1 107/265/1 +f 131/302/16 103/266/16 130/268/16 +f 105/303/1 91/269/1 112/271/1 +f 130/331/17 101/272/17 129/274/17 +f 101/304/1 103/275/1 110/277/1 +f 99/273/18 97/278/18 129/274/18 +f 93/285/1 95/280/1 89/281/1 +f 97/483/19 95/282/19 128/284/19 +f 91/269/1 93/285/1 90/270/1 +f 95/282/20 93/286/20 127/283/20 +f 97/263/1 99/288/1 108/264/1 +f 111/321/21 112/290/21 115/292/21 +f 93/484/22 91/293/22 126/295/22 +f 102/330/17 100/296/17 138/298/17 +f 125/294/23 91/293/23 132/300/23 +f 132/335/21 105/301/21 131/302/21 +f 103/275/1 105/303/1 111/276/1 +f 99/288/1 101/304/1 109/289/1 +f 113/307/2 114/485/2 120/486/2 +f 120/486/2 119/487/2 118/305/2 +f 118/305/2 117/488/2 116/306/2 +f 116/306/2 115/489/2 113/307/2 +f 113/307/2 120/486/2 118/305/2 +f 109/314/17 110/308/17 117/310/17 +f 90/319/22 89/311/22 114/313/22 +f 108/490/18 109/314/18 118/315/18 +f 107/323/19 108/316/19 119/318/19 +f 112/491/23 90/319/23 113/320/23 +f 110/492/16 111/321/16 116/322/16 +f 89/493/20 107/323/20 120/324/20 +f 132/300/23 106/325/23 125/294/23 +f 94/494/22 126/295/22 92/326/22 +f 96/328/20 127/283/20 94/327/20 +f 98/495/19 128/284/19 96/328/19 +f 100/296/18 129/274/18 98/329/18 +f 129/274/17 100/296/17 130/331/17 +f 130/268/16 102/332/16 131/302/16 +f 131/302/21 104/333/21 132/335/21 +f 131/338/1 121/175/1 130/337/1 +f 52/340/1 121/175/1 132/339/1 +f 125/341/1 122/170/1 132/339/1 +f 36/464/1 122/170/1 126/342/1 +f 36/464/1 126/342/1 123/178/1 +f 50/173/1 123/178/1 128/344/1 +f 50/173/1 128/344/1 124/174/1 +f 60/336/1 124/174/1 130/337/1 +f 140/371/2 139/346/2 148/348/2 +f 96/328/20 94/327/20 135/350/20 +f 104/333/16 102/332/16 139/352/16 +f 94/494/22 92/326/22 133/354/22 +f 98/495/19 96/328/19 136/355/19 +f 106/334/21 104/333/21 140/356/21 +f 100/296/18 98/329/18 137/297/18 +f 92/326/23 106/325/23 134/353/23 +f 145/382/18 144/359/18 153/361/18 +f 146/372/2 138/362/2 145/364/2 +f 136/373/2 135/365/2 144/367/2 +f 133/374/2 134/368/2 141/370/2 +f 134/368/2 140/371/2 142/369/2 +f 139/346/2 138/362/2 147/347/2 +f 145/364/2 137/363/2 144/367/2 +f 143/366/2 135/365/2 141/370/2 +f 96/496/1 181/151/1 94/375/1 +f 143/384/20 141/376/20 151/378/20 +f 148/497/21 147/379/21 156/381/21 +f 146/498/17 145/382/17 154/383/17 +f 144/499/19 143/384/19 152/385/19 +f 141/500/22 142/386/22 149/388/22 +f 142/386/23 148/389/23 150/387/23 +f 147/379/16 146/391/16 155/380/16 +f 158/501/8 160/393/8 157/395/8 +f 160/502/3 164/396/3 159/398/3 +f 164/503/5 162/399/5 163/401/5 +f 162/504/4 158/402/4 161/404/4 +f 157/505/2 159/405/2 161/407/2 +f 162/506/1 164/408/1 158/410/1 +f 166/507/8 168/411/8 165/413/8 +f 168/508/3 172/414/3 167/416/3 +f 172/509/5 170/417/5 171/419/5 +f 170/510/4 166/420/4 169/422/4 +f 165/511/2 167/423/2 169/425/2 +f 170/512/1 172/426/1 166/428/1 +f 175/513/1 173/514/1 174/431/1 +f 174/431/1 180/515/1 179/429/1 +f 179/429/1 178/516/1 177/430/1 +f 177/430/1 176/517/1 175/513/1 +f 175/513/1 174/431/1 177/430/1 +f 96/496/1 98/432/1 181/151/1 +f 100/433/1 183/150/1 98/432/1 +f 8/6/1 183/150/1 102/434/1 +f 104/435/1 184/156/1 102/434/1 +f 11/8/1 184/156/1 106/436/1 +f 92/437/1 182/153/1 106/436/1 +f 14/10/1 182/153/1 94/375/1 diff --git a/assets/hbm/textures/blocks/machine_flare.png b/assets/hbm/textures/blocks/machine_flare.png new file mode 100644 index 000000000..881172519 Binary files /dev/null and b/assets/hbm/textures/blocks/machine_flare.png differ diff --git a/assets/hbm/textures/blocks/oil_duct.png b/assets/hbm/textures/blocks/oil_duct.png new file mode 100644 index 000000000..563499fed Binary files /dev/null and b/assets/hbm/textures/blocks/oil_duct.png differ diff --git a/assets/hbm/textures/blocks/oil_duct_icon.png b/assets/hbm/textures/blocks/oil_duct_icon.png new file mode 100644 index 000000000..979a275d5 Binary files /dev/null and b/assets/hbm/textures/blocks/oil_duct_icon.png differ diff --git a/assets/hbm/textures/blocks/oil_duct_solid.png b/assets/hbm/textures/blocks/oil_duct_solid.png new file mode 100644 index 000000000..c26a7b5ec Binary files /dev/null and b/assets/hbm/textures/blocks/oil_duct_solid.png differ diff --git a/assets/hbm/textures/gui/gui_gasFlare.png b/assets/hbm/textures/gui/gui_gasFlare.png new file mode 100644 index 000000000..1733380a0 Binary files /dev/null and b/assets/hbm/textures/gui/gui_gasFlare.png differ diff --git a/assets/hbm/textures/gui/gui_refinery.png b/assets/hbm/textures/gui/gui_refinery.png index 6d7dfc25d..1804a2ef3 100644 Binary files a/assets/hbm/textures/gui/gui_refinery.png and b/assets/hbm/textures/gui/gui_refinery.png differ diff --git a/assets/hbm/textures/gui/gui_well_large.png b/assets/hbm/textures/gui/gui_well_large.png new file mode 100644 index 000000000..1c362694c Binary files /dev/null and b/assets/hbm/textures/gui/gui_well_large.png differ diff --git a/assets/hbm/textures/items/book.png b/assets/hbm/textures/items/book.png new file mode 100644 index 000000000..a4888e1e2 Binary files /dev/null and b/assets/hbm/textures/items/book.png differ diff --git a/assets/hbm/textures/items/canister_smear.png b/assets/hbm/textures/items/canister_smear.png new file mode 100644 index 000000000..dcb31ab64 Binary files /dev/null and b/assets/hbm/textures/items/canister_smear.png differ diff --git a/assets/hbm/textures/items/gas1.png b/assets/hbm/textures/items/gas1.png new file mode 100644 index 000000000..9a18426b1 Binary files /dev/null and b/assets/hbm/textures/items/gas1.png differ diff --git a/assets/hbm/textures/items/gas2.png b/assets/hbm/textures/items/gas2.png new file mode 100644 index 000000000..d54ab3371 Binary files /dev/null and b/assets/hbm/textures/items/gas2.png differ diff --git a/assets/hbm/textures/items/gas3.png b/assets/hbm/textures/items/gas3.png new file mode 100644 index 000000000..f1c4e9995 Binary files /dev/null and b/assets/hbm/textures/items/gas3.png differ diff --git a/assets/hbm/textures/items/gas4.png b/assets/hbm/textures/items/gas4.png new file mode 100644 index 000000000..333eddb59 Binary files /dev/null and b/assets/hbm/textures/items/gas4.png differ diff --git a/assets/hbm/textures/items/gas5.png b/assets/hbm/textures/items/gas5.png new file mode 100644 index 000000000..f328cff0e Binary files /dev/null and b/assets/hbm/textures/items/gas5.png differ diff --git a/assets/hbm/textures/items/gas6.png b/assets/hbm/textures/items/gas6.png new file mode 100644 index 000000000..765c31ce7 Binary files /dev/null and b/assets/hbm/textures/items/gas6.png differ diff --git a/assets/hbm/textures/items/gas7.png b/assets/hbm/textures/items/gas7.png new file mode 100644 index 000000000..ca279b5d9 Binary files /dev/null and b/assets/hbm/textures/items/gas7.png differ diff --git a/assets/hbm/textures/items/gas8.png b/assets/hbm/textures/items/gas8.png new file mode 100644 index 000000000..90a905ed0 Binary files /dev/null and b/assets/hbm/textures/items/gas8.png differ diff --git a/assets/hbm/textures/items/gas_empty.png b/assets/hbm/textures/items/gas_empty.png new file mode 100644 index 000000000..2b97c224a Binary files /dev/null and b/assets/hbm/textures/items/gas_empty.png differ diff --git a/assets/hbm/textures/items/gas_full.png b/assets/hbm/textures/items/gas_full.png new file mode 100644 index 000000000..66fb1fa40 Binary files /dev/null and b/assets/hbm/textures/items/gas_full.png differ diff --git a/assets/hbm/textures/models/oilFlareTexture.png b/assets/hbm/textures/models/oilFlareTexture.png new file mode 100755 index 000000000..ecbe7d293 Binary files /dev/null and b/assets/hbm/textures/models/oilFlareTexture.png differ diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index b9bda600c..6d4e700da 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -49,10 +49,13 @@ import com.hbm.blocks.machine.BlockCable; import com.hbm.blocks.machine.BlockConverterHeRf; import com.hbm.blocks.machine.BlockConverterRfHe; import com.hbm.blocks.machine.BlockHatch; +import com.hbm.blocks.machine.BlockOilDuct; +import com.hbm.blocks.machine.OilDuctSolid; import com.hbm.blocks.machine.BlockReactor; import com.hbm.blocks.machine.BlockSeal; import com.hbm.blocks.machine.DummyBlockCentrifuge; import com.hbm.blocks.machine.DummyBlockCyclotron; +import com.hbm.blocks.machine.DummyBlockFlare; import com.hbm.blocks.machine.DummyBlockIGenerator; import com.hbm.blocks.machine.DummyBlockWell; import com.hbm.blocks.machine.FWatzCore; @@ -71,6 +74,7 @@ import com.hbm.blocks.machine.MachineDeuterium; import com.hbm.blocks.machine.MachineDiFurnace; import com.hbm.blocks.machine.MachineDiesel; import com.hbm.blocks.machine.MachineElectricFurnace; +import com.hbm.blocks.machine.MachineGasFlare; import com.hbm.blocks.machine.MachineGenerator; import com.hbm.blocks.machine.MachineIGenerator; import com.hbm.blocks.machine.MachineNukeFurnace; @@ -78,6 +82,7 @@ import com.hbm.blocks.machine.MachineOilWell; import com.hbm.blocks.machine.MachinePuF6Tank; import com.hbm.blocks.machine.MachineRTG; import com.hbm.blocks.machine.MachineReactor; +import com.hbm.blocks.machine.MachineRefinery; import com.hbm.blocks.machine.MachineReiXMainframe; import com.hbm.blocks.machine.MachineRtgFurnace; import com.hbm.blocks.machine.MachineSchrabidiumTransmutator; @@ -334,6 +339,8 @@ public class ModBlocks { public static Block red_wire_coated; public static Block red_cable; + public static Block oil_duct_solid; + public static Block oil_duct; public static Block bomb_multi_large; public static final int guiID_bomb_multi_large = 18; @@ -423,6 +430,12 @@ public class ModBlocks { public static Block oil_pipe; public static final int guiID_machine_well = 40; + public static Block machine_flare; + public static final int guiID_machine_flare = 44; + + public static Block machine_refinery; + public static final int guiID_machine_refinery = 43; + public static Block launch_pad; public static Block launch_pad_generic; public static Block launch_pad_incendiary; @@ -478,6 +491,8 @@ public class ModBlocks { public static Block dummy_port_cyclotron; public static Block dummy_block_well; public static Block dummy_port_well; + public static Block dummy_block_flare; + public static Block dummy_port_flare; private static void initializeBlock() { @@ -670,6 +685,8 @@ public class ModBlocks { red_wire_coated = new WireCoated(Material.iron).setBlockName("red_wire_coated").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":red_wire_coated"); red_cable = new BlockCable(Material.iron).setBlockName("red_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":red_cable_icon"); + oil_duct_solid = new OilDuctSolid(Material.iron).setBlockName("oil_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":oil_duct_solid"); + oil_duct = new BlockOilDuct(Material.iron).setBlockName("oil_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":oil_duct_icon"); factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull"); factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace"); @@ -745,7 +762,9 @@ public class ModBlocks { 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"); + oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_pipe"); + machine_flare = new MachineGasFlare(Material.iron).setBlockName("machine_flare").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_flare"); + machine_refinery = new MachineRefinery(Material.iron).setBlockName("machine_refinery").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_refinery_side"); machine_schrabidium_transmutator = new MachineSchrabidiumTransmutator(Material.iron).setBlockName("machine_schrabidium_transmutator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock); @@ -781,6 +800,8 @@ public class ModBlocks { 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"); + dummy_block_flare = new DummyBlockFlare(Material.iron).setBlockName("dummy_block_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); + dummy_port_flare = new DummyBlockFlare(Material.iron).setBlockName("dummy_port_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel"); } private static void registerBlock() { @@ -961,6 +982,8 @@ public class ModBlocks { //GameRegistry.registerBlock(machine_rtg_purple, machine_rtg_purple.getUnlocalizedName()); GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName()); GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName()); + GameRegistry.registerBlock(oil_duct, oil_duct.getUnlocalizedName()); + GameRegistry.registerBlock(oil_duct_solid, oil_duct_solid.getUnlocalizedName()); GameRegistry.registerBlock(machine_battery, machine_battery.getUnlocalizedName()); GameRegistry.registerBlock(machine_converter_he_rf, machine_converter_he_rf.getUnlocalizedName()); GameRegistry.registerBlock(machine_converter_rf_he, machine_converter_rf_he.getUnlocalizedName()); @@ -969,6 +992,8 @@ public class ModBlocks { GameRegistry.registerBlock(machine_shredder, machine_shredder.getUnlocalizedName()); GameRegistry.registerBlock(machine_deuterium, machine_deuterium.getUnlocalizedName()); GameRegistry.registerBlock(machine_well, machine_well.getUnlocalizedName()); + GameRegistry.registerBlock(machine_flare, machine_flare.getUnlocalizedName()); + GameRegistry.registerBlock(machine_refinery, machine_refinery.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()); @@ -1067,6 +1092,8 @@ public class ModBlocks { 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()); + GameRegistry.registerBlock(dummy_block_flare, dummy_block_flare.getUnlocalizedName()); + GameRegistry.registerBlock(dummy_port_flare, dummy_port_flare.getUnlocalizedName()); //Other Technical Blocks GameRegistry.registerBlock(oil_pipe, oil_pipe.getUnlocalizedName()); diff --git a/com/hbm/blocks/machine/BlockOilDuct.java b/com/hbm/blocks/machine/BlockOilDuct.java new file mode 100644 index 000000000..e71d2b3eb --- /dev/null +++ b/com/hbm/blocks/machine/BlockOilDuct.java @@ -0,0 +1,75 @@ +package com.hbm.blocks.machine; + +import com.hbm.tileentity.TileEntityOilDuct; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockOilDuct extends BlockContainer { + + public BlockOilDuct(Material p_i45386_1_) { + super(p_i45386_1_); + float p = 1F/16F; + this.setBlockBounds(11 * p / 2, 11 * p / 2, 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2, 1 - 11 * p / 2); + this.useNeighborBrightness = true; + } + + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { + TileEntityOilDuct cable = (TileEntityOilDuct)world.getTileEntity(x, y, z); + + if(cable != null) + { + float p = 1F/16F; + float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0); + float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0); + float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0); + float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0); + float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0); + float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0); + + this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ); + } + return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); + } + + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntityOilDuct cable = (TileEntityOilDuct)world.getTileEntity(x, y, z); + + if(cable != null) + { + float p = 1F/16F; + float minX = 11 * p / 2 - (cable.connections[5] != null ? (11 * p / 2) : 0); + float minY = 11 * p / 2 - (cable.connections[1] != null ? (11 * p / 2) : 0); + float minZ = 11 * p / 2 - (cable.connections[2] != null ? (11 * p / 2) : 0); + float maxX = 1 - 11 * p / 2 + (cable.connections[3] != null ? (11 * p / 2) : 0); + float maxY = 1 - 11 * p / 2 + (cable.connections[0] != null ? (11 * p / 2) : 0); + float maxZ = 1 - 11 * p / 2 + (cable.connections[4] != null ? (11 * p / 2) : 0); + + this.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ); + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityOilDuct(); + } + + @Override + public int getRenderType(){ + return -1; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } +} diff --git a/com/hbm/blocks/machine/DummyBlockFlare.java b/com/hbm/blocks/machine/DummyBlockFlare.java new file mode 100644 index 000000000..79ebbf5f2 --- /dev/null +++ b/com/hbm/blocks/machine/DummyBlockFlare.java @@ -0,0 +1,105 @@ +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.TileEntityMachineCyclotron; +import com.hbm.tileentity.TileEntityMachineGasFlare; + +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 DummyBlockFlare extends BlockContainer implements IDummy { + + public static boolean safeBreak = false; + + public DummyBlockFlare(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_flare); + } + + @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; + + TileEntityMachineGasFlare entity = (TileEntityMachineGasFlare) world.getTileEntity(a, b, c); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_flare, world, a, b, c); + } + } + return true; + } else { + return false; + } + } +} diff --git a/com/hbm/blocks/machine/MachineGasFlare.java b/com/hbm/blocks/machine/MachineGasFlare.java new file mode 100644 index 000000000..935d21070 --- /dev/null +++ b/com/hbm/blocks/machine/MachineGasFlare.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.TileEntityMachineGasFlare; +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 MachineGasFlare extends BlockContainer implements IMultiblock { + + private final Random field_149933_a = new Random(); + private Random rand; + private static boolean keepInventory; + + public MachineGasFlare(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_flare); + } + + @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()) + { + TileEntityMachineGasFlare entity = (TileEntityMachineGasFlare) world.getTileEntity(x, y, z); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_flare, world, x, y, z); + } + return true; + } else { + return false; + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityMachineGasFlare(); + } + + @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) + { + TileEntityMachineGasFlare tileentityfurnace = (TileEntityMachineGasFlare)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.flareDimension)) { + MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.flareDimension, ModBlocks.dummy_block_flare); + + DummyBlockFlare.safeBreak = true; + world.setBlock(x, y, z + 1, ModBlocks.dummy_port_flare); + 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_flare); + 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_flare); + 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_flare); + 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; + } + DummyBlockFlare.safeBreak = false; + + } else + world.func_147480_a(x, y, z, true); + } +} diff --git a/com/hbm/blocks/machine/MachineOilWell.java b/com/hbm/blocks/machine/MachineOilWell.java index 9e2c20f24..22ef880e6 100644 --- a/com/hbm/blocks/machine/MachineOilWell.java +++ b/com/hbm/blocks/machine/MachineOilWell.java @@ -78,7 +78,7 @@ public class MachineOilWell extends BlockContainer implements IMultiblock { return new TileEntityMachineOilWell(); } - /*@Override + @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) @@ -128,7 +128,7 @@ public class MachineOilWell extends BlockContainer implements IMultiblock { } 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) { diff --git a/com/hbm/blocks/machine/MachineRefinery.java b/com/hbm/blocks/machine/MachineRefinery.java new file mode 100644 index 000000000..02ccf434e --- /dev/null +++ b/com/hbm/blocks/machine/MachineRefinery.java @@ -0,0 +1,134 @@ +package com.hbm.blocks.machine; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.lib.RefStrings; +import com.hbm.main.MainRegistry; +import com.hbm.tileentity.TileEntityMachineCMBFactory; +import com.hbm.tileentity.TileEntityMachineDiesel; +import com.hbm.tileentity.TileEntityMachineRefinery; + +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.client.renderer.texture.IIconRegister; +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.util.IIcon; +import net.minecraft.world.World; + +public class MachineRefinery extends BlockContainer { + + private final Random field_149933_a = new Random(); + private Random rand; + private static boolean keepInventory; + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_refinery_top"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_refinery_side"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return Item.getItemFromBlock(ModBlocks.machine_refinery); + } + + public MachineRefinery(Material p_i45386_1_) { + super(p_i45386_1_); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityMachineRefinery(); + } + + @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()) + { + TileEntityMachineRefinery entity = (TileEntityMachineRefinery) world.getTileEntity(x, y, z); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_refinery, world, x, y, z); + } + return true; + } else { + return false; + } + } + + @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) + { + TileEntityMachineRefinery tileentityfurnace = (TileEntityMachineRefinery)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_); + } +} diff --git a/com/hbm/blocks/machine/OilDuctSolid.java b/com/hbm/blocks/machine/OilDuctSolid.java new file mode 100644 index 000000000..fd3cba325 --- /dev/null +++ b/com/hbm/blocks/machine/OilDuctSolid.java @@ -0,0 +1,25 @@ +package com.hbm.blocks.machine; + +import java.util.ArrayList; +import java.util.List; + +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForOil; +import com.hbm.tileentity.TileEntityOilDuctSolid; +import com.hbm.tileentity.TileEntityWireCoated; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class OilDuctSolid extends BlockContainer { + + public OilDuctSolid(Material p_i45386_1_) { + super(p_i45386_1_); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityOilDuctSolid(); + } +} diff --git a/com/hbm/calc/UnionOfTileEntitiesAndBooleansForOil.java b/com/hbm/calc/UnionOfTileEntitiesAndBooleansForOil.java new file mode 100644 index 000000000..9b712f25e --- /dev/null +++ b/com/hbm/calc/UnionOfTileEntitiesAndBooleansForOil.java @@ -0,0 +1,18 @@ +package com.hbm.calc; + +import com.hbm.interfaces.IOilSource; +import com.hbm.interfaces.ISource; + +import net.minecraft.tileentity.TileEntity; + +public class UnionOfTileEntitiesAndBooleansForOil { + + public UnionOfTileEntitiesAndBooleansForOil(IOilSource tileentity, boolean bool) + { + source = tileentity; + ticked = bool; + } + + public IOilSource source; + public boolean ticked = false; +} diff --git a/com/hbm/entity/particle/EntityGasFX.java b/com/hbm/entity/particle/EntityGasFX.java new file mode 100644 index 000000000..c4431895d --- /dev/null +++ b/com/hbm/entity/particle/EntityGasFX.java @@ -0,0 +1,81 @@ +package com.hbm.entity.particle; + +import net.minecraft.world.World; + +public class EntityGasFX extends EntityModFX +{ + float smokeParticleScale; + public int particleAge; + public int maxAge; + private static final String __OBFID = "CL_00000924"; + + public EntityGasFX(World world) { + super(world, 0, 0, 0); + } + + public EntityGasFX(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 EntityGasFX(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.motionY += 0.1D; + this.motionZ *= 0.7599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + if(this.isBurning()) { + this.setDead(); + worldObj.createExplosion(null, posX, posY, posZ, 3F, true); + } + + 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 index b27c9800b..0499d28e8 100644 --- a/com/hbm/entity/projectile/EntityOilSpill.java +++ b/com/hbm/entity/projectile/EntityOilSpill.java @@ -53,13 +53,6 @@ public class EntityOilSpill extends EntityThrowable { @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/handler/GUIHandler.java b/com/hbm/handler/GUIHandler.java index f82ffa4c3..a5c0f535b 100644 --- a/com/hbm/handler/GUIHandler.java +++ b/com/hbm/handler/GUIHandler.java @@ -20,8 +20,10 @@ 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.ContainerMachineGasFlare; import com.hbm.inventory.container.ContainerMachineOilWell; import com.hbm.inventory.container.ContainerMachineRTG; +import com.hbm.inventory.container.ContainerMachineRefinery; import com.hbm.inventory.container.ContainerMachineSchrabidiumTransmutator; import com.hbm.inventory.container.ContainerMachineShredder; import com.hbm.inventory.container.ContainerMachineTeleporter; @@ -59,11 +61,13 @@ import com.hbm.inventory.gui.GUIMachineCyclotron; import com.hbm.inventory.gui.GUIMachineDeuterium; import com.hbm.inventory.gui.GUIMachineDiesel; import com.hbm.inventory.gui.GUIMachineElectricFurnace; +import com.hbm.inventory.gui.GUIMachineGasFlare; 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; +import com.hbm.inventory.gui.GUIMachineRefinery; import com.hbm.inventory.gui.GUIMachineSchrabidiumTransmutator; import com.hbm.inventory.gui.GUIMachineShredder; import com.hbm.inventory.gui.GUIMachineTeleporter; @@ -102,10 +106,12 @@ import com.hbm.tileentity.TileEntityMachineCyclotron; import com.hbm.tileentity.TileEntityMachineDeuterium; import com.hbm.tileentity.TileEntityMachineDiesel; import com.hbm.tileentity.TileEntityMachineElectricFurnace; +import com.hbm.tileentity.TileEntityMachineGasFlare; import com.hbm.tileentity.TileEntityMachineGenerator; import com.hbm.tileentity.TileEntityMachinePuF6Tank; import com.hbm.tileentity.TileEntityMachineRTG; import com.hbm.tileentity.TileEntityMachineReactor; +import com.hbm.tileentity.TileEntityMachineRefinery; import com.hbm.tileentity.TileEntityMachineSchrabidiumTransmutator; import com.hbm.tileentity.TileEntityMachineShredder; import com.hbm.tileentity.TileEntityMachineTeleporter; @@ -466,6 +472,22 @@ public class GUIHandler implements IGuiHandler { return new ContainerMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity); } } + + case ModBlocks.guiID_machine_refinery: + { + if(entity instanceof TileEntityMachineRefinery) + { + return new ContainerMachineRefinery(player.inventory, (TileEntityMachineRefinery) entity); + } + } + + case ModBlocks.guiID_machine_flare: + { + if(entity instanceof TileEntityMachineGasFlare) + { + return new ContainerMachineGasFlare(player.inventory, (TileEntityMachineGasFlare) entity); + } + } } return null; } @@ -806,6 +828,22 @@ public class GUIHandler implements IGuiHandler { return new GUIMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity); } } + + case ModBlocks.guiID_machine_refinery: + { + if(entity instanceof TileEntityMachineRefinery) + { + return new GUIMachineRefinery(player.inventory, (TileEntityMachineRefinery) entity); + } + } + + case ModBlocks.guiID_machine_flare: + { + if(entity instanceof TileEntityMachineGasFlare) + { + return new GUIMachineGasFlare(player.inventory, (TileEntityMachineGasFlare) entity); + } + } } } return null; diff --git a/com/hbm/handler/MultiblockHandler.java b/com/hbm/handler/MultiblockHandler.java index 628a7738a..883060513 100644 --- a/com/hbm/handler/MultiblockHandler.java +++ b/com/hbm/handler/MultiblockHandler.java @@ -47,6 +47,7 @@ public class MultiblockHandler { 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 }; + public static final int[] flareDimension = new int[] { 1, 1, 9, 0, 1, 1 }; //Approved! public static boolean checkSpace(World world, int x, int y, int z, int[] i) { diff --git a/com/hbm/interfaces/IDuct.java b/com/hbm/interfaces/IDuct.java new file mode 100644 index 000000000..bd4196947 --- /dev/null +++ b/com/hbm/interfaces/IDuct.java @@ -0,0 +1,5 @@ +package com.hbm.interfaces; + +public interface IDuct { + +} diff --git a/com/hbm/interfaces/IOilAcceptor.java b/com/hbm/interfaces/IOilAcceptor.java new file mode 100644 index 000000000..b8af2606e --- /dev/null +++ b/com/hbm/interfaces/IOilAcceptor.java @@ -0,0 +1,11 @@ +package com.hbm.interfaces; + +public interface IOilAcceptor { + + void setFill(int i); + + int getFill(); + + int getMaxFill(); + +} diff --git a/com/hbm/interfaces/IOilSource.java b/com/hbm/interfaces/IOilSource.java new file mode 100644 index 000000000..31fd4879a --- /dev/null +++ b/com/hbm/interfaces/IOilSource.java @@ -0,0 +1,17 @@ +package com.hbm.interfaces; + +import java.util.List; + +public interface IOilSource { + + void fillInit(); + + void fill(int x, int y, int z, boolean newTact); + + boolean getTact(); + int getSFill(); + void setSFill(int i); + List getList(); + void clearList(); + +} diff --git a/com/hbm/inventory/container/ContainerIGenerator.java b/com/hbm/inventory/container/ContainerIGenerator.java index b0bbc6fdb..a3571f4a4 100644 --- a/com/hbm/inventory/container/ContainerIGenerator.java +++ b/com/hbm/inventory/container/ContainerIGenerator.java @@ -1,5 +1,6 @@ package com.hbm.inventory.container; +import com.hbm.inventory.SlotMachineOutput; import com.hbm.tileentity.TileEntityMachineIGenerator; import com.hbm.tileentity.TileEntityReiXMainframe; @@ -44,7 +45,7 @@ public class ContainerIGenerator extends Container { //Fluid Slot this.addSlotToContainer(new Slot(tedf, 13, 98, 108)); //Container Slot - this.addSlotToContainer(new Slot(tedf, 14, 98, 72)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 98, 72)); //Battery Slot this.addSlotToContainer(new Slot(tedf, 15, 152, 108)); @@ -85,8 +86,8 @@ public class ContainerIGenerator extends Container { ItemStack var5 = var4.getStack(); var3 = var5.copy(); - if (par2 <= 4) { - if (!this.mergeItemStack(var5, 5, this.inventorySlots.size(), true)) + if (par2 <= 15) { + if (!this.mergeItemStack(var5, 16, this.inventorySlots.size(), true)) { return null; } diff --git a/com/hbm/inventory/container/ContainerMachineGasFlare.java b/com/hbm/inventory/container/ContainerMachineGasFlare.java new file mode 100644 index 000000000..8b7c96617 --- /dev/null +++ b/com/hbm/inventory/container/ContainerMachineGasFlare.java @@ -0,0 +1,124 @@ +package com.hbm.inventory.container; + +import com.hbm.inventory.SlotMachineOutput; +import com.hbm.tileentity.TileEntityMachineGasFlare; +import com.hbm.tileentity.TileEntityMachineRTG; + +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 ContainerMachineGasFlare extends Container { + + private TileEntityMachineGasFlare testNuke; + private int gas; + private int power; + + public ContainerMachineGasFlare(InventoryPlayer invPlayer, TileEntityMachineGasFlare tedf) { + gas = 0; + power = 0; + + testNuke = tedf; + + this.addSlotToContainer(new Slot(tedf, 0, 44, 53)); + this.addSlotToContainer(new Slot(tedf, 1, 134, 17)); + 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.gas); + crafting.sendProgressBarUpdate(this, 1, this.testNuke.power); + } + + @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 <= 1) { + if (!this.mergeItemStack(var5, 3, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(var5, 0, 3, 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.gas != this.testNuke.gas) + { + par1.sendProgressBarUpdate(this, 0, this.testNuke.gas); + } + if(this.power != this.testNuke.power) + { + par1.sendProgressBarUpdate(this, 1, this.testNuke.power); + } + } + + this.gas = this.testNuke.gas; + this.power = this.testNuke.power; + } + + @Override + public void updateProgressBar(int i, int j) { + if(i == 0) + { + testNuke.gas = j; + } + if(i == 1) + { + testNuke.power = j; + } + } +} diff --git a/com/hbm/inventory/container/ContainerMachineOilWell.java b/com/hbm/inventory/container/ContainerMachineOilWell.java index 5285d6d2b..d604b92cc 100644 --- a/com/hbm/inventory/container/ContainerMachineOilWell.java +++ b/com/hbm/inventory/container/ContainerMachineOilWell.java @@ -18,32 +18,42 @@ public class ContainerMachineOilWell extends Container { private int oil; private int power; private int warning; + private int gas; + private int warning2; public ContainerMachineOilWell(InventoryPlayer invPlayer, TileEntityMachineOilWell tedf) { oil = 0; power = 0; warning = 0; + gas = 0; + warning2 = 0; testNuke = tedf; //Battery - this.addSlotToContainer(new Slot(tedf, 0, 44, 53)); + this.addSlotToContainer(new Slot(tedf, 0, 44, 54)); //Canister Input - this.addSlotToContainer(new Slot(tedf, 1, 134, 17)); + this.addSlotToContainer(new Slot(tedf, 1, 134, 18)); //Canister Output - this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 53)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 54)); + //Gas Input + this.addSlotToContainer(new Slot(tedf, 3, 134, 72)); + //Gas Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 134, 108)); + //Chip + this.addSlotToContainer(new Slot(tedf, 5, 8, 90)); 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)); + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56)); } } for(int i = 0; i < 9; i++) { - this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56)); } } @@ -53,6 +63,8 @@ public class ContainerMachineOilWell extends Container { crafting.sendProgressBarUpdate(this, 0, this.testNuke.oil); crafting.sendProgressBarUpdate(this, 1, this.testNuke.power); crafting.sendProgressBarUpdate(this, 2, this.testNuke.warning); + crafting.sendProgressBarUpdate(this, 3, this.testNuke.gas); + crafting.sendProgressBarUpdate(this, 4, this.testNuke.warning2); } @Override @@ -66,14 +78,16 @@ public class ContainerMachineOilWell extends Container { ItemStack var5 = var4.getStack(); var3 = var5.copy(); - if (par2 <= 14) { - if (!this.mergeItemStack(var5, 15, this.inventorySlots.size(), true)) + if (par2 <= 5) { + if (!this.mergeItemStack(var5, 6, this.inventorySlots.size(), true)) { return null; } } - else if (!this.mergeItemStack(var5, 0, 15, false)) + else if (!this.mergeItemStack(var5, 0, 2, false)) { + if (!this.mergeItemStack(var5, 3, 4, false)) + if (!this.mergeItemStack(var5, 5, 6, false)) return null; } @@ -111,15 +125,25 @@ public class ContainerMachineOilWell extends Container { { par1.sendProgressBarUpdate(this, 1, this.testNuke.power); } - if(this.power != this.testNuke.warning) + if(this.warning != this.testNuke.warning) { par1.sendProgressBarUpdate(this, 2, this.testNuke.warning); } + if(this.gas != this.testNuke.gas) + { + par1.sendProgressBarUpdate(this, 3, this.testNuke.gas); + } + if(this.warning2 != this.testNuke.warning2) + { + par1.sendProgressBarUpdate(this, 4, this.testNuke.warning2); + } } this.oil = this.testNuke.oil; this.power = this.testNuke.power; this.warning = this.testNuke.warning; + this.gas = this.testNuke.gas; + this.warning2 = this.testNuke.warning2; } @Override @@ -136,5 +160,13 @@ public class ContainerMachineOilWell extends Container { { testNuke.warning = j; } + if(i == 3) + { + testNuke.gas = j; + } + if(i == 4) + { + testNuke.warning2 = j; + } } } diff --git a/com/hbm/inventory/container/ContainerMachineRefinery.java b/com/hbm/inventory/container/ContainerMachineRefinery.java new file mode 100644 index 000000000..03257cc68 --- /dev/null +++ b/com/hbm/inventory/container/ContainerMachineRefinery.java @@ -0,0 +1,197 @@ +package com.hbm.inventory.container; + +import com.hbm.inventory.SlotMachineOutput; +import com.hbm.tileentity.TileEntityMachineOilWell; +import com.hbm.tileentity.TileEntityMachineRefinery; + +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 ContainerMachineRefinery extends Container { + + private TileEntityMachineRefinery testNuke; + private int power; + private float oil; + private int fuel; + private int lubricant; + private int diesel; + private int kerosene; + + public ContainerMachineRefinery(InventoryPlayer invPlayer, TileEntityMachineRefinery tedf) { + power = 0; + oil = 0; + fuel = 0; + lubricant = 0; + diesel = 0; + kerosene = 0; + + testNuke = tedf; + + //Battery + this.addSlotToContainer(new Slot(tedf, 0, 44, 54)); + //Canister Input + this.addSlotToContainer(new Slot(tedf, 1, 134, 18)); + //Canister Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 54)); + //Fuel Input + this.addSlotToContainer(new Slot(tedf, 3, 26, 72)); + //Fuel Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 26, 108)); + //Lubricant Input + this.addSlotToContainer(new Slot(tedf, 5, 62, 72)); + //Lubricant Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 6, 62, 108)); + //Diesel Input + this.addSlotToContainer(new Slot(tedf, 7, 98, 72)); + //Diesel Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 8, 98, 108)); + //Kerosene Input + this.addSlotToContainer(new Slot(tedf, 9, 134, 72)); + //Kerosene Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 10, 134, 108)); + //Sulfur Output + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 152, 108)); + + 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 + 56)); + } + } + + for(int i = 0; i < 9; i++) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting crafting) { + super.addCraftingToCrafters(crafting); + crafting.sendProgressBarUpdate(this, 0, this.testNuke.power); + crafting.sendProgressBarUpdate(this, 1, (int)this.testNuke.oil); + crafting.sendProgressBarUpdate(this, 2, this.testNuke.fuel); + crafting.sendProgressBarUpdate(this, 3, this.testNuke.lubricant); + crafting.sendProgressBarUpdate(this, 4, this.testNuke.diesel); + crafting.sendProgressBarUpdate(this, 5, this.testNuke.kerosene); + } + + @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 <= 11) { + if (!this.mergeItemStack(var5, 12, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(var5, 0, 1, false)) + if (!this.mergeItemStack(var5, 1, 2, false)) + if (!this.mergeItemStack(var5, 3, 4, false)) + if (!this.mergeItemStack(var5, 5, 6, false)) + if (!this.mergeItemStack(var5, 7, 8, false)) + if (!this.mergeItemStack(var5, 9, 10, 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.power != this.testNuke.power) + { + par1.sendProgressBarUpdate(this, 0, this.testNuke.power); + } + if(this.oil != this.testNuke.oil) + { + par1.sendProgressBarUpdate(this, 1, (int)this.testNuke.oil); + } + if(this.fuel != this.testNuke.fuel) + { + par1.sendProgressBarUpdate(this, 2, this.testNuke.fuel); + } + if(this.lubricant != this.testNuke.lubricant) + { + par1.sendProgressBarUpdate(this, 3, this.testNuke.lubricant); + } + if(this.diesel != this.testNuke.diesel) + { + par1.sendProgressBarUpdate(this, 4, this.testNuke.diesel); + } + if(this.kerosene != this.testNuke.kerosene) + { + par1.sendProgressBarUpdate(this, 5, this.testNuke.kerosene); + } + } + + this.power = this.testNuke.power; + this.oil = this.testNuke.oil; + this.oil = this.testNuke.fuel; + this.oil = this.testNuke.lubricant; + this.oil = this.testNuke.diesel; + this.oil = this.testNuke.kerosene; + } + + @Override + public void updateProgressBar(int i, int j) { + if(i == 0) + { + testNuke.power = j; + } + if(i == 1) + { + testNuke.oil = j; + } + if(i == 2) + { + testNuke.fuel = j; + } + if(i == 3) + { + testNuke.lubricant = j; + } + if(i == 4) + { + testNuke.diesel = j; + } + if(i == 5) + { + testNuke.kerosene = j; + } + } +} diff --git a/com/hbm/inventory/gui/GUIMachineGasFlare.java b/com/hbm/inventory/gui/GUIMachineGasFlare.java new file mode 100644 index 000000000..c889a1f8f --- /dev/null +++ b/com/hbm/inventory/gui/GUIMachineGasFlare.java @@ -0,0 +1,49 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.container.ContainerMachineGasFlare; +import com.hbm.inventory.container.ContainerMachineRTG; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.TileEntityMachineGasFlare; +import com.hbm.tileentity.TileEntityMachineRTG; + +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 GUIMachineGasFlare extends GuiContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_gasFlare.png"); + private TileEntityMachineGasFlare flare; + + public GUIMachineGasFlare(InventoryPlayer invPlayer, TileEntityMachineGasFlare tedf) { + super(new ContainerMachineGasFlare(invPlayer, tedf)); + flare = tedf; + + this.xSize = 176; + this.ySize = 166; + } + + @Override + protected void drawGuiContainerForegroundLayer( int i, int j) { + String name = this.flare.hasCustomInventoryName() ? this.flare.getInventoryName() : I18n.format(this.flare.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 = flare.getGasScaled(52); + drawTexturedModalRect(guiLeft + 80, guiTop + 69 - i, 192, 52 - i, 34, i); + int j = flare.getPowerScaled(52); + drawTexturedModalRect(guiLeft + 8, guiTop + 69 - j, 176, 52 - j, 16, j); + } +} diff --git a/com/hbm/inventory/gui/GUIMachineOilWell.java b/com/hbm/inventory/gui/GUIMachineOilWell.java index 068df8952..c6b64de22 100644 --- a/com/hbm/inventory/gui/GUIMachineOilWell.java +++ b/com/hbm/inventory/gui/GUIMachineOilWell.java @@ -18,7 +18,7 @@ import net.minecraft.util.ResourceLocation; public class GUIMachineOilWell extends GuiContainer { - private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well.png"); + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well_large.png"); private TileEntityMachineOilWell derrick; public GUIMachineOilWell(InventoryPlayer invPlayer, TileEntityMachineOilWell tedf) { @@ -26,7 +26,7 @@ public class GUIMachineOilWell extends GuiContainer { derrick = tedf; this.xSize = 176; - this.ySize = 166; + this.ySize = 222; } @Override @@ -44,15 +44,24 @@ public class GUIMachineOilWell extends GuiContainer { drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); int i = derrick.getPowerScaled(52); - drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i); + drawTexturedModalRect(guiLeft + 8, guiTop + 70 - i, 176, 52 - i, 16, i); int j = derrick.getOilScaled(52); - drawTexturedModalRect(guiLeft + 80, guiTop + 69 - j, 192, 52 - j, 34, j); + drawTexturedModalRect(guiLeft + 80, guiTop + 70 - j, 192, 52 - j, 34, j); + + int x = derrick.getGasScaled(52); + drawTexturedModalRect(guiLeft + 80, guiTop + 124 - x, 176, 120 - x, 34, x); int k = derrick.warning; if(k == 2) - drawTexturedModalRect(guiLeft + 44, guiTop + 17, 176, 52, 16, 16); + drawTexturedModalRect(guiLeft + 44, guiTop + 18, 176, 52, 16, 16); if(k == 1) - drawTexturedModalRect(guiLeft + 44, guiTop + 17, 192, 52, 16, 16); + drawTexturedModalRect(guiLeft + 44, guiTop + 18, 192, 52, 16, 16); + + int l = derrick.warning2; + if(l == 1) + drawTexturedModalRect(guiLeft + 44, guiTop + 90, 208, 52, 16, 16); + if(l == 2) + drawTexturedModalRect(guiLeft + 44, guiTop + 90, 224, 52, 16, 16); } } diff --git a/com/hbm/inventory/gui/GUIMachineRefinery.java b/com/hbm/inventory/gui/GUIMachineRefinery.java new file mode 100644 index 000000000..d62b8edbe --- /dev/null +++ b/com/hbm/inventory/gui/GUIMachineRefinery.java @@ -0,0 +1,57 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.container.ContainerIGenerator; +import com.hbm.inventory.container.ContainerMachineRefinery; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.TileEntityMachineIGenerator; +import com.hbm.tileentity.TileEntityMachineRefinery; + +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 GUIMachineRefinery extends GuiContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_refinery.png"); + private TileEntityMachineRefinery diFurnace; + + public GUIMachineRefinery(InventoryPlayer invPlayer, TileEntityMachineRefinery tedf) { + super(new ContainerMachineRefinery(invPlayer, tedf)); + diFurnace = tedf; + + this.xSize = 176; + this.ySize = 222; + } + + @Override + protected void drawGuiContainerForegroundLayer(int i, int j) { + String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.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 = diFurnace.getOilScaled(52); + drawTexturedModalRect(guiLeft + 80, guiTop + 70 - i, 192, 52 - i, 34, i); + int j = diFurnace.getPowerScaled(52); + drawTexturedModalRect(guiLeft + 8, guiTop + 70 - j, 176, 52 - j, 16, j); + int k = diFurnace.getSmearScaled(52); + drawTexturedModalRect(guiLeft + 8, guiTop + 124 - k, 176, 104 - k, 7, k); + int l = diFurnace.getLubricantScaled(52); + drawTexturedModalRect(guiLeft + 44, guiTop + 124 - l, 183, 104 - l, 7, l); + int m = diFurnace.getDieselScaled(52); + drawTexturedModalRect(guiLeft + 80, guiTop + 124 - m, 190, 104 - m, 7, m); + int n = diFurnace.getKeroseneScaled(52); + drawTexturedModalRect(guiLeft + 116, guiTop + 124 - n, 197, 104 - n, 7, n); + } +} diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index f65759273..189358d80 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -419,6 +419,7 @@ public class ModItems { public static Item oil_canola; public static Item canister_empty; + public static Item canister_smear; public static Item canister_canola; public static Item canister_oil; public static Item canister_fuel; @@ -426,6 +427,9 @@ public class ModItems { public static Item canister_napalm; public static Item canister_NITAN; + public static Item gas_empty; + public static Item gas_full; + public static Item syringe_empty; public static Item syringe_antidote; public static Item syringe_poison; @@ -947,6 +951,14 @@ public class ModItems { public static Item spill6; public static Item spill7; public static Item spill8; + public static Item gas1; + public static Item gas2; + public static Item gas3; + public static Item gas4; + public static Item gas5; + public static Item gas6; + public static Item gas7; + public static Item gas8; public static Item energy_ball; public static Item discharge; public static Item empblast; @@ -1272,12 +1284,15 @@ 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_smear = new ItemCustomLore().setUnlocalizedName("canister_smear").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_smear"); 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_kerosene = new ItemCustomLore().setUnlocalizedName("canister_kerosene").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_kerosene"); 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"); + gas_empty = new Item().setUnlocalizedName("gas_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":gas_empty"); + gas_full = new Item().setUnlocalizedName("gas_full").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.gas_empty).setTextureName(RefStrings.MODID + ":gas_full"); tank_waste = new ItemTankWaste().setUnlocalizedName("tank_waste").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts); @@ -1797,6 +1812,14 @@ public class ModItems { 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"); + gas1 = new Item().setUnlocalizedName("gas1").setTextureName(RefStrings.MODID + ":gas1"); + gas2 = new Item().setUnlocalizedName("gas2").setTextureName(RefStrings.MODID + ":gas2"); + gas3 = new Item().setUnlocalizedName("gas3").setTextureName(RefStrings.MODID + ":gas3"); + gas4 = new Item().setUnlocalizedName("gas4").setTextureName(RefStrings.MODID + ":gas4"); + gas5 = new Item().setUnlocalizedName("gas5").setTextureName(RefStrings.MODID + ":gas5"); + gas6 = new Item().setUnlocalizedName("gas6").setTextureName(RefStrings.MODID + ":gas6"); + gas7 = new Item().setUnlocalizedName("gas7").setTextureName(RefStrings.MODID + ":gas7"); + gas8 = new Item().setUnlocalizedName("gas8").setTextureName(RefStrings.MODID + ":gas8"); 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"); @@ -2161,6 +2184,7 @@ public class ModItems { //Canisters GameRegistry.registerItem(canister_empty, canister_empty.getUnlocalizedName()); + GameRegistry.registerItem(canister_smear, canister_smear.getUnlocalizedName()); GameRegistry.registerItem(canister_canola, canister_canola.getUnlocalizedName()); GameRegistry.registerItem(canister_oil, canister_oil.getUnlocalizedName()); GameRegistry.registerItem(canister_fuel, canister_fuel.getUnlocalizedName()); @@ -2168,6 +2192,10 @@ public class ModItems { GameRegistry.registerItem(canister_napalm, canister_napalm.getUnlocalizedName()); GameRegistry.registerItem(canister_NITAN, canister_NITAN.getUnlocalizedName()); + //Gastanks + GameRegistry.registerItem(gas_empty, gas_empty.getUnlocalizedName()); + GameRegistry.registerItem(gas_full, gas_full.getUnlocalizedName()); + //Batteries GameRegistry.registerItem(battery_generic, battery_generic.getUnlocalizedName()); GameRegistry.registerItem(battery_advanced, battery_advanced.getUnlocalizedName()); @@ -2732,6 +2760,14 @@ public class ModItems { GameRegistry.registerItem(spill6, spill6.getUnlocalizedName()); GameRegistry.registerItem(spill7, spill7.getUnlocalizedName()); GameRegistry.registerItem(spill8, spill8.getUnlocalizedName()); + GameRegistry.registerItem(gas1, gas1.getUnlocalizedName()); + GameRegistry.registerItem(gas2, gas2.getUnlocalizedName()); + GameRegistry.registerItem(gas3, gas3.getUnlocalizedName()); + GameRegistry.registerItem(gas4, gas4.getUnlocalizedName()); + GameRegistry.registerItem(gas5, gas5.getUnlocalizedName()); + GameRegistry.registerItem(gas6, gas6.getUnlocalizedName()); + GameRegistry.registerItem(gas7, gas7.getUnlocalizedName()); + GameRegistry.registerItem(gas8, gas8.getUnlocalizedName()); GameRegistry.registerItem(energy_ball, energy_ball.getUnlocalizedName()); GameRegistry.registerItem(discharge, discharge.getUnlocalizedName()); GameRegistry.registerItem(empblast, empblast.getUnlocalizedName()); diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index a8116e062..02a0b82f3 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -6,10 +6,14 @@ import java.util.UUID; import com.hbm.blocks.ModBlocks; import com.hbm.calc.UnionOfTileEntitiesAndBooleans; +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForOil; import com.hbm.entity.mob.EntityHunterChopper; import com.hbm.entity.projectile.EntityChopperMine; import com.hbm.interfaces.IConductor; import com.hbm.interfaces.IConsumer; +import com.hbm.interfaces.IDuct; +import com.hbm.interfaces.IOilAcceptor; +import com.hbm.interfaces.IOilSource; import com.hbm.interfaces.ISource; import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; @@ -18,6 +22,8 @@ import com.hbm.tileentity.TileEntityLaunchPad; import com.hbm.tileentity.TileEntityMachineBattery; import com.hbm.tileentity.TileEntityMachineDeuterium; import com.hbm.tileentity.TileEntityMachineElectricFurnace; +import com.hbm.tileentity.TileEntityOilDuct; +import com.hbm.tileentity.TileEntityOilDuctSolid; import com.hbm.tileentity.TileEntityWireCoated; import net.minecraft.block.Block; @@ -244,7 +250,7 @@ public class Library { return false; } - public static boolean checkConnectables(World world, int x, int y, int z) + public static boolean checkCableConnectables(World world, int x, int y, int z) { TileEntity tileentity = world.getTileEntity(x, y, z); if((tileentity != null && (tileentity instanceof IConductor || @@ -265,6 +271,18 @@ public class Library { return false; } + public static boolean checkDuctConnectables(World world, int x, int y, int z) + { + TileEntity tileentity = world.getTileEntity(x, y, z); + if((tileentity != null && tileentity instanceof IDuct) || + world.getBlock(x, y, z) == ModBlocks.dummy_port_well || + world.getBlock(x, y, z) == ModBlocks.machine_refinery) + { + return true; + } + return false; + } + public static boolean checkUnionList(List list, ISource that) { for(UnionOfTileEntitiesAndBooleans union : list) @@ -278,6 +296,19 @@ public class Library { return false; } + public static boolean checkOilUnionListForOil(List list, IOilSource that) { + + for(UnionOfTileEntitiesAndBooleansForOil union : list) + { + if(union.source == that) + { + return true; + } + } + + return false; + } + ////// ////// ////// ////// ////// //// ////// ////// ////// // // // // // // // // // // // //// ////// ///// // //// //// //// // // // // @@ -651,4 +682,90 @@ public class Library { that.clearList(); } } + + public static void transmitOil(int x, int y, int z, boolean newTact, IOilSource that, World worldObj) { + Block block = worldObj.getBlock(x, y, z); + TileEntity tileentity = worldObj.getTileEntity(x, y, z); + + if(tileentity instanceof IDuct) + { + if(tileentity instanceof TileEntityOilDuct) + { + if(Library.checkOilUnionListForOil(((TileEntityOilDuct)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityOilDuct)tileentity).uoteab.size(); i++) + { + if(((TileEntityOilDuct)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityOilDuct)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityOilDuct)tileentity).uoteab.get(i).ticked = newTact; + that.fill(x, y + 1, z, that.getTact()); + that.fill(x, y - 1, z, that.getTact()); + that.fill(x - 1, y, z, that.getTact()); + that.fill(x + 1, y, z, that.getTact()); + that.fill(x, y, z - 1, that.getTact()); + that.fill(x, y, z + 1, that.getTact()); + } + } + } + } else { + ((TileEntityOilDuct)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForOil(that, newTact)); + } + } + if(tileentity instanceof TileEntityOilDuctSolid) + { + if(Library.checkOilUnionListForOil(((TileEntityOilDuctSolid)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityOilDuctSolid)tileentity).uoteab.size(); i++) + { + if(((TileEntityOilDuctSolid)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityOilDuctSolid)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityOilDuctSolid)tileentity).uoteab.get(i).ticked = newTact; + that.fill(x, y + 1, z, that.getTact()); + that.fill(x, y - 1, z, that.getTact()); + that.fill(x - 1, y, z, that.getTact()); + that.fill(x + 1, y, z, that.getTact()); + that.fill(x, y, z - 1, that.getTact()); + that.fill(x, y, z + 1, that.getTact()); + } + } + } + } else { + ((TileEntityOilDuctSolid)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForOil(that, newTact)); + } + } + } + + if(tileentity instanceof IOilAcceptor && newTact) + { + that.getList().add((IOilAcceptor)tileentity); + } + + if(!newTact) + { + int size = that.getList().size(); + if(size > 0) + { + int part = that.getSFill() / size; + for(IOilAcceptor consume : that.getList()) + { + if(consume.getFill() < consume.getMaxFill()) + { + if(consume.getMaxFill() - consume.getFill() >= part) + { + that.setSFill(that.getSFill()-part); + consume.setFill(consume.getFill() + part); + } else { + that.setSFill(that.getSFill() - (consume.getMaxFill() - consume.getFill())); + consume.setFill(consume.getMaxFill()); + } + } + } + } + that.clearList(); + } + } } diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index a32cf9c4d..7625bc7f1 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.EntityGasFX; import com.hbm.entity.particle.EntityOilSpillFX; import com.hbm.entity.particle.EntitySSmokeFX; import com.hbm.entity.particle.EntitySmokeFX; @@ -83,6 +84,7 @@ import com.hbm.items.ModItems; import com.hbm.render.entity.BSmokeRenderer; import com.hbm.render.entity.DSmokeRenderer; import com.hbm.render.entity.ElectricityRenderer; +import com.hbm.render.entity.GasRenderer; import com.hbm.render.entity.ModEffectRenderer; import com.hbm.render.entity.RenderBaleflare; import com.hbm.render.entity.RenderBeam; @@ -162,6 +164,7 @@ 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.RenderGasFlare; import com.hbm.render.tileentity.RenderIGenerator; import com.hbm.render.tileentity.RenderLaunchPadTier1; import com.hbm.render.tileentity.RenderNukeBoy; @@ -172,6 +175,7 @@ import com.hbm.render.tileentity.RenderNukeMan; import com.hbm.render.tileentity.RenderNukeMike; import com.hbm.render.tileentity.RenderNukePrototype; import com.hbm.render.tileentity.RenderNukeTsar; +import com.hbm.render.tileentity.RenderOilDuct; import com.hbm.render.tileentity.RenderPoleSatelliteReceiver; import com.hbm.render.tileentity.RenderPoleTop; import com.hbm.render.tileentity.RenderPuF6Tank; @@ -203,6 +207,7 @@ import com.hbm.tileentity.TileEntityMachineOilWell; import com.hbm.tileentity.TileEntityLaunchPad; import com.hbm.tileentity.TileEntityMachineCentrifuge; import com.hbm.tileentity.TileEntityMachineCyclotron; +import com.hbm.tileentity.TileEntityMachineGasFlare; import com.hbm.tileentity.TileEntityMachinePuF6Tank; import com.hbm.tileentity.TileEntityMachineUF6Tank; import com.hbm.tileentity.TileEntityNukeBoy; @@ -214,6 +219,7 @@ import com.hbm.tileentity.TileEntityNukeMike; import com.hbm.tileentity.TileEntityNukePrototype; import com.hbm.tileentity.TileEntityNukeTsar; import com.hbm.tileentity.TileEntityObjTester; +import com.hbm.tileentity.TileEntityOilDuct; import com.hbm.tileentity.TileEntityRedBarrel; import com.hbm.tileentity.TileEntityRotationTester; import com.hbm.tileentity.TileEntityTestBombAdvanced; @@ -255,6 +261,7 @@ public class ClientProxy extends ServerProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineIGenerator.class, new RenderIGenerator()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCyclotron.class, new RenderCyclotron()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineOilWell.class, new RenderDerrick()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineGasFlare.class, new RenderGasFlare()); //RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderRocket()); RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderSnowball(ModItems.man_core)); @@ -375,6 +382,7 @@ public class ClientProxy extends ServerProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaunchPad.class, new RenderLaunchPadTier1()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCable.class, new RenderCable()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOilDuct.class, new RenderOilDuct()); RenderingRegistry.registerEntityRenderingHandler(EntityMissileGeneric.class, new RenderMissileGeneric()); RenderingRegistry.registerEntityRenderingHandler(EntityMissileAntiBallistic.class, new RenderMissileGeneric()); @@ -424,6 +432,7 @@ public class ClientProxy extends ServerProxy 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(EntityGasFX.class, new GasRenderer(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/MainRegistry.java b/com/hbm/main/MainRegistry.java index 80cb55845..bf044a5d2 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.EntityGasFX; import com.hbm.entity.particle.EntityOilSpillFX; import com.hbm.entity.particle.EntitySSmokeFX; import com.hbm.entity.particle.EntitySmokeFX; @@ -139,9 +140,11 @@ import com.hbm.tileentity.TileEntityMachineCyclotron; import com.hbm.tileentity.TileEntityMachineDeuterium; import com.hbm.tileentity.TileEntityMachineDiesel; import com.hbm.tileentity.TileEntityMachineElectricFurnace; +import com.hbm.tileentity.TileEntityMachineGasFlare; import com.hbm.tileentity.TileEntityMachineGenerator; import com.hbm.tileentity.TileEntityMachinePuF6Tank; import com.hbm.tileentity.TileEntityMachineReactor; +import com.hbm.tileentity.TileEntityMachineRefinery; import com.hbm.tileentity.TileEntityMachineSchrabidiumTransmutator; import com.hbm.tileentity.TileEntityMachineShredder; import com.hbm.tileentity.TileEntityMachineTeleporter; @@ -156,6 +159,8 @@ import com.hbm.tileentity.TileEntityNukeMike; import com.hbm.tileentity.TileEntityNukePrototype; import com.hbm.tileentity.TileEntityNukeTsar; import com.hbm.tileentity.TileEntityObjTester; +import com.hbm.tileentity.TileEntityOilDuct; +import com.hbm.tileentity.TileEntityOilDuctSolid; import com.hbm.tileentity.TileEntityReactorMultiblock; import com.hbm.tileentity.TileEntityRedBarrel; import com.hbm.tileentity.TileEntityRotationTester; @@ -383,6 +388,10 @@ public class MainRegistry GameRegistry.registerTileEntity(TileEntityDummy.class, "tileentity_dummy"); GameRegistry.registerTileEntity(TileEntityMachineCyclotron.class, "tileentity_cyclotron"); GameRegistry.registerTileEntity(TileEntityMachineOilWell.class, "tileentity_derrick"); + GameRegistry.registerTileEntity(TileEntityMachineGasFlare.class, "tileentity_gasflare"); + GameRegistry.registerTileEntity(TileEntityMachineRefinery.class, "tileentity_refinery"); + GameRegistry.registerTileEntity(TileEntityOilDuct.class, "tileentity_oil_duct"); + GameRegistry.registerTileEntity(TileEntityOilDuctSolid.class, "tileentity_oil_duct_solid"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true); @@ -458,6 +467,7 @@ public class MainRegistry 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.registerModEntity(EntityGasFX.class, "entity_spill_fx", 74, 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/GasRenderer.java b/com/hbm/render/entity/GasRenderer.java new file mode 100644 index 000000000..eb8e423c6 --- /dev/null +++ b/com/hbm/render/entity/GasRenderer.java @@ -0,0 +1,124 @@ +package com.hbm.render.entity; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import com.hbm.entity.particle.EntityGasFX; +import com.hbm.entity.particle.EntityOilSpillFX; +import com.hbm.items.ModItems; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class GasRenderer extends Render { + private Item field_94151_a; + private int field_94150_f; + private static final String __OBFID = "CL_00001008"; + + public GasRenderer(Item p_i1259_1_, int p_i1259_2_) { + this.field_94151_a = p_i1259_1_; + this.field_94150_f = p_i1259_2_; + } + + public GasRenderer(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.gas8; + } + + if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) { + field_94151_a = ModItems.gas7; + } + + if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) { + field_94151_a = ModItems.gas6; + } + + if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) { + field_94151_a = ModItems.gas5; + } + + if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) { + field_94151_a = ModItems.gas4; + } + + if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) { + field_94151_a = ModItems.gas3; + } + + if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) { + field_94151_a = ModItems.gas2; + } + + if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) { + field_94151_a = ModItems.gas1; + } + + 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/RenderGasFlare.java b/com/hbm/render/tileentity/RenderGasFlare.java new file mode 100644 index 000000000..bb2d33ccb --- /dev/null +++ b/com/hbm/render/tileentity/RenderGasFlare.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 RenderGasFlare extends TileEntitySpecialRenderer { + + private static final ResourceLocation body = new ResourceLocation(RefStrings.MODID, "models/oilFlare.obj"); + private IModelCustom genModel; + private ResourceLocation genTexture; + + public RenderGasFlare() + { + genModel = AdvancedModelLoader.loadModel(body); + genTexture = new ResourceLocation(RefStrings.MODID, "textures/models/oilFlareTexture.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/render/tileentity/RenderOilDuct.java b/com/hbm/render/tileentity/RenderOilDuct.java new file mode 100644 index 000000000..34404b839 --- /dev/null +++ b/com/hbm/render/tileentity/RenderOilDuct.java @@ -0,0 +1,154 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.TileEntityCable; +import com.hbm.tileentity.TileEntityOilDuct; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +public class RenderOilDuct extends TileEntitySpecialRenderer { + + public ResourceLocation texture = new ResourceLocation(RefStrings.MODID, "textures/blocks/oil_duct.png"); + float pixel = 1F/16F; + float textureP = 1F / 32F; + + @Override + public void renderTileEntityAt(TileEntity tileentity, double offsetX, double offsetY, double offsetZ, float f) { + GL11.glTranslated(offsetX, offsetY, offsetZ); + GL11.glDisable(GL11.GL_LIGHTING); + this.bindTexture(texture); + drawCore(tileentity); + TileEntityOilDuct cable = (TileEntityOilDuct) tileentity; + for(int i = 0; i < cable.connections.length; i++) + { + if(cable.connections[i] != null) + { + drawConnection(cable.connections[i]); + } + } + GL11.glTranslated(-offsetX, -offsetY, -offsetZ); + GL11.glEnable(GL11.GL_LIGHTING); + + } + + public void drawCore(TileEntity tileentity) { + Tessellator tesseract = Tessellator.instance; + tesseract.startDrawingQuads(); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP); + + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP); + + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 5 * textureP); + + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 5 * textureP); + + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP); + + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0 * textureP, 5 * textureP); + tesseract.draw(); + } + + public void drawConnection(ForgeDirection direction) + { + Tessellator tesseract = Tessellator.instance; + tesseract.startDrawingQuads(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if(direction.equals(ForgeDirection.UP)) + { + + } + if(direction.equals(ForgeDirection.DOWN)) + { + GL11.glRotatef(180, 1, 0, 0); + } + if(direction.equals(ForgeDirection.NORTH)) + { + GL11.glRotatef(270, 1, 0, 0); + } + if(direction.equals(ForgeDirection.SOUTH)) + { + GL11.glRotatef(90, 1, 0, 0); + } + if(direction.equals(ForgeDirection.EAST)) + { + GL11.glRotatef(270, 0, 0, 1); + } + if(direction.equals(ForgeDirection.WEST)) + { + GL11.glRotatef(90, 0, 0, 1); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 5 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP); + + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 5 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP); + + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 5 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 0 * textureP); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 0 * textureP); + + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 5 * textureP, 5 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1, 1 - 11 * pixel / 2, 10 * textureP, 5 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1, 11 * pixel / 2, 10 * textureP, 0 * textureP); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 5 * textureP, 0 * textureP); + tesseract.draw(); + + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + if(direction.equals(ForgeDirection.UP)) + { + + } + if(direction.equals(ForgeDirection.DOWN)) + { + GL11.glRotatef(-180, 1, 0, 0); + } + if(direction.equals(ForgeDirection.NORTH)) + { + GL11.glRotatef(-270, 1, 0, 0); + } + if(direction.equals(ForgeDirection.SOUTH)) + { + GL11.glRotatef(-90, 1, 0, 0); + } + if(direction.equals(ForgeDirection.EAST)) + { + GL11.glRotatef(-270, 0, 0, 1); + } + if(direction.equals(ForgeDirection.WEST)) + { + GL11.glRotatef(-90, 0, 0, 1); + } + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + } +} diff --git a/com/hbm/tileentity/TileEntityCable.java b/com/hbm/tileentity/TileEntityCable.java index 92c3cc72b..10a746a70 100644 --- a/com/hbm/tileentity/TileEntityCable.java +++ b/com/hbm/tileentity/TileEntityCable.java @@ -28,22 +28,22 @@ public class TileEntityCable extends TileEntity implements IConductor { } public void updateConnections() { - if(Library.checkConnectables(this.worldObj, xCoord, yCoord + 1, zCoord)) connections[0] = ForgeDirection.UP; + if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord + 1, zCoord)) connections[0] = ForgeDirection.UP; else connections[0] = null; - if(Library.checkConnectables(this.worldObj, xCoord, yCoord - 1, zCoord)) connections[1] = ForgeDirection.DOWN; + if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord - 1, zCoord)) connections[1] = ForgeDirection.DOWN; else connections[1] = null; - if(Library.checkConnectables(this.worldObj, xCoord, yCoord, zCoord - 1)) connections[2] = ForgeDirection.NORTH; + if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord, zCoord - 1)) connections[2] = ForgeDirection.NORTH; else connections[2] = null; - if(Library.checkConnectables(this.worldObj, xCoord + 1, yCoord, zCoord)) connections[3] = ForgeDirection.EAST; + if(Library.checkCableConnectables(this.worldObj, xCoord + 1, yCoord, zCoord)) connections[3] = ForgeDirection.EAST; else connections[3] = null; - if(Library.checkConnectables(this.worldObj, xCoord, yCoord, zCoord + 1)) connections[4] = ForgeDirection.SOUTH; + if(Library.checkCableConnectables(this.worldObj, xCoord, yCoord, zCoord + 1)) connections[4] = ForgeDirection.SOUTH; else connections[4] = null; - if(Library.checkConnectables(this.worldObj, xCoord - 1, yCoord, zCoord)) connections[5] = ForgeDirection.WEST; + if(Library.checkCableConnectables(this.worldObj, xCoord - 1, yCoord, zCoord)) connections[5] = ForgeDirection.WEST; else connections[5] = null; } diff --git a/com/hbm/tileentity/TileEntityMachineGasFlare.java b/com/hbm/tileentity/TileEntityMachineGasFlare.java new file mode 100644 index 000000000..34ab88963 --- /dev/null +++ b/com/hbm/tileentity/TileEntityMachineGasFlare.java @@ -0,0 +1,284 @@ +package com.hbm.tileentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.interfaces.IConsumer; +import com.hbm.interfaces.IOilAcceptor; +import com.hbm.interfaces.IOilSource; +import com.hbm.interfaces.ISource; +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.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.oredict.OreDictionary; + +public class TileEntityMachineGasFlare extends TileEntity implements ISidedInventory, ISource { + + private ItemStack slots[]; + + public int gas; + public int power; + public static final int maxPower = 100000; + public static final int maxGas = 640; + public int age = 0; + public List list = new ArrayList(); + + 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(); + + private String customName; + + public TileEntityMachineGasFlare() { + 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.gasFlare"; + } + + @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) <=128; + } + } + + //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.gas = nbt.getInteger("gas"); + 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("gas", gas); + 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 getGasScaled(int i) { + return (gas * i) / maxGas; + } + + public int getPowerScaled(int i) { + return (power * i) / maxPower; + } + + @Override + public void updateEntity() { + + age++; + if(age >= 20) + age -= 20; + if(age == 9 || age == 19) + ffgeuaInit(); + + if(!worldObj.isRemote) { + } + + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return TileEntity.INFINITE_EXTENT_AABB; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() + { + return 65536.0D; + } + + @Override + public boolean getTact() { + if (age >= 0 && age < 10) { + return true; + } + + return false; + } + + @Override + public void clearList() { + this.list.clear(); + } + + @Override + public void ffgeuaInit() { + ffgeua(this.xCoord + 2, this.yCoord, this.zCoord, getTact()); + ffgeua(this.xCoord - 2, this.yCoord, this.zCoord, getTact()); + ffgeua(this.xCoord, this.yCoord, this.zCoord + 2, getTact()); + ffgeua(this.xCoord, this.yCoord, this.zCoord - 2, getTact()); + + } + + @Override + public void ffgeua(int x, int y, int z, boolean newTact) { + Library.ffgeua(x, y, z, newTact, this, worldObj); + } + + @Override + public int getSPower() { + return this.power; + } + + @Override + public void setSPower(int i) { + this.power = i; + } + + @Override + public List getList() { + return this.list; + } +} diff --git a/com/hbm/tileentity/TileEntityMachineOilWell.java b/com/hbm/tileentity/TileEntityMachineOilWell.java index 165348054..221cae17b 100644 --- a/com/hbm/tileentity/TileEntityMachineOilWell.java +++ b/com/hbm/tileentity/TileEntityMachineOilWell.java @@ -6,9 +6,13 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.machine.MachineElectricFurnace; +import com.hbm.entity.particle.EntityGasFX; +import com.hbm.entity.particle.EntityOilSpillFX; import com.hbm.explosion.ExplosionLarge; import com.hbm.handler.ShredderRecipeHandler; import com.hbm.interfaces.IConsumer; +import com.hbm.interfaces.IOilAcceptor; +import com.hbm.interfaces.IOilSource; import com.hbm.inventory.MachineRecipes; import com.hbm.items.ModItems; import com.hbm.items.special.ItemBattery; @@ -26,28 +30,34 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; -public class TileEntityMachineOilWell extends TileEntity implements ISidedInventory, IConsumer { +public class TileEntityMachineOilWell extends TileEntity implements ISidedInventory, IConsumer, IOilSource { private ItemStack slots[]; - + public int oil; + public int gas; public int power; public int warning; + public int warning2; public static final int maxPower = 100000; public static final int maxOil = 640; + public static final int maxGas = 640; + public int age = 0; + public int age2 = 0; + public List aclist = new ArrayList(); 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]; + slots = new ItemStack[6]; } @Override @@ -106,7 +116,7 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent { return false; }else{ - return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64; + return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=128; } } @@ -157,6 +167,7 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent this.power = nbt.getInteger("powerTime"); this.oil = nbt.getInteger("oil"); + this.gas = nbt.getInteger("gas"); this.age = nbt.getInteger("age"); slots = new ItemStack[getSizeInventory()]; @@ -176,6 +187,7 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent super.writeToNBT(nbt); nbt.setInteger("powerTime", power); nbt.setInteger("oil", oil); + nbt.setInteger("gas", gas); nbt.setInteger("age", age); NBTTagList list = new NBTTagList(); @@ -212,6 +224,10 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent return (oil * i) / maxOil; } + public int getGasScaled(int i) { + return (gas * i) / maxGas; + } + public int getPowerScaled(int i) { return (power * i) / maxPower; } @@ -222,8 +238,13 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent int timer = 50; age++; + age2++; if(age >= timer) age -= timer; + if(age2 >= 20) + age2 -= 20; + if(age2 == 9 || age2 == 19) + fillInit(); if(!worldObj.isRemote) { @@ -233,19 +254,35 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent slots[2] = new ItemStack(ModItems.canister_oil); slots[1].stackSize--; if(slots[1].stackSize <= 0) - slots[1]= null; + 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; + slots[1] = null; + } + } + + if(slots[3] != null && slots[3].getItem() == ModItems.gas_empty && gas >= 10) { + if(slots[4] == null) { + gas -= 10; + slots[4] = new ItemStack(ModItems.gas_full); + slots[3].stackSize--; + if(slots[3].stackSize <= 0) + slots[3] = null; + } else if(slots[4] != null && slots[4].getItem() == ModItems.gas_full && slots[4].stackSize < slots[4].getMaxStackSize()) { + gas -= 10; + slots[4].stackSize++; + slots[3].stackSize--; + if(slots[3].stackSize <= 0) + slots[3] = null; } } power = Library.chargeTEFromItems(slots, 0, power, maxPower); - if(power >= 10) { + if(power >= 100) { //operation start @@ -279,13 +316,18 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent warning = 2; break; - } else if((b == ModBlocks.ore_oil || b == ModBlocks.ore_oil_empty) && this.oil < this.maxOil) { + } else if((b == ModBlocks.ore_oil || b == ModBlocks.ore_oil_empty) && this.oil < this.maxOil && this.gas < this.maxGas) { if(succ(this.xCoord, i, this.zCoord)) { oil += 5; if(oil > maxOil) oil = maxOil; + gas += rand.nextInt(26) + 25; + if(gas > maxGas) + gas = maxGas; + ExplosionLarge.spawnOilSpills(worldObj, xCoord + 0.5F, yCoord + 5.5F, zCoord + 0.5F, 3); + worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "game.neutral.swim.splash", 3.0F, 0.5F); break; } else { @@ -303,10 +345,23 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent //operation end - power -= 10; + power -= 100; } else { warning = 1; } + + warning2 = 0; + if(gas > 0) { + if(slots[5] != null && (slots[5].getItem() == ModItems.fuse || slots[5].getItem() == ModItems.screwdriver)) { + warning2 = 2; + gas -= 1; + if(gas <= 0) + gas = 0; + worldObj.spawnEntityInWorld(new EntityGasFX(worldObj, this.xCoord + 0.5F, this.yCoord + 6.5F, this.zCoord + 0.5F, 0.0, 0.0, 0.0)); + } else { + warning2 = 1; + } + } } } @@ -417,4 +472,46 @@ public class TileEntityMachineOilWell extends TileEntity implements ISidedInvent return 65536.0D; } + @Override + public void fillInit() { + fill(this.xCoord + 2, this.yCoord, this.zCoord, getTact()); + fill(this.xCoord - 2, this.yCoord, this.zCoord, getTact()); + fill(this.xCoord, this.yCoord, this.zCoord + 2, getTact()); + fill(this.xCoord, this.yCoord, this.zCoord - 2, getTact()); + } + + @Override + public void fill(int x, int y, int z, boolean newTact) { + Library.transmitOil(x, y, z, newTact, this, worldObj); + } + + @Override + public boolean getTact() { + if (age2 >= 0 && age2 < 10) { + return true; + } + + return false; + } + + @Override + public int getSFill() { + return this.oil; + } + + @Override + public void setSFill(int i) { + this.oil = i; + } + + @Override + public List getList() { + return aclist; + } + + @Override + public void clearList() { + this.aclist.clear(); + } + } diff --git a/com/hbm/tileentity/TileEntityMachineRefinery.java b/com/hbm/tileentity/TileEntityMachineRefinery.java new file mode 100644 index 000000000..30643db57 --- /dev/null +++ b/com/hbm/tileentity/TileEntityMachineRefinery.java @@ -0,0 +1,412 @@ +package com.hbm.tileentity; + +import com.hbm.interfaces.IConsumer; +import com.hbm.interfaces.IOilAcceptor; +import com.hbm.items.ModItems; +import com.hbm.items.special.ItemBattery; +import com.hbm.lib.Library; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityMachineRefinery extends TileEntity implements ISidedInventory, IConsumer, IOilAcceptor { + + private ItemStack slots[]; + + public int power = 0; + public int oil = 0; + public int fuel = 0; + public int lubricant = 0; + public int diesel = 0; + public int kerosene = 0; + public int sulfur = 0; + public static final int maxPower = 100000; + public static final int maxOil = 640; + public static final int maxFuel = 64 * 100; + public static final int maxLubricant = 64 * 100; + public static final int maxDiesel = 64 * 100; + public static final int maxKerosene = 64 * 100; + public static final int maxSulfur = 100; + public int age = 0; + + private static final int[] slots_top = new int[] { 1 }; + private static final int[] slots_bottom = new int[] { 0, 2, 4, 6, 8, 10, 11}; + private static final int[] slots_side = new int[] { 0, 3, 5, 7, 9 }; + + private String customName; + + public TileEntityMachineRefinery() { + slots = new ItemStack[12]; + } + + @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.machineRefinery"; + } + + @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; + } + } + + @Override + public void openInventory() {} + @Override + public void closeInventory() {} + + @Override + public boolean isItemValidForSlot(int i, ItemStack stack) { + + if(i == 0 && stack.getItem() instanceof ItemBattery) + return true; + if(i == 1 && stack.getItem() == ModItems.canister_oil) + return true; + if(stack.getItem() == ModItems.canister_empty) { + if(i == 3) + return true; + if(i == 5) + return true; + if(i == 7) + return true; + if(i == 9) + 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); + + power = nbt.getInteger("power"); + oil = nbt.getInteger("oil"); + fuel = nbt.getInteger("fuel"); + lubricant = nbt.getInteger("lubricant"); + diesel = nbt.getInteger("diesel"); + kerosene = nbt.getInteger("kerosene"); + sulfur = nbt.getInteger("sulfur"); + 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("power", power); + nbt.setInteger("oil", oil); + nbt.setInteger("fuel", fuel); + nbt.setInteger("lubricant", lubricant); + nbt.setInteger("diesel", diesel); + nbt.setInteger("kerosene", kerosene); + nbt.setInteger("sulfur", sulfur); + 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) { + if(i == 0 && itemStack.getItem() instanceof ItemBattery) + if(itemStack.getItemDamage() == itemStack.getMaxDamage()) + return true; + if(i == 2) + return true; + if(i == 4) + return true; + if(i == 6) + return true; + if(i == 8) + return true; + if(i == 10) + return true; + if(i == 11) + return true; + + return false; + } + + @Override + public void updateEntity() { + + int timer = 20; + age++; + if(age >= timer) + age -= timer; + + if (!worldObj.isRemote) { + + power = Library.chargeTEFromItems(slots, 0, power, maxPower); + + if(slots[1] != null && slots[1].getItem() == ModItems.canister_oil && oil + 5 <= maxOil) { + if(slots[2] == null) { + oil += 5; + slots[1].stackSize--; + if(slots[1].stackSize <= 0) + slots[1] = null; + slots[2] = new ItemStack(ModItems.canister_empty); + }else if(slots[2] != null && slots[2].getItem() == ModItems.canister_empty && slots[2].stackSize < slots[2].getMaxStackSize()) { + oil += 5; + slots[1].stackSize--; + if(slots[1].stackSize <= 0) + slots[1] = null; + slots[2].stackSize++; + } + } + + if(age == 0) + if(power >= 100 && oil - 5 >= 0 && fuel + 45 <= maxFuel && + lubricant + 30 <= maxLubricant && + diesel + 20 <= maxDiesel && + kerosene + 5 <= maxKerosene) { + + oil -= 5; + fuel += 45; + lubricant += 30; + diesel += 20; + kerosene += 5; + sulfur += 1; + power -= 100; + } + + if(slots[3] != null && slots[3].getItem() == ModItems.canister_empty && fuel - 100 >= 0) { + if(slots[4] == null) { + slots[4] = new ItemStack(ModItems.canister_smear); + fuel -= 100; + slots[3].stackSize--; + if(slots[3].stackSize <= 0) + slots[3] = null; + } else if(slots[4] != null && slots[4].getItem() == ModItems.canister_smear && slots[4].stackSize < slots[4].getMaxStackSize()) { + slots[4].stackSize++; + fuel -= 100; + slots[3].stackSize--; + if(slots[3].stackSize <= 0) + slots[3] = null; + } + } + + if(slots[5] != null && slots[5].getItem() == ModItems.canister_empty && lubricant - 100 >= 0) { + if(slots[6] == null) { + slots[6] = new ItemStack(ModItems.canister_canola); + lubricant -= 100; + slots[5].stackSize--; + if(slots[5].stackSize <= 0) + slots[5] = null; + } else if(slots[6] != null && slots[6].getItem() == ModItems.canister_canola && slots[6].stackSize < slots[6].getMaxStackSize()) { + slots[6].stackSize++; + lubricant -= 100; + slots[5].stackSize--; + if(slots[5].stackSize <= 0) + slots[5] = null; + } + } + + if(slots[7] != null && slots[7].getItem() == ModItems.canister_empty && diesel - 100 >= 0) { + if(slots[8] == null) { + slots[8] = new ItemStack(ModItems.canister_fuel); + diesel -= 100; + slots[7].stackSize--; + if(slots[7].stackSize <= 0) + slots[7] = null; + } else if(slots[8] != null && slots[8].getItem() == ModItems.canister_fuel && slots[8].stackSize < slots[8].getMaxStackSize()) { + slots[8].stackSize++; + diesel -= 100; + slots[7].stackSize--; + if(slots[7].stackSize <= 0) + slots[7] = null; + } + } + + if(slots[9] != null && slots[9].getItem() == ModItems.canister_empty && kerosene - 100 >= 0) { + if(slots[10] == null) { + slots[10] = new ItemStack(ModItems.canister_kerosene); + kerosene -= 100; + slots[9].stackSize--; + if(slots[9].stackSize <= 0) + slots[9] = null; + } else if(slots[10] != null && slots[10].getItem() == ModItems.canister_kerosene && slots[10].stackSize < slots[10].getMaxStackSize()) { + slots[10].stackSize++; + kerosene -= 100; + slots[9].stackSize--; + if(slots[9].stackSize <= 0) + slots[9] = null; + } + } + + if(sulfur >= maxSulfur) { + if(slots[11] == null) { + slots[11] = new ItemStack(ModItems.sulfur); + sulfur -= maxSulfur; + } else if(slots[11] != null && slots[11].getItem() == ModItems.sulfur && slots[11].stackSize < slots[11].getMaxStackSize()) { + slots[11].stackSize++; + sulfur -= maxSulfur; + + } + } + } + } + + public int getPowerScaled(int i) { + return (power * i) / maxPower; + } + + public int getOilScaled(int i) { + return (int)((oil * i) / maxOil); + } + + public int getSmearScaled(int i) { + return (fuel * i) / maxFuel; + } + + public int getLubricantScaled(int i) { + return (lubricant * i) / maxLubricant; + } + + public int getDieselScaled(int i) { + return (diesel * i) / maxDiesel; + } + + public int getKeroseneScaled(int i) { + return (kerosene * i) / maxKerosene; + } + + @Override + public void setPower(int i) { + power = i; + + } + + @Override + public int getPower() { + return power; + + } + + @Override + public int getMaxPower() { + return maxPower; + } + + @Override + public void setFill(int i) { + this.oil = i; + } + + @Override + public int getFill() { + return this.oil; + } + + @Override + public int getMaxFill() { + return this.maxOil; + } +} diff --git a/com/hbm/tileentity/TileEntityOilDuct.java b/com/hbm/tileentity/TileEntityOilDuct.java new file mode 100644 index 000000000..db5193fec --- /dev/null +++ b/com/hbm/tileentity/TileEntityOilDuct.java @@ -0,0 +1,58 @@ +package com.hbm.tileentity; + +import java.util.ArrayList; +import java.util.List; + +import com.hbm.calc.UnionOfTileEntitiesAndBooleans; +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForOil; +import com.hbm.interfaces.IConductor; +import com.hbm.interfaces.IDuct; +import com.hbm.interfaces.IOilAcceptor; +import com.hbm.lib.Library; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileEntityOilDuct extends TileEntity implements IDuct { + + public ForgeDirection[] connections = new ForgeDirection[6]; + + public List uoteab = new ArrayList(); + + public TileEntityOilDuct() { + + } + + public void updateEntity() { + this.updateConnections(); + } + + public void updateConnections() { + if(Library.checkDuctConnectables(this.worldObj, xCoord, yCoord + 1, zCoord)) connections[0] = ForgeDirection.UP; + else connections[0] = null; + + if(Library.checkDuctConnectables(this.worldObj, xCoord, yCoord - 1, zCoord)) connections[1] = ForgeDirection.DOWN; + else connections[1] = null; + + if(Library.checkDuctConnectables(this.worldObj, xCoord, yCoord, zCoord - 1)) connections[2] = ForgeDirection.NORTH; + else connections[2] = null; + + if(Library.checkDuctConnectables(this.worldObj, xCoord + 1, yCoord, zCoord)) connections[3] = ForgeDirection.EAST; + else connections[3] = null; + + if(Library.checkDuctConnectables(this.worldObj, xCoord, yCoord, zCoord + 1)) connections[4] = ForgeDirection.SOUTH; + else connections[4] = null; + + if(Library.checkDuctConnectables(this.worldObj, xCoord - 1, yCoord, zCoord)) connections[5] = ForgeDirection.WEST; + else connections[5] = null; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() + { + return 65536.0D; + } +} diff --git a/com/hbm/tileentity/TileEntityOilDuctSolid.java b/com/hbm/tileentity/TileEntityOilDuctSolid.java new file mode 100644 index 000000000..456723f88 --- /dev/null +++ b/com/hbm/tileentity/TileEntityOilDuctSolid.java @@ -0,0 +1,15 @@ +package com.hbm.tileentity; + +import java.util.ArrayList; +import java.util.List; + +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForOil; +import com.hbm.interfaces.IDuct; + +import net.minecraft.tileentity.TileEntity; + +public class TileEntityOilDuctSolid extends TileEntity implements IDuct { + + public List uoteab = new ArrayList(); + +}