mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Port config rewrite (#5378)
Port Config system, Remove some unused code, Refactored various Tier enums out into their own package
This commit is contained in:
1 parent
a776879eed
commit
9d98ef575d
209 files changed
+3275
-2763
No files matched your search
@@ -3,7 +3,7 @@ package mekanism.client;
|
||||
import java.net.InetSocketAddress;
|
||||
import mekanism.client.voice.VoiceClient;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -14,12 +14,13 @@ public class ClientConnectionHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConnection(ClientConnectedToServerEvent event) {
|
||||
if (general.voiceServerEnabled) {
|
||||
if (MekanismConfig.current().general.voiceServerEnabled.val()) {
|
||||
if (event.isLocal()) {
|
||||
// If the client is connecting to its own corresponding integrated server.
|
||||
try {
|
||||
MekanismClient.voiceClient = new VoiceClient("127.0.0.1");
|
||||
// Will probably not work when multiple integrateds are running on one computer
|
||||
MekanismClient.voiceClient.start();//start here as config sync is not sent
|
||||
} catch (Throwable e) {
|
||||
Mekanism.logger.error("Unable to establish VoiceClient on local connection.", e);
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ import mekanism.common.CommonProxy;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Tier.GasTankTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.tier.GasTankTier;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
@@ -130,8 +130,7 @@ import mekanism.common.block.states.BlockStateOre.EnumOreType;
|
||||
import mekanism.common.block.states.BlockStatePlastic.PlasticBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStateTransmitter.TransmitterStateMapper;
|
||||
import mekanism.common.block.states.BlockStateTransmitter.TransmitterType;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.entity.EntityBabySkeleton;
|
||||
import mekanism.common.entity.EntityBalloon;
|
||||
import mekanism.common.entity.EntityFlame;
|
||||
@@ -236,7 +235,6 @@ import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.obj.OBJLoader;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
@@ -268,38 +266,7 @@ public class ClientProxy extends CommonProxy {
|
||||
public void loadConfiguration() {
|
||||
super.loadConfiguration();
|
||||
|
||||
client.enablePlayerSounds = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "EnablePlayerSounds", true,
|
||||
"Play sounds for Jetpack/Gas Mask/Flamethrower (all players).").getBoolean();
|
||||
client.enableMachineSounds = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "EnableMachineSounds", true,
|
||||
"If enabled machines play their sounds while running.").getBoolean();
|
||||
client.holidays = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "Holidays", true, "Christmas/New Years greetings in chat.")
|
||||
.getBoolean();
|
||||
client.baseSoundVolume = (float) Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "SoundVolume", 1D,
|
||||
"Adjust Mekanism sounds' base volume. < 1 is softer, higher is louder.").getDouble();
|
||||
client.machineEffects = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "MachineEffects", true, "Show particles when machines active.")
|
||||
.getBoolean();
|
||||
client.enableAmbientLighting = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "EnableAmbientLighting", true,
|
||||
"Should active machines produce block light.").getBoolean();
|
||||
client.ambientLightingLevel = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "AmbientLightingLevel", 15,
|
||||
"How much light to produce if ambient lighting is enabled.", 1, 15).getInt();
|
||||
client.opaqueTransmitters = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "OpaqueTransmitterRender", false,
|
||||
"If true, don't render Cables/Pipes/Tubes as transparent and don't render their contents.")
|
||||
.getBoolean();
|
||||
client.allowConfiguratorModeScroll = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "ConfiguratorModeScroll", true,
|
||||
"Allow sneak+scroll to change Configurator modes.").getBoolean();
|
||||
client.enableMultiblockFormationParticles = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_CLIENT, "MultiblockFormParticles", true,
|
||||
"Set to false to prevent particle spam when loading multiblocks (notification message will still display).")
|
||||
.getBoolean();
|
||||
MekanismConfig.current().client.load(Mekanism.configuration);
|
||||
|
||||
if (Mekanism.configuration.hasChanged()) {
|
||||
Mekanism.configuration.save();
|
||||
@@ -1003,7 +970,7 @@ public class ClientProxy extends CommonProxy {
|
||||
EntityPlayerSP player = Minecraft.getMinecraft().player;
|
||||
// If player is within 16 blocks (256 = 16^2), show the status message/sparkles
|
||||
if (tileEntity.getPos().distanceSq(player.getPosition()) <= 256) {
|
||||
if (client.enableMultiblockFormationParticles) {
|
||||
if (MekanismConfig.current().client.enableMultiblockFormationParticles.val()) {
|
||||
anim.run();
|
||||
} else {
|
||||
player.sendStatusMessage(
|
||||
@@ -1094,7 +1061,7 @@ public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void onConfigSync(boolean fromPacket) {
|
||||
super.onConfigSync(fromPacket);
|
||||
if (fromPacket && general.voiceServerEnabled && MekanismClient.voiceClient != null) {
|
||||
if (fromPacket && MekanismConfig.current().general.voiceServerEnabled.val() && MekanismClient.voiceClient != null) {
|
||||
MekanismClient.voiceClient.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@ import mekanism.client.render.RenderTickHandler;
|
||||
import mekanism.common.CommonPlayerTickHandler;
|
||||
import mekanism.common.KeySync;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.frequency.Frequency;
|
||||
import mekanism.common.item.ItemConfigurator;
|
||||
import mekanism.common.item.ItemConfigurator.ConfiguratorMode;
|
||||
@@ -159,12 +158,12 @@ public class ClientTickHandler {
|
||||
}
|
||||
|
||||
public static void portableTeleport(EntityPlayer player, EnumHand hand, Frequency freq) {
|
||||
if (general.portableTeleporterDelay == 0) {
|
||||
if (MekanismConfig.current().general.portableTeleporterDelay.val() == 0) {
|
||||
Mekanism.packetHandler
|
||||
.sendToServer(new PortableTeleporterMessage(PortableTeleporterPacketType.TELEPORT, hand, freq));
|
||||
} else {
|
||||
portableTeleports
|
||||
.put(player, new TeleportData(hand, freq, mc.world.getWorldTime() + general.portableTeleporterDelay));
|
||||
portableTeleports.put(player, new TeleportData(hand, freq,
|
||||
mc.world.getWorldTime() + MekanismConfig.current().general.portableTeleporterDelay.val()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +325,8 @@ public class ClientTickHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onMouseEvent(MouseEvent event) {
|
||||
if (client.allowConfiguratorModeScroll && mc.player != null && mc.player.isSneaking()) {
|
||||
if (MekanismConfig.current().client.allowConfiguratorModeScroll.val() && mc.player != null && mc.player
|
||||
.isSneaking()) {
|
||||
ItemStack stack = mc.player.getHeldItemMainhand();
|
||||
int delta = event.getDwheel();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -20,7 +20,7 @@ public final class HolidayManager {
|
||||
private static List<Holiday> holidaysNotified = new ArrayList<>();
|
||||
|
||||
public static void init() {
|
||||
if (client.holidays) {
|
||||
if (MekanismConfig.current().client.holidays.val()) {
|
||||
holidays.add(new Christmas());
|
||||
holidays.add(new NewYear());
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public final class HolidayManager {
|
||||
}
|
||||
|
||||
public static ResourceLocation filterSound(ResourceLocation sound) {
|
||||
if (!client.holidays) {
|
||||
if (!MekanismConfig.current().client.holidays.val()) {
|
||||
return sound;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import mekanism.client.render.obj.TransmitterModel;
|
||||
import mekanism.client.voice.VoiceClient;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IModule;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.boiler.SynchronizedBoilerData;
|
||||
import mekanism.common.network.PacketKey.KeyMessage;
|
||||
import mekanism.common.security.SecurityData;
|
||||
@@ -38,7 +38,7 @@ public class MekanismClient extends Mekanism {
|
||||
clientSecurityMap.clear();
|
||||
clientUUIDMap.clear();
|
||||
|
||||
if (general.voiceServerEnabled) {
|
||||
if (MekanismConfig.current().general.voiceServerEnabled.val()) {
|
||||
if (MekanismClient.voiceClient != null) {
|
||||
MekanismClient.voiceClient.disconnect();
|
||||
MekanismClient.voiceClient = null;
|
||||
@@ -60,12 +60,11 @@ public class MekanismClient extends Mekanism {
|
||||
|
||||
SynchronizedBoilerData.clientHotMap.clear();
|
||||
|
||||
MekanismConfig.setSyncedConfig(null);
|
||||
Mekanism.proxy.onConfigSync(false);
|
||||
|
||||
for (IModule module : Mekanism.modulesLoaded) {
|
||||
module.resetClient();
|
||||
}
|
||||
|
||||
Mekanism.proxy.loadConfiguration();
|
||||
|
||||
Mekanism.logger.info("Reloaded config.");
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,8 @@ package mekanism.client;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismSounds;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
@@ -38,7 +37,7 @@ public class SparkleAnimation {
|
||||
|
||||
|
||||
public void run() {
|
||||
if (general.dynamicTankEasterEgg) {
|
||||
if (MekanismConfig.current().general.dynamicTankEasterEgg.val()) {
|
||||
tile.getWorld()
|
||||
.playSound(null, tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ(),
|
||||
MekanismSounds.CJ_EASTER_EGG, SoundCategory.BLOCKS, 1F, 1F);
|
||||
|
||||
@@ -5,7 +5,7 @@ import mekanism.client.gui.element.GuiBoilerTab;
|
||||
import mekanism.client.gui.element.GuiBoilerTab.BoilerTab;
|
||||
import mekanism.client.gui.element.GuiGraph;
|
||||
import mekanism.client.gui.element.GuiHeatInfo;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.boiler.SynchronizedBoilerData;
|
||||
import mekanism.common.inventory.container.ContainerNull;
|
||||
import mekanism.common.tile.TileEntityBoilerCasing;
|
||||
@@ -31,7 +31,7 @@ public class GuiBoilerStats extends GuiMekanismTile<TileEntityBoilerCasing> {
|
||||
ResourceLocation resource = getGuiLocation();
|
||||
addGuiElement(new GuiBoilerTab(this, tileEntity, BoilerTab.MAIN, 6, resource));
|
||||
addGuiElement(new GuiHeatInfo(() -> {
|
||||
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
|
||||
TemperatureUnit unit = TemperatureUnit.values()[MekanismConfig.current().general.tempUnit.val().ordinal()];
|
||||
String environment = UnitDisplayUtils
|
||||
.getDisplayShort(tileEntity.structure.lastEnvironmentLoss * unit.intervalSize, false, unit);
|
||||
return Collections.singletonList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
|
||||
@@ -40,8 +40,9 @@ public class GuiBoilerStats extends GuiMekanismTile<TileEntityBoilerCasing> {
|
||||
data -> LangUtils.localize("gui.boilRate") + ": " + data + " mB/t"));
|
||||
addGuiElement(maxGraph = new GuiGraph(this, resource, 8, 122, 160, 36,
|
||||
data -> LangUtils.localize("gui.maxBoil") + ": " + data + " mB/t"));
|
||||
maxGraph.enableFixedScale((int) ((tileEntity.structure.superheatingElements * general.superheatingHeatTransfer)
|
||||
/ SynchronizedBoilerData.getHeatEnthalpy()));
|
||||
maxGraph.enableFixedScale((int) (
|
||||
(tileEntity.structure.superheatingElements * MekanismConfig.current().general.superheatingHeatTransfer
|
||||
.val()) / SynchronizedBoilerData.getHeatEnthalpy()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,8 +59,9 @@ public class GuiBoilerStats extends GuiMekanismTile<TileEntityBoilerCasing> {
|
||||
fontRenderer
|
||||
.drawString(LangUtils.localize("gui.superheaters") + ": " + tileEntity.structure.superheatingElements, 14,
|
||||
58, 0x404040);
|
||||
int boilCapacity = (int) ((tileEntity.structure.superheatingElements * general.superheatingHeatTransfer)
|
||||
/ SynchronizedBoilerData.getHeatEnthalpy());
|
||||
int boilCapacity = (int) ((tileEntity.structure.superheatingElements *
|
||||
MekanismConfig.current().general.superheatingHeatTransfer.val()) / SynchronizedBoilerData
|
||||
.getHeatEnthalpy());
|
||||
fontRenderer
|
||||
.drawString(LangUtils.localize("gui.boilCapacity") + ": " + boilCapacity + " mB/t", 8, 72, 0x404040);
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
@@ -13,7 +13,7 @@ import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.OreDictCache;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.miner.MItemStackFilter;
|
||||
import mekanism.common.content.miner.MMaterialFilter;
|
||||
import mekanism.common.content.miner.MModIDFilter;
|
||||
@@ -340,7 +340,8 @@ public class GuiDigitalMinerConfig extends GuiMekanismTile<TileEntityDigitalMine
|
||||
String prevMax = maxField != null ? maxField.getText() : "";
|
||||
|
||||
radiusField = new GuiTextField(1, fontRenderer, guiWidth + 12, guiHeight + 67, 26, 11);
|
||||
radiusField.setMaxStringLength(Integer.toString(general.digitalMinerMaxRadius).length());
|
||||
radiusField.setMaxStringLength(
|
||||
Integer.toString(MekanismConfig.current().general.digitalMinerMaxRadius.val()).length());
|
||||
radiusField.setText(prevRad);
|
||||
|
||||
minField = new GuiTextField(2, fontRenderer, guiWidth + 12, guiHeight + 92, 26, 11);
|
||||
@@ -573,7 +574,8 @@ public class GuiDigitalMinerConfig extends GuiMekanismTile<TileEntityDigitalMine
|
||||
|
||||
private void setRadius() {
|
||||
if (!radiusField.getText().isEmpty()) {
|
||||
int toUse = Math.max(0, Math.min(Integer.parseInt(radiusField.getText()), general.digitalMinerMaxRadius));
|
||||
int toUse = Math.max(0, Math.min(Integer.parseInt(radiusField.getText()),
|
||||
MekanismConfig.current().general.digitalMinerMaxRadius.val()));
|
||||
|
||||
TileNetworkList data = TileNetworkList.withContents(6, toUse);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import mekanism.client.gui.element.GuiUpgradeTab;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import mekanism.common.tier.FactoryTier;
|
||||
import mekanism.common.base.IFactory.MachineFuelType;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.api.TileNetworkList;
|
||||
|
||||
@@ -5,7 +5,7 @@ import mekanism.client.gui.element.GuiHeatInfo;
|
||||
import mekanism.client.gui.element.GuiSecurityTab;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.inventory.container.ContainerFuelwoodHeater;
|
||||
import mekanism.common.tile.TileEntityFuelwoodHeater;
|
||||
import mekanism.common.util.LangUtils;
|
||||
@@ -28,7 +28,7 @@ public class GuiFuelwoodHeater extends GuiMekanismTile<TileEntityFuelwoodHeater>
|
||||
addGuiElement(new GuiSlot(SlotType.NORMAL, this, resource, 14, 28));
|
||||
addGuiElement(new GuiSecurityTab(this, tileEntity, resource));
|
||||
addGuiElement(new GuiHeatInfo(() -> {
|
||||
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
|
||||
TemperatureUnit unit = TemperatureUnit.values()[MekanismConfig.current().general.tempUnit.val().ordinal()];
|
||||
String environment = UnitDisplayUtils
|
||||
.getDisplayShort(tileEntity.lastEnvironmentLoss * unit.intervalSize, false, unit);
|
||||
return Collections.singletonList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
|
||||
|
||||
@@ -2,6 +2,7 @@ package mekanism.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.client.gui.element.GuiRedstoneControl;
|
||||
import mekanism.client.gui.element.GuiSecurityTab;
|
||||
import mekanism.client.gui.element.GuiSideConfigurationTab;
|
||||
@@ -11,7 +12,6 @@ import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.gui.element.GuiTransporterConfigTab;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.inventory.container.ContainerGasTank;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.TileEntityGasTank;
|
||||
@@ -44,8 +44,8 @@ public class GuiGasTank extends GuiMekanismTile<TileEntityGasTank> {
|
||||
String stored = "" + (tileEntity.gasTank.getStored() == Integer.MAX_VALUE ? LangUtils.localize("gui.infinite")
|
||||
: tileEntity.gasTank.getStored());
|
||||
String capacityInfo =
|
||||
stored + " / " + (tileEntity.tier.storage == Integer.MAX_VALUE ? LangUtils.localize("gui.infinite")
|
||||
: tileEntity.tier.storage);
|
||||
stored + " / " + (tileEntity.tier.getStorage() == Integer.MAX_VALUE ? LangUtils.localize("gui.infinite")
|
||||
: tileEntity.tier.getStorage());
|
||||
fontRenderer
|
||||
.drawString(tileEntity.getName(), (xSize / 2) - (fontRenderer.getStringWidth(tileEntity.getName()) / 2),
|
||||
6, 0x404040);
|
||||
@@ -71,7 +71,7 @@ public class GuiGasTank extends GuiMekanismTile<TileEntityGasTank> {
|
||||
int displayInt = chooseByMode(tileEntity.dumping, 10, 18, 26);
|
||||
drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, displayInt, 8, 8);
|
||||
if (tileEntity.gasTank.getGas() != null) {
|
||||
int scale = (int) (((double) tileEntity.gasTank.getStored() / tileEntity.tier.storage) * 72);
|
||||
int scale = (int) (((double) tileEntity.gasTank.getStored() / tileEntity.tier.getStorage()) * 72);
|
||||
drawTexturedModalRect(guiWidth + 65, guiHeight + 17, 176, 0, scale, 10);
|
||||
}
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.client.gui.element.GuiEnergyInfo;
|
||||
import mekanism.client.gui.element.GuiHeatInfo;
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
@@ -14,8 +15,7 @@ import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.inventory.container.ContainerResistiveHeater;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.TileEntityResistiveHeater;
|
||||
@@ -52,7 +52,7 @@ public class GuiResistiveHeater extends GuiMekanismTile<TileEntityResistiveHeate
|
||||
.getEnergyDisplay(tileEntity.getMaxEnergy() - tileEntity.getEnergy()));
|
||||
}, this, resource));
|
||||
addGuiElement(new GuiHeatInfo(() -> {
|
||||
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
|
||||
TemperatureUnit unit = TemperatureUnit.values()[MekanismConfig.current().general.tempUnit.val().ordinal()];
|
||||
String environment = UnitDisplayUtils
|
||||
.getDisplayShort(tileEntity.lastEnvironmentLoss * unit.intervalSize, false, unit);
|
||||
return Collections.singletonList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
|
||||
|
||||
@@ -8,7 +8,7 @@ import mekanism.client.gui.element.GuiSecurityTab;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.common.config.MekanismConfig.usage;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.inventory.container.ContainerSeismicVibrator;
|
||||
import mekanism.common.tile.TileEntitySeismicVibrator;
|
||||
import mekanism.common.util.LangUtils;
|
||||
@@ -30,7 +30,8 @@ public class GuiSeismicVibrator extends GuiMekanismTile<TileEntitySeismicVibrato
|
||||
addGuiElement(new GuiRedstoneControl(this, tileEntity, resource));
|
||||
addGuiElement(new GuiPowerBar(this, tileEntity, resource, 164, 15));
|
||||
addGuiElement(new GuiEnergyInfo(() -> {
|
||||
String multiplier = MekanismUtils.getEnergyDisplay(usage.seismicVibratorUsage);
|
||||
String multiplier = MekanismUtils
|
||||
.getEnergyDisplay(MekanismConfig.current().usage.seismicVibratorUsage.val());
|
||||
return Arrays.asList(LangUtils.localize("gui.using") + ": " + multiplier + "/t",
|
||||
LangUtils.localize("gui.needed") + ": " + MekanismUtils
|
||||
.getEnergyDisplay(tileEntity.getMaxEnergy() - tileEntity.getEnergy()));
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Collections;
|
||||
import mekanism.client.gui.element.GuiFluidGauge;
|
||||
import mekanism.client.gui.element.GuiGauge;
|
||||
import mekanism.client.gui.element.GuiHeatInfo;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.inventory.container.ContainerThermalEvaporationController;
|
||||
import mekanism.common.tile.TileEntityThermalEvaporationController;
|
||||
import mekanism.common.util.LangUtils;
|
||||
@@ -28,7 +28,7 @@ public class GuiThermalEvaporationController extends GuiMekanismTile<TileEntityT
|
||||
addGuiElement(new GuiFluidGauge(() ->
|
||||
tileEntity.outputTank, GuiGauge.Type.STANDARD, this, resource, 152, 13));
|
||||
addGuiElement(new GuiHeatInfo(() -> {
|
||||
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
|
||||
TemperatureUnit unit = TemperatureUnit.values()[MekanismConfig.current().general.tempUnit.val().ordinal()];
|
||||
String environment = UnitDisplayUtils
|
||||
.getDisplayShort(tileEntity.totalLoss * unit.intervalSize, false, unit);
|
||||
return Collections.singletonList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
|
||||
|
||||
@@ -8,7 +8,7 @@ import mekanism.client.gui.element.GuiRateBar;
|
||||
import mekanism.client.gui.element.GuiRateBar.IRateInfoHandler;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.FluidType;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.boiler.SynchronizedBoilerData;
|
||||
import mekanism.common.inventory.container.ContainerFilter;
|
||||
import mekanism.common.tile.TileEntityBoilerCasing;
|
||||
@@ -50,13 +50,13 @@ public class GuiThermoelectricBoiler extends GuiMekanismTile<TileEntityBoilerCas
|
||||
|
||||
@Override
|
||||
public double getLevel() {
|
||||
double cap = (tileEntity.structure.superheatingElements * general.superheatingHeatTransfer)
|
||||
/ SynchronizedBoilerData.getHeatEnthalpy();
|
||||
double cap = (tileEntity.structure.superheatingElements * MekanismConfig
|
||||
.current().general.superheatingHeatTransfer.val()) / SynchronizedBoilerData.getHeatEnthalpy();
|
||||
return (double) tileEntity.structure.lastMaxBoil / cap;
|
||||
}
|
||||
}, resource, 144, 13));
|
||||
addGuiElement(new GuiHeatInfo(() -> {
|
||||
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
|
||||
TemperatureUnit unit = TemperatureUnit.values()[MekanismConfig.current().general.tempUnit.val().ordinal()];
|
||||
String environment = UnitDisplayUtils
|
||||
.getDisplayShort(tileEntity.structure.lastEnvironmentLoss * unit.intervalSize, false, unit);
|
||||
return Collections.singletonList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.client.gui.element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mekanism.client.gui.IGuiWrapper;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
@@ -43,7 +43,7 @@ public class GuiEnergyInfo extends GuiElement {
|
||||
public void renderForeground(int xAxis, int yAxis) {
|
||||
if (inBounds(xAxis, yAxis)) {
|
||||
List<String> info = new ArrayList<>(infoHandler.getInfo());
|
||||
info.add(LangUtils.localize("gui.unit") + ": " + general.energyUnit);
|
||||
info.add(LangUtils.localize("gui.unit") + ": " + MekanismConfig.current().general.energyUnit.val());
|
||||
displayTooltips(info, xAxis, yAxis);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,9 @@ public class GuiEnergyInfo extends GuiElement {
|
||||
@Override
|
||||
public void mouseClicked(int xAxis, int yAxis, int button) {
|
||||
if (button == 0 && inBounds(xAxis, yAxis)) {
|
||||
general.energyUnit = EnergyType.values()[(general.energyUnit.ordinal() + 1) % EnergyType.values().length];
|
||||
MekanismConfig.current().general.energyUnit
|
||||
.set(EnergyType.values()[(MekanismConfig.current().general.energyUnit.val().ordinal() + 1)
|
||||
% EnergyType.values().length]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package mekanism.client.gui.element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mekanism.client.gui.IGuiWrapper;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
@@ -43,7 +43,7 @@ public class GuiHeatInfo extends GuiElement {
|
||||
public void renderForeground(int xAxis, int yAxis) {
|
||||
if (inBounds(xAxis, yAxis)) {
|
||||
List<String> info = new ArrayList<>(infoHandler.getInfo());
|
||||
info.add(LangUtils.localize("gui.unit") + ": " + general.tempUnit);
|
||||
info.add(LangUtils.localize("gui.unit") + ": " + MekanismConfig.current().general.tempUnit.val());
|
||||
displayTooltips(info, xAxis, yAxis);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,9 @@ public class GuiHeatInfo extends GuiElement {
|
||||
@Override
|
||||
public void mouseClicked(int xAxis, int yAxis, int button) {
|
||||
if (button == 0 && inBounds(xAxis, yAxis)) {
|
||||
general.tempUnit = TempType.values()[(general.tempUnit.ordinal() + 1) % TempType.values().length];
|
||||
MekanismConfig.current().general.tempUnit
|
||||
.set(TempType.values()[(MekanismConfig.current().general.tempUnit.val().ordinal() + 1) % TempType
|
||||
.values().length]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import mekanism.client.MekanismClient;
|
||||
import mekanism.client.gui.IGuiWrapper;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.network.PacketSecurityMode.SecurityModeMessage;
|
||||
import mekanism.common.security.ISecurityItem;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
@@ -104,7 +104,7 @@ public class GuiSecurityTab extends GuiTileEntityElement<TileEntity> {
|
||||
}
|
||||
|
||||
private SecurityMode getSecurity() {
|
||||
if (!general.allowProtection) {
|
||||
if (!MekanismConfig.current().general.allowProtection.val()) {
|
||||
return SecurityMode.PUBLIC;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public class GuiSecurityTab extends GuiTileEntityElement<TileEntity> {
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int xAxis, int yAxis, int button) {
|
||||
if (button == 0 && general.allowProtection) {
|
||||
if (button == 0 && MekanismConfig.current().general.allowProtection.val()) {
|
||||
if (getOwner() != null && mc.player.getUniqueID().equals(getOwner())) {
|
||||
if (inBounds(xAxis, yAxis)) {
|
||||
SecurityMode current = getSecurity();
|
||||
|
||||
@@ -41,7 +41,6 @@ import mekanism.client.jei.machine.other.PRCRecipeWrapper;
|
||||
import mekanism.client.jei.machine.other.RotaryCondensentratorRecipeWrapper;
|
||||
import mekanism.client.jei.machine.other.SolarNeutronRecipeWrapper;
|
||||
import mekanism.client.jei.machine.other.ThermalEvaporationRecipeWrapper;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
@@ -67,6 +66,7 @@ import mekanism.common.recipe.machines.SmeltingRecipe;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
|
||||
import mekanism.common.recipe.machines.WasherRecipe;
|
||||
import mekanism.common.tier.FactoryTier;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.recipe.IRecipeWrapperFactory;
|
||||
@@ -326,7 +326,7 @@ public class RecipeRegistryHelper {
|
||||
|
||||
private static void registerVanillaSmeltingRecipeCatalyst(IModRegistry registry) {
|
||||
registry.addRecipeCatalyst(MachineType.ENERGIZED_SMELTER.getStack(), VanillaRecipeCategoryUid.SMELTING);
|
||||
for (Tier.FactoryTier tier : Tier.FactoryTier.values()) {
|
||||
for (FactoryTier tier : FactoryTier.values()) {
|
||||
if (tier.machineType.isEnabled()) {
|
||||
registry.addRecipeCatalyst(MekanismUtils.getFactory(tier, RecipeType.SMELTING),
|
||||
VanillaRecipeCategoryUid.SMELTING);
|
||||
@@ -353,7 +353,7 @@ public class RecipeRegistryHelper {
|
||||
}
|
||||
}
|
||||
if (factoryType != null) {
|
||||
for (Tier.FactoryTier tier : Tier.FactoryTier.values()) {
|
||||
for (FactoryTier tier : FactoryTier.values()) {
|
||||
if (tier.machineType.isEnabled()) {
|
||||
registry.addRecipeCatalyst(MekanismUtils.getFactory(tier, factoryType), recipe.getJEICategory());
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.client.model;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.tileentity.RenderEnergyCube;
|
||||
import mekanism.common.SideData.IOState;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.tier.EnergyCubeTier;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.client.model;
|
||||
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.Tier.FluidTankTier;
|
||||
import mekanism.common.tier.FluidTankTier;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -7,7 +7,7 @@ import mekanism.client.model.ModelEnergyCube.ModelEnergyCore;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.tileentity.RenderEnergyCube;
|
||||
import mekanism.common.SideData.IOState;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.tier.EnergyCubeTier;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.common.util.ItemDataUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -51,7 +51,7 @@ public class RenderEnergyCubeItem extends MekanismItemStackRenderer {
|
||||
|
||||
double energy = ItemDataUtils.getDouble(stack, "energyStored");
|
||||
|
||||
if (energy / tier.maxEnergy > 0.1) {
|
||||
if (energy / tier.getMaxEnergy() > 0.1) {
|
||||
GlStateManager.pushMatrix();
|
||||
MekanismRenderer.bindTexture(RenderEnergyCube.coreTexture);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RenderEnergyCubeItem extends MekanismItemStackRenderer {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(0.4F, 0.4F, 0.4F);
|
||||
GL11.glColor4f((float) c[0] / 255F, (float) c[1] / 255F, (float) c[2] / 255F,
|
||||
(float) (energy / tier.maxEnergy));
|
||||
(float) (energy / tier.getMaxEnergy()));
|
||||
GlStateManager.translate(0, (float) Math.sin(Math.toRadians(MekanismClient.ticksPassed * 3)) / 7, 0);
|
||||
GlStateManager.rotate(MekanismClient.ticksPassed * 4, 0, 1, 0);
|
||||
GlStateManager.rotate(36F + MekanismClient.ticksPassed * 4, 0, 1, 1);
|
||||
|
||||
@@ -7,7 +7,7 @@ import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
import mekanism.client.render.MekanismRenderer.FluidType;
|
||||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.Tier.FluidTankTier;
|
||||
import mekanism.common.tier.FluidTankTier;
|
||||
import mekanism.common.item.ItemBlockMachine;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
||||
@@ -15,7 +15,7 @@ import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
import mekanism.common.block.property.PropertyColor;
|
||||
import mekanism.common.block.property.PropertyConnection;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.tile.transmitter.TileEntitySidedPipe;
|
||||
import mekanism.common.tile.transmitter.TileEntitySidedPipe.ConnectionType;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -188,7 +188,7 @@ public class TransmitterModel extends OBJBakedModelBase {
|
||||
boolean sideIconOverride = connection != null && getIconStatus(side, connection) > 0;
|
||||
|
||||
if (MinecraftForgeClient.getRenderLayer() == BlockRenderLayer.TRANSLUCENT) {
|
||||
int opaqueVal = client.opaqueTransmitters ? 1 : 0;
|
||||
int opaqueVal = MekanismConfig.current().client.opaqueTransmitters.val() ? 1 : 0;
|
||||
|
||||
if (prop != null && prop.color != null) {
|
||||
return (!sideIconOverride && f.getMaterialName().contains("Center"))
|
||||
@@ -204,15 +204,13 @@ public class TransmitterModel extends OBJBakedModelBase {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!s.contains("Center") && !s.contains("Centre") && (client.opaqueTransmitters == s
|
||||
.contains("Opaque"))) {
|
||||
if (!s.contains("Center") && !s.contains("Centre") && (
|
||||
MekanismConfig.current().client.opaqueTransmitters.val() == s.contains("Opaque"))) {
|
||||
return textureMap.get(s);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (client.opaqueTransmitters) {
|
||||
return textureMap.get(f.getMaterialName() + "_Opaque");
|
||||
}
|
||||
} else if (MekanismConfig.current().client.opaqueTransmitters.val()) {
|
||||
return textureMap.get(f.getMaterialName() + "_Opaque");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import mekanism.client.MekanismClient;
|
||||
import mekanism.client.model.ModelEnergyCube;
|
||||
import mekanism.client.model.ModelEnergyCube.ModelEnergyCore;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.tier.EnergyCubeTier;
|
||||
import mekanism.common.tile.TileEntityEnergyCube;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
||||
@@ -5,7 +5,7 @@ import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
import mekanism.client.render.MekanismRenderer.FluidType;
|
||||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.Tier.FluidTankTier;
|
||||
import mekanism.common.tier.FluidTankTier;
|
||||
import mekanism.common.tile.TileEntityFluidTank;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
||||
@@ -6,8 +6,7 @@ import mekanism.client.model.ModelTransporterBox;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.transporter.TransporterStack;
|
||||
import mekanism.common.item.ItemConfigurator;
|
||||
import mekanism.common.tile.transmitter.TileEntityDiversionTransporter;
|
||||
@@ -55,7 +54,7 @@ public class RenderLogisticalTransporter extends RenderTransmitterBase<TileEntit
|
||||
@Override
|
||||
public void render(TileEntityLogisticalTransporter transporter, double x, double y, double z, float partialTick,
|
||||
int destroyStage, float alpha) {
|
||||
if (client.opaqueTransmitters) {
|
||||
if (MekanismConfig.current().client.opaqueTransmitters.val()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,7 +73,7 @@ public class RenderLogisticalTransporter extends RenderTransmitterBase<TileEntit
|
||||
entityItem.setItem(stack.itemStack);
|
||||
|
||||
float[] pos = TransporterUtils
|
||||
.getStackPosition(transporter.getTransmitter(), stack, partialTick * transporter.tier.speed);
|
||||
.getStackPosition(transporter.getTransmitter(), stack, partialTick * transporter.tier.getSpeed());
|
||||
|
||||
GL11.glTranslated(x + pos[0], y + pos[1], z + pos[2]);
|
||||
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||
|
||||
@@ -7,7 +7,7 @@ import mekanism.client.render.MekanismRenderer.DisplayInteger;
|
||||
import mekanism.client.render.MekanismRenderer.FluidType;
|
||||
import mekanism.client.render.MekanismRenderer.Model3D;
|
||||
import mekanism.common.ColourRGBA;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.tile.transmitter.TileEntityMechanicalPipe;
|
||||
import mekanism.common.tile.transmitter.TileEntitySidedPipe.ConnectionType;
|
||||
import mekanism.common.transmitters.grid.FluidNetwork;
|
||||
@@ -38,7 +38,7 @@ public class RenderMechanicalPipe extends RenderTransmitterBase<TileEntityMechan
|
||||
@Override
|
||||
public void render(TileEntityMechanicalPipe pipe, double x, double y, double z, float partialTick, int destroyStage,
|
||||
float alpha) {
|
||||
if (client.opaqueTransmitters) {
|
||||
if (MekanismConfig.current().client.opaqueTransmitters.val()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.client.render.transmitter;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.ColourRGBA;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.tile.transmitter.TileEntityPressurizedTube;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -19,7 +19,7 @@ public class RenderPressurizedTube extends RenderTransmitterBase<TileEntityPress
|
||||
@Override
|
||||
public void render(TileEntityPressurizedTube tube, double x, double y, double z, float partialTick,
|
||||
int destroyStage, float alpha) {
|
||||
if (client.opaqueTransmitters || !tube.getTransmitter().hasTransmitterNetwork()
|
||||
if (MekanismConfig.current().client.opaqueTransmitters.val() || !tube.getTransmitter().hasTransmitterNetwork()
|
||||
|| tube.getTransmitter().getTransmitterNetwork().refGas == null
|
||||
|| tube.getTransmitter().getTransmitterNetwork().gasScale == 0) {
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@ package mekanism.client.render.transmitter;
|
||||
|
||||
import mekanism.client.render.ColourTemperature;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.tile.transmitter.TileEntityThermodynamicConductor;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -18,7 +18,7 @@ public class RenderThermodynamicConductor extends RenderTransmitterBase<TileEnti
|
||||
@Override
|
||||
public void render(TileEntityThermodynamicConductor transmitter, double x, double y, double z, float partialTick,
|
||||
int destroyStage, float alpha) {
|
||||
if (client.opaqueTransmitters) {
|
||||
if (MekanismConfig.current().client.opaqueTransmitters.val()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package mekanism.client.render.transmitter;
|
||||
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.ColourRGBA;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.tile.transmitter.TileEntityUniversalCable;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -18,7 +18,7 @@ public class RenderUniversalCable extends RenderTransmitterBase<TileEntityUniver
|
||||
@Override
|
||||
public void render(TileEntityUniversalCable cable, double x, double y, double z, float partialTick,
|
||||
int destroyStage, float alpha) {
|
||||
if (client.opaqueTransmitters || cable.currentPower == 0) {
|
||||
if (MekanismConfig.current().client.opaqueTransmitters.val() || cable.currentPower == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.client.sound;
|
||||
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
import net.minecraft.client.audio.PositionedSound;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -75,6 +75,6 @@ public abstract class PlayerSound extends PositionedSound implements ITickableSo
|
||||
|
||||
@Override
|
||||
public float getVolume() {
|
||||
return super.getVolume() * client.baseSoundVolume;
|
||||
return (float) (super.getVolume() * MekanismConfig.current().client.baseSoundVolume.val());
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import javax.annotation.Nullable;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
@@ -73,7 +72,8 @@ public class SoundHandler {
|
||||
}
|
||||
|
||||
public static void playSound(SoundEvent sound) {
|
||||
playSound(PositionedSoundRecord.getRecord(sound, 1.0F, MekanismConfig.client.baseSoundVolume));
|
||||
playSound(PositionedSoundRecord
|
||||
.getRecord(sound, 1.0F, (float) MekanismConfig.current().client.baseSoundVolume.val()));
|
||||
}
|
||||
|
||||
public static void playSound(ISound sound) {
|
||||
@@ -86,7 +86,7 @@ public class SoundHandler {
|
||||
if (s == null || !Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(s)) {
|
||||
// No sound playing, start one up - we assume that tile sounds will play until explicitly stopped
|
||||
s = new PositionedSoundRecord(soundLoc, SoundCategory.BLOCKS,
|
||||
volume * client.baseSoundVolume, 1.0f,
|
||||
(float) (volume * MekanismConfig.current().client.baseSoundVolume.val()), 1.0f,
|
||||
true, 0, ISound.AttenuationType.LINEAR,
|
||||
pos.getX() + 0.5f, pos.getY() + 0.5f, pos.getZ() + 0.5f);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.net.ConnectException;
|
||||
import java.net.Socket;
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class VoiceClient extends Thread {
|
||||
Mekanism.logger.info("VoiceServer: Starting client connection...");
|
||||
|
||||
try {
|
||||
socket = new Socket(ip, general.VOICE_PORT);
|
||||
socket = new Socket(ip, MekanismConfig.current().general.VOICE_PORT.val());
|
||||
running = true;
|
||||
|
||||
input = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.common;
|
||||
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.network.PacketBoxBlacklist.BoxBlacklistMessage;
|
||||
import mekanism.common.network.PacketConfigSync.ConfigSyncMessage;
|
||||
import mekanism.common.network.PacketFreeRunnerData;
|
||||
@@ -8,6 +9,7 @@ import mekanism.common.network.PacketScubaTankData.ScubaTankDataMessage;
|
||||
import mekanism.common.network.PacketSecurityUpdate.SecurityPacket;
|
||||
import mekanism.common.network.PacketSecurityUpdate.SecurityUpdateMessage;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
|
||||
@@ -22,8 +24,13 @@ public class CommonPlayerTracker {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerLoginEvent(PlayerLoggedInEvent event) {
|
||||
MinecraftServer server = event.player.getServer();
|
||||
if (!event.player.world.isRemote) {
|
||||
Mekanism.packetHandler.sendTo(new ConfigSyncMessage(), (EntityPlayerMP) event.player);
|
||||
if (server == null || !server.isSinglePlayer()) {
|
||||
Mekanism.packetHandler
|
||||
.sendTo(new ConfigSyncMessage(MekanismConfig.local()), (EntityPlayerMP) event.player);
|
||||
Mekanism.logger.info("Sent config to '" + event.player.getDisplayNameString() + ".'");
|
||||
}
|
||||
Mekanism.packetHandler.sendTo(new BoxBlacklistMessage(), (EntityPlayerMP) event.player);
|
||||
// TODO: Coalesce all these sync events into a single message
|
||||
Mekanism.packetHandler.sendTo(JetpackDataMessage.FULL(Mekanism.playerState.getActiveJetpacks()),
|
||||
@@ -35,8 +42,6 @@ public class CommonPlayerTracker {
|
||||
Mekanism.packetHandler.sendTo(
|
||||
new PacketFreeRunnerData.FreeRunnerDataMessage(PacketFreeRunnerData.FreeRunnerPacket.FULL, null,
|
||||
false), (EntityPlayerMP) event.player);
|
||||
|
||||
Mekanism.logger.info("Sent config to '" + event.player.getDisplayNameString() + ".'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ import mekanism.common.base.IGuiProvider;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig.usage;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.entity.EntityRobit;
|
||||
import mekanism.common.inventory.container.ContainerAdvancedElectricMachine;
|
||||
import mekanism.common.inventory.container.ContainerChanceMachine;
|
||||
@@ -93,8 +92,6 @@ import mekanism.common.tile.prefab.TileEntityAdvancedElectricMachine;
|
||||
import mekanism.common.tile.prefab.TileEntityContainerBlock;
|
||||
import mekanism.common.tile.prefab.TileEntityDoubleElectricMachine;
|
||||
import mekanism.common.tile.prefab.TileEntityElectricMachine;
|
||||
import mekanism.common.util.UnitDisplayUtils.EnergyType;
|
||||
import mekanism.common.util.UnitDisplayUtils.TempType;
|
||||
import mekanism.common.voice.VoiceServerManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -110,7 +107,6 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||
import net.minecraftforge.fml.relauncher.FMLInjectionData;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@@ -163,331 +159,8 @@ public class CommonProxy implements IGuiProvider {
|
||||
* Set and load the mod's common configuration properties.
|
||||
*/
|
||||
public void loadConfiguration() {
|
||||
general.controlCircuitOreDict = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "ControlCircuitOreDict", true,
|
||||
"Enables recipes using Control Circuits to use OreDict'd Control Circuits from other mods.")
|
||||
.getBoolean();
|
||||
general.logPackets = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "LogPackets", false, "Log Mekanism packet names. Debug setting.")
|
||||
.getBoolean();
|
||||
general.dynamicTankEasterEgg = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "DynamicTankEasterEgg", false, "Audible sparkles.").getBoolean();
|
||||
general.voiceServerEnabled = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "WalkieTalkieServerEnabled", false).getBoolean();
|
||||
general.cardboardSpawners = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "AllowSpawnerBoxPickup", true,
|
||||
"Allows vanilla spawners to be moved with a Cardboard Box.").getBoolean();
|
||||
general.enableWorldRegeneration = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "EnableWorldRegeneration", false,
|
||||
"Allows chunks to retrogen Mekanism ore blocks.").getBoolean();
|
||||
general.spawnBabySkeletons = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "SpawnBabySkeletons", true,
|
||||
"Enable the spawning of baby skeletons. Think baby zombies but skeletons.")
|
||||
.getBoolean();
|
||||
general.obsidianTNTDelay = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTDelay", 100, "Fuse time for Obsidian TNT.")
|
||||
.getInt();
|
||||
general.obsidianTNTBlastRadius = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTBlastRadius", 12,
|
||||
"Radius of the explosion of Obsidian TNT.").getInt();
|
||||
general.UPDATE_DELAY = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ClientUpdateDelay", 10,
|
||||
"How many ticks must pass until a block's active state can sync with the client.")
|
||||
.getInt();
|
||||
general.osmiumPerChunk = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "OsmiumPerChunk", 12, "Chance that osmium generates in a chunk.", 0,
|
||||
Integer.MAX_VALUE).getInt();
|
||||
general.osmiumMaxVeinSize = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "OsmiumVeinSize", 8, "Max number of blocks in an osmium vein.", 1,
|
||||
Integer.MAX_VALUE)
|
||||
.getInt();
|
||||
general.copperPerChunk = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "CopperPerChunk", 16, "Chance that copper generates in a chunk.", 0,
|
||||
Integer.MAX_VALUE)
|
||||
.getInt();
|
||||
general.copperMaxVeinSize = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "CopperVeinSize", 8, "Max number of blocks in a copper vein.", 1,
|
||||
Integer.MAX_VALUE)
|
||||
.getInt();
|
||||
general.tinPerChunk = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "TinPerChunk", 14, "Chance that tin generates in a chunk.", 0,
|
||||
Integer.MAX_VALUE).getInt();
|
||||
general.tinMaxVeinSize = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "TinVeinSize", 8, "Max number of blocks in a tin vein.", 1,
|
||||
Integer.MAX_VALUE).getInt();
|
||||
general.saltPerChunk = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "SaltPerChunk", 2, "Chance that salt generates in a chunk.", 0,
|
||||
Integer.MAX_VALUE).getInt();
|
||||
general.saltMaxVeinSize = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "SaltVeinSize", 6, "Max number of blocks in a salt vein.", 1,
|
||||
Integer.MAX_VALUE).getInt();
|
||||
general.userWorldGenVersion = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "WorldRegenVersion", 0,
|
||||
"Change this value to cause Mekanism to regen its ore in all loaded chunks.")
|
||||
.getInt();
|
||||
general.FROM_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToEU", 10D,
|
||||
"Conversion multiplier from EU to Joules (EU * JoulesToEU = Joules)").getDouble();
|
||||
general.TO_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EUToJoules", .1D,
|
||||
"Conversion multiplier from Joules to EU (Joules * EUToJoules = EU)").getDouble();
|
||||
general.FROM_RF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToRF", 2.5D,
|
||||
"Conversion multiplier from RF to Joules (RF * JoulesToRF = Joules)").getDouble();
|
||||
general.TO_RF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "RFToJoules", 0.4D,
|
||||
"Conversion multiplier from Joules to RF (Joules * RFToJoules = RF)").getDouble();
|
||||
general.FROM_TESLA = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToTesla", 2.5D,
|
||||
"Conversion multiplier from Tesla to Joules (Tesla * JoulesToTesla = Joules)")
|
||||
.getDouble();
|
||||
general.TO_TESLA = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "TeslaToJoules", 0.4D,
|
||||
"Conversion multiplier from Joules to Tesla (Joules * TeslaToJoules = Tesla)")
|
||||
.getDouble();
|
||||
general.FROM_FORGE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToForge", 2.5D,
|
||||
"Conversion multiplier from Forge Energy to Joules (FE * JoulesToForge = Joules)")
|
||||
.getDouble();
|
||||
general.TO_FORGE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ForgeToJoules", 0.4D,
|
||||
"Conversion multiplier from Joules to Forge Energy (Joules * ForgeToJoules = FE)")
|
||||
.getDouble();
|
||||
general.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D,
|
||||
"How much energy is produced per mB of Hydrogen, also affects Electrolytic Separator usage, Ethylene burn rate and Gas generator energy capacity")
|
||||
.getDouble();
|
||||
general.ETHENE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EthyleneBurnTime", 40,
|
||||
"Burn time for Ethylene (1mB hydrogen + 2*bioFuel/tick*200ticks/100mB * 20x efficiency bonus).").getInt();
|
||||
general.ENERGY_PER_REDSTONE = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D,
|
||||
"How much energy (Joules) a piece of redstone gives in machines.").getDouble();
|
||||
general.DISASSEMBLER_USAGE = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "DisassemblerEnergyUsage", 10,
|
||||
"Base Energy (Joules) usage of the Atomic Disassembler.").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,
|
||||
"Base factor for working out machine performance with upgrades - UpgradeModifier * (UpgradesInstalled/UpgradesPossible).",
|
||||
1, Integer.MAX_VALUE).getInt();
|
||||
general.minerSilkMultiplier = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "MinerSilkMultiplier", 6,
|
||||
"Energy multiplier for using silk touch mode with the Digital Miner.").getDouble();
|
||||
general.prefilledGasTanks = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "PrefilledGasTanks", true,
|
||||
"Add filled creative gas tanks to creative/JEI.").getBoolean();
|
||||
general.armoredJetpackDamageRatio = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "ArmoredJetpackDamageRatio", 0.8,
|
||||
"Damage absorb ratio of the Armored Jetpack.").getDouble();
|
||||
general.armoredJetpackDamageMax = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "ArmoredJepackDamageMax", 115,
|
||||
"Max damage the Armored Jetpack can absorb.").getInt();
|
||||
general.aestheticWorldDamage = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "AestheticWorldDamage", true,
|
||||
"If enabled, lasers can break blocks and the flamethrower starts fires.").getBoolean();
|
||||
general.opsBypassRestrictions = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "OpsBypassRestrictions", false,
|
||||
"Ops can bypass the block security restrictions if enabled.").getBoolean();
|
||||
general.maxJetpackGas = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "MaxJetpackGas", 24000, "Jetpack Gas Tank capacity in mB.")
|
||||
.getInt();
|
||||
general.maxScubaGas = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "MaxScubaGas", 24000, "Scuba Tank Gas Tank capacity in mB.")
|
||||
.getInt();
|
||||
general.maxFlamethrowerGas = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "MaxFlamethrowerGas", 24000, "Flamethrower Gas Tank capacity in mB.")
|
||||
.getInt();
|
||||
general.maxPumpRange = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxPumpRange", 80,
|
||||
"Maximum block distance to pull fluid from for the Electric Pump.").getInt();
|
||||
general.pumpWaterSources = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PumpWaterSources", false,
|
||||
"If enabled makes Water and Heavy Water blocks be removed from the world on pump.")
|
||||
.getBoolean();
|
||||
general.maxPlenisherNodes = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "MaxPlenisherNodes", 4000,
|
||||
"Fluidic Plenisher stops after this many blocks.").getInt();
|
||||
general.evaporationHeatDissipation = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "EvaporationHeatDissipation", 0.02D,
|
||||
"Thermal Evaporation Tower heat loss per tick.").getDouble();
|
||||
general.evaporationTempMultiplier = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "EvaporationTempMultiplier", 0.1D,
|
||||
"Temperature to amount produced ratio for Thermal Evaporation Tower.").getDouble();
|
||||
general.evaporationSolarMultiplier = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "EvaporationSolarMultiplier", 0.2D,
|
||||
"Heat to absorb per Solar Panel array of Thermal Evaporation Tower.").getDouble();
|
||||
general.evaporationMaxTemp = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "EvaporationMaxTemp", 3000D,
|
||||
"Max Temperature of the Thermal Evaporation Tower.").getDouble();
|
||||
general.energyPerHeat = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerHeat", 1000D,
|
||||
"Joules required by the Resistive Heater to produce one unit of heat. Also affects Thermoelectric Boiler's Water->Steam rate.")
|
||||
.getDouble();
|
||||
general.maxEnergyPerSteam = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "MaxEnergyPerSteam", 100D,
|
||||
"Maximum Joules per mB of Steam. Also affects Thermoelectric Boiler.").getDouble();
|
||||
general.superheatingHeatTransfer = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "SuperheatingHeatTransfer", 10000D,
|
||||
"Amount of heat each Boiler heating element produces.").getDouble();
|
||||
general.heatPerFuelTick = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HeatPerFuelTick", 4D,
|
||||
"Amount of heat produced per fuel tick of a fuel's burn time in the Fuelwood Heater.")
|
||||
.getDouble();
|
||||
general.allowTransmitterAlloyUpgrade = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "AllowTransmitterAlloyUpgrade", true,
|
||||
"Allow right clicking on Cables/Pipes/Tubes with alloys to upgrade the tier.").getBoolean();
|
||||
general.allowChunkloading = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "AllowChunkloading", true,
|
||||
"Disable to make the anchor upgrade not do anything.").getBoolean();
|
||||
general.allowProtection = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AllowProtection", true,
|
||||
"Enable the security system for players to prevent others from accessing their machines. Does NOT affect Frequencies.")
|
||||
.getBoolean();
|
||||
general.portableTeleporterDelay = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "PortableTeleporterDelay", 0,
|
||||
"Delay in ticks before a player is teleported after clicking the Teleport button in the portable teleporter.")
|
||||
.getInt();
|
||||
general.quantumEntangloporterEnergyTransfer = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "QuantumEntangloporterEnergyTransfer", 16000000D,
|
||||
"Maximum buffer of an Entangoloporter frequency.").getDouble();
|
||||
|
||||
general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false,
|
||||
"Disables IC2 power integration. Requires world restart (server-side option in SMP).").getBoolean();
|
||||
general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false,
|
||||
"Disables Thermal Expansion RedstoneFlux power integration. Requires world restart (server-side option in SMP).")
|
||||
.getBoolean();
|
||||
general.blacklistTesla = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "BlacklistTeslaPower", false,
|
||||
"Disables Tesla power integration. Requires world restart (server-side option in SMP).")
|
||||
.getBoolean();
|
||||
general.blacklistForge = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "BlacklistForgePower", false,
|
||||
"Disables Forge Energy (FE,IF,uF,CF) power integration. Requires world restart (server-side option in SMP).")
|
||||
.getBoolean();
|
||||
|
||||
String s = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "EnergyType", "RF", "Displayed energy type in Mekanism GUIs.",
|
||||
new String[]{"J", "RF", "EU", "T"})
|
||||
.getString().trim().toLowerCase();
|
||||
|
||||
switch (s) {
|
||||
case "joules":
|
||||
general.energyUnit = EnergyType.J;
|
||||
break;
|
||||
case "eu":
|
||||
case "ic2":
|
||||
general.energyUnit = EnergyType.EU;
|
||||
break;
|
||||
case "tesla":
|
||||
general.energyUnit = EnergyType.T;
|
||||
break;
|
||||
default:
|
||||
general.energyUnit = EnergyType.RF;
|
||||
}
|
||||
|
||||
s = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "Temperature Units", "K",
|
||||
"Displayed temperature unit in Mekanism GUIs.", new String[]{"K", "C", "R", "F"})
|
||||
.getString();
|
||||
|
||||
if (s != null) {
|
||||
if (s.trim().equalsIgnoreCase("k") || s.trim().equalsIgnoreCase("kelvin")) {
|
||||
general.tempUnit = TempType.K;
|
||||
} else if (s.trim().equalsIgnoreCase("c") || s.trim().equalsIgnoreCase("celsius") || s.trim()
|
||||
.equalsIgnoreCase("centigrade")) {
|
||||
general.tempUnit = TempType.C;
|
||||
} else if (s.trim().equalsIgnoreCase("r") || s.trim().equalsIgnoreCase("rankine")) {
|
||||
general.tempUnit = TempType.R;
|
||||
} else if (s.trim().equalsIgnoreCase("f") || s.trim().equalsIgnoreCase("fahrenheit")) {
|
||||
general.tempUnit = TempType.F;
|
||||
} else if (s.trim().equalsIgnoreCase("a") || s.trim().equalsIgnoreCase("ambient") || s.trim()
|
||||
.equalsIgnoreCase("stp")) {
|
||||
general.tempUnit = TempType.STP;
|
||||
}
|
||||
}
|
||||
|
||||
general.laserRange = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "LaserRange", 64, "How far (in blocks) a laser can travel.")
|
||||
.getInt();
|
||||
general.laserEnergyNeededPerHardness = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "LaserDiggingEnergy", 100000,
|
||||
"Energy needed to destroy or attract blocks with a Laser (per block hardness level).")
|
||||
.getInt();
|
||||
general.destroyDisabledBlocks = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "DestroyDisabledBlocks", true,
|
||||
"If machine is disabled in config, do we set its block to air if it is found in world?")
|
||||
.getBoolean();
|
||||
general.digitalMinerMaxRadius = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "DigitalMinerMaxRadius", 32,
|
||||
"Maximum radius in blocks that the Digital Miner can reach. "
|
||||
+ "(Increasing this may have negative effects on stability and/or performance. "
|
||||
+ "We strongly recommend you leave it at the default value.)",
|
||||
1, Integer.MAX_VALUE).getInt();
|
||||
|
||||
for (MachineType type : BlockStateMachine.MachineType.getValidMachines()) {
|
||||
general.machinesManager.setEntry(type.blockName,
|
||||
Mekanism.configuration.get("machines", type.blockName + "Enabled", true,
|
||||
"Allow " + type.blockName + " to be used/crafted.").getBoolean());
|
||||
}
|
||||
|
||||
general.sawdustChancePlank = Mekanism.configuration
|
||||
.get(Configuration.CATEGORY_GENERAL, "SawdustChancePlank", 0.25D,
|
||||
"Chance of producing sawdust per operation in the precision sawmill when turning planks into sticks.")
|
||||
.getDouble();
|
||||
general.sawdustChanceLog = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SawdustChanceLog", 1D,
|
||||
"Chance of producing sawdust per operation in the precision sawmill when turning logs into planks.")
|
||||
.getDouble();
|
||||
|
||||
usage.enrichmentChamberUsage = Mekanism.configuration
|
||||
.get("usage", "EnrichmentChamberUsage", 50D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.osmiumCompressorUsage = Mekanism.configuration
|
||||
.get("usage", "OsmiumCompressorUsage", 100D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.combinerUsage = Mekanism.configuration
|
||||
.get("usage", "CombinerUsage", 50D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.crusherUsage = Mekanism.configuration
|
||||
.get("usage", "CrusherUsage", 50D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.metallurgicInfuserUsage = Mekanism.configuration
|
||||
.get("usage", "MetallurgicInfuserUsage", 50D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.purificationChamberUsage = Mekanism.configuration
|
||||
.get("usage", "PurificationChamberUsage", 200D, "Energy per operation tick (Joules).")
|
||||
.getDouble();
|
||||
usage.energizedSmelterUsage = Mekanism.configuration
|
||||
.get("usage", "EnergizedSmelterUsage", 50D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.digitalMinerUsage = Mekanism.configuration
|
||||
.get("usage", "DigitalMinerUsage", 100D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.electricPumpUsage = Mekanism.configuration
|
||||
.get("usage", "ElectricPumpUsage", 100D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.rotaryCondensentratorUsage = Mekanism.configuration
|
||||
.get("usage", "RotaryCondensentratorUsage", 50D, "Energy per operation tick (Joules).")
|
||||
.getDouble();
|
||||
usage.oxidationChamberUsage = Mekanism.configuration
|
||||
.get("usage", "OxidationChamberUsage", 200D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.chemicalInfuserUsage = Mekanism.configuration
|
||||
.get("usage", "ChemicalInfuserUsage", 200D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.chemicalInjectionChamberUsage = Mekanism.configuration
|
||||
.get("usage", "ChemicalInjectionChamberUsage", 400D, "Energy per operation tick (Joules).")
|
||||
.getDouble();
|
||||
usage.precisionSawmillUsage = Mekanism.configuration
|
||||
.get("usage", "PrecisionSawmillUsage", 50D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.chemicalDissolutionChamberUsage = Mekanism.configuration
|
||||
.get("usage", "ChemicalDissolutionChamberUsage", 400D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.chemicalWasherUsage = Mekanism.configuration
|
||||
.get("usage", "ChemicalWasherUsage", 200D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.chemicalCrystallizerUsage = Mekanism.configuration
|
||||
.get("usage", "ChemicalCrystallizerUsage", 400D, "Energy per operation tick (Joules).")
|
||||
.getDouble();
|
||||
usage.seismicVibratorUsage = Mekanism.configuration
|
||||
.get("usage", "SeismicVibratorUsage", 50D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.pressurizedReactionBaseUsage = Mekanism.configuration
|
||||
.get("usage", "PressurizedReactionBaseUsage", 5D, "Energy per operation tick (Joules).")
|
||||
.getDouble();
|
||||
usage.fluidicPlenisherUsage = Mekanism.configuration
|
||||
.get("usage", "FluidicPlenisherUsage", 100D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.laserUsage = Mekanism.configuration
|
||||
.get("usage", "LaserUsage", 5000D, "Energy per operation tick (Joules).").getDouble();
|
||||
usage.heavyWaterElectrolysisUsage = Mekanism.configuration.get("usage", "HeavyWaterElectrolysisUsage", 800D,
|
||||
"Energy needed for one [recipe unit] of heavy water production (Joules).")
|
||||
.getDouble();
|
||||
usage.formulaicAssemblicatorUsage = Mekanism.configuration
|
||||
.get("usage", "FormulaicAssemblicatorUsage", 100D, "Energy per operation tick (Joules).")
|
||||
.getDouble();
|
||||
usage.teleporterBaseUsage = Mekanism.configuration
|
||||
.get("usage", "TeleporterBaseUsage", 1000, "Base Joules cost for a teleportation.")
|
||||
.getInt();
|
||||
usage.teleporterDistanceUsage = Mekanism.configuration.get("usage", "TeleporterDistanceUsage", 10,
|
||||
"Joules per unit of distance travelled during teleportation - sqrt(xDiff^2 + yDiff^2 + zDiff^2).")
|
||||
.getInt();
|
||||
usage.teleporterDimensionPenalty = Mekanism.configuration
|
||||
.get("usage", "TeleporterDimensionPenalty", 10000,
|
||||
"Flat additional cost for interdimensional teleportation.").getInt();
|
||||
|
||||
Tier.loadConfig();
|
||||
MekanismConfig.local().general.load(Mekanism.configuration);
|
||||
MekanismConfig.local().usage.load(Mekanism.configuration);
|
||||
|
||||
if (Mekanism.configuration.hasChanged()) {
|
||||
Mekanism.configuration.save();
|
||||
@@ -720,7 +393,7 @@ public class CommonProxy implements IGuiProvider {
|
||||
}
|
||||
|
||||
public void onConfigSync(boolean fromPacket) {
|
||||
if (general.cardboardSpawners) {
|
||||
if (MekanismConfig.current().general.cardboardSpawners.val()) {
|
||||
MekanismAPI.removeBoxBlacklist(Blocks.MOB_SPAWNER, OreDictionary.WILDCARD_VALUE);
|
||||
} else {
|
||||
MekanismAPI.addBoxBlacklist(Blocks.MOB_SPAWNER, OreDictionary.WILDCARD_VALUE);
|
||||
@@ -728,7 +401,7 @@ public class CommonProxy implements IGuiProvider {
|
||||
|
||||
BlockStateMachine.MachineType.updateAllUsages();
|
||||
|
||||
if (general.voiceServerEnabled && Mekanism.voiceManager == null) {
|
||||
if (MekanismConfig.current().general.voiceServerEnabled.val() && Mekanism.voiceManager == null) {
|
||||
Mekanism.voiceManager = new VoiceServerManager();
|
||||
}
|
||||
if (fromPacket) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import buildcraft.api.fuels.IFuel;
|
||||
import buildcraft.api.mj.MjAPI;
|
||||
import java.util.HashMap;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -59,7 +59,8 @@ public class FuelHandler {
|
||||
|
||||
// getPowerPerCycle returns value in 1 BuildCraft micro MJ
|
||||
// 1 BuildCraft MJ equals 20 RF
|
||||
energyPerTick = bcFuel.getPowerPerCycle() / (double) MjAPI.MJ * 20 * general.FROM_RF;
|
||||
energyPerTick =
|
||||
bcFuel.getPowerPerCycle() / (double) MjAPI.MJ * 20 * MekanismConfig.current().general.FROM_RF.val();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.api.Pos3D;
|
||||
import mekanism.api.lasers.ILaserReceptor;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.CapabilityUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -30,7 +30,7 @@ public class LaserManager {
|
||||
}
|
||||
|
||||
public static LaserInfo fireLaser(Pos3D from, EnumFacing direction, double energy, World world) {
|
||||
Pos3D to = from.clone().translate(direction, general.laserRange - 0.002);
|
||||
Pos3D to = from.clone().translate(direction, MekanismConfig.current().general.laserRange.val() - 0.002);
|
||||
|
||||
RayTraceResult mop = world.rayTraceBlocks(from, to);
|
||||
|
||||
@@ -69,7 +69,7 @@ public class LaserManager {
|
||||
}
|
||||
|
||||
public static List<ItemStack> breakBlock(Coord4D blockCoord, boolean dropAtBlock, World world, BlockPos laserPos) {
|
||||
if (!general.aestheticWorldDamage) {
|
||||
if (!MekanismConfig.current().general.aestheticWorldDamage.val()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class LaserManager {
|
||||
}
|
||||
|
||||
public static RayTraceResult fireLaserClient(Pos3D from, EnumFacing direction, double energy, World world) {
|
||||
Pos3D to = from.clone().translate(direction, general.laserRange - 0.002);
|
||||
Pos3D to = from.clone().translate(direction, MekanismConfig.current().general.laserRange.val() - 0.002);
|
||||
RayTraceResult mop = world.rayTraceBlocks(from, to);
|
||||
|
||||
if (mop != null) {
|
||||
|
||||
@@ -26,15 +26,14 @@ import mekanism.api.transmitters.DynamicNetwork.NetworkClientRequest;
|
||||
import mekanism.api.transmitters.DynamicNetwork.TransmittersAddedEvent;
|
||||
import mekanism.api.transmitters.TransmitterNetworkRegistry;
|
||||
import mekanism.client.ClientTickHandler;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.base.IModule;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.block.states.BlockStateTransmitter.TransmitterType;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.chunkloading.ChunkManager;
|
||||
import mekanism.common.command.CommandMek;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig.usage;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.boiler.SynchronizedBoilerData;
|
||||
import mekanism.common.content.entangloporter.InventoryFrequency;
|
||||
import mekanism.common.content.matrix.SynchronizedMatrixData;
|
||||
@@ -358,7 +357,8 @@ public class Mekanism {
|
||||
new ItemStack(MekanismItems.Ingot, 1, 6), 0.0F);
|
||||
|
||||
//Enrichment Chamber Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.ENRICHMENT_CHAMBER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.ENRICHMENT_CHAMBER)) {
|
||||
RecipeHandler
|
||||
.addEnrichmentChamberRecipe(new ItemStack(Blocks.REDSTONE_ORE), new ItemStack(Items.REDSTONE, 12));
|
||||
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.OBSIDIAN),
|
||||
@@ -405,7 +405,7 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Combiner recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.COMBINER)) {
|
||||
if (MekanismConfig.current().general.machinesManager.isEnabled(BlockStateMachine.MachineType.COMBINER)) {
|
||||
RecipeHandler.addCombinerRecipe(new ItemStack(Items.REDSTONE, 16), new ItemStack(Blocks.COBBLESTONE),
|
||||
new ItemStack(Blocks.REDSTONE_ORE));
|
||||
RecipeHandler.addCombinerRecipe(new ItemStack(Items.DYE, 16, 4), new ItemStack(Blocks.COBBLESTONE),
|
||||
@@ -421,13 +421,14 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Osmium Compressor Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.OSMIUM_COMPRESSOR)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.OSMIUM_COMPRESSOR)) {
|
||||
RecipeHandler.addOsmiumCompressorRecipe(new ItemStack(Items.GLOWSTONE_DUST),
|
||||
new ItemStack(MekanismItems.Ingot, 1, 3));
|
||||
}
|
||||
|
||||
//Crusher Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.CRUSHER)) {
|
||||
if (MekanismConfig.current().general.machinesManager.isEnabled(BlockStateMachine.MachineType.CRUSHER)) {
|
||||
RecipeHandler.addCrusherRecipe(new ItemStack(Items.DIAMOND), new ItemStack(MekanismItems.OtherDust, 1, 0));
|
||||
RecipeHandler.addCrusherRecipe(new ItemStack(Items.IRON_INGOT),
|
||||
new ItemStack(MekanismItems.Dust, 1, Resource.IRON.ordinal()));
|
||||
@@ -472,12 +473,14 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Purification Chamber Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.PURIFICATION_CHAMBER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.PURIFICATION_CHAMBER)) {
|
||||
RecipeHandler.addPurificationChamberRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT));
|
||||
}
|
||||
|
||||
//Chemical Injection Chamber Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.CHEMICAL_INJECTION_CHAMBER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.CHEMICAL_INJECTION_CHAMBER)) {
|
||||
RecipeHandler.addChemicalInjectionChamberRecipe(new ItemStack(Blocks.DIRT), MekanismFluids.Water,
|
||||
new ItemStack(Blocks.CLAY));
|
||||
RecipeHandler.addChemicalInjectionChamberRecipe(new ItemStack(Blocks.HARDENED_CLAY), MekanismFluids.Water,
|
||||
@@ -490,7 +493,8 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Precision Sawmill Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.PRECISION_SAWMILL)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.PRECISION_SAWMILL)) {
|
||||
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.LADDER, 3), new ItemStack(Items.STICK, 7));
|
||||
RecipeHandler.addPrecisionSawmillRecipe(new ItemStack(Blocks.TORCH, 4), new ItemStack(Items.STICK),
|
||||
new ItemStack(Items.COAL), 1);
|
||||
@@ -546,7 +550,8 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Metallurgic Infuser Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.METALLURGIC_INFUSER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.METALLURGIC_INFUSER)) {
|
||||
RecipeHandler.addMetallurgicInfuserRecipe(InfuseRegistry.get("CARBON"), 10, new ItemStack(Items.IRON_INGOT),
|
||||
new ItemStack(MekanismItems.EnrichedIron));
|
||||
RecipeHandler.addMetallurgicInfuserRecipe(InfuseRegistry.get("CARBON"), 10,
|
||||
@@ -572,7 +577,8 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Chemical Infuser Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.CHEMICAL_INFUSER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.CHEMICAL_INFUSER)) {
|
||||
RecipeHandler.addChemicalInfuserRecipe(new GasStack(MekanismFluids.Oxygen, 1),
|
||||
new GasStack(MekanismFluids.SulfurDioxide, 2), new GasStack(MekanismFluids.SulfurTrioxide, 2));
|
||||
RecipeHandler.addChemicalInfuserRecipe(new GasStack(MekanismFluids.SulfurTrioxide, 1),
|
||||
@@ -584,13 +590,17 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Electrolytic Separator Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.ELECTROLYTIC_SEPARATOR)) {
|
||||
RecipeHandler.addElectrolyticSeparatorRecipe(FluidRegistry.getFluidStack("water", 2), 2 * general.FROM_H2,
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.ELECTROLYTIC_SEPARATOR)) {
|
||||
RecipeHandler.addElectrolyticSeparatorRecipe(FluidRegistry.getFluidStack("water", 2),
|
||||
2 * MekanismConfig.current().general.FROM_H2.val(),
|
||||
new GasStack(MekanismFluids.Hydrogen, 2), new GasStack(MekanismFluids.Oxygen, 1));
|
||||
RecipeHandler.addElectrolyticSeparatorRecipe(FluidRegistry.getFluidStack("brine", 10), 2 * general.FROM_H2,
|
||||
RecipeHandler.addElectrolyticSeparatorRecipe(FluidRegistry.getFluidStack("brine", 10),
|
||||
2 * MekanismConfig.current().general.FROM_H2.val(),
|
||||
new GasStack(MekanismFluids.Sodium, 1), new GasStack(MekanismFluids.Chlorine, 1));
|
||||
RecipeHandler.addElectrolyticSeparatorRecipe(FluidRegistry.getFluidStack("heavywater", 2),
|
||||
usage.heavyWaterElectrolysisUsage, new GasStack(MekanismFluids.Deuterium, 2),
|
||||
MekanismConfig.current().usage.heavyWaterElectrolysisUsage.val(),
|
||||
new GasStack(MekanismFluids.Deuterium, 2),
|
||||
new GasStack(MekanismFluids.Oxygen, 1));
|
||||
}
|
||||
|
||||
@@ -601,7 +611,8 @@ public class Mekanism {
|
||||
FluidRegistry.getFluidStack("liquidlithium", 1));
|
||||
|
||||
//Chemical Crystallizer Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.CHEMICAL_CRYSTALLIZER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.CHEMICAL_CRYSTALLIZER)) {
|
||||
RecipeHandler.addChemicalCrystallizerRecipe(new GasStack(MekanismFluids.Lithium, 100),
|
||||
new ItemStack(MekanismItems.OtherDust, 1, 4));
|
||||
RecipeHandler.addChemicalCrystallizerRecipe(new GasStack(MekanismFluids.Brine, 15),
|
||||
@@ -613,14 +624,15 @@ public class Mekanism {
|
||||
if (gas instanceof OreGas && !((OreGas) gas).isClean()) {
|
||||
OreGas oreGas = (OreGas) gas;
|
||||
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.CHEMICAL_WASHER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.CHEMICAL_WASHER)) {
|
||||
RecipeHandler
|
||||
.addChemicalWasherRecipe(new GasStack(oreGas, 1), new GasStack(oreGas.getCleanGas(), 1));
|
||||
}
|
||||
|
||||
//do the crystallizer only if it's one of ours!
|
||||
Resource gasResource = Resource.getFromName(oreGas.getName());
|
||||
if (gasResource != null && general.machinesManager
|
||||
if (gasResource != null && MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.CHEMICAL_CRYSTALLIZER)) {
|
||||
RecipeHandler.addChemicalCrystallizerRecipe(new GasStack(oreGas.getCleanGas(), 200),
|
||||
new ItemStack(MekanismItems.Crystal, 1, gasResource.ordinal()));
|
||||
@@ -629,7 +641,8 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Pressurized Reaction Chamber Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.PRESSURIZED_REACTION_CHAMBER)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.PRESSURIZED_REACTION_CHAMBER)) {
|
||||
RecipeHandler.addPRCRecipe(
|
||||
new ItemStack(MekanismItems.BioFuel, 2), new FluidStack(FluidRegistry.WATER, 10),
|
||||
new GasStack(MekanismFluids.Hydrogen, 100),
|
||||
@@ -654,7 +667,8 @@ public class Mekanism {
|
||||
}
|
||||
|
||||
//Solar Neutron Activator Recipes
|
||||
if (general.machinesManager.isEnabled(BlockStateMachine.MachineType.SOLAR_NEUTRON_ACTIVATOR)) {
|
||||
if (MekanismConfig.current().general.machinesManager
|
||||
.isEnabled(BlockStateMachine.MachineType.SOLAR_NEUTRON_ACTIVATOR)) {
|
||||
RecipeHandler.addSolarNeutronRecipe(new GasStack(MekanismFluids.Lithium, 1),
|
||||
new GasStack(MekanismFluids.Tritium, 1));
|
||||
}
|
||||
@@ -688,7 +702,7 @@ public class Mekanism {
|
||||
new InfuseObject(InfuseRegistry.get("OBSIDIAN"), 80));
|
||||
|
||||
//Fuel Gases
|
||||
FuelHandler.addGas(MekanismFluids.Hydrogen, 1, general.FROM_H2);
|
||||
FuelHandler.addGas(MekanismFluids.Hydrogen, 1, MekanismConfig.current().general.FROM_H2.val());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -764,7 +778,7 @@ public class Mekanism {
|
||||
OreDictionary.registerOre("oreCopper", new ItemStack(MekanismBlocks.OreBlock, 1, 1));
|
||||
OreDictionary.registerOre("oreTin", new ItemStack(MekanismBlocks.OreBlock, 1, 2));
|
||||
|
||||
if (general.controlCircuitOreDict) {
|
||||
if (MekanismConfig.current().general.controlCircuitOreDict.val()) {
|
||||
OreDictionary.registerOre("circuitBasic", new ItemStack(MekanismItems.ControlCircuit, 1, 0));
|
||||
OreDictionary.registerOre("circuitAdvanced", new ItemStack(MekanismItems.ControlCircuit, 1, 1));
|
||||
OreDictionary.registerOre("circuitElite", new ItemStack(MekanismItems.ControlCircuit, 1, 2));
|
||||
@@ -869,7 +883,7 @@ public class Mekanism {
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
if (general.voiceServerEnabled) {
|
||||
if (MekanismConfig.current().general.voiceServerEnabled.val()) {
|
||||
voiceManager.start();
|
||||
}
|
||||
CommandMek.register(event);
|
||||
@@ -877,7 +891,7 @@ public class Mekanism {
|
||||
|
||||
@EventHandler
|
||||
public void serverStopping(FMLServerStoppingEvent event) {
|
||||
if (general.voiceServerEnabled) {
|
||||
if (MekanismConfig.current().general.voiceServerEnabled.val()) {
|
||||
voiceManager.stop();
|
||||
}
|
||||
|
||||
@@ -917,9 +931,6 @@ public class Mekanism {
|
||||
//Set the mod's configuration
|
||||
configuration = new Configuration(config);
|
||||
|
||||
//Register tier information
|
||||
Tier.init();
|
||||
|
||||
//Load configuration
|
||||
proxy.loadConfiguration();
|
||||
proxy.onConfigSync(false);
|
||||
@@ -992,7 +1003,7 @@ public class Mekanism {
|
||||
PacketSimpleGui.handlers.add(0, proxy);
|
||||
|
||||
//Set up VoiceServerManager
|
||||
if (general.voiceServerEnabled) {
|
||||
if (MekanismConfig.current().general.voiceServerEnabled.val()) {
|
||||
voiceManager = new VoiceServerManager();
|
||||
}
|
||||
|
||||
@@ -1000,7 +1011,7 @@ public class Mekanism {
|
||||
TransmitterNetworkRegistry.initiate();
|
||||
|
||||
//Add baby skeleton spawner
|
||||
if (general.spawnBabySkeletons) {
|
||||
if (MekanismConfig.current().general.spawnBabySkeletons.val()) {
|
||||
for (Biome biome : BiomeProvider.allowedBiomes) {
|
||||
if (biome.getSpawnableList(EnumCreatureType.MONSTER) != null
|
||||
&& biome.getSpawnableList(EnumCreatureType.MONSTER).size() > 0) {
|
||||
@@ -1160,18 +1171,19 @@ public class Mekanism {
|
||||
NBTTagCompound nbtTags = event.getData();
|
||||
|
||||
nbtTags.setInteger("MekanismWorldGen", baseWorldGenVersion);
|
||||
nbtTags.setInteger("MekanismUserWorldGen", general.userWorldGenVersion);
|
||||
nbtTags.setInteger("MekanismUserWorldGen", MekanismConfig.current().general.userWorldGenVersion.val());
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public synchronized void onChunkDataLoad(ChunkDataEvent.Load event) {
|
||||
if (!event.getWorld().isRemote) {
|
||||
if (general.enableWorldRegeneration) {
|
||||
if (MekanismConfig.current().general.enableWorldRegeneration.val()) {
|
||||
NBTTagCompound loadData = event.getData();
|
||||
|
||||
if (loadData.getInteger("MekanismWorldGen") == baseWorldGenVersion
|
||||
&& loadData.getInteger("MekanismUserWorldGen") == general.userWorldGenVersion) {
|
||||
&& loadData.getInteger("MekanismUserWorldGen") == MekanismConfig
|
||||
.current().general.userWorldGenVersion.val()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nonnull;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.network.PacketBoxBlacklist;
|
||||
import mekanism.common.network.PacketBoxBlacklist.BoxBlacklistMessage;
|
||||
import mekanism.common.network.PacketConfigSync;
|
||||
@@ -170,7 +170,7 @@ public class PacketHandler {
|
||||
}
|
||||
|
||||
public static void log(String log) {
|
||||
if (general.logPackets) {
|
||||
if (MekanismConfig.current().general.logPackets.val()) {
|
||||
Mekanism.logger.info(log);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class PlayerState {
|
||||
}
|
||||
|
||||
// Start a sound playing if the person is now flying
|
||||
if (isActive && MekanismConfig.client.enablePlayerSounds) {
|
||||
if (isActive && MekanismConfig.current().client.enablePlayerSounds.val()) {
|
||||
SoundHandler.startSound(world.getPlayerEntityByUUID(uuid), "jetpack");
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class PlayerState {
|
||||
}
|
||||
|
||||
// Start a sound playing if the person is now using a gasmask
|
||||
if (isActive && MekanismConfig.client.enablePlayerSounds) {
|
||||
if (isActive && MekanismConfig.current().client.enablePlayerSounds.val()) {
|
||||
SoundHandler.startSound(world.getPlayerEntityByUUID(uuid), "gasmask");
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class PlayerState {
|
||||
}
|
||||
|
||||
// Start a sound playing if the person is now using a flamethrower
|
||||
if (isActive && MekanismConfig.client.enablePlayerSounds) {
|
||||
if (isActive && MekanismConfig.current().client.enablePlayerSounds.val()) {
|
||||
SoundHandler.startSound(world.getPlayerEntityByUUID(uuid), "flamethrower");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,676 +0,0 @@
|
||||
package mekanism.common;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
* Tier information for Mekanism. This currently includes tiers for Energy Cubes and Smelting Factories.
|
||||
*
|
||||
* @author aidancbrady
|
||||
*/
|
||||
public final class Tier {
|
||||
|
||||
private static List<ITier> tierTypes = new ArrayList<>();
|
||||
|
||||
private static boolean initiated = false;
|
||||
|
||||
public static void init() {
|
||||
if (initiated) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Class<?> c : Tier.class.getDeclaredClasses()) {
|
||||
if (c.isEnum()) {
|
||||
try {
|
||||
for (Object obj : c.getEnumConstants()) {
|
||||
if (obj instanceof ITier) {
|
||||
tierTypes.add((ITier) obj);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initiated = true;
|
||||
}
|
||||
|
||||
public static void loadConfig() {
|
||||
for (ITier tier : tierTypes) {
|
||||
tier.loadConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public static void readConfig(ByteBuf dataStream) {
|
||||
for (ITier tier : tierTypes) {
|
||||
tier.readConfig(dataStream);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeConfig(ByteBuf dataStream) {
|
||||
for (ITier tier : tierTypes) {
|
||||
tier.writeConfig(dataStream);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The default tiers used in Mekanism.
|
||||
*
|
||||
* @author aidancbrady
|
||||
*/
|
||||
public enum BaseTier implements IStringSerializable {
|
||||
BASIC("Basic", EnumColor.BRIGHT_GREEN),
|
||||
ADVANCED("Advanced", EnumColor.DARK_RED),
|
||||
ELITE("Elite", EnumColor.DARK_BLUE),
|
||||
ULTIMATE("Ultimate", EnumColor.PURPLE),
|
||||
CREATIVE("Creative", EnumColor.BLACK);
|
||||
|
||||
private String name;
|
||||
private EnumColor color;
|
||||
|
||||
BaseTier(String s, EnumColor c) {
|
||||
name = s;
|
||||
color = c;
|
||||
}
|
||||
|
||||
public String getSimpleName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getLocalizedName() {
|
||||
return LangUtils.localize("tier." + getSimpleName());
|
||||
}
|
||||
|
||||
public EnumColor getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public boolean isObtainable() {
|
||||
return this != CREATIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
public enum EnergyCubeTier implements ITier, IStringSerializable {
|
||||
BASIC(2000000, 800),
|
||||
ADVANCED(8000000, 3200),
|
||||
ELITE(32000000, 12800),
|
||||
ULTIMATE(128000000, 51200),
|
||||
CREATIVE(Double.MAX_VALUE, Double.MAX_VALUE);
|
||||
|
||||
public double maxEnergy;
|
||||
public double output;
|
||||
private double baseMaxEnergy;
|
||||
private double baseOutput;
|
||||
|
||||
EnergyCubeTier(double max, double out) {
|
||||
baseMaxEnergy = maxEnergy = max;
|
||||
baseOutput = output = out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
if (this != CREATIVE) {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
maxEnergy = Mekanism.configuration.get("tier", name + "EnergyCubeMaxEnergy", baseMaxEnergy,
|
||||
"Maximum number of Joules a " + name + " energy cube can store.").getDouble();
|
||||
output = Mekanism.configuration.get("tier", name + "EnergyCubeOutput", baseOutput,
|
||||
"Output rate in Joules of a " + name + " energy cube.").getDouble();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
if (this != CREATIVE) {
|
||||
maxEnergy = dataStream.readDouble();
|
||||
output = dataStream.readDouble();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
if (this != CREATIVE) {
|
||||
dataStream.writeDouble(maxEnergy);
|
||||
dataStream.writeDouble(output);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
public enum InductionCellTier implements ITier {
|
||||
BASIC(1E9D),
|
||||
ADVANCED(8E9D),
|
||||
ELITE(64E9D),
|
||||
ULTIMATE(512E9D);
|
||||
|
||||
public double maxEnergy;
|
||||
private double baseMaxEnergy;
|
||||
|
||||
InductionCellTier(double max) {
|
||||
baseMaxEnergy = maxEnergy = max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
maxEnergy = Mekanism.configuration.get("tier", name + "InductionCellMaxEnergy", baseMaxEnergy,
|
||||
"Maximum number of Joules a " + name + " induction cell can store.").getDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
maxEnergy = dataStream.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeDouble(maxEnergy);
|
||||
}
|
||||
}
|
||||
|
||||
public enum InductionProviderTier implements ITier {
|
||||
BASIC(64000),
|
||||
ADVANCED(512000),
|
||||
ELITE(4096000),
|
||||
ULTIMATE(32768000);
|
||||
|
||||
public double output;
|
||||
private double baseOutput;
|
||||
|
||||
InductionProviderTier(double out) {
|
||||
baseOutput = output = out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
output = Mekanism.configuration.get("tier", name + "InductionProviderOutput", baseOutput,
|
||||
"Maximum number of Joules a " + name + " induction provider can output or accept.").getDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
output = dataStream.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeDouble(output);
|
||||
}
|
||||
}
|
||||
|
||||
public enum FactoryTier {
|
||||
BASIC(3, new ResourceLocation("mekanism", "gui/factory/GuiBasicFactory.png"),
|
||||
BlockStateMachine.MachineType.BASIC_FACTORY),
|
||||
ADVANCED(5, new ResourceLocation("mekanism", "gui/factory/GuiAdvancedFactory.png"),
|
||||
BlockStateMachine.MachineType.ADVANCED_FACTORY),
|
||||
ELITE(7, new ResourceLocation("mekanism", "gui/factory/GuiEliteFactory.png"),
|
||||
BlockStateMachine.MachineType.ELITE_FACTORY);
|
||||
|
||||
public final BlockStateMachine.MachineType machineType;
|
||||
public int processes;
|
||||
public ResourceLocation guiLocation;
|
||||
|
||||
FactoryTier(int process, ResourceLocation gui, BlockStateMachine.MachineType machineTypeIn) {
|
||||
processes = process;
|
||||
guiLocation = gui;
|
||||
machineType = machineTypeIn;
|
||||
}
|
||||
|
||||
public static FactoryTier getFromName(String tierName) {
|
||||
for (FactoryTier tier : values()) {
|
||||
if (tierName.contains(tier.getBaseTier().getSimpleName())) {
|
||||
return tier;
|
||||
}
|
||||
}
|
||||
|
||||
Mekanism.logger.error("Invalid tier identifier when retrieving with name.");
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
}
|
||||
|
||||
public enum CableTier implements ITier {
|
||||
BASIC(3200),
|
||||
ADVANCED(12800),
|
||||
ELITE(64000),
|
||||
ULTIMATE(320000);
|
||||
|
||||
public int cableCapacity;
|
||||
private int baseCapacity;
|
||||
|
||||
CableTier(int capacity) {
|
||||
baseCapacity = cableCapacity = capacity;
|
||||
}
|
||||
|
||||
public static CableTier get(BaseTier tier) {
|
||||
for (CableTier transmitter : values()) {
|
||||
if (transmitter.getBaseTier() == tier) {
|
||||
return transmitter;
|
||||
}
|
||||
}
|
||||
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
cableCapacity = Mekanism.configuration.get("tier", name + "CableCapacity", baseCapacity,
|
||||
"Internal buffer in Joules of each " + name + " universal cable.").getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
cableCapacity = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeInt(cableCapacity);
|
||||
}
|
||||
}
|
||||
|
||||
public enum PipeTier implements ITier {
|
||||
BASIC(1000, 100),
|
||||
ADVANCED(4000, 400),
|
||||
ELITE(16000, 1600),
|
||||
ULTIMATE(64000, 6400);
|
||||
|
||||
public int pipeCapacity;
|
||||
public int pipePullAmount;
|
||||
private int baseCapacity;
|
||||
private int basePull;
|
||||
|
||||
PipeTier(int capacity, int pullAmount) {
|
||||
baseCapacity = pipeCapacity = capacity;
|
||||
basePull = pipePullAmount = pullAmount;
|
||||
}
|
||||
|
||||
public static PipeTier get(BaseTier tier) {
|
||||
for (PipeTier transmitter : values()) {
|
||||
if (transmitter.getBaseTier() == tier) {
|
||||
return transmitter;
|
||||
}
|
||||
}
|
||||
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
pipeCapacity = Mekanism.configuration.get("tier", name + "PipeCapacity", baseCapacity,
|
||||
"Capacity of " + name + " mechanical pipe in mB.").getInt();
|
||||
pipePullAmount = Mekanism.configuration.get("tier", name + "PipePullAmount", basePull,
|
||||
"Pump rate of " + name + " mechanical pipe in mB/t.").getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
pipeCapacity = dataStream.readInt();
|
||||
pipePullAmount = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeInt(pipeCapacity);
|
||||
dataStream.writeInt(pipePullAmount);
|
||||
}
|
||||
}
|
||||
|
||||
public enum TubeTier implements ITier {
|
||||
BASIC(256, 64),
|
||||
ADVANCED(1024, 256),
|
||||
ELITE(4096, 1024),
|
||||
ULTIMATE(16384, 4096);
|
||||
|
||||
public int tubeCapacity;
|
||||
public int tubePullAmount;
|
||||
private int baseCapacity;
|
||||
private int basePull;
|
||||
|
||||
TubeTier(int capacity, int pullAmount) {
|
||||
baseCapacity = tubeCapacity = capacity;
|
||||
basePull = tubePullAmount = pullAmount;
|
||||
}
|
||||
|
||||
public static TubeTier get(BaseTier tier) {
|
||||
for (TubeTier transmitter : values()) {
|
||||
if (transmitter.getBaseTier() == tier) {
|
||||
return transmitter;
|
||||
}
|
||||
}
|
||||
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
tubeCapacity = Mekanism.configuration.get("tier", name + "TubeCapacity", baseCapacity,
|
||||
"Capacity of " + name + " pressurized tube in mB.").getInt();
|
||||
tubePullAmount = Mekanism.configuration.get("tier", name + "TubePullAmount", basePull,
|
||||
"Pump rate of " + name + " pressurized tube in mB/t.").getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
tubeCapacity = dataStream.readInt();
|
||||
tubePullAmount = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeInt(tubeCapacity);
|
||||
dataStream.writeInt(tubePullAmount);
|
||||
}
|
||||
}
|
||||
|
||||
public enum TransporterTier implements ITier {
|
||||
BASIC(1, 5),
|
||||
ADVANCED(16, 10),
|
||||
ELITE(32, 20),
|
||||
ULTIMATE(64, 50);
|
||||
|
||||
public int pullAmount;
|
||||
public int speed;
|
||||
private int basePull;
|
||||
private int baseSpeed;
|
||||
|
||||
TransporterTier(int pull, int s) {
|
||||
basePull = pullAmount = pull;
|
||||
baseSpeed = speed = s;
|
||||
}
|
||||
|
||||
public static TransporterTier get(BaseTier tier) {
|
||||
for (TransporterTier transmitter : values()) {
|
||||
if (transmitter.getBaseTier() == tier) {
|
||||
return transmitter;
|
||||
}
|
||||
}
|
||||
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
pullAmount = Mekanism.configuration.get("tier", name + "TransporterPullAmount", basePull,
|
||||
"Item throughput rate of " + name + " logistical transporter in items/s.").getInt();
|
||||
speed = Mekanism.configuration.get("tier", name + "TransporterSpeed", baseSpeed,
|
||||
"Five times travel speed of " + name + " logistical transporter.").getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
pullAmount = dataStream.readInt();
|
||||
speed = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeInt(pullAmount);
|
||||
dataStream.writeInt(speed);
|
||||
}
|
||||
}
|
||||
|
||||
public enum ConductorTier implements ITier {
|
||||
BASIC(5, 1, 10, new ColourRGBA(0.2, 0.2, 0.2, 1)),
|
||||
ADVANCED(5, 1, 400, new ColourRGBA(0.2, 0.2, 0.2, 1)),
|
||||
ELITE(5, 1, 8000, new ColourRGBA(0.2, 0.2, 0.2, 1)),
|
||||
ULTIMATE(5, 1, 100000, new ColourRGBA(0.2, 0.2, 0.2, 1));
|
||||
|
||||
public double inverseConduction;
|
||||
public double inverseHeatCapacity;
|
||||
public double inverseConductionInsulation;
|
||||
public ColourRGBA baseColour;
|
||||
private double baseConduction;
|
||||
private double baseHeatCapacity;
|
||||
private double baseConductionInsulation;
|
||||
|
||||
ConductorTier(double inversek, double inverseC, double insulationInversek, ColourRGBA colour) {
|
||||
baseConduction = inverseConduction = inversek;
|
||||
baseHeatCapacity = inverseHeatCapacity = inverseC;
|
||||
baseConductionInsulation = inverseConductionInsulation = insulationInversek;
|
||||
|
||||
baseColour = colour;
|
||||
}
|
||||
|
||||
public static ConductorTier get(BaseTier tier) {
|
||||
for (ConductorTier transmitter : values()) {
|
||||
if (transmitter.getBaseTier() == tier) {
|
||||
return transmitter;
|
||||
}
|
||||
}
|
||||
|
||||
return BASIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
inverseConduction = Mekanism.configuration.get("tier", name + "ConductorInverseConduction", baseConduction,
|
||||
"Conduction value of " + name + " thermodynamic conductor.").getDouble();
|
||||
inverseHeatCapacity = Mekanism.configuration.get("tier", name + "ConductorHeatCapacity", baseHeatCapacity,
|
||||
"Heat capacity of " + name + " thermodynamic conductor.").getDouble();
|
||||
inverseConductionInsulation = Mekanism.configuration
|
||||
.get("tier", name + "ConductorConductionInsulation", baseConductionInsulation,
|
||||
"Insulation value of " + name + " thermodynamic conductor.").getDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
inverseConduction = dataStream.readDouble();
|
||||
inverseHeatCapacity = dataStream.readDouble();
|
||||
inverseConductionInsulation = dataStream.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeDouble(inverseConduction);
|
||||
dataStream.writeDouble(inverseHeatCapacity);
|
||||
dataStream.writeDouble(inverseConductionInsulation);
|
||||
}
|
||||
}
|
||||
|
||||
public enum FluidTankTier implements ITier {
|
||||
BASIC(14000, 400),
|
||||
ADVANCED(28000, 800),
|
||||
ELITE(56000, 1600),
|
||||
ULTIMATE(112000, 3200),
|
||||
CREATIVE(Integer.MAX_VALUE, Integer.MAX_VALUE / 2);
|
||||
|
||||
public int storage;
|
||||
public int output;
|
||||
private int baseStorage;
|
||||
private int baseOutput;
|
||||
|
||||
FluidTankTier(int s, int o) {
|
||||
baseStorage = storage = s;
|
||||
baseOutput = output = o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
storage = Mekanism.configuration.get("tier", name + "FluidTankStorage", baseStorage,
|
||||
"Storage size of " + name + " gas tank in mB.").getInt();
|
||||
output = Mekanism.configuration.get("tier", name + "FluidTankOutput", baseOutput,
|
||||
"Output rate of " + name + " gas tank in mB.").getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
storage = dataStream.readInt();
|
||||
output = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeInt(storage);
|
||||
dataStream.writeInt(output);
|
||||
}
|
||||
}
|
||||
|
||||
public enum GasTankTier implements ITier, IStringSerializable {
|
||||
BASIC(64000, 256),
|
||||
ADVANCED(128000, 512),
|
||||
ELITE(256000, 1028),
|
||||
ULTIMATE(512000, 2056),
|
||||
CREATIVE(Integer.MAX_VALUE, Integer.MAX_VALUE / 2);
|
||||
|
||||
public int storage;
|
||||
public int output;
|
||||
private int baseStorage;
|
||||
private int baseOutput;
|
||||
|
||||
GasTankTier(int s, int o) {
|
||||
baseStorage = storage = s;
|
||||
baseOutput = output = o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
storage = Mekanism.configuration.get("tier", name + "GasTankStorage", baseStorage,
|
||||
"Storage size of " + name + " gas tank in mB.").getInt();
|
||||
output = Mekanism.configuration.get("tier", name + "GasTankOutput", baseOutput,
|
||||
"Output rate of " + name + " gas tank in mB.").getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
storage = dataStream.readInt();
|
||||
output = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeInt(storage);
|
||||
dataStream.writeInt(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
public enum BinTier implements ITier {
|
||||
BASIC(4096),
|
||||
ADVANCED(8192),
|
||||
ELITE(32768),
|
||||
ULTIMATE(262144),
|
||||
CREATIVE(Integer.MAX_VALUE);
|
||||
|
||||
public int storage;
|
||||
private int baseStorage;
|
||||
|
||||
BinTier(int s) {
|
||||
baseStorage = storage = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier() {
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
String name = getBaseTier().getSimpleName();
|
||||
storage = Mekanism.configuration.get("tier", name + "BinStorage", baseStorage,
|
||||
"The number of items a " + name + " bin can store.").getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream) {
|
||||
storage = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream) {
|
||||
dataStream.writeInt(storage);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ITier {
|
||||
|
||||
BaseTier getBaseTier();
|
||||
|
||||
void loadConfig();
|
||||
|
||||
void readConfig(ByteBuf dataStream);
|
||||
|
||||
void writeConfig(ByteBuf dataStream);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -128,8 +128,8 @@ public enum Upgrade {
|
||||
List<String> ret = new ArrayList<>();
|
||||
|
||||
if (canMultiply()) {
|
||||
double effect = Math
|
||||
.pow(general.maxUpgradeMultiplier, (float) tile.getComponent().getUpgrades(this) / (float) getMax());
|
||||
double effect = Math.pow(MekanismConfig.current().general.maxUpgradeMultiplier.val(),
|
||||
(float) tile.getComponent().getUpgrades(this) / (float) getMax());
|
||||
|
||||
ret.add(LangUtils.localize("gui.upgrades.effect") + ": " + (Math.round(effect * 100) / 100F) + "x");
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.function.Function;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.energy.IStrictEnergyAcceptor;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.CapabilityUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.darkhax.tesla.api.ITeslaConsumer;
|
||||
@@ -121,11 +121,11 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor {
|
||||
}
|
||||
|
||||
public int toRF(double joules) {
|
||||
return (int) Math.round(joules * general.TO_RF);
|
||||
return (int) Math.round(joules * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
public double fromRF(int rf) {
|
||||
return rf * general.FROM_RF;
|
||||
return rf * MekanismConfig.current().general.FROM_RF.val();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,11 +156,11 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor {
|
||||
}
|
||||
|
||||
public double toEU(double joules) {
|
||||
return joules * general.TO_IC2;
|
||||
return joules * MekanismConfig.current().general.TO_IC2.val();
|
||||
}
|
||||
|
||||
public double fromEU(double eu) {
|
||||
return eu * general.FROM_IC2;
|
||||
return eu * MekanismConfig.current().general.FROM_IC2.val();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,11 +188,11 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor {
|
||||
}
|
||||
|
||||
public long toTesla(double joules) {
|
||||
return Math.round(joules * general.TO_TESLA);
|
||||
return Math.round(joules * MekanismConfig.current().general.TO_TESLA.val());
|
||||
}
|
||||
|
||||
public double fromTesla(double tesla) {
|
||||
return tesla * general.FROM_TESLA;
|
||||
return tesla * MekanismConfig.current().general.FROM_TESLA.val();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,11 +220,11 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor {
|
||||
}
|
||||
|
||||
public int toForge(double joules) {
|
||||
return (int) Math.round(joules * general.TO_FORGE);
|
||||
return (int) Math.round(joules * MekanismConfig.current().general.TO_FORGE.val());
|
||||
}
|
||||
|
||||
public double fromForge(double forge) {
|
||||
return forge * general.FROM_FORGE;
|
||||
return forge * MekanismConfig.current().general.FROM_FORGE.val();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package mekanism.common.base;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.common.Version;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
|
||||
/**
|
||||
* Implement in your main class if your mod happens to be completely reliant on Mekanism, or in other words, is a
|
||||
@@ -30,15 +31,17 @@ public interface IModule {
|
||||
* Writes this module's configuration to a ConfigSync packet.
|
||||
*
|
||||
* @param dataStream - the ByteBuf of the sync packet
|
||||
* @param config - the configuration to write
|
||||
*/
|
||||
void writeConfig(ByteBuf dataStream);
|
||||
void writeConfig(ByteBuf dataStream, MekanismConfig config);
|
||||
|
||||
/**
|
||||
* Reads this module's configuration from the original ConfigSync packet.
|
||||
*
|
||||
* @param dataStream - the incoming ByteBuf of the sync packet
|
||||
* @param destConfig - configuration to read to
|
||||
*/
|
||||
void readConfig(ByteBuf dataStream);
|
||||
void readConfig(ByteBuf dataStream, MekanismConfig destConfig);
|
||||
|
||||
/**
|
||||
* Called when the player returns to the main menu.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.common.base;
|
||||
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ITierItem {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.common.base;
|
||||
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
|
||||
public interface ITierUpgradeable {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import mekanism.api.IMekWrench;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBoundingBlock;
|
||||
import mekanism.common.base.ITierItem;
|
||||
@@ -481,7 +481,7 @@ public abstract class BlockBasic extends Block {
|
||||
}
|
||||
|
||||
if (!world.isRemote) {
|
||||
if (bin.getItemCount() < bin.tier.storage) {
|
||||
if (bin.getItemCount() < bin.tier.getStorage()) {
|
||||
if (bin.addTicks == 0) {
|
||||
if (!stack.isEmpty()) {
|
||||
ItemStack remain = bin.add(stack);
|
||||
@@ -492,7 +492,7 @@ public abstract class BlockBasic extends Block {
|
||||
NonNullList<ItemStack> inv = entityplayer.inventory.mainInventory;
|
||||
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if (bin.getItemCount() == bin.tier.storage) {
|
||||
if (bin.getItemCount() == bin.tier.getStorage()) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import mekanism.api.IMekWrench;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.tier.EnergyCubeTier;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.base.ITierItem;
|
||||
@@ -165,7 +165,7 @@ public class BlockEnergyCube extends BlockContainer {
|
||||
list.add(discharged);
|
||||
ItemStack charged = new ItemStack(this);
|
||||
((ItemBlockEnergyCube) charged.getItem()).setBaseTier(charged, tier.getBaseTier());
|
||||
((ItemBlockEnergyCube) charged.getItem()).setEnergy(charged, tier.maxEnergy);
|
||||
((ItemBlockEnergyCube) charged.getItem()).setEnergy(charged, tier.getMaxEnergy());
|
||||
list.add(charged);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import mekanism.api.IMekWrench;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.FluidTankTier;
|
||||
import mekanism.common.tier.FluidTankTier;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBoundingBlock;
|
||||
import mekanism.common.base.IFactory;
|
||||
@@ -24,7 +24,7 @@ import mekanism.common.block.states.BlockStateFacing;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineBlock;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.entangloporter.InventoryFrequency;
|
||||
import mekanism.common.integration.wrenches.Wrenches;
|
||||
import mekanism.common.item.ItemBlockMachine;
|
||||
@@ -252,7 +252,8 @@ public abstract class BlockMachine extends BlockContainer {
|
||||
return;
|
||||
}
|
||||
|
||||
if (MekanismUtils.isActive(world, pos) && ((IActiveState) tileEntity).renderUpdate() && client.machineEffects) {
|
||||
if (MekanismUtils.isActive(world, pos) && ((IActiveState) tileEntity).renderUpdate() && MekanismConfig
|
||||
.current().client.machineEffects.val()) {
|
||||
float xRandom = (float) pos.getX() + 0.5F;
|
||||
float yRandom = (float) pos.getY() + 0.0F + random.nextFloat() * 6.0F / 16.0F;
|
||||
float zRandom = (float) pos.getZ() + 0.5F;
|
||||
@@ -298,12 +299,12 @@ public abstract class BlockMachine extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
if (client.enableAmbientLighting) {
|
||||
if (MekanismConfig.current().client.enableAmbientLighting.val()) {
|
||||
TileEntity tileEntity = MekanismUtils.getTileEntitySafe(world, pos);
|
||||
if (tileEntity instanceof IActiveState &&
|
||||
((IActiveState) tileEntity).lightUpdate() &&
|
||||
((IActiveState) tileEntity).wasActiveRecently()) {
|
||||
return client.ambientLightingLevel;
|
||||
return MekanismConfig.current().client.ambientLightingLevel.val();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
|
||||
import mekanism.api.IMekWrench;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.common.block.property.PropertyConnection;
|
||||
import mekanism.common.block.states.BlockStateTransmitter;
|
||||
|
||||
@@ -7,7 +7,7 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.block.BlockBasic;
|
||||
import mekanism.common.tile.TileEntityBin;
|
||||
import mekanism.common.tile.TileEntityBoilerCasing;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.block.BlockEnergyCube;
|
||||
import mekanism.common.tier.EnergyCubeTier;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
|
||||
/**
|
||||
@@ -9,8 +9,8 @@ import net.minecraft.block.properties.PropertyEnum;
|
||||
*/
|
||||
public class BlockStateEnergyCube extends BlockStateFacing {
|
||||
|
||||
public static final PropertyEnum<Tier.EnergyCubeTier> typeProperty = PropertyEnum
|
||||
.create("tier", Tier.EnergyCubeTier.class);
|
||||
public static final PropertyEnum<EnergyCubeTier> typeProperty = PropertyEnum
|
||||
.create("tier", EnergyCubeTier.class);
|
||||
|
||||
public BlockStateEnergyCube(BlockEnergyCube block) {
|
||||
super(block, typeProperty);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.block.BlockGasTank;
|
||||
import mekanism.common.tier.GasTankTier;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
|
||||
/**
|
||||
@@ -9,8 +9,8 @@ import net.minecraft.block.properties.PropertyEnum;
|
||||
*/
|
||||
public class BlockStateGasTank extends BlockStateFacing {
|
||||
|
||||
public static final PropertyEnum<Tier.GasTankTier> typeProperty = PropertyEnum
|
||||
.create("tier", Tier.GasTankTier.class);
|
||||
public static final PropertyEnum<GasTankTier> typeProperty = PropertyEnum
|
||||
.create("tier", GasTankTier.class);
|
||||
|
||||
public BlockStateGasTank(BlockGasTank block) {
|
||||
super(block, typeProperty);
|
||||
|
||||
@@ -8,13 +8,12 @@ import java.util.Locale;
|
||||
import javax.annotation.Nonnull;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.base.IBlockType;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.block.BlockMachine;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig.usage;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.tier.FactoryTier;
|
||||
import mekanism.common.tile.TileEntityAdvancedFactory;
|
||||
import mekanism.common.tile.TileEntityAmbientAccumulator;
|
||||
import mekanism.common.tile.TileEntityChargepad;
|
||||
@@ -123,11 +122,11 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
DIGITAL_MINER(MachineBlock.MACHINE_BLOCK_1, 4, "DigitalMiner", 2, TileEntityDigitalMiner.class, true, true,
|
||||
true, Plane.HORIZONTAL, true),
|
||||
BASIC_FACTORY(MachineBlock.MACHINE_BLOCK_1, 5, "Factory", 11, TileEntityFactory.class, true, false, true,
|
||||
Plane.HORIZONTAL, true, Tier.FactoryTier.BASIC),
|
||||
Plane.HORIZONTAL, true, FactoryTier.BASIC),
|
||||
ADVANCED_FACTORY(MachineBlock.MACHINE_BLOCK_1, 6, "Factory", 11, TileEntityAdvancedFactory.class, true, false,
|
||||
true, Plane.HORIZONTAL, true, Tier.FactoryTier.ADVANCED),
|
||||
true, Plane.HORIZONTAL, true, FactoryTier.ADVANCED),
|
||||
ELITE_FACTORY(MachineBlock.MACHINE_BLOCK_1, 7, "Factory", 11, TileEntityEliteFactory.class, true, false, true,
|
||||
Plane.HORIZONTAL, true, Tier.FactoryTier.ELITE),
|
||||
Plane.HORIZONTAL, true, FactoryTier.ELITE),
|
||||
METALLURGIC_INFUSER(MachineBlock.MACHINE_BLOCK_1, 8, "MetallurgicInfuser", 12,
|
||||
TileEntityMetallurgicInfuser.class, true, true, true, Plane.HORIZONTAL, false),
|
||||
PURIFICATION_CHAMBER(MachineBlock.MACHINE_BLOCK_1, 9, "PurificationChamber", 15,
|
||||
@@ -202,7 +201,7 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
public boolean supportsUpgrades;
|
||||
public Predicate<EnumFacing> facingPredicate;
|
||||
public boolean activable;
|
||||
public Tier.FactoryTier factoryTier;
|
||||
public FactoryTier factoryTier;
|
||||
|
||||
MachineType(MachineBlock block, int i, String s, int j, Class<? extends TileEntity> tileClass, boolean electric,
|
||||
boolean model, boolean upgrades, Predicate<EnumFacing> predicate, boolean hasActiveTexture) {
|
||||
@@ -211,7 +210,7 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
|
||||
MachineType(MachineBlock block, int i, String s, int j, Class<? extends TileEntity> tileClass, boolean electric,
|
||||
boolean model, boolean upgrades, Predicate<EnumFacing> predicate, boolean hasActiveTexture,
|
||||
Tier.FactoryTier factoryTier) {
|
||||
FactoryTier factoryTier) {
|
||||
typeBlock = block;
|
||||
meta = i;
|
||||
blockName = s;
|
||||
@@ -225,16 +224,20 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
this.factoryTier = factoryTier;
|
||||
}
|
||||
|
||||
public static List<MachineType> getValidMachines() {
|
||||
private static final List<MachineType> VALID_MACHINES = new ArrayList<>();
|
||||
|
||||
static {
|
||||
List<MachineType> ret = new ArrayList<>();
|
||||
|
||||
for (MachineType type : MachineType.values()) {
|
||||
if (type.isValidMachine()) {
|
||||
ret.add(type);
|
||||
VALID_MACHINES.add(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
public static List<MachineType> getValidMachines() {
|
||||
return VALID_MACHINES;
|
||||
}
|
||||
|
||||
public static MachineType get(Block block, int meta) {
|
||||
@@ -272,7 +275,7 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return general.machinesManager.isEnabled(blockName);
|
||||
return MekanismConfig.current().general.machinesManager.isEnabled(this);
|
||||
}
|
||||
|
||||
public boolean isValidMachine() {
|
||||
@@ -295,25 +298,25 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
public double getUsage() {
|
||||
switch (this) {
|
||||
case ENRICHMENT_CHAMBER:
|
||||
return usage.enrichmentChamberUsage;
|
||||
return MekanismConfig.current().usage.enrichmentChamberUsage.val();
|
||||
case OSMIUM_COMPRESSOR:
|
||||
return usage.osmiumCompressorUsage;
|
||||
return MekanismConfig.current().usage.osmiumCompressorUsage.val();
|
||||
case COMBINER:
|
||||
return usage.combinerUsage;
|
||||
return MekanismConfig.current().usage.combinerUsage.val();
|
||||
case CRUSHER:
|
||||
return usage.crusherUsage;
|
||||
return MekanismConfig.current().usage.crusherUsage.val();
|
||||
case DIGITAL_MINER:
|
||||
return usage.digitalMinerUsage;
|
||||
return MekanismConfig.current().usage.digitalMinerUsage.val();
|
||||
case METALLURGIC_INFUSER:
|
||||
return usage.metallurgicInfuserUsage;
|
||||
return MekanismConfig.current().usage.metallurgicInfuserUsage.val();
|
||||
case PURIFICATION_CHAMBER:
|
||||
return usage.purificationChamberUsage;
|
||||
return MekanismConfig.current().usage.purificationChamberUsage.val();
|
||||
case ENERGIZED_SMELTER:
|
||||
return usage.energizedSmelterUsage;
|
||||
return MekanismConfig.current().usage.energizedSmelterUsage.val();
|
||||
case TELEPORTER:
|
||||
return 12500;
|
||||
case ELECTRIC_PUMP:
|
||||
return usage.electricPumpUsage;
|
||||
return MekanismConfig.current().usage.electricPumpUsage.val();
|
||||
case PERSONAL_CHEST:
|
||||
return 30;
|
||||
case CHARGEPAD:
|
||||
@@ -321,33 +324,33 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
case LOGISTICAL_SORTER:
|
||||
return 0;
|
||||
case ROTARY_CONDENSENTRATOR:
|
||||
return usage.rotaryCondensentratorUsage;
|
||||
return MekanismConfig.current().usage.rotaryCondensentratorUsage.val();
|
||||
case CHEMICAL_OXIDIZER:
|
||||
return usage.oxidationChamberUsage;
|
||||
return MekanismConfig.current().usage.oxidationChamberUsage.val();
|
||||
case CHEMICAL_INFUSER:
|
||||
return usage.chemicalInfuserUsage;
|
||||
return MekanismConfig.current().usage.chemicalInfuserUsage.val();
|
||||
case CHEMICAL_INJECTION_CHAMBER:
|
||||
return usage.chemicalInjectionChamberUsage;
|
||||
return MekanismConfig.current().usage.chemicalInjectionChamberUsage.val();
|
||||
case ELECTROLYTIC_SEPARATOR:
|
||||
return general.FROM_H2 * 2;
|
||||
return MekanismConfig.current().general.FROM_H2.val() * 2;
|
||||
case PRECISION_SAWMILL:
|
||||
return usage.precisionSawmillUsage;
|
||||
return MekanismConfig.current().usage.precisionSawmillUsage.val();
|
||||
case CHEMICAL_DISSOLUTION_CHAMBER:
|
||||
return usage.chemicalDissolutionChamberUsage;
|
||||
return MekanismConfig.current().usage.chemicalDissolutionChamberUsage.val();
|
||||
case CHEMICAL_WASHER:
|
||||
return usage.chemicalWasherUsage;
|
||||
return MekanismConfig.current().usage.chemicalWasherUsage.val();
|
||||
case CHEMICAL_CRYSTALLIZER:
|
||||
return usage.chemicalCrystallizerUsage;
|
||||
return MekanismConfig.current().usage.chemicalCrystallizerUsage.val();
|
||||
case SEISMIC_VIBRATOR:
|
||||
return usage.seismicVibratorUsage;
|
||||
return MekanismConfig.current().usage.seismicVibratorUsage.val();
|
||||
case PRESSURIZED_REACTION_CHAMBER:
|
||||
return usage.pressurizedReactionBaseUsage;
|
||||
return MekanismConfig.current().usage.pressurizedReactionBaseUsage.val();
|
||||
case FLUID_TANK:
|
||||
return 0;
|
||||
case FLUIDIC_PLENISHER:
|
||||
return usage.fluidicPlenisherUsage;
|
||||
return MekanismConfig.current().usage.fluidicPlenisherUsage.val();
|
||||
case LASER:
|
||||
return usage.laserUsage;
|
||||
return MekanismConfig.current().usage.laserUsage.val();
|
||||
case LASER_AMPLIFIER:
|
||||
return 0;
|
||||
case LASER_TRACTOR_BEAM:
|
||||
@@ -361,7 +364,7 @@ public class BlockStateMachine extends ExtendedBlockState {
|
||||
case RESISTIVE_HEATER:
|
||||
return 100;
|
||||
case FORMULAIC_ASSEMBLICATOR:
|
||||
return usage.formulaicAssemblicatorUsage;
|
||||
return MekanismConfig.current().usage.formulaicAssemblicatorUsage.val();
|
||||
default:
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.common.block.states;
|
||||
import java.util.Locale;
|
||||
import javax.annotation.Nonnull;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.block.BlockTransmitter;
|
||||
import mekanism.common.block.property.PropertyColor;
|
||||
import mekanism.common.block.property.PropertyConnection;
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mekanism.common.config.options.Option;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
public abstract class BaseConfig {
|
||||
|
||||
/**
|
||||
* No-op owner for making option fields not be null
|
||||
*/
|
||||
protected static BaseConfig NULL_OWNER = new BaseConfig() {
|
||||
@Override
|
||||
public void registerOption(Option option) {
|
||||
}
|
||||
};
|
||||
|
||||
private List<Option> options = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Registers an option to the save/load list. Should only be used by {@link Option}'s constructor
|
||||
*
|
||||
* @param option the option to add.
|
||||
*/
|
||||
public void registerOption(Option option) {
|
||||
options.add(option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all options from the config file NB: saving back is done automatically by the config system / GUIs
|
||||
*
|
||||
* @param config Configuration to save to
|
||||
*/
|
||||
public void load(Configuration config) {
|
||||
options.forEach(o -> o.load(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves all options to the network buffer
|
||||
*
|
||||
* @param config buffer to save to
|
||||
*/
|
||||
public void write(ByteBuf config) {
|
||||
options.forEach(o -> o.write(config));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads all options from the network buffer
|
||||
*
|
||||
* @param config buffer to read from
|
||||
*/
|
||||
public void read(ByteBuf config) {
|
||||
options.forEach(o -> o.read(config));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.common.config.options.BooleanOption;
|
||||
import mekanism.common.config.options.DoubleOption;
|
||||
import mekanism.common.config.options.IntOption;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
public class ClientConfig extends BaseConfig {
|
||||
|
||||
public final BooleanOption enablePlayerSounds = new BooleanOption(this, "client", "EnablePlayerSounds", true,
|
||||
"Play sounds for Jetpack/Gas Mask/Flamethrower (all players).");
|
||||
|
||||
public final BooleanOption enableMachineSounds = new BooleanOption(this, "client", "EnableMachineSounds", true,
|
||||
"If enabled machines play their sounds while running.");
|
||||
|
||||
public final BooleanOption holidays = new BooleanOption(this, "client", "Holidays", true,
|
||||
"Christmas/New Years greetings in chat.");
|
||||
|
||||
public final DoubleOption baseSoundVolume = new DoubleOption(this, "client", "SoundVolume", 1D,
|
||||
"Adjust Mekanism sounds' base volume. < 1 is softer, higher is louder.");
|
||||
|
||||
public final BooleanOption machineEffects = new BooleanOption(this, "client", "MachineEffects", true,
|
||||
"Show particles when machines active.");
|
||||
|
||||
public final BooleanOption enableAmbientLighting = new BooleanOption(this, "client", "EnableAmbientLighting", true,
|
||||
"Should active machines produce block light.");
|
||||
|
||||
public final IntOption ambientLightingLevel = new IntOption(this, "client", "AmbientLightingLevel", 15,
|
||||
"How much light to produce if ambient lighting is enabled.", 1, 15);
|
||||
|
||||
public final BooleanOption opaqueTransmitters = new BooleanOption(this, "client", "OpaqueTransmitterRender", false,
|
||||
"If true, don't render Cables/Pipes/Tubes as transparent and don't render their contents.");
|
||||
|
||||
public final BooleanOption allowConfiguratorModeScroll = new BooleanOption(this, "client", "ConfiguratorModeScroll",
|
||||
true, "Allow sneak+scroll to change Configurator modes.");
|
||||
|
||||
public final BooleanOption enableMultiblockFormationParticles = new BooleanOption(this, "client",
|
||||
"MultiblockFormParticles",
|
||||
true,
|
||||
"Set to false to prevent particle spam when loading multiblocks (notification message will still display).");
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf config) {
|
||||
throw new UnsupportedOperationException("Client config shouldn't be synced");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf config) {
|
||||
throw new UnsupportedOperationException("Client config shouldn't be synced");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.config.options.BooleanOption;
|
||||
import mekanism.common.config.options.DoubleOption;
|
||||
import mekanism.common.config.options.EnumOption;
|
||||
import mekanism.common.config.options.IntOption;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.util.UnitDisplayUtils.EnergyType;
|
||||
import mekanism.common.util.UnitDisplayUtils.TempType;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
public class GeneralConfig extends BaseConfig {
|
||||
|
||||
public final BooleanOption controlCircuitOreDict = new BooleanOption(this, "general", "ControlCircuitOreDict", true,
|
||||
"Enables recipes using Control Circuits to use OreDict'd Control Circuits from other mods.");
|
||||
|
||||
public final BooleanOption logPackets = new BooleanOption(this, "general", "LogPackets", false,
|
||||
"Log Mekanism packet names. Debug setting.");
|
||||
|
||||
public final BooleanOption dynamicTankEasterEgg = new BooleanOption(this, "general", "DynamicTankEasterEgg", false,
|
||||
"Audible sparkles.");
|
||||
|
||||
public final BooleanOption voiceServerEnabled = new BooleanOption(this, "general", "WalkieTalkieServerEnabled",
|
||||
true, "Enables the voice server for Walkie Talkies.");
|
||||
|
||||
public final BooleanOption cardboardSpawners = new BooleanOption(this, "general", "AllowSpawnerBoxPickup", true,
|
||||
"Allows vanilla spawners to be moved with a Cardboard Box.");
|
||||
|
||||
public final BooleanOption enableWorldRegeneration = new BooleanOption(this, "general", "EnableWorldRegeneration",
|
||||
false, "Allows chunks to retrogen Mekanism ore blocks.");
|
||||
|
||||
public final BooleanOption spawnBabySkeletons = new BooleanOption(this, "general", "SpawnBabySkeletons", true,
|
||||
"Enable the spawning of baby skeletons. Think baby zombies but skeletons.");
|
||||
|
||||
public final IntOption obsidianTNTDelay = new IntOption(this, "general", "ObsidianTNTDelay", 100,
|
||||
"Fuse time for Obsidian TNT.");
|
||||
|
||||
public final IntOption obsidianTNTBlastRadius = new IntOption(this, "general", "ObsidianTNTBlastRadius", 12,
|
||||
"Radius of the explosion of Obsidian TNT.");
|
||||
|
||||
public final IntOption UPDATE_DELAY = new IntOption(this, "general", "ClientUpdateDelay", 10,
|
||||
"How many ticks must pass until a block's active state can sync with the client.");
|
||||
|
||||
public final IntOption osmiumPerChunk = new IntOption(this, "general", "OsmiumPerChunk", 12,
|
||||
"Chance that osmium generates in a chunk. (0 to Disable)", 0, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption osmiumMaxVeinSize = new IntOption(this, "general", "OsmiumVeinSize", 8,
|
||||
"Max number of blocks in an osmium vein.", 1, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption copperPerChunk = new IntOption(this, "general", "CopperPerChunk", 16,
|
||||
"Chance that copper generates in a chunk. (0 to Disable)", 0, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption copperMaxVeinSize = new IntOption(this, "general", "CopperVeinSize", 8,
|
||||
"Max number of blocks in a copper vein.", 1, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption tinPerChunk = new IntOption(this, "general", "TinPerChunk", 14,
|
||||
"Chance that tin generates in a chunk. (0 to Disable)", 0, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption tinMaxVeinSize = new IntOption(this, "general", "TinVeinSize", 8,
|
||||
"Max number of blocks in a tin vein.", 1, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption saltPerChunk = new IntOption(this, "general", "SaltPerChunk", 2,
|
||||
"Chance that salt generates in a chunk. (0 to Disable)", 0, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption saltMaxVeinSize = new IntOption(this, "general", "SaltVeinSize", 6,
|
||||
"Max number of blocks in a salt vein.", 1, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption userWorldGenVersion = new IntOption(this, "general", "WorldRegenVersion", 0,
|
||||
"Change this value to cause Mekanism to regen its ore in all loaded chunks.");
|
||||
|
||||
public final DoubleOption FROM_IC2 = new DoubleOption(this, "general", "JoulesToEU", 10D,
|
||||
"Conversion multiplier from EU to Joules (EU * JoulesToEU = Joules)");
|
||||
|
||||
public final DoubleOption TO_IC2 = new DoubleOption(this, "general", "EUToJoules", .1D,
|
||||
"Conversion multiplier from Joules to EU (Joules * EUToJoules = EU)");
|
||||
|
||||
public final DoubleOption FROM_RF = new DoubleOption(this, "general", "JoulesToRF", 2.5D,
|
||||
"Conversion multiplier from RF to Joules (RF * JoulesToRF = Joules)");
|
||||
|
||||
public final DoubleOption TO_RF = new DoubleOption(this, "general", "RFToJoules", 0.4D,
|
||||
"Conversion multiplier from Joules to RF (Joules * RFToJoules = RF)");
|
||||
|
||||
public final DoubleOption FROM_TESLA = new DoubleOption(this, "general", "JoulesToTesla", 2.5D,
|
||||
"Conversion multiplier from Tesla to Joules (Tesla * JoulesToTesla = Joules)");
|
||||
|
||||
public final DoubleOption TO_TESLA = new DoubleOption(this, "general", "TeslaToJoules", 0.4D,
|
||||
"Conversion multiplier from Joules to Tesla (Joules * TeslaToJoules = Tesla)");
|
||||
|
||||
public final DoubleOption FROM_FORGE = new DoubleOption(this, "general", "JoulesToForge", 2.5D,
|
||||
"Conversion multiplier from Forge Energy to Joules (FE * JoulesToForge = Joules)");
|
||||
|
||||
public final DoubleOption TO_FORGE = new DoubleOption(this, "general", "ForgeToJoules", 0.4D,
|
||||
"Conversion multiplier from Joules to Forge Energy (Joules * ForgeToJoules = FE)");
|
||||
|
||||
public final DoubleOption FROM_H2 = new DoubleOption(this, "general", "HydrogenEnergyDensity", 200D,
|
||||
"How much energy is produced per mB of Hydrogen, also affects Electrolytic Separator usage, Ethylene burn rate and Gas generator energy capacity.");
|
||||
|
||||
public final IntOption ETHENE_BURN_TIME = new IntOption(this, "general", "EthyleneBurnTime", 40,
|
||||
"Burn time for Ethylene (1mB hydrogen + 2*bioFuel/tick*200ticks/100mB * 20x efficiency bonus).");
|
||||
|
||||
public final DoubleOption ENERGY_PER_REDSTONE = new DoubleOption(this, "general", "EnergyPerRedstone", 10000D,
|
||||
"How much energy (Joules) a piece of redstone gives in machines.");
|
||||
|
||||
public final IntOption DISASSEMBLER_USAGE = new IntOption(this, "general", "DisassemblerEnergyUsage", 10,
|
||||
"Base Energy (Joules) usage of the Atomic Disassembler. (Gets multiplied by speed factor)");
|
||||
|
||||
public final IntOption VOICE_PORT = new IntOption(this, "general", "VoicePort", 36123,
|
||||
"TCP port for the Voice server to listen on.", 1, 65535);
|
||||
|
||||
//If this is less than 1, upgrades make machines worse. If less than 0, I don't even know.
|
||||
public final IntOption maxUpgradeMultiplier = new IntOption(this, "general", "UpgradeModifier", 10,
|
||||
"Base factor for working out machine performance with upgrades - UpgradeModifier * (UpgradesInstalled/UpgradesPossible).",
|
||||
1, Integer.MAX_VALUE);
|
||||
|
||||
public final IntOption minerSilkMultiplier = new IntOption(this, "general", "MinerSilkMultiplier", 6,
|
||||
"Energy multiplier for using silk touch mode with the Digital Miner.");
|
||||
|
||||
public final BooleanOption prefilledGasTanks = new BooleanOption(this, "general", "PrefilledGasTanks", true,
|
||||
"Add filled creative gas tanks to creative/JEI.");
|
||||
|
||||
public final DoubleOption armoredJetpackDamageRatio = new DoubleOption(this, "general", "ArmoredJetpackDamageRatio",
|
||||
0.8, "Damage absorb ratio of the Armored Jetpack.");
|
||||
|
||||
public final IntOption armoredJetpackDamageMax = new IntOption(this, "general", "ArmoredJepackDamageMax", 115,
|
||||
"Max damage the Armored Jetpack can absorb.");
|
||||
|
||||
public final BooleanOption aestheticWorldDamage = new BooleanOption(this, "general", "AestheticWorldDamage", true,
|
||||
"If enabled, lasers can break blocks and the flamethrower starts fires.");
|
||||
|
||||
public final BooleanOption opsBypassRestrictions = new BooleanOption(this, "general", "OpsBypassRestrictions",
|
||||
false, "Ops can bypass the block security restrictions if enabled.");
|
||||
|
||||
public final IntOption maxJetpackGas = new IntOption(this, "general", "MaxJetpackGas", 24000,
|
||||
"Jetpack Gas Tank capacity in mB.");
|
||||
|
||||
public final IntOption maxScubaGas = new IntOption(this, "general", "MaxScubaGas", 24000,
|
||||
"Scuba Tank Gas Tank capacity in mB.");
|
||||
|
||||
public final IntOption maxFlamethrowerGas = new IntOption(this, "general", "MaxFlamethrowerGas", 24000,
|
||||
"Flamethrower Gas Tank capacity in mB.");
|
||||
|
||||
public final IntOption maxPumpRange = new IntOption(this, "general", "MaxPumpRange", 80,
|
||||
"Maximum block distance to pull fluid from for the Electric Pump.");
|
||||
|
||||
public final BooleanOption pumpWaterSources = new BooleanOption(this, "general", "PumpWaterSources", false,
|
||||
"If enabled makes Water and Heavy Water blocks be removed from the world on pump.");
|
||||
|
||||
public final IntOption maxPlenisherNodes = new IntOption(this, "general", "MaxPlenisherNodes", 4000,
|
||||
"Fluidic Plenisher stops after this many blocks.");
|
||||
|
||||
public final DoubleOption evaporationHeatDissipation = new DoubleOption(this, "general",
|
||||
"EvaporationHeatDissipation", 0.02D, "Thermal Evaporation Tower heat loss per tick.");
|
||||
|
||||
public final DoubleOption evaporationTempMultiplier = new DoubleOption(this, "general", "EvaporationTempMultiplier",
|
||||
0.1D, "Temperature to amount produced ratio for Thermal Evaporation Tower.");
|
||||
|
||||
public final DoubleOption evaporationSolarMultiplier = new DoubleOption(this, "general",
|
||||
"EvaporationSolarMultiplier", 0.2D, "Heat to absorb per Solar Panel array of Thermal Evaporation Tower.");
|
||||
|
||||
public final DoubleOption evaporationMaxTemp = new DoubleOption(this, "general", "EvaporationMaxTemp", 3000D,
|
||||
"Max Temperature of the Thermal Evaporation Tower.");
|
||||
|
||||
public final DoubleOption energyPerHeat = new DoubleOption(this, "general", "EnergyPerHeat", 1000D,
|
||||
"Joules required by the Resistive Heater to produce one unit of heat. Also affects Thermoelectric Boiler's Water->Steam rate.");
|
||||
|
||||
public final DoubleOption maxEnergyPerSteam = new DoubleOption(this, "general", "MaxEnergyPerSteam", 100D,
|
||||
"Maximum Joules per mB of Steam. Also affects Thermoelectric Boiler.");
|
||||
|
||||
public final DoubleOption superheatingHeatTransfer = new DoubleOption(this, "general", "SuperheatingHeatTransfer",
|
||||
10000D, "Amount of heat each Boiler heating element produces.");
|
||||
|
||||
public final DoubleOption heatPerFuelTick = new DoubleOption(this, "general", "HeatPerFuelTick", 4D,
|
||||
"Amount of heat produced per fuel tick of a fuel's burn time in the Fuelwood Heater.");
|
||||
|
||||
public final BooleanOption allowTransmitterAlloyUpgrade = new BooleanOption(this, "general",
|
||||
"AllowTransmitterAlloyUpgrade", true,
|
||||
"Allow right clicking on Cables/Pipes/Tubes with alloys to upgrade the tier.");
|
||||
|
||||
public final BooleanOption allowChunkloading = new BooleanOption(this, "general", "AllowChunkloading", true,
|
||||
"Disable to make the anchor upgrade not do anything.");
|
||||
|
||||
public final BooleanOption allowProtection = new BooleanOption(this, "general", "AllowProtection", true,
|
||||
"Enable the security system for players to prevent others from accessing their machines. Does NOT affect Frequencies.");
|
||||
|
||||
public final IntOption portableTeleporterDelay = new IntOption(this, "general", "PortableTeleporterDelay", 0,
|
||||
"Delay in ticks before a player is teleported after clicking the Teleport button in the portable teleporter.");
|
||||
|
||||
public final DoubleOption quantumEntangloporterEnergyTransfer = new DoubleOption(this, "general",
|
||||
"QuantumEntangloporterEnergyTransfer", 16000000D, "Maximum buffer of an Entangoloporter frequency.");
|
||||
|
||||
public final BooleanOption blacklistIC2 = new BooleanOption(this, "general", "BlacklistIC2Power", false,
|
||||
"Disables IC2 power integration. Requires world restart (server-side option in SMP).");
|
||||
|
||||
public final BooleanOption blacklistRF = new BooleanOption(this, "general", "BlacklistRFPower", false,
|
||||
"Disables Thermal Expansion RedstoneFlux power integration. Requires world restart (server-side option in SMP).");
|
||||
|
||||
public final BooleanOption blacklistTesla = new BooleanOption(this, "general", "BlacklistTeslaPower", false,
|
||||
"Disables Tesla power integration. Requires world restart (server-side option in SMP).");
|
||||
|
||||
public final BooleanOption blacklistForge = new BooleanOption(this, "general", "BlacklistForgePower", false,
|
||||
"Disables Forge Energy (FE,IF,uF,CF) power integration. Requires world restart (server-side option in SMP).");
|
||||
|
||||
public EnumOption<EnergyType> energyUnit = new EnumOption<>(this, "general", "EnergyType",
|
||||
EnergyType.RF, "Displayed energy type in Mekanism GUIs.");
|
||||
|
||||
public EnumOption<TempType> tempUnit = new EnumOption<>(this, "general", "Temperature Units",
|
||||
TempType.K, "Displayed temperature unit in Mekanism GUIs.");
|
||||
|
||||
public final IntOption laserRange = new IntOption(this, "general", "LaserRange", 64,
|
||||
"How far (in blocks) a laser can travel.");
|
||||
|
||||
public final IntOption laserEnergyNeededPerHardness = new IntOption(this, "general", "LaserDiggingEnergy", 100000,
|
||||
"Energy needed to destroy or attract blocks with a Laser (per block hardness level).");
|
||||
|
||||
public final BooleanOption destroyDisabledBlocks = new BooleanOption(this, "general", "DestroyDisabledBlocks", true,
|
||||
"If machine is disabled in config, do we set its block to air if it is found in world?");
|
||||
|
||||
public final IntOption digitalMinerMaxRadius = new IntOption(this, "general", "digitalMinerMaxRadius", 32,
|
||||
"Maximum radius in blocks that the Digital Miner can reach. "
|
||||
+ "(Increasing this may have negative effects on stability and/or performance. "
|
||||
+ "We strongly recommend you leave it at the default value.)", 1, Integer.MAX_VALUE);
|
||||
|
||||
public final DoubleOption sawdustChancePlank = new DoubleOption(this, "general", "SawdustChancePlank", 0.25D,
|
||||
"Chance of producing sawdust per operation in the precision sawmill when turning planks into sticks.")
|
||||
.setRequiresGameRestart(true);
|
||||
|
||||
public final DoubleOption sawdustChanceLog = new DoubleOption(this, "general", "SawdustChanceLog", 1D,
|
||||
"Chance of producing sawdust per operation in the precision sawmill when turning logs into planks.")
|
||||
.setRequiresGameRestart(true);
|
||||
|
||||
public final TypeConfigManager<BlockStateMachine.MachineType> machinesManager = new TypeConfigManager<>(this,
|
||||
"machines", BlockStateMachine.MachineType.class, BlockStateMachine.MachineType::getValidMachines,
|
||||
t -> t.blockName);
|
||||
|
||||
public final EnumMap<BaseTier, TierConfig> tiers = TierConfig.create(this);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.common.config.options.DoubleOption;
|
||||
import mekanism.common.config.options.IntOption;
|
||||
import mekanism.common.config.options.IntSetOption;
|
||||
import mekanism.generators.common.block.states.BlockStateGenerator;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
public class GeneratorsConfig extends BaseConfig {
|
||||
|
||||
public final DoubleOption advancedSolarGeneration = new DoubleOption(this, "generation", "AdvancedSolarGeneration",
|
||||
300D,
|
||||
"Peak output for the Advanced Solar Generator. Note: It can go higher than this value in some extreme environments.");
|
||||
|
||||
public final DoubleOption bioGeneration = new DoubleOption(this, "generation", "BioGeneration", 350D,
|
||||
"Amount of energy in Joules the Bio Generator produces per tick.");
|
||||
|
||||
public final DoubleOption heatGeneration = new DoubleOption(this, "generation", "HeatGeneration", 150D,
|
||||
"Amount of energy in Joules the Heat Generator produces per tick. (heatGenerationLava * heatGenerationLava) + heatGenerationNether");
|
||||
|
||||
public final DoubleOption heatGenerationLava = new DoubleOption(this, "generation", "HeatGenerationLava", 5D,
|
||||
"Multiplier of effectiveness of Lava in the Heat Generator.");
|
||||
|
||||
public final DoubleOption heatGenerationNether = new DoubleOption(this, "generation", "HeatGenerationNether", 100D,
|
||||
"Add this amount of Joules to the energy produced by a heat generator if it is in the Nether.");
|
||||
|
||||
public final DoubleOption solarGeneration = new DoubleOption(this, "generation", "SolarGeneration", 50D,
|
||||
"Peak output for the Solar Generator. Note: It can go higher than this value in some extreme environments.");
|
||||
|
||||
public final IntOption turbineBladesPerCoil = new IntOption(this, "generation", "TurbineBladesPerCoil", 4,
|
||||
"The number of blades on each turbine coil per blade applied.");
|
||||
|
||||
public final DoubleOption turbineVentGasFlow = new DoubleOption(this, "generation", "TurbineVentGasFlow", 16000D,
|
||||
"The rate at which steam is vented into the turbine.");
|
||||
|
||||
public final DoubleOption turbineDisperserGasFlow = new DoubleOption(this, "generation", "TurbineDisperserGasFlow",
|
||||
640D, "The rate at which steam is dispersed into the turbine.");
|
||||
|
||||
public final IntOption condenserRate = new IntOption(this, "generation", "TurbineCondenserFlowRate", 32000,
|
||||
"The rate at which steam is condensed in the turbine.");
|
||||
|
||||
public final DoubleOption energyPerFusionFuel = new DoubleOption(this, "generation", "EnergyPerFusionFuel", 5E6D,
|
||||
"Affects the Injection Rate, Max Temp, and Ignition Temp.");
|
||||
|
||||
public final DoubleOption windGenerationMin = new DoubleOption(this, "generation", "WindGenerationMin", 60D,
|
||||
"Minimum base generation value of the Wind Generator.");
|
||||
|
||||
public final DoubleOption windGenerationMax = new DoubleOption(this, "generation", "WindGenerationMax", 480D,
|
||||
"Maximum base generation value of the Wind Generator.");
|
||||
|
||||
public final IntOption windGenerationMinY = new IntOption(this, "generation", "WindGenerationMinY", 24,
|
||||
"The minimum Y value that affects the Wind Generators Power generation.");
|
||||
|
||||
public final IntOption windGenerationMaxY = new IntOption(this, "generation", "WindGenerationMaxY", 255,
|
||||
"The maximum Y value that affects the Wind Generators Power generation.");
|
||||
|
||||
public final IntSetOption windGenerationDimBlacklist = new IntSetOption(this, "generation",
|
||||
"WindGenerationDimBlacklist", new int[0],
|
||||
"The list of dimension ids that the Wind Generator will not generate power in.");
|
||||
|
||||
public TypeConfigManager<BlockStateGenerator.GeneratorType> generatorsManager = new TypeConfigManager<>(this,
|
||||
"generators", BlockStateGenerator.GeneratorType.class,
|
||||
BlockStateGenerator.GeneratorType::getGeneratorsForConfig, t -> t.blockName);
|
||||
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
super.load(config);
|
||||
validate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf config) {
|
||||
super.read(config);
|
||||
validate();
|
||||
}
|
||||
|
||||
private void validate() {
|
||||
//ensure windGenerationMaxY is > windGenerationMinY
|
||||
windGenerationMaxY.set(Math.max(windGenerationMinY.val() + 1, windGenerationMaxY.val()));
|
||||
}
|
||||
}
|
||||
@@ -1,160 +1,45 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import java.util.Set;
|
||||
import mekanism.common.util.UnitDisplayUtils.EnergyType;
|
||||
import mekanism.common.util.UnitDisplayUtils.TempType;
|
||||
import javax.annotation.Nullable;
|
||||
import mekanism.generators.common.MekanismGenerators;
|
||||
import mekanism.tools.common.MekanismTools;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
public class MekanismConfig {
|
||||
|
||||
public static class general {
|
||||
private static MekanismConfig LOCAL = new MekanismConfig();
|
||||
private static MekanismConfig SERVER = null;
|
||||
|
||||
public static TypeConfigManager machinesManager = new TypeConfigManager();
|
||||
|
||||
public static boolean controlCircuitOreDict = true;
|
||||
public static boolean logPackets = false;
|
||||
public static boolean dynamicTankEasterEgg = false;
|
||||
public static boolean voiceServerEnabled = false;
|
||||
public static boolean cardboardSpawners = true;
|
||||
public static boolean enableWorldRegeneration = true;
|
||||
public static boolean spawnBabySkeletons = true;
|
||||
public static int obsidianTNTBlastRadius = 12;
|
||||
public static int osmiumPerChunk = 12;
|
||||
public static int osmiumMaxVeinSize = 8;
|
||||
public static int copperPerChunk = 16;
|
||||
public static int copperMaxVeinSize = 8;
|
||||
public static int tinPerChunk = 14;
|
||||
public static int tinMaxVeinSize = 8;
|
||||
public static int saltPerChunk = 2;
|
||||
public static int saltMaxVeinSize = 6;
|
||||
public static int obsidianTNTDelay = 100;
|
||||
public static int UPDATE_DELAY = 10;
|
||||
public static int VOICE_PORT = 36123;
|
||||
public static int maxUpgradeMultiplier = 10;
|
||||
public static int userWorldGenVersion = 0;
|
||||
public static double ENERGY_PER_REDSTONE = 10000;
|
||||
public static int ETHENE_BURN_TIME = 40;
|
||||
public static double DISASSEMBLER_USAGE = 10;
|
||||
public static EnergyType energyUnit = EnergyType.J;
|
||||
public static TempType tempUnit = TempType.K;
|
||||
public static double TO_IC2 = 0.1;
|
||||
public static double TO_RF = 0.4;
|
||||
public static double TO_TESLA = 0.4;
|
||||
public static double TO_FORGE = 0.4;
|
||||
public static double FROM_H2 = 200;
|
||||
public static double FROM_IC2 = 10;
|
||||
public static double FROM_RF = 2.5;
|
||||
public static double FROM_TESLA = 2.5;
|
||||
public static double FROM_FORGE = 2.5;
|
||||
public static int laserRange = 64;
|
||||
public static double laserEnergyNeededPerHardness = 100000;
|
||||
public static double minerSilkMultiplier = 6;
|
||||
public static boolean blacklistIC2 = false;
|
||||
public static boolean blacklistRF = false;
|
||||
public static boolean blacklistTesla = false;
|
||||
public static boolean blacklistForge = false;
|
||||
public static boolean destroyDisabledBlocks = true;
|
||||
public static int digitalMinerMaxRadius = 32;
|
||||
public static boolean prefilledGasTanks = true;
|
||||
public static double armoredJetpackDamageRatio = 0.8;
|
||||
public static int armoredJetpackDamageMax = 115;
|
||||
public static boolean aestheticWorldDamage = true;
|
||||
public static boolean opsBypassRestrictions = false;
|
||||
public static int maxJetpackGas = 24000;
|
||||
public static int maxScubaGas = 24000;
|
||||
public static int maxFlamethrowerGas = 24000;
|
||||
public static int maxPumpRange = 80;
|
||||
public static boolean pumpWaterSources = false;
|
||||
public static int maxPlenisherNodes = 4000;
|
||||
public static double evaporationHeatDissipation = 0.02;
|
||||
public static double evaporationTempMultiplier = 0.1;
|
||||
public static double evaporationSolarMultiplier = 0.2;
|
||||
public static double evaporationMaxTemp = 3000;
|
||||
public static double energyPerHeat = 1000;
|
||||
public static double maxEnergyPerSteam = 100;
|
||||
public static double superheatingHeatTransfer = 10000;
|
||||
public static double heatPerFuelTick = 4;
|
||||
public static boolean allowTransmitterAlloyUpgrade = true;
|
||||
public static boolean allowChunkloading = true;
|
||||
public static boolean allowProtection = true;
|
||||
public static int portableTeleporterDelay = 0;
|
||||
public static double quantumEntangloporterEnergyTransfer = 16000000;
|
||||
public static double sawdustChancePlank = 0.25;
|
||||
public static double sawdustChanceLog = 1;
|
||||
/**
|
||||
* Current config, for use when querying the config
|
||||
*
|
||||
* @return when connected to a server, SERVER, otherwise LOCAL.
|
||||
*/
|
||||
public static MekanismConfig current() {
|
||||
return SERVER != null ? SERVER : LOCAL;
|
||||
}
|
||||
|
||||
public static class client {
|
||||
|
||||
public static boolean enablePlayerSounds = true;
|
||||
public static boolean enableMachineSounds = true;
|
||||
public static boolean holidays = true;//Was going to remove?
|
||||
public static float baseSoundVolume = 1F;
|
||||
public static boolean machineEffects = true;
|
||||
public static boolean enableAmbientLighting;
|
||||
public static int ambientLightingLevel = 15;
|
||||
public static boolean opaqueTransmitters = false;
|
||||
public static boolean allowConfiguratorModeScroll = true;
|
||||
public static boolean enableMultiblockFormationParticles = true;
|
||||
/**
|
||||
* Local config, mainly for the config GUI
|
||||
*
|
||||
* @return LOCAL
|
||||
*/
|
||||
public static MekanismConfig local() {
|
||||
return LOCAL;
|
||||
}
|
||||
|
||||
public static class usage {
|
||||
|
||||
public static double enrichmentChamberUsage = 50;
|
||||
public static double osmiumCompressorUsage = 100;
|
||||
public static double combinerUsage = 50;
|
||||
public static double crusherUsage = 50;
|
||||
public static double metallurgicInfuserUsage = 50;
|
||||
public static double purificationChamberUsage = 200;
|
||||
public static double energizedSmelterUsage = 50;
|
||||
public static double digitalMinerUsage = 100;
|
||||
public static double electricPumpUsage = 100;
|
||||
public static double rotaryCondensentratorUsage = 50;
|
||||
public static double oxidationChamberUsage = 200;
|
||||
public static double chemicalInfuserUsage = 200;
|
||||
public static double chemicalInjectionChamberUsage = 400;
|
||||
public static double precisionSawmillUsage = 50;
|
||||
public static double chemicalDissolutionChamberUsage = 400;
|
||||
public static double chemicalWasherUsage = 200;
|
||||
public static double chemicalCrystallizerUsage = 400;
|
||||
public static double seismicVibratorUsage = 50;
|
||||
public static double pressurizedReactionBaseUsage = 5;
|
||||
public static double fluidicPlenisherUsage = 100;
|
||||
public static double laserUsage = 5000;
|
||||
public static double heavyWaterElectrolysisUsage = 800;
|
||||
public static double formulaicAssemblicatorUsage = 100;
|
||||
public static int teleporterBaseUsage = 1000;
|
||||
public static int teleporterDistanceUsage = 10;
|
||||
public static int teleporterDimensionPenalty = 10000;
|
||||
public static void setSyncedConfig(@Nullable MekanismConfig newConfig) {
|
||||
if (newConfig != null) {
|
||||
newConfig.client = LOCAL.client;
|
||||
}
|
||||
SERVER = newConfig;
|
||||
}
|
||||
|
||||
public static class generators {
|
||||
public GeneralConfig general = new GeneralConfig();
|
||||
public ClientConfig client = new ClientConfig();
|
||||
public UsageConfig usage = new UsageConfig();
|
||||
|
||||
public static TypeConfigManager generatorsManager = new TypeConfigManager();
|
||||
public GeneratorsConfig generators = Loader.isModLoaded(MekanismGenerators.MODID) ? new GeneratorsConfig() : null;
|
||||
|
||||
public static double advancedSolarGeneration = 300;
|
||||
public static double bioGeneration = 350;
|
||||
public static double heatGeneration = 150;
|
||||
public static double heatGenerationLava = 5;
|
||||
public static double heatGenerationNether = 100;
|
||||
public static double solarGeneration = 50;
|
||||
|
||||
public static double windGenerationMin = 60;
|
||||
public static double windGenerationMax = 480;
|
||||
|
||||
public static int windGenerationMinY = 24;
|
||||
public static int windGenerationMaxY = 255;
|
||||
|
||||
public static Set<Integer> windGenerationDimBlacklist;
|
||||
|
||||
public static int turbineBladesPerCoil = 4;
|
||||
public static double turbineVentGasFlow = 16000;
|
||||
public static double turbineDisperserGasFlow = 640;
|
||||
public static int condenserRate = 32000;
|
||||
|
||||
public static double energyPerFusionFuel = 5E6;
|
||||
}
|
||||
|
||||
public static class tools {
|
||||
|
||||
public static double armorSpawnRate = 0.03;
|
||||
}
|
||||
public ToolsConfig tools = Loader.isModLoaded(MekanismTools.MODID) ? new ToolsConfig() : null;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import mekanism.common.config.options.DoubleOption;
|
||||
import mekanism.common.config.options.IntOption;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.tier.BinTier;
|
||||
import mekanism.common.tier.CableTier;
|
||||
import mekanism.common.tier.ConductorTier;
|
||||
import mekanism.common.tier.EnergyCubeTier;
|
||||
import mekanism.common.tier.FluidTankTier;
|
||||
import mekanism.common.tier.GasTankTier;
|
||||
import mekanism.common.tier.InductionCellTier;
|
||||
import mekanism.common.tier.InductionProviderTier;
|
||||
import mekanism.common.tier.PipeTier;
|
||||
import mekanism.common.tier.TransporterTier;
|
||||
import mekanism.common.tier.TubeTier;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 16/03/2019.
|
||||
*/
|
||||
public class TierConfig {
|
||||
|
||||
public static EnumMap<BaseTier, TierConfig> create(BaseConfig baseConfig) {
|
||||
EnumMap<BaseTier, TierConfig> map = new EnumMap<>(BaseTier.class);
|
||||
|
||||
for (BaseTier baseTier : BaseTier.values()) {
|
||||
map.put(baseTier, new TierConfig(baseConfig, baseTier));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public final DoubleOption EnergyCubeMaxEnergy;
|
||||
public final DoubleOption EnergyCubeOutput;
|
||||
public final DoubleOption InductionCellMaxEnergy;
|
||||
public final DoubleOption InductionProviderOutput;
|
||||
public final IntOption CableCapacity;
|
||||
public final IntOption PipeCapacity;
|
||||
public final IntOption PipePullAmount;
|
||||
public final IntOption TubeCapacity;
|
||||
public final IntOption TubePullAmount;
|
||||
public final IntOption TransporterPullAmount;
|
||||
public final IntOption TransporterSpeed;
|
||||
public final DoubleOption ConductorInverseConduction;
|
||||
public final DoubleOption ConductorHeatCapacity;
|
||||
public final DoubleOption ConductorConductionInsulation;
|
||||
public final IntOption FluidTankStorage;
|
||||
public final IntOption FluidTankOutput;
|
||||
public final IntOption GasTankStorage;
|
||||
public final IntOption GasTankOutput;
|
||||
public final IntOption BinStorage;
|
||||
|
||||
private TierConfig(BaseConfig baseConfig, BaseTier tier) {
|
||||
String name = tier.getSimpleName();
|
||||
EnergyCubeMaxEnergy = new DoubleOption(baseConfig, "tier", name + "EnergyCubeMaxEnergy",
|
||||
EnergyCubeTier.values()[tier.ordinal()].getBaseMaxEnergy(),
|
||||
"Maximum number of Joules a " + name + " energy cube can store.");
|
||||
EnergyCubeOutput = new DoubleOption(baseConfig, "tier", name + "EnergyCubeOutput",
|
||||
EnergyCubeTier.values()[tier.ordinal()].getBaseOutput(),
|
||||
"Output rate in Joules of a " + name + " energy cube.");
|
||||
FluidTankStorage = new IntOption(baseConfig, "tier", name + "FluidTankStorage",
|
||||
FluidTankTier.values()[tier.ordinal()].getBaseStorage(),
|
||||
"Storage size of " + name + " gas tank in mB.");
|
||||
FluidTankOutput = new IntOption(baseConfig, "tier", name + "FluidTankOutput",
|
||||
FluidTankTier.values()[tier.ordinal()].getBaseOutput(),
|
||||
"Output rate of " + name + " gas tank in mB.");
|
||||
GasTankStorage = new IntOption(baseConfig, "tier", name + "GasTankStorage",
|
||||
GasTankTier.values()[tier.ordinal()].getBaseStorage(),
|
||||
"Storage size of " + name + " gas tank in mB.");
|
||||
GasTankOutput = new IntOption(baseConfig, "tier", name + "GasTankOutput",
|
||||
GasTankTier.values()[tier.ordinal()].getBaseOutput(), "Output rate of " + name + " gas tank in mB.");
|
||||
BinStorage = new IntOption(baseConfig, "tier", name + "BinStorage",
|
||||
BinTier.values()[tier.ordinal()].getBaseStorage(),
|
||||
"The number of items a " + name + " bin can store.");
|
||||
if (tier != BaseTier.CREATIVE) {
|
||||
InductionCellMaxEnergy = new DoubleOption(baseConfig, "tier", name + "InductionCellMaxEnergy",
|
||||
InductionCellTier.values()[tier.ordinal()].getBaseMaxEnergy(),
|
||||
"Maximum number of Joules a " + name + " induction cell can store.");
|
||||
InductionProviderOutput = new DoubleOption(baseConfig, "tier", name + "InductionProviderOutput",
|
||||
InductionProviderTier.values()[tier.ordinal()].getBaseOutput(),
|
||||
"Maximum number of Joules a " + name + " induction provider can output or accept.");
|
||||
CableCapacity = new IntOption(baseConfig, "tier", name + "CableCapacity",
|
||||
CableTier.values()[tier.ordinal()].getBaseCapacity(),
|
||||
"Internal buffer in Joules of each " + name + " universal cable.");
|
||||
PipeCapacity = new IntOption(baseConfig, "tier", name + "PipeCapacity",
|
||||
PipeTier.values()[tier.ordinal()].getBaseCapacity(),
|
||||
"Capacity of " + name + " mechanical pipe in mB.");
|
||||
PipePullAmount = new IntOption(baseConfig, "tier", name + "PipePullAmount",
|
||||
PipeTier.values()[tier.ordinal()].getBasePull(),
|
||||
"Pump rate of " + name + " mechanical pipe in mB/t.");
|
||||
TubeCapacity = new IntOption(baseConfig, "tier", name + "TubeCapacity",
|
||||
TubeTier.values()[tier.ordinal()].getBaseCapacity(),
|
||||
"Capacity of " + name + " pressurized tube in mB.");
|
||||
TubePullAmount = new IntOption(baseConfig, "tier", name + "TubePullAmount",
|
||||
TubeTier.values()[tier.ordinal()].getBasePull(),
|
||||
"Pump rate of " + name + " pressurized tube in mB/t.");
|
||||
TransporterPullAmount = new IntOption(baseConfig, "tier", name + "TransporterPullAmount",
|
||||
TransporterTier.values()[tier.ordinal()].getBasePull(),
|
||||
"Item throughput rate of " + name + " logistical transporter in items/s.");
|
||||
TransporterSpeed = new IntOption(baseConfig, "tier", name + "TransporterSpeed",
|
||||
TransporterTier.values()[tier.ordinal()].getBaseSpeed(),
|
||||
"Five times travel speed of " + name + " logistical transporter.");
|
||||
ConductorInverseConduction = new DoubleOption(baseConfig, "tier",
|
||||
name + "ConductorInverseConduction",
|
||||
ConductorTier.values()[tier.ordinal()].getBaseConduction(),
|
||||
"Conduction value of " + name + " thermodynamic conductor.");
|
||||
ConductorHeatCapacity = new DoubleOption(baseConfig, "tier", name + "ConductorHeatCapacity",
|
||||
ConductorTier.values()[tier.ordinal()].getBaseHeatCapacity(),
|
||||
"Heat capacity of " + name + " thermodynamic conductor.");
|
||||
ConductorConductionInsulation = new DoubleOption(baseConfig, "tier",
|
||||
name + "ConductorConductionInsulation",
|
||||
ConductorTier.values()[tier.ordinal()].getBaseConductionInsulation(),
|
||||
"Insulation value of " + name + " thermodynamic conductor.");
|
||||
|
||||
} else {
|
||||
InductionCellMaxEnergy = null;
|
||||
InductionProviderOutput = null;
|
||||
CableCapacity = null;
|
||||
PipeCapacity = null;
|
||||
PipePullAmount = null;
|
||||
TubeCapacity = null;
|
||||
TubePullAmount = null;
|
||||
TransporterPullAmount = null;
|
||||
TransporterSpeed = null;
|
||||
ConductorInverseConduction = null;
|
||||
ConductorHeatCapacity = null;
|
||||
ConductorConductionInsulation = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import mekanism.common.config.options.DoubleOption;
|
||||
import mekanism.common.config.options.FloatOption;
|
||||
import mekanism.common.config.options.IntOption;
|
||||
import mekanism.common.util.FieldsAreNonnullByDefault;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@FieldsAreNonnullByDefault
|
||||
public class ToolsConfig extends BaseConfig {
|
||||
|
||||
public final DoubleOption armorSpawnRate = new DoubleOption(this, "tools.general", "MobArmorSpawnRate", 0.03,
|
||||
"The chance that Mekanism Armor can spawn on mobs.", 0.00, 1.00);
|
||||
|
||||
public final ArmorBalance armorOBSIDIAN = new ArmorBalance(this, "obsidian", 50, 5, 8, 12, 5, 40, 4);
|
||||
public final ArmorBalance armorLAZULI = new ArmorBalance(this, "lapis", 13, 2, 6, 5, 2, 8, 0);
|
||||
public final ArmorBalance armorOSMIUM = new ArmorBalance(this, "osmium", 30, 3, 6, 5, 3, 12, 1);
|
||||
public final ArmorBalance armorBRONZE = new ArmorBalance(this, "bronze", 35, 2, 5, 6, 3, 10, 0);
|
||||
public final ArmorBalance armorGLOWSTONE = new ArmorBalance(this, "glowstone", 18, 3, 6, 7, 3, 18, 0);
|
||||
public final ArmorBalance armorSTEEL = new ArmorBalance(this, "steel", 40, 3, 6, 7, 3, 10, 1);
|
||||
|
||||
public final ToolBalance toolOBSIDIAN = new ToolBalance(this, "obsidian", "regular", 3, 2500, 20, 10, 40, 12, -2);
|
||||
public final ToolBalance toolOBSIDIAN2 = new ToolBalance(this, "obsidian", "paxel", 3, 3000, 25, 10, 50);
|
||||
public final ToolBalance toolLAZULI = new ToolBalance(this, "lapis", "regular", 2, 200, 5, 2, 8, 8, -3.1F);
|
||||
public final ToolBalance toolLAZULI2 = new ToolBalance(this, "lapis", "paxel", 2, 250, 6, 4, 10);
|
||||
public final ToolBalance toolOSMIUM = new ToolBalance(this, "osmium", "regular", 2, 500, 10, 4, 12, 8, -3);
|
||||
public final ToolBalance toolOSMIUM2 = new ToolBalance(this, "osmium", "paxel", 3, 700, 12, 5, 16);
|
||||
public final ToolBalance toolBRONZE = new ToolBalance(this, "bronze", "regular", 2, 800, 14, 6, 10, 8, -3.1F);
|
||||
public final ToolBalance toolBRONZE2 = new ToolBalance(this, "bronze", "paxel", 3, 1100, 16, 10, 14);
|
||||
public final ToolBalance toolGLOWSTONE = new ToolBalance(this, "glowstone", "regular", 2, 300, 14, 5, 18, 8, -3.1F);
|
||||
public final ToolBalance toolGLOWSTONE2 = new ToolBalance(this, "glowstone", "paxel", 2, 450, 18, 5, 22);
|
||||
public final ToolBalance toolSTEEL = new ToolBalance(this, "steel", "regular", 3, 850, 14, 4, 10, 8, -3);
|
||||
public final ToolBalance toolSTEEL2 = new ToolBalance(this, "steel", "paxel", 3, 1250, 18, 8, 14);
|
||||
|
||||
@FieldsAreNonnullByDefault
|
||||
public static class ArmorBalance {
|
||||
|
||||
public final IntOption durability;
|
||||
public final IntOption feetProtection;
|
||||
public final IntOption legsProtection;
|
||||
public final IntOption chestProtection;
|
||||
public final IntOption headProtection;
|
||||
public final IntOption enchantability;
|
||||
public final FloatOption toughness;
|
||||
|
||||
private ArmorBalance(BaseConfig owner, String toolKey, int durabilityDefault, int feetProtectionDefault,
|
||||
int legsProtectionDefault, int chestProtectionDefault, int headProtectionDefault,
|
||||
int enchantabilityDefault, float toughnessDefault) {
|
||||
final String category = "tools.armor-balance." + toolKey;
|
||||
final String protectionCategory = category + ".protection";
|
||||
this.durability = new IntOption(owner, category, "durability", durabilityDefault,
|
||||
"Base durability of " + toolKey + " armor.");
|
||||
String protectionComment = "Protection value of " + toolKey;
|
||||
this.feetProtection = new IntOption(owner, protectionCategory, "feet", feetProtectionDefault,
|
||||
protectionComment + " boots.");
|
||||
this.legsProtection = new IntOption(owner, protectionCategory, "legs", legsProtectionDefault,
|
||||
protectionComment + " leggings.");
|
||||
this.chestProtection = new IntOption(owner, protectionCategory, "chest", chestProtectionDefault,
|
||||
protectionComment + " chestplates.");
|
||||
this.headProtection = new IntOption(owner, protectionCategory, "head", headProtectionDefault,
|
||||
protectionComment + " helmets.");
|
||||
this.enchantability = new IntOption(owner, category, "enchantability", enchantabilityDefault,
|
||||
"Natural enchantability factor of " + toolKey + " armor.");
|
||||
this.toughness = new FloatOption(owner, category, "toughness", toughnessDefault,
|
||||
"Base armor toughness value of " + toolKey + " armor.");
|
||||
|
||||
this.durability.setRequiresGameRestart(true);
|
||||
this.feetProtection.setRequiresGameRestart(true);
|
||||
this.legsProtection.setRequiresGameRestart(true);
|
||||
this.chestProtection.setRequiresGameRestart(true);
|
||||
this.headProtection.setRequiresGameRestart(true);
|
||||
this.enchantability.setRequiresGameRestart(true);
|
||||
this.toughness.setRequiresGameRestart(true);
|
||||
}
|
||||
}
|
||||
|
||||
@FieldsAreNonnullByDefault
|
||||
public static class ToolBalance {
|
||||
|
||||
public final IntOption harvestLevel;
|
||||
public final IntOption maxUses;
|
||||
public final FloatOption efficiency;
|
||||
public final IntOption damage;
|
||||
public final IntOption enchantability;
|
||||
public final FloatOption axeAttackDamage;
|
||||
public final FloatOption axeAttackSpeed;
|
||||
|
||||
private ToolBalance(BaseConfig owner, String toolKey, String variant, int harvestLevelDefault,
|
||||
int maxUsesDefault, float efficiencyDefault, int damageDefault, int enchantabilityDefault,
|
||||
float axeAttackDamageDefault, float axeAttackSpeedDefault) {
|
||||
final String category = "tools.tool-balance." + toolKey + "." + variant;
|
||||
this.harvestLevel = new IntOption(owner, category, "harvestLevel", harvestLevelDefault,
|
||||
"Harvest level of " + toolKey + " tools.");
|
||||
this.maxUses = new IntOption(owner, category, "maxUses", maxUsesDefault,
|
||||
"Maximum durability of " + toolKey + " tools.");
|
||||
this.efficiency = new FloatOption(owner, category, "efficiency", efficiencyDefault,
|
||||
"Base speed of " + toolKey + ".");
|
||||
this.damage = new IntOption(owner, category, "damage", damageDefault,
|
||||
"Base attack damage of " + toolKey + ".");
|
||||
this.enchantability = new IntOption(owner, category, "enchantability", enchantabilityDefault,
|
||||
"Natural enchantability factor of " + toolKey + ".");
|
||||
|
||||
if (variant.equals("regular")) {
|
||||
this.axeAttackDamage = new FloatOption(owner, category, "axeAttackDamage", axeAttackDamageDefault,
|
||||
"Base attack damage of a " + toolKey + " axe.");
|
||||
this.axeAttackSpeed = new FloatOption(owner, category, "axeAttackSpeed", axeAttackSpeedDefault,
|
||||
"Base attack speed of a " + toolKey + " axe.");
|
||||
} else {
|
||||
this.axeAttackDamage = new FloatOption(NULL_OWNER, "", "");
|
||||
this.axeAttackSpeed = new FloatOption(NULL_OWNER, "", "");
|
||||
}
|
||||
|
||||
this.harvestLevel.setRequiresGameRestart(true);
|
||||
this.maxUses.setRequiresGameRestart(true);
|
||||
this.efficiency.setRequiresGameRestart(true);
|
||||
this.damage.setRequiresGameRestart(true);
|
||||
this.enchantability.setRequiresGameRestart(true);
|
||||
this.axeAttackDamage.setRequiresGameRestart(true);
|
||||
this.axeAttackSpeed.setRequiresGameRestart(true);
|
||||
}
|
||||
|
||||
public ToolBalance(BaseConfig owner, String toolKey, String variant, int harvestLevelDefault,
|
||||
int maxUsesDefault, float efficiencyDefault, int damageDefault, int enchantabilityDefault) {
|
||||
this(owner, toolKey, variant, harvestLevelDefault, maxUsesDefault, efficiencyDefault, damageDefault,
|
||||
enchantabilityDefault, 0, 0);
|
||||
if (!variant.equals("paxel")) {
|
||||
throw new IllegalStateException("Wrong constructor, only paxel can use this");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,84 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.options.Option;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
public class TypeConfigManager {
|
||||
@ParametersAreNonnullByDefault
|
||||
public class TypeConfigManager<T extends Enum<T>> extends Option<TypeConfigManager<T>> {
|
||||
|
||||
private Map<String, Boolean> config = new HashMap<>();
|
||||
private EnumSet<T> config;
|
||||
private Supplier<List<T>> validValuesSupplier;
|
||||
private Function<T, String> nameSupplier;
|
||||
|
||||
public boolean isEnabled(String type) {
|
||||
return config.get(type) != null && config.get(type);
|
||||
TypeConfigManager(BaseConfig owner, String category, Class<T> enumClazz, Supplier<List<T>> validValuesSupplier,
|
||||
Function<T, String> nameSupplier) {
|
||||
super(owner, category, "", null);//key unused
|
||||
this.validValuesSupplier = validValuesSupplier;
|
||||
this.nameSupplier = nameSupplier;
|
||||
this.config = EnumSet.noneOf(enumClazz);
|
||||
}
|
||||
|
||||
public boolean isEnabled(BlockStateMachine.MachineType type) {
|
||||
return isEnabled(type.blockName);
|
||||
public boolean isEnabled(@Nullable T type) {
|
||||
return config.contains(type);
|
||||
}
|
||||
|
||||
public void setEntry(String type, boolean enabled) {
|
||||
config.put(type, enabled);
|
||||
public void setEntry(T type, boolean enabled) {
|
||||
if (enabled) {
|
||||
config.add(type);
|
||||
} else {
|
||||
config.remove(type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the enum constant from a name. Used in recipes, allowed to be non-cached
|
||||
*
|
||||
* @param name JSON supplied name
|
||||
* @return the found enum constant or null
|
||||
*/
|
||||
@Nullable
|
||||
public T typeFromName(String name) {
|
||||
for (T type : validValuesSupplier.get()) {
|
||||
if (nameSupplier.apply(type).equals(name)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
for (T type : validValuesSupplier.get()) {
|
||||
String typeName = nameSupplier.apply(type);
|
||||
final Property property = config.get(this.category, typeName + "Enabled", true,
|
||||
"Allow " + typeName + " to be used/crafted. Requires game restart to fully take effect.");
|
||||
property.setRequiresWorldRestart(true);
|
||||
setEntry(type, property.getBoolean());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
for (T type : validValuesSupplier.get()) {
|
||||
buf.writeBoolean(config.contains(type));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
config.clear();
|
||||
for (T type : validValuesSupplier.get()) {
|
||||
if (buf.readBoolean()) {
|
||||
config.add(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package mekanism.common.config;
|
||||
|
||||
import mekanism.common.config.options.DoubleOption;
|
||||
import mekanism.common.config.options.IntOption;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
public class UsageConfig extends BaseConfig {
|
||||
|
||||
public final DoubleOption enrichmentChamberUsage = new DoubleOption(this, "usage", "EnrichmentChamberUsage", 50D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption osmiumCompressorUsage = new DoubleOption(this, "usage", "OsmiumCompressorUsage", 100D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption combinerUsage = new DoubleOption(this, "usage", "CombinerUsage", 50D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption crusherUsage = new DoubleOption(this, "usage", "CrusherUsage", 50D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption metallurgicInfuserUsage = new DoubleOption(this, "usage", "MetallurgicInfuserUsage", 50D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption purificationChamberUsage = new DoubleOption(this, "usage", "PurificationChamberUsage",
|
||||
200D, "Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption energizedSmelterUsage = new DoubleOption(this, "usage", "EnergizedSmelterUsage", 50D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption digitalMinerUsage = new DoubleOption(this, "usage", "DigitalMinerUsage", 100D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption electricPumpUsage = new DoubleOption(this, "usage", "ElectricPumpUsage", 100D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption rotaryCondensentratorUsage = new DoubleOption(this, "usage", "RotaryCondensentratorUsage",
|
||||
50D, "Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption oxidationChamberUsage = new DoubleOption(this, "usage", "OxidationChamberUsage", 200D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption chemicalInfuserUsage = new DoubleOption(this, "usage", "ChemicalInfuserUsage", 200D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption chemicalInjectionChamberUsage = new DoubleOption(this, "usage",
|
||||
"ChemicalInjectionChamberUsage", 400D, "Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption precisionSawmillUsage = new DoubleOption(this, "usage", "PrecisionSawmillUsage", 50D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption chemicalDissolutionChamberUsage = new DoubleOption(this, "usage",
|
||||
"ChemicalDissolutionChamberUsage", 400D, "Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption chemicalWasherUsage = new DoubleOption(this, "usage", "ChemicalWasherUsage", 200D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption chemicalCrystallizerUsage = new DoubleOption(this, "usage", "ChemicalCrystallizerUsage",
|
||||
400D, "Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption seismicVibratorUsage = new DoubleOption(this, "usage", "SeismicVibratorUsage", 50D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption pressurizedReactionBaseUsage = new DoubleOption(this, "usage",
|
||||
"PressurizedReactionBaseUsage", 5D, "Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption fluidicPlenisherUsage = new DoubleOption(this, "usage", "FluidicPlenisherUsage", 100D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption laserUsage = new DoubleOption(this, "usage", "LaserUsage", 5000D,
|
||||
"Energy per operation tick (Joules).");
|
||||
|
||||
public final DoubleOption heavyWaterElectrolysisUsage = new DoubleOption(this, "usage",
|
||||
"HeavyWaterElectrolysisUsage", 800D,
|
||||
"Energy needed for one [recipe unit] of heavy water production (Joules).");
|
||||
|
||||
public final DoubleOption formulaicAssemblicatorUsage = new DoubleOption(this, "usage",
|
||||
"FormulaicAssemblicatorUsage", 100D, "Energy per operation tick (Joules).");
|
||||
|
||||
public final IntOption teleporterBaseUsage = new IntOption(this, "usage", "TeleporterBaseUsage", 1000,
|
||||
"Base Joules cost for a teleportation.");
|
||||
|
||||
public final IntOption teleporterDistanceUsage = new IntOption(this, "usage", "TeleporterDistanceUsage", 10,
|
||||
"Joules per unit of distance travelled during teleportation - sqrt(xDiff^2 + yDiff^2 + zDiff^2).");
|
||||
|
||||
public final IntOption teleporterDimensionPenalty = new IntOption(this, "usage", "TeleporterDimensionPenalty",
|
||||
10000, "Flat additional cost for interdimensional teleportation.");
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public class BooleanOption extends Option<BooleanOption> {
|
||||
|
||||
private boolean value;
|
||||
private final boolean defaultValue;
|
||||
|
||||
public BooleanOption(BaseConfig owner, String category, String key, boolean defaultValue,
|
||||
@Nullable String comment) {
|
||||
super(owner, category, key, comment);
|
||||
this.defaultValue = defaultValue;
|
||||
this.value = defaultValue;
|
||||
}
|
||||
|
||||
public BooleanOption(BaseConfig owner, String category, String key, boolean defaultValue) {
|
||||
this(owner, category, key, defaultValue, null);
|
||||
}
|
||||
|
||||
public BooleanOption(BaseConfig owner, String category, String key) {
|
||||
this(owner, category, key, false, null);
|
||||
}
|
||||
|
||||
public boolean val() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(boolean value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")//types are different
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
Property prop = config.get(this.category, this.key, this.defaultValue, this.comment);
|
||||
|
||||
prop.setRequiresMcRestart(this.requiresGameRestart);
|
||||
prop.setRequiresWorldRestart(this.requiresWorldRestart);
|
||||
|
||||
this.value = prop.getBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
buf.writeBoolean(this.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
this.value = buf.readBoolean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public class DoubleOption extends Option<DoubleOption> {
|
||||
|
||||
private double value;
|
||||
private final double defaultValue;
|
||||
private boolean hasRange = false;
|
||||
private double min;
|
||||
private double max;
|
||||
|
||||
public DoubleOption(BaseConfig owner, String category, String key, double defaultValue, @Nullable String comment) {
|
||||
super(owner, category, key, comment);
|
||||
this.defaultValue = defaultValue;
|
||||
this.value = defaultValue;
|
||||
}
|
||||
|
||||
public DoubleOption(BaseConfig owner, String category, String key, double defaultValue) {
|
||||
this(owner, category, key, defaultValue, null);
|
||||
}
|
||||
|
||||
public DoubleOption(BaseConfig owner, String category, String key) {
|
||||
this(owner, category, key, 0, null);
|
||||
}
|
||||
|
||||
public DoubleOption(BaseConfig owner, String category, String key, double defaultValue, @Nullable String comment,
|
||||
double min, double max) {
|
||||
this(owner, category, key, defaultValue, comment);
|
||||
this.hasRange = true;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public double val() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(double value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")//types are different
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
Property prop;
|
||||
|
||||
if (hasRange) {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment, this.min, this.max);
|
||||
} else {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment);
|
||||
}
|
||||
|
||||
prop.setRequiresMcRestart(this.requiresGameRestart);
|
||||
prop.setRequiresWorldRestart(this.requiresWorldRestart);
|
||||
|
||||
this.value = prop.getDouble();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
buf.writeDouble(this.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
this.value = buf.readDouble();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public class EnumOption<T extends Enum<T>> extends Option<EnumOption<T>> {
|
||||
|
||||
private T value;
|
||||
private final T defaultValue;
|
||||
private final Class<T> enumClass;
|
||||
private final T[] enumValues;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public EnumOption(BaseConfig owner, String category, String key, T defaultValue, @Nullable String comment) {
|
||||
super(owner, category, key, comment);
|
||||
this.defaultValue = Objects.requireNonNull(defaultValue);
|
||||
this.value = defaultValue;
|
||||
this.enumClass = (Class<T>) defaultValue.getClass();
|
||||
this.enumValues = enumClass.getEnumConstants();
|
||||
}
|
||||
|
||||
public EnumOption(BaseConfig owner, String category, String key, T defaultValue) {
|
||||
this(owner, category, key, defaultValue, null);
|
||||
}
|
||||
|
||||
public T val() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
this.value = Objects.requireNonNull(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
final Property prop = config.get(this.category, this.key, this.defaultValue.name(), this.comment);
|
||||
|
||||
prop.setRequiresMcRestart(this.requiresGameRestart);
|
||||
prop.setRequiresWorldRestart(this.requiresWorldRestart);
|
||||
|
||||
this.value = Enum.valueOf(this.enumClass, prop.getString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
buf.writeInt(this.value.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
this.value = this.enumValues[buf.readInt()];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public class FloatOption extends Option<FloatOption> {
|
||||
|
||||
private float value;
|
||||
private final float defaultValue;
|
||||
private boolean hasRange = false;
|
||||
private float min;
|
||||
private float max;
|
||||
|
||||
public FloatOption(BaseConfig owner, String category, String key, float defaultValue, @Nullable String comment) {
|
||||
super(owner, category, key, comment);
|
||||
this.defaultValue = defaultValue;
|
||||
this.value = defaultValue;
|
||||
}
|
||||
|
||||
public FloatOption(BaseConfig owner, String category, String key, float defaultValue) {
|
||||
this(owner, category, key, defaultValue, null);
|
||||
}
|
||||
|
||||
public FloatOption(BaseConfig owner, String category, String key) {
|
||||
this(owner, category, key, 0, null);
|
||||
}
|
||||
|
||||
public FloatOption(BaseConfig owner, String category, String key, float defaultValue, @Nullable String comment,
|
||||
float min, float max) {
|
||||
this(owner, category, key, defaultValue, comment);
|
||||
this.hasRange = true;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public float val() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(float value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")//types are different
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
Property prop;
|
||||
|
||||
if (hasRange) {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment, this.min, this.max);
|
||||
} else {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment);
|
||||
}
|
||||
|
||||
prop.setRequiresMcRestart(this.requiresGameRestart);
|
||||
prop.setRequiresWorldRestart(this.requiresWorldRestart);
|
||||
|
||||
this.value = (float) prop.getDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
buf.writeFloat(this.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
this.value = buf.readFloat();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public class IntListOption extends Option<IntListOption> {
|
||||
|
||||
private int[] value;
|
||||
private final int[] defaultValue;
|
||||
private boolean hasRange = false;
|
||||
private int min;
|
||||
private int max;
|
||||
|
||||
public IntListOption(BaseConfig owner, String category, String key, int[] defaultValue, @Nullable String comment) {
|
||||
super(owner, category, key, comment);
|
||||
this.defaultValue = defaultValue;
|
||||
this.value = defaultValue;
|
||||
}
|
||||
|
||||
public IntListOption(BaseConfig owner, String category, String key, int[] defaultValue) {
|
||||
this(owner, category, key, defaultValue, null);
|
||||
}
|
||||
|
||||
public IntListOption(BaseConfig owner, String category, String key) {
|
||||
this(owner, category, key, new int[0], null);
|
||||
}
|
||||
|
||||
public IntListOption(BaseConfig owner, String category, String key, int[] defaultValue, @Nullable String comment,
|
||||
int min, int max) {
|
||||
this(owner, category, key, defaultValue, comment);
|
||||
this.hasRange = true;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public int[] val() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(int[] value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")//types are different
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
Property prop;
|
||||
|
||||
if (hasRange) {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment, this.min, this.max);
|
||||
} else {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment);
|
||||
}
|
||||
|
||||
prop.setRequiresMcRestart(this.requiresGameRestart);
|
||||
prop.setRequiresWorldRestart(this.requiresWorldRestart);
|
||||
|
||||
this.value = prop.getIntList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
buf.writeInt(this.value.length);
|
||||
for (int i : value) {
|
||||
buf.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
int size = buf.readInt();
|
||||
this.value = new int[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.value[i] = buf.readInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public class IntOption extends Option<IntOption> {
|
||||
|
||||
private int value;
|
||||
private final int defaultValue;
|
||||
private boolean hasRange = false;
|
||||
private int min;
|
||||
private int max;
|
||||
|
||||
public IntOption(BaseConfig owner, String category, String key, int defaultValue, @Nullable String comment) {
|
||||
super(owner, category, key, comment);
|
||||
this.defaultValue = defaultValue;
|
||||
this.value = defaultValue;
|
||||
}
|
||||
|
||||
public IntOption(BaseConfig owner, String category, String key, int defaultValue) {
|
||||
this(owner, category, key, defaultValue, null);
|
||||
}
|
||||
|
||||
public IntOption(BaseConfig owner, String category, String key) {
|
||||
this(owner, category, key, 0, null);
|
||||
}
|
||||
|
||||
public IntOption(BaseConfig owner, String category, String key, int defaultValue, @Nullable String comment, int min,
|
||||
int max) {
|
||||
this(owner, category, key, defaultValue, comment);
|
||||
this.hasRange = true;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public int val() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")//types are different
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
Property prop;
|
||||
|
||||
if (hasRange) {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment, this.min, this.max);
|
||||
} else {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment);
|
||||
}
|
||||
|
||||
prop.setRequiresMcRestart(this.requiresGameRestart);
|
||||
prop.setRequiresWorldRestart(this.requiresWorldRestart);
|
||||
|
||||
this.value = prop.getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
buf.writeInt(this.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
this.value = buf.readInt();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import it.unimi.dsi.fastutil.ints.IntArraySet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public class IntSetOption extends Option<IntSetOption> {
|
||||
|
||||
private final int[] defaultValue;
|
||||
private IntSet value;
|
||||
private boolean hasRange = false;
|
||||
private int min;
|
||||
private int max;
|
||||
|
||||
public IntSetOption(BaseConfig owner, String category, String key, int[] defaultValue, @Nullable String comment) {
|
||||
super(owner, category, key, comment);
|
||||
this.defaultValue = defaultValue;
|
||||
this.value = new IntArraySet();
|
||||
for (int i : defaultValue) {
|
||||
this.value.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
public IntSetOption(BaseConfig owner, String category, String key, int[] defaultValue) {
|
||||
this(owner, category, key, defaultValue, null);
|
||||
}
|
||||
|
||||
public IntSetOption(BaseConfig owner, String category, String key) {
|
||||
this(owner, category, key, new int[0], null);
|
||||
}
|
||||
|
||||
public IntSetOption(BaseConfig owner, String category, String key, int[] defaultValue, @Nullable String comment,
|
||||
int min, int max) {
|
||||
this(owner, category, key, defaultValue, comment);
|
||||
this.hasRange = true;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public IntSet val() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void set(IntSet value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")//types are different
|
||||
@Override
|
||||
public void load(Configuration config) {
|
||||
Property prop;
|
||||
|
||||
if (hasRange) {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment, this.min, this.max);
|
||||
} else {
|
||||
prop = config.get(this.category, this.key, this.defaultValue, this.comment);
|
||||
}
|
||||
|
||||
prop.setRequiresMcRestart(this.requiresGameRestart);
|
||||
prop.setRequiresWorldRestart(this.requiresWorldRestart);
|
||||
|
||||
this.value.clear();
|
||||
for (int i : prop.getIntList()) {
|
||||
this.value.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buf) {
|
||||
buf.writeInt(this.value.size());
|
||||
for (int i : value) {
|
||||
buf.writeInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuf buf) {
|
||||
int size = buf.readInt();
|
||||
this.value.clear();
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.value.add(buf.readInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package mekanism.common.config.options;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import mekanism.common.config.BaseConfig;
|
||||
import mekanism.common.util.FieldsAreNonnullByDefault;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
/**
|
||||
* Created by Thiakil on 15/03/2019.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
@FieldsAreNonnullByDefault
|
||||
public abstract class Option<THISTYPE extends Option> {
|
||||
|
||||
protected final String key;
|
||||
|
||||
@Nullable
|
||||
protected final String comment;
|
||||
|
||||
protected final String category;
|
||||
|
||||
protected boolean requiresGameRestart = false;
|
||||
|
||||
protected boolean requiresWorldRestart = false;
|
||||
|
||||
public Option(BaseConfig owner, String category, String key, @Nullable String comment) {
|
||||
this.category = category;
|
||||
this.key = key;
|
||||
this.comment = comment;
|
||||
owner.registerOption(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads this option from the config file NB: saving back is handled by the config system / GUIs, load will be
|
||||
* re-called
|
||||
*
|
||||
* @param config where to load from
|
||||
*/
|
||||
public abstract void load(Configuration config);
|
||||
|
||||
/**
|
||||
* Serialise value to network buffer Must write the same way {@link #read(ByteBuf)} reads
|
||||
*
|
||||
* @param buf where to write to.
|
||||
*/
|
||||
public abstract void write(ByteBuf buf);
|
||||
|
||||
/**
|
||||
* Deserialise from network buffer Must read the same way {@link #write(ByteBuf)} writes
|
||||
*
|
||||
* @param buf where to read from
|
||||
*/
|
||||
public abstract void read(ByteBuf buf);
|
||||
|
||||
public THISTYPE setRequiresWorldRestart(boolean requiresWorldRestart) {
|
||||
this.requiresWorldRestart = requiresWorldRestart;
|
||||
//noinspection unchecked
|
||||
return (THISTYPE) this;
|
||||
}
|
||||
|
||||
public THISTYPE setRequiresGameRestart(boolean requiresGameRestart) {
|
||||
this.requiresGameRestart = requiresGameRestart;
|
||||
//noinspection unchecked
|
||||
return (THISTYPE) this;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.IHeatTransfer;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.content.tank.SynchronizedTankData.ValveData;
|
||||
import mekanism.common.multiblock.SynchronizedData;
|
||||
import mekanism.common.util.UnitDisplayUtils.TemperatureUnit;
|
||||
@@ -58,12 +58,14 @@ public class SynchronizedBoilerData extends SynchronizedData<SynchronizedBoilerD
|
||||
* @return how much heat energy is needed to convert one unit of water into steam
|
||||
*/
|
||||
public static double getHeatEnthalpy() {
|
||||
return general.maxEnergyPerSteam / general.energyPerHeat;
|
||||
return MekanismConfig.current().general.maxEnergyPerSteam.val() / MekanismConfig.current().general.energyPerHeat
|
||||
.val();
|
||||
}
|
||||
|
||||
public double getHeatAvailable() {
|
||||
double heatAvailable = (temperature - BASE_BOIL_TEMP) * locations.size();
|
||||
return Math.min(heatAvailable, superheatingElements * general.superheatingHeatTransfer);
|
||||
return Math.min(heatAvailable,
|
||||
superheatingElements * MekanismConfig.current().general.superheatingHeatTransfer.val());
|
||||
}
|
||||
|
||||
public boolean needsRenderUpdate() {
|
||||
|
||||
@@ -2,12 +2,13 @@ package mekanism.common.content.entangloporter;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import java.util.UUID;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.frequency.Frequency;
|
||||
import mekanism.common.tier.FluidTankTier;
|
||||
import mekanism.common.tier.GasTankTier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -21,9 +22,6 @@ public class InventoryFrequency extends Frequency {
|
||||
|
||||
public static final String ENTANGLOPORTER = "Entangloporter";
|
||||
|
||||
public static final int FLUID_TANK_SIZE = Tier.FluidTankTier.ULTIMATE.output;
|
||||
public static final int GAS_TANK_SIZE = Tier.GasTankTier.ULTIMATE.output;
|
||||
|
||||
public double storedEnergy;
|
||||
public FluidTank storedFluid;
|
||||
public GasTank storedGas;
|
||||
@@ -33,8 +31,8 @@ public class InventoryFrequency extends Frequency {
|
||||
public InventoryFrequency(String n, UUID uuid) {
|
||||
super(n, uuid);
|
||||
|
||||
storedFluid = new FluidTank(FLUID_TANK_SIZE);
|
||||
storedGas = new GasTank(GAS_TANK_SIZE);
|
||||
storedFluid = new FluidTank(FluidTankTier.ULTIMATE.getOutput());
|
||||
storedGas = new GasTank(GasTankTier.ULTIMATE.getOutput());
|
||||
}
|
||||
|
||||
public InventoryFrequency(NBTTagCompound nbtTags) {
|
||||
@@ -79,8 +77,8 @@ public class InventoryFrequency extends Frequency {
|
||||
protected void read(NBTTagCompound nbtTags) {
|
||||
super.read(nbtTags);
|
||||
|
||||
storedFluid = new FluidTank(FLUID_TANK_SIZE);
|
||||
storedGas = new GasTank(GAS_TANK_SIZE);
|
||||
storedFluid = new FluidTank(FluidTankTier.ULTIMATE.getOutput());
|
||||
storedGas = new GasTank(GasTankTier.ULTIMATE.getOutput());
|
||||
|
||||
storedEnergy = nbtTags.getDouble("storedEnergy");
|
||||
|
||||
@@ -136,8 +134,8 @@ public class InventoryFrequency extends Frequency {
|
||||
protected void read(ByteBuf dataStream) {
|
||||
super.read(dataStream);
|
||||
|
||||
storedFluid = new FluidTank(FLUID_TANK_SIZE);
|
||||
storedGas = new GasTank(GAS_TANK_SIZE);
|
||||
storedFluid = new FluidTank(FluidTankTier.ULTIMATE.getOutput());
|
||||
storedGas = new GasTank(GasTankTier.ULTIMATE.getOutput());
|
||||
|
||||
storedEnergy = dataStream.readDouble();
|
||||
|
||||
|
||||
@@ -75,10 +75,10 @@ public class MatrixUpdateProtocol extends UpdateProtocol<SynchronizedMatrixData>
|
||||
|
||||
if (tile instanceof TileEntityInductionCell) {
|
||||
structure.cells.add(coord);
|
||||
structure.storageCap += ((TileEntityInductionCell) tile).tier.maxEnergy;
|
||||
structure.storageCap += ((TileEntityInductionCell) tile).tier.getMaxEnergy();
|
||||
} else if (tile instanceof TileEntityInductionProvider) {
|
||||
structure.providers.add(coord);
|
||||
structure.transferCap += ((TileEntityInductionProvider) tile).tier.output;
|
||||
structure.transferCap += ((TileEntityInductionProvider) tile).tier.getOutput();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.Pos3D;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.item.ItemFlamethrower;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.StackUtils;
|
||||
@@ -170,8 +170,8 @@ public class EntityFlame extends Entity implements IEntityAdditionalSpawnData {
|
||||
|
||||
Coord4D sideCoord = new Coord4D(mop.getBlockPos().offset(mop.sideHit), world);
|
||||
|
||||
if (general.aestheticWorldDamage && !fluid && (sideCoord.isAirBlock(world) || sideCoord
|
||||
.isReplaceable(world))) {
|
||||
if (MekanismConfig.current().general.aestheticWorldDamage.val() && !fluid && (
|
||||
sideCoord.isAirBlock(world) || sideCoord.isReplaceable(world))) {
|
||||
if (mode != ItemFlamethrower.FlamethrowerMode.COMBAT && !smeltBlock(new Coord4D(mop, world))) {
|
||||
if (mode == ItemFlamethrower.FlamethrowerMode.INFERNO && !world.isRemote) {
|
||||
world.setBlockState(sideCoord.getPos(), Blocks.FIRE.getDefaultState());
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.entity;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.MoverType;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -38,7 +38,7 @@ public class EntityObsidianTNT extends Entity {
|
||||
motionY = 0.2;
|
||||
motionZ = -(Math.cos(randPi)) * 0.02F;
|
||||
|
||||
fuse = general.obsidianTNTDelay;
|
||||
fuse = MekanismConfig.current().general.obsidianTNTDelay.val();
|
||||
|
||||
prevPosX = x;
|
||||
prevPosY = y;
|
||||
@@ -101,7 +101,8 @@ public class EntityObsidianTNT extends Entity {
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
world.createExplosion(null, posX, posY, posZ, general.obsidianTNTBlastRadius, true);
|
||||
world.createExplosion(null, posX, posY, posZ, MekanismConfig.current().general.obsidianTNTBlastRadius.val(),
|
||||
true);
|
||||
hasExploded = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.entity.ai.RobitAIFollow;
|
||||
import mekanism.common.entity.ai.RobitAIPickup;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
@@ -188,34 +188,43 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
|
||||
.hasCapability(Capabilities.TESLA_PRODUCER_CAPABILITY, null)) {
|
||||
ITeslaProducer producer = stack.getCapability(Capabilities.TESLA_PRODUCER_CAPABILITY, null);
|
||||
|
||||
long needed = Math.round((MAX_ELECTRICITY - getEnergy()) * general.TO_TESLA);
|
||||
setEnergy(getEnergy() + producer.takePower(needed, false) * general.FROM_TESLA);
|
||||
long needed = Math
|
||||
.round((MAX_ELECTRICITY - getEnergy()) * MekanismConfig.current().general.TO_TESLA.val());
|
||||
setEnergy(
|
||||
getEnergy() + producer.takePower(needed, false) * MekanismConfig.current().general.FROM_TESLA
|
||||
.val());
|
||||
} else if (MekanismUtils.useForge() && stack.hasCapability(CapabilityEnergy.ENERGY, null)) {
|
||||
IEnergyStorage storage = stack.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
|
||||
if (storage.canExtract()) {
|
||||
int needed = (int) Math
|
||||
.round(Math.min(Integer.MAX_VALUE, (MAX_ELECTRICITY - getEnergy()) * general.TO_FORGE));
|
||||
setEnergy(getEnergy() + storage.extractEnergy(needed, false) * general.FROM_FORGE);
|
||||
.round(Math.min(Integer.MAX_VALUE,
|
||||
(MAX_ELECTRICITY - getEnergy()) * MekanismConfig.current().general.TO_FORGE.val()));
|
||||
setEnergy(getEnergy() + storage.extractEnergy(needed, false) * MekanismConfig
|
||||
.current().general.FROM_FORGE.val());
|
||||
}
|
||||
} else if (MekanismUtils.useRF() && stack.getItem() instanceof IEnergyContainerItem) {
|
||||
IEnergyContainerItem item = (IEnergyContainerItem) stack.getItem();
|
||||
|
||||
int needed = (int) Math
|
||||
.round(Math.min(Integer.MAX_VALUE, (MAX_ELECTRICITY - getEnergy()) * general.TO_RF));
|
||||
setEnergy(getEnergy() + (item.extractEnergy(stack, needed, false) * general.FROM_RF));
|
||||
.round(Math.min(Integer.MAX_VALUE,
|
||||
(MAX_ELECTRICITY - getEnergy()) * MekanismConfig.current().general.TO_RF.val()));
|
||||
setEnergy(getEnergy() + (item.extractEnergy(stack, needed, false) * MekanismConfig
|
||||
.current().general.FROM_RF.val()));
|
||||
} else if (MekanismUtils.useIC2() && stack.getItem() instanceof IElectricItem) {
|
||||
IElectricItem item = (IElectricItem) stack.getItem();
|
||||
|
||||
if (item.canProvideEnergy(stack)) {
|
||||
double gain = ElectricItem.manager
|
||||
.discharge(stack, (MAX_ELECTRICITY - getEnergy()) * general.TO_IC2, 4, true, true, false)
|
||||
* general.FROM_IC2;
|
||||
.discharge(stack,
|
||||
(MAX_ELECTRICITY - getEnergy()) * MekanismConfig.current().general.TO_IC2.val(), 4,
|
||||
true, true, false)
|
||||
* MekanismConfig.current().general.FROM_IC2.val();
|
||||
setEnergy(getEnergy() + gain);
|
||||
}
|
||||
} else if (stack.getItem() == Items.REDSTONE
|
||||
&& getEnergy() + general.ENERGY_PER_REDSTONE <= MAX_ELECTRICITY) {
|
||||
setEnergy(getEnergy() + general.ENERGY_PER_REDSTONE);
|
||||
&& getEnergy() + MekanismConfig.current().general.ENERGY_PER_REDSTONE.val() <= MAX_ELECTRICITY) {
|
||||
setEnergy(getEnergy() + MekanismConfig.current().general.ENERGY_PER_REDSTONE.val());
|
||||
stack.shrink(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismFluids;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.Resource;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -42,7 +42,7 @@ public final class OreDictManager {
|
||||
ItemStack plank = StackUtils.size(ore, 1);
|
||||
if (!Recipe.PRECISION_SAWMILL.containsRecipe(plank)) {
|
||||
RecipeHandler.addPrecisionSawmillRecipe(plank, new ItemStack(Items.STICK, 6),
|
||||
new ItemStack(MekanismItems.Sawdust), general.sawdustChancePlank);
|
||||
new ItemStack(MekanismItems.Sawdust), MekanismConfig.current().general.sawdustChancePlank.val());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ public final class OreDictManager {
|
||||
|
||||
if (!resultEntry.isEmpty()) {
|
||||
RecipeHandler.addPrecisionSawmillRecipe(log, StackUtils.size(resultEntry, 6),
|
||||
new ItemStack(MekanismItems.Sawdust), general.sawdustChanceLog);
|
||||
new ItemStack(MekanismItems.Sawdust), MekanismConfig.current().general.sawdustChanceLog.val());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -1,6 +1,6 @@
|
||||
package mekanism.common.integration.forgeenergy;
|
||||
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.tile.transmitter.TileEntityUniversalCable;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
@@ -19,7 +19,9 @@ public class ForgeEnergyCableIntegration implements IEnergyStorage {
|
||||
@Override
|
||||
public int receiveEnergy(int maxReceive, boolean simulate) {
|
||||
return (int) Math
|
||||
.round(tileEntity.acceptEnergy(side, maxReceive * general.FROM_FORGE, simulate) * general.TO_FORGE);
|
||||
.round(tileEntity
|
||||
.acceptEnergy(side, maxReceive * MekanismConfig.current().general.FROM_FORGE.val(), simulate)
|
||||
* MekanismConfig.current().general.TO_FORGE.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -29,12 +31,14 @@ public class ForgeEnergyCableIntegration implements IEnergyStorage {
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
return (int) Math.round(Math.min(Integer.MAX_VALUE, tileEntity.getEnergy() * general.TO_FORGE));
|
||||
return (int) Math.round(
|
||||
Math.min(Integer.MAX_VALUE, tileEntity.getEnergy() * MekanismConfig.current().general.TO_FORGE.val()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return (int) Math.round(Math.min(Integer.MAX_VALUE, tileEntity.getMaxEnergy() * general.TO_FORGE));
|
||||
return (int) Math.round(
|
||||
Math.min(Integer.MAX_VALUE, tileEntity.getMaxEnergy() * MekanismConfig.current().general.TO_FORGE.val()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.integration.forgeenergy;
|
||||
|
||||
import mekanism.common.base.IEnergyWrapper;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
|
||||
@@ -17,11 +17,11 @@ public class ForgeEnergyIntegration implements IEnergyStorage {
|
||||
}
|
||||
|
||||
public static double forgeToMek(int forge) {
|
||||
return forge * general.FROM_FORGE;
|
||||
return forge * MekanismConfig.current().general.FROM_FORGE.val();
|
||||
}
|
||||
|
||||
public static int mekToForge(double mek) {
|
||||
return (int) Math.round(mek * general.TO_FORGE);
|
||||
return (int) Math.round(mek * MekanismConfig.current().general.TO_FORGE.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@ package mekanism.common.integration.forgeenergy;
|
||||
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.capabilities.ItemCapabilityWrapper.ItemCapability;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
@@ -26,7 +26,8 @@ public class ForgeEnergyItemWrapper extends ItemCapability implements IEnergySto
|
||||
int toReceive = Math.min(maxReceive, energyNeeded);
|
||||
|
||||
if (!simulate) {
|
||||
getItem().setEnergy(getStack(), getItem().getEnergy(getStack()) + toReceive * general.FROM_TESLA);
|
||||
getItem().setEnergy(getStack(),
|
||||
getItem().getEnergy(getStack()) + toReceive * MekanismConfig.current().general.FROM_TESLA.val());
|
||||
}
|
||||
|
||||
return toReceive;
|
||||
@@ -42,7 +43,8 @@ public class ForgeEnergyItemWrapper extends ItemCapability implements IEnergySto
|
||||
int toSend = Math.min(maxExtract, energyRemaining);
|
||||
|
||||
if (!simulate) {
|
||||
getItem().setEnergy(getStack(), getItem().getEnergy(getStack()) - toSend * general.FROM_TESLA);
|
||||
getItem().setEnergy(getStack(),
|
||||
getItem().getEnergy(getStack()) - toSend * MekanismConfig.current().general.FROM_TESLA.val());
|
||||
}
|
||||
|
||||
return toSend;
|
||||
@@ -53,12 +55,14 @@ public class ForgeEnergyItemWrapper extends ItemCapability implements IEnergySto
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
return MekanismUtils.clampToInt(Math.round(getItem().getEnergy(getStack()) * general.TO_FORGE));
|
||||
return MekanismUtils.clampToInt(
|
||||
Math.round(getItem().getEnergy(getStack()) * MekanismConfig.current().general.TO_FORGE.val()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return MekanismUtils.clampToInt(Math.round(getItem().getMaxEnergy(getStack()) * general.TO_FORGE));
|
||||
return MekanismUtils.clampToInt(
|
||||
Math.round(getItem().getMaxEnergy(getStack()) * MekanismConfig.current().general.TO_FORGE.val()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,7 @@ import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import mekanism.common.base.IEnergyWrapper;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -38,10 +38,11 @@ public class IC2Integration {
|
||||
IEnergyTile tile = EnergyNet.instance.getSubTile(tileEntity.getWorld(), tileEntity.getPos());
|
||||
|
||||
if (tile instanceof IEnergySink && ((IEnergySink) tile).acceptsEnergyFrom(from, side.getOpposite())) {
|
||||
double toSend = Math.min(currentSending * general.TO_IC2,
|
||||
double toSend = Math.min(currentSending * MekanismConfig.current().general.TO_IC2.val(),
|
||||
EnergyNet.instance.getPowerFromTier(((IEnergySink) tile).getSinkTier()));
|
||||
toSend = Math.min(Math.min(toSend, ((IEnergySink) tile).getDemandedEnergy()), Integer.MAX_VALUE);
|
||||
return (toSend - (((IEnergySink) tile).injectEnergy(side.getOpposite(), toSend, 0))) * general.FROM_IC2;
|
||||
return (toSend - (((IEnergySink) tile).injectEnergy(side.getOpposite(), toSend, 0))) * MekanismConfig
|
||||
.current().general.FROM_IC2.val();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -2,7 +2,7 @@ package mekanism.common.integration.ic2;
|
||||
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -22,13 +22,14 @@ public class IC2ItemManager implements IElectricItemManager {
|
||||
if (energizedItem.canReceive(itemStack)) {
|
||||
double energyNeeded = energizedItem.getMaxEnergy(itemStack) - energizedItem.getEnergy(itemStack);
|
||||
double energyToStore = Math
|
||||
.min(Math.min(amount * general.FROM_IC2, energizedItem.getMaxEnergy(itemStack) * 0.01), energyNeeded);
|
||||
.min(Math.min(amount * MekanismConfig.current().general.FROM_IC2.val(),
|
||||
energizedItem.getMaxEnergy(itemStack) * 0.01), energyNeeded);
|
||||
|
||||
if (!simulate) {
|
||||
energizedItem.setEnergy(itemStack, energizedItem.getEnergy(itemStack) + energyToStore);
|
||||
}
|
||||
|
||||
return (int) Math.round(energyToStore * general.TO_IC2);
|
||||
return (int) Math.round(energyToStore * MekanismConfig.current().general.TO_IC2.val());
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -38,7 +39,7 @@ public class IC2ItemManager implements IElectricItemManager {
|
||||
public double discharge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean external,
|
||||
boolean simulate) {
|
||||
if (energizedItem.canSend(itemStack)) {
|
||||
double energyWanted = amount * general.FROM_IC2;
|
||||
double energyWanted = amount * MekanismConfig.current().general.FROM_IC2.val();
|
||||
double energyToGive = Math.min(Math.min(energyWanted, energizedItem.getMaxEnergy(itemStack) * 0.01),
|
||||
energizedItem.getEnergy(itemStack));
|
||||
|
||||
@@ -46,7 +47,7 @@ public class IC2ItemManager implements IElectricItemManager {
|
||||
energizedItem.setEnergy(itemStack, energizedItem.getEnergy(itemStack) - energyToGive);
|
||||
}
|
||||
|
||||
return (int) Math.round(energyToGive * general.TO_IC2);
|
||||
return (int) Math.round(energyToGive * MekanismConfig.current().general.TO_IC2.val());
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -54,12 +55,12 @@ public class IC2ItemManager implements IElectricItemManager {
|
||||
|
||||
@Override
|
||||
public boolean canUse(ItemStack itemStack, double amount) {
|
||||
return energizedItem.getEnergy(itemStack) >= amount * general.FROM_IC2;
|
||||
return energizedItem.getEnergy(itemStack) >= amount * MekanismConfig.current().general.FROM_IC2.val();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getCharge(ItemStack itemStack) {
|
||||
return (int) Math.round(energizedItem.getEnergy(itemStack) * general.TO_IC2);
|
||||
return (int) Math.round(energizedItem.getEnergy(itemStack) * MekanismConfig.current().general.TO_IC2.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,7 @@ import mcmultipart.api.multipart.IMultipart;
|
||||
import mcmultipart.api.slot.EnumCenterSlot;
|
||||
import mcmultipart.api.slot.IPartSlot;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.tile.transmitter.TileEntitySidedPipe;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.common.integration.tesla;
|
||||
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
import mekanism.common.tile.transmitter.TileEntityUniversalCable;
|
||||
import net.darkhax.tesla.api.ITeslaConsumer;
|
||||
@@ -23,6 +23,8 @@ public class TeslaCableIntegration implements ITeslaConsumer {
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.TESLA_MOD_ID)
|
||||
public long givePower(long power, boolean simulated) {
|
||||
return Math.round(tileEntity.acceptEnergy(side, power * general.FROM_TESLA, simulated) * general.TO_TESLA);
|
||||
return Math.round(
|
||||
tileEntity.acceptEnergy(side, power * MekanismConfig.current().general.FROM_TESLA.val(), simulated)
|
||||
* MekanismConfig.current().general.TO_TESLA.val());
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.integration.tesla;
|
||||
|
||||
import mekanism.common.base.IEnergyWrapper;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
import net.darkhax.tesla.api.ITeslaConsumer;
|
||||
import net.darkhax.tesla.api.ITeslaHolder;
|
||||
@@ -30,13 +30,13 @@ public class TeslaIntegration implements ITeslaHolder, ITeslaConsumer, ITeslaPro
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.TESLA_MOD_ID)
|
||||
public long getStoredPower() {
|
||||
return Math.round(tileEntity.getEnergy() * general.TO_TESLA);
|
||||
return Math.round(tileEntity.getEnergy() * MekanismConfig.current().general.TO_TESLA.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.TESLA_MOD_ID)
|
||||
public long getCapacity() {
|
||||
return Math.round(tileEntity.getMaxEnergy() * general.TO_TESLA);
|
||||
return Math.round(tileEntity.getMaxEnergy() * MekanismConfig.current().general.TO_TESLA.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,10 +52,13 @@ public class TeslaIntegration implements ITeslaHolder, ITeslaConsumer, ITeslaPro
|
||||
}
|
||||
|
||||
public long rfToTesla(int rf) {
|
||||
return Math.round(rf * general.FROM_RF * general.TO_TESLA);
|
||||
return Math.round(
|
||||
rf * MekanismConfig.current().general.FROM_RF.val() * MekanismConfig.current().general.TO_TESLA.val());
|
||||
}
|
||||
|
||||
public int teslaToRF(long tesla) {
|
||||
return (int) Math.round(Math.min(Integer.MAX_VALUE, tesla * general.FROM_TESLA * general.TO_RF));
|
||||
return (int) Math.round(Math.min(Integer.MAX_VALUE,
|
||||
tesla * MekanismConfig.current().general.FROM_TESLA.val() * MekanismConfig.current().general.TO_RF
|
||||
.val()));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package mekanism.common.integration.tesla;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.capabilities.ItemCapabilityWrapper.ItemCapability;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
import net.darkhax.tesla.api.ITeslaConsumer;
|
||||
import net.darkhax.tesla.api.ITeslaHolder;
|
||||
@@ -39,7 +39,8 @@ public class TeslaItemWrapper extends ItemCapability implements ITeslaHolder, IT
|
||||
long toSend = Math.min(power, energyRemaining);
|
||||
|
||||
if (!simulated) {
|
||||
getItem().setEnergy(getStack(), getItem().getEnergy(getStack()) - toSend * general.FROM_TESLA);
|
||||
getItem().setEnergy(getStack(),
|
||||
getItem().getEnergy(getStack()) - toSend * MekanismConfig.current().general.FROM_TESLA.val());
|
||||
}
|
||||
|
||||
return toSend;
|
||||
@@ -56,7 +57,8 @@ public class TeslaItemWrapper extends ItemCapability implements ITeslaHolder, IT
|
||||
long toReceive = Math.min(power, energyNeeded);
|
||||
|
||||
if (!simulated) {
|
||||
getItem().setEnergy(getStack(), getItem().getEnergy(getStack()) + toReceive * general.FROM_TESLA);
|
||||
getItem().setEnergy(getStack(),
|
||||
getItem().getEnergy(getStack()) + toReceive * MekanismConfig.current().general.FROM_TESLA.val());
|
||||
}
|
||||
|
||||
return toReceive;
|
||||
@@ -68,12 +70,12 @@ public class TeslaItemWrapper extends ItemCapability implements ITeslaHolder, IT
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.TESLA_MOD_ID)
|
||||
public long getStoredPower() {
|
||||
return Math.round(getItem().getEnergy(getStack()) * general.TO_TESLA);
|
||||
return Math.round(getItem().getEnergy(getStack()) * MekanismConfig.current().general.TO_TESLA.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.TESLA_MOD_ID)
|
||||
public long getCapacity() {
|
||||
return Math.round(getItem().getEnergy(getStack()) * general.TO_TESLA);
|
||||
return Math.round(getItem().getEnergy(getStack()) * MekanismConfig.current().general.TO_TESLA.val());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package mekanism.common.inventory;
|
||||
|
||||
import mekanism.common.Tier.BinTier;
|
||||
import mekanism.common.tier.BinTier;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
|
||||
import mekanism.common.util.ItemDataUtils;
|
||||
@@ -84,7 +84,7 @@ public class InventoryBin {
|
||||
}
|
||||
|
||||
public int getMaxStorage() {
|
||||
return getTier().storage;
|
||||
return getTier().getStorage();
|
||||
}
|
||||
|
||||
public BinTier getTier() {
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.common.inventory.container;
|
||||
import java.util.Arrays;
|
||||
import javax.annotation.Nonnull;
|
||||
import mekanism.api.infuse.InfuseRegistry;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import mekanism.common.tier.FactoryTier;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge;
|
||||
import mekanism.common.inventory.slot.SlotOutput;
|
||||
|
||||
@@ -4,7 +4,7 @@ import javax.annotation.Nonnull;
|
||||
import mekanism.api.IAlloyInteraction;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.CapabilityUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -28,7 +28,7 @@ public class ItemAlloy extends ItemMekanism {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
|
||||
if (general.allowTransmitterAlloyUpgrade && CapabilityUtils
|
||||
if (MekanismConfig.current().general.allowTransmitterAlloyUpgrade.val() && CapabilityUtils
|
||||
.hasCapability(tile, Capabilities.ALLOY_INTERACTION_CAPABILITY, side)) {
|
||||
if (!world.isRemote) {
|
||||
IAlloyInteraction interaction = CapabilityUtils
|
||||
|
||||
@@ -12,7 +12,7 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.OreDictCache;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.util.ItemDataUtils;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -43,7 +43,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemAtomicDisassembler extends ItemEnergized {
|
||||
|
||||
public double HOE_USAGE = 10 * general.DISASSEMBLER_USAGE;
|
||||
public double HOE_USAGE = 10 * MekanismConfig.current().general.DISASSEMBLER_USAGE.val();
|
||||
|
||||
public ItemAtomicDisassembler() {
|
||||
super(1000000);
|
||||
@@ -94,9 +94,12 @@ public class ItemAtomicDisassembler extends ItemEnergized {
|
||||
public boolean onBlockDestroyed(ItemStack itemstack, World world, IBlockState state, BlockPos pos,
|
||||
EntityLivingBase entityliving) {
|
||||
if (state.getBlockHardness(world, pos) != 0.0D) {
|
||||
setEnergy(itemstack, getEnergy(itemstack) - (general.DISASSEMBLER_USAGE * getEfficiency(itemstack)));
|
||||
setEnergy(itemstack,
|
||||
getEnergy(itemstack) - (MekanismConfig.current().general.DISASSEMBLER_USAGE.val() * getEfficiency(
|
||||
itemstack)));
|
||||
} else {
|
||||
setEnergy(itemstack, getEnergy(itemstack) - (general.DISASSEMBLER_USAGE * (getEfficiency(itemstack)) / 2));
|
||||
setEnergy(itemstack, getEnergy(itemstack) - (
|
||||
MekanismConfig.current().general.DISASSEMBLER_USAGE.val() * (getEfficiency(itemstack)) / 2F));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -145,7 +148,8 @@ public class ItemAtomicDisassembler extends ItemEnergized {
|
||||
Set<Coord4D> found = new Finder(player, stack, new Coord4D(pos, player.world), raytrace).calc();
|
||||
|
||||
for (Coord4D coord : found) {
|
||||
if (coord.equals(orig) || getEnergy(itemstack) < (general.DISASSEMBLER_USAGE * getEfficiency(
|
||||
if (coord.equals(orig) || getEnergy(itemstack) < (
|
||||
MekanismConfig.current().general.DISASSEMBLER_USAGE.val() * getEfficiency(
|
||||
itemstack))) {
|
||||
continue;
|
||||
}
|
||||
@@ -159,7 +163,8 @@ public class ItemAtomicDisassembler extends ItemEnergized {
|
||||
block2.dropBlockAsItem(player.world, coord.getPos(), state, 0);
|
||||
|
||||
setEnergy(itemstack,
|
||||
getEnergy(itemstack) - (general.DISASSEMBLER_USAGE * getEfficiency(itemstack)));
|
||||
getEnergy(itemstack) - (MekanismConfig.current().general.DISASSEMBLER_USAGE.val()
|
||||
* getEfficiency(itemstack)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,18 @@ import javax.annotation.Nonnull;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Tier.BinTier;
|
||||
import mekanism.common.Tier.InductionCellTier;
|
||||
import mekanism.common.Tier.InductionProviderTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.tier.BinTier;
|
||||
import mekanism.common.tier.InductionCellTier;
|
||||
import mekanism.common.tier.InductionProviderTier;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
|
||||
import mekanism.common.inventory.InventoryBin;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
@@ -129,7 +129,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem, ITierIt
|
||||
list.add(EnumColor.DARK_RED + LangUtils.localize("gui.empty"));
|
||||
}
|
||||
|
||||
int cap = BinTier.values()[getBaseTier(itemstack).ordinal()].storage;
|
||||
int cap = BinTier.values()[getBaseTier(itemstack).ordinal()].getStorage();
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + (
|
||||
cap == Integer.MAX_VALUE ? LangUtils.localize("gui.infinite") : cap) + " " + LangUtils
|
||||
.localize("transmission.Items"));
|
||||
@@ -138,12 +138,12 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem, ITierIt
|
||||
|
||||
list.add(
|
||||
tier.getBaseTier().getColor() + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY
|
||||
+ MekanismUtils.getEnergyDisplay(tier.maxEnergy));
|
||||
+ MekanismUtils.getEnergyDisplay(tier.getMaxEnergy()));
|
||||
} else if (type == BasicBlockType.INDUCTION_PROVIDER) {
|
||||
InductionProviderTier tier = InductionProviderTier.values()[getBaseTier(itemstack).ordinal()];
|
||||
|
||||
list.add(tier.getBaseTier().getColor() + LangUtils.localize("tooltip.outputRate") + ": "
|
||||
+ EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.output));
|
||||
+ EnumColor.GREY + MekanismUtils.getEnergyDisplay(tier.getOutput()));
|
||||
}
|
||||
|
||||
if (getMaxEnergy(itemstack) > 0) {
|
||||
@@ -277,7 +277,7 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem, ITierIt
|
||||
@Override
|
||||
public double getMaxEnergy(ItemStack itemStack) {
|
||||
if (BasicBlockType.get(itemStack) == BasicBlockType.INDUCTION_CELL) {
|
||||
return InductionCellTier.values()[getBaseTier(itemStack).ordinal()].maxEnergy;
|
||||
return InductionCellTier.values()[getBaseTier(itemStack).ordinal()].getMaxEnergy();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -9,20 +9,20 @@ import javax.annotation.Nonnull;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismClient;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.tier.EnergyCubeTier;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.capabilities.ItemCapabilityWrapper;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
import mekanism.common.integration.forgeenergy.ForgeEnergyItemWrapper;
|
||||
import mekanism.common.integration.ic2.IC2ItemManager;
|
||||
@@ -82,7 +82,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS
|
||||
list.add(EnumColor.BRIGHT_GREEN + LangUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY
|
||||
+ MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + MekanismUtils
|
||||
.getEnergyDisplay(EnergyCubeTier.values()[getBaseTier(itemstack).ordinal()].maxEnergy));
|
||||
.getEnergyDisplay(EnergyCubeTier.values()[getBaseTier(itemstack).ordinal()].getMaxEnergy()));
|
||||
|
||||
if (!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey)) {
|
||||
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings
|
||||
@@ -215,7 +215,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS
|
||||
|
||||
@Override
|
||||
public double getMaxEnergy(ItemStack itemStack) {
|
||||
return EnergyCubeTier.values()[getBaseTier(itemStack).ordinal()].maxEnergy;
|
||||
return EnergyCubeTier.values()[getBaseTier(itemStack).ordinal()].getMaxEnergy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -238,13 +238,13 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS
|
||||
public int receiveEnergy(ItemStack theItem, int energy, boolean simulate) {
|
||||
if (canReceive(theItem)) {
|
||||
double energyNeeded = getMaxEnergy(theItem) - getEnergy(theItem);
|
||||
double toReceive = Math.min(energy * general.FROM_RF, energyNeeded);
|
||||
double toReceive = Math.min(energy * MekanismConfig.current().general.FROM_RF.val(), energyNeeded);
|
||||
|
||||
if (!simulate) {
|
||||
setEnergy(theItem, getEnergy(theItem) + toReceive);
|
||||
}
|
||||
|
||||
return (int) Math.round(toReceive * general.TO_RF);
|
||||
return (int) Math.round(toReceive * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -255,13 +255,13 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS
|
||||
public int extractEnergy(ItemStack theItem, int energy, boolean simulate) {
|
||||
if (canSend(theItem)) {
|
||||
double energyRemaining = getEnergy(theItem);
|
||||
double toSend = Math.min((energy * general.FROM_RF), energyRemaining);
|
||||
double toSend = Math.min((energy * MekanismConfig.current().general.FROM_RF.val()), energyRemaining);
|
||||
|
||||
if (!simulate) {
|
||||
setEnergy(theItem, getEnergy(theItem) - toSend);
|
||||
}
|
||||
|
||||
return (int) Math.round(toSend * general.TO_RF);
|
||||
return (int) Math.round(toSend * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -270,13 +270,13 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.REDSTONEFLUX_MOD_ID)
|
||||
public int getEnergyStored(ItemStack theItem) {
|
||||
return (int) (getEnergy(theItem) * general.TO_RF);
|
||||
return (int) (getEnergy(theItem) * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.REDSTONEFLUX_MOD_ID)
|
||||
public int getMaxEnergyStored(ItemStack theItem) {
|
||||
return (int) (getMaxEnergy(theItem) * general.TO_RF);
|
||||
return (int) (getMaxEnergy(theItem) * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -321,7 +321,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS
|
||||
|
||||
@Override
|
||||
public SecurityMode getSecurity(ItemStack stack) {
|
||||
if (!general.allowProtection) {
|
||||
if (!MekanismConfig.current().general.allowProtection.val()) {
|
||||
return SecurityMode.PUBLIC;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import javax.annotation.Nonnull;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
@@ -14,13 +15,12 @@ import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismClient;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Tier.GasTankTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.tier.GasTankTier;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.security.ISecurityItem;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
@@ -87,7 +87,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
|
||||
if (place) {
|
||||
TileEntityGasTank tileEntity = (TileEntityGasTank) world.getTileEntity(pos);
|
||||
tileEntity.tier = GasTankTier.values()[getBaseTier(stack).ordinal()];
|
||||
tileEntity.gasTank.setMaxGas(tileEntity.tier.storage);
|
||||
tileEntity.gasTank.setMaxGas(tileEntity.tier.getStorage());
|
||||
tileEntity.gasTank.setGas(getGas(stack));
|
||||
|
||||
ISecurityTile security = tileEntity;
|
||||
@@ -133,7 +133,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
|
||||
list.add(EnumColor.ORANGE + gasStack.getGas().getLocalizedName() + ": " + EnumColor.GREY + amount);
|
||||
}
|
||||
|
||||
int cap = GasTankTier.values()[getBaseTier(itemstack).ordinal()].storage;
|
||||
int cap = GasTankTier.values()[getBaseTier(itemstack).ordinal()].getStorage();
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + (
|
||||
cap == Integer.MAX_VALUE ? LangUtils.localize("gui.infinite") : cap));
|
||||
|
||||
@@ -194,7 +194,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
|
||||
list.add(empty);
|
||||
}
|
||||
|
||||
if (general.prefilledGasTanks) {
|
||||
if (MekanismConfig.current().general.prefilledGasTanks.val()) {
|
||||
for (Gas type : GasRegistry.getRegisteredGasses()) {
|
||||
if (type.isVisible()) {
|
||||
ItemStack filled = new ItemStack(this);
|
||||
@@ -226,12 +226,12 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
|
||||
|
||||
@Override
|
||||
public int getMaxGas(ItemStack itemstack) {
|
||||
return GasTankTier.values()[getBaseTier(itemstack).ordinal()].storage;
|
||||
return GasTankTier.values()[getBaseTier(itemstack).ordinal()].getStorage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRate(ItemStack itemstack) {
|
||||
return GasTankTier.values()[getBaseTier(itemstack).ordinal()].output;
|
||||
return GasTankTier.values()[getBaseTier(itemstack).ordinal()].getOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -334,7 +334,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
|
||||
|
||||
@Override
|
||||
public SecurityMode getSecurity(ItemStack stack) {
|
||||
if (!general.allowProtection) {
|
||||
if (!MekanismConfig.current().general.allowProtection.val()) {
|
||||
return SecurityMode.PUBLIC;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,14 @@ import javax.annotation.Nonnull;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismClient;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Tier.FluidTankTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.tier.FluidTankTier;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.FluidItemWrapper;
|
||||
import mekanism.common.base.IFactory;
|
||||
@@ -31,10 +32,9 @@ import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.base.ISustainedTank;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.capabilities.ItemCapabilityWrapper;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
import mekanism.common.frequency.Frequency;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
import mekanism.common.integration.forgeenergy.ForgeEnergyItemWrapper;
|
||||
@@ -183,7 +183,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
list.add(EnumColor.DARK_RED + LangUtils.localize("gui.empty") + ".");
|
||||
}
|
||||
|
||||
int cap = FluidTankTier.values()[getBaseTier(itemstack).ordinal()].storage;
|
||||
int cap = FluidTankTier.values()[getBaseTier(itemstack).ordinal()].getStorage();
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + (
|
||||
cap == Integer.MAX_VALUE ? LangUtils.localize("gui.infinite") : cap + " mB"));
|
||||
}
|
||||
@@ -315,7 +315,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
if (tileEntity instanceof TileEntityFluidTank) {
|
||||
TileEntityFluidTank tile = (TileEntityFluidTank) tileEntity;
|
||||
tile.tier = FluidTankTier.values()[getBaseTier(stack).ordinal()];
|
||||
tile.fluidTank.setCapacity(tile.tier.storage);
|
||||
tile.fluidTank.setCapacity(tile.tier.getStorage());
|
||||
}
|
||||
|
||||
if (tileEntity instanceof ISecurityTile) {
|
||||
@@ -657,13 +657,13 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
public int receiveEnergy(ItemStack theItem, int energy, boolean simulate) {
|
||||
if (canReceive(theItem)) {
|
||||
double energyNeeded = getMaxEnergy(theItem) - getEnergy(theItem);
|
||||
double toReceive = Math.min(energy * general.FROM_RF, energyNeeded);
|
||||
double toReceive = Math.min(energy * MekanismConfig.current().general.FROM_RF.val(), energyNeeded);
|
||||
|
||||
if (!simulate) {
|
||||
setEnergy(theItem, getEnergy(theItem) + toReceive);
|
||||
}
|
||||
|
||||
return (int) Math.round(toReceive * general.TO_RF);
|
||||
return (int) Math.round(toReceive * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -674,13 +674,13 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
public int extractEnergy(ItemStack theItem, int energy, boolean simulate) {
|
||||
if (canSend(theItem)) {
|
||||
double energyRemaining = getEnergy(theItem);
|
||||
double toSend = Math.min((energy * general.FROM_RF), energyRemaining);
|
||||
double toSend = Math.min((energy * MekanismConfig.current().general.FROM_RF.val()), energyRemaining);
|
||||
|
||||
if (!simulate) {
|
||||
setEnergy(theItem, getEnergy(theItem) - toSend);
|
||||
}
|
||||
|
||||
return (int) Math.round(toSend * general.TO_RF);
|
||||
return (int) Math.round(toSend * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -689,13 +689,13 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.REDSTONEFLUX_MOD_ID)
|
||||
public int getEnergyStored(ItemStack theItem) {
|
||||
return (int) (getEnergy(theItem) * general.TO_RF);
|
||||
return (int) (getEnergy(theItem) * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Method(modid = MekanismHooks.REDSTONEFLUX_MOD_ID)
|
||||
public int getMaxEnergyStored(ItemStack theItem) {
|
||||
return (int) (getMaxEnergy(theItem) * general.TO_RF);
|
||||
return (int) (getMaxEnergy(theItem) * MekanismConfig.current().general.TO_RF.val());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -711,7 +711,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
|
||||
@Override
|
||||
public int getCapacity(ItemStack container) {
|
||||
return FluidTankTier.values()[getBaseTier(container).ordinal()].storage;
|
||||
return FluidTankTier.values()[getBaseTier(container).ordinal()].getStorage();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -805,7 +805,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
|
||||
@Override
|
||||
public SecurityMode getSecurity(ItemStack stack) {
|
||||
if (!general.allowProtection) {
|
||||
if (!MekanismConfig.current().general.allowProtection.val()) {
|
||||
return SecurityMode.PUBLIC;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,18 +6,22 @@ import mcmultipart.api.multipart.IMultipart;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.base.ITierItem;
|
||||
import mekanism.api.TileNetworkList;
|
||||
import mekanism.common.block.states.BlockStateTransmitter.TransmitterType;
|
||||
import mekanism.common.integration.MekanismHooks;
|
||||
import mekanism.common.integration.multipart.MultipartMekanism;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tier.CableTier;
|
||||
import mekanism.common.tier.ConductorTier;
|
||||
import mekanism.common.tier.PipeTier;
|
||||
import mekanism.common.tier.TransporterTier;
|
||||
import mekanism.common.tier.TubeTier;
|
||||
import mekanism.common.tile.transmitter.TileEntitySidedPipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -80,33 +84,33 @@ public class ItemBlockTransmitter extends ItemBlockMultipartAble implements ITie
|
||||
if (transmission == TransmissionType.ENERGY) {
|
||||
list.add(
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + MekanismUtils
|
||||
.getEnergyDisplay(Tier.CableTier.get(tier).cableCapacity) + "/t");
|
||||
.getEnergyDisplay(CableTier.get(tier).getCableCapacity()) + "/t");
|
||||
} else if (transmission == TransmissionType.FLUID) {
|
||||
list.add(
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + Tier.PipeTier
|
||||
.get(tier).pipeCapacity + "mB/t");
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + PipeTier
|
||||
.get(tier).getPipeCapacity() + "mB/t");
|
||||
list.add(
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.pumpRate") + ": " + EnumColor.GREY + Tier.PipeTier
|
||||
.get(tier).pipePullAmount + "mB/t");
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.pumpRate") + ": " + EnumColor.GREY + PipeTier
|
||||
.get(tier).getPipePullAmount() + "mB/t");
|
||||
} else if (transmission == TransmissionType.GAS) {
|
||||
list.add(
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + Tier.TubeTier
|
||||
.get(tier).tubeCapacity + "mB/t");
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + TubeTier
|
||||
.get(tier).getTubeCapacity() + "mB/t");
|
||||
list.add(
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.pumpRate") + ": " + EnumColor.GREY + Tier.TubeTier
|
||||
.get(tier).tubePullAmount + "mB/t");
|
||||
EnumColor.INDIGO + LangUtils.localize("tooltip.pumpRate") + ": " + EnumColor.GREY + TubeTier
|
||||
.get(tier).getTubePullAmount() + "mB/t");
|
||||
} else if (transmission == TransmissionType.ITEM) {
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.speed") + ": " + EnumColor.GREY + (
|
||||
Tier.TransporterTier.get(tier).speed / (100 / 20)) + " m/s");
|
||||
TransporterTier.get(tier).getSpeed() / (100 / 20)) + " m/s");
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.pumpRate") + ": " + EnumColor.GREY
|
||||
+ Tier.TransporterTier.get(tier).pullAmount * 2 + "/s");
|
||||
+ TransporterTier.get(tier).getPullAmount() * 2 + "/s");
|
||||
} else if (transmission == TransmissionType.HEAT) {
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.conduction") + ": " + EnumColor.GREY
|
||||
+ Tier.ConductorTier.get(tier).inverseConduction);
|
||||
+ ConductorTier.get(tier).getInverseConduction());
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.insulation") + ": " + EnumColor.GREY
|
||||
+ Tier.ConductorTier.get(tier).inverseConductionInsulation);
|
||||
+ ConductorTier.get(tier).getBaseConductionInsulation());
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.heatCapacity") + ": " + EnumColor.GREY
|
||||
+ Tier.ConductorTier.get(tier).inverseHeatCapacity);
|
||||
+ ConductorTier.get(tier).getInverseHeatCapacity());
|
||||
}
|
||||
|
||||
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.item;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.tier.BaseTier;
|
||||
import mekanism.common.base.IMetaItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
Loaded 100 of 209 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user