Fixed PRC varying reaction time not being applied

This commit is contained in:
Aidan C. Brady 2015-03-05 08:53:01 -05:00
parent abd581b2f1
commit 1237230637
5 changed files with 24 additions and 1 deletions

View file

@ -583,7 +583,7 @@ public class Mekanism
//Plastic stuff
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MekanismItems.Polyethene, 1, 1), new Object[] {
"PP", "PP", "PP", Character.valueOf('P'), new ItemStack(MekanismItems.Polyethene, 1, 0)
"PP", "PP", Character.valueOf('P'), new ItemStack(MekanismItems.Polyethene, 1, 0)
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MekanismItems.Polyethene, 1, 2), new Object[] {
"PPP", "P P", "PPP", Character.valueOf('P'), new ItemStack(MekanismItems.Polyethene, 1, 0)
@ -683,6 +683,7 @@ public class Mekanism
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Blocks.clay), new ItemStack(Items.clay_ball, 4));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(MekanismBlocks.SaltBlock), new ItemStack(MekanismItems.Salt, 4));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(Items.diamond), new ItemStack(MekanismItems.CompressedDiamond));
RecipeHandler.addEnrichmentChamberRecipe(new ItemStack(MekanismItems.Polyethene, 3, 0), new ItemStack(MekanismItems.Polyethene, 1, 2));
for(int i = 0; i < EnumColor.DYES.length; i++)
{
@ -810,6 +811,12 @@ public class Mekanism
1000,
60
);
RecipeHandler.addPRCRecipe(
new ItemStack(MekanismItems.Substrate), new FluidStack(FluidRegistry.WATER, 200), new GasStack(GasRegistry.getGas("ethene"), 100),
new ItemStack(MekanismItems.Substrate, 8), new GasStack(GasRegistry.getGas("oxygen"), 10),
200,
400
);
//Solar Neutron Activator Recipes
RecipeHandler.addSolarNeutronRecipe(new GasStack(GasRegistry.getGas("lithium"), 1), new GasStack(GasRegistry.getGas("tritium"), 1));

View file

@ -28,6 +28,7 @@ public class PressurizedRecipe extends MachineRecipe<PressurizedInput, Pressuriz
ticks = duration;
}
@Override
public PressurizedRecipe copy()
{
return new PressurizedRecipe(getInput().copy(), getOutput().copy(), extraEnergy, ticks);

View file

@ -170,6 +170,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
operatingTicks = dataStream.readInt();
clientActive = dataStream.readBoolean();
ticksRequired = dataStream.readInt();
controlType = RedstoneControl.values()[dataStream.readInt()];
for(int i = 0; i < 6; i++)
@ -192,6 +193,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
data.add(operatingTicks);
data.add(isActive);
data.add(ticksRequired);
data.add(controlType.ordinal());
data.add(sideConfig);

View file

@ -190,10 +190,12 @@ public abstract class TileEntityElectricMachine<RECIPE extends BasicMachineRecip
public RECIPE getRecipe()
{
ItemStackInput input = getInput();
if(cachedRecipe == null || !input.testEquality(cachedRecipe.getInput()))
{
cachedRecipe = RecipeHandler.getRecipe(input, getRecipes());
}
return cachedRecipe;
}

View file

@ -15,6 +15,7 @@ import mekanism.api.gas.GasTank;
import mekanism.api.gas.IGasHandler;
import mekanism.api.gas.ITubeConnection;
import mekanism.common.SideData;
import mekanism.common.Upgrade;
import mekanism.common.base.IDropperHandler;
import mekanism.common.base.ISustainedData;
import mekanism.common.block.BlockMachine.MachineType;
@ -83,7 +84,15 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
if(canOperate(recipe) && MekanismUtils.canFunction(this) && getEnergy() >= energyPerTick)
{
boolean update = BASE_TICKS_REQUIRED != recipe.ticks;
BASE_TICKS_REQUIRED = recipe.ticks;
if(update)
{
recalculateUpgradables(Upgrade.SPEED);
}
setActive(true);
if((operatingTicks+1) < ticksRequired)
@ -155,10 +164,12 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
public PressurizedRecipe getRecipe()
{
PressurizedInput input = getInput();
if(cachedRecipe == null || !input.testEquality(cachedRecipe.getInput()))
{
cachedRecipe = RecipeHandler.getPRCRecipe(input);
}
return cachedRecipe;
}