-Changed Crusher Recipe Registering a bit

This commit is contained in:
Ellpeck 2015-07-01 16:06:40 +02:00
parent 308dc205c0
commit 56bb502ab7
10 changed files with 145 additions and 156 deletions

View file

@ -9,7 +9,7 @@ import ellpeck.actuallyadditions.achievement.InitAchievements;
import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.communication.InterModCommunications;
import ellpeck.actuallyadditions.config.ConfigurationHandler;
import ellpeck.actuallyadditions.crafting.GrinderCrafting;
import ellpeck.actuallyadditions.crafting.CrusherCrafting;
import ellpeck.actuallyadditions.crafting.InitCrafting;
import ellpeck.actuallyadditions.crafting.ItemCrafting;
import ellpeck.actuallyadditions.event.InitEvents;
@ -76,7 +76,7 @@ public class ActuallyAdditions{
Util.logInfo("Starting PostInitialization Phase...");
ItemCoffee.initIngredients();
GrinderCrafting.init();
CrusherCrafting.init();
ItemCrafting.initMashedFoodRecipes();
HairyBallHandler.init();
proxy.postInit();

View file

@ -2,7 +2,7 @@ package ellpeck.actuallyadditions.communication;
import cpw.mods.fml.common.event.FMLInterModComms;
import ellpeck.actuallyadditions.items.ItemCoffee;
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
import ellpeck.actuallyadditions.recipe.CrusherRecipeManualRegistry;
import ellpeck.actuallyadditions.recipe.HairyBallHandler;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util;
@ -26,7 +26,7 @@ public class InterModCommunications{
int secondChance = compound.getInteger("secondChance");
if(input != null && outputOne != null){
GrinderRecipeManualRegistry.registerRecipe(input, outputOne, outputTwo, secondChance);
CrusherRecipeManualRegistry.registerRecipe(input, outputOne, outputTwo, secondChance);
Util.logInfo("Crusher Recipe that was sent from Mod " + message.getSender() + " has been registered successfully: " + input.toString() + " -> " + outputOne.toString() + (outputTwo != null ? " + " + outputTwo.toString() + ", Second Chance: " + secondChance : ""));
}
else ModUtil.LOGGER.log(Level.ERROR, "Crusher Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Input or an Output!");

View file

@ -0,0 +1,46 @@
package ellpeck.actuallyadditions.crafting;
import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheDusts;
import ellpeck.actuallyadditions.items.metalists.TheFoods;
import ellpeck.actuallyadditions.recipe.CrusherRecipeAutoRegistry;
import ellpeck.actuallyadditions.recipe.CrusherRecipeAutoRegistry.SearchCase;
import ellpeck.actuallyadditions.recipe.CrusherRecipeManualRegistry;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class CrusherCrafting{
public static void init(){
Util.logInfo("Initializing Crusher Recipes...");
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Items.bed), new ItemStack(Blocks.planks, 3), new ItemStack(Blocks.wool, 3), 100);
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.wool, 1, Util.WILDCARD), new ItemStack(Items.string, 4));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(InitItems.itemDust, 12, TheDusts.LAPIS.ordinal()));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_block), new ItemStack(InitItems.itemDust, 9, TheDusts.COAL.ordinal()));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
CrusherRecipeManualRegistry.registerRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2));
CrusherRecipeManualRegistry.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 15, 2, 1);
CrusherRecipeManualRegistry.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2, 1);
CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("oreNether", 6));
CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("denseore", 8));
CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("gem", 1));
CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("ingot", 1));
CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("ore", 2));
CrusherRecipeAutoRegistry.exceptions.add("ingotBrick");
CrusherRecipeAutoRegistry.exceptions.add("ingotBrickNether");
CrusherRecipeAutoRegistry.registerFinally();
}
}

View file

@ -1,44 +0,0 @@
package ellpeck.actuallyadditions.crafting;
import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheDusts;
import ellpeck.actuallyadditions.items.metalists.TheFoods;
import ellpeck.actuallyadditions.recipe.GrinderRecipeAutoRegistry;
import ellpeck.actuallyadditions.recipe.GrinderRecipeAutoRegistry.SearchCase;
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class GrinderCrafting{
public static void init(){
Util.logInfo("Initializing Crusher Recipes...");
GrinderRecipeManualRegistry.clearRecipeList();
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10));
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(InitItems.itemDust, 12, TheDusts.LAPIS.ordinal()));
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()));
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_block), new ItemStack(InitItems.itemDust, 9, TheDusts.COAL.ordinal()));
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand));
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
GrinderRecipeManualRegistry.registerRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2));
GrinderRecipeManualRegistry.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 15, 2);
GrinderRecipeManualRegistry.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2);
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("oreNether", 6));
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("denseore", 8));
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("gem", 1));
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("ingot", 1));
GrinderRecipeAutoRegistry.searchCases.add(new SearchCase("ore", 2));
GrinderRecipeAutoRegistry.exceptions.add("ingotBrick");
GrinderRecipeAutoRegistry.exceptions.add("ingotBrickNether");
GrinderRecipeAutoRegistry.registerFinally();
}
}

View file

@ -3,7 +3,7 @@ package ellpeck.actuallyadditions.inventory;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.inventory.slot.SlotOutput;
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
import ellpeck.actuallyadditions.recipe.CrusherRecipeManualRegistry;
import ellpeck.actuallyadditions.tile.TileEntityBase;
import ellpeck.actuallyadditions.tile.TileEntityGrinder;
import invtweaks.api.container.InventoryContainer;
@ -104,7 +104,7 @@ public class ContainerGrinder extends Container{
if(currentStack.getItem() != null){
if(slot <= hotbarEnd && slot >= inventoryStart){
if(GrinderRecipeManualRegistry.getOutput(currentStack, false) != null){
if(CrusherRecipeManualRegistry.getOutput(currentStack, false) != null){
this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false);
if(this.isDouble) this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false);
}

View file

@ -6,7 +6,7 @@ import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.RecipeInfo;
import codechicken.nei.recipe.TemplateRecipeHandler;
import ellpeck.actuallyadditions.inventory.gui.GuiGrinder;
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
import ellpeck.actuallyadditions.recipe.CrusherRecipeManualRegistry;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer;
@ -84,8 +84,8 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{
@Override
public void loadCraftingRecipes(String outputId, Object... results){
if(outputId.equals(NAME) && getClass() == CrusherRecipeHandler.class){
ArrayList<GrinderRecipeManualRegistry.GrinderRecipe> recipes = GrinderRecipeManualRegistry.recipes;
for(GrinderRecipeManualRegistry.GrinderRecipe recipe : recipes){
ArrayList<CrusherRecipeManualRegistry.CrusherRecipe> recipes = CrusherRecipeManualRegistry.recipes;
for(CrusherRecipeManualRegistry.CrusherRecipe recipe : recipes){
arecipes.add(new CachedCrush(recipe.input, recipe.firstOutput, recipe.secondOutput, recipe.secondChance));
}
}
@ -94,16 +94,16 @@ public class CrusherRecipeHandler extends TemplateRecipeHandler{
@Override
public void loadCraftingRecipes(ItemStack result){
ArrayList<GrinderRecipeManualRegistry.GrinderRecipe> recipes = GrinderRecipeManualRegistry.recipes;
for(GrinderRecipeManualRegistry.GrinderRecipe recipe : recipes){
ArrayList<CrusherRecipeManualRegistry.CrusherRecipe> recipes = CrusherRecipeManualRegistry.recipes;
for(CrusherRecipeManualRegistry.CrusherRecipe recipe : recipes){
if(NEIServerUtils.areStacksSameType(recipe.firstOutput, result) || NEIServerUtils.areStacksSameType(recipe.secondOutput, result)) arecipes.add(new CachedCrush(recipe.input, recipe.firstOutput, recipe.secondOutput, recipe.secondChance));
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient){
ArrayList<GrinderRecipeManualRegistry.GrinderRecipe> recipes = GrinderRecipeManualRegistry.recipes;
for(GrinderRecipeManualRegistry.GrinderRecipe recipe : recipes){
ArrayList<CrusherRecipeManualRegistry.CrusherRecipe> recipes = CrusherRecipeManualRegistry.recipes;
for(CrusherRecipeManualRegistry.CrusherRecipe recipe : recipes){
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.input, ingredient)){
CachedCrush theRecipe = new CachedCrush(recipe.input, recipe.firstOutput, recipe.secondOutput, recipe.secondChance);
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredient), ingredient);

View file

@ -0,0 +1,47 @@
package ellpeck.actuallyadditions.recipe;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
public class CrusherRecipeAutoRegistry{
public static ArrayList<SearchCase> searchCases = new ArrayList<SearchCase>();
public static ArrayList<String> exceptions = new ArrayList<String>();
public static class SearchCase{
public final String name;
public final int resultAmount;
public SearchCase(String name, int resultAmount){
this.name = name;
this.resultAmount = resultAmount;
}
}
public static void registerFinally(){
String[] names = OreDictionary.getOreNames();
for(String inputName : names){
if(!exceptions.contains(inputName)){
int resultAmount = 1;
String inputNameWithoutPrefix = null;
for(SearchCase searchCase : searchCases){
String toSearch = searchCase.name;
if(inputName.length() > toSearch.length() && inputName.substring(0, toSearch.length()).equals(toSearch)){
inputNameWithoutPrefix = inputName.substring(toSearch.length());
resultAmount = searchCase.resultAmount;
break;
}
}
if(inputNameWithoutPrefix != null){
String inputWithDustPrefix = "dust" + inputNameWithoutPrefix;
CrusherRecipeManualRegistry.registerRecipe(inputName, inputWithDustPrefix, resultAmount);
}
}
}
}
}

View file

@ -1,23 +1,29 @@
package ellpeck.actuallyadditions.recipe;
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.logging.log4j.Level;
import java.util.ArrayList;
public class GrinderRecipeManualRegistry{
public class CrusherRecipeManualRegistry{
public static ArrayList<GrinderRecipe> recipes = new ArrayList<GrinderRecipe>();
public static void clearRecipeList(){
recipes.clear();
}
public static ArrayList<CrusherRecipe> recipes = new ArrayList<CrusherRecipe>();
public static void registerRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int secondChance){
recipes.add(new GrinderRecipe(input, outputOne, outputTwo, secondChance));
if(!hasRecipe(input, outputOne)){
recipes.add(new CrusherRecipe(input, outputOne, outputTwo, secondChance));
}
}
public static void registerRecipe(String input, String outputOne, String outputTwo, int secondChance, int outputAmount){
public static void registerRecipe(String input, String outputOne, int outputOneAmount){
registerRecipe(input, outputOne, "", 0, outputOneAmount, 0);
}
public static void registerRecipe(String input, String outputOne, String outputTwo, int secondChance, int outputOneAmount, int outputTwoAmount){
ArrayList<ItemStack> inputStacks = (ArrayList<ItemStack>)OreDictionary.getOres(input, false);
ArrayList<ItemStack> outputOneStacks = (ArrayList<ItemStack>)OreDictionary.getOres(outputOne, false);
ArrayList<ItemStack> outputTwoStacks = (ArrayList<ItemStack>)OreDictionary.getOres(outputTwo, false);
@ -28,18 +34,27 @@ public class GrinderRecipeManualRegistry{
if(outputOneStacks != null && !outputOneStacks.isEmpty()){
for(ItemStack anOutputOne : outputOneStacks){
ItemStack theOutputOne = anOutputOne.copy();
theOutputOne.stackSize = outputAmount;
theOutputOne.stackSize = outputOneAmount;
if(outputTwoStacks != null && !outputTwoStacks.isEmpty()){
for(ItemStack anOutputTwo : outputTwoStacks){
ItemStack theOutputTwo = anOutputTwo.copy();
theOutputTwo.stackSize = outputTwoAmount;
registerRecipe(theInput, theOutputOne, theOutputTwo, secondChance);
}
}
else registerRecipe(theInput, theOutputOne, null, 0);
}
}
else{
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled())
ModUtil.LOGGER.log(Level.WARN, "Couldn't register Crusher Recipe! An Item with OreDictionary Registry '" + outputOne + "' doesn't exist! It should be the output of '" + input + "'!");
}
}
}
else{
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled())
ModUtil.LOGGER.log(Level.WARN, "Couldn't register Crusher Recipe! Didn't find Items registered as '" + input + "'!");
}
}
public static void registerRecipe(ItemStack input, ItemStack outputOne){
@ -47,8 +62,8 @@ public class GrinderRecipeManualRegistry{
}
public static ItemStack getOutput(ItemStack input, boolean wantSecond){
for(GrinderRecipe recipe : recipes){
if(recipe.input.isItemEqual(input)){
for(CrusherRecipe recipe : recipes){
if(recipe.input.isItemEqual(input) || (recipe.input.getItem() == input.getItem() && recipe.input.getItemDamage() == Util.WILDCARD)){
return wantSecond ? recipe.secondOutput : recipe.firstOutput;
}
}
@ -56,29 +71,29 @@ public class GrinderRecipeManualRegistry{
}
public static boolean hasRecipe(ItemStack input, ItemStack outputOne){
for(GrinderRecipe recipe : recipes){
if(recipe.input.isItemEqual(input) && recipe.firstOutput.isItemEqual(outputOne)) return true;
for(CrusherRecipe recipe : recipes){
if(recipe.input.isItemEqual(input) && recipe.firstOutput.isItemEqual(outputOne) || (recipe.input.getItem() == input.getItem() && recipe.firstOutput.getItem() == outputOne.getItem() && recipe.input.getItemDamage() == Util.WILDCARD)) return true;
}
return false;
}
public static int getSecondChance(ItemStack input){
for(GrinderRecipe recipe : recipes){
if(recipe.input.isItemEqual(input)){
for(CrusherRecipe recipe : recipes){
if(recipe.input.isItemEqual(input) || (recipe.input.getItem() == input.getItem() && recipe.input.getItemDamage() == Util.WILDCARD)){
return recipe.secondChance;
}
}
return 0;
}
public static class GrinderRecipe{
public static class CrusherRecipe{
public final ItemStack input;
public final ItemStack firstOutput;
public final ItemStack secondOutput;
public final int secondChance;
public GrinderRecipe(ItemStack input, ItemStack firstOutput, ItemStack secondOutput, int secondChance){
public CrusherRecipe(ItemStack input, ItemStack firstOutput, ItemStack secondOutput, int secondChance){
this.input = input;
this.firstOutput = firstOutput;
this.secondOutput = secondOutput;

View file

@ -1,75 +0,0 @@
package ellpeck.actuallyadditions.recipe;
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.logging.log4j.Level;
import java.util.ArrayList;
public class GrinderRecipeAutoRegistry{
public static ArrayList<SearchCase> searchCases = new ArrayList<SearchCase>();
public static ArrayList<String> exceptions = new ArrayList<String>();
public static class SearchCase{
public final String name;
public final int resultAmount;
public SearchCase(String name, int resultAmount){
this.name = name;
this.resultAmount = resultAmount;
}
}
public static void registerFinally(){
String[] names = OreDictionary.getOreNames();
for(String inputName : names){
if(!exceptions.contains(inputName)){
int resultAmount = 1;
String inputNameWithoutPrefix = null;
for(SearchCase searchCase : searchCases){
String toSearch = searchCase.name;
if(inputName.length() > toSearch.length() && inputName.substring(0, toSearch.length()).equals(toSearch)){
inputNameWithoutPrefix = inputName.substring(toSearch.length());
resultAmount = searchCase.resultAmount;
break;
}
}
if(inputNameWithoutPrefix != null){
String inputWithDustPrefix = "dust" + inputNameWithoutPrefix;
ArrayList<ItemStack> allOresOfInitialInputName = (ArrayList<ItemStack>)OreDictionary.getOres(inputName, false);
ArrayList<ItemStack> allOresWithDustPrefix = (ArrayList<ItemStack>)OreDictionary.getOres(inputWithDustPrefix, false);
if(allOresOfInitialInputName != null && allOresOfInitialInputName.size() > 0){
if(allOresWithDustPrefix != null && allOresWithDustPrefix.size() > 0){
for(ItemStack theInput : allOresOfInitialInputName){
for(ItemStack theDust : allOresWithDustPrefix){
ItemStack input = theInput.copy();
ItemStack output = theDust.copy();
output.stackSize = resultAmount;
if(!GrinderRecipeManualRegistry.hasRecipe(input, output)){
GrinderRecipeManualRegistry.registerRecipe(input, output, null, 0);
}
}
}
}
else{
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled())
ModUtil.LOGGER.log(Level.INFO, "Couldn't register Crusher Recipe! An Item with OreDictionary Registry '" + inputWithDustPrefix + "' doesn't exist! It should correspond to '" + inputName + "'! This is not an Error, just a bit sad :(");
}
}
else{
if(ConfigBoolValues.DO_CRUSHER_SPAM.isEnabled())
ModUtil.LOGGER.log(Level.WARN, "Couldn't register Crusher Recipe! Didn't find Items registered as '" + inputName + "'! This shouldn't happen as there is something registered as '" + inputName + "' that doesn't exist!");
}
}
}
}
}
}

View file

@ -5,7 +5,7 @@ import cofh.api.energy.IEnergyReceiver;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
import ellpeck.actuallyadditions.recipe.GrinderRecipeManualRegistry;
import ellpeck.actuallyadditions.recipe.CrusherRecipeManualRegistry;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
@ -122,8 +122,8 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
public boolean canCrushOn(int theInput, int theFirstOutput, int theSecondOutput){
if(this.slots[theInput] != null){
ItemStack outputOne = GrinderRecipeManualRegistry.getOutput(this.slots[theInput], false);
ItemStack outputTwo = GrinderRecipeManualRegistry.getOutput(this.slots[theInput], true);
ItemStack outputOne = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], false);
ItemStack outputTwo = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], true);
if(this.slots[theInput] != null){
if(outputOne != null){
if((this.slots[theFirstOutput] == null || (this.slots[theFirstOutput].isItemEqual(outputOne) && this.slots[theFirstOutput].stackSize <= this.slots[theFirstOutput].getMaxStackSize()-outputOne.stackSize)) && (outputTwo == null || (this.slots[theSecondOutput] == null || (this.slots[theSecondOutput].isItemEqual(outputTwo) && this.slots[theSecondOutput].stackSize <= this.slots[theSecondOutput].getMaxStackSize()-outputTwo.stackSize)))){
@ -136,14 +136,14 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
}
public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput){
ItemStack outputOnFirst = GrinderRecipeManualRegistry.getOutput(this.slots[theInput], false);
ItemStack outputOnFirst = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], false);
if(outputOnFirst != null){
if(this.slots[theFirstOutput] == null) this.slots[theFirstOutput] = outputOnFirst.copy();
else if(this.slots[theFirstOutput].getItem() == outputOnFirst.getItem()) this.slots[theFirstOutput].stackSize += outputOnFirst.stackSize;
}
int chance = GrinderRecipeManualRegistry.getSecondChance(this.slots[theInput]);
ItemStack outputOnSecond = GrinderRecipeManualRegistry.getOutput(this.slots[theInput], true);
int chance = CrusherRecipeManualRegistry.getSecondChance(this.slots[theInput]);
ItemStack outputOnSecond = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], true);
if(outputOnSecond != null){
int rand = new Random().nextInt(100) + 1;
if(rand <= chance){
@ -189,7 +189,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg
@Override
public boolean isItemValidForSlot(int i, ItemStack stack){
return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && GrinderRecipeManualRegistry.getOutput(stack, false) != null;
return (i == SLOT_INPUT_1 || i == SLOT_INPUT_2) && CrusherRecipeManualRegistry.getOutput(stack, false) != null;
}
@Override