Added recipe for PRC, energy type is now controlled by server (closes #1369)

This commit is contained in:
Aidan C. Brady 2014-06-16 02:09:31 +02:00
parent 75f09adba2
commit 5fd89a7959
4 changed files with 31 additions and 24 deletions

View file

@ -165,29 +165,6 @@ public class ClientProxy extends CommonProxy
MekanismClient.holidays = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "Holidays", true).getBoolean(true);
MekanismClient.baseSoundVolume = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SoundVolume", 1D).getDouble(1D);
MekanismClient.machineEffects = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MachineEffects", true).getBoolean(true);
String s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyType", "J").getString();
if(s != null)
{
if(s.trim().equalsIgnoreCase("j") || s.trim().equalsIgnoreCase("joules"))
{
Mekanism.activeType = EnergyType.J;
}
else if(s.trim().equalsIgnoreCase("rf") || s.trim().equalsIgnoreCase("te") || s.trim().equalsIgnoreCase("thermal expansion"))
{
Mekanism.activeType = EnergyType.RF;
}
else if(s.trim().equalsIgnoreCase("eu") || s.trim().equalsIgnoreCase("ic2"))
{
Mekanism.activeType = EnergyType.EU;
}
else if(s.trim().equalsIgnoreCase("mj") || s.trim().equalsIgnoreCase("bc") || s.trim().equalsIgnoreCase("buildcraft"))
{
Mekanism.activeType = EnergyType.MJ;
}
}
Mekanism.configuration.save();
}

View file

@ -3,6 +3,7 @@ package mekanism.common;
import java.io.File;
import mekanism.api.MekanismAPI;
import mekanism.common.EnergyDisplay.EnergyType;
import mekanism.common.entity.EntityRobit;
import mekanism.common.inventory.container.ContainerAdvancedElectricMachine;
import mekanism.common.inventory.container.ContainerChanceMachine;
@ -203,6 +204,28 @@ public class CommonProxy
Mekanism.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123).getInt();
//If this is less than 1, upgrades make machines worse. If less than 0, I don't even know.
Mekanism.maxUpgradeMultiplier = Math.max(1, Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpgradeModifier", 10).getInt());
String s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyType", "J").getString();
if(s != null)
{
if(s.trim().equalsIgnoreCase("j") || s.trim().equalsIgnoreCase("joules"))
{
Mekanism.activeType = EnergyType.J;
}
else if(s.trim().equalsIgnoreCase("rf") || s.trim().equalsIgnoreCase("te") || s.trim().equalsIgnoreCase("thermal expansion"))
{
Mekanism.activeType = EnergyType.RF;
}
else if(s.trim().equalsIgnoreCase("eu") || s.trim().equalsIgnoreCase("ic2"))
{
Mekanism.activeType = EnergyType.EU;
}
else if(s.trim().equalsIgnoreCase("mj") || s.trim().equalsIgnoreCase("bc") || s.trim().equalsIgnoreCase("buildcraft"))
{
Mekanism.activeType = EnergyType.MJ;
}
}
Mekanism.TO_TE = Mekanism.TO_BC*10;
Mekanism.FROM_TE = Mekanism.FROM_BC/10;

View file

@ -579,7 +579,11 @@ public class Mekanism
"SLS", "STS", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('L'), new ItemStack(Items.dye, 1, 4)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock2, 1, 9), new Object[] {
"TLT", "CIC", "TTT", Character.valueOf('T'), "ingotTin", Character.valueOf('L'), new ItemStack(Items.dye, 1, 4), Character.valueOf('C'), "circuitBasic"
"TLT", "CIC", "TTT", Character.valueOf('T'), "ingotTin", Character.valueOf('L'), new ItemStack(Items.dye, 1, 4), Character.valueOf('C'), "circuitBasic", Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock2, 1, 10), new Object[] {
"TET", "CIC", "GFG", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), EnrichedAlloy, Character.valueOf('C'), "circuitBasic", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(),
Character.valueOf('I'), new ItemStack(MachineBlock, 1, 0), Character.valueOf('F'), new ItemStack(BasicBlock, 1, 9)
}));
for(RecipeType type : RecipeType.values())

View file

@ -1,6 +1,7 @@
package mekanism.common.network;
import io.netty.buffer.ByteBuf;
import mekanism.common.EnergyDisplay.EnergyType;
import mekanism.common.IModule;
import mekanism.common.Mekanism;
import mekanism.common.network.PacketConfigSync.ConfigSyncMessage;
@ -49,6 +50,7 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
dataStream.writeDouble(Mekanism.ENERGY_PER_REDSTONE);
dataStream.writeInt(Mekanism.VOICE_PORT);
dataStream.writeInt(Mekanism.maxUpgradeMultiplier);
dataStream.writeInt(Mekanism.activeType.ordinal());
dataStream.writeDouble(Mekanism.enrichmentChamberUsage);
dataStream.writeDouble(Mekanism.osmiumCompressorUsage);
@ -109,6 +111,7 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
Mekanism.ENERGY_PER_REDSTONE = dataStream.readDouble();
Mekanism.VOICE_PORT = dataStream.readInt();
Mekanism.maxUpgradeMultiplier = dataStream.readInt();
Mekanism.activeType = EnergyType.values()[dataStream.readInt()];
Mekanism.TO_TE = Mekanism.TO_BC*10;
Mekanism.FROM_TE = Mekanism.FROM_BC/10;