Better gas management

This commit is contained in:
aidancbrady committed 2017-04-04 19:45:51 -04:00
1 parent 8ae8652aff
commit 3d86b75da4
23 files changed
+149 -115

No files matched your search

+14 -4
View File
@@ -223,22 +223,32 @@ public class Gas
* Registers a new fluid out of this Gas or gets one from the FluidRegistry.
* @return this Gas object
*/
public Gas registerFluid()
public Gas registerFluid(String name)
{
if(fluid == null)
{
if(FluidRegistry.getFluid(getName()) == null)
if(FluidRegistry.getFluid(name) == null)
{
fluid = new Fluid(getName(), getIcon(), getIcon()).setGaseous(true);
fluid = new Fluid(name, getIcon(), getIcon());
FluidRegistry.registerFluid(fluid);
}
else {
fluid = FluidRegistry.getFluid(getName());
fluid = FluidRegistry.getFluid(name);
}
}
return this;
}
/**
* Registers a new fluid out of this Gas or gets one from the FluidRegistry.
* Uses default gas name.
* @return this Gas object
*/
public Gas registerFluid()
{
return registerFluid(getName());
}
@Override
public String toString()