This commit is contained in:
Boblet 2025-12-15 15:33:10 +01:00
parent fa12cfeec1
commit 82f175105c
10 changed files with 109 additions and 50 deletions

View File

@ -1,5 +1,10 @@
## Changed
* Updated russian localization
* Changed the recipe change button on the mixer to be bright red with arrows on it (since the "C" looked too much like it meant "clear")
* The refinery and the vacuum refinery now have working recipe configs
* Recipe autogen for foundry casting now deprioritizes fragments, preventing them from being casted when nuggets of that material are available
## Fixed
* Fixed atomic clock precision assembler recipe not working
* Fixed atomic clock precision assembler recipe not working
* Fixed ICF parts using 528 mode templates in normal mode
* Fixed arc furnace queue slots inserting too many items, causing the output to exceed max stack size

View File

@ -1,6 +1,6 @@
mod_version=1.0.27
# Empty build number makes a release type
mod_build_number=5544
mod_build_number=5545
credits=HbMinecraft,\
\ rodolphito (explosion algorithms),\

View File

@ -1,11 +1,9 @@
package com.hbm.inventory.gui;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.recipes.RefineryRecipes;
import com.hbm.util.Tuple;
import com.hbm.inventory.recipes.RefineryRecipes.RefineryRecipe;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachineRefinery;
@ -83,7 +81,7 @@ public class GUIMachineRefinery extends GuiInfoContainer {
// pipes
Tuple.Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> recipe = RefineryRecipes.getRefinery(inputOil.getTankType());
RefineryRecipe recipe = RefineryRecipes.getRefinery(inputOil.getTankType());
if(recipe == null) {
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
@ -93,27 +91,27 @@ public class GUIMachineRefinery extends GuiInfoContainer {
} else {
// Heavy Oil Products
Color color = new Color(recipe.getV().type.getColor());
Color color = new Color(recipe.outputs[0].type.getColor());
GL11.glEnable(GL11.GL_BLEND);
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
// Naphtha Oil Products
color = new Color(recipe.getW().type.getColor());
color = new Color(recipe.outputs[1].type.getColor());
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 52, guiTop + 32, 247, 50, 66, 52, 350, 256);
// Light Oil Products
color = new Color(recipe.getX().type.getColor());
color = new Color(recipe.outputs[2].type.getColor());
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 52, guiTop + 24, 247, 145, 86, 35, 350, 256);
// Gaseous Products
color = new Color(recipe.getY().type.getColor());
color = new Color(recipe.outputs[3].type.getColor());
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1F, 1F, 1F, 1F);
}

View File

@ -1,22 +1,26 @@
package com.hbm.inventory.recipes;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.OreDictManager.DictFrame;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums.EnumTarType;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.util.ItemStackUtil;
import com.hbm.util.Tuple.Quintet;
import net.minecraft.item.ItemStack;
public class RefineryRecipes {
public class RefineryRecipes extends SerializableRecipe {
/// fractions in percent ///
public static final int oil_frac_heavy = 50;
@ -37,51 +41,32 @@ public class RefineryRecipes {
public static final int crackds_frac_aroma = 15;
public static final int crackds_frac_unsat = 15;
private static Map<FluidType, Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack>> refinery = new HashMap();
public static HashMap<Object, Object[]> getRefineryRecipe() {
private static Map<FluidType, RefineryRecipe> recipes = new HashMap();
HashMap<Object, Object[]> recipes = new HashMap<Object, Object[]>();
for(Entry<FluidType, Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack>> recipe : refinery.entrySet()) {
Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> fluids = recipe.getValue();
recipes.put(ItemFluidIcon.make(recipe.getKey(), 1000),
new ItemStack[] {
ItemFluidIcon.make(fluids.getV().type, fluids.getV().fill * 10),
ItemFluidIcon.make(fluids.getW().type, fluids.getW().fill * 10),
ItemFluidIcon.make(fluids.getX().type, fluids.getX().fill * 10),
ItemFluidIcon.make(fluids.getY().type, fluids.getY().fill * 10),
ItemStackUtil.carefulCopy(fluids.getZ()) });
}
return recipes;
}
public static void registerRefinery() {
refinery.put(Fluids.HOTOIL, new Quintet(
@Override
public void registerDefaults() {
recipes.put(Fluids.HOTOIL, new RefineryRecipe(
new FluidStack(Fluids.HEAVYOIL, oil_frac_heavy),
new FluidStack(Fluids.NAPHTHA, oil_frac_naph),
new FluidStack(Fluids.LIGHTOIL, oil_frac_light),
new FluidStack(Fluids.PETROLEUM, oil_frac_petro),
new ItemStack(ModItems.sulfur)
));
refinery.put(Fluids.HOTCRACKOIL, new Quintet(
recipes.put(Fluids.HOTCRACKOIL, new RefineryRecipe(
new FluidStack(Fluids.NAPHTHA_CRACK, crack_frac_naph),
new FluidStack(Fluids.LIGHTOIL_CRACK, crack_frac_light),
new FluidStack(Fluids.AROMATICS, crack_frac_aroma),
new FluidStack(Fluids.UNSATURATEDS, crack_frac_unsat),
DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)
));
refinery.put(Fluids.HOTOIL_DS, new Quintet(
recipes.put(Fluids.HOTOIL_DS, new RefineryRecipe(
new FluidStack(Fluids.HEAVYOIL, oilds_frac_heavy),
new FluidStack(Fluids.NAPHTHA_DS, oilds_frac_naph),
new FluidStack(Fluids.LIGHTOIL_DS, oilds_frac_light),
new FluidStack(Fluids.UNSATURATEDS, oilds_frac_unsat),
DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN)
));
refinery.put(Fluids.HOTCRACKOIL_DS, new Quintet(
recipes.put(Fluids.HOTCRACKOIL_DS, new RefineryRecipe(
new FluidStack(Fluids.NAPHTHA_DS, crackds_frac_naph),
new FluidStack(Fluids.LIGHTOIL_DS, crackds_frac_light),
new FluidStack(Fluids.AROMATICS, crackds_frac_aroma),
@ -90,7 +75,75 @@ public class RefineryRecipes {
));
}
public static Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> getRefinery(FluidType oil) {
return refinery.get(oil);
public static RefineryRecipe getRefinery(FluidType oil) {
return recipes.get(oil);
}
@Override public String getFileName() { return "hbmRefinery.json"; }
@Override public Object getRecipeObject() { return recipes; }
@Override public void deleteRecipes() { recipes.clear(); }
@Override public String getComment() {
return "Inputs always assume 100mB, input ammount cannot be changed.";
}
@Override
public void readRecipe(JsonElement recipe) {
JsonObject obj = recipe.getAsJsonObject();
FluidType type = Fluids.fromName(obj.get("input").getAsString());
FluidStack o0 = this.readFluidStack(obj.get("output0").getAsJsonArray());
FluidStack o1 = this.readFluidStack(obj.get("output1").getAsJsonArray());
FluidStack o2 = this.readFluidStack(obj.get("output2").getAsJsonArray());
FluidStack o3 = this.readFluidStack(obj.get("output3").getAsJsonArray());
ItemStack solid = this.readItemStack(obj.get("solid").getAsJsonArray());
recipes.put(type, new RefineryRecipe(o0, o1, o2, o3, solid));
}
@Override
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
Entry<FluidType, RefineryRecipe> rec = (Entry<FluidType, RefineryRecipe>) recipe;
writer.name("input").value(rec.getKey().getName());
for(int i = 0; i < 4; i++) {
writer.name("output" + i);
this.writeFluidStack(rec.getValue().outputs[i], writer);
}
writer.name("solid");
this.writeItemStack(rec.getValue().solid, writer);
}
public static HashMap<Object, Object[]> getRefineryRecipe() {
HashMap<Object, Object[]> recipes = new HashMap<Object, Object[]>();
for(Entry<FluidType, RefineryRecipe> recipe : RefineryRecipes.recipes.entrySet()) {
RefineryRecipe fluids = recipe.getValue();
recipes.put(ItemFluidIcon.make(recipe.getKey(), 1000),
new ItemStack[] {
ItemFluidIcon.make(fluids.outputs[0].type, fluids.outputs[0].fill * 10),
ItemFluidIcon.make(fluids.outputs[1].type, fluids.outputs[1].fill * 10),
ItemFluidIcon.make(fluids.outputs[2].type, fluids.outputs[2].fill * 10),
ItemFluidIcon.make(fluids.outputs[3].type, fluids.outputs[3].fill * 10),
ItemStackUtil.carefulCopy(fluids.solid) });
}
return recipes;
}
public static class RefineryRecipe {
public FluidStack[] outputs;
public ItemStack solid;
public RefineryRecipe(FluidStack f0, FluidStack f1, FluidStack f2, FluidStack f3, ItemStack f4) {
this.outputs = new FluidStack[] {f0, f1, f2, f3};
this.solid = f4;
}
}
}

View File

@ -59,6 +59,7 @@ public abstract class SerializableRecipe {
recipeHandlers.add(new CrucibleRecipes());
recipeHandlers.add(new CentrifugeRecipes());
recipeHandlers.add(new CrystallizerRecipes());
recipeHandlers.add(new RefineryRecipes());
recipeHandlers.add(new VacuumRefineryRecipes());
recipeHandlers.add(new FractionRecipes());
recipeHandlers.add(new CrackingRecipes());

View File

@ -187,7 +187,9 @@ public class ItemMold extends Item {
if(!ores.isEmpty()) {
//prioritize NTM items
for(ItemStack ore : ores) {
if(Item.itemRegistry.getNameForObject(ore.getItem()).startsWith(RefStrings.MODID)) {
String registry = Item.itemRegistry.getNameForObject(ore.getItem());
if(registry.startsWith(RefStrings.MODID)) {
if(registry.contains("fragment")) continue; // deprioritize fragments
ItemStack copy = ore.copy();
copy.stackSize = this.amount;
return copy;

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (5544)";
public static final String VERSION = "1.0.27 BETA (5545)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -552,7 +552,6 @@ public class MainRegistry {
MagicRecipes.register();
LemegetonRecipes.register();
SILEXRecipes.register();
RefineryRecipes.registerRefinery();
GasCentrifugeRecipes.register();
CustomMachineConfigJSON.initialize();

View File

@ -279,11 +279,13 @@ public class TileEntityMachineArcFurnaceLarge extends TileEntityMachineBase impl
if(slots[q] == null) continue;
ArcFurnaceRecipe recipe = ArcFurnaceRecipes.getOutput(slots[q], this.liquidMode);
if(recipe == null) continue;
int max = this.getMaxInputSize();
int recipeMax = this.liquidMode ? max : slots[q].getMaxStackSize() / recipe.solidOutput.stackSize;
max = Math.min(max, recipeMax);
// add to existing stacks
for(int i /* ingredient */ = 5; i < 25; i++) {
if(slots[i] == null) continue;
int max = this.getMaxInputSize();
if(!slots[q].isItemEqual(slots[i])) continue;
int toMove = BobMathUtil.min(slots[i].getMaxStackSize() - slots[i].stackSize, slots[q].stackSize, max - slots[i].stackSize);
if(toMove > 0) {
@ -297,7 +299,6 @@ public class TileEntityMachineArcFurnaceLarge extends TileEntityMachineBase impl
// add to empty slot
if(slots[q] != null) for(int i /* ingredient */ = 5; i < 25; i++) {
if(slots[i] != null) continue;
int max = this.getMaxInputSize();
int toMove = Math.min(max, slots[q].stackSize);
slots[i] = slots[q].copy();
slots[i].stackSize = toMove;

View File

@ -20,13 +20,13 @@ import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.gui.GUIMachineRefinery;
import com.hbm.inventory.recipes.RefineryRecipes;
import com.hbm.inventory.recipes.RefineryRecipes.RefineryRecipe;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.*;
import com.hbm.util.ParticleUtil;
import com.hbm.util.Tuple.Quintet;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energymk2.IEnergyReceiverMK2;
@ -266,13 +266,13 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
}
private void refine() {
Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> refinery = RefineryRecipes.getRefinery(tanks[0].getTankType());
RefineryRecipe refinery = RefineryRecipes.getRefinery(tanks[0].getTankType());
if(refinery == null) {
for(int i = 1; i < 5; i++) tanks[i].setTankType(Fluids.NONE);
return;
}
FluidStack[] stacks = new FluidStack[] {refinery.getV(), refinery.getW(), refinery.getX(), refinery.getY()};
FluidStack[] stacks = refinery.outputs;
for(int i = 0; i < stacks.length; i++) tanks[i + 1].setTankType(stacks[i].type);
@ -294,7 +294,7 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
if(this.sulfur >= maxSulfur) {
this.sulfur -= maxSulfur;
ItemStack out = refinery.getZ();
ItemStack out = refinery.solid;
if(out != null) {