mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the yapping never ends
This commit is contained in:
parent
8c34b0f02f
commit
c19c8ac4f4
@ -7,6 +7,10 @@
|
|||||||
* Old files are still compatible if moved to the new folder, since the base structure of the recipe file is the same
|
* Old files are still compatible if moved to the new folder, since the base structure of the recipe file is the same
|
||||||
* Recipes should work as expected with the `/ntmreload` command
|
* Recipes should work as expected with the `/ntmreload` command
|
||||||
* Recipes now have an optional list for specifying which template folder they are made in
|
* Recipes now have an optional list for specifying which template folder they are made in
|
||||||
|
* Electrolyzing heavy water now has the same yields as regular water, I don't remember why this incsonsistency existed and there was probably a reason for it but I don't care
|
||||||
|
* Electrolyzing fluids now only takes 20 ticks instead of 60
|
||||||
|
* Batch sizes for water and heavy water have been doubled, effectively increasing throughout 6x
|
||||||
|
* The throughput for electrolysis on chemical plants has been halved (but heavy water still has the output buff, effectively remaining unchanged)
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
* Fixed the structure toggle on the world creation screen not working correctly on most world types
|
* Fixed the structure toggle on the world creation screen not working correctly on most world types
|
||||||
|
|||||||
@ -159,52 +159,49 @@ public class CustomMachineConfigJSON {
|
|||||||
configuration.fluidOutCap = machineObject.get("fluidOutCap").getAsInt();
|
configuration.fluidOutCap = machineObject.get("fluidOutCap").getAsInt();
|
||||||
configuration.itemOutCount = machineObject.get("itemOutCount").getAsInt();
|
configuration.itemOutCount = machineObject.get("itemOutCount").getAsInt();
|
||||||
configuration.generatorMode = machineObject.get("generatorMode").getAsBoolean();
|
configuration.generatorMode = machineObject.get("generatorMode").getAsBoolean();
|
||||||
if(machineObject.get("maxPollutionCap")!=null) {
|
if(machineObject.has("maxPollutionCap")) configuration.maxPollutionCap = machineObject.get("maxPollutionCap").getAsInt();
|
||||||
configuration.maxPollutionCap = machineObject.get("maxPollutionCap").getAsInt();
|
if(machineObject.has("fluxMode")) configuration.fluxMode = machineObject.get("fluxMode").getAsBoolean();
|
||||||
}
|
|
||||||
else configuration.maxPollutionCap = 0;
|
|
||||||
if(machineObject.get("fluxMode")!=null) {
|
|
||||||
configuration.fluxMode = machineObject.get("fluxMode").getAsBoolean();
|
|
||||||
}
|
|
||||||
else configuration.fluxMode = false;
|
|
||||||
configuration.recipeSpeedMult = machineObject.get("recipeSpeedMult").getAsDouble();
|
configuration.recipeSpeedMult = machineObject.get("recipeSpeedMult").getAsDouble();
|
||||||
configuration.recipeConsumptionMult = machineObject.get("recipeConsumptionMult").getAsDouble();
|
configuration.recipeConsumptionMult = machineObject.get("recipeConsumptionMult").getAsDouble();
|
||||||
configuration.maxPower = machineObject.get("maxPower").getAsLong();
|
configuration.maxPower = machineObject.get("maxPower").getAsLong();
|
||||||
if(machineObject.get("maxHeat")!=null) {
|
if(machineObject.has("maxHeat")) configuration.maxHeat = machineObject.get("maxHeat").getAsInt();
|
||||||
configuration.maxHeat = machineObject.get("maxHeat").getAsInt();
|
|
||||||
}
|
|
||||||
else configuration.maxHeat = 0;
|
|
||||||
|
|
||||||
if(machineObject.has("recipeShape") && machineObject.has("recipeParts")) {
|
if(machineObject.has("recipeShape") && machineObject.has("recipeParts")) {
|
||||||
JsonArray recipeShape = machineObject.get("recipeShape").getAsJsonArray();
|
try {
|
||||||
JsonArray recipeParts = machineObject.get("recipeParts").getAsJsonArray();
|
JsonArray recipeShape = machineObject.get("recipeShape").getAsJsonArray();
|
||||||
|
JsonArray recipeParts = machineObject.get("recipeParts").getAsJsonArray();
|
||||||
Object[] parts = new Object[recipeShape.size() + recipeParts.size()];
|
|
||||||
|
Object[] parts = new Object[recipeShape.size() + recipeParts.size()];
|
||||||
for(int j = 0; j < recipeShape.size(); j++) {
|
|
||||||
parts[j] = recipeShape.get(j).getAsString();
|
for(int j = 0; j < recipeShape.size(); j++) {
|
||||||
}
|
parts[j] = recipeShape.get(j).getAsString();
|
||||||
|
|
||||||
for(int j = 0; j < recipeParts.size(); j++) {
|
|
||||||
Object o = null;
|
|
||||||
|
|
||||||
if(j % 2 == 0) {
|
|
||||||
o = recipeParts.get(j).getAsString().charAt(0); //god is dead and we killed him
|
|
||||||
} else {
|
|
||||||
AStack a = SerializableRecipe.readAStack(recipeParts.get(j).getAsJsonArray());
|
|
||||||
|
|
||||||
if(a instanceof ComparableStack) o = ((ComparableStack) a).toStack();
|
|
||||||
if(a instanceof OreDictStack) o = ((OreDictStack) a).name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parts[j + recipeShape.size()] = o;
|
for(int j = 0; j < recipeParts.size(); j++) {
|
||||||
|
Object o = null;
|
||||||
|
|
||||||
|
if(j % 2 == 0) {
|
||||||
|
o = recipeParts.get(j).getAsString().charAt(0); //god is dead and we killed him
|
||||||
|
} else {
|
||||||
|
AStack a = SerializableRecipe.readAStack(recipeParts.get(j).getAsJsonArray());
|
||||||
|
|
||||||
|
if(a instanceof ComparableStack) o = ((ComparableStack) a).toStack();
|
||||||
|
if(a instanceof OreDictStack) o = ((OreDictStack) a).name;
|
||||||
|
}
|
||||||
|
|
||||||
|
parts[j + recipeShape.size()] = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack stack = new ItemStack(ModBlocks.custom_machine, 1, i + 100);
|
||||||
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
|
stack.stackTagCompound.setString("machineType", configuration.unlocalizedName);
|
||||||
|
|
||||||
|
CraftingManager.addRecipeAuto(stack, parts);
|
||||||
|
} catch(Exception ex) {
|
||||||
|
MainRegistry.logger.error("Caught exception trying to parse core recipe for custom machine " + configuration.unlocalizedName);
|
||||||
|
MainRegistry.logger.error("recipeShape was" + machineObject.get("recipeShape").toString());
|
||||||
|
MainRegistry.logger.error("recipeParts was" + machineObject.get("recipeParts").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack stack = new ItemStack(ModBlocks.custom_machine, 1, i + 100);
|
|
||||||
stack.stackTagCompound = new NBTTagCompound();
|
|
||||||
stack.stackTagCompound.setString("machineType", configuration.unlocalizedName);
|
|
||||||
|
|
||||||
CraftingManager.addRecipeAuto(stack, parts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonArray components = machineObject.get("components").getAsJsonArray();
|
JsonArray components = machineObject.get("components").getAsJsonArray();
|
||||||
|
|||||||
@ -84,13 +84,13 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
|||||||
}
|
}
|
||||||
outputs.add(new PositionedStack(out, 102 + (i - 3) * 18, 42));
|
outputs.add(new PositionedStack(out, 102 + (i - 3) * 18, 42));
|
||||||
}
|
}
|
||||||
if(recipe.pollutionMode) {
|
|
||||||
this.pollutionType = recipe.pollutionType;
|
this.pollutionType = recipe.pollutionType;
|
||||||
this.pollutionAmount = recipe.pollutionAmount;
|
this.pollutionAmount = recipe.pollutionAmount;
|
||||||
}
|
this.radiationAmount = recipe.radiationAmount;
|
||||||
if(recipe.radiationMode) this.radiationAmount = recipe.radiationAmount;
|
|
||||||
if(conf.fluxMode) this.flux = recipe.flux;
|
if(conf.fluxMode) this.flux = recipe.flux;
|
||||||
if(conf.maxHeat>0 && recipe.heat>0) this.heat = recipe.heat;
|
if(conf.maxHeat > 0 && recipe.heat > 0) this.heat = recipe.heat;
|
||||||
|
|
||||||
this.machine = new PositionedStack(new ItemStack(ModBlocks.custom_machine, 1, 100 + CustomMachineConfigJSON.niceList.indexOf(conf)), 75, 42);
|
this.machine = new PositionedStack(new ItemStack(ModBlocks.custom_machine, 1, 100 + CustomMachineConfigJSON.niceList.indexOf(conf)), 75, 42);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,6 +212,7 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void loadTransferRects() {
|
public void loadTransferRects() {
|
||||||
if(this.conf == null) return;
|
if(this.conf == null) return;
|
||||||
|
transferRects.clear();
|
||||||
transferRects.add(new RecipeTransferRect(new Rectangle(65, 23, 36, 18), "ntm_" + conf.unlocalizedName));
|
transferRects.add(new RecipeTransferRect(new Rectangle(65, 23, 36, 18), "ntm_" + conf.unlocalizedName));
|
||||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ public class GUIElectrolyserFluid extends GuiInfoContainer {
|
|||||||
int p = (int) (electrolyser.power * 89 / electrolyser.maxPower);
|
int p = (int) (electrolyser.power * 89 / electrolyser.maxPower);
|
||||||
drawTexturedModalRect(guiLeft + 186, guiTop + 107 - p, 210, 89 - p, 16, p);
|
drawTexturedModalRect(guiLeft + 186, guiTop + 107 - p, 210, 89 - p, 16, p);
|
||||||
|
|
||||||
if(electrolyser.power >= electrolyser.usage)
|
if(electrolyser.power >= electrolyser.usageFluid)
|
||||||
drawTexturedModalRect(guiLeft + 190, guiTop + 4, 226, 40, 9, 12);
|
drawTexturedModalRect(guiLeft + 190, guiTop + 4, 226, 40, 9, 12);
|
||||||
|
|
||||||
int e = electrolyser.progressFluid * 41 / electrolyser.processFluidTime;
|
int e = electrolyser.progressFluid * 41 / electrolyser.processFluidTime;
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public class GUIElectrolyserMetal extends GuiInfoContainer {
|
|||||||
int p = (int) (electrolyser.power * 89 / electrolyser.maxPower);
|
int p = (int) (electrolyser.power * 89 / electrolyser.maxPower);
|
||||||
drawTexturedModalRect(guiLeft + 186, guiTop + 107 - p, 210, 89 - p, 16, p);
|
drawTexturedModalRect(guiLeft + 186, guiTop + 107 - p, 210, 89 - p, 16, p);
|
||||||
|
|
||||||
if(electrolyser.power >= electrolyser.usage)
|
if(electrolyser.power >= electrolyser.usageOre)
|
||||||
drawTexturedModalRect(guiLeft + 190, guiTop + 4, 226, 25, 9, 12);
|
drawTexturedModalRect(guiLeft + 190, guiTop + 4, 226, 25, 9, 12);
|
||||||
|
|
||||||
int o = electrolyser.progressOre * 26 / electrolyser.processOreTime;
|
int o = electrolyser.progressOre * 26 / electrolyser.processOreTime;
|
||||||
|
|||||||
@ -226,10 +226,10 @@ public class ChemplantRecipes extends SerializableRecipe {
|
|||||||
.inputFluids(new FluidStack(Fluids.PETROLEUM, 200, GeneralConfig.enable528 ? 1 : 0))
|
.inputFluids(new FluidStack(Fluids.PETROLEUM, 200, GeneralConfig.enable528 ? 1 : 0))
|
||||||
.outputItems(new ItemStack(ModItems.rocket_fuel, 4)));
|
.outputItems(new ItemStack(ModItems.rocket_fuel, 4)));
|
||||||
recipes.add(new ChemRecipe(58, "ELECTROLYSIS", 150)
|
recipes.add(new ChemRecipe(58, "ELECTROLYSIS", 150)
|
||||||
.inputFluids(new FluidStack(Fluids.WATER, 8000))
|
.inputFluids(new FluidStack(Fluids.WATER, 4000))
|
||||||
.outputFluids(
|
.outputFluids(
|
||||||
new FluidStack(Fluids.HYDROGEN, 800),
|
new FluidStack(Fluids.HYDROGEN, 400),
|
||||||
new FluidStack(Fluids.OXYGEN, 800)));
|
new FluidStack(Fluids.OXYGEN, 400)));
|
||||||
recipes.add(new ChemRecipe(59, "XENON", 300)
|
recipes.add(new ChemRecipe(59, "XENON", 300)
|
||||||
.inputFluids(new FluidStack(Fluids.NONE, 0))
|
.inputFluids(new FluidStack(Fluids.NONE, 0))
|
||||||
.outputFluids(new FluidStack(Fluids.XENON, 50)));
|
.outputFluids(new FluidStack(Fluids.XENON, 50)));
|
||||||
@ -371,10 +371,10 @@ public class ChemplantRecipes extends SerializableRecipe {
|
|||||||
.inputFluids(new FluidStack(Fluids.GAS, 1000))
|
.inputFluids(new FluidStack(Fluids.GAS, 1000))
|
||||||
.outputFluids(new FluidStack(Fluids.CARBONDIOXIDE, 1000)));
|
.outputFluids(new FluidStack(Fluids.CARBONDIOXIDE, 1000)));
|
||||||
recipes.add(new ChemRecipe(78, "HEAVY_ELECTROLYSIS", 150)
|
recipes.add(new ChemRecipe(78, "HEAVY_ELECTROLYSIS", 150)
|
||||||
.inputFluids(new FluidStack(Fluids.HEAVYWATER, 8000))
|
.inputFluids(new FluidStack(Fluids.HEAVYWATER, 2000))
|
||||||
.outputFluids(
|
.outputFluids(
|
||||||
new FluidStack(Fluids.DEUTERIUM, 400),
|
new FluidStack(Fluids.DEUTERIUM, 200),
|
||||||
new FluidStack(Fluids.OXYGEN, 400)));
|
new FluidStack(Fluids.OXYGEN, 200)));
|
||||||
recipes.add(new ChemRecipe(80, "EPEARL", 100)
|
recipes.add(new ChemRecipe(80, "EPEARL", 100)
|
||||||
.inputItems(new OreDictStack(DIAMOND.dust(), 1))
|
.inputItems(new OreDictStack(DIAMOND.dust(), 1))
|
||||||
.inputFluids(new FluidStack(Fluids.XPJUICE, 500))
|
.inputFluids(new FluidStack(Fluids.XPJUICE, 500))
|
||||||
|
|||||||
@ -36,10 +36,8 @@ public class CustomMachineRecipes extends SerializableRecipe {
|
|||||||
recipe.outputItems = new Pair[] {new Pair(new ItemStack(Items.paper, 3), 1F)};
|
recipe.outputItems = new Pair[] {new Pair(new ItemStack(Items.paper, 3), 1F)};
|
||||||
recipe.duration = 60;
|
recipe.duration = 60;
|
||||||
recipe.consumptionPerTick = 10;
|
recipe.consumptionPerTick = 10;
|
||||||
recipe.pollutionMode = true;
|
|
||||||
recipe.pollutionType = "SOOT";
|
recipe.pollutionType = "SOOT";
|
||||||
recipe.pollutionAmount = 0.03f;
|
recipe.pollutionAmount = 0.03F;
|
||||||
recipe.radiationMode = false;
|
|
||||||
recipe.radiationAmount = 0;
|
recipe.radiationAmount = 0;
|
||||||
recipe.flux = 0;
|
recipe.flux = 0;
|
||||||
recipe.heat = 0;
|
recipe.heat = 0;
|
||||||
@ -80,32 +78,17 @@ public class CustomMachineRecipes extends SerializableRecipe {
|
|||||||
recipeInstance.duration = rec.get("duration").getAsInt();
|
recipeInstance.duration = rec.get("duration").getAsInt();
|
||||||
recipeInstance.consumptionPerTick = rec.get("consumptionPerTick").getAsInt();
|
recipeInstance.consumptionPerTick = rec.get("consumptionPerTick").getAsInt();
|
||||||
|
|
||||||
if(rec.get("pollutionMode")!=null) {
|
if(rec.has("pollutionType") && rec.has("pollutionAmount")) {
|
||||||
recipeInstance.pollutionMode = rec.get("pollutionMode").getAsBoolean();
|
|
||||||
recipeInstance.pollutionType = rec.get("pollutionType").getAsString();
|
recipeInstance.pollutionType = rec.get("pollutionType").getAsString();
|
||||||
recipeInstance.pollutionAmount = rec.get("pollutionAmount").getAsFloat();
|
recipeInstance.pollutionAmount = rec.get("pollutionAmount").getAsFloat();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
recipeInstance.pollutionMode = false;
|
|
||||||
recipeInstance.pollutionType = "";
|
recipeInstance.pollutionType = "";
|
||||||
recipeInstance.pollutionAmount = 0;
|
|
||||||
}
|
}
|
||||||
if(rec.get("radiationMode")!=null) {
|
|
||||||
recipeInstance.radiationMode = rec.get("radiationMode").getAsBoolean();
|
if(rec.has("radiationAmount")) recipeInstance.radiationAmount = rec.get("radiationAmount").getAsFloat();
|
||||||
recipeInstance.radiationAmount = rec.get("radiationAmount").getAsFloat();
|
if(rec.has("flux")) recipeInstance.flux = rec.get("flux").getAsInt();
|
||||||
}
|
if(rec.has("heat")) recipeInstance.heat = rec.get("heat").getAsInt();
|
||||||
else {
|
|
||||||
recipeInstance.radiationMode = false;
|
|
||||||
recipeInstance.radiationAmount = 0;
|
|
||||||
}
|
|
||||||
if(rec.get("flux")!=null) {
|
|
||||||
recipeInstance.flux = rec.get("flux").getAsInt();
|
|
||||||
}
|
|
||||||
else recipeInstance.flux = 0;
|
|
||||||
if(rec.get("heat")!=null) {
|
|
||||||
recipeInstance.heat = rec.get("heat").getAsInt();
|
|
||||||
}
|
|
||||||
else recipeInstance.heat = 0;
|
|
||||||
list.add(recipeInstance);
|
list.add(recipeInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,10 +123,8 @@ public class CustomMachineRecipes extends SerializableRecipe {
|
|||||||
|
|
||||||
writer.name("duration").value(recipeInstance.duration);
|
writer.name("duration").value(recipeInstance.duration);
|
||||||
writer.name("consumptionPerTick").value(recipeInstance.consumptionPerTick);
|
writer.name("consumptionPerTick").value(recipeInstance.consumptionPerTick);
|
||||||
writer.name("pollutionMode").value(recipeInstance.pollutionMode);
|
|
||||||
writer.name("pollutionType").value(recipeInstance.pollutionType);
|
writer.name("pollutionType").value(recipeInstance.pollutionType);
|
||||||
writer.name("pollutionAmount").value(recipeInstance.pollutionAmount);
|
writer.name("pollutionAmount").value(recipeInstance.pollutionAmount);
|
||||||
writer.name("radiationMode").value(recipeInstance.radiationMode);
|
|
||||||
writer.name("radiationnAmount").value(recipeInstance.radiationAmount);
|
writer.name("radiationnAmount").value(recipeInstance.radiationAmount);
|
||||||
writer.name("flux").value(recipeInstance.flux);
|
writer.name("flux").value(recipeInstance.flux);
|
||||||
writer.name("heat").value(recipeInstance.heat);
|
writer.name("heat").value(recipeInstance.heat);
|
||||||
@ -163,11 +144,9 @@ public class CustomMachineRecipes extends SerializableRecipe {
|
|||||||
|
|
||||||
public int duration;
|
public int duration;
|
||||||
public int consumptionPerTick;
|
public int consumptionPerTick;
|
||||||
public boolean pollutionMode;
|
|
||||||
|
|
||||||
public String pollutionType;
|
public String pollutionType;
|
||||||
public float pollutionAmount;
|
public float pollutionAmount;
|
||||||
public boolean radiationMode;
|
|
||||||
public float radiationAmount;
|
public float radiationAmount;
|
||||||
public int flux;
|
public int flux;
|
||||||
public int heat;
|
public int heat;
|
||||||
|
|||||||
@ -24,8 +24,8 @@ public class ElectrolyserFluidRecipes extends SerializableRecipe {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerDefaults() {
|
public void registerDefaults() {
|
||||||
recipes.put(Fluids.WATER, new ElectrolysisRecipe(1_000, new FluidStack(Fluids.HYDROGEN, 100), new FluidStack(Fluids.OXYGEN, 100)));
|
recipes.put(Fluids.WATER, new ElectrolysisRecipe(2_000, new FluidStack(Fluids.HYDROGEN, 200), new FluidStack(Fluids.OXYGEN, 200)));
|
||||||
recipes.put(Fluids.HEAVYWATER, new ElectrolysisRecipe(1_000, new FluidStack(Fluids.DEUTERIUM, 50), new FluidStack(Fluids.OXYGEN, 50)));
|
recipes.put(Fluids.HEAVYWATER, new ElectrolysisRecipe(2_000, new FluidStack(Fluids.DEUTERIUM, 200), new FluidStack(Fluids.OXYGEN, 200)));
|
||||||
|
|
||||||
recipes.put(Fluids.POTASSIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.NONE, 0), new ItemStack(ModItems.dust)));
|
recipes.put(Fluids.POTASSIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.NONE, 0), new ItemStack(ModItems.dust)));
|
||||||
recipes.put(Fluids.CALCIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.CALCIUM_SOLUTION, 125)));
|
recipes.put(Fluids.CALCIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.CALCIUM_SOLUTION, 125)));
|
||||||
|
|||||||
@ -259,21 +259,17 @@ public class TileEntityCustomMachine extends TileEntityMachinePolluting implemen
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public void pollution(CustomMachineRecipe recipe) {
|
public void pollution(CustomMachineRecipe recipe) {
|
||||||
if (recipe.pollutionMode) {
|
if(recipe.pollutionAmount > 0) {
|
||||||
if (recipe.pollutionAmount > 0) {
|
this.pollute(PollutionHandler.PollutionType.valueOf(recipe.pollutionType), recipe.pollutionAmount);
|
||||||
this.pollute(PollutionHandler.PollutionType.valueOf(recipe.pollutionType), recipe.pollutionAmount);
|
} else if(recipe.pollutionAmount < 0 && PollutionHandler.getPollution(worldObj, xCoord, yCoord, zCoord, PollutionHandler.PollutionType.valueOf(recipe.pollutionType)) >= -recipe.pollutionAmount) {
|
||||||
} else if (recipe.pollutionAmount < 0 && PollutionHandler.getPollution(worldObj, xCoord, yCoord, zCoord, PollutionHandler.PollutionType.valueOf(recipe.pollutionType)) >= -recipe.pollutionAmount) {
|
PollutionHandler.decrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionHandler.PollutionType.valueOf(recipe.pollutionType), -recipe.pollutionAmount);
|
||||||
PollutionHandler.decrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionHandler.PollutionType.valueOf(recipe.pollutionType), -recipe.pollutionAmount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void radiation(CustomMachineRecipe recipe){
|
public void radiation(CustomMachineRecipe recipe){
|
||||||
if (recipe.radiationMode) {
|
if(recipe.radiationAmount > 0) {
|
||||||
if (recipe.radiationAmount > 0) {
|
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, recipe.radiationAmount);
|
||||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, recipe.radiationAmount);
|
} else if (recipe.radiationAmount < 0) {
|
||||||
} else if (recipe.radiationAmount < 0) {
|
ChunkRadiationManager.proxy.decrementRad(worldObj, xCoord, yCoord, zCoord, -recipe.radiationAmount);
|
||||||
ChunkRadiationManager.proxy.decrementRad(worldObj, xCoord, yCoord, zCoord, -recipe.radiationAmount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected void tryPullHeat(int x, int y, int z) {
|
protected void tryPullHeat(int x, int y, int z) {
|
||||||
|
|||||||
@ -53,11 +53,13 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
|
|
||||||
public long power;
|
public long power;
|
||||||
public static final long maxPower = 20000000;
|
public static final long maxPower = 20000000;
|
||||||
public static final int usageBase = 10000;
|
public static final int usageOreBase = 10_000;
|
||||||
public int usage;
|
public static final int usageFluidBase = 10_000;
|
||||||
|
public int usageOre;
|
||||||
|
public int usageFluid;
|
||||||
|
|
||||||
public int progressFluid;
|
public int progressFluid;
|
||||||
public static final int processFluidTimeBase = 60;
|
public static final int processFluidTimeBase = 20;
|
||||||
public int processFluidTime;
|
public int processFluidTime;
|
||||||
public int progressOre;
|
public int progressOre;
|
||||||
public static final int processOreTimeBase = 600;
|
public static final int processOreTimeBase = 600;
|
||||||
@ -136,11 +138,12 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
|
|
||||||
processFluidTime = processFluidTimeBase - processFluidTimeBase * speedLevel / 4;
|
processFluidTime = processFluidTimeBase - processFluidTimeBase * speedLevel / 4;
|
||||||
processOreTime = processOreTimeBase - processOreTimeBase * speedLevel / 4;
|
processOreTime = processOreTimeBase - processOreTimeBase * speedLevel / 4;
|
||||||
usage = usageBase - usageBase * powerLevel / 4;
|
usageOre = usageOreBase - usageOreBase * powerLevel / 4;
|
||||||
|
usageFluid = usageFluidBase - usageFluidBase * powerLevel / 4;
|
||||||
|
|
||||||
if(this.canProcessFluid()) {
|
if(this.canProcessFluid()) {
|
||||||
this.progressFluid++;
|
this.progressFluid++;
|
||||||
this.power -= this.usage;
|
this.power -= this.usageFluid;
|
||||||
|
|
||||||
if(this.progressFluid >= this.processFluidTime) {
|
if(this.progressFluid >= this.processFluidTime) {
|
||||||
this.processFluids();
|
this.processFluids();
|
||||||
@ -151,7 +154,7 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
|
|
||||||
if(this.canProcesMetal()) {
|
if(this.canProcesMetal()) {
|
||||||
this.progressOre++;
|
this.progressOre++;
|
||||||
this.power -= this.usage;
|
this.power -= this.usageOre;
|
||||||
|
|
||||||
if(this.progressOre >= this.processOreTime) {
|
if(this.progressOre >= this.processOreTime) {
|
||||||
this.processMetal();
|
this.processMetal();
|
||||||
@ -210,7 +213,8 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
data.setLong("power", this.power);
|
data.setLong("power", this.power);
|
||||||
data.setInteger("progressFluid", this.progressFluid);
|
data.setInteger("progressFluid", this.progressFluid);
|
||||||
data.setInteger("progressOre", this.progressOre);
|
data.setInteger("progressOre", this.progressOre);
|
||||||
data.setInteger("usage", this.usage);
|
data.setInteger("usageOre", this.usageOre);
|
||||||
|
data.setInteger("usageFluid", this.usageFluid);
|
||||||
data.setInteger("processFluidTime", this.processFluidTime);
|
data.setInteger("processFluidTime", this.processFluidTime);
|
||||||
data.setInteger("processOreTime", this.processOreTime);
|
data.setInteger("processOreTime", this.processOreTime);
|
||||||
if(this.leftStack != null) {
|
if(this.leftStack != null) {
|
||||||
@ -247,7 +251,8 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
this.power = nbt.getLong("power");
|
this.power = nbt.getLong("power");
|
||||||
this.progressFluid = nbt.getInteger("progressFluid");
|
this.progressFluid = nbt.getInteger("progressFluid");
|
||||||
this.progressOre = nbt.getInteger("progressOre");
|
this.progressOre = nbt.getInteger("progressOre");
|
||||||
this.usage = nbt.getInteger("usage");
|
this.usageOre = nbt.getInteger("usageOre");
|
||||||
|
this.usageFluid = nbt.getInteger("usageFluid");
|
||||||
this.processFluidTime = nbt.getInteger("processFluidTime");
|
this.processFluidTime = nbt.getInteger("processFluidTime");
|
||||||
this.processOreTime = nbt.getInteger("processOreTime");
|
this.processOreTime = nbt.getInteger("processOreTime");
|
||||||
if(nbt.hasKey("leftType")) this.leftStack = new MaterialStack(Mats.matById.get(nbt.getInteger("leftType")), nbt.getInteger("leftAmount"));
|
if(nbt.hasKey("leftType")) this.leftStack = new MaterialStack(Mats.matById.get(nbt.getInteger("leftType")), nbt.getInteger("leftAmount"));
|
||||||
@ -259,7 +264,7 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
|
|
||||||
public boolean canProcessFluid() {
|
public boolean canProcessFluid() {
|
||||||
|
|
||||||
if(this.power < usage) return false;
|
if(this.power < usageFluid) return false;
|
||||||
|
|
||||||
ElectrolysisRecipe recipe = ElectrolyserFluidRecipes.recipes.get(tanks[0].getTankType());
|
ElectrolysisRecipe recipe = ElectrolyserFluidRecipes.recipes.get(tanks[0].getTankType());
|
||||||
|
|
||||||
@ -310,7 +315,7 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
public boolean canProcesMetal() {
|
public boolean canProcesMetal() {
|
||||||
|
|
||||||
if(slots[14] == null) return false;
|
if(slots[14] == null) return false;
|
||||||
if(this.power < usage) return false;
|
if(this.power < usageOre) return false;
|
||||||
if(this.tanks[3].getFill() < 100) return false;
|
if(this.tanks[3].getFill() < 100) return false;
|
||||||
|
|
||||||
ElectrolysisMetalRecipe recipe = ElectrolyserMetalRecipes.getRecipe(slots[14]);
|
ElectrolysisMetalRecipe recipe = ElectrolyserMetalRecipes.getRecipe(slots[14]);
|
||||||
@ -382,7 +387,6 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
this.power = nbt.getLong("power");
|
this.power = nbt.getLong("power");
|
||||||
this.progressFluid = nbt.getInteger("progressFluid");
|
this.progressFluid = nbt.getInteger("progressFluid");
|
||||||
this.progressOre = nbt.getInteger("progressOre");
|
this.progressOre = nbt.getInteger("progressOre");
|
||||||
this.usage = nbt.getInteger("usage");
|
|
||||||
this.processFluidTime = nbt.getInteger("processFluidTime");
|
this.processFluidTime = nbt.getInteger("processFluidTime");
|
||||||
this.processOreTime = nbt.getInteger("processOreTime");
|
this.processOreTime = nbt.getInteger("processOreTime");
|
||||||
if(nbt.hasKey("leftType")) this.leftStack = new MaterialStack(Mats.matById.get(nbt.getInteger("leftType")), nbt.getInteger("leftAmount"));
|
if(nbt.hasKey("leftType")) this.leftStack = new MaterialStack(Mats.matById.get(nbt.getInteger("leftType")), nbt.getInteger("leftAmount"));
|
||||||
@ -399,7 +403,6 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
|||||||
nbt.setLong("power", this.power);
|
nbt.setLong("power", this.power);
|
||||||
nbt.setInteger("progressFluid", this.progressFluid);
|
nbt.setInteger("progressFluid", this.progressFluid);
|
||||||
nbt.setInteger("progressOre", this.progressOre);
|
nbt.setInteger("progressOre", this.progressOre);
|
||||||
nbt.setInteger("usage", this.usage);
|
|
||||||
nbt.setInteger("processFluidTime", this.processFluidTime);
|
nbt.setInteger("processFluidTime", this.processFluidTime);
|
||||||
nbt.setInteger("processOreTime", this.processOreTime);
|
nbt.setInteger("processOreTime", this.processOreTime);
|
||||||
if(this.leftStack != null) {
|
if(this.leftStack != null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user