mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Work on Thermodynamic Conductors
This commit is contained in:
1 parent
f19a8f9e64
commit
2bea8ac29a
21 files changed
+451
-331
No files matched your search
@@ -5,6 +5,7 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.common.multipart.TransmitterType;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import codechicken.lib.colour.ColourRGBA;
|
||||
|
||||
/**
|
||||
* Tier information for Mekanism. This currently includes tiers for Energy Cubes and Smelting Factories.
|
||||
@@ -481,6 +482,77 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum ConductorTier
|
||||
{
|
||||
BASIC(5, 1, 0, new ColourRGBA(0.2, 0.2, 0.2, 1), TransmitterType.THERMODYNAMIC_CONDUCTOR_BASIC),
|
||||
ADVANCED(5, 1, 0, new ColourRGBA(0.2, 0.2, 0.2, 1), TransmitterType.THERMODYNAMIC_CONDUCTOR_ADVANCED),
|
||||
ELITE(5, 1, 0, new ColourRGBA(0.2, 0.2, 0.2, 1), TransmitterType.THERMODYNAMIC_CONDUCTOR_ELITE),
|
||||
ULTIMATE(5, 1, 0, new ColourRGBA(0.2, 0.2, 0.2, 1), TransmitterType.THERMODYNAMIC_CONDUCTOR_ULTIMATE);
|
||||
|
||||
public BaseTier getBaseTier()
|
||||
{
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
public double inverseConduction;
|
||||
private double baseConduction;
|
||||
|
||||
public double inverseHeatCapacity;
|
||||
private double baseHeatCapacity;
|
||||
|
||||
public double inverseConductionInsulation;
|
||||
private double baseConductionInsulation;
|
||||
|
||||
public ColourRGBA baseColour;
|
||||
|
||||
public TransmitterType type;
|
||||
|
||||
private ConductorTier(double inversek, double inverseC, double insulationInversek, ColourRGBA colour, TransmitterType transmitterType)
|
||||
{
|
||||
baseConduction = inverseConduction = inversek;
|
||||
baseHeatCapacity = inverseHeatCapacity = inverseC;
|
||||
baseConductionInsulation = inverseConductionInsulation = insulationInversek;
|
||||
|
||||
baseColour = colour;
|
||||
|
||||
type = transmitterType;
|
||||
}
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
inverseConduction = Mekanism.configuration.get("tier", getBaseTier().getName() + "ConductorInverseConduction", baseConduction).getDouble();
|
||||
inverseHeatCapacity = Mekanism.configuration.get("tier", getBaseTier().getName() + "ConductorHeatCapacity", baseHeatCapacity).getDouble();
|
||||
inverseConductionInsulation = Mekanism.configuration.get("tier", getBaseTier().getName() + "ConductorConductionInsulation", baseConductionInsulation).getDouble();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
inverseConduction = dataStream.readDouble();
|
||||
inverseHeatCapacity = dataStream.readDouble();
|
||||
inverseConductionInsulation = dataStream.readDouble();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeDouble(inverseConduction);
|
||||
dataStream.writeDouble(inverseHeatCapacity);
|
||||
dataStream.writeDouble(inverseConductionInsulation);
|
||||
}
|
||||
|
||||
public static ConductorTier get(BaseTier tier)
|
||||
{
|
||||
for(ConductorTier transmitter : values())
|
||||
{
|
||||
if(transmitter.getBaseTier() == tier)
|
||||
{
|
||||
return transmitter;
|
||||
}
|
||||
}
|
||||
|
||||
return BASIC;
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadConfig()
|
||||
{
|
||||
for(CableTier tier : CableTier.values())
|
||||
@@ -517,6 +589,11 @@ public final class Tier
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
|
||||
for(ConductorTier tier : ConductorTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public static void readConfig(ByteBuf dataStream)
|
||||
@@ -555,6 +632,11 @@ public final class Tier
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
|
||||
for(ConductorTier tier : ConductorTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeConfig(ByteBuf dataStream)
|
||||
@@ -593,5 +675,10 @@ public final class Tier
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
|
||||
for(ConductorTier tier : ConductorTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user