mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 12:59:41 +00:00
Added new "machines" section to config - specifically enable or disable any core Mekanism machinery, including options to remove already-existing machinery from worlds
This commit is contained in:
1 parent
6d291c8bbc
commit
ff91bf72fe
8 files changed
+168
-47
No files matched your search
@@ -1,18 +1,18 @@
|
||||
package mekanism.common.network;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.MekanismConfig.machines;
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.api.util.UnitDisplayUtils.EnergyType;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IModule;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.network.PacketConfigSync.ConfigSyncMessage;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMessage>
|
||||
{
|
||||
@Override
|
||||
@@ -53,6 +53,11 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
dataStream.writeDouble(general.minerSilkMultiplier);
|
||||
dataStream.writeBoolean(general.blacklistIC2);
|
||||
dataStream.writeBoolean(general.blacklistRF);
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
{
|
||||
dataStream.writeBoolean(machines.isEnabled(type));
|
||||
}
|
||||
|
||||
dataStream.writeDouble(usage.enrichmentChamberUsage);
|
||||
dataStream.writeDouble(usage.osmiumCompressorUsage);
|
||||
@@ -115,6 +120,11 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
general.minerSilkMultiplier = dataStream.readDouble();
|
||||
general.blacklistIC2 = dataStream.readBoolean();
|
||||
general.blacklistRF = dataStream.readBoolean();
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
{
|
||||
machines.setEntry(type, dataStream.readBoolean());
|
||||
}
|
||||
|
||||
usage.enrichmentChamberUsage = dataStream.readDouble();
|
||||
usage.osmiumCompressorUsage = dataStream.readDouble();
|
||||
|
||||
Reference in new issue
Block a user