Compare commits
No commits in common. "a36d7cf32b0dd82ef925eb0f7a5b8759583883e2" and "cf85938d84d3782f865b685d6b4581c8d064475b" have entirely different histories.
a36d7cf32b
...
cf85938d84
|
@ -1,15 +1,7 @@
|
||||||
v2o.4.0
|
v2o.3.7
|
||||||
|
|
||||||
+ Added CT script addon loader and merger system!
|
|
||||||
+ Put all script addons into "resources/nuclearcraft/addons/" to have them loaded!
|
|
||||||
+ See the GitHub repository for examples of the script addon format
|
|
||||||
|
|
||||||
* Updated Chinese Patchouli localisation [thanks to WuzgXY and ghostbird03!]
|
* Updated Chinese Patchouli localisation [thanks to WuzgXY and ghostbird03!]
|
||||||
|
|
||||||
+ Added input and output settings for all fission ports
|
|
||||||
|
|
||||||
* Shields can no longer act as active moderators in MSRs
|
|
||||||
|
|
||||||
* Tweaked turbine throughput bonus (ask in Discord server for subtle details)
|
* Tweaked turbine throughput bonus (ask in Discord server for subtle details)
|
||||||
* Tweaked default turbine coil efficiencies
|
* Tweaked default turbine coil efficiencies
|
||||||
|
|
||||||
|
@ -21,14 +13,7 @@ v2o.4.0
|
||||||
* Fixed radiation immunity not being applied when radiation death persistence is disabled
|
* Fixed radiation immunity not being applied when radiation death persistence is disabled
|
||||||
* Fixed CT radiation methods being called too late
|
* Fixed CT radiation methods being called too late
|
||||||
|
|
||||||
* Large refactoring and improvement of tile entity block update logic
|
* CT scripts can now be stored in the "resources/nuclearcraft/scripts/" directory
|
||||||
* Fixed some models not correctly updating on the client-side
|
|
||||||
|
|
||||||
* Fixed CT input recipe removal methods not correctly removing recipes with matching array ingredients
|
|
||||||
|
|
||||||
* Various other minor fixes, changes and refactors
|
|
||||||
* Possible other things that I have forgotten
|
|
||||||
- Removed Paulobrine and Herobrian
|
|
||||||
|
|
||||||
v2o.3.6
|
v2o.3.6
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
mc_version=1.12.2
|
mc_version=1.12.2
|
||||||
forge_version=14.23.5.2847
|
forge_version=14.23.5.2847
|
||||||
mapping_version=stable_39
|
mapping_version=stable_39
|
||||||
mod_version=2o.4.0_test_build_please_back_your_worlds_up_people
|
mod_version=2o.3.7
|
||||||
|
|
||||||
ic2_version=2.8.197-ex112
|
ic2_version=2.8.197-ex112
|
||||||
jei_version=4.15.0.293
|
jei_version=4.15.0.293
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "nuclearcraft:fission_port_overlayed",
|
|
||||||
"textures": {
|
|
||||||
"front": "nuclearcraft:blocks/heater_port_extreme",
|
|
||||||
"overlay": "nuclearcraft:blocks/fission/port/heater/off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"active": {
|
|
||||||
"false": {},
|
|
||||||
"true": {
|
|
||||||
"textures": {
|
|
||||||
"overlay": "nuclearcraft:blocks/fission/port/heater/on"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"axis": {
|
|
||||||
"x": {"y": 90},
|
|
||||||
"y": {"x": 90},
|
|
||||||
"z": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "nuclearcraft:fission_port_overlayed",
|
|
||||||
"textures": {
|
|
||||||
"front": "nuclearcraft:blocks/heater_port_sic_sic_cmc",
|
|
||||||
"overlay": "nuclearcraft:blocks/fission/port/heater/off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"active": {
|
|
||||||
"false": {},
|
|
||||||
"true": {
|
|
||||||
"textures": {
|
|
||||||
"overlay": "nuclearcraft:blocks/fission/port/heater/on"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"axis": {
|
|
||||||
"x": {"y": 90},
|
|
||||||
"y": {"x": 90},
|
|
||||||
"z": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model":"cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "nuclearcraft:blocks/heater_extreme"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"normal": [{}]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model":"cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "nuclearcraft:blocks/heater_sic_sic_cmc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"normal": [{}]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model":"cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "nuclearcraft:blocks/sink_extreme"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"normal": [{}]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model":"cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "nuclearcraft:blocks/sink_sic_sic_cmc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"normal": [{}]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
tile.nuclearcraft.solid_fission_sink_extreme.name=Extreme Alloy Fission Heat Sink
|
|
||||||
tile.nuclearcraft.solid_fission_sink_sic_sic_cmc.name=SiC-SiC CMC Fission Heat Sink
|
|
||||||
|
|
||||||
tile.nuclearcraft.salt_fission_heater_extreme.name=Extreme Alloy Fission Coolant Heater
|
|
||||||
tile.nuclearcraft.salt_fission_heater_sic_sic_cmc.name=SiC-SiC CMC Fission Coolant Heater
|
|
||||||
|
|
||||||
tile.nuclearcraft.fission_heater_port_extreme.name=Extreme Alloy Fission Coolant Heater Port
|
|
||||||
tile.nuclearcraft.fission_heater_port_sic_sic_cmc.name=SiC-SiC CMC Fission Coolant Heater Port
|
|
||||||
|
|
||||||
nc.sf.extreme_sink0=%s valid extreme alloy sink
|
|
||||||
nc.sf.extreme_sink1=%s valid extreme alloy sinks
|
|
||||||
nc.sf.sic_sic_cmc_sink0=%s valid SiC-SiC CMC sink
|
|
||||||
nc.sf.sic_sic_cmc_sink1=%s valid SiC-SiC CMC sinks
|
|
||||||
|
|
||||||
nc.sf.extreme_heater0=%s functional extreme alloy heater
|
|
||||||
nc.sf.extreme_heater1=%s functional extreme alloy heaters
|
|
||||||
nc.sf.sic_sic_cmc_heater0=%s functional SiC-SiC CMC heater
|
|
||||||
nc.sf.sic_sic_cmc_heater1=%s functional SiC-SiC CMC heaters
|
|
|
@ -1,7 +0,0 @@
|
||||||
#loader nc_preinit
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerFissionSink("extreme", 210, "exactly one sic_sic_cmc sink");
|
|
||||||
mods.nuclearcraft.Registration.registerFissionSink("sic_sic_cmc", 215, "exactly one lead sink");
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerFissionHeater("extreme", "tritium", 1, "deuterium", 1, 210, "exactly one sic_sic_cmc heater");
|
|
||||||
mods.nuclearcraft.Registration.registerFissionHeater("sic_sic_cmc", "helium3", 1, "helium", 1, 215, "exactly one lead heater");
|
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model":"cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "nuclearcraft:blocks/coil_extreme"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"normal": [{}]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model":"cube_all",
|
|
||||||
"textures": {
|
|
||||||
"all": "nuclearcraft:blocks/coil_sic_sic_cmc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"normal": [{}]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "nuclearcraft:turbine_rotor_blade",
|
|
||||||
"textures": {
|
|
||||||
"texture": "nuclearcraft:blocks/blade_copper"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"dir": {
|
|
||||||
"invisible": {
|
|
||||||
"model": "nuclearcraft:block_invisible"
|
|
||||||
},
|
|
||||||
"x": {"x": 90, "y": 90},
|
|
||||||
"y": {},
|
|
||||||
"z": {"x": 90}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "nuclearcraft:turbine_rotor_blade",
|
|
||||||
"textures": {
|
|
||||||
"texture": "nuclearcraft:blocks/blade_manganese"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"dir": {
|
|
||||||
"invisible": {
|
|
||||||
"model": "nuclearcraft:block_invisible"
|
|
||||||
},
|
|
||||||
"x": {"x": 90, "y": 90},
|
|
||||||
"y": {},
|
|
||||||
"z": {"x": 90}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "nuclearcraft:turbine_rotor_stator",
|
|
||||||
"textures": {
|
|
||||||
"texture": "nuclearcraft:blocks/stator_boron"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"dir": {
|
|
||||||
"invisible": {
|
|
||||||
"model": "nuclearcraft:block_invisible"
|
|
||||||
},
|
|
||||||
"x": {"x": 90, "y": 90},
|
|
||||||
"y": {},
|
|
||||||
"z": {"x": 90}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"forge_marker": 1,
|
|
||||||
"defaults": {
|
|
||||||
"model": "nuclearcraft:turbine_rotor_stator",
|
|
||||||
"textures": {
|
|
||||||
"texture": "nuclearcraft:blocks/stator_magnesium"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"inventory": [{}],
|
|
||||||
"dir": {
|
|
||||||
"invisible": {
|
|
||||||
"model": "nuclearcraft:block_invisible"
|
|
||||||
},
|
|
||||||
"x": {"x": 90, "y": 90},
|
|
||||||
"y": {},
|
|
||||||
"z": {"x": 90}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
tile.nuclearcraft.turbine_dynamo_coil_extreme.name=Extreme Alloy Turbine Dynamo Coil
|
|
||||||
tile.nuclearcraft.turbine_dynamo_coil_sic_sic_cmc.name=SiC-SiC CMC Turbine Dynamo Coil
|
|
||||||
|
|
||||||
tile.nuclearcraft.turbine_rotor_blade_manganese.name=Manganese Turbine Rotor Blade
|
|
||||||
tile.nuclearcraft.turbine_rotor_blade_copper.name=Copper Turbine Rotor Blade
|
|
||||||
|
|
||||||
tile.nuclearcraft.turbine_rotor_stator_magnesium.name=Magnesium Turbine Rotor Stator
|
|
||||||
tile.nuclearcraft.turbine_rotor_stator_boron.name=Boron Turbine Rotor Stator
|
|
||||||
|
|
||||||
nc.sf.extreme_coil0=%s extreme alloy dynamo coil
|
|
||||||
nc.sf.extreme_coil1=%s extreme alloy dynamo coils
|
|
||||||
nc.sf.sic_sic_cmc_coil0=%s SiC-SiC CMC dynamo coil
|
|
||||||
nc.sf.sic_sic_cmc_coil1=%s SiC-SiC CMC dynamo coils
|
|
|
@ -1,10 +0,0 @@
|
||||||
#loader nc_preinit
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineCoil("extreme", 1.14, "four of any coil");
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineCoil("sic_sic_cmc", 1.16, "exactly two axial connectors");
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineBlade("manganese", 1.05, 1.35);
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineBlade("copper", 1.15, 1.55);
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineStator("magnesium", 0.6);
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineStator("boron", 0.85);
|
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1017 B |
Before Width: | Height: | Size: 1018 B |
Before Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 461 B |
|
@ -1,5 +1,3 @@
|
||||||
# Addon Test A
|
|
||||||
|
|
||||||
tile.nuclearcraft.solid_fission_sink_extreme.name=Extreme Alloy Fission Heat Sink
|
tile.nuclearcraft.solid_fission_sink_extreme.name=Extreme Alloy Fission Heat Sink
|
||||||
tile.nuclearcraft.solid_fission_sink_sic_sic_cmc.name=SiC-SiC CMC Fission Heat Sink
|
tile.nuclearcraft.solid_fission_sink_sic_sic_cmc.name=SiC-SiC CMC Fission Heat Sink
|
||||||
|
|
||||||
|
@ -9,6 +7,15 @@ tile.nuclearcraft.salt_fission_heater_sic_sic_cmc.name=SiC-SiC CMC Fission Coola
|
||||||
tile.nuclearcraft.fission_heater_port_extreme.name=Extreme Alloy Fission Coolant Heater Port
|
tile.nuclearcraft.fission_heater_port_extreme.name=Extreme Alloy Fission Coolant Heater Port
|
||||||
tile.nuclearcraft.fission_heater_port_sic_sic_cmc.name=SiC-SiC CMC Fission Coolant Heater Port
|
tile.nuclearcraft.fission_heater_port_sic_sic_cmc.name=SiC-SiC CMC Fission Coolant Heater Port
|
||||||
|
|
||||||
|
tile.nuclearcraft.turbine_dynamo_coil_extreme.name=Extreme Alloy Turbine Dynamo Coil
|
||||||
|
tile.nuclearcraft.turbine_dynamo_coil_sic_sic_cmc.name=SiC-SiC CMC Turbine Dynamo Coil
|
||||||
|
|
||||||
|
tile.nuclearcraft.turbine_rotor_blade_manganese.name=Manganese Turbine Rotor Blade
|
||||||
|
tile.nuclearcraft.turbine_rotor_blade_copper.name=Copper Turbine Rotor Blade
|
||||||
|
|
||||||
|
tile.nuclearcraft.turbine_rotor_stator_magnesium.name=Magnesium Turbine Rotor Stator
|
||||||
|
tile.nuclearcraft.turbine_rotor_stator_boron.name=Boron Turbine Rotor Stator
|
||||||
|
|
||||||
nc.sf.extreme_sink0=%s valid extreme alloy sink
|
nc.sf.extreme_sink0=%s valid extreme alloy sink
|
||||||
nc.sf.extreme_sink1=%s valid extreme alloy sinks
|
nc.sf.extreme_sink1=%s valid extreme alloy sinks
|
||||||
nc.sf.sic_sic_cmc_sink0=%s valid SiC-SiC CMC sink
|
nc.sf.sic_sic_cmc_sink0=%s valid SiC-SiC CMC sink
|
||||||
|
@ -19,18 +26,6 @@ nc.sf.extreme_heater1=%s functional extreme alloy heaters
|
||||||
nc.sf.sic_sic_cmc_heater0=%s functional SiC-SiC CMC heater
|
nc.sf.sic_sic_cmc_heater0=%s functional SiC-SiC CMC heater
|
||||||
nc.sf.sic_sic_cmc_heater1=%s functional SiC-SiC CMC heaters
|
nc.sf.sic_sic_cmc_heater1=%s functional SiC-SiC CMC heaters
|
||||||
|
|
||||||
|
|
||||||
# Addon Test B
|
|
||||||
|
|
||||||
tile.nuclearcraft.turbine_dynamo_coil_extreme.name=Extreme Alloy Turbine Dynamo Coil
|
|
||||||
tile.nuclearcraft.turbine_dynamo_coil_sic_sic_cmc.name=SiC-SiC CMC Turbine Dynamo Coil
|
|
||||||
|
|
||||||
tile.nuclearcraft.turbine_rotor_blade_manganese.name=Manganese Turbine Rotor Blade
|
|
||||||
tile.nuclearcraft.turbine_rotor_blade_copper.name=Copper Turbine Rotor Blade
|
|
||||||
|
|
||||||
tile.nuclearcraft.turbine_rotor_stator_magnesium.name=Magnesium Turbine Rotor Stator
|
|
||||||
tile.nuclearcraft.turbine_rotor_stator_boron.name=Boron Turbine Rotor Stator
|
|
||||||
|
|
||||||
nc.sf.extreme_coil0=%s extreme alloy dynamo coil
|
nc.sf.extreme_coil0=%s extreme alloy dynamo coil
|
||||||
nc.sf.extreme_coil1=%s extreme alloy dynamo coils
|
nc.sf.extreme_coil1=%s extreme alloy dynamo coils
|
||||||
nc.sf.sic_sic_cmc_coil0=%s SiC-SiC CMC dynamo coil
|
nc.sf.sic_sic_cmc_coil0=%s SiC-SiC CMC dynamo coil
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#loader nc_preinit
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerFissionSink("extreme", 210, "exactly one sic_sic_cmc sink");
|
|
||||||
mods.nuclearcraft.Registration.registerFissionSink("sic_sic_cmc", 215, "exactly one lead sink");
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerFissionHeater("extreme", "tritium", 1, "deuterium", 1, 210, "exactly one sic_sic_cmc heater");
|
|
||||||
mods.nuclearcraft.Registration.registerFissionHeater("sic_sic_cmc", "helium3", 1, "helium", 1, 215, "exactly one lead heater");
|
|
|
@ -1,5 +1,11 @@
|
||||||
#loader nc_preinit
|
#loader nc_preinit
|
||||||
|
|
||||||
|
mods.nuclearcraft.Registration.registerFissionSink("extreme", 210, "exactly one sic_sic_cmc sink");
|
||||||
|
mods.nuclearcraft.Registration.registerFissionSink("sic_sic_cmc", 215, "exactly one lead sink");
|
||||||
|
|
||||||
|
mods.nuclearcraft.Registration.registerFissionHeater("extreme", "tritium", 1, "deuterium", 1, 210, "exactly one sic_sic_cmc heater");
|
||||||
|
mods.nuclearcraft.Registration.registerFissionHeater("sic_sic_cmc", "helium3", 1, "helium", 1, 215, "exactly one lead heater");
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineCoil("extreme", 1.14, "four of any coil");
|
mods.nuclearcraft.Registration.registerTurbineCoil("extreme", 1.14, "four of any coil");
|
||||||
mods.nuclearcraft.Registration.registerTurbineCoil("sic_sic_cmc", 1.16, "exactly two axial connectors");
|
mods.nuclearcraft.Registration.registerTurbineCoil("sic_sic_cmc", 1.16, "exactly two axial connectors");
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#loader nc_preinit
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerFissionSink("extreme", 210, "exactly one sic_sic_cmc sink");
|
|
||||||
mods.nuclearcraft.Registration.registerFissionSink("sic_sic_cmc", 215, "exactly one lead sink");
|
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerFissionHeater("extreme", "tritium", 1, "deuterium", 1, 210, "exactly one sic_sic_cmc heater");
|
|
||||||
mods.nuclearcraft.Registration.registerFissionHeater("sic_sic_cmc", "helium3", 1, "helium", 1, 215, "exactly one lead heater");
|
|
|
@ -1,5 +1,11 @@
|
||||||
#loader nc_preinit
|
#loader nc_preinit
|
||||||
|
|
||||||
|
mods.nuclearcraft.Registration.registerFissionSink("extreme", 210, "exactly one sic_sic_cmc sink");
|
||||||
|
mods.nuclearcraft.Registration.registerFissionSink("sic_sic_cmc", 215, "exactly one lead sink");
|
||||||
|
|
||||||
|
mods.nuclearcraft.Registration.registerFissionHeater("extreme", "tritium", 1, "deuterium", 1, 210, "exactly one sic_sic_cmc heater");
|
||||||
|
mods.nuclearcraft.Registration.registerFissionHeater("sic_sic_cmc", "helium3", 1, "helium", 1, 215, "exactly one lead heater");
|
||||||
|
|
||||||
mods.nuclearcraft.Registration.registerTurbineCoil("extreme", 1.14, "four of any coil");
|
mods.nuclearcraft.Registration.registerTurbineCoil("extreme", 1.14, "four of any coil");
|
||||||
mods.nuclearcraft.Registration.registerTurbineCoil("sic_sic_cmc", 1.16, "exactly two axial connectors");
|
mods.nuclearcraft.Registration.registerTurbineCoil("sic_sic_cmc", 1.16, "exactly two axial connectors");
|
||||||
|
|
|
@ -6,6 +6,4 @@
|
||||||
|
|
||||||
#mods.nuclearcraft.Manufactory.addRecipe(<minecraft:magma_cream>*5, null);
|
#mods.nuclearcraft.Manufactory.addRecipe(<minecraft:magma_cream>*5, null);
|
||||||
|
|
||||||
#mods.nuclearcraft.SolidFission.addRecipe(<minecraft:magma_cream>*4 | <minecraft:diamond>*2, mods.nuclearcraft.ChanceItemIngredient.create(<ore:ingotSilver>*4, 50, 2), 100, 125, 1.15, 99, true, 0.005);
|
#mods.nuclearcraft.SolidFission.addRecipe(<minecraft:magma_cream>*4 | <minecraft:diamond>*2, mods.nuclearcraft.ChanceItemIngredient.create(<ore:ingotSilver>*4, 50, 2), 100, 125, 1.15, 99, true, 0.005);
|
||||||
|
|
||||||
#mods.nuclearcraft.DecayHastener.removeRecipeWithInput(<ore:ingotUranium235> | <ore:ingotUranium235Oxide> | <ore:ingotUranium235Nitride>);
|
|
|
@ -10,7 +10,6 @@ public class ModCheck {
|
||||||
private static boolean ic2Loaded = false;
|
private static boolean ic2Loaded = false;
|
||||||
private static boolean mekanismLoaded = false;
|
private static boolean mekanismLoaded = false;
|
||||||
private static boolean craftTweakerLoaded = false;
|
private static boolean craftTweakerLoaded = false;
|
||||||
private static boolean contentTweakerLoaded = false;
|
|
||||||
private static boolean mantleLoaded = false;
|
private static boolean mantleLoaded = false;
|
||||||
private static boolean tinkersLoaded = false;
|
private static boolean tinkersLoaded = false;
|
||||||
private static boolean constructsArmoryLoaded = false;
|
private static boolean constructsArmoryLoaded = false;
|
||||||
|
@ -37,7 +36,6 @@ public class ModCheck {
|
||||||
ic2Loaded = Loader.isModLoaded("ic2");
|
ic2Loaded = Loader.isModLoaded("ic2");
|
||||||
mekanismLoaded = Loader.isModLoaded("mekanism");
|
mekanismLoaded = Loader.isModLoaded("mekanism");
|
||||||
craftTweakerLoaded = Loader.isModLoaded("crafttweaker");
|
craftTweakerLoaded = Loader.isModLoaded("crafttweaker");
|
||||||
contentTweakerLoaded = craftTweakerLoaded && Loader.isModLoaded("contenttweaker");
|
|
||||||
mantleLoaded = Loader.isModLoaded("mantle");
|
mantleLoaded = Loader.isModLoaded("mantle");
|
||||||
tinkersLoaded = mantleLoaded && Loader.isModLoaded("tconstruct");
|
tinkersLoaded = mantleLoaded && Loader.isModLoaded("tconstruct");
|
||||||
constructsArmoryLoaded = tinkersLoaded && Loader.isModLoaded("conarm");
|
constructsArmoryLoaded = tinkersLoaded && Loader.isModLoaded("conarm");
|
||||||
|
@ -74,10 +72,6 @@ public class ModCheck {
|
||||||
return craftTweakerLoaded;
|
return craftTweakerLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean contentTweakerLoaded() {
|
|
||||||
return contentTweakerLoaded;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean mantleLoaded() {
|
public static boolean mantleLoaded() {
|
||||||
return mantleLoaded;
|
return mantleLoaded;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,18 @@ public class BlockActivatable extends BlockTile implements IActivatable, ITileTy
|
||||||
return getDefaultState().withProperty(ACTIVE, Boolean.valueOf(false));
|
return getDefaultState().withProperty(ACTIVE, Boolean.valueOf(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() == type.getBlock()) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class Transparent extends BlockActivatable {
|
public static class Transparent extends BlockActivatable {
|
||||||
|
|
||||||
protected final boolean smartRender;
|
protected final boolean smartRender;
|
||||||
|
|
|
@ -1,22 +1,8 @@
|
||||||
package nc.block.tile;
|
package nc.block.tile;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
|
||||||
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public interface IActivatable extends IDynamicState {
|
public interface IActivatable {
|
||||||
|
|
||||||
public default void setActivity(boolean isActive, TileEntity tile) {
|
public void setState(boolean isActive, TileEntity tile);
|
||||||
World world = tile.getWorld();
|
|
||||||
BlockPos pos = tile.getPos();
|
|
||||||
IBlockState state = world.getBlockState(pos);
|
|
||||||
if (!world.isRemote && getClass().isInstance(state.getBlock())) {
|
|
||||||
if (isActive != state.getValue(ACTIVE)) {
|
|
||||||
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
package nc.block.tile;
|
|
||||||
|
|
||||||
public interface IDynamicState {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +1,29 @@
|
||||||
package nc.block.tile.processor;
|
package nc.block.tile.processor;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_HORIZONTAL;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import nc.NuclearCraft;
|
import nc.NuclearCraft;
|
||||||
import nc.block.tile.IActivatable;
|
import nc.block.tile.IActivatable;
|
||||||
import nc.block.tile.IDynamicState;
|
import nc.init.NCBlocks;
|
||||||
import nc.tab.NCTabs;
|
import nc.tab.NCTabs;
|
||||||
import nc.tile.processor.TileNuclearFurnace;
|
import nc.tile.processor.TileNuclearFurnace;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.ITileEntityProvider;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.*;
|
||||||
import net.minecraft.inventory.InventoryHelper;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.EnumParticleTypes;
|
|
||||||
import net.minecraft.util.Mirror;
|
|
||||||
import net.minecraft.util.Rotation;
|
|
||||||
import net.minecraft.util.SoundCategory;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;
|
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.*;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockNuclearFurnace extends Block implements ITileEntityProvider, IActivatable {
|
public class BlockNuclearFurnace extends Block implements ITileEntityProvider, IActivatable {
|
||||||
|
|
||||||
|
@ -101,6 +91,18 @@ public class BlockNuclearFurnace extends Block implements ITileEntityProvider, I
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() == NCBlocks.nuclear_furnace) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@SuppressWarnings("incomplete-switch")
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
|
|
@ -1,27 +1,21 @@
|
||||||
package nc.block.tile.processor;
|
package nc.block.tile.processor;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_HORIZONTAL;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import nc.block.tile.BlockSidedTile;
|
import nc.block.tile.*;
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.block.tile.ITileType;
|
|
||||||
import nc.enumm.BlockEnums.ProcessorType;
|
import nc.enumm.BlockEnums.ProcessorType;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.properties.IProperty;
|
import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.*;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockProcessor extends BlockSidedTile implements IActivatable, ITileType {
|
public class BlockProcessor extends BlockSidedTile implements IActivatable, ITileType {
|
||||||
|
|
||||||
|
@ -73,6 +67,18 @@ public class BlockProcessor extends BlockSidedTile implements IActivatable, ITil
|
||||||
return getDefaultState().withProperty(FACING_HORIZONTAL, placer.getHorizontalFacing().getOpposite()).withProperty(ACTIVE, Boolean.valueOf(false));
|
return getDefaultState().withProperty(FACING_HORIZONTAL, placer.getHorizontalFacing().getOpposite()).withProperty(ACTIVE, Boolean.valueOf(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() == type.getBlock()) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||||
|
|
|
@ -1001,7 +1001,7 @@ public class NCConfig {
|
||||||
propertyOreDictRawMaterialRecipes.setLanguageKey("gui.nc.config.ore_dict_raw_material_recipes");
|
propertyOreDictRawMaterialRecipes.setLanguageKey("gui.nc.config.ore_dict_raw_material_recipes");
|
||||||
Property propertyOreDictPriorityBool = config.get(CATEGORY_MISC, "ore_dict_priority_bool", true, Lang.localise("gui.nc.config.ore_dict_priority_bool.comment"));
|
Property propertyOreDictPriorityBool = config.get(CATEGORY_MISC, "ore_dict_priority_bool", true, Lang.localise("gui.nc.config.ore_dict_priority_bool.comment"));
|
||||||
propertyOreDictPriorityBool.setLanguageKey("gui.nc.config.ore_dict_priority_bool");
|
propertyOreDictPriorityBool.setLanguageKey("gui.nc.config.ore_dict_priority_bool");
|
||||||
Property propertyOreDictPriority = config.get(CATEGORY_MISC, "ore_dict_priority", new String[] {"minecraft", "thermalfoundation", "techreborn", "nuclearcraft", "immersiveengineering", "mekanism", "ic2", "appliedenergistics2", "refinedstorage", "actuallyadditions", "libvulpes", "advancedrocketry", "thaumcraft", "biomesoplenty"}, Lang.localise("gui.nc.config.ore_dict_priority.comment"));
|
Property propertyOreDictPriority = config.get(CATEGORY_MISC, "ore_dict_priority", new String[] {"minecraft", "thermalfoundation", "techreborn", "nuclearcraft", "immersiveengineering", "mekanism", "ic2", "appliedenergistics2", "refinedstorage", "actuallyadditions", "advancedRocketry", "thaumcraft", "biomesoplenty"}, Lang.localise("gui.nc.config.ore_dict_priority.comment"));
|
||||||
propertyOreDictPriority.setLanguageKey("gui.nc.config.ore_dict_priority");
|
propertyOreDictPriority.setLanguageKey("gui.nc.config.ore_dict_priority");
|
||||||
Property propertyHWYLAEnabled = config.get(CATEGORY_MISC, "hwyla_enabled", true, Lang.localise("gui.nc.config.hwyla_enabled.comment"));
|
Property propertyHWYLAEnabled = config.get(CATEGORY_MISC, "hwyla_enabled", true, Lang.localise("gui.nc.config.hwyla_enabled.comment"));
|
||||||
propertyHWYLAEnabled.setLanguageKey("gui.nc.config.hwyla_enabled");
|
propertyHWYLAEnabled.setLanguageKey("gui.nc.config.hwyla_enabled");
|
||||||
|
|
|
@ -264,7 +264,7 @@ public class BlockEnums {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ActivatableTileType implements IStringSerializable {
|
public enum ActivatableTileType implements IStringSerializable {
|
||||||
;
|
/* FUSION_ELECTROMAGNET("fusion_electromagnet", NCTabs.FUSION), FUSION_ELECTROMAGNET_TRANSPARENT("fusion_electromagnet_transparent", NCTabs.FUSION), ACCELERATOR_ELECTROMAGNET("accelerator_electromagnet", NCTabs.ACCELERATOR), ELECTROMAGNET_SUPERCOOLER("electromagnet_supercooler", NCTabs.ACCELERATOR) */;
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final CreativeTabs tab;
|
private final CreativeTabs tab;
|
||||||
|
@ -281,6 +281,7 @@ public class BlockEnums {
|
||||||
|
|
||||||
public TileEntity getTile() {
|
public TileEntity getTile() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
|
/* case FUSION_ELECTROMAGNET: return new TilePassive.FusionElectromagnet(); case FUSION_ELECTROMAGNET_TRANSPARENT: return new TilePassive.FusionElectromagnet(); case ACCELERATOR_ELECTROMAGNET: return new TilePassive.AcceleratorElectromagnet(); case ELECTROMAGNET_SUPERCOOLER: return new TilePassive.ElectromagnetSupercooler(); */
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -292,8 +293,9 @@ public class BlockEnums {
|
||||||
|
|
||||||
public Block getBlock() {
|
public Block getBlock() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
|
/* case FUSION_ELECTROMAGNET: return NCBlocks.fusion_electromagnet; case FUSION_ELECTROMAGNET_TRANSPARENT: return NCBlocks.fusion_electromagnet_transparent; case ACCELERATOR_ELECTROMAGNET: return NCBlocks.accelerator_electromagnet; case ELECTROMAGNET_SUPERCOOLER: return NCBlocks.electromagnet_supercooler; */
|
||||||
default:
|
default:
|
||||||
return null;
|
return /* NCBlocks.fusion_electromagnet */ null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -598,14 +598,14 @@ public class NCBlocks {
|
||||||
|
|
||||||
public static void registerRenders() {
|
public static void registerRenders() {
|
||||||
for (int i = 0; i < MetaEnums.OreType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.OreType.values().length; i++) {
|
||||||
registerRender(ore, i, "type=" + MetaEnums.OreType.values()[i].getName());
|
registerRender(ore, i, MetaEnums.OreType.values()[i].getName());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < MetaEnums.IngotType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.IngotType.values().length; i++) {
|
||||||
registerRender(ingot_block, i, "type=" + MetaEnums.IngotType.values()[i].getName());
|
registerRender(ingot_block, i, MetaEnums.IngotType.values()[i].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < MetaEnums.FertileIsotopeType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.FertileIsotopeType.values().length; i++) {
|
||||||
registerRender(fertile_isotope, i, "type=" + MetaEnums.FertileIsotopeType.values()[i].getName());
|
registerRender(fertile_isotope, i, MetaEnums.FertileIsotopeType.values()[i].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
registerRender(supercold_ice);
|
registerRender(supercold_ice);
|
||||||
|
@ -708,16 +708,16 @@ public class NCBlocks {
|
||||||
registerRender(fission_conductor);
|
registerRender(fission_conductor);
|
||||||
registerRender(fission_monitor);
|
registerRender(fission_monitor);
|
||||||
for (int i = 0; i < MetaEnums.NeutronReflectorType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.NeutronReflectorType.values().length; i++) {
|
||||||
registerRender(fission_reflector, i, "type=" + MetaEnums.NeutronReflectorType.values()[i].getName());
|
registerRender(fission_reflector, i, MetaEnums.NeutronReflectorType.values()[i].getName());
|
||||||
}
|
}
|
||||||
registerRender(fission_power_port);
|
registerRender(fission_power_port);
|
||||||
registerRender(fission_vent);
|
registerRender(fission_vent);
|
||||||
registerRender(fission_irradiator);
|
registerRender(fission_irradiator);
|
||||||
for (int i = 0; i < MetaEnums.NeutronSourceType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.NeutronSourceType.values().length; i++) {
|
||||||
registerRender(fission_source, i, "active=false,facing=south,type=" + MetaEnums.NeutronSourceType.values()[i].getName());
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(fission_source), i, new ModelResourceLocation(new ResourceLocation(Global.MOD_ID, fission_source.getRegistryName().getPath()), "active=false,facing=south,type=" + MetaEnums.NeutronSourceType.values()[i].getName()));
|
||||||
}
|
}
|
||||||
for (int i = 0; i < MetaEnums.NeutronShieldType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.NeutronShieldType.values().length; i++) {
|
||||||
registerRender(fission_shield, i, "active=true,type=" + MetaEnums.NeutronShieldType.values()[i].getName());
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(fission_shield), i, new ModelResourceLocation(new ResourceLocation(Global.MOD_ID, fission_shield.getRegistryName().getPath()), "active=true,type=" + MetaEnums.NeutronShieldType.values()[i].getName()));
|
||||||
}
|
}
|
||||||
registerRender(fission_computer_port);
|
registerRender(fission_computer_port);
|
||||||
|
|
||||||
|
@ -727,10 +727,10 @@ public class NCBlocks {
|
||||||
|
|
||||||
registerRender(fission_vessel_port);
|
registerRender(fission_vessel_port);
|
||||||
for (int i = 0; i < MetaEnums.CoolantHeaterType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.CoolantHeaterType.values().length; i++) {
|
||||||
registerRender(fission_heater_port, i, "active=false,axis=z,type=" + MetaEnums.CoolantHeaterType.values()[i].getName());
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(fission_heater_port), i, new ModelResourceLocation(new ResourceLocation(Global.MOD_ID, fission_heater_port.getRegistryName().getPath()), "axis=z,type=" + MetaEnums.CoolantHeaterType.values()[i].getName()));
|
||||||
}
|
}
|
||||||
for (int i = 0; i < MetaEnums.CoolantHeaterType2.values().length; i++) {
|
for (int i = 0; i < MetaEnums.CoolantHeaterType2.values().length; i++) {
|
||||||
registerRender(fission_heater_port2, i, "active=false,axis=z,type=" + MetaEnums.CoolantHeaterType2.values()[i].getName());
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(fission_heater_port2), i, new ModelResourceLocation(new ResourceLocation(Global.MOD_ID, fission_heater_port2.getRegistryName().getPath()), "axis=z,type=" + MetaEnums.CoolantHeaterType2.values()[i].getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
registerRender(fission_shield_manager);
|
registerRender(fission_shield_manager);
|
||||||
|
@ -738,19 +738,19 @@ public class NCBlocks {
|
||||||
registerRender(solid_fission_controller);
|
registerRender(solid_fission_controller);
|
||||||
registerRender(solid_fission_cell);
|
registerRender(solid_fission_cell);
|
||||||
for (int i = 0; i < MetaEnums.HeatSinkType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.HeatSinkType.values().length; i++) {
|
||||||
registerRender(solid_fission_sink, i, "type=" + MetaEnums.HeatSinkType.values()[i].getName());
|
registerRender(solid_fission_sink, i, MetaEnums.HeatSinkType.values()[i].getName());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < MetaEnums.HeatSinkType2.values().length; i++) {
|
for (int i = 0; i < MetaEnums.HeatSinkType2.values().length; i++) {
|
||||||
registerRender(solid_fission_sink2, i, "type=" + MetaEnums.HeatSinkType2.values()[i].getName());
|
registerRender(solid_fission_sink2, i, MetaEnums.HeatSinkType2.values()[i].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
registerRender(salt_fission_controller);
|
registerRender(salt_fission_controller);
|
||||||
registerRender(salt_fission_vessel);
|
registerRender(salt_fission_vessel);
|
||||||
for (int i = 0; i < MetaEnums.CoolantHeaterType.values().length; i++) {
|
for (int i = 0; i < MetaEnums.CoolantHeaterType.values().length; i++) {
|
||||||
registerRender(salt_fission_heater, i, "type=" + MetaEnums.CoolantHeaterType.values()[i].getName());
|
registerRender(salt_fission_heater, i, MetaEnums.CoolantHeaterType.values()[i].getName());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < MetaEnums.CoolantHeaterType2.values().length; i++) {
|
for (int i = 0; i < MetaEnums.CoolantHeaterType2.values().length; i++) {
|
||||||
registerRender(salt_fission_heater2, i, "type=" + MetaEnums.CoolantHeaterType2.values()[i].getName());
|
registerRender(salt_fission_heater2, i, MetaEnums.CoolantHeaterType2.values()[i].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
registerRender(heat_exchanger_controller);
|
registerRender(heat_exchanger_controller);
|
||||||
|
@ -777,7 +777,7 @@ public class NCBlocks {
|
||||||
registerRender(turbine_rotor_stator);
|
registerRender(turbine_rotor_stator);
|
||||||
registerRender(turbine_rotor_bearing);
|
registerRender(turbine_rotor_bearing);
|
||||||
for (int i = 0; i < TurbineDynamoCoilType.values().length; i++) {
|
for (int i = 0; i < TurbineDynamoCoilType.values().length; i++) {
|
||||||
registerRender(turbine_dynamo_coil, i, "type=" + TurbineDynamoCoilType.values()[i].getName());
|
registerRender(turbine_dynamo_coil, i, TurbineDynamoCoilType.values()[i].getName());
|
||||||
}
|
}
|
||||||
registerRender(turbine_coil_connector);
|
registerRender(turbine_coil_connector);
|
||||||
registerRender(turbine_inlet);
|
registerRender(turbine_inlet);
|
||||||
|
@ -816,13 +816,13 @@ public class NCBlocks {
|
||||||
registerRender(quantum_computer_qubit);
|
registerRender(quantum_computer_qubit);
|
||||||
|
|
||||||
for (int i = 0; i < QuantumGateEnums.SingleType.values().length; i++) {
|
for (int i = 0; i < QuantumGateEnums.SingleType.values().length; i++) {
|
||||||
registerRender(quantum_computer_gate_single, i, "type=" + QuantumGateEnums.SingleType.values()[i].getName());
|
registerRender(quantum_computer_gate_single, i, QuantumGateEnums.SingleType.values()[i].getName());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < QuantumGateEnums.ControlType.values().length; i++) {
|
for (int i = 0; i < QuantumGateEnums.ControlType.values().length; i++) {
|
||||||
registerRender(quantum_computer_gate_control, i, "type=" + QuantumGateEnums.ControlType.values()[i].getName());
|
registerRender(quantum_computer_gate_control, i, QuantumGateEnums.ControlType.values()[i].getName());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < QuantumGateEnums.SwapType.values().length; i++) {
|
for (int i = 0; i < QuantumGateEnums.SwapType.values().length; i++) {
|
||||||
registerRender(quantum_computer_gate_swap, i, "type=" + QuantumGateEnums.SwapType.values()[i].getName());
|
registerRender(quantum_computer_gate_swap, i, QuantumGateEnums.SwapType.values()[i].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
registerRender(quantum_computer_connector);
|
registerRender(quantum_computer_connector);
|
||||||
|
@ -869,7 +869,7 @@ public class NCBlocks {
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerRender(Block block, int meta, String variant) {
|
public static void registerRender(Block block, int meta, String type) {
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(new ResourceLocation(Global.MOD_ID, block.getRegistryName().getPath()), variant));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(new ResourceLocation(Global.MOD_ID, block.getRegistryName().getPath()), "type=" + type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package nc.init;
|
||||||
|
|
||||||
import nc.Global;
|
import nc.Global;
|
||||||
import nc.enumm.MetaEnums;
|
import nc.enumm.MetaEnums;
|
||||||
|
import nc.integration.crafttweaker.CTRegistration;
|
||||||
import nc.multiblock.battery.tile.TileBattery;
|
import nc.multiblock.battery.tile.TileBattery;
|
||||||
import nc.multiblock.fission.salt.tile.TileSaltFissionController;
|
import nc.multiblock.fission.salt.tile.TileSaltFissionController;
|
||||||
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
||||||
|
@ -145,6 +146,7 @@ public class NCTiles {
|
||||||
GameRegistry.registerTileEntity(TileFissionHeaterPort.LiquidHelium.class, Global.MOD_ID + ":fission_heater_port_" + MetaEnums.CoolantHeaterType2.LIQUID_HELIUM.getName());
|
GameRegistry.registerTileEntity(TileFissionHeaterPort.LiquidHelium.class, Global.MOD_ID + ":fission_heater_port_" + MetaEnums.CoolantHeaterType2.LIQUID_HELIUM.getName());
|
||||||
GameRegistry.registerTileEntity(TileFissionHeaterPort.Enderium.class, Global.MOD_ID + ":fission_heater_port_" + MetaEnums.CoolantHeaterType2.ENDERIUM.getName());
|
GameRegistry.registerTileEntity(TileFissionHeaterPort.Enderium.class, Global.MOD_ID + ":fission_heater_port_" + MetaEnums.CoolantHeaterType2.ENDERIUM.getName());
|
||||||
GameRegistry.registerTileEntity(TileFissionHeaterPort.Cryotheum.class, Global.MOD_ID + ":fission_heater_port_" + MetaEnums.CoolantHeaterType2.CRYOTHEUM.getName());
|
GameRegistry.registerTileEntity(TileFissionHeaterPort.Cryotheum.class, Global.MOD_ID + ":fission_heater_port_" + MetaEnums.CoolantHeaterType2.CRYOTHEUM.getName());
|
||||||
|
GameRegistry.registerTileEntity(CTRegistration.TileHeaterPort.class, Global.MOD_ID + ":fission_heater_port_ct");
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileFissionShieldManager.class, Global.MOD_ID + ":fission_shield_manager");
|
GameRegistry.registerTileEntity(TileFissionShieldManager.class, Global.MOD_ID + ":fission_shield_manager");
|
||||||
|
|
||||||
|
@ -183,6 +185,7 @@ public class NCTiles {
|
||||||
GameRegistry.registerTileEntity(TileSolidFissionSink.LiquidHelium.class, Global.MOD_ID + ":solid_fission_sink_" + MetaEnums.HeatSinkType2.LIQUID_HELIUM.getName());
|
GameRegistry.registerTileEntity(TileSolidFissionSink.LiquidHelium.class, Global.MOD_ID + ":solid_fission_sink_" + MetaEnums.HeatSinkType2.LIQUID_HELIUM.getName());
|
||||||
GameRegistry.registerTileEntity(TileSolidFissionSink.Enderium.class, Global.MOD_ID + ":solid_fission_sink_" + MetaEnums.HeatSinkType2.ENDERIUM.getName());
|
GameRegistry.registerTileEntity(TileSolidFissionSink.Enderium.class, Global.MOD_ID + ":solid_fission_sink_" + MetaEnums.HeatSinkType2.ENDERIUM.getName());
|
||||||
GameRegistry.registerTileEntity(TileSolidFissionSink.Cryotheum.class, Global.MOD_ID + ":solid_fission_sink_" + MetaEnums.HeatSinkType2.CRYOTHEUM.getName());
|
GameRegistry.registerTileEntity(TileSolidFissionSink.Cryotheum.class, Global.MOD_ID + ":solid_fission_sink_" + MetaEnums.HeatSinkType2.CRYOTHEUM.getName());
|
||||||
|
GameRegistry.registerTileEntity(CTRegistration.TileSink.class, Global.MOD_ID + ":solid_fission_sink_ct");
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileSaltFissionController.class, Global.MOD_ID + ":salt_fission_controller");
|
GameRegistry.registerTileEntity(TileSaltFissionController.class, Global.MOD_ID + ":salt_fission_controller");
|
||||||
GameRegistry.registerTileEntity(TileSaltFissionVessel.class, Global.MOD_ID + ":salt_fission_vessel");
|
GameRegistry.registerTileEntity(TileSaltFissionVessel.class, Global.MOD_ID + ":salt_fission_vessel");
|
||||||
|
@ -219,6 +222,7 @@ public class NCTiles {
|
||||||
GameRegistry.registerTileEntity(TileSaltFissionHeater.LiquidHelium.class, Global.MOD_ID + ":salt_fission_heater_" + MetaEnums.CoolantHeaterType2.LIQUID_HELIUM.getName());
|
GameRegistry.registerTileEntity(TileSaltFissionHeater.LiquidHelium.class, Global.MOD_ID + ":salt_fission_heater_" + MetaEnums.CoolantHeaterType2.LIQUID_HELIUM.getName());
|
||||||
GameRegistry.registerTileEntity(TileSaltFissionHeater.Enderium.class, Global.MOD_ID + ":salt_fission_heater_" + MetaEnums.CoolantHeaterType2.ENDERIUM.getName());
|
GameRegistry.registerTileEntity(TileSaltFissionHeater.Enderium.class, Global.MOD_ID + ":salt_fission_heater_" + MetaEnums.CoolantHeaterType2.ENDERIUM.getName());
|
||||||
GameRegistry.registerTileEntity(TileSaltFissionHeater.Cryotheum.class, Global.MOD_ID + ":salt_fission_heater_" + MetaEnums.CoolantHeaterType2.CRYOTHEUM.getName());
|
GameRegistry.registerTileEntity(TileSaltFissionHeater.Cryotheum.class, Global.MOD_ID + ":salt_fission_heater_" + MetaEnums.CoolantHeaterType2.CRYOTHEUM.getName());
|
||||||
|
GameRegistry.registerTileEntity(CTRegistration.TileHeater.class, Global.MOD_ID + ":salt_fission_heater_ct");
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileHeatExchangerController.class, Global.MOD_ID + ":heat_exchanger_controller");
|
GameRegistry.registerTileEntity(TileHeatExchangerController.class, Global.MOD_ID + ":heat_exchanger_controller");
|
||||||
GameRegistry.registerTileEntity(TileHeatExchangerCasing.class, Global.MOD_ID + ":heat_exchanger_casing");
|
GameRegistry.registerTileEntity(TileHeatExchangerCasing.class, Global.MOD_ID + ":heat_exchanger_casing");
|
||||||
|
@ -238,17 +242,14 @@ public class NCTiles {
|
||||||
GameRegistry.registerTileEntity(TileTurbineCasing.class, Global.MOD_ID + ":turbine_casing");
|
GameRegistry.registerTileEntity(TileTurbineCasing.class, Global.MOD_ID + ":turbine_casing");
|
||||||
GameRegistry.registerTileEntity(TileTurbineGlass.class, Global.MOD_ID + ":turbine_glass");
|
GameRegistry.registerTileEntity(TileTurbineGlass.class, Global.MOD_ID + ":turbine_glass");
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorShaft.class, Global.MOD_ID + ":turbine_rotor_shaft");
|
GameRegistry.registerTileEntity(TileTurbineRotorShaft.class, Global.MOD_ID + ":turbine_rotor_shaft");
|
||||||
|
GameRegistry.registerTileEntity(TileTurbineRotorBlade.class, Global.MOD_ID + ":turbine_rotor_blade");
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorBlade.class, Global.MOD_ID + ":turbine_rotor_blade_");
|
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorBlade.Steel.class, Global.MOD_ID + ":turbine_rotor_blade_" + TurbineRotorBladeType.STEEL.toString());
|
GameRegistry.registerTileEntity(TileTurbineRotorBlade.Steel.class, Global.MOD_ID + ":turbine_rotor_blade_" + TurbineRotorBladeType.STEEL.toString());
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorBlade.Extreme.class, Global.MOD_ID + ":turbine_rotor_blade_" + TurbineRotorBladeType.EXTREME.toString());
|
GameRegistry.registerTileEntity(TileTurbineRotorBlade.Extreme.class, Global.MOD_ID + ":turbine_rotor_blade_" + TurbineRotorBladeType.EXTREME.toString());
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorBlade.SicSicCMC.class, Global.MOD_ID + ":turbine_rotor_blade_" + TurbineRotorBladeType.SIC_SIC_CMC.toString());
|
GameRegistry.registerTileEntity(TileTurbineRotorBlade.SicSicCMC.class, Global.MOD_ID + ":turbine_rotor_blade_" + TurbineRotorBladeType.SIC_SIC_CMC.toString());
|
||||||
|
GameRegistry.registerTileEntity(CTRegistration.TileBlade.class, Global.MOD_ID + ":turbine_rotor_blade_ct");
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorStator.class, Global.MOD_ID + ":turbine_rotor_stator_");
|
GameRegistry.registerTileEntity(TileTurbineRotorStator.class, Global.MOD_ID + ":turbine_rotor_stator");
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorStator.Standard.class, Global.MOD_ID + ":turbine_rotor_stator_standard");
|
GameRegistry.registerTileEntity(CTRegistration.TileStator.class, Global.MOD_ID + ":turbine_rotor_stator_ct");
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileTurbineRotorBearing.class, Global.MOD_ID + ":turbine_rotor_bearing");
|
GameRegistry.registerTileEntity(TileTurbineRotorBearing.class, Global.MOD_ID + ":turbine_rotor_bearing");
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.class, Global.MOD_ID + ":turbine_dynamo_coil");
|
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.class, Global.MOD_ID + ":turbine_dynamo_coil");
|
||||||
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Magnesium.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.MAGNESIUM.toString());
|
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Magnesium.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.MAGNESIUM.toString());
|
||||||
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Beryllium.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.BERYLLIUM.toString());
|
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Beryllium.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.BERYLLIUM.toString());
|
||||||
|
@ -256,7 +257,7 @@ public class NCTiles {
|
||||||
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Gold.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.GOLD.toString());
|
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Gold.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.GOLD.toString());
|
||||||
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Copper.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.COPPER.toString());
|
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Copper.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.COPPER.toString());
|
||||||
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Silver.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.SILVER.toString());
|
GameRegistry.registerTileEntity(TileTurbineDynamoCoil.Silver.class, Global.MOD_ID + ":turbine_dynamo_coil_" + TurbineDynamoCoilType.SILVER.toString());
|
||||||
|
GameRegistry.registerTileEntity(CTRegistration.TileCoil.class, Global.MOD_ID + ":turbine_dynamo_coil_ct");
|
||||||
GameRegistry.registerTileEntity(TileTurbineCoilConnector.class, Global.MOD_ID + ":turbine_coil_connector");
|
GameRegistry.registerTileEntity(TileTurbineCoilConnector.class, Global.MOD_ID + ":turbine_coil_connector");
|
||||||
GameRegistry.registerTileEntity(TileTurbineInlet.class, Global.MOD_ID + ":turbine_inlet");
|
GameRegistry.registerTileEntity(TileTurbineInlet.class, Global.MOD_ID + ":turbine_inlet");
|
||||||
GameRegistry.registerTileEntity(TileTurbineOutlet.class, Global.MOD_ID + ":turbine_outlet");
|
GameRegistry.registerTileEntity(TileTurbineOutlet.class, Global.MOD_ID + ":turbine_outlet");
|
||||||
|
@ -284,8 +285,17 @@ public class NCTiles {
|
||||||
GameRegistry.registerTileEntity(TileBattery.LithiumIonBatteryDU.class, Global.MOD_ID + ":lithium_ion_battery_du");
|
GameRegistry.registerTileEntity(TileBattery.LithiumIonBatteryDU.class, Global.MOD_ID + ":lithium_ion_battery_du");
|
||||||
GameRegistry.registerTileEntity(TileBattery.LithiumIonBatteryElite.class, Global.MOD_ID + ":lithium_ion_battery_elite");
|
GameRegistry.registerTileEntity(TileBattery.LithiumIonBatteryElite.class, Global.MOD_ID + ":lithium_ion_battery_elite");
|
||||||
|
|
||||||
|
// GameRegistry.registerTileEntity(TileBuffer.class, Global.MOD_ID +
|
||||||
|
// ":buffer");
|
||||||
GameRegistry.registerTileEntity(TileBin.class, Global.MOD_ID + ":bin");
|
GameRegistry.registerTileEntity(TileBin.class, Global.MOD_ID + ":bin");
|
||||||
|
|
||||||
|
// GameRegistry.registerTileEntity(TilePassive.FusionElectromagnet.class,
|
||||||
|
// Global.MOD_ID + ":fusion_electromagnet");
|
||||||
|
// GameRegistry.registerTileEntity(TilePassive.AcceleratorElectromagnet.class,
|
||||||
|
// Global.MOD_ID + ":accelerator_electromagnet");
|
||||||
|
// GameRegistry.registerTileEntity(TilePassive.ElectromagnetSupercooler.class,
|
||||||
|
// Global.MOD_ID + ":electromagnet_supercooler");
|
||||||
|
|
||||||
GameRegistry.registerTileEntity(TilePassive.CobblestoneGenerator.class, Global.MOD_ID + ":cobblestone_generator");
|
GameRegistry.registerTileEntity(TilePassive.CobblestoneGenerator.class, Global.MOD_ID + ":cobblestone_generator");
|
||||||
GameRegistry.registerTileEntity(TilePassive.CobblestoneGeneratorCompact.class, Global.MOD_ID + ":cobblestone_generator_compact");
|
GameRegistry.registerTileEntity(TilePassive.CobblestoneGeneratorCompact.class, Global.MOD_ID + ":cobblestone_generator_compact");
|
||||||
GameRegistry.registerTileEntity(TilePassive.CobblestoneGeneratorDense.class, Global.MOD_ID + ":cobblestone_generator_dense");
|
GameRegistry.registerTileEntity(TilePassive.CobblestoneGeneratorDense.class, Global.MOD_ID + ":cobblestone_generator_dense");
|
||||||
|
|
|
@ -54,6 +54,13 @@ public class CTRegistration {
|
||||||
|
|
||||||
public static final List<RegistrationInfo> INFO_LIST = new ArrayList<>();
|
public static final List<RegistrationInfo> INFO_LIST = new ArrayList<>();
|
||||||
|
|
||||||
|
public static class TileSink extends TileSolidFissionSink {
|
||||||
|
|
||||||
|
public TileSink(String sinkName, int coolingRate, String ruleID) {
|
||||||
|
super(sinkName, coolingRate, ruleID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void registerFissionSink(String sinkID, int cooling, String rule) {
|
public static void registerFissionSink(String sinkID, int cooling, String rule) {
|
||||||
|
|
||||||
|
@ -61,7 +68,7 @@ public class CTRegistration {
|
||||||
new BlockFissionPart() {
|
new BlockFissionPart() {
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileSolidFissionSink(sinkID, cooling, sinkID + "_sink");
|
return new TileSink(sinkID, cooling, sinkID + "_sink");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -77,14 +84,28 @@ public class CTRegistration {
|
||||||
INFO_LIST.add(new FissionSinkRegistrationInfo(sink, sinkID, cooling, rule));
|
INFO_LIST.add(new FissionSinkRegistrationInfo(sink, sinkID, cooling, rule));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TileHeaterPort extends TileFissionHeaterPort {
|
||||||
|
|
||||||
|
public TileHeaterPort(String coolantName) {
|
||||||
|
super(coolantName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TileHeater extends TileSaltFissionHeater {
|
||||||
|
|
||||||
|
public TileHeater(String heaterName, String coolantName) {
|
||||||
|
super(heaterName, coolantName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void registerFissionHeater(String heaterID, String fluidInput, int inputAmount, String fluidOutput, int outputAmount, int cooling, String rule) {
|
public static void registerFissionHeater(String heaterID, String fluidInput, int inputAmount, String fluidOutput, int outputAmount, int cooling, String rule) {
|
||||||
|
|
||||||
Block port = NCBlocks.withName(
|
Block port = NCBlocks.withName(
|
||||||
new BlockFissionFluidPort(TileFissionHeaterPort.class, 303) {
|
new BlockFissionFluidPort(TileHeaterPort.class, 303) {
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileFissionHeaterPort(fluidInput);
|
return new TileHeaterPort(fluidInput);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fission_heater_port_" + heaterID);
|
"fission_heater_port_" + heaterID);
|
||||||
|
@ -93,7 +114,7 @@ public class CTRegistration {
|
||||||
new BlockFissionPart() {
|
new BlockFissionPart() {
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileSaltFissionHeater(heaterID, fluidInput);
|
return new TileHeater(heaterID, fluidInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -132,6 +153,13 @@ public class CTRegistration {
|
||||||
INFO_LIST.add(new FissionHeaterRegistrationInfo(heater, heaterID, fluidInput, inputAmount, fluidOutput, outputAmount, cooling, rule));
|
INFO_LIST.add(new FissionHeaterRegistrationInfo(heater, heaterID, fluidInput, inputAmount, fluidOutput, outputAmount, cooling, rule));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TileCoil extends TileTurbineDynamoCoil {
|
||||||
|
|
||||||
|
public TileCoil(String partName, double conductivity, String ruleID) {
|
||||||
|
super(partName, conductivity, ruleID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void registerTurbineCoil(String coilID, double conductivity, String rule) {
|
public static void registerTurbineCoil(String coilID, double conductivity, String rule) {
|
||||||
|
|
||||||
|
@ -139,7 +167,7 @@ public class CTRegistration {
|
||||||
new BlockTurbinePart() {
|
new BlockTurbinePart() {
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileTurbineDynamoCoil(coilID, conductivity, coilID + "_coil");
|
return new TileCoil(coilID, conductivity, coilID + "_coil");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -155,6 +183,21 @@ public class CTRegistration {
|
||||||
INFO_LIST.add(new TurbineCoilRegistrationInfo(coil, coilID, conductivity, rule));
|
INFO_LIST.add(new TurbineCoilRegistrationInfo(coil, coilID, conductivity, rule));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TileBlade extends TileTurbineRotorBlade {
|
||||||
|
|
||||||
|
final Block bladeBlock;
|
||||||
|
|
||||||
|
public TileBlade(IRotorBladeType bladeType, Block bladeBlock) {
|
||||||
|
super(bladeType);
|
||||||
|
this.bladeBlock = bladeBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBlockState getRenderState() {
|
||||||
|
return bladeBlock.getDefaultState().withProperty(TurbineRotorBladeUtil.DIR, dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void registerTurbineBlade(String bladeID, double efficiency, double expansionCoefficient) {
|
public static void registerTurbineBlade(String bladeID, double efficiency, double expansionCoefficient) {
|
||||||
|
|
||||||
|
@ -181,7 +224,7 @@ public class CTRegistration {
|
||||||
new BlockTurbineRotorBlade(null) {
|
new BlockTurbineRotorBlade(null) {
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileTurbineRotorBlade(bladeType);
|
return new TileBlade(bladeType, this);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"turbine_rotor_blade_" + bladeID);
|
"turbine_rotor_blade_" + bladeID);
|
||||||
|
@ -189,6 +232,26 @@ public class CTRegistration {
|
||||||
INFO_LIST.add(new TurbineBladeRegistrationInfo(blade, efficiency, expansionCoefficient));
|
INFO_LIST.add(new TurbineBladeRegistrationInfo(blade, efficiency, expansionCoefficient));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TileStator extends TileTurbineRotorStator {
|
||||||
|
|
||||||
|
final Block bladeBlock;
|
||||||
|
|
||||||
|
public TileStator(IRotorStatorType statorType, Block bladeBlock) {
|
||||||
|
super(statorType);
|
||||||
|
this.bladeBlock = bladeBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IRotorBladeType getBladeType() {
|
||||||
|
return statorType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBlockState getRenderState() {
|
||||||
|
return bladeBlock.getDefaultState().withProperty(TurbineRotorBladeUtil.DIR, dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ZenMethod
|
@ZenMethod
|
||||||
public static void registerTurbineStator(String statorID, double expansionCoefficient) {
|
public static void registerTurbineStator(String statorID, double expansionCoefficient) {
|
||||||
|
|
||||||
|
@ -210,7 +273,7 @@ public class CTRegistration {
|
||||||
new BlockTurbineRotorStator() {
|
new BlockTurbineRotorStator() {
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||||
return new TileTurbineRotorStator(statorType);
|
return new TileBlade(statorType, this);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"turbine_rotor_stator_" + statorID);
|
"turbine_rotor_stator_" + statorID);
|
||||||
|
|
|
@ -2,41 +2,21 @@ package nc.item;
|
||||||
|
|
||||||
import static nc.config.NCConfig.quantum_angle_precision;
|
import static nc.config.NCConfig.quantum_angle_precision;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import nc.tile.IMultitoolLogic;
|
import nc.tile.IMultitoolLogic;
|
||||||
import nc.util.Lang;
|
import nc.util.*;
|
||||||
import nc.util.NCMath;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumActionResult;
|
import net.minecraft.util.math.*;
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class ItemMultitool extends NCItem {
|
public class ItemMultitool extends NCItem {
|
||||||
|
|
||||||
/** List of all multitool right-click logic. Earlier entries are prioritised! */
|
|
||||||
public static final List<MultitoolRightClickLogic> MULTITOOL_RIGHT_CLICK_LOGIC = new LinkedList<>();
|
|
||||||
|
|
||||||
public ItemMultitool(String... tooltip) {
|
public ItemMultitool(String... tooltip) {
|
||||||
super(tooltip);
|
super(tooltip);
|
||||||
maxStackSize = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public boolean isFull3D() {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isMultitool(ItemStack stack) {
|
public static boolean isMultitool(ItemStack stack) {
|
||||||
|
@ -80,12 +60,28 @@ public class ItemMultitool extends NCItem {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
if (!world.isRemote && isMultitool(stack)) {
|
if (!world.isRemote && isMultitool(stack)) {
|
||||||
for (MultitoolRightClickLogic logic : MULTITOOL_RIGHT_CLICK_LOGIC) {
|
NBTTagCompound nbt = stack.getTagCompound();
|
||||||
ActionResult<ItemStack> result = logic.onRightClick(this, world, player, hand, stack);
|
if (!player.isSneaking() && nbt.getString("gateMode").equals("angle")) {
|
||||||
if (result != null) {
|
double angle = NCMath.roundTo(player.rotationYaw + 360D, 360D / quantum_angle_precision) % 360D;
|
||||||
return result;
|
nbt.setDouble("gateAngle", angle);
|
||||||
|
player.sendMessage(new TextComponentString(Lang.localise("info.nuclearcraft.multitool.quantum_computer.tool_set_angle", NCMath.decimalPlaces(angle, 5))));
|
||||||
|
return actionResult(true, stack);
|
||||||
|
}
|
||||||
|
else if (player.isSneaking() && !nbt.isEmpty() && !nbt.getBoolean("multitoolUsed")) {
|
||||||
|
RayTraceResult raytraceresult = rayTrace(world, player, false);
|
||||||
|
if (raytraceresult == null || raytraceresult.typeOfHit != RayTraceResult.Type.BLOCK) {
|
||||||
|
return actionResult(false, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
BlockPos pos = raytraceresult.getBlockPos();
|
||||||
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
if (!(tile instanceof IMultitoolLogic)) {
|
||||||
|
clearNBT(stack);
|
||||||
|
player.sendMessage(new TextComponentString(Lang.localise("info.nuclearcraft.multitool.clear_info")));
|
||||||
|
return actionResult(true, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stack.getTagCompound().removeTag("multitoolUsed");
|
||||||
}
|
}
|
||||||
return super.onItemRightClick(world, player, hand);
|
return super.onItemRightClick(world, player, hand);
|
||||||
}
|
}
|
||||||
|
@ -95,55 +91,4 @@ public class ItemMultitool extends NCItem {
|
||||||
// return world.getTileEntity(pos) instanceof IMultitoolLogic;
|
// return world.getTileEntity(pos) instanceof IMultitoolLogic;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract static class MultitoolRightClickLogic {
|
|
||||||
|
|
||||||
public abstract ActionResult<ItemStack> onRightClick(ItemMultitool itemMultitool, World world, EntityPlayer player, EnumHand hand, ItemStack heldItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerRightClickLogic() {
|
|
||||||
MULTITOOL_RIGHT_CLICK_LOGIC.add(new MultitoolRightClickLogic() {
|
|
||||||
|
|
||||||
public ActionResult<ItemStack> onRightClick(ItemMultitool itemMultitool, World world, EntityPlayer player, EnumHand hand, ItemStack heldItem) {
|
|
||||||
NBTTagCompound nbt = heldItem.getTagCompound();
|
|
||||||
if (!player.isSneaking() && nbt.getString("gateMode").equals("angle")) {
|
|
||||||
double angle = NCMath.roundTo(player.rotationYaw + 360D, 360D / quantum_angle_precision) % 360D;
|
|
||||||
nbt.setDouble("gateAngle", angle);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("info.nuclearcraft.multitool.quantum_computer.tool_set_angle", NCMath.decimalPlaces(angle, 5))));
|
|
||||||
return itemMultitool.actionResult(true, heldItem);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
MULTITOOL_RIGHT_CLICK_LOGIC.add(new MultitoolRightClickLogic() {
|
|
||||||
|
|
||||||
public ActionResult<ItemStack> onRightClick(ItemMultitool itemMultitool, World world, EntityPlayer player, EnumHand hand, ItemStack heldItem) {
|
|
||||||
NBTTagCompound nbt = heldItem.getTagCompound();
|
|
||||||
if (player.isSneaking() && !nbt.isEmpty() && !nbt.getBoolean("multitoolUsed")) {
|
|
||||||
RayTraceResult raytraceresult = itemMultitool.rayTrace(world, player, false);
|
|
||||||
if (raytraceresult == null || raytraceresult.typeOfHit != RayTraceResult.Type.BLOCK) {
|
|
||||||
return itemMultitool.actionResult(false, heldItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockPos pos = raytraceresult.getBlockPos();
|
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
|
||||||
if (!(tile instanceof IMultitoolLogic)) {
|
|
||||||
clearNBT(heldItem);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("info.nuclearcraft.multitool.clear_info")));
|
|
||||||
return itemMultitool.actionResult(true, heldItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
MULTITOOL_RIGHT_CLICK_LOGIC.add(new MultitoolRightClickLogic() {
|
|
||||||
|
|
||||||
public ActionResult<ItemStack> onRightClick(ItemMultitool itemMultitool, World world, EntityPlayer player, EnumHand hand, ItemStack heldItem) {
|
|
||||||
heldItem.getTagCompound().removeTag("multitoolUsed");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,13 +42,13 @@ public abstract class Multiblock<T extends ITileMultiblockPart, PACKET extends M
|
||||||
|
|
||||||
// Disassembled -> Assembled; Assembled -> Disassembled OR Paused; Paused ->
|
// Disassembled -> Assembled; Assembled -> Disassembled OR Paused; Paused ->
|
||||||
// Assembled
|
// Assembled
|
||||||
public enum AssemblyState {
|
protected enum AssemblyState {
|
||||||
Disassembled,
|
Disassembled,
|
||||||
Assembled,
|
Assembled,
|
||||||
Paused
|
Paused
|
||||||
}
|
}
|
||||||
|
|
||||||
public AssemblyState assemblyState;
|
protected AssemblyState assemblyState;
|
||||||
|
|
||||||
protected ObjectOpenHashSet<ITileMultiblockPart> connectedParts;
|
protected ObjectOpenHashSet<ITileMultiblockPart> connectedParts;
|
||||||
|
|
||||||
|
@ -1147,9 +1147,8 @@ public abstract class Multiblock<T extends ITileMultiblockPart, PACKET extends M
|
||||||
|
|
||||||
BlockPos rc = this.getReferenceCoord();
|
BlockPos rc = this.getReferenceCoord();
|
||||||
|
|
||||||
if (WORLD != null && rc != null) {
|
if (this.WORLD != null && rc != null) {
|
||||||
IBlockState state = WORLD.getBlockState(rc);
|
WorldHelper.notifyBlockUpdate(this.WORLD, rc, null, null);
|
||||||
WORLD.notifyBlockUpdate(rc, state, state, 3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,31 @@ public final class WorldHelper {
|
||||||
return position.getZ() >> 4;
|
return position.getZ() >> 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* force a block update at the given position
|
||||||
|
*
|
||||||
|
* @param world
|
||||||
|
* the world to update
|
||||||
|
* @param position
|
||||||
|
* the position of the block begin updated
|
||||||
|
* @param oldState
|
||||||
|
* the old state of the block begin updated. if null, the current state will be retrieved from the world
|
||||||
|
* @param newState
|
||||||
|
* the new state for the block begin updated. if null, the final value of oldState will be used
|
||||||
|
*/
|
||||||
|
public static void notifyBlockUpdate(World world, BlockPos position, IBlockState oldState, IBlockState newState) {
|
||||||
|
|
||||||
|
if (null == oldState) {
|
||||||
|
oldState = world.getBlockState(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null == newState) {
|
||||||
|
newState = oldState;
|
||||||
|
}
|
||||||
|
|
||||||
|
world.notifyBlockUpdate(position, oldState, newState, 3);
|
||||||
|
}
|
||||||
|
|
||||||
public static long getChunkXZHashFromBlock(int blockX, int blockZ) {
|
public static long getChunkXZHashFromBlock(int blockX, int blockZ) {
|
||||||
return ChunkPos.asLong(WorldHelper.getChunkXFromBlock(blockX), WorldHelper.getChunkZFromBlock(blockZ));
|
return ChunkPos.asLong(WorldHelper.getChunkXFromBlock(blockX), WorldHelper.getChunkZFromBlock(blockZ));
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,6 @@ public class BatteryMultiblock extends Multiblock<TileBattery, MultiblockUpdateP
|
||||||
if (shouldUpdate) {
|
if (shouldUpdate) {
|
||||||
for (TileBattery battery : getParts(TileBattery.class)) {
|
for (TileBattery battery : getParts(TileBattery.class)) {
|
||||||
battery.markDirty();
|
battery.markDirty();
|
||||||
battery.updateComparatorOutputLevel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return shouldUpdate;
|
return shouldUpdate;
|
||||||
|
|
|
@ -1,34 +1,27 @@
|
||||||
package nc.multiblock.battery.block;
|
package nc.multiblock.battery.block;
|
||||||
|
|
||||||
import nc.block.property.ISidedEnergy;
|
import nc.block.property.ISidedEnergy;
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.block.tile.INBTDrop;
|
import nc.block.tile.INBTDrop;
|
||||||
import nc.item.ItemMultitool;
|
import nc.item.ItemMultitool;
|
||||||
import nc.multiblock.battery.BatteryMultiblock;
|
import nc.multiblock.battery.*;
|
||||||
import nc.multiblock.battery.BatteryType;
|
|
||||||
import nc.multiblock.battery.tile.TileBattery;
|
import nc.multiblock.battery.tile.TileBattery;
|
||||||
import nc.multiblock.block.BlockMultiblockPart;
|
import nc.multiblock.block.BlockMultiblockPart;
|
||||||
import nc.tab.NCTabs;
|
import nc.tab.NCTabs;
|
||||||
import nc.tile.internal.energy.EnergyConnection;
|
import nc.tile.internal.energy.*;
|
||||||
import nc.tile.internal.energy.EnergyStorage;
|
import nc.util.*;
|
||||||
import nc.util.Lang;
|
|
||||||
import nc.util.UnitHelper;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockBattery extends BlockMultiblockPart implements IDynamicState, ISidedEnergy, INBTDrop {
|
public class BlockBattery extends BlockMultiblockPart implements ISidedEnergy, INBTDrop {
|
||||||
|
|
||||||
private final BatteryType type;
|
private final BatteryType type;
|
||||||
|
|
||||||
|
|
|
@ -238,11 +238,11 @@ public class FissionReactor extends CuboidalMultiblock<IFissionPart, FissionUpda
|
||||||
isReactorOn = isAssembled() && logic.isReactorOn();
|
isReactorOn = isAssembled() && logic.isReactorOn();
|
||||||
if (isReactorOn != wasReactorOn) {
|
if (isReactorOn != wasReactorOn) {
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
controller.setActivity(isReactorOn);
|
controller.updateBlockState(isReactorOn);
|
||||||
sendUpdateToAllPlayers();
|
sendUpdateToAllPlayers();
|
||||||
}
|
}
|
||||||
for (TileFissionMonitor monitor : getParts(TileFissionMonitor.class)) {
|
for (TileFissionMonitor monitor : getParts(TileFissionMonitor.class)) {
|
||||||
monitor.setActivity(isReactorOn);
|
monitor.updateBlockState(isReactorOn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
package nc.multiblock.fission.block;
|
package nc.multiblock.fission.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.item.ItemMultitool;
|
import nc.item.ItemMultitool;
|
||||||
import nc.multiblock.fission.FissionCluster;
|
import nc.multiblock.fission.*;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
import nc.multiblock.fission.tile.*;
|
||||||
import nc.multiblock.fission.tile.IFissionComponent;
|
|
||||||
import nc.multiblock.fission.tile.TileFissionMonitor;
|
|
||||||
import nc.render.BlockHighlightTracker;
|
import nc.render.BlockHighlightTracker;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.*;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockFissionMonitor extends BlockFissionPart implements IActivatable {
|
public class BlockFissionMonitor extends BlockFissionPart {
|
||||||
|
|
||||||
public BlockFissionMonitor() {
|
public BlockFissionMonitor() {
|
||||||
super();
|
super();
|
||||||
|
@ -96,4 +88,15 @@ public class BlockFissionMonitor extends BlockFissionPart implements IActivatabl
|
||||||
}
|
}
|
||||||
return rightClickOnPart(world, pos, player, hand, facing, true);
|
return rightClickOnPart(world, pos, player, hand, facing, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() instanceof BlockFissionMonitor) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,47 +1,37 @@
|
||||||
package nc.multiblock.fission.block;
|
package nc.multiblock.fission.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
import static nc.block.property.BlockProperties.FACING_ALL;
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.multiblock.fission.tile.TileFissionPowerPort;
|
import nc.multiblock.fission.tile.TileFissionPowerPort;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockFissionPowerPort extends BlockFissionPart implements IActivatable {
|
public class BlockFissionPowerPort extends BlockFissionPart {
|
||||||
|
|
||||||
public BlockFissionPowerPort() {
|
public BlockFissionPowerPort() {
|
||||||
super();
|
super();
|
||||||
setDefaultState(blockState.getBaseState().withProperty(FACING_ALL, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false)));
|
setDefaultState(blockState.getBaseState().withProperty(FACING_ALL, EnumFacing.NORTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, FACING_ALL, ACTIVE);
|
return new BlockStateContainer(this, FACING_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
public IBlockState getStateFromMeta(int meta) {
|
||||||
EnumFacing enumfacing = EnumFacing.byIndex(meta & 7);
|
return getDefaultState().withProperty(FACING_ALL, EnumFacing.byIndex(meta));
|
||||||
return getDefaultState().withProperty(FACING_ALL, enumfacing).withProperty(ACTIVE, Boolean.valueOf((meta & 8) > 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetaFromState(IBlockState state) {
|
public int getMetaFromState(IBlockState state) {
|
||||||
int i = state.getValue(FACING_ALL).getIndex();
|
return state.getValue(FACING_ALL).getIndex();
|
||||||
if (state.getValue(ACTIVE).booleanValue()) {
|
|
||||||
i |= 8;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -51,7 +41,7 @@ public class BlockFissionPowerPort extends BlockFissionPart implements IActivata
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
|
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
|
||||||
return getDefaultState().withProperty(FACING_ALL, EnumFacing.getDirectionFromEntityLiving(pos, placer)).withProperty(ACTIVE, Boolean.valueOf(false));
|
return getDefaultState().withProperty(FACING_ALL, EnumFacing.getDirectionFromEntityLiving(pos, placer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,28 +2,21 @@ package nc.multiblock.fission.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.ACTIVE;
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.enumm.MetaEnums;
|
import nc.enumm.MetaEnums;
|
||||||
import nc.multiblock.fission.tile.TileFissionShield;
|
import nc.multiblock.fission.tile.TileFissionShield;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.World;
|
import net.minecraftforge.fml.relauncher.*;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockFissionShield extends BlockFissionMetaPart<MetaEnums.NeutronShieldType> implements IActivatable {
|
public class BlockFissionShield extends BlockFissionMetaPart<MetaEnums.NeutronShieldType> {
|
||||||
|
|
||||||
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.NeutronShieldType.class);
|
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.NeutronShieldType.class);
|
||||||
|
|
||||||
|
@ -81,6 +74,15 @@ public class BlockFissionShield extends BlockFissionMetaPart<MetaEnums.NeutronSh
|
||||||
return rightClickOnPart(world, pos, player, hand, facing);
|
return rightClickOnPart(world, pos, player, hand, facing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() instanceof BlockFissionShield && isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Rendering
|
// Rendering
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,34 +1,26 @@
|
||||||
package nc.multiblock.fission.block;
|
package nc.multiblock.fission.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.enumm.MetaEnums;
|
import nc.enumm.MetaEnums;
|
||||||
import nc.multiblock.fission.tile.TileFissionSource;
|
import nc.multiblock.fission.tile.TileFissionSource;
|
||||||
import nc.multiblock.fission.tile.TileFissionSource.PrimingTargetInfo;
|
import nc.multiblock.fission.tile.TileFissionSource.PrimingTargetInfo;
|
||||||
import nc.render.BlockHighlightTracker;
|
import nc.render.BlockHighlightTracker;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.*;
|
||||||
import nc.util.Lang;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.*;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.TextComponentString;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockFissionSource extends BlockFissionMetaPart<MetaEnums.NeutronSourceType> implements IActivatable {
|
public class BlockFissionSource extends BlockFissionMetaPart<MetaEnums.NeutronSourceType> {
|
||||||
|
|
||||||
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.NeutronSourceType.class);
|
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.NeutronSourceType.class);
|
||||||
|
|
||||||
|
@ -117,4 +109,13 @@ public class BlockFissionSource extends BlockFissionMetaPart<MetaEnums.NeutronSo
|
||||||
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
||||||
return side != null;
|
return side != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,18 @@
|
||||||
package nc.multiblock.fission.block;
|
package nc.multiblock.fission.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.multiblock.fission.tile.TileFissionVent;
|
import nc.multiblock.fission.tile.TileFissionVent;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockFissionVent extends BlockFissionPart implements IActivatable {
|
public class BlockFissionVent extends BlockFissionPart {
|
||||||
|
|
||||||
public BlockFissionVent() {
|
public BlockFissionVent() {
|
||||||
super();
|
super();
|
||||||
|
@ -70,4 +65,15 @@ public class BlockFissionVent extends BlockFissionPart implements IActivatable {
|
||||||
}
|
}
|
||||||
return rightClickOnPart(world, pos, player, hand, facing);
|
return rightClickOnPart(world, pos, player, hand, facing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() instanceof BlockFissionVent) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,19 @@
|
||||||
package nc.multiblock.fission.block.manager;
|
package nc.multiblock.fission.block.manager;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.multiblock.fission.block.BlockFissionPart;
|
import nc.multiblock.fission.block.BlockFissionPart;
|
||||||
import nc.multiblock.fission.tile.manager.IFissionManagerListener;
|
import nc.multiblock.fission.tile.manager.*;
|
||||||
import nc.multiblock.fission.tile.manager.TileFissionManager;
|
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public abstract class BlockFissionManager<MANAGER extends TileFissionManager<MANAGER, LISTENER>, LISTENER extends IFissionManagerListener<MANAGER, LISTENER>> extends BlockFissionPart implements IActivatable {
|
public abstract class BlockFissionManager<MANAGER extends TileFissionManager<MANAGER, LISTENER>, LISTENER extends IFissionManagerListener<MANAGER, LISTENER>> extends BlockFissionPart {
|
||||||
|
|
||||||
protected final Class<MANAGER> managerClass;
|
protected final Class<MANAGER> managerClass;
|
||||||
|
|
||||||
|
@ -71,4 +65,15 @@ public abstract class BlockFissionManager<MANAGER extends TileFissionManager<MAN
|
||||||
|
|
||||||
return rightClickOnPart(world, pos, player, hand, facing, false);
|
return rightClickOnPart(world, pos, player, hand, facing, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() instanceof BlockFissionManager) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package nc.multiblock.fission.block.port;
|
package nc.multiblock.fission.block.port;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.NuclearCraft;
|
import nc.NuclearCraft;
|
||||||
import nc.enumm.MetaEnums;
|
import nc.enumm.MetaEnums;
|
||||||
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
||||||
import nc.multiblock.fission.tile.port.TileFissionHeaterPort;
|
import nc.multiblock.fission.tile.port.TileFissionHeaterPort;
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.*;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -15,8 +13,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockFissionHeaterPort extends BlockFissionFluidMetaPort<TileFissionHeaterPort, TileSaltFissionHeater, MetaEnums.CoolantHeaterType> {
|
public class BlockFissionHeaterPort extends BlockFissionFluidMetaPort<TileFissionHeaterPort, TileSaltFissionHeater, MetaEnums.CoolantHeaterType> {
|
||||||
|
|
||||||
|
@ -28,11 +24,7 @@ public class BlockFissionHeaterPort extends BlockFissionFluidMetaPort<TileFissio
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, TYPE, AXIS_ALL, ACTIVE);
|
return new BlockStateContainer(this, TYPE, AXIS_ALL);
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActualStateActive(TileFissionHeaterPort port) {
|
|
||||||
return port.getTankSorption(EnumFacing.DOWN, 0) != TankSorption.IN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package nc.multiblock.fission.block.port;
|
package nc.multiblock.fission.block.port;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.NuclearCraft;
|
import nc.NuclearCraft;
|
||||||
import nc.enumm.MetaEnums;
|
import nc.enumm.MetaEnums;
|
||||||
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
||||||
import nc.multiblock.fission.tile.port.TileFissionHeaterPort;
|
import nc.multiblock.fission.tile.port.TileFissionHeaterPort;
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.*;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -15,8 +13,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public class BlockFissionHeaterPort2 extends BlockFissionFluidMetaPort<TileFissionHeaterPort, TileSaltFissionHeater, MetaEnums.CoolantHeaterType2> {
|
public class BlockFissionHeaterPort2 extends BlockFissionFluidMetaPort<TileFissionHeaterPort, TileSaltFissionHeater, MetaEnums.CoolantHeaterType2> {
|
||||||
|
|
||||||
|
@ -28,11 +24,7 @@ public class BlockFissionHeaterPort2 extends BlockFissionFluidMetaPort<TileFissi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, TYPE, AXIS_ALL, ACTIVE);
|
return new BlockStateContainer(this, TYPE, AXIS_ALL);
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getActualStateActive(TileFissionHeaterPort port) {
|
|
||||||
return port.getTankSorption(EnumFacing.DOWN, 0) != TankSorption.IN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,38 +1,28 @@
|
||||||
package nc.multiblock.fission.block.port;
|
package nc.multiblock.fission.block.port;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.enumm.IBlockMetaEnum;
|
import nc.enumm.IBlockMetaEnum;
|
||||||
import nc.multiblock.fission.block.BlockFissionMetaPart;
|
import nc.multiblock.fission.block.BlockFissionMetaPart;
|
||||||
import nc.multiblock.fission.tile.port.IFissionPortTarget;
|
import nc.multiblock.fission.tile.port.*;
|
||||||
import nc.multiblock.fission.tile.port.TileFissionPort;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public abstract class BlockFissionMetaPort<PORT extends TileFissionPort<PORT, TARGET>, TARGET extends IFissionPortTarget<PORT, TARGET>, T extends Enum<T> & IStringSerializable & IBlockMetaEnum> extends BlockFissionMetaPart<T> implements IActivatable {
|
public abstract class BlockFissionMetaPort<PORT extends TileFissionPort<PORT, TARGET>, TARGET extends IFissionPortTarget<PORT, TARGET>, T extends Enum<T> & IStringSerializable & IBlockMetaEnum> extends BlockFissionMetaPart<T> {
|
||||||
|
|
||||||
protected final Class<PORT> portClass;
|
protected final Class<PORT> portClass;
|
||||||
|
|
||||||
public BlockFissionMetaPort(Class<PORT> portClass, Class<T> enumm, PropertyEnum<T> property) {
|
public BlockFissionMetaPort(Class<PORT> portClass, Class<T> enumm, PropertyEnum<T> property) {
|
||||||
super(enumm, property);
|
super(enumm, property);
|
||||||
this.portClass = portClass;
|
this.portClass = portClass;
|
||||||
setDefaultState(getDefaultState().withProperty(AXIS_ALL, EnumFacing.Axis.Z).withProperty(ACTIVE, Boolean.valueOf(false)));
|
setDefaultState(getDefaultState().withProperty(AXIS_ALL, EnumFacing.Axis.Z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -41,19 +31,11 @@ public abstract class BlockFissionMetaPort<PORT extends TileFissionPort<PORT, TA
|
||||||
if (portClass.isInstance(tile)) {
|
if (portClass.isInstance(tile)) {
|
||||||
PORT port = (PORT) tile;
|
PORT port = (PORT) tile;
|
||||||
EnumFacing facing = port.getPartPosition().getFacing();
|
EnumFacing facing = port.getPartPosition().getFacing();
|
||||||
return state.withProperty(AXIS_ALL, facing != null ? facing.getAxis() : port.axis).withProperty(ACTIVE, getActualStateActive(port));
|
return state.withProperty(AXIS_ALL, facing != null ? facing.getAxis() : port.axis);
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract boolean getActualStateActive(PORT port);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public BlockRenderLayer getRenderLayer() {
|
|
||||||
return BlockRenderLayer.CUTOUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
|
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
|
||||||
return getStateFromMeta(meta).withProperty(AXIS_ALL, EnumFacing.getDirectionFromEntityLiving(pos, placer).getAxis());
|
return getStateFromMeta(meta).withProperty(AXIS_ALL, EnumFacing.getDirectionFromEntityLiving(pos, placer).getAxis());
|
||||||
|
|
|
@ -1,58 +1,39 @@
|
||||||
package nc.multiblock.fission.block.port;
|
package nc.multiblock.fission.block.port;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.multiblock.fission.block.BlockFissionPart;
|
import nc.multiblock.fission.block.BlockFissionPart;
|
||||||
import nc.multiblock.fission.tile.port.IFissionPortTarget;
|
import nc.multiblock.fission.tile.port.*;
|
||||||
import nc.multiblock.fission.tile.port.TileFissionPort;
|
|
||||||
import nc.util.PosHelper;
|
import nc.util.PosHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.BlockRenderLayer;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public abstract class BlockFissionPort<PORT extends TileFissionPort<PORT, TARGET>, TARGET extends IFissionPortTarget<PORT, TARGET>> extends BlockFissionPart implements IActivatable {
|
public abstract class BlockFissionPort<PORT extends TileFissionPort<PORT, TARGET>, TARGET extends IFissionPortTarget<PORT, TARGET>> extends BlockFissionPart {
|
||||||
|
|
||||||
protected final Class<PORT> portClass;
|
protected final Class<PORT> portClass;
|
||||||
|
|
||||||
public BlockFissionPort(Class<PORT> portClass) {
|
public BlockFissionPort(Class<PORT> portClass) {
|
||||||
super();
|
super();
|
||||||
this.portClass = portClass;
|
this.portClass = portClass;
|
||||||
setDefaultState(blockState.getBaseState().withProperty(AXIS_ALL, EnumFacing.Axis.Z).withProperty(ACTIVE, Boolean.valueOf(false)));
|
setDefaultState(blockState.getBaseState().withProperty(AXIS_ALL, EnumFacing.Axis.Z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
return new BlockStateContainer(this, AXIS_ALL, ACTIVE);
|
return new BlockStateContainer(this, AXIS_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
public IBlockState getStateFromMeta(int meta) {
|
||||||
EnumFacing.Axis axis = PosHelper.AXES[meta & 3];
|
return getDefaultState().withProperty(AXIS_ALL, PosHelper.AXES[meta]);
|
||||||
return getDefaultState().withProperty(AXIS_ALL, axis).withProperty(ACTIVE, Boolean.valueOf((meta & 4) > 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetaFromState(IBlockState state) {
|
public int getMetaFromState(IBlockState state) {
|
||||||
int i = state.getValue(AXIS_ALL).ordinal();
|
return state.getValue(AXIS_ALL).ordinal();
|
||||||
if (state.getValue(ACTIVE).booleanValue()) {
|
|
||||||
i |= 4;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public BlockRenderLayer getRenderLayer() {
|
|
||||||
return BlockRenderLayer.CUTOUT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -385,8 +385,7 @@ public class MoltenSaltFissionLogic extends FissionReactorLogic {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isShieldActiveModerator(TileFissionShield shield, boolean activeModeratorPos) {
|
public boolean isShieldActiveModerator(TileFissionShield shield, boolean activeModeratorPos) {
|
||||||
//return activeModeratorPos;
|
return activeModeratorPos;
|
||||||
return super.isShieldActiveModerator(shield, activeModeratorPos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,25 +1,20 @@
|
||||||
package nc.multiblock.fission.salt.block;
|
package nc.multiblock.fission.salt.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import nc.NuclearCraft;
|
import nc.NuclearCraft;
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.multiblock.fission.block.BlockFissionPart;
|
import nc.multiblock.fission.block.BlockFissionPart;
|
||||||
import nc.multiblock.fission.salt.tile.TileSaltFissionController;
|
import nc.multiblock.fission.salt.tile.TileSaltFissionController;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockSaltFissionController extends BlockFissionPart implements IActivatable {
|
public class BlockSaltFissionController extends BlockFissionPart {
|
||||||
|
|
||||||
public BlockSaltFissionController() {
|
public BlockSaltFissionController() {
|
||||||
super();
|
super();
|
||||||
|
@ -83,4 +78,15 @@ public class BlockSaltFissionController extends BlockFissionPart implements IAct
|
||||||
}
|
}
|
||||||
return rightClickOnPart(world, pos, player, hand, facing, true);
|
return rightClickOnPart(world, pos, player, hand, facing, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() instanceof BlockSaltFissionController) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,23 +5,18 @@ import nc.enumm.MetaEnums;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
import nc.multiblock.fission.FissionReactor;
|
||||||
import nc.multiblock.fission.block.BlockFissionMetaPart;
|
import nc.multiblock.fission.block.BlockFissionMetaPart;
|
||||||
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
||||||
import nc.util.FluidStackHelper;
|
import nc.util.*;
|
||||||
import nc.util.Lang;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.*;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
public class BlockSaltFissionHeater extends BlockFissionMetaPart<MetaEnums.CoolantHeaterType> {
|
public class BlockSaltFissionHeater extends BlockFissionMetaPart<MetaEnums.CoolantHeaterType> /* implements ISidedProperty< SaltFissionHeaterSetting> */ {
|
||||||
|
|
||||||
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.CoolantHeaterType.class);
|
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.CoolantHeaterType.class);
|
||||||
|
|
||||||
|
@ -31,6 +26,7 @@ public class BlockSaltFissionHeater extends BlockFissionMetaPart<MetaEnums.Coola
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
|
// return new BlockStateContainer(this, TYPE, DOWN, UP, NORTH, SOUTH, WEST, EAST);
|
||||||
return new BlockStateContainer(this, TYPE);
|
return new BlockStateContainer(this, TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,23 +5,18 @@ import nc.enumm.MetaEnums;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
import nc.multiblock.fission.FissionReactor;
|
||||||
import nc.multiblock.fission.block.BlockFissionMetaPart;
|
import nc.multiblock.fission.block.BlockFissionMetaPart;
|
||||||
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
import nc.multiblock.fission.salt.tile.TileSaltFissionHeater;
|
||||||
import nc.util.FluidStackHelper;
|
import nc.util.*;
|
||||||
import nc.util.Lang;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.*;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
public class BlockSaltFissionHeater2 extends BlockFissionMetaPart<MetaEnums.CoolantHeaterType2> {
|
public class BlockSaltFissionHeater2 extends BlockFissionMetaPart<MetaEnums.CoolantHeaterType2> /* implements ISidedProperty< SaltFissionHeaterSetting> */ {
|
||||||
|
|
||||||
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.CoolantHeaterType2.class);
|
public final static PropertyEnum TYPE = PropertyEnum.create("type", MetaEnums.CoolantHeaterType2.class);
|
||||||
|
|
||||||
|
@ -31,6 +26,8 @@ public class BlockSaltFissionHeater2 extends BlockFissionMetaPart<MetaEnums.Cool
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BlockStateContainer createBlockState() {
|
protected BlockStateContainer createBlockState() {
|
||||||
|
// return new BlockStateContainer(this, TYPE, DOWN, UP, NORTH, SOUTH,
|
||||||
|
// WEST, EAST);
|
||||||
return new BlockStateContainer(this, TYPE);
|
return new BlockStateContainer(this, TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,14 @@ public class TileSaltFissionController extends TileFissionPart implements IFissi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockSaltFissionController) {
|
||||||
|
((BlockSaltFissionController) getBlockType()).setState(isActive, this);
|
||||||
|
world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doMeltdown() {
|
public void doMeltdown() {
|
||||||
IBlockState corium = RegistryHelper.getBlock(Global.MOD_ID + ":fluid_corium").getDefaultState();
|
IBlockState corium = RegistryHelper.getBlock(Global.MOD_ID + ":fluid_corium").getDefaultState();
|
||||||
|
|
|
@ -3,52 +3,34 @@ package nc.multiblock.fission.salt.tile;
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.enable_mek_gas;
|
||||||
import static nc.init.NCCoolantFluids.COOLANTS;
|
import static nc.init.NCCoolantFluids.COOLANTS;
|
||||||
import static nc.recipe.NCRecipes.coolant_heater;
|
import static nc.recipe.NCRecipes.coolant_heater;
|
||||||
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.PosHelper.DEFAULT_NON;
|
||||||
|
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntList;
|
import it.unimi.dsi.fastutil.ints.IntList;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
import it.unimi.dsi.fastutil.objects.*;
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
|
||||||
import nc.ModCheck;
|
import nc.ModCheck;
|
||||||
import nc.multiblock.PlacementRule;
|
import nc.multiblock.PlacementRule;
|
||||||
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.fission.FissionCluster;
|
import nc.multiblock.fission.*;
|
||||||
import nc.multiblock.fission.FissionPlacement;
|
|
||||||
import nc.multiblock.fission.FissionReactor;
|
|
||||||
import nc.multiblock.fission.salt.SaltFissionHeaterSetting;
|
import nc.multiblock.fission.salt.SaltFissionHeaterSetting;
|
||||||
import nc.multiblock.fission.tile.IFissionComponent;
|
import nc.multiblock.fission.tile.*;
|
||||||
import nc.multiblock.fission.tile.IFissionCoolingComponent;
|
|
||||||
import nc.multiblock.fission.tile.IFissionFuelComponent.ModeratorBlockInfo;
|
import nc.multiblock.fission.tile.IFissionFuelComponent.ModeratorBlockInfo;
|
||||||
import nc.multiblock.fission.tile.IFissionPart;
|
import nc.multiblock.fission.tile.port.*;
|
||||||
import nc.multiblock.fission.tile.TileFissionPart;
|
|
||||||
import nc.multiblock.fission.tile.port.IFissionPortTarget;
|
|
||||||
import nc.multiblock.fission.tile.port.TileFissionHeaterPort;
|
|
||||||
import nc.multiblock.network.SaltFissionHeaterUpdatePacket;
|
import nc.multiblock.network.SaltFissionHeaterUpdatePacket;
|
||||||
import nc.recipe.AbstractRecipeHandler;
|
import nc.recipe.*;
|
||||||
import nc.recipe.ProcessorRecipe;
|
|
||||||
import nc.recipe.RecipeInfo;
|
|
||||||
import nc.recipe.ingredient.IFluidIngredient;
|
import nc.recipe.ingredient.IFluidIngredient;
|
||||||
import nc.tile.ITileGui;
|
import nc.tile.ITileGui;
|
||||||
import nc.tile.fluid.ITileFilteredFluid;
|
import nc.tile.fluid.*;
|
||||||
import nc.tile.fluid.ITileFluid;
|
import nc.tile.internal.fluid.*;
|
||||||
import nc.tile.internal.fluid.FluidConnection;
|
|
||||||
import nc.tile.internal.fluid.FluidTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.GasTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.Tank;
|
|
||||||
import nc.tile.internal.fluid.TankOutputSetting;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.tile.processor.IFluidProcessor;
|
import nc.tile.processor.IFluidProcessor;
|
||||||
import nc.util.CapabilityHelper;
|
import nc.util.GasHelper;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -56,7 +38,7 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
|
|
||||||
public class TileSaltFissionHeater extends TileFissionPart implements ITileFilteredFluid, ITileGui<SaltFissionHeaterUpdatePacket>, IFluidProcessor, IFissionCoolingComponent, IFissionPortTarget<TileFissionHeaterPort, TileSaltFissionHeater> {
|
public abstract class TileSaltFissionHeater extends TileFissionPart implements ITileFilteredFluid, ITileGui<SaltFissionHeaterUpdatePacket>, IFluidProcessor, IFissionCoolingComponent, IFissionPortTarget<TileFissionHeaterPort, TileSaltFissionHeater> {
|
||||||
|
|
||||||
protected final @Nonnull List<Tank> tanks;
|
protected final @Nonnull List<Tank> tanks;
|
||||||
protected final @Nonnull List<Tank> filterTanks;
|
protected final @Nonnull List<Tank> filterTanks;
|
||||||
|
@ -741,7 +723,7 @@ public class TileSaltFissionHeater extends TileFissionPart implements ITileFilte
|
||||||
public void toggleHeaterSetting(@Nonnull EnumFacing side) {
|
public void toggleHeaterSetting(@Nonnull EnumFacing side) {
|
||||||
setHeaterSetting(side, getHeaterSetting(side).next());
|
setHeaterSetting(side, getHeaterSetting(side).next());
|
||||||
refreshFluidConnections(side);
|
refreshFluidConnections(side);
|
||||||
markDirtyAndNotify(true);
|
markDirtyAndNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
||||||
|
@ -847,6 +829,7 @@ public class TileSaltFissionHeater extends TileFissionPart implements ITileFilte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterChanged(int slot) {
|
public void onFilterChanged(int slot) {
|
||||||
|
/* if (!canModifyFilter(slot)) { getMultiblock().getLogic().refreshPorts(); } */
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,7 +996,7 @@ public class TileSaltFissionHeater extends TileFissionPart implements ITileFilte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
||||||
}
|
}
|
||||||
return super.hasCapability(capability, side);
|
return super.hasCapability(capability, side);
|
||||||
|
@ -1027,7 +1010,7 @@ public class TileSaltFissionHeater extends TileFissionPart implements ITileFilte
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (ModCheck.mekanismLoaded() && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
else if (ModCheck.mekanismLoaded() && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
||||||
return (T) getGasWrapper();
|
return (T) getGasWrapper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,66 +1,41 @@
|
||||||
package nc.multiblock.fission.salt.tile;
|
package nc.multiblock.fission.salt.tile;
|
||||||
|
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.*;
|
||||||
import static nc.config.NCConfig.fission_fuel_time_multiplier;
|
import static nc.recipe.NCRecipes.*;
|
||||||
import static nc.config.NCConfig.fission_meltdown_radiation_multiplier;
|
|
||||||
import static nc.recipe.NCRecipes.salt_fission;
|
|
||||||
import static nc.recipe.NCRecipes.salt_fission_valid_fluids;
|
|
||||||
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.PosHelper.DEFAULT_NON;
|
||||||
|
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntList;
|
import it.unimi.dsi.fastutil.ints.IntList;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
import it.unimi.dsi.fastutil.longs.*;
|
||||||
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
import it.unimi.dsi.fastutil.objects.*;
|
||||||
import it.unimi.dsi.fastutil.longs.LongSet;
|
import nc.*;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
|
||||||
import nc.Global;
|
|
||||||
import nc.ModCheck;
|
|
||||||
import nc.capability.radiation.source.IRadiationSource;
|
import nc.capability.radiation.source.IRadiationSource;
|
||||||
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.fission.FissionCluster;
|
import nc.multiblock.fission.*;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
|
||||||
import nc.multiblock.fission.salt.SaltFissionVesselSetting;
|
import nc.multiblock.fission.salt.SaltFissionVesselSetting;
|
||||||
import nc.multiblock.fission.tile.IFissionComponent;
|
import nc.multiblock.fission.tile.*;
|
||||||
import nc.multiblock.fission.tile.IFissionFluxSink;
|
import nc.multiblock.fission.tile.port.*;
|
||||||
import nc.multiblock.fission.tile.IFissionFuelComponent;
|
|
||||||
import nc.multiblock.fission.tile.TileFissionPart;
|
|
||||||
import nc.multiblock.fission.tile.port.IFissionPortTarget;
|
|
||||||
import nc.multiblock.fission.tile.port.TileFissionVesselPort;
|
|
||||||
import nc.multiblock.network.SaltFissionVesselUpdatePacket;
|
import nc.multiblock.network.SaltFissionVesselUpdatePacket;
|
||||||
import nc.radiation.RadiationHelper;
|
import nc.radiation.RadiationHelper;
|
||||||
import nc.recipe.AbstractRecipeHandler;
|
import nc.recipe.*;
|
||||||
import nc.recipe.ProcessorRecipe;
|
|
||||||
import nc.recipe.RecipeInfo;
|
|
||||||
import nc.recipe.ingredient.IFluidIngredient;
|
import nc.recipe.ingredient.IFluidIngredient;
|
||||||
import nc.tile.ITileGui;
|
import nc.tile.ITileGui;
|
||||||
import nc.tile.fluid.ITileFilteredFluid;
|
import nc.tile.fluid.*;
|
||||||
import nc.tile.fluid.ITileFluid;
|
|
||||||
import nc.tile.generator.IFluidGenerator;
|
import nc.tile.generator.IFluidGenerator;
|
||||||
import nc.tile.internal.fluid.FluidConnection;
|
import nc.tile.internal.fluid.*;
|
||||||
import nc.tile.internal.fluid.FluidTileWrapper;
|
import nc.util.*;
|
||||||
import nc.tile.internal.fluid.GasTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.Tank;
|
|
||||||
import nc.tile.internal.fluid.TankOutputSetting;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.util.CapabilityHelper;
|
|
||||||
import nc.util.RegistryHelper;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.*;
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
|
@ -728,7 +703,7 @@ public class TileSaltFissionVessel extends TileFissionPart implements ITileFilte
|
||||||
public void toggleVesselSetting(@Nonnull EnumFacing side) {
|
public void toggleVesselSetting(@Nonnull EnumFacing side) {
|
||||||
setVesselSetting(side, getVesselSetting(side).next());
|
setVesselSetting(side, getVesselSetting(side).next());
|
||||||
refreshFluidConnections(side);
|
refreshFluidConnections(side);
|
||||||
markDirtyAndNotify(true);
|
markDirtyAndNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
||||||
|
@ -847,6 +822,7 @@ public class TileSaltFissionVessel extends TileFissionPart implements ITileFilte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterChanged(int slot) {
|
public void onFilterChanged(int slot) {
|
||||||
|
/* if (!canModifyFilter(slot)) { getMultiblock().getLogic().refreshPorts(); } */
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1018,7 +994,7 @@ public class TileSaltFissionVessel extends TileFissionPart implements ITileFilte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
||||||
}
|
}
|
||||||
return super.hasCapability(capability, side);
|
return super.hasCapability(capability, side);
|
||||||
|
@ -1032,7 +1008,7 @@ public class TileSaltFissionVessel extends TileFissionPart implements ITileFilte
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (ModCheck.mekanismLoaded() && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
else if (ModCheck.mekanismLoaded() && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
||||||
return (T) getGasWrapper();
|
return (T) getGasWrapper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,20 @@
|
||||||
package nc.multiblock.fission.solid.block;
|
package nc.multiblock.fission.solid.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import nc.NuclearCraft;
|
import nc.NuclearCraft;
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.multiblock.fission.block.BlockFissionPart;
|
import nc.multiblock.fission.block.BlockFissionPart;
|
||||||
import nc.multiblock.fission.solid.tile.TileSolidFissionController;
|
import nc.multiblock.fission.solid.tile.TileSolidFissionController;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockSolidFissionController extends BlockFissionPart implements IActivatable {
|
public class BlockSolidFissionController extends BlockFissionPart {
|
||||||
|
|
||||||
public BlockSolidFissionController() {
|
public BlockSolidFissionController() {
|
||||||
super();
|
super();
|
||||||
|
@ -83,4 +78,15 @@ public class BlockSolidFissionController extends BlockFissionPart implements IAc
|
||||||
}
|
}
|
||||||
return rightClickOnPart(world, pos, player, hand, facing, true);
|
return rightClickOnPart(world, pos, player, hand, facing, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() instanceof BlockSolidFissionController) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -795,7 +795,7 @@ public class TileSolidFissionCell extends TileFissionPart implements ITileFilter
|
||||||
public void toggleCellSetting(@Nonnull EnumFacing side) {
|
public void toggleCellSetting(@Nonnull EnumFacing side) {
|
||||||
setCellSetting(side, getCellSetting(side).next());
|
setCellSetting(side, getCellSetting(side).next());
|
||||||
refreshInventoryConnections(side);
|
refreshInventoryConnections(side);
|
||||||
markDirtyAndNotify(true);
|
markDirtyAndNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshInventoryConnections(@Nonnull EnumFacing side) {
|
public void refreshInventoryConnections(@Nonnull EnumFacing side) {
|
||||||
|
@ -837,6 +837,7 @@ public class TileSolidFissionCell extends TileFissionPart implements ITileFilter
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterChanged(int slot) {
|
public void onFilterChanged(int slot) {
|
||||||
|
/* if (!canModifyFilter(slot)) { getMultiblock().getLogic().refreshPorts(); } */
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,14 @@ public class TileSolidFissionController extends TileFissionPart implements IFiss
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockSolidFissionController) {
|
||||||
|
((BlockSolidFissionController) getBlockType()).setState(isActive, this);
|
||||||
|
world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doMeltdown() {
|
public void doMeltdown() {
|
||||||
IBlockState corium = RegistryHelper.getBlock(Global.MOD_ID + ":fluid_corium").getDefaultState();
|
IBlockState corium = RegistryHelper.getBlock(Global.MOD_ID + ":fluid_corium").getDefaultState();
|
||||||
|
|
|
@ -12,7 +12,7 @@ import nc.multiblock.fission.tile.*;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
public class TileSolidFissionSink extends TileFissionPart implements IFissionCoolingComponent {
|
public abstract class TileSolidFissionSink extends TileFissionPart implements IFissionCoolingComponent {
|
||||||
|
|
||||||
public String sinkName;
|
public String sinkName;
|
||||||
public int coolingRate;
|
public int coolingRate;
|
||||||
|
|
|
@ -5,5 +5,7 @@ import nc.multiblock.tile.ILogicMultiblockController;
|
||||||
|
|
||||||
public interface IFissionController extends IFissionPart, ILogicMultiblockController<FissionReactor> {
|
public interface IFissionController extends IFissionPart, ILogicMultiblockController<FissionReactor> {
|
||||||
|
|
||||||
|
public void updateBlockState(boolean isActive);
|
||||||
|
|
||||||
public void doMeltdown();
|
public void doMeltdown();
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,11 +273,7 @@ public class TileFissionIrradiator extends TileFissionPart implements ITileFilte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refreshActivity() {
|
public void refreshActivity() {
|
||||||
boolean wasReady = readyToProcess(false);
|
|
||||||
canProcessInputs = canProcessInputs();
|
canProcessInputs = canProcessInputs();
|
||||||
if (getMultiblock() != null && !wasReady && readyToProcess(false)) {
|
|
||||||
getMultiblock().refreshFlag = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -578,6 +574,7 @@ public class TileFissionIrradiator extends TileFissionPart implements ITileFilte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterChanged(int slot) {
|
public void onFilterChanged(int slot) {
|
||||||
|
/* if (!canModifyFilter(slot)) { getMultiblock().getLogic().refreshPorts(); } */
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,9 @@ public class TileFissionMonitor extends TileFissionPart {
|
||||||
@Override
|
@Override
|
||||||
public void onMachineBroken() {
|
public void onMachineBroken() {
|
||||||
super.onMachineBroken();
|
super.onMachineBroken();
|
||||||
|
// if (getWorld().isRemote) return;
|
||||||
|
// getWorld().setBlockState(getPos(),
|
||||||
|
// getWorld().getBlockState(getPos()), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,6 +46,13 @@ public class TileFissionMonitor extends TileFissionPart {
|
||||||
return oldState.getBlock() != newState.getBlock();
|
return oldState.getBlock() != newState.getBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockFissionMonitor) {
|
||||||
|
((BlockFissionMonitor) getBlockType()).setState(isActive, this);
|
||||||
|
world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public BlockPos getComponentPos() {
|
public BlockPos getComponentPos() {
|
||||||
return componentPos;
|
return componentPos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,46 +1,30 @@
|
||||||
package nc.multiblock.fission.tile;
|
package nc.multiblock.fission.tile;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
import static nc.block.property.BlockProperties.FACING_ALL;
|
||||||
import static nc.config.NCConfig.enable_gtce_eu;
|
import static nc.config.NCConfig.*;
|
||||||
import static nc.config.NCConfig.rf_per_eu;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import gregtech.api.capability.GregtechCapabilities;
|
import gregtech.api.capability.*;
|
||||||
import gregtech.api.capability.IEnergyContainer;
|
|
||||||
import ic2.api.energy.EnergyNet;
|
import ic2.api.energy.EnergyNet;
|
||||||
import ic2.api.energy.tile.IEnergyAcceptor;
|
import ic2.api.energy.tile.*;
|
||||||
import ic2.api.energy.tile.IEnergySink;
|
|
||||||
import ic2.api.energy.tile.IEnergySource;
|
|
||||||
import nc.ModCheck;
|
import nc.ModCheck;
|
||||||
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
import nc.multiblock.fission.FissionReactor;
|
||||||
import nc.multiblock.fission.block.BlockFissionPowerPort;
|
|
||||||
import nc.multiblock.turbine.tile.TileTurbinePart;
|
import nc.multiblock.turbine.tile.TileTurbinePart;
|
||||||
import nc.tile.energy.ITileEnergy;
|
import nc.tile.energy.ITileEnergy;
|
||||||
import nc.tile.internal.energy.EnergyConnection;
|
import nc.tile.internal.energy.*;
|
||||||
import nc.tile.internal.energy.EnergyStorage;
|
import nc.tile.internal.energy.EnergyStorage;
|
||||||
import nc.tile.internal.energy.EnergyTileWrapper;
|
|
||||||
import nc.tile.internal.energy.EnergyTileWrapperGT;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.tile.passive.ITilePassive;
|
import nc.tile.passive.ITilePassive;
|
||||||
import nc.util.EnergyHelper;
|
import nc.util.EnergyHelper;
|
||||||
import nc.util.Lang;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.*;
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraft.util.text.TextComponentString;
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.energy.CapabilityEnergy;
|
import net.minecraftforge.energy.*;
|
||||||
import net.minecraftforge.energy.IEnergyStorage;
|
|
||||||
import net.minecraftforge.fml.common.Optional;
|
import net.minecraftforge.fml.common.Optional;
|
||||||
|
|
||||||
@Optional.InterfaceList({@Optional.Interface(iface = "ic2.api.energy.tile.IEnergyTile", modid = "ic2"), @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "ic2"), @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "ic2")})
|
@Optional.InterfaceList({@Optional.Interface(iface = "ic2.api.energy.tile.IEnergyTile", modid = "ic2"), @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "ic2"), @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "ic2")})
|
||||||
|
@ -71,6 +55,9 @@ public class TileFissionPowerPort extends TileFissionPart implements ITileEnergy
|
||||||
@Override
|
@Override
|
||||||
public void onMachineBroken() {
|
public void onMachineBroken() {
|
||||||
super.onMachineBroken();
|
super.onMachineBroken();
|
||||||
|
// if (getWorld().isRemote) return;
|
||||||
|
// getWorld().setBlockState(getPos(),
|
||||||
|
// getWorld().getBlockState(getPos()), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -81,9 +68,8 @@ public class TileFissionPowerPort extends TileFissionPart implements ITileEnergy
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
super.update();
|
super.update();
|
||||||
EnumFacing facing = getPartPosition().getFacing();
|
if (!world.isRemote) {
|
||||||
if (!world.isRemote && facing != null && getEnergyStored() > 0 && getEnergyConnection(facing).canExtract()) {
|
pushEnergy();
|
||||||
pushEnergyToSide(facing);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,41 +222,6 @@ public class TileFissionPowerPort extends TileFissionPart implements ITileEnergy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasConfigurableEnergyConnections() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IMultitoolLogic
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onUseMultitool(ItemStack multitoolStack, EntityPlayer player, World world, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
|
||||||
if (player.isSneaking()) {
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (getMultiblock() != null) {
|
|
||||||
if (getEnergyConnection(facing) != EnergyConnection.OUT) {
|
|
||||||
for (EnumFacing side : EnumFacing.VALUES) {
|
|
||||||
setEnergyConnection(EnergyConnection.OUT, side);
|
|
||||||
}
|
|
||||||
setActivity(false);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.port_toggle") + " " + TextFormatting.GOLD + Lang.localise("nc.block.fission_port_mode.output") + " " + TextFormatting.WHITE + Lang.localise("nc.block.port_toggle.mode")));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for (EnumFacing side : EnumFacing.VALUES) {
|
|
||||||
setEnergyConnection(EnergyConnection.IN, side);
|
|
||||||
}
|
|
||||||
setActivity(true);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.port_toggle") + " " + TextFormatting.DARK_AQUA + Lang.localise("nc.block.fission_port_mode.input") + " " + TextFormatting.WHITE + Lang.localise("nc.block.port_toggle.mode")));
|
|
||||||
}
|
|
||||||
markDirtyAndNotify(true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return super.onUseMultitool(multitoolStack, player, world, facing, hitX, hitY, hitZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
// NBT
|
// NBT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -230,7 +230,7 @@ public abstract class TileFissionShield extends TileFissionPart implements IFiss
|
||||||
isShielding = manager.isShieldingActive();
|
isShielding = manager.isShieldingActive();
|
||||||
if (wasShielding != isShielding) {
|
if (wasShielding != isShielding) {
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
setActivity(isShielding);
|
updateBlockState(isShielding);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -249,12 +249,19 @@ public abstract class TileFissionShield extends TileFissionPart implements IFiss
|
||||||
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
||||||
boolean wasShielding = isShielding;
|
boolean wasShielding = isShielding;
|
||||||
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
||||||
setActivity(isShielding);
|
updateBlockState(isShielding);
|
||||||
if (!world.isRemote && wasShielding != isShielding) {
|
if (!world.isRemote && wasShielding != isShielding) {
|
||||||
getLogic().onShieldUpdated(this);
|
getLogic().onShieldUpdated(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockFissionShield) {
|
||||||
|
((BlockFissionShield) getBlockType()).setState(isActive, this);
|
||||||
|
// world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NBT
|
// NBT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -97,12 +97,19 @@ public abstract class TileFissionSource extends TileFissionPart {
|
||||||
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
||||||
boolean wasRedstonePowered = getIsRedstonePowered();
|
boolean wasRedstonePowered = getIsRedstonePowered();
|
||||||
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
||||||
setActivity(getIsRedstonePowered());
|
updateBlockState(getIsRedstonePowered());
|
||||||
if (!world.isRemote && wasRedstonePowered != getIsRedstonePowered()) {
|
if (!world.isRemote && wasRedstonePowered != getIsRedstonePowered()) {
|
||||||
getLogic().onSourceUpdated(this);
|
getLogic().onSourceUpdated(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockFissionSource) {
|
||||||
|
((BlockFissionSource) getBlockType()).setState(isActive, this);
|
||||||
|
// world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public PrimingTargetInfo getPrimingTarget(boolean simulate) {
|
public PrimingTargetInfo getPrimingTarget(boolean simulate) {
|
||||||
EnumFacing facing = getPartPosition().getFacing();
|
EnumFacing facing = getPartPosition().getFacing();
|
||||||
if (facing == null) {
|
if (facing == null) {
|
||||||
|
|
|
@ -3,11 +3,9 @@ package nc.multiblock.fission.tile;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
import static nc.block.property.BlockProperties.FACING_ALL;
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.enable_mek_gas;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
@ -16,15 +14,9 @@ import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
import nc.multiblock.fission.FissionReactor;
|
||||||
import nc.multiblock.fission.block.BlockFissionVent;
|
import nc.multiblock.fission.block.BlockFissionVent;
|
||||||
import nc.tile.fluid.ITileFluid;
|
import nc.tile.fluid.ITileFluid;
|
||||||
import nc.tile.internal.fluid.FluidConnection;
|
import nc.tile.internal.fluid.*;
|
||||||
import nc.tile.internal.fluid.FluidTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.GasTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.Tank;
|
|
||||||
import nc.tile.internal.fluid.TankOutputSetting;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.tile.passive.ITilePassive;
|
import nc.tile.passive.ITilePassive;
|
||||||
import nc.util.CapabilityHelper;
|
import nc.util.*;
|
||||||
import nc.util.Lang;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -32,12 +24,10 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
import net.minecraft.util.text.*;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.*;
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
|
||||||
|
|
||||||
public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
||||||
|
|
||||||
|
@ -67,6 +57,16 @@ public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
||||||
@Override
|
@Override
|
||||||
public void onMachineBroken() {
|
public void onMachineBroken() {
|
||||||
super.onMachineBroken();
|
super.onMachineBroken();
|
||||||
|
// if (getWorld().isRemote) return;
|
||||||
|
// getWorld().setBlockState(getPos(),
|
||||||
|
// getWorld().getBlockState(getPos()), 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockFissionVent) {
|
||||||
|
((BlockFissionVent) getBlockType()).setState(isActive, this);
|
||||||
|
// world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,7 +78,7 @@ public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
||||||
public void update() {
|
public void update() {
|
||||||
super.update();
|
super.update();
|
||||||
EnumFacing facing = getPartPosition().getFacing();
|
EnumFacing facing = getPartPosition().getFacing();
|
||||||
if (!world.isRemote && facing != null && !getTanks().get(1).isEmpty() && getTankSorption(facing, 1).canDrain()) {
|
if (!world.isRemote && !getTanks().get(1).isEmpty() && facing != null && getTankSorption(facing, 1).canDrain()) {
|
||||||
pushFluidToSide(facing);
|
pushFluidToSide(facing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
||||||
setTankSorption(side, 0, TankSorption.IN);
|
setTankSorption(side, 0, TankSorption.IN);
|
||||||
setTankSorption(side, 1, TankSorption.NON);
|
setTankSorption(side, 1, TankSorption.NON);
|
||||||
}
|
}
|
||||||
setActivity(false);
|
updateBlockState(false);
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.vent_toggle") + " " + TextFormatting.DARK_AQUA + Lang.localise("nc.block.fission_vent_mode.input") + " " + TextFormatting.WHITE + Lang.localise("nc.block.vent_toggle.mode")));
|
player.sendMessage(new TextComponentString(Lang.localise("nc.block.vent_toggle") + " " + TextFormatting.DARK_AQUA + Lang.localise("nc.block.fission_vent_mode.input") + " " + TextFormatting.WHITE + Lang.localise("nc.block.vent_toggle.mode")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -190,10 +190,10 @@ public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
||||||
setTankSorption(side, 0, TankSorption.NON);
|
setTankSorption(side, 0, TankSorption.NON);
|
||||||
setTankSorption(side, 1, TankSorption.OUT);
|
setTankSorption(side, 1, TankSorption.OUT);
|
||||||
}
|
}
|
||||||
setActivity(true);
|
updateBlockState(true);
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.vent_toggle") + " " + TextFormatting.RED + Lang.localise("nc.block.fission_vent_mode.output") + " " + TextFormatting.WHITE + Lang.localise("nc.block.vent_toggle.mode")));
|
player.sendMessage(new TextComponentString(Lang.localise("nc.block.vent_toggle") + " " + TextFormatting.RED + Lang.localise("nc.block.fission_vent_mode.output") + " " + TextFormatting.WHITE + Lang.localise("nc.block.vent_toggle.mode")));
|
||||||
}
|
}
|
||||||
markDirtyAndNotify(true);
|
markDirtyAndNotify();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
||||||
}
|
}
|
||||||
return super.hasCapability(capability, side);
|
return super.hasCapability(capability, side);
|
||||||
|
@ -233,7 +233,7 @@ public class TileFissionVent extends TileFissionPart implements ITileFluid {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (ModCheck.mekanismLoaded() && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
else if (ModCheck.mekanismLoaded() && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
||||||
return (T) getGasWrapper();
|
return (T) getGasWrapper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,12 +64,19 @@ public class TileFissionShieldManager extends TileFissionManager<TileFissionShie
|
||||||
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
||||||
boolean wasShieldingActive = isShieldingActive();
|
boolean wasShieldingActive = isShieldingActive();
|
||||||
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
||||||
setActivity(isShieldingActive());
|
updateBlockState(isShieldingActive());
|
||||||
if (!world.isRemote && wasShieldingActive != isShieldingActive()) {
|
if (!world.isRemote && wasShieldingActive != isShieldingActive()) {
|
||||||
refreshListeners(false);
|
refreshListeners(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockFissionShieldManager) {
|
||||||
|
((BlockFissionShieldManager) getBlockType()).setState(isActive, this);
|
||||||
|
// world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// IMultitoolLogic
|
// IMultitoolLogic
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,7 +93,7 @@ public class TileFissionShieldManager extends TileFissionManager<TileFissionShie
|
||||||
shield.setManagerPos(pos);
|
shield.setManagerPos(pos);
|
||||||
shield.refreshManager();
|
shield.refreshManager();
|
||||||
}
|
}
|
||||||
markDirty();
|
markDirtyAndNotify();
|
||||||
getMultiblock().refreshFlag = true;
|
getMultiblock().refreshFlag = true;
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("info.nuclearcraft.multitool.fission.connect_shield_manager", listenerPosSet.size())));
|
player.sendMessage(new TextComponentString(Lang.localise("info.nuclearcraft.multitool.fission.connect_shield_manager", listenerPosSet.size())));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -3,33 +3,19 @@ package nc.multiblock.fission.tile.port;
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.enable_mek_gas;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.PosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import nc.ModCheck;
|
import nc.ModCheck;
|
||||||
import nc.recipe.ProcessorRecipeHandler;
|
import nc.recipe.ProcessorRecipeHandler;
|
||||||
import nc.tile.fluid.ITileFilteredFluid;
|
import nc.tile.fluid.*;
|
||||||
import nc.tile.fluid.ITileFluid;
|
import nc.tile.internal.fluid.*;
|
||||||
import nc.tile.internal.fluid.FluidConnection;
|
import nc.util.GasHelper;
|
||||||
import nc.tile.internal.fluid.FluidTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.GasTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.Tank;
|
|
||||||
import nc.tile.internal.fluid.TankOutputSetting;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.util.CapabilityHelper;
|
|
||||||
import nc.util.Lang;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
|
|
||||||
|
@ -57,15 +43,6 @@ public abstract class TileFissionFluidPort<PORT extends TileFissionFluidPort<POR
|
||||||
this.recipeHandler = recipeHandler;
|
this.recipeHandler = recipeHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update() {
|
|
||||||
super.update();
|
|
||||||
EnumFacing facing = getPartPosition().getFacing();
|
|
||||||
if (!world.isRemote && facing != null && !getTanks().get(1).isEmpty() && getTankSorption(facing, 1).canDrain()) {
|
|
||||||
pushFluidToSide(facing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInventoryStackLimit(int stackLimit) {}
|
public void setInventoryStackLimit(int stackLimit) {}
|
||||||
|
|
||||||
|
@ -87,6 +64,7 @@ public abstract class TileFissionFluidPort<PORT extends TileFissionFluidPort<POR
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterChanged(int tank) {
|
public void onFilterChanged(int tank) {
|
||||||
|
/* if (!canModifyFilter(tank)) { getMultiblock().getLogic().refreshPorts(); } */
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +73,8 @@ public abstract class TileFissionFluidPort<PORT extends TileFissionFluidPort<POR
|
||||||
return getFilterTanks().get(0).getFluidName().hashCode();
|
return getFilterTanks().get(0).getFluidName().hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @Override public void markDirty() { super.markDirty(); } */
|
||||||
|
|
||||||
// Fluids
|
// Fluids
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -156,43 +136,6 @@ public abstract class TileFissionFluidPort<PORT extends TileFissionFluidPort<POR
|
||||||
@Override
|
@Override
|
||||||
public void setTankOutputSetting(int tankNumber, TankOutputSetting setting) {}
|
public void setTankOutputSetting(int tankNumber, TankOutputSetting setting) {}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasConfigurableFluidConnections() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IMultitoolLogic
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onUseMultitool(ItemStack multitoolStack, EntityPlayer player, World world, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
|
||||||
if (player.isSneaking()) {
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (getMultiblock() != null) {
|
|
||||||
if (getTankSorption(facing, 0) != TankSorption.IN) {
|
|
||||||
for (EnumFacing side : EnumFacing.VALUES) {
|
|
||||||
setTankSorption(side, 0, TankSorption.IN);
|
|
||||||
setTankSorption(side, 1, TankSorption.NON);
|
|
||||||
}
|
|
||||||
setActivity(false);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.port_toggle") + " " + TextFormatting.DARK_AQUA + Lang.localise("nc.block.fission_port_mode.input") + " " + TextFormatting.WHITE + Lang.localise("nc.block.port_toggle.mode")));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for (EnumFacing side : EnumFacing.VALUES) {
|
|
||||||
setTankSorption(side, 0, TankSorption.NON);
|
|
||||||
setTankSorption(side, 1, TankSorption.OUT);
|
|
||||||
}
|
|
||||||
setActivity(true);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.port_toggle") + " " + TextFormatting.RED + Lang.localise("nc.block.fission_port_mode.output") + " " + TextFormatting.WHITE + Lang.localise("nc.block.port_toggle.mode")));
|
|
||||||
}
|
|
||||||
markDirtyAndNotify(true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return super.onUseMultitool(multitoolStack, player, world, facing, hitX, hitY, hitZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
// NBT
|
// NBT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -233,7 +176,7 @@ public abstract class TileFissionFluidPort<PORT extends TileFissionFluidPort<POR
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
||||||
}
|
}
|
||||||
return super.hasCapability(capability, side);
|
return super.hasCapability(capability, side);
|
||||||
|
@ -247,7 +190,7 @@ public abstract class TileFissionFluidPort<PORT extends TileFissionFluidPort<POR
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (ModCheck.mekanismLoaded() && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
else if (ModCheck.mekanismLoaded() && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
||||||
return (T) getGasWrapper();
|
return (T) getGasWrapper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,11 +274,6 @@ public class TileFissionHeaterPort extends TileFissionFluidPort<TileFissionHeate
|
||||||
return coolantName.hashCode();
|
return coolantName.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasConfigurableFluidConnections() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ticking
|
// Ticking
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,20 +12,13 @@ import com.google.common.collect.Lists;
|
||||||
import nc.Global;
|
import nc.Global;
|
||||||
import nc.multiblock.fission.tile.port.internal.PortItemHandler;
|
import nc.multiblock.fission.tile.port.internal.PortItemHandler;
|
||||||
import nc.recipe.ProcessorRecipeHandler;
|
import nc.recipe.ProcessorRecipeHandler;
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.tile.internal.inventory.*;
|
import nc.tile.internal.inventory.*;
|
||||||
import nc.tile.inventory.*;
|
import nc.tile.inventory.*;
|
||||||
import nc.util.Lang;
|
|
||||||
import nc.util.NBTHelper;
|
import nc.util.NBTHelper;
|
||||||
import nc.util.NCUtil;
|
|
||||||
import net.minecraft.client.util.RecipeItemHelper;
|
import net.minecraft.client.util.RecipeItemHelper;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.text.TextComponentString;
|
|
||||||
import net.minecraft.util.text.TextFormatting;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.items.*;
|
import net.minecraftforge.items.*;
|
||||||
|
|
||||||
|
@ -48,15 +41,6 @@ public abstract class TileFissionItemPort<PORT extends TileFissionItemPort<PORT,
|
||||||
this.recipeHandler = recipeHandler;
|
this.recipeHandler = recipeHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update() {
|
|
||||||
super.update();
|
|
||||||
EnumFacing facing = getPartPosition().getFacing();
|
|
||||||
if (!world.isRemote && facing != null && !getStackInSlot(1).isEmpty() && getItemSorption(facing, 1).canExtract()) {
|
|
||||||
pushStacksToSide(facing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInventoryStackLimit(int stackLimit) {
|
public void setInventoryStackLimit(int stackLimit) {
|
||||||
inventoryStackLimit = stackLimit;
|
inventoryStackLimit = stackLimit;
|
||||||
|
@ -82,6 +66,7 @@ public abstract class TileFissionItemPort<PORT extends TileFissionItemPort<PORT,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterChanged(int slot) {
|
public void onFilterChanged(int slot) {
|
||||||
|
/* if (!canModifyFilter(slot)) { getMultiblock().getLogic().refreshPorts(); } */
|
||||||
markDirty();
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +124,8 @@ public abstract class TileFissionItemPort<PORT extends TileFissionItemPort<PORT,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @Override public void markDirty() { super.markDirty(); } */
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||||
if (stack.isEmpty() || slot >= recipeHandler.getItemInputSize()) {
|
if (stack.isEmpty() || slot >= recipeHandler.getItemInputSize()) {
|
||||||
|
@ -199,43 +186,6 @@ public abstract class TileFissionItemPort<PORT extends TileFissionItemPort<PORT,
|
||||||
@Override
|
@Override
|
||||||
public void setItemOutputSetting(int slot, ItemOutputSetting setting) {}
|
public void setItemOutputSetting(int slot, ItemOutputSetting setting) {}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasConfigurableInventoryConnections() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IMultitoolLogic
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onUseMultitool(ItemStack multitoolStack, EntityPlayer player, World world, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
|
||||||
if (player.isSneaking()) {
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (getMultiblock() != null) {
|
|
||||||
if (getItemSorption(facing, 0) != ItemSorption.IN) {
|
|
||||||
for (EnumFacing side : EnumFacing.VALUES) {
|
|
||||||
setItemSorption(side, 0, ItemSorption.IN);
|
|
||||||
setItemSorption(side, 1, ItemSorption.NON);
|
|
||||||
}
|
|
||||||
setActivity(false);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.port_toggle") + " " + TextFormatting.BLUE + Lang.localise("nc.block.fission_port_mode.input") + " " + TextFormatting.WHITE + Lang.localise("nc.block.port_toggle.mode")));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for (EnumFacing side : EnumFacing.VALUES) {
|
|
||||||
setItemSorption(side, 0, ItemSorption.NON);
|
|
||||||
setItemSorption(side, 1, ItemSorption.OUT);
|
|
||||||
}
|
|
||||||
setActivity(true);
|
|
||||||
player.sendMessage(new TextComponentString(Lang.localise("nc.block.port_toggle") + " " + TextFormatting.GOLD + Lang.localise("nc.block.fission_port_mode.output") + " " + TextFormatting.WHITE + Lang.localise("nc.block.port_toggle.mode")));
|
|
||||||
}
|
|
||||||
markDirtyAndNotify(true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return super.onUseMultitool(multitoolStack, player, world, facing, hitX, hitY, hitZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
// NBT
|
// NBT
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,8 +8,6 @@ import javax.annotation.*;
|
||||||
import it.unimi.dsi.fastutil.objects.*;
|
import it.unimi.dsi.fastutil.objects.*;
|
||||||
import nc.multiblock.cuboidal.*;
|
import nc.multiblock.cuboidal.*;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
import nc.multiblock.fission.FissionReactor;
|
||||||
import nc.multiblock.fission.block.port.BlockFissionMetaPort;
|
|
||||||
import nc.multiblock.fission.block.port.BlockFissionPort;
|
|
||||||
import nc.multiblock.fission.tile.TileFissionPart;
|
import nc.multiblock.fission.tile.TileFissionPart;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -46,6 +44,9 @@ public abstract class TileFissionPort<PORT extends TileFissionPort<PORT, TARGET>
|
||||||
@Override
|
@Override
|
||||||
public void onMachineBroken() {
|
public void onMachineBroken() {
|
||||||
super.onMachineBroken();
|
super.onMachineBroken();
|
||||||
|
|
||||||
|
// TODO - temporary ports
|
||||||
|
/* if (!getWorld().isRemote && !DEFAULT_NON.equals(masterPortPos)) { PORT master = masterPort; clearMasterPort(); master.shiftStacks(this); } */
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,7 +8,6 @@ import nc.multiblock.fission.tile.port.TileFissionHeaterPort;
|
||||||
import nc.network.PacketHandler;
|
import nc.network.PacketHandler;
|
||||||
import nc.network.gui.*;
|
import nc.network.gui.*;
|
||||||
import nc.tile.internal.fluid.Tank;
|
import nc.tile.internal.fluid.Tank;
|
||||||
import nc.util.Lang;
|
|
||||||
import nc.util.NCUtil;
|
import nc.util.NCUtil;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
@ -35,7 +34,7 @@ public class GuiFissionHeaterPort extends NCGui {
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||||
int fontColor = port.getMultiblock() != null && port.getMultiblock().isReactorOn ? -1 : 15641088;
|
int fontColor = port.getMultiblock() != null && port.getMultiblock().isReactorOn ? -1 : 15641088;
|
||||||
String s = Lang.localise("gui.nc.container.fission_heater_port.name");
|
String s = port.getDisplayName().getUnformattedText();
|
||||||
fontRenderer.drawString(s, xSize / 2 - fontRenderer.getStringWidth(s) / 2, 6, fontColor);
|
fontRenderer.drawString(s, xSize / 2 - fontRenderer.getStringWidth(s) / 2, 6, fontColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ public class HeatExchanger extends CuboidalMultiblock<IHeatExchangerPart, HeatEx
|
||||||
protected void onMachineDisassembled() {
|
protected void onMachineDisassembled() {
|
||||||
isHeatExchangerOn = false;
|
isHeatExchangerOn = false;
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
controller.setActivity(false);
|
controller.updateBlockState(false);
|
||||||
}
|
}
|
||||||
fractionOfTubesActive = efficiency = maxEfficiency = 0D;
|
fractionOfTubesActive = efficiency = maxEfficiency = 0D;
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ public class HeatExchanger extends CuboidalMultiblock<IHeatExchangerPart, HeatEx
|
||||||
isHeatExchangerOn = (isRedstonePowered() || computerActivated) && isAssembled();
|
isHeatExchangerOn = (isRedstonePowered() || computerActivated) && isAssembled();
|
||||||
if (isHeatExchangerOn != oldIsHeatExchangerOn) {
|
if (isHeatExchangerOn != oldIsHeatExchangerOn) {
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
controller.setActivity(isHeatExchangerOn);
|
controller.updateBlockState(isHeatExchangerOn);
|
||||||
sendUpdateToAllPlayers();
|
sendUpdateToAllPlayers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,22 @@
|
||||||
package nc.multiblock.heatExchanger.block;
|
package nc.multiblock.heatExchanger.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import nc.NuclearCraft;
|
import nc.NuclearCraft;
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.init.NCBlocks;
|
import nc.init.NCBlocks;
|
||||||
import nc.multiblock.heatExchanger.tile.TileCondenserController;
|
import nc.multiblock.heatExchanger.tile.TileCondenserController;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockCondenserController extends BlockHeatExchangerPart implements IActivatable {
|
public class BlockCondenserController extends BlockHeatExchangerPart {
|
||||||
|
|
||||||
public BlockCondenserController() {
|
public BlockCondenserController() {
|
||||||
super();
|
super();
|
||||||
|
@ -93,4 +87,15 @@ public class BlockCondenserController extends BlockHeatExchangerPart implements
|
||||||
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
||||||
return side != null;
|
return side != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() == NCBlocks.condenser_controller) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package nc.multiblock.heatExchanger.block;
|
package nc.multiblock.heatExchanger.block;
|
||||||
|
|
||||||
import nc.block.property.*;
|
import nc.block.property.*;
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.item.ItemMultitool;
|
import nc.item.ItemMultitool;
|
||||||
import nc.multiblock.heatExchanger.*;
|
import nc.multiblock.heatExchanger.*;
|
||||||
import nc.multiblock.heatExchanger.tile.TileCondenserTube;
|
import nc.multiblock.heatExchanger.tile.TileCondenserTube;
|
||||||
|
@ -17,7 +16,7 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.*;
|
import net.minecraft.util.text.*;
|
||||||
import net.minecraft.world.*;
|
import net.minecraft.world.*;
|
||||||
|
|
||||||
public class BlockCondenserTube extends BlockHeatExchangerPart implements IDynamicState, ISidedProperty<HeatExchangerTubeSetting> {
|
public class BlockCondenserTube extends BlockHeatExchangerPart implements ISidedProperty<HeatExchangerTubeSetting> {
|
||||||
|
|
||||||
private static EnumFacing placementSide = null;
|
private static EnumFacing placementSide = null;
|
||||||
|
|
||||||
|
@ -123,7 +122,7 @@ public class BlockCondenserTube extends BlockHeatExchangerPart implements IDynam
|
||||||
TileCondenserTube other = (TileCondenserTube) otherTile;
|
TileCondenserTube other = (TileCondenserTube) otherTile;
|
||||||
tube.setFluidConnections(FluidConnection.cloneArray(other.getFluidConnections()));
|
tube.setFluidConnections(FluidConnection.cloneArray(other.getFluidConnections()));
|
||||||
tube.setTubeSettings(other.getTubeSettings().clone());
|
tube.setTubeSettings(other.getTubeSettings().clone());
|
||||||
tube.markDirtyAndNotify(true);
|
tube.markDirtyAndNotify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,22 @@
|
||||||
package nc.multiblock.heatExchanger.block;
|
package nc.multiblock.heatExchanger.block;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.ACTIVE;
|
import static nc.block.property.BlockProperties.*;
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import nc.NuclearCraft;
|
import nc.NuclearCraft;
|
||||||
import nc.block.tile.IActivatable;
|
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.init.NCBlocks;
|
import nc.init.NCBlocks;
|
||||||
import nc.multiblock.heatExchanger.tile.TileHeatExchangerController;
|
import nc.multiblock.heatExchanger.tile.TileHeatExchangerController;
|
||||||
import nc.util.BlockHelper;
|
import nc.util.BlockHelper;
|
||||||
import net.minecraft.block.state.BlockStateContainer;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.EnumHand;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.*;
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockHeatExchangerController extends BlockHeatExchangerPart implements IActivatable {
|
public class BlockHeatExchangerController extends BlockHeatExchangerPart {
|
||||||
|
|
||||||
public BlockHeatExchangerController() {
|
public BlockHeatExchangerController() {
|
||||||
super();
|
super();
|
||||||
|
@ -93,4 +87,15 @@ public class BlockHeatExchangerController extends BlockHeatExchangerPart impleme
|
||||||
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
||||||
return side != null;
|
return side != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setState(boolean isActive, TileEntity tile) {
|
||||||
|
World world = tile.getWorld();
|
||||||
|
BlockPos pos = tile.getPos();
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if (!world.isRemote && state.getBlock() == NCBlocks.heat_exchanger_controller) {
|
||||||
|
if (isActive != state.getValue(ACTIVE)) {
|
||||||
|
world.setBlockState(pos, state.withProperty(ACTIVE, isActive), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package nc.multiblock.heatExchanger.block;
|
package nc.multiblock.heatExchanger.block;
|
||||||
|
|
||||||
import nc.block.property.*;
|
import nc.block.property.*;
|
||||||
import nc.block.tile.IDynamicState;
|
|
||||||
import nc.item.ItemMultitool;
|
import nc.item.ItemMultitool;
|
||||||
import nc.multiblock.heatExchanger.*;
|
import nc.multiblock.heatExchanger.*;
|
||||||
import nc.multiblock.heatExchanger.tile.TileHeatExchangerTube;
|
import nc.multiblock.heatExchanger.tile.TileHeatExchangerTube;
|
||||||
|
@ -17,7 +16,7 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.*;
|
import net.minecraft.util.text.*;
|
||||||
import net.minecraft.world.*;
|
import net.minecraft.world.*;
|
||||||
|
|
||||||
public class BlockHeatExchangerTube extends BlockHeatExchangerPart implements IDynamicState, ISidedProperty<HeatExchangerTubeSetting> {
|
public class BlockHeatExchangerTube extends BlockHeatExchangerPart implements ISidedProperty<HeatExchangerTubeSetting> {
|
||||||
|
|
||||||
private static EnumFacing placementSide = null;
|
private static EnumFacing placementSide = null;
|
||||||
|
|
||||||
|
@ -123,7 +122,7 @@ public class BlockHeatExchangerTube extends BlockHeatExchangerPart implements ID
|
||||||
TileHeatExchangerTube other = (TileHeatExchangerTube) otherTile;
|
TileHeatExchangerTube other = (TileHeatExchangerTube) otherTile;
|
||||||
tube.setFluidConnections(FluidConnection.cloneArray(other.getFluidConnections()));
|
tube.setFluidConnections(FluidConnection.cloneArray(other.getFluidConnections()));
|
||||||
tube.setTubeSettings(other.getTubeSettings().clone());
|
tube.setTubeSettings(other.getTubeSettings().clone());
|
||||||
tube.markDirtyAndNotify(true);
|
tube.markDirtyAndNotify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,5 @@ import nc.multiblock.tile.ILogicMultiblockController;
|
||||||
|
|
||||||
public interface IHeatExchangerController extends IHeatExchangerPart, ILogicMultiblockController<HeatExchanger> {
|
public interface IHeatExchangerController extends IHeatExchangerPart, ILogicMultiblockController<HeatExchanger> {
|
||||||
|
|
||||||
|
public void updateBlockState(boolean isActive);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,4 +61,12 @@ public class TileCondenserController extends TileHeatExchangerPart implements IH
|
||||||
public int[] weakSidesToCheck(World world, BlockPos pos) {
|
public int[] weakSidesToCheck(World world, BlockPos pos) {
|
||||||
return new int[] {2, 3, 4, 5};
|
return new int[] {2, 3, 4, 5};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockCondenserController) {
|
||||||
|
((BlockCondenserController) getBlockType()).setState(isActive, this);
|
||||||
|
world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,25 @@
|
||||||
package nc.multiblock.heatExchanger.tile;
|
package nc.multiblock.heatExchanger.tile;
|
||||||
|
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.enable_mek_gas;
|
||||||
import static nc.recipe.NCRecipes.condenser;
|
import static nc.recipe.NCRecipes.*;
|
||||||
import static nc.recipe.NCRecipes.condenser_valid_fluids;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntList;
|
import it.unimi.dsi.fastutil.ints.IntList;
|
||||||
import nc.ModCheck;
|
import nc.ModCheck;
|
||||||
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.heatExchanger.HeatExchanger;
|
import nc.multiblock.heatExchanger.*;
|
||||||
import nc.multiblock.heatExchanger.HeatExchangerTubeSetting;
|
import nc.recipe.*;
|
||||||
import nc.multiblock.heatExchanger.HeatExchangerTubeType;
|
|
||||||
import nc.recipe.AbstractRecipeHandler;
|
|
||||||
import nc.recipe.ProcessorRecipe;
|
|
||||||
import nc.recipe.RecipeInfo;
|
|
||||||
import nc.recipe.ingredient.IFluidIngredient;
|
import nc.recipe.ingredient.IFluidIngredient;
|
||||||
import nc.tile.fluid.ITileFluid;
|
import nc.tile.fluid.ITileFluid;
|
||||||
import nc.tile.internal.fluid.FluidConnection;
|
import nc.tile.internal.fluid.*;
|
||||||
import nc.tile.internal.fluid.FluidTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.GasTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.Tank;
|
|
||||||
import nc.tile.internal.fluid.TankOutputSetting;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.tile.passive.ITilePassive;
|
import nc.tile.passive.ITilePassive;
|
||||||
import nc.tile.processor.IFluidProcessor;
|
import nc.tile.processor.IFluidProcessor;
|
||||||
import nc.util.CapabilityHelper;
|
import nc.util.GasHelper;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -40,8 +28,7 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.IFluidBlock;
|
import net.minecraftforge.fluids.IFluidBlock;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.*;
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
|
||||||
|
|
||||||
public class TileCondenserTube extends TileHeatExchangerPart implements IFluidProcessor {
|
public class TileCondenserTube extends TileHeatExchangerPart implements IFluidProcessor {
|
||||||
|
|
||||||
|
@ -400,7 +387,7 @@ public class TileCondenserTube extends TileHeatExchangerPart implements IFluidPr
|
||||||
public void toggleTubeSetting(@Nonnull EnumFacing side) {
|
public void toggleTubeSetting(@Nonnull EnumFacing side) {
|
||||||
setTubeSetting(side, getTubeSetting(side).next());
|
setTubeSetting(side, getTubeSetting(side).next());
|
||||||
refreshFluidConnections(side);
|
refreshFluidConnections(side);
|
||||||
markDirtyAndNotify(true);
|
markDirtyAndNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
||||||
|
@ -615,7 +602,7 @@ public class TileCondenserTube extends TileHeatExchangerPart implements IFluidPr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
||||||
}
|
}
|
||||||
return super.hasCapability(capability, side);
|
return super.hasCapability(capability, side);
|
||||||
|
@ -629,7 +616,7 @@ public class TileCondenserTube extends TileHeatExchangerPart implements IFluidPr
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (ModCheck.mekanismLoaded() && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
else if (ModCheck.mekanismLoaded() && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
||||||
return (T) getGasWrapper();
|
return (T) getGasWrapper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,4 +61,12 @@ public class TileHeatExchangerController extends TileHeatExchangerPart implement
|
||||||
public int[] weakSidesToCheck(World world, BlockPos pos) {
|
public int[] weakSidesToCheck(World world, BlockPos pos) {
|
||||||
return new int[] {2, 3, 4, 5};
|
return new int[] {2, 3, 4, 5};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBlockState(boolean isActive) {
|
||||||
|
if (getBlockType() instanceof BlockHeatExchangerController) {
|
||||||
|
((BlockHeatExchangerController) getBlockType()).setState(isActive, this);
|
||||||
|
world.notifyNeighborsOfStateChange(pos, getBlockType(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +1,31 @@
|
||||||
package nc.multiblock.heatExchanger.tile;
|
package nc.multiblock.heatExchanger.tile;
|
||||||
|
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.enable_mek_gas;
|
||||||
import static nc.recipe.NCRecipes.heat_exchanger;
|
import static nc.recipe.NCRecipes.*;
|
||||||
import static nc.recipe.NCRecipes.heat_exchanger_valid_fluids;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntList;
|
import it.unimi.dsi.fastutil.ints.IntList;
|
||||||
import nc.ModCheck;
|
import nc.ModCheck;
|
||||||
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.heatExchanger.HeatExchanger;
|
import nc.multiblock.heatExchanger.*;
|
||||||
import nc.multiblock.heatExchanger.HeatExchangerTubeSetting;
|
import nc.recipe.*;
|
||||||
import nc.multiblock.heatExchanger.HeatExchangerTubeType;
|
|
||||||
import nc.recipe.AbstractRecipeHandler;
|
|
||||||
import nc.recipe.ProcessorRecipe;
|
|
||||||
import nc.recipe.RecipeInfo;
|
|
||||||
import nc.recipe.ingredient.IFluidIngredient;
|
import nc.recipe.ingredient.IFluidIngredient;
|
||||||
import nc.tile.fluid.ITileFluid;
|
import nc.tile.fluid.ITileFluid;
|
||||||
import nc.tile.internal.fluid.FluidConnection;
|
import nc.tile.internal.fluid.*;
|
||||||
import nc.tile.internal.fluid.FluidTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.GasTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.Tank;
|
|
||||||
import nc.tile.internal.fluid.TankOutputSetting;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.tile.passive.ITilePassive;
|
import nc.tile.passive.ITilePassive;
|
||||||
import nc.tile.processor.IFluidProcessor;
|
import nc.tile.processor.IFluidProcessor;
|
||||||
import nc.util.CapabilityHelper;
|
import nc.util.GasHelper;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.*;
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
|
||||||
|
|
||||||
public class TileHeatExchangerTube extends TileHeatExchangerPart implements IFluidProcessor {
|
public class TileHeatExchangerTube extends TileHeatExchangerPart implements IFluidProcessor {
|
||||||
|
|
||||||
|
@ -430,7 +417,7 @@ public class TileHeatExchangerTube extends TileHeatExchangerPart implements IFlu
|
||||||
setTubeSetting(side, getTubeSetting(side).next());
|
setTubeSetting(side, getTubeSetting(side).next());
|
||||||
refreshFluidConnections(side);
|
refreshFluidConnections(side);
|
||||||
updateFlowDir();
|
updateFlowDir();
|
||||||
markDirtyAndNotify(true);
|
markDirtyAndNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
public void refreshFluidConnections(@Nonnull EnumFacing side) {
|
||||||
|
@ -670,7 +657,7 @@ public class TileHeatExchangerTube extends TileHeatExchangerPart implements IFlu
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
||||||
}
|
}
|
||||||
return super.hasCapability(capability, side);
|
return super.hasCapability(capability, side);
|
||||||
|
@ -684,7 +671,7 @@ public class TileHeatExchangerTube extends TileHeatExchangerPart implements IFlu
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (ModCheck.mekanismLoaded() && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
else if (ModCheck.mekanismLoaded() && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
||||||
return (T) getGasWrapper();
|
return (T) getGasWrapper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,20 @@
|
||||||
package nc.multiblock.heatExchanger.tile;
|
package nc.multiblock.heatExchanger.tile;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.*;
|
||||||
import static nc.config.NCConfig.machine_update_rate;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import nc.ModCheck;
|
import nc.ModCheck;
|
||||||
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.heatExchanger.HeatExchanger;
|
import nc.multiblock.heatExchanger.*;
|
||||||
import nc.multiblock.heatExchanger.HeatExchangerTubeSetting;
|
|
||||||
import nc.tile.fluid.ITileFluid;
|
import nc.tile.fluid.ITileFluid;
|
||||||
import nc.tile.internal.fluid.FluidConnection;
|
import nc.tile.internal.fluid.*;
|
||||||
import nc.tile.internal.fluid.FluidTileWrapper;
|
import nc.util.GasHelper;
|
||||||
import nc.tile.internal.fluid.GasTileWrapper;
|
|
||||||
import nc.tile.internal.fluid.Tank;
|
|
||||||
import nc.tile.internal.fluid.TankOutputSetting;
|
|
||||||
import nc.tile.internal.fluid.TankSorption;
|
|
||||||
import nc.util.CapabilityHelper;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -183,7 +175,7 @@ public class TileHeatExchangerVent extends TileHeatExchangerPart implements ITil
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing side) {
|
||||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || ModCheck.mekanismLoaded() && enable_mek_gas && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
return !getTanks().isEmpty() && hasFluidSideCapability(side);
|
||||||
}
|
}
|
||||||
return super.hasCapability(capability, side);
|
return super.hasCapability(capability, side);
|
||||||
|
@ -197,7 +189,7 @@ public class TileHeatExchangerVent extends TileHeatExchangerPart implements ITil
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else if (ModCheck.mekanismLoaded() && capability == CapabilityHelper.GAS_HANDLER_CAPABILITY) {
|
else if (ModCheck.mekanismLoaded() && capability == GasHelper.GAS_HANDLER_CAPABILITY) {
|
||||||
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
if (enable_mek_gas && !getTanks().isEmpty() && hasFluidSideCapability(side)) {
|
||||||
return (T) getGasWrapper();
|
return (T) getGasWrapper();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,20 +2,14 @@ package nc.multiblock.network;
|
||||||
|
|
||||||
import javax.vecmath.Vector3f;
|
import javax.vecmath.Vector3f;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import nc.multiblock.Multiblock.AssemblyState;
|
|
||||||
import nc.multiblock.turbine.Turbine;
|
import nc.multiblock.turbine.Turbine;
|
||||||
import nc.multiblock.turbine.tile.TileTurbineController;
|
import nc.multiblock.turbine.tile.TileTurbineController;
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
public class TurbineFormPacket extends MultiblockUpdatePacket {
|
public class TurbineFormPacket extends MultiblockUpdatePacket {
|
||||||
|
|
||||||
public AssemblyState assemblyState;
|
public boolean nullArray;
|
||||||
public EnumFacing flowDir;
|
|
||||||
public boolean nullData;
|
|
||||||
public BlockPos[] bladePosArray;
|
public BlockPos[] bladePosArray;
|
||||||
public Vector3f[] renderPosArray;
|
public Vector3f[] renderPosArray;
|
||||||
public float[] bladeAngleArray;
|
public float[] bladeAngleArray;
|
||||||
|
@ -24,19 +18,9 @@ public class TurbineFormPacket extends MultiblockUpdatePacket {
|
||||||
messageValid = false;
|
messageValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TurbineFormPacket(BlockPos pos, AssemblyState assemblyState, EnumFacing flowDir, BlockPos[] bladePosArray, Vector3f[] renderPosArray, float[] bladeAngleArray) {
|
public TurbineFormPacket(BlockPos pos, BlockPos[] bladePosArray, Vector3f[] renderPosArray, float[] bladeAngleArray) {
|
||||||
this.pos = pos;
|
this.pos = pos;
|
||||||
this.assemblyState = assemblyState;
|
nullArray = bladePosArray == null || renderPosArray == null || bladeAngleArray == null;
|
||||||
this.flowDir = flowDir;
|
|
||||||
|
|
||||||
nullData = flowDir == null || bladePosArray == null || renderPosArray == null || bladeAngleArray == null;
|
|
||||||
if (!nullData && ArrayUtils.contains(bladePosArray, null)) {
|
|
||||||
nullData = true;
|
|
||||||
}
|
|
||||||
if (!nullData && ArrayUtils.contains(renderPosArray, null)) {
|
|
||||||
nullData = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.bladePosArray = bladePosArray;
|
this.bladePosArray = bladePosArray;
|
||||||
this.renderPosArray = renderPosArray;
|
this.renderPosArray = renderPosArray;
|
||||||
this.bladeAngleArray = bladeAngleArray;
|
this.bladeAngleArray = bladeAngleArray;
|
||||||
|
@ -47,12 +31,8 @@ public class TurbineFormPacket extends MultiblockUpdatePacket {
|
||||||
@Override
|
@Override
|
||||||
public void readMessage(ByteBuf buf) {
|
public void readMessage(ByteBuf buf) {
|
||||||
pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
|
pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
|
||||||
byte b = buf.readByte();
|
nullArray = buf.readBoolean();
|
||||||
assemblyState = b == 0 ? AssemblyState.Assembled : (b == 1 ? AssemblyState.Disassembled : AssemblyState.Paused);
|
if (!nullArray) {
|
||||||
|
|
||||||
nullData = buf.readBoolean();
|
|
||||||
if (!nullData) {
|
|
||||||
flowDir = EnumFacing.byIndex(buf.readInt());
|
|
||||||
bladePosArray = new BlockPos[buf.readInt()];
|
bladePosArray = new BlockPos[buf.readInt()];
|
||||||
for (int i = 0; i < bladePosArray.length; i++) {
|
for (int i = 0; i < bladePosArray.length; i++) {
|
||||||
bladePosArray[i] = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
|
bladePosArray[i] = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
|
||||||
|
@ -73,11 +53,8 @@ public class TurbineFormPacket extends MultiblockUpdatePacket {
|
||||||
buf.writeInt(pos.getX());
|
buf.writeInt(pos.getX());
|
||||||
buf.writeInt(pos.getY());
|
buf.writeInt(pos.getY());
|
||||||
buf.writeInt(pos.getZ());
|
buf.writeInt(pos.getZ());
|
||||||
buf.writeByte(assemblyState == AssemblyState.Assembled ? 0 : (assemblyState == AssemblyState.Disassembled ? 1 : 2));
|
buf.writeBoolean(nullArray);
|
||||||
|
if (!nullArray) {
|
||||||
buf.writeBoolean(nullData);
|
|
||||||
if (!nullData) {
|
|
||||||
buf.writeInt(flowDir.getIndex());
|
|
||||||
buf.writeInt(bladePosArray.length);
|
buf.writeInt(bladePosArray.length);
|
||||||
for (BlockPos rotorPos : bladePosArray) {
|
for (BlockPos rotorPos : bladePosArray) {
|
||||||
buf.writeInt(rotorPos.getX());
|
buf.writeInt(rotorPos.getX());
|
||||||
|
|