mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Configurable values for Mekanism tier-related properties
This commit is contained in:
1 parent
dc0a90921a
commit
45895cb753
13 files changed
+363
-81
No files matched your search
@@ -26,6 +26,7 @@ public class GuiMekanismConfig extends GuiConfig
|
||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.general"), "mekanism.configgui.ctgy.general", GeneralEntry.class));
|
||||
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.machines"), "mekanism.configgui.ctgy.machines", MachinesEntry.class));
|
||||
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.tier"), "mekanism.configgui.ctgy.tier", TierEntry.class));
|
||||
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.usage"), "mekanism.configgui.ctgy.usage", UsageEntry.class));
|
||||
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.client"), "mekanism.configgui.ctgy.client", ClientEntry.class));
|
||||
return list;
|
||||
@@ -64,6 +65,23 @@ public class GuiMekanismConfig extends GuiConfig
|
||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class TierEntry extends CategoryEntry
|
||||
{
|
||||
public TierEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop)
|
||||
{
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiScreen buildChildScreen()
|
||||
{
|
||||
return new GuiConfig(owningScreen,
|
||||
new ConfigElement(Mekanism.configuration.getCategory("tier")).getChildElements(),
|
||||
owningScreen.modID, Configuration.CATEGORY_GENERAL, false, false,
|
||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public static class UsageEntry extends CategoryEntry
|
||||
{
|
||||
|
||||
@@ -221,15 +221,15 @@ public class CommonProxy
|
||||
*/
|
||||
public void loadConfiguration()
|
||||
{
|
||||
general.updateNotifications = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpdateNotifications", true).getBoolean(true);
|
||||
general.controlCircuitOreDict = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ControlCircuitOreDict", true).getBoolean(true);
|
||||
general.logPackets = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "LogPackets", false).getBoolean(false);
|
||||
general.dynamicTankEasterEgg = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DynamicTankEasterEgg", false).getBoolean(false);
|
||||
general.voiceServerEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoiceServerEnabled", true).getBoolean(true);
|
||||
general.cardboardSpawners = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AllowSpawnerBoxPickup", true).getBoolean(true);
|
||||
general.enableWorldRegeneration = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnableWorldRegeneration", false).getBoolean(false);
|
||||
general.creativeOverrideElectricChest = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "CreativeOverrideElectricChest", true).getBoolean(true);
|
||||
general.spawnBabySkeletons = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SpawnBabySkeletons", true).getBoolean(true);
|
||||
general.updateNotifications = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpdateNotifications", true).getBoolean();
|
||||
general.controlCircuitOreDict = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ControlCircuitOreDict", true).getBoolean();
|
||||
general.logPackets = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "LogPackets", false).getBoolean();
|
||||
general.dynamicTankEasterEgg = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DynamicTankEasterEgg", false).getBoolean();
|
||||
general.voiceServerEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoiceServerEnabled", true).getBoolean();
|
||||
general.cardboardSpawners = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AllowSpawnerBoxPickup", true).getBoolean();
|
||||
general.enableWorldRegeneration = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnableWorldRegeneration", false).getBoolean();
|
||||
general.creativeOverrideElectricChest = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "CreativeOverrideElectricChest", true).getBoolean();
|
||||
general.spawnBabySkeletons = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SpawnBabySkeletons", true).getBoolean();
|
||||
general.obsidianTNTDelay = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTDelay", 100).getInt();
|
||||
general.obsidianTNTBlastRadius = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTBlastRadius", 12).getInt();
|
||||
general.UPDATE_DELAY = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ClientUpdateDelay", 10).getInt();
|
||||
@@ -238,19 +238,19 @@ public class CommonProxy
|
||||
general.tinPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "TinPerChunk", 14).getInt();
|
||||
general.saltPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SaltPerChunk", 2).getInt();
|
||||
general.userWorldGenVersion = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "WorldRegenVersion", 0).getInt();
|
||||
general.FROM_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToEU", 10D).getDouble(10D);
|
||||
general.TO_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EUToJoules", .1D).getDouble(.1D);
|
||||
general.FROM_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToRF", 2.5D).getDouble(2.5D);
|
||||
general.TO_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "RFToJoules", 0.4D).getDouble(0.4D);
|
||||
general.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D, "Determines Electrolytic Separator usage").getDouble(200D);
|
||||
general.ETHENE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EthyleneBurnTime", 40).getInt(40);
|
||||
general.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D).getDouble(10000D);
|
||||
general.DISASSEMBLER_USAGE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisassemblerEnergyUsage", 10).getInt(10);
|
||||
general.FROM_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToEU", 10D).getDouble();
|
||||
general.TO_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EUToJoules", .1D).getDouble();
|
||||
general.FROM_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToRF", 2.5D).getDouble();
|
||||
general.TO_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "RFToJoules", 0.4D).getDouble();
|
||||
general.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D, "Determines Electrolytic Separator usage").getDouble();
|
||||
general.ETHENE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EthyleneBurnTime", 40).getInt();
|
||||
general.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D).getDouble();
|
||||
general.DISASSEMBLER_USAGE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisassemblerEnergyUsage", 10).getInt();
|
||||
general.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123, null, 1, 65535).getInt();
|
||||
//If this is less than 1, upgrades make machines worse. If less than 0, I don't even know.
|
||||
general.maxUpgradeMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpgradeModifier", 10, null, 1, Integer.MAX_VALUE).getInt();
|
||||
general.minerSilkMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MinerSilkMultiplier", 6).getDouble();
|
||||
general.prefilledPortableTanks = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PrefilledPortableTanks", true).getBoolean(true);
|
||||
general.prefilledPortableTanks = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PrefilledPortableTanks", true).getBoolean();
|
||||
|
||||
general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean();
|
||||
general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean();
|
||||
@@ -303,42 +303,44 @@ public class CommonProxy
|
||||
}
|
||||
}
|
||||
|
||||
general.laserRange = Mekanism.configuration.get("general", "LaserRange", 64).getInt(64);
|
||||
general.laserEnergyNeededPerHardness = Mekanism.configuration.get("general", "LaserDiggingEnergy", 100000).getInt(100000);
|
||||
general.destroyDisabledBlocks = Mekanism.configuration.get("general", "DestroyDisabledBlocks", true).getBoolean(true);
|
||||
general.enableAmbientLighting = Mekanism.configuration.get("general", "EnableAmbientLighting", true).getBoolean(true);
|
||||
general.ambientLightingLevel = Mekanism.configuration.get("general", "AmbientLightingLevel", 15).getInt(15);
|
||||
general.laserRange = Mekanism.configuration.get("general", "LaserRange", 64).getInt();
|
||||
general.laserEnergyNeededPerHardness = Mekanism.configuration.get("general", "LaserDiggingEnergy", 100000).getInt();
|
||||
general.destroyDisabledBlocks = Mekanism.configuration.get("general", "DestroyDisabledBlocks", true).getBoolean();
|
||||
general.enableAmbientLighting = Mekanism.configuration.get("general", "EnableAmbientLighting", true).getBoolean();
|
||||
general.ambientLightingLevel = Mekanism.configuration.get("general", "AmbientLightingLevel", 15).getInt();
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
{
|
||||
machines.setEntry(type.name, Mekanism.configuration.get("machines", type.name + "Enabled", true).getBoolean(true));
|
||||
machines.setEntry(type.name, Mekanism.configuration.get("machines", type.name + "Enabled", true).getBoolean());
|
||||
}
|
||||
|
||||
usage.enrichmentChamberUsage = Mekanism.configuration.get("usage", "EnrichmentChamberUsage", 50D).getDouble(50D);
|
||||
usage.osmiumCompressorUsage = Mekanism.configuration.get("usage", "OsmiumCompressorUsage", 100D).getDouble(100D);
|
||||
usage.combinerUsage = Mekanism.configuration.get("usage", "CombinerUsage", 50D).getDouble(50D);
|
||||
usage.crusherUsage = Mekanism.configuration.get("usage", "CrusherUsage", 50D).getDouble(50D);
|
||||
usage.factoryUsage = Mekanism.configuration.get("usage", "FactoryUsage", 50D).getDouble(50D);
|
||||
usage.metallurgicInfuserUsage = Mekanism.configuration.get("usage", "MetallurgicInfuserUsage", 50D).getDouble(50D);
|
||||
usage.purificationChamberUsage = Mekanism.configuration.get("usage", "PurificationChamberUsage", 200D).getDouble(200D);
|
||||
usage.energizedSmelterUsage = Mekanism.configuration.get("usage", "EnergizedSmelterUsage", 50D).getDouble(50D);
|
||||
usage.digitalMinerUsage = Mekanism.configuration.get("usage", "DigitalMinerUsage", 100D).getDouble(100D);
|
||||
usage.electricPumpUsage = Mekanism.configuration.get("usage", "ElectricPumpUsage", 100D).getDouble(100D);
|
||||
usage.rotaryCondensentratorUsage = Mekanism.configuration.get("usage", "RotaryCondensentratorUsage", 50D).getDouble(50D);
|
||||
usage.oxidationChamberUsage = Mekanism.configuration.get("usage", "OxidationChamberUsage", 200D).getDouble(200D);
|
||||
usage.chemicalInfuserUsage = Mekanism.configuration.get("usage", "ChemicalInfuserUsage", 200D).getDouble(200D);
|
||||
usage.chemicalInjectionChamberUsage = Mekanism.configuration.get("usage", "ChemicalInjectionChamberUsage", 400D).getDouble(400D);
|
||||
usage.precisionSawmillUsage = Mekanism.configuration.get("usage", "PrecisionSawmillUsage", 50D).getDouble(50D);
|
||||
usage.chemicalDissolutionChamberUsage = Mekanism.configuration.get("usage", "ChemicalDissolutionChamberUsage", 400D).getDouble(400D);
|
||||
usage.chemicalWasherUsage = Mekanism.configuration.get("usage", "ChemicalWasherUsage", 200D).getDouble(200D);
|
||||
usage.chemicalCrystallizerUsage = Mekanism.configuration.get("usage", "ChemicalCrystallizerUsage", 400D).getDouble(400D);
|
||||
usage.seismicVibratorUsage = Mekanism.configuration.get("usage", "SeismicVibratorUsage", 50D).getDouble(50D);
|
||||
usage.pressurizedReactionBaseUsage = Mekanism.configuration.get("usage", "PressurizedReactionBaseUsage", 5D).getDouble(5D);
|
||||
usage.fluidicPlenisherUsage = Mekanism.configuration.get("usage", "FluidicPlenisherUsage", 100D).getDouble(100D);
|
||||
usage.laserUsage = Mekanism.configuration.get("usage", "LaserUsage", 5000D).getDouble(5000D);
|
||||
usage.gasCentrifugeUsage = Mekanism.configuration.get("usage", "GasCentrifugeUsage", 100D).getDouble(100D);
|
||||
usage.heavyWaterElectrolysisUsage = Mekanism.configuration.get("usage", "HeavyWaterElectrolysisUsage", 800D).getDouble(800D);
|
||||
usage.enrichmentChamberUsage = Mekanism.configuration.get("usage", "EnrichmentChamberUsage", 50D).getDouble();
|
||||
usage.osmiumCompressorUsage = Mekanism.configuration.get("usage", "OsmiumCompressorUsage", 100D).getDouble();
|
||||
usage.combinerUsage = Mekanism.configuration.get("usage", "CombinerUsage", 50D).getDouble();
|
||||
usage.crusherUsage = Mekanism.configuration.get("usage", "CrusherUsage", 50D).getDouble();
|
||||
usage.factoryUsage = Mekanism.configuration.get("usage", "FactoryUsage", 50D).getDouble();
|
||||
usage.metallurgicInfuserUsage = Mekanism.configuration.get("usage", "MetallurgicInfuserUsage", 50D).getDouble();
|
||||
usage.purificationChamberUsage = Mekanism.configuration.get("usage", "PurificationChamberUsage", 200D).getDouble();
|
||||
usage.energizedSmelterUsage = Mekanism.configuration.get("usage", "EnergizedSmelterUsage", 50D).getDouble();
|
||||
usage.digitalMinerUsage = Mekanism.configuration.get("usage", "DigitalMinerUsage", 100D).getDouble();
|
||||
usage.electricPumpUsage = Mekanism.configuration.get("usage", "ElectricPumpUsage", 100D).getDouble();
|
||||
usage.rotaryCondensentratorUsage = Mekanism.configuration.get("usage", "RotaryCondensentratorUsage", 50D).getDouble();
|
||||
usage.oxidationChamberUsage = Mekanism.configuration.get("usage", "OxidationChamberUsage", 200D).getDouble();
|
||||
usage.chemicalInfuserUsage = Mekanism.configuration.get("usage", "ChemicalInfuserUsage", 200D).getDouble();
|
||||
usage.chemicalInjectionChamberUsage = Mekanism.configuration.get("usage", "ChemicalInjectionChamberUsage", 400D).getDouble();
|
||||
usage.precisionSawmillUsage = Mekanism.configuration.get("usage", "PrecisionSawmillUsage", 50D).getDouble();
|
||||
usage.chemicalDissolutionChamberUsage = Mekanism.configuration.get("usage", "ChemicalDissolutionChamberUsage", 400D).getDouble();
|
||||
usage.chemicalWasherUsage = Mekanism.configuration.get("usage", "ChemicalWasherUsage", 200D).getDouble();
|
||||
usage.chemicalCrystallizerUsage = Mekanism.configuration.get("usage", "ChemicalCrystallizerUsage", 400D).getDouble();
|
||||
usage.seismicVibratorUsage = Mekanism.configuration.get("usage", "SeismicVibratorUsage", 50D).getDouble();
|
||||
usage.pressurizedReactionBaseUsage = Mekanism.configuration.get("usage", "PressurizedReactionBaseUsage", 5D).getDouble();
|
||||
usage.fluidicPlenisherUsage = Mekanism.configuration.get("usage", "FluidicPlenisherUsage", 100D).getDouble();
|
||||
usage.laserUsage = Mekanism.configuration.get("usage", "LaserUsage", 5000D).getDouble();
|
||||
usage.gasCentrifugeUsage = Mekanism.configuration.get("usage", "GasCentrifugeUsage", 100D).getDouble();
|
||||
usage.heavyWaterElectrolysisUsage = Mekanism.configuration.get("usage", "HeavyWaterElectrolysisUsage", 800D).getDouble();
|
||||
|
||||
Tier.loadConfig();
|
||||
|
||||
if(Mekanism.configuration.hasChanged())
|
||||
{
|
||||
Mekanism.configuration.save();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.common;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.multipart.TransmitterType;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -66,8 +67,11 @@ public final class Tier
|
||||
ULTIMATE(128000000, 51200),
|
||||
CREATIVE(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
|
||||
public double MAX_ELECTRICITY;
|
||||
public double OUTPUT;
|
||||
public double maxEnergy;
|
||||
private double baseMaxEnergy;
|
||||
|
||||
public double output;
|
||||
private double baseOutput;
|
||||
|
||||
public static EnergyCubeTier getFromName(String tierName)
|
||||
{
|
||||
@@ -83,15 +87,33 @@ public final class Tier
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
maxEnergy = Mekanism.configuration.get("tier", getBaseTier().getName() + "EnergyCubeMaxEnergy", baseMaxEnergy).getDouble();
|
||||
output = Mekanism.configuration.get("tier", getBaseTier().getName() + "EnergyCubeOutput", baseOutput).getDouble();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
maxEnergy = dataStream.readDouble();
|
||||
output = dataStream.readDouble();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeDouble(maxEnergy);
|
||||
dataStream.writeDouble(output);
|
||||
}
|
||||
|
||||
public BaseTier getBaseTier()
|
||||
{
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
private EnergyCubeTier(double maxEnergy, double out)
|
||||
private EnergyCubeTier(double max, double out)
|
||||
{
|
||||
MAX_ELECTRICITY = maxEnergy;
|
||||
OUTPUT = out;
|
||||
baseMaxEnergy = maxEnergy = max;
|
||||
baseOutput = output = out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,16 +124,32 @@ public final class Tier
|
||||
ELITE(64E9D),
|
||||
ULTIMATE(512E9D);
|
||||
|
||||
public double MAX_ELECTRICITY;
|
||||
public double maxEnergy;
|
||||
private double baseMaxEnergy;
|
||||
|
||||
public BaseTier getBaseTier()
|
||||
{
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
private InductionCellTier(double maxEnergy)
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
MAX_ELECTRICITY = maxEnergy;
|
||||
maxEnergy = Mekanism.configuration.get("tier", getBaseTier().getName() + "InductionCellMaxEnergy", baseMaxEnergy).getDouble();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
maxEnergy = dataStream.readDouble();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeDouble(maxEnergy);
|
||||
}
|
||||
|
||||
private InductionCellTier(double max)
|
||||
{
|
||||
baseMaxEnergy = maxEnergy = max;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,16 +160,32 @@ public final class Tier
|
||||
ELITE(4096000),
|
||||
ULTIMATE(32768000);
|
||||
|
||||
public double OUTPUT;
|
||||
public double output;
|
||||
private double baseOutput;
|
||||
|
||||
public BaseTier getBaseTier()
|
||||
{
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
output = Mekanism.configuration.get("tier", getBaseTier().getName() + "InductionProviderOutput", baseOutput).getDouble();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
output = dataStream.readDouble();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeDouble(output);
|
||||
}
|
||||
|
||||
private InductionProviderTier(double out)
|
||||
{
|
||||
OUTPUT = out;
|
||||
baseOutput = output = out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,14 +247,32 @@ public final class Tier
|
||||
}
|
||||
|
||||
public int cableCapacity;
|
||||
private int baseCapacity;
|
||||
|
||||
public TransmitterType type;
|
||||
|
||||
private CableTier(int capacity, TransmitterType transmitterType)
|
||||
{
|
||||
cableCapacity = capacity;
|
||||
baseCapacity = cableCapacity = capacity;
|
||||
|
||||
type = transmitterType;
|
||||
}
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
cableCapacity = Mekanism.configuration.get("tier", getBaseTier().getName() + "CableCapacity", baseCapacity).getInt();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
cableCapacity = dataStream.readInt();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(cableCapacity);
|
||||
}
|
||||
|
||||
public static CableTier get(BaseTier tier)
|
||||
{
|
||||
for(CableTier transmitter : values())
|
||||
@@ -233,16 +305,39 @@ public final class Tier
|
||||
}
|
||||
|
||||
public int pipeCapacity;
|
||||
private int baseCapacity;
|
||||
|
||||
public int pipePullAmount;
|
||||
private int basePull;
|
||||
|
||||
public TransmitterType type;
|
||||
|
||||
private PipeTier(int capacity, int pullAmount, TransmitterType transmitterType)
|
||||
{
|
||||
pipeCapacity = capacity;
|
||||
pipePullAmount = pullAmount;
|
||||
baseCapacity = pipeCapacity = capacity;
|
||||
basePull = pipePullAmount = pullAmount;
|
||||
|
||||
type = transmitterType;
|
||||
}
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
pipeCapacity = Mekanism.configuration.get("tier", getBaseTier().getName() + "PipeCapacity", baseCapacity).getInt();
|
||||
pipePullAmount = Mekanism.configuration.get("tier", getBaseTier().getName() + "PipePullAmount", basePull).getInt();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
pipeCapacity = dataStream.readInt();
|
||||
pipePullAmount = dataStream.readInt();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(pipeCapacity);
|
||||
dataStream.writeInt(pipePullAmount);
|
||||
}
|
||||
|
||||
public static PipeTier get(BaseTier tier)
|
||||
{
|
||||
for(PipeTier transmitter : values())
|
||||
@@ -275,16 +370,39 @@ public final class Tier
|
||||
}
|
||||
|
||||
public int tubeCapacity;
|
||||
private int baseCapacity;
|
||||
|
||||
public int tubePullAmount;
|
||||
private int basePull;
|
||||
|
||||
public TransmitterType type;
|
||||
|
||||
private TubeTier(int capacity, int pullAmount, TransmitterType transmitterType)
|
||||
{
|
||||
tubeCapacity = capacity;
|
||||
tubePullAmount = pullAmount;
|
||||
baseCapacity = tubeCapacity = capacity;
|
||||
basePull = tubePullAmount = pullAmount;
|
||||
|
||||
type = transmitterType;
|
||||
}
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
tubeCapacity = Mekanism.configuration.get("tier", getBaseTier().getName() + "TubeCapacity", baseCapacity).getInt();
|
||||
tubePullAmount = Mekanism.configuration.get("tier", getBaseTier().getName() + "TubePullAmount", basePull).getInt();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
tubeCapacity = dataStream.readInt();
|
||||
tubePullAmount = dataStream.readInt();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(tubeCapacity);
|
||||
dataStream.writeInt(tubePullAmount);
|
||||
}
|
||||
|
||||
public static TubeTier get(BaseTier tier)
|
||||
{
|
||||
for(TubeTier transmitter : values())
|
||||
@@ -317,16 +435,39 @@ public final class Tier
|
||||
}
|
||||
|
||||
public int pullAmount;
|
||||
private int basePull;
|
||||
|
||||
public int speed;
|
||||
private int baseSpeed;
|
||||
|
||||
public TransmitterType type;
|
||||
|
||||
private TransporterTier(int pull, int s, TransmitterType transmitterType)
|
||||
{
|
||||
pullAmount = pull;
|
||||
speed = s;
|
||||
basePull = pullAmount = pull;
|
||||
baseSpeed = speed = s;
|
||||
|
||||
type = transmitterType;
|
||||
}
|
||||
|
||||
protected void loadConfig()
|
||||
{
|
||||
pullAmount = Mekanism.configuration.get("tier", getBaseTier().getName() + "TransporterPullAmount", basePull).getInt();
|
||||
speed = Mekanism.configuration.get("tier", getBaseTier().getName() + "TransporterSpeed", baseSpeed).getInt();
|
||||
}
|
||||
|
||||
protected void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
pullAmount = dataStream.readInt();
|
||||
speed = dataStream.readInt();
|
||||
}
|
||||
|
||||
protected void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(pullAmount);
|
||||
dataStream.writeInt(speed);
|
||||
}
|
||||
|
||||
public static TransporterTier get(BaseTier tier)
|
||||
{
|
||||
for(TransporterTier transmitter : values())
|
||||
@@ -340,4 +481,118 @@ public final class Tier
|
||||
return BASIC;
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadConfig()
|
||||
{
|
||||
for(CableTier tier : CableTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
|
||||
for(InductionCellTier tier : InductionCellTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
|
||||
for(InductionProviderTier tier : InductionProviderTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
|
||||
for(EnergyCubeTier tier : EnergyCubeTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
|
||||
for(PipeTier tier : PipeTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
|
||||
for(TubeTier tier : TubeTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
|
||||
for(TransporterTier tier : TransporterTier.values())
|
||||
{
|
||||
tier.loadConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public static void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
for(CableTier tier : CableTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
|
||||
for(InductionCellTier tier : InductionCellTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
|
||||
for(InductionProviderTier tier : InductionProviderTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
|
||||
for(EnergyCubeTier tier : EnergyCubeTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
|
||||
for(PipeTier tier : PipeTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
|
||||
for(TubeTier tier : TubeTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
|
||||
for(TransporterTier tier : TransporterTier.values())
|
||||
{
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
for(CableTier tier : CableTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
|
||||
for(InductionCellTier tier : InductionCellTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
|
||||
for(InductionProviderTier tier : InductionProviderTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
|
||||
for(EnergyCubeTier tier : EnergyCubeTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
|
||||
for(PipeTier tier : PipeTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
|
||||
for(TubeTier tier : TubeTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
|
||||
for(TransporterTier tier : TransporterTier.values())
|
||||
{
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public interface ILogisticalTransporter extends IBlockableConnection, IGridTrans
|
||||
|
||||
public ItemStack insertRR(TileEntityLogisticalSorter outputter, ItemStack itemStack, EnumColor color, boolean doEmit, int min);
|
||||
|
||||
public void entityEntering(TransporterStack stack);
|
||||
public void entityEntering(TransporterStack stack, int progress);
|
||||
|
||||
public EnumColor getColor();
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ public class BlockEnergyCube extends BlockContainer implements IPeripheralProvid
|
||||
list.add(discharged);
|
||||
ItemStack charged = new ItemStack(this);
|
||||
((ItemBlockEnergyCube)charged.getItem()).setEnergyCubeTier(charged, tier);
|
||||
((ItemBlockEnergyCube)charged.getItem()).setEnergy(charged, tier.MAX_ELECTRICITY);
|
||||
((ItemBlockEnergyCube)charged.getItem()).setEnergy(charged, tier.maxEnergy);
|
||||
list.add(charged);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,12 +82,12 @@ public class MatrixUpdateProtocol extends UpdateProtocol<SynchronizedMatrixData>
|
||||
if(tile instanceof TileEntityInductionCell)
|
||||
{
|
||||
structureFound.cells.add(coord);
|
||||
structureFound.storageCap += ((TileEntityInductionCell)tile).tier.MAX_ELECTRICITY;
|
||||
structureFound.storageCap += ((TileEntityInductionCell)tile).tier.maxEnergy;
|
||||
}
|
||||
else if(tile instanceof TileEntityInductionProvider)
|
||||
{
|
||||
structureFound.providers.add(coord);
|
||||
structureFound.outputCap += ((TileEntityInductionProvider)tile).tier.OUTPUT;
|
||||
structureFound.outputCap += ((TileEntityInductionProvider)tile).tier.output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,13 +137,13 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
|
||||
{
|
||||
InductionCellTier tier = InductionCellTier.values()[getTier(itemstack).ordinal()];
|
||||
|
||||
list.add(tier.getBaseTier().getColor() + MekanismUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.MAX_ELECTRICITY));
|
||||
list.add(tier.getBaseTier().getColor() + MekanismUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.maxEnergy));
|
||||
}
|
||||
else if(itemstack.getItemDamage() == 4)
|
||||
{
|
||||
InductionProviderTier tier = InductionProviderTier.values()[getTier(itemstack).ordinal()];
|
||||
|
||||
list.add(tier.getBaseTier().getColor() + MekanismUtils.localize("tooltip.outputRate") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.OUTPUT));
|
||||
list.add(tier.getBaseTier().getColor() + MekanismUtils.localize("tooltip.outputRate") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.output));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem
|
||||
{
|
||||
if(Block.getBlockFromItem(this) == MekanismBlocks.BasicBlock2 && itemStack.getItemDamage() == 3)
|
||||
{
|
||||
return InductionCellTier.values()[getTier(itemStack).ordinal()].MAX_ELECTRICITY;
|
||||
return InductionCellTier.values()[getTier(itemStack).ordinal()].maxEnergy;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -231,7 +231,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
|
||||
@Override
|
||||
public double getMaxEnergy(ItemStack itemStack)
|
||||
{
|
||||
return getEnergyCubeTier(itemStack).MAX_ELECTRICITY;
|
||||
return getEnergyCubeTier(itemStack).maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -206,7 +206,7 @@ public class PartLogisticalTransporter extends PartTransmitter<InventoryNetwork>
|
||||
if(next != null && stack.canInsertToTransporter(stack.getNext(this).getTileEntity(world()), ForgeDirection.getOrientation(stack.getSide(this))))
|
||||
{
|
||||
ILogisticalTransporter nextTile = (ILogisticalTransporter)next.getTileEntity(world());
|
||||
nextTile.entityEntering(stack);
|
||||
nextTile.entityEntering(stack, stack.progress%100);
|
||||
remove.add(stack);
|
||||
|
||||
continue;
|
||||
@@ -484,9 +484,9 @@ public class PartLogisticalTransporter extends PartTransmitter<InventoryNetwork>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityEntering(TransporterStack stack)
|
||||
public void entityEntering(TransporterStack stack, int progress)
|
||||
{
|
||||
stack.progress = 0;
|
||||
stack.progress = progress;
|
||||
transit.add(stack);
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tile()), getSyncPacket(stack, false)), new Range4D(Coord4D.get(tile())));
|
||||
MekanismUtils.saveChunk(tile());
|
||||
|
||||
@@ -6,6 +6,7 @@ import mekanism.api.MekanismConfig.machines;
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.api.util.UnitDisplayUtils.EnergyType;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.base.IModule;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.network.PacketConfigSync.ConfigSyncMessage;
|
||||
@@ -81,6 +82,8 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
dataStream.writeDouble(usage.fluidicPlenisherUsage);
|
||||
dataStream.writeDouble(usage.gasCentrifugeUsage);
|
||||
dataStream.writeDouble(usage.heavyWaterElectrolysisUsage);
|
||||
|
||||
Tier.writeConfig(dataStream);
|
||||
|
||||
try {
|
||||
for(IModule module : Mekanism.modulesLoaded)
|
||||
@@ -148,6 +151,8 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
usage.fluidicPlenisherUsage = dataStream.readDouble();
|
||||
usage.gasCentrifugeUsage = dataStream.readDouble();
|
||||
usage.heavyWaterElectrolysisUsage = dataStream.readDouble();
|
||||
|
||||
Tier.readConfig(dataStream);
|
||||
|
||||
try {
|
||||
for(IModule module : Mekanism.modulesLoaded)
|
||||
|
||||
@@ -88,7 +88,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPe
|
||||
@Override
|
||||
public double getMaxOutput()
|
||||
{
|
||||
return tier.OUTPUT;
|
||||
return tier.output;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +131,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPe
|
||||
@Override
|
||||
public double getMaxEnergy()
|
||||
{
|
||||
return tier.MAX_ELECTRICITY;
|
||||
return tier.maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -178,7 +178,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPe
|
||||
case 0:
|
||||
return new Object[] {getEnergy()};
|
||||
case 1:
|
||||
return new Object[] {tier.OUTPUT};
|
||||
return new Object[] {tier.output};
|
||||
case 2:
|
||||
return new Object[] {getMaxEnergy()};
|
||||
case 3:
|
||||
|
||||
@@ -86,6 +86,6 @@ public class TileEntityInductionCell extends TileEntityBasicBlock implements ISt
|
||||
@Override
|
||||
public double getMaxEnergy()
|
||||
{
|
||||
return tier.MAX_ELECTRICITY;
|
||||
return tier.maxEnergy;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user