1v1 me on twitter vro

This commit is contained in:
Bob 2025-07-21 00:52:02 +02:00
parent b7641dcd54
commit 05bc334274
16 changed files with 372 additions and 441 deletions

View File

@ -9,6 +9,7 @@
* Replace the journals
* Instead of opening them and making a template, they act as a multi template
* Blueprints need to remain in the slot, removing them will disable the recipes again
* Not actually part of worldgen yet - yeah i ran out of time, cry about it
* More paintables
* Paintable pneumatic tube
* Behaves the exact same as a regular pneumatic tube
@ -38,6 +39,7 @@
* Chemical artillery shell recipes have now been moved to the assembler
* The chemical plant and factory now scale their max power based on the recipe, similar to how the arc welder works
* The chemical plant's default max power is now 100kHE again instead of 1MHE
* The NEI handlers for the old chemplant and assembler have been deactivated, however they will continue to function for the time being
## Fixed
* Fixed gas centrifuge sound persisting when broken or when unloaded

View File

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

View File

@ -1,176 +0,0 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.gui.GUIMachineAssembler;
import com.hbm.inventory.recipes.AssemblerRecipes;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemAssemblyTemplate;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class AssemblerRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_assembler),
new ItemStack(ModBlocks.machine_assemfac)};
}
@Override
public String getRecipeID() {
return "assembly";
}
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe {
List<PositionedStack> input;
PositionedStack result;
public SmeltingSet(List<Object> in, ItemStack result) {
input = new ArrayList();
ComparableStack comp = new ComparableStack(result);
ItemStack template = ItemAssemblyTemplate.writeType(new ItemStack(ModItems.assembly_template), comp);
for(int i = 0; i < Math.min(in.size(), 12); i++) {
input.add(new PositionedStack(in.get(i), 30 + (i % 4) * 18, 6 + (i / 4) * 18));
}
input.add(new PositionedStack(template, 66 + 45, 6));
this.result = new PositionedStack(result, 138, 24);
}
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 48, input);
}
@Override
public PositionedStack getResult() {
return result;
}
}
@Override
public String getRecipeName() {
return "Assembly Machine";
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_assembler.png";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if ((outputId.equals("assembly")) && getClass() == AssemblerRecipeHandler.class) {
Map<ItemStack, List<Object>> recipes = AssemblerRecipes.getRecipes();
for (Map.Entry<ItemStack, List<Object>> recipe : recipes.entrySet()) {
this.arecipes.add(new SmeltingSet(recipe.getValue(), recipe.getKey()));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
Map<ItemStack, List<Object>> recipes = AssemblerRecipes.getRecipes();
for (Map.Entry<ItemStack, List<Object>> recipe : recipes.entrySet()) {
if (NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey(), result))
this.arecipes.add(new SmeltingSet(recipe.getValue(), recipe.getKey()));
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if ((inputId.equals("assembly")) && getClass() == AssemblerRecipeHandler.class) {
loadCraftingRecipes("assembly", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
Map<ItemStack, List<Object>> recipes = AssemblerRecipes.getRecipes();
for (Map.Entry<ItemStack, List<Object>> recipe : recipes.entrySet()) {
for(Object o : recipe.getValue()) {
if(o instanceof ItemStack && NEIServerUtils.areStacksSameTypeCrafting((ItemStack)o, ingredient)) {
this.arecipes.add(new SmeltingSet(recipe.getValue(), recipe.getKey()));
} else if(o instanceof List) {
for(Object obj : (List)o) {
if(obj instanceof ItemStack && NEIServerUtils.areStacksSameTypeCrafting((ItemStack)obj, ingredient)) {
this.arecipes.add(new SmeltingSet(recipe.getValue(), recipe.getKey()));
}
}
}
}
}
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return null;
}
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(138 - 1 - 36, 23, 36, 18), "assembly"));
transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2, 89 - 7 - 11, 18 * 5 - 4, 18 + 16), "assembly"));
guiGui.add(GUIMachineAssembler.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
@Override
public void drawExtras(int recipe) {
drawProgressBar(83 - (18 * 4) - 9 + 1, 6, 0, 86, 16, 18 * 3 - 2, 480, 7);
drawProgressBar(83 - 3 + 16 + 5, 5 + 18, 16, 86, 36, 18, 48, 0);
}
@Override
public TemplateRecipeHandler newInstance() {
return super.newInstance();
}
}

View File

@ -0,0 +1,18 @@
package com.hbm.handler.nei;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.recipes.AssemblyMachineRecipes;
import com.hbm.inventory.recipes.loader.GenericRecipe;
public class AssemblyMachineRecipeHandler extends NEIGenericRecipeHandler {
public AssemblyMachineRecipeHandler() {
super(ModBlocks.machine_assembly_machine.getLocalizedName(), AssemblyMachineRecipes.INSTANCE, ModBlocks.machine_assembly_machine);
}
@Override public String getRecipeID() { return "ntmAssemblyMachine"; }
@Override public int getInputXOffset(GenericRecipe recipe, int inputCount) { return recipe.inputItem != null && recipe.inputItem.length > 9 ? 18 : 0; }
@Override public int getOutputXOffset(GenericRecipe recipe, int outputCount) { return recipe.inputItem != null && recipe.inputItem.length > 9 ? 18 : 0; }
@Override public int getMachineXOffset(GenericRecipe recipe) { return recipe.inputItem != null && recipe.inputItem.length > 9 ? 18 : 0; }
}

View File

@ -3,14 +3,11 @@ package com.hbm.handler.nei;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.recipes.ChemicalPlantRecipes;
public class ChemicalPlantRecipeHandler extends NEIUniversalHandler { //TODO: make a new universal handler
public class ChemicalPlantRecipeHandler extends NEIGenericRecipeHandler {
public ChemicalPlantRecipeHandler() {
super(ModBlocks.machine_chemical_plant.getLocalizedName(), ModBlocks.machine_chemical_plant, ChemicalPlantRecipes.getRecipes());
super(ModBlocks.machine_chemical_plant.getLocalizedName(), ChemicalPlantRecipes.INSTANCE, ModBlocks.machine_chemical_plant, ModBlocks.machine_chemical_factory);
}
@Override
public String getKey() {
return "ntmChemicalPlant";
}
@Override public String getRecipeID() { return "ntmChemicalPlant"; }
}

View File

@ -1,236 +0,0 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.gui.GUIMachineChemplant;
import com.hbm.inventory.recipes.ChemplantRecipes;
import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class ChemplantRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
@Override
public ItemStack[] getMachinesForRecipe() {
return new ItemStack[]{
new ItemStack(ModBlocks.machine_chemplant),
new ItemStack(ModBlocks.machine_chemfac)};
}
@Override
public String getRecipeID() {
return "chemistry";
}
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack[] itemIn = new PositionedStack[4];
PositionedStack[] fluidIn = new PositionedStack[2];
PositionedStack[] itemOut = new PositionedStack[4];
PositionedStack[] fluidOut = new PositionedStack[2];
PositionedStack template;
public RecipeSet(ChemRecipe recipe) {
for(int i = 0; i < recipe.inputs.length; i++) {
AStack in = recipe.inputs[i];
if(in == null) continue;
this.itemIn[i] = new PositionedStack(in.extractForNEI(), 30 + (i % 2) * 18, 24 + (i / 2) * 18);
}
for(int i = 0; i < recipe.inputFluids.length; i++) {
FluidStack in = recipe.inputFluids[i];
if(in == null) continue;
ItemStack drop = ItemFluidIcon.make(in);
this.fluidIn[i] = new PositionedStack(drop, 30 + (i % 2) * 18, 6);
}
for(int i = 0; i < recipe.outputs.length; i++) {
ItemStack out = recipe.outputs[i];
if(out == null) continue;
this.itemOut[i] = new PositionedStack(out, 120 + (i % 2) * 18, 24 + (i / 2) * 18);
}
for(int i = 0; i < recipe.outputFluids.length; i++) {
FluidStack out = recipe.outputFluids[i];
if(out == null) continue;
ItemStack drop = ItemFluidIcon.make(out);
this.fluidOut[i] = new PositionedStack(drop, 120 + (i % 2) * 18, 6);
}
this.template = new PositionedStack(new ItemStack(ModItems.chemistry_template, 1, recipe.getId()), 84, 6);
}
@Override
public List<PositionedStack> getIngredients() {
List<PositionedStack> stacks = new ArrayList<PositionedStack>();
for(PositionedStack stack : itemIn) if(stack != null) stacks.add(stack);
for(PositionedStack stack : fluidIn) if(stack != null) stacks.add(stack);
stacks.add(template);
return getCycledIngredients(cycleticks / 20, stacks);
}
@Override
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> stacks = new ArrayList<PositionedStack>();
for(PositionedStack stack : itemOut) if(stack != null) stacks.add(stack);
for(PositionedStack stack : fluidOut) if(stack != null) stacks.add(stack);
stacks.add(template);
return stacks;
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public String getRecipeName() {
return "Chemical Plant";
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_chemplant.png";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if((outputId.equals("chemistry")) && getClass() == ChemplantRecipeHandler.class) {
for(ChemRecipe recipe : ChemplantRecipes.recipes) {
this.arecipes.add(new RecipeSet(recipe));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
outer:
for(ChemRecipe recipe : ChemplantRecipes.recipes) {
for(ItemStack out : recipe.outputs) {
if(out != null && NEIServerUtils.areStacksSameTypeCrafting(result, out)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
for(FluidStack out : recipe.outputFluids) {
if(out != null) {
ItemStack drop = ItemFluidIcon.make(out.type, out.fill);
if(compareFluidStacks(result, drop)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
}
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if((inputId.equals("chemistry")) && getClass() == ChemplantRecipeHandler.class) {
loadCraftingRecipes("chemistry", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
outer:
for(ChemRecipe recipe : ChemplantRecipes.recipes) {
for(AStack in : recipe.inputs) {
if(in != null) {
List<ItemStack> stacks = in.extractForNEI();
for(ItemStack stack : stacks) {
if(NEIServerUtils.areStacksSameTypeCrafting(ingredient, stack)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
}
}
for(FluidStack in : recipe.inputFluids) {
if(in != null) {
ItemStack drop = ItemFluidIcon.make(in.type, in.fill);
if(compareFluidStacks(ingredient, drop)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
}
}
}
private boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return null;
}
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(138 - 1 - 72, 23, 18 * 3, 18), "chemistry"));
transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2, 89 - 7 - 11, 18 * 5 - 4, 18 + 16), "chemistry"));
guiGui.add(GUIMachineChemplant.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
@Override
public void drawExtras(int recipe) {
drawProgressBar(83 - (18 * 4) - 9 + 1, 6, 0, 86, 16, 18 * 3 - 2, 480, 7);
drawProgressBar(83 - 3 + 16 + 5 - 36, 5 + 18, 16, 86, 18 * 3, 18, 48, 0);
}
@Override
public TemplateRecipeHandler newInstance() {
return super.newInstance();
}
}

View File

@ -0,0 +1,321 @@
package com.hbm.handler.nei;
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import com.hbm.config.ClientConfig;
import com.hbm.handler.imc.ICompatNHNEI;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.recipes.loader.GenericRecipe;
import com.hbm.inventory.recipes.loader.GenericRecipes;
import com.hbm.inventory.recipes.loader.GenericRecipes.IOutput;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemBlueprints;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.block.Block;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public abstract class NEIGenericRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
public final String displayName;
public final GenericRecipes recipeSet;
public final ItemStack[] machines;
public NEIGenericRecipeHandler(String displayName, GenericRecipes recipeSet, Block... machines) {
ItemStack[] machineStacks = new ItemStack[machines.length];
for(int i = 0; i < machines.length; i++) machineStacks[i] = new ItemStack(machines[i]);
this.displayName = displayName;
this.recipeSet = recipeSet;
this.machines = machineStacks;
}
public NEIGenericRecipeHandler(String displayName, GenericRecipes recipeSet, ItemStack... machines) {
this.displayName = displayName;
this.recipeSet = recipeSet;
this.machines = machines;
}
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
protected GenericRecipe recipe;
protected PositionedStack[] input;
protected PositionedStack[] output;
protected PositionedStack machine;
protected PositionedStack template;
public RecipeSet(GenericRecipe recipe) {
this.recipe = recipe;
int inputSize = 0;
int outputSize = 0;
if(recipe.inputItem != null) inputSize += recipe.inputItem.length; // sure a ternary is "less code" but is it more readable? no? thought so
if(recipe.inputFluid != null) inputSize += recipe.inputFluid.length;
if(recipe.outputItem != null) outputSize += recipe.outputItem.length;
if(recipe.outputFluid != null) outputSize += recipe.outputFluid.length;
int inputOffset = getInputXOffset(recipe, inputSize);
int outputOffset = getOutputXOffset(recipe, outputSize);
int machineOffset = getMachineXOffset(recipe);
this.input = new PositionedStack[inputSize];
int[][] inPos = getInputSlotPositions(inputSize);
inputSize = 0; // just gonna reuse this because fuck it why not
if(recipe.inputItem != null) for(int i = 0; i < recipe.inputItem.length; i++) {
this.input[i] = new PositionedStack(recipe.inputItem[i].extractForNEI(), inPos[i][0] + inputOffset, inPos[i][1]);
inputSize = i + 1;
}
if(recipe.inputFluid != null) for(int i = 0; i < recipe.inputFluid.length; i++) {
this.input[inputSize + i] = new PositionedStack(ItemFluidIcon.make(recipe.inputFluid[i]), inPos[inputSize + i][0] + inputOffset, inPos[inputSize + i][1]);
}
int[][] outPos = getOutputSlotPositions(outputSize);
this.output = new PositionedStack[outputSize];
outputSize = 0;
if(recipe.outputItem != null) for(int i = 0; i < recipe.outputItem.length; i++) {
this.output[i] = new PositionedStack(recipe.outputItem[i].getAllPossibilities(), outPos[i][0] + outputOffset, outPos[i][1]);
outputSize = i + 1;
}
if(recipe.outputFluid != null) for(int i = 0; i < recipe.outputFluid.length; i++) {
this.output[outputSize + i] = new PositionedStack(ItemFluidIcon.make(recipe.outputFluid[i]), outPos[outputSize + i][0] + outputOffset, outPos[outputSize + i][1]);
}
if(recipe.isPooled()) {
String[] pools = recipe.getPools();
ItemStack[] blueprints = new ItemStack[pools.length];
for(int i = 0; i < pools.length; i++) blueprints[i] = ItemBlueprints.make(pools[i]);
this.template = new PositionedStack(blueprints, 75 + machineOffset, 10);
}
ItemStack[] machineStacks = getMachines(recipe);
this.machine = new PositionedStack(machineStacks, 75 + machineOffset, template == null ? 31 : 38);
}
@Override public List<PositionedStack> getIngredients() { return getCycledIngredients(cycleticks / 20, Arrays.asList(this.input)); }
@Override public PositionedStack getResult() { return this.output[0]; }
@Override
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> other = new ArrayList();
for(int i = 1; i < this.output.length; i++) other.add(this.output[i]);
other.add(this.machine);
if(this.template != null) other.add(this.template);
return getCycledIngredients(cycleticks / 20, other);
}
}
@Override public String getRecipeName() { return this.displayName; }
@Override public ItemStack[] getMachinesForRecipe() { return machines; }
@Override public String getGuiTexture() { return RefStrings.MODID + ":textures/gui/nei/gui_nei.png"; }
public int getInputXOffset(GenericRecipe recipe, int inputCount) { return 0; }
public int getOutputXOffset(GenericRecipe recipe, int outputCount) { return 0; }
public int getMachineXOffset(GenericRecipe recipe) { return 0; }
public ItemStack[] getMachines(GenericRecipe recipe) { return this.machines; }
// magic number vomit land
public int[][] getInputSlotPositions(int count) {
if(count == 1) return new int[][] { {48, 24} };
if(count == 2) return new int[][] { {30, 24}, {48, 24} };
if(count == 3) return new int[][] { {12, 24}, {30, 24}, {48, 24} };
if(count == 4) return new int[][] { {30, 15}, {48, 15}, {30, 33}, {48, 33} };
if(count == 5) return new int[][] { {12, 15}, {30, 15}, {48, 15}, {12, 33}, {30, 33} };
if(count == 6) return new int[][] { {12, 15}, {30, 15}, {48, 15}, {12, 33}, {30, 33}, {48, 33} };
int[][] slots = new int[count][2];
int cols = (count + 2) / 3;
for(int i = 0; i < count; i++) {
slots[i][0] = 12 + (i % cols) * 18 - (cols == 4 ? 18 : 0);
slots[i][1] = 6 + (i / cols) * 18;
}
return slots;
}
public int[][] getOutputSlotPositions(int count) {
switch(count) {
case 1: return new int[][] {
{102, 24}
};
case 2: return new int[][] {
{102, 24},
{120, 24}
};
case 3: return new int[][] {
{102, 24},
{120, 24},
{138, 24}
};
case 4: return new int[][] {
{102, 24 - 9},
{120, 24 - 9},
{102, 24 + 9},
{120, 24 + 9}
};
case 5: return new int[][] {
{102, 24 - 9}, {120, 24 - 9},
{102, 24 + 9}, {120, 24 + 9},
{138, 24},
};
case 6: return new int[][] {
{102, 6}, {120, 6},
{102, 24}, {120, 24},
{102, 42}, {120, 42},
};
case 7: return new int[][] {
{102, 6}, {120, 6},
{102, 24}, {120, 24},
{102, 42}, {120, 42},
{138, 24},
};
case 8: return new int[][] {
{102, 6}, {120, 6},
{102, 24}, {120, 24},
{102, 42}, {120, 42},
{138, 24}, {138, 42},
};
}
return new int[count][2];
}
@Override
public void loadCraftingRecipes(ItemStack result) {
outer: for(Object o : this.recipeSet.recipeOrderedList) {
GenericRecipe recipe = (GenericRecipe) o;
boolean hasMatch = false;
boolean hide = ClientConfig.NEI_HIDE_SECRETS.get();
if(hide && recipe.isPooled()) {
String[] pools = recipe.getPools();
for(String pool : pools) if(pool.startsWith(GenericRecipes.POOL_PREFIX_SECRET)) continue outer;
}
if(hide && recipe.inputItem != null) for(AStack astack : recipe.inputItem) for(ItemStack stack : astack.extractForNEI()) {
if(ModItems.excludeNEI.contains(stack.getItem())) continue outer;
}
if(recipe.outputItem != null) for(IOutput output : recipe.outputItem) for(ItemStack stack : output.getAllPossibilities()) {
if(hide && ModItems.excludeNEI.contains(stack.getItem())) continue outer;
if(NEIServerUtils.areStacksSameTypeCrafting(stack, result)) hasMatch = true;
}
if(recipe.outputFluid != null) for(FluidStack fluid : recipe.outputFluid) {
if(areItemsAndMetaEqual(ItemFluidIcon.make(fluid), result)) hasMatch = true;
}
if(hasMatch) this.arecipes.add(new RecipeSet(recipe));
}
}
/** load all */
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals(getRecipeID())) {
outer: for(Object o : this.recipeSet.recipeOrderedList) {
GenericRecipe recipe = (GenericRecipe) o;
boolean hide = ClientConfig.NEI_HIDE_SECRETS.get();
if(hide && recipe.isPooled()) {
String[] pools = recipe.getPools();
for(String pool : pools) if(pool.startsWith(GenericRecipes.POOL_PREFIX_SECRET)) continue outer;
}
if(hide && recipe.inputItem != null) for(AStack astack : recipe.inputItem) for(ItemStack stack : astack.extractForNEI())
if(ModItems.excludeNEI.contains(stack.getItem())) continue outer;
if(hide && recipe.outputItem != null) for(IOutput output : recipe.outputItem) for(ItemStack stack : output.getAllPossibilities())
if(ModItems.excludeNEI.contains(stack.getItem())) continue outer;
this.arecipes.add(new RecipeSet(recipe));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals(getRecipeID())) {
loadCraftingRecipes(getRecipeID(), new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
outer: for(Object o : this.recipeSet.recipeOrderedList) {
GenericRecipe recipe = (GenericRecipe) o;
boolean hasMatch = false;
boolean hide = ClientConfig.NEI_HIDE_SECRETS.get();
if(hide && recipe.isPooled()) {
String[] pools = recipe.getPools();
for(String pool : pools) if(pool.startsWith(GenericRecipes.POOL_PREFIX_SECRET)) continue outer;
}
if(recipe.inputItem != null) for(AStack astack : recipe.inputItem) for(ItemStack stack : astack.extractForNEI()) {
if(hide && ModItems.excludeNEI.contains(stack.getItem())) continue outer;
if(NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) hasMatch = true;
}
if(recipe.inputFluid != null) for(FluidStack fluid : recipe.inputFluid) {
if(areItemsAndMetaEqual(ItemFluidIcon.make(fluid), ingredient)) hasMatch = true;
}
if(hide && recipe.outputItem != null) for(IOutput output : recipe.outputItem) for(ItemStack stack : output.getAllPossibilities()) {
if(ModItems.excludeNEI.contains(stack.getItem())) continue outer;
}
if(hasMatch) this.arecipes.add(new RecipeSet(recipe));
}
}
public static boolean areItemsAndMetaEqual(ItemStack sta1, ItemStack sta2) {
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
}
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(147, 1, 18, 18), getRecipeID()));
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
}
@Override
public void drawBackground(int recipe) {
super.drawBackground(recipe);
RecipeSet rec = (RecipeSet) this.arecipes.get(recipe);
for(PositionedStack pos : rec.input) drawTexturedModalRect(pos.relx - 1, pos.rely - 1, 5, 87, 18, 18);
for(PositionedStack pos : rec.output) drawTexturedModalRect(pos.relx - 1, pos.rely - 1, 5, 87, 18, 18);
if(rec.template == null) {
drawTexturedModalRect(74 + this.getMachineXOffset(rec.recipe), 14, 59, 87, 18, 36);
} else {
drawTexturedModalRect(74 + this.getMachineXOffset(rec.recipe), 7, 77, 87, 18, 50);
}
}
}

View File

@ -25,11 +25,6 @@ import net.minecraft.item.ItemStack;
public abstract class NEIUniversalHandler extends TemplateRecipeHandler implements ICompatNHNEI {
@Override
public ItemStack[] getMachinesForRecipe() {
return machine;
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
@ -119,6 +114,11 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
return this.display;
}
@Override
public ItemStack[] getMachinesForRecipe() {
return machine;
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei.png";

View File

@ -166,17 +166,17 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
// decoration
this.register(new GenericRecipe("ass.capnuka").setup(10, 100).outputItems(DictFrame.fromOne(ModBlocks.block_cap, EnumCapBlock.NUKA))
.inputItems(new ComparableStack(ModItems.cap_nuka, 128)));
.inputItems(new ComparableStack(ModItems.cap_nuka, 64), new ComparableStack(ModItems.cap_nuka, 64)));
this.register(new GenericRecipe("ass.capquantum").setup(10, 100).outputItems(DictFrame.fromOne(ModBlocks.block_cap, EnumCapBlock.QUANTUM))
.inputItems(new ComparableStack(ModItems.cap_quantum, 128)));
.inputItems(new ComparableStack(ModItems.cap_quantum, 64), new ComparableStack(ModItems.cap_quantum, 64)));
this.register(new GenericRecipe("ass.capsparkle").setup(10, 100).outputItems(DictFrame.fromOne(ModBlocks.block_cap, EnumCapBlock.SPARKLE))
.inputItems(new ComparableStack(ModItems.cap_sparkle, 128)));
.inputItems(new ComparableStack(ModItems.cap_sparkle, 64), new ComparableStack(ModItems.cap_sparkle, 64)));
this.register(new GenericRecipe("ass.caprad").setup(10, 100).outputItems(DictFrame.fromOne(ModBlocks.block_cap, EnumCapBlock.RAD))
.inputItems(new ComparableStack(ModItems.cap_rad, 128)));
.inputItems(new ComparableStack(ModItems.cap_rad, 64), new ComparableStack(ModItems.cap_rad, 64)));
this.register(new GenericRecipe("ass.capfritz").setup(10, 100).outputItems(DictFrame.fromOne(ModBlocks.block_cap, EnumCapBlock.FRITZ))
.inputItems(new ComparableStack(ModItems.cap_fritz, 128)));
.inputItems(new ComparableStack(ModItems.cap_fritz, 64), new ComparableStack(ModItems.cap_fritz, 64)));
this.register(new GenericRecipe("ass.capkorl").setup(10, 100).outputItems(DictFrame.fromOne(ModBlocks.block_cap, EnumCapBlock.KORL))
.inputItems(new ComparableStack(ModItems.cap_korl, 128)));
.inputItems(new ComparableStack(ModItems.cap_korl, 64), new ComparableStack(ModItems.cap_korl, 64)));
/*
this.register(new GenericRecipe("ass.").setup(, 100).outputItems(new ItemStack(ModBlocks., 1))
.inputItems());
@ -330,7 +330,8 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
new ComparableStack(ModItems.powder_magic, 64),
new ComparableStack(ModItems.plate_dineutronium, 24),
new ComparableStack(ModItems.ingot_u238m2),
new ComparableStack(ModItems.ingot_cft, 128)));
new ComparableStack(ModItems.ingot_cft, 64),
new ComparableStack(ModItems.ingot_cft, 64)));
// fluid tanks
this.register(new GenericRecipe("ass.tank").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_fluidtank, 1))
@ -791,9 +792,9 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
for(int i = 1; i < order.length; ++i) {
FluidType type = order[i];
if(type.hasNoContainer()) continue;
this.register(new GenericRecipe("ass.package" + type.getUnlocalizedName()).setup(100, 100).outputItems(new ItemStack(ModItems.fluid_pack_full, 1, type.getID()))
this.register(new GenericRecipe("ass.package" + type.getUnlocalizedName()).setup(40, 100).outputItems(new ItemStack(ModItems.fluid_pack_full, 1, type.getID()))
.inputItems(new ComparableStack(ModItems.fluid_pack_empty)).inputFluids(new FluidStack(type, 32_000)));
this.register(new GenericRecipe("ass.unpackage" + type.getUnlocalizedName()).setup(100, 100).setIcon(ItemFluidIcon.make(type, 32_000)).outputItems(new ItemStack(ModItems.fluid_pack_empty))
this.register(new GenericRecipe("ass.unpackage" + type.getUnlocalizedName()).setup(40, 100).setIcon(ItemFluidIcon.make(type, 32_000)).outputItems(new ItemStack(ModItems.fluid_pack_empty))
.inputItems(new ComparableStack(ModItems.fluid_pack_full, 1, type.getID())).outputFluids(new FluidStack(type, 32_000)));
}

View File

@ -37,9 +37,8 @@ public class GenericRecipe {
this.name = name;
}
public boolean isPooled() {
return blueprintPools != null;
}
public boolean isPooled() { return blueprintPools != null; }
public String[] getPools() { return this.blueprintPools; }
public boolean isPartOfPool(String lookingFor) {
if(!isPooled()) return false;

View File

@ -1,5 +1,7 @@
package com.hbm.items;
import java.util.HashSet;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.VersatileConfig;
import com.hbm.handler.BucketHandler;
@ -62,6 +64,8 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
public class ModItems {
public static HashSet<Item> excludeNEI = new HashSet();
public static void mainRegistry() {
initializeItem();
@ -4984,6 +4988,9 @@ public class ModItems {
}
private static void registerItem() {
excludeNEI.add(item_secret);
//Weapons
GameRegistry.registerItem(redstone_sword, redstone_sword.getUnlocalizedName());
GameRegistry.registerItem(big_sword, big_sword.getUnlocalizedName());

View File

@ -133,7 +133,7 @@ public class ItemBlueprints extends Item {
return stack.stackTagCompound.getString("pool");
}
public ItemStack make(String pool) {
public static ItemStack make(String pool) {
ItemStack stack = new ItemStack(ModItems.blueprints);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("pool", pool);

View File

@ -4,7 +4,6 @@ import java.util.List;
import com.hbm.inventory.recipes.ChemplantRecipes;
import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
import com.hbm.items.ModItems;
import com.hbm.util.i18n.I18nUtil;
import cpw.mods.fml.relauncher.Side;

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 (5383)";
public static final String VERSION = "1.0.27 BETA (5397)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -24,14 +24,13 @@ public class NEIRegistry {
handlers.add(new GasCentrifugeRecipeHandler());
handlers.add(new BreederRecipeHandler());
handlers.add(new CyclotronRecipeHandler());
handlers.add(new AssemblerRecipeHandler());
handlers.add(new AssemblyMachineRecipeHandler());
handlers.add(new RefineryRecipeHandler());
handlers.add(new VacuumRecipeHandler());
handlers.add(new CrackingHandler());
handlers.add(new RadiolysisRecipeHandler());
handlers.add(new ReformingHandler());
handlers.add(new HydrotreatingHandler());
handlers.add(new ChemplantRecipeHandler());
handlers.add(new ChemicalPlantRecipeHandler());
handlers.add(new OreSlopperHandler()); //before acidizing
handlers.add(new CrystallizerRecipeHandler());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB