mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-18 19:39:14 +00:00
Massive cleanup up recipes.
This commit is contained in:
1 parent
7798e384ee
commit
ac3000efcc
26 files changed
+192
-427
No files matched your search
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.block;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -22,12 +20,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInputClass;
|
||||
import crazypants.enderio.crafting.impl.RecipeOutput;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
@@ -162,14 +154,6 @@ public class BlockDarkSteelPressurePlate extends BlockPressurePlate implements I
|
||||
return new ResultStack[] { new ResultStack(createItemStackForSourceBlock(Block.getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage())) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IRecipeInput input = new RecipeInputClass<BlockDarkSteelPressurePlate>(new ItemStack(EnderIO.blockDarkSteelPressurePlate), BlockDarkSteelPressurePlate.class);
|
||||
IRecipeOutput output = new RecipeOutput(new ItemStack(EnderIO.blockDarkSteelPressurePlate, 1, 0));
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(getMachineName(), DEFAULT_ENERGY_PER_TASK, input, output);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
public static ItemStack createItemStackForSourceBlock(Block block, int damage) {
|
||||
ItemStack result = new ItemStack(EnderIO.blockDarkSteelPressurePlate, 1, damage);
|
||||
PainterUtil.setSourceBlock(result, block, damage);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package crazypants.enderio.conduit.facade;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -18,8 +17,6 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.gui.IAdvancedTooltipProvider;
|
||||
import crazypants.enderio.gui.TooltipAddera;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
@@ -144,14 +141,7 @@ public class ItemConduitFacade extends Item implements IAdvancedTooltipProvider
|
||||
@Override
|
||||
public boolean isValidTarget(ItemStack target) {
|
||||
return target != null && target.getItem() == EnderIO.itemConduitFacade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
ItemStack is = new ItemStack(EnderIO.itemConduitFacade, 1, 0);
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(IEnderIoRecipe.PAINTER_ID, DEFAULT_ENERGY_PER_TASK, is, is);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
|
||||
/**
|
||||
* A MachineRecipe implementation must be stateless, always returning the same
|
||||
@@ -94,13 +93,6 @@ public interface IMachineRecipe {
|
||||
*/
|
||||
List<MachineRecipeInput> getQuantitiesConsumed(MachineRecipeInput[] inputs);
|
||||
|
||||
/**
|
||||
* Returns all possible outputs from the recipe.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<IEnderIoRecipe> getAllRecipes();
|
||||
|
||||
public static class ResultStack {
|
||||
|
||||
public final ItemStack item;
|
||||
|
||||
@@ -8,7 +8,6 @@ import java.util.Map;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import crazypants.enderio.crafting.RecipeReigistry;
|
||||
|
||||
public class MachineRecipeRegistry {
|
||||
|
||||
@@ -17,11 +16,7 @@ public class MachineRecipeRegistry {
|
||||
private final Map<String, Map<String, IMachineRecipe>> machineRecipes = new HashMap<String, Map<String, IMachineRecipe>>();
|
||||
|
||||
public void registerRecipe(String machine, IMachineRecipe recipe) {
|
||||
getRecipesForMachine(machine).put(recipe.getUid(), recipe);
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
if(side == Side.CLIENT) {
|
||||
RecipeReigistry.instance.registerRecipes(recipe.getAllRecipes());
|
||||
}
|
||||
getRecipesForMachine(machine).put(recipe.getUid(), recipe);
|
||||
}
|
||||
|
||||
public Map<String, IMachineRecipe> getRecipesForMachine(String machineName) {
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
package crazypants.enderio.machine.alloy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeComponent;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.recipe.AbstractMachineRecipe;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
|
||||
public class AlloyMachineRecipe extends AbstractMachineRecipe {
|
||||
|
||||
@@ -46,28 +36,6 @@ public class AlloyMachineRecipe extends AbstractMachineRecipe {
|
||||
return AlloyRecipeManager.instance.getExperianceForOutput(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
List<IEnderIoRecipe> result = new ArrayList<IEnderIoRecipe>();
|
||||
List<IAlloyRecipe> recipes = AlloyRecipeManager.getInstance().getRecipes();
|
||||
for (IRecipe cr : recipes) {
|
||||
List<IRecipeComponent> components = new ArrayList<IRecipeComponent>();
|
||||
for (crazypants.enderio.machine.recipe.RecipeInput ri : cr.getInputs()) {
|
||||
if(ri.getInput() != null) {
|
||||
IRecipeInput input = new RecipeInput(ri.getInput(), -1, ri.getEquivelentInputs());
|
||||
components.add(input);
|
||||
}
|
||||
}
|
||||
|
||||
for (RecipeOutput co : cr.getOutputs()) {
|
||||
IRecipeOutput output = new crazypants.enderio.crafting.impl.RecipeOutput(co.getOutput(), co.getChance());
|
||||
components.add(output);
|
||||
}
|
||||
result.add(new EnderIoRecipe(IEnderIoRecipe.ALLOY_SMELTER_ID, cr.getEnergyRequired(), components));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean isValidRecipeComponents(ItemStack[] resultInv) {
|
||||
return AlloyRecipeManager.instance.isValidRecipeComponents(resultInv);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,16 @@ public class AlloyRecipeManager {
|
||||
public AlloyRecipeManager() {
|
||||
}
|
||||
|
||||
public VanillaSmeltingRecipe getVanillaRecipe() {
|
||||
return vanillaRecipe;
|
||||
}
|
||||
|
||||
public void setVanillaRecipe(VanillaSmeltingRecipe vanillaRecipe) {
|
||||
this.vanillaRecipe = vanillaRecipe;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void loadRecipesFromConfig() {
|
||||
|
||||
VanillaFurnaceTagHandler tagHandler = new VanillaFurnaceTagHandler();
|
||||
|
||||
@@ -8,9 +8,6 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeComponent;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.recipe.Recipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
@@ -23,8 +20,6 @@ public class BasicAlloyRecipe implements IAlloyRecipe {
|
||||
private float energyRequired = DEFAULT_ENERGY_USE;
|
||||
private ItemStack output;
|
||||
|
||||
private final List<IEnderIoRecipe> recipeEIO;
|
||||
|
||||
private float expPerItem;
|
||||
|
||||
private final Recipe recipe;
|
||||
@@ -35,14 +30,6 @@ public class BasicAlloyRecipe implements IAlloyRecipe {
|
||||
expPerItem = recipe.getOutputs()[0].getExperiance();
|
||||
energyRequired = recipe.getEnergyRequired();
|
||||
|
||||
List<IRecipeComponent> reipceComps = new ArrayList<IRecipeComponent>(recipe.getInputs().length);
|
||||
for (RecipeInput input : recipe.getInputs()) {
|
||||
crazypants.enderio.crafting.impl.RecipeInput ri = new crazypants.enderio.crafting.impl.RecipeInput(input.getInput(), -1, input.getEquivelentInputs());
|
||||
reipceComps.add(ri);
|
||||
}
|
||||
reipceComps.add(new crazypants.enderio.crafting.impl.RecipeOutput(output));
|
||||
IEnderIoRecipe rec = new EnderIoRecipe(IEnderIoRecipe.ALLOY_SMELTER_ID, energyRequired, reipceComps);
|
||||
this.recipeEIO = Collections.singletonList(rec);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,10 +148,6 @@ public class BasicAlloyRecipe implements IAlloyRecipe {
|
||||
return result.toArray(new MachineRecipeInput[result.size()]);
|
||||
}
|
||||
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
return recipeEIO;
|
||||
}
|
||||
|
||||
static class InputKey {
|
||||
|
||||
int itemID;
|
||||
|
||||
@@ -11,11 +11,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.machine.IMachineRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.Recipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
|
||||
public class VanillaSmeltingRecipe implements IMachineRecipe {
|
||||
|
||||
@@ -155,16 +156,16 @@ public class VanillaSmeltingRecipe implements IMachineRecipe {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
|
||||
|
||||
public List<IRecipe> getAllRecipes() {
|
||||
if(!enabled) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<IEnderIoRecipe> result = new ArrayList<IEnderIoRecipe>();
|
||||
List<IRecipe> result = new ArrayList<IRecipe>();
|
||||
Map<ItemStack, ItemStack> metaList = FurnaceRecipes.smelting().getSmeltingList();
|
||||
for (Entry<ItemStack, ItemStack> entry : metaList.entrySet()) {
|
||||
result.add(new EnderIoRecipe(IEnderIoRecipe.ALLOY_SMELTER_ID, MJ_PER_ITEM, entry.getKey(), entry.getValue()));
|
||||
result.add(new Recipe(new RecipeInput(entry.getKey()), MJ_PER_ITEM, new RecipeOutput(entry.getValue())));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
package crazypants.enderio.machine.crusher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeComponent;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.recipe.AbstractMachineRecipe;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.Recipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
|
||||
public class CrusherMachineRecipe extends AbstractMachineRecipe {
|
||||
|
||||
@@ -41,24 +30,5 @@ public class CrusherMachineRecipe extends AbstractMachineRecipe {
|
||||
return ModObject.blockSagMill.unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
List<IEnderIoRecipe> result = new ArrayList<IEnderIoRecipe>();
|
||||
List<Recipe> recipes = CrusherRecipeManager.getInstance().getRecipes();
|
||||
for (IRecipe cr : recipes) {
|
||||
List<IRecipeComponent> components = new ArrayList<IRecipeComponent>();
|
||||
for (crazypants.enderio.machine.recipe.RecipeInput ri : cr.getInputs()) {
|
||||
if(ri.getInput() != null) {
|
||||
IRecipeInput input = new RecipeInput(ri.getInput(), -1, ri.getEquivelentInputs());
|
||||
components.add(input);
|
||||
}
|
||||
}
|
||||
for (RecipeOutput co : cr.getOutputs()) {
|
||||
IRecipeOutput output = new crazypants.enderio.crafting.impl.RecipeOutput(co.getOutput(), co.getChance());
|
||||
components.add(output);
|
||||
}
|
||||
result.add(new EnderIoRecipe(IEnderIoRecipe.SAG_MILL_ID, cr.getEnergyRequired(), components));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.machine.painter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -25,12 +23,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInputClass;
|
||||
import crazypants.enderio.crafting.impl.RecipeOutput;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
|
||||
@@ -239,14 +231,7 @@ public class BlockPaintedCarpet extends BlockCarpet implements ITileEntityProvid
|
||||
}
|
||||
return new ResultStack[] { new ResultStack(createItemStackForSourceBlock(Block.getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage())) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IRecipeInput input = new RecipeInputClass<BlockCarpet>(new ItemStack(Blocks.carpet), BlockCarpet.class);
|
||||
IRecipeOutput output = new RecipeOutput(new ItemStack(EnderIO.blockPaintedCarpet, 1, 0));
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(getMachineName(), DEFAULT_ENERGY_PER_TASK, input, output);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.machine.painter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -26,8 +24,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
|
||||
@@ -269,14 +265,7 @@ public class BlockPaintedFence extends BlockFence implements ITileEntityProvider
|
||||
ItemStack paintSource = MachineRecipeInput.getInputForSlot(1, inputs);
|
||||
return new ResultStack[] { new ResultStack(createItemStackForSourceBlock(getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage())) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(IEnderIoRecipe.PAINTER_ID, DEFAULT_ENERGY_PER_TASK, new ItemStack(Blocks.fence), new ItemStack(
|
||||
EnderIO.blockPaintedFence, 1, 0));
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.machine.painter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -25,8 +23,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
|
||||
@@ -236,14 +232,7 @@ public class BlockPaintedFenceGate extends BlockFenceGate implements ITileEntity
|
||||
ItemStack paintSource = MachineRecipeInput.getInputForSlot(1, inputs);
|
||||
return new ResultStack[] { new ResultStack(createItemStackForSourceBlock(Block.getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage())) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(IEnderIoRecipe.PAINTER_ID, DEFAULT_ENERGY_PER_TASK, new ItemStack(Blocks.fence_gate), new ItemStack(
|
||||
EnderIO.blockPaintedFenceGate,
|
||||
1, 0));
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
package crazypants.enderio.machine.painter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGlowstone;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
@@ -26,12 +23,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInputClass;
|
||||
import crazypants.enderio.crafting.impl.RecipeOutput;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
|
||||
@@ -252,14 +243,7 @@ public class BlockPaintedGlowstone extends Block implements ITileEntityProvider
|
||||
}
|
||||
return new ResultStack[] { new ResultStack(createItemStackForSourceBlock(Block.getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage())) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IRecipeInput input = new RecipeInputClass<BlockGlowstone>(new ItemStack(Blocks.glowstone), BlockGlowstone.class);
|
||||
IRecipeOutput output = new RecipeOutput(new ItemStack(EnderIO.blockPaintedGlowstone, 1, 0));
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(getMachineName(), DEFAULT_ENERGY_PER_TASK, input, output);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.machine.painter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -27,12 +25,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInputClass;
|
||||
import crazypants.enderio.crafting.impl.RecipeOutput;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
|
||||
@@ -260,15 +252,7 @@ public class BlockPaintedSlab extends BlockSlab implements ITileEntityProvider {
|
||||
Block blk = Block.getBlockFromItem(target.getItem());
|
||||
return blk instanceof BlockSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IRecipeInput input = new RecipeInputClass<BlockSlab>(new ItemStack(Blocks.stone_slab), BlockSlab.class, new ItemStack(Blocks.wooden_slab));
|
||||
IRecipeOutput output = new RecipeOutput(new ItemStack(EnderIO.blockPaintedSlab, 1, 0));
|
||||
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(getMachineName(), DEFAULT_ENERGY_PER_TASK, input, output);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.machine.painter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -25,12 +23,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInputClass;
|
||||
import crazypants.enderio.crafting.impl.RecipeOutput;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
|
||||
@@ -257,16 +249,7 @@ public class BlockPaintedStair extends BlockStairs implements ITileEntityProvide
|
||||
Block blk = Block.getBlockFromItem(target.getItem());
|
||||
return blk instanceof BlockStairs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IRecipeInput input = new RecipeInputClass<BlockStairs>(new ItemStack(Blocks.oak_stairs), BlockStairs.class, new ItemStack(Blocks.stone_stairs),
|
||||
new ItemStack(Blocks.stone_stairs));
|
||||
IRecipeOutput output = new RecipeOutput(new ItemStack(EnderIO.blockPaintedStair, 1, 0));
|
||||
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(getMachineName(), DEFAULT_ENERGY_PER_TASK, input, output);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package crazypants.enderio.machine.painter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -24,8 +22,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
|
||||
@@ -244,13 +240,6 @@ public class BlockPaintedWall extends BlockWall implements ITileEntityProvider {
|
||||
return new ResultStack[] { new ResultStack(createItemStackForSourceBlock(Block.getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage())) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(IEnderIoRecipe.PAINTER_ID, DEFAULT_ENERGY_PER_TASK, new ItemStack(Blocks.cobblestone_wall), new ItemStack(
|
||||
EnderIO.blockPaintedWall, 1, 0));
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -145,6 +145,19 @@ public class Recipe implements IRecipe {
|
||||
return outputs;
|
||||
}
|
||||
|
||||
public boolean hasOuput(ItemStack result) {
|
||||
if(result == null) {
|
||||
return false;
|
||||
}
|
||||
for(RecipeOutput output : outputs) {
|
||||
ItemStack os = output.getOutput();
|
||||
if(os != null && os.isItemEqual(result)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnergyRequired() {
|
||||
return energyRequired;
|
||||
@@ -160,4 +173,6 @@ public class Recipe implements IRecipe {
|
||||
return "Recipe [input=" + Arrays.toString(inputs) + ", output=" + Arrays.toString(outputs) + ", energyRequired=" + energyRequired + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.machine.IMachineRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
|
||||
@@ -52,9 +51,4 @@ public class DummyRecipe implements IMachineRecipe {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,11 +6,6 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeComponent;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.recipe.AbstractMachineRecipe;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
@@ -72,34 +67,4 @@ public class VatMachineRecipe extends AbstractMachineRecipe {
|
||||
return new ResultStack[] { new ResultStack(recipe.getFluidOutput(inputs)) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
List<IEnderIoRecipe> result = new ArrayList<IEnderIoRecipe>();
|
||||
List<IRecipe> recipes = VatRecipeManager.getInstance().getRecipes();
|
||||
for (IRecipe cr : recipes) {
|
||||
List<IRecipeComponent> components = new ArrayList<IRecipeComponent>();
|
||||
for (crazypants.enderio.machine.recipe.RecipeInput ri : cr.getInputs()) {
|
||||
if(ri.getInput() != null) {
|
||||
IRecipeInput input = new crazypants.enderio.crafting.impl.RecipeInput(ri.getInput(), ri.getSlotNumber(), ri.getEquivelentInputs());
|
||||
components.add(input);
|
||||
} else if(ri.getFluidInput() != null) {
|
||||
IRecipeInput input = new crazypants.enderio.crafting.impl.RecipeInput(ri.getFluidInput(), 0);
|
||||
components.add(input);
|
||||
}
|
||||
}
|
||||
|
||||
for (crazypants.enderio.machine.recipe.RecipeOutput co : cr.getOutputs()) {
|
||||
if(co.isFluid()) {
|
||||
IRecipeOutput output = new crazypants.enderio.crafting.impl.RecipeOutput(co.getFluidOutput(), -1);
|
||||
components.add(output);
|
||||
} else {
|
||||
IRecipeOutput output = new crazypants.enderio.crafting.impl.RecipeOutput(co.getOutput(), co.getChance());
|
||||
components.add(output);
|
||||
}
|
||||
}
|
||||
result.add(new EnderIoRecipe(IEnderIoRecipe.VAT_ID, cr.getEnergyRequired(), components));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -14,8 +13,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
@@ -93,12 +90,6 @@ public class ItemFusedQuartzFrame extends Item {
|
||||
public boolean isValidTarget(ItemStack target) {
|
||||
return target != null && target.getItem() == i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
ItemStack is = new ItemStack(i, 1, 0);
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(IEnderIoRecipe.PAINTER_ID, DEFAULT_ENERGY_PER_TASK, is, is);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,14 +7,16 @@ import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.RecipeReigistry;
|
||||
import crazypants.enderio.machine.alloy.AlloyRecipeManager;
|
||||
import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.alloy.IAlloyRecipe;
|
||||
import crazypants.enderio.machine.alloy.VanillaSmeltingRecipe;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
|
||||
public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -28,7 +30,6 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
return "enderio:textures/gui/alloySmelter.png";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiAlloySmelter.class;
|
||||
@@ -51,24 +52,26 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForOutput(IEnderIoRecipe.ALLOY_SMELTER_ID, result);
|
||||
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
for (IRecipeOutput output : recipe.getOutputs()) {
|
||||
AlloySmelterRecipe res = new AlloySmelterRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), output.getItem());
|
||||
List<IRecipe> recipes = new ArrayList<IRecipe>(AlloyRecipeManager.getInstance().getRecipes());
|
||||
recipes.addAll(AlloyRecipeManager.getInstance().getVanillaRecipe().getAllRecipes());
|
||||
for (IRecipe recipe : recipes) {
|
||||
ItemStack output = recipe.getOutputs()[0].getOutput();
|
||||
if(result.getItem() == output.getItem() && result.getItemDamage() == output.getItemDamage()) {
|
||||
AlloySmelterRecipe res = new AlloySmelterRecipe(recipe.getEnergyRequired(), recipe.getInputs(), output);
|
||||
arecipes.add(res);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results)
|
||||
{
|
||||
if(outputId.equals("EnderIOAlloySmelter") && getClass() == AlloySmelterRecipeHandler.class)
|
||||
{
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForCrafter(IEnderIoRecipe.ALLOY_SMELTER_ID);
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
AlloySmelterRecipe res = new AlloySmelterRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), recipe.getOutputs().get(0).getItem());
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if(outputId.equals("EnderIOAlloySmelter") && getClass() == AlloySmelterRecipeHandler.class) {
|
||||
List<IRecipe> recipes = new ArrayList<IRecipe>(AlloyRecipeManager.getInstance().getRecipes());
|
||||
recipes.addAll(AlloyRecipeManager.getInstance().getVanillaRecipe().getAllRecipes());
|
||||
for (IRecipe recipe : recipes) {
|
||||
ItemStack output = recipe.getOutputs()[0].getOutput();
|
||||
AlloySmelterRecipe res = new AlloySmelterRecipe(recipe.getEnergyRequired(), recipe.getInputs(), output);
|
||||
arecipes.add(res);
|
||||
}
|
||||
} else {
|
||||
@@ -78,16 +81,13 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForCrafter(IEnderIoRecipe.ALLOY_SMELTER_ID);
|
||||
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
if(recipe.isInput(ingredient)) {
|
||||
for (IRecipeOutput output : recipe.getOutputs()) {
|
||||
AlloySmelterRecipe res = new AlloySmelterRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), output.getItem());
|
||||
res.setIngredientPermutation(res.input, ingredient);
|
||||
arecipes.add(res);
|
||||
}
|
||||
List<IRecipe> recipes = new ArrayList<IRecipe>(AlloyRecipeManager.getInstance().getRecipes());
|
||||
recipes.addAll(AlloyRecipeManager.getInstance().getVanillaRecipe().getAllRecipes());
|
||||
for (IRecipe recipe : recipes) {
|
||||
if(recipe.isValidInput(0, ingredient)) {
|
||||
ItemStack output = recipe.getOutputs()[0].getOutput();
|
||||
AlloySmelterRecipe res = new AlloySmelterRecipe(recipe.getEnergyRequired(), recipe.getInputs(), output);
|
||||
arecipes.add(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,10 +101,15 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(energyString, 100, 50, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(IRecipeInput input) {
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
List<ItemStack> result = new ArrayList<ItemStack>();
|
||||
result.add(input.getItem());
|
||||
result.addAll(input.getEquivelentInputs());
|
||||
result.add(input.getInput());
|
||||
ItemStack[] equivs = input.getEquivelentInputs();
|
||||
if(equivs != null) {
|
||||
for (ItemStack st : equivs) {
|
||||
result.add(st);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -129,18 +134,18 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
return output;
|
||||
}
|
||||
|
||||
public AlloySmelterRecipe(float energy, List<IRecipeInput> ingredients, ItemStack result) {
|
||||
int recipeSize = ingredients.size();
|
||||
public AlloySmelterRecipe(float energy, RecipeInput[] ingredients, ItemStack result) {
|
||||
int recipeSize = ingredients.length;
|
||||
this.input = new ArrayList<PositionedStack>();
|
||||
int yOff = 8;
|
||||
if(recipeSize > 0) {
|
||||
this.input.add(new PositionedStack(getInputs(ingredients.get(0)), 49, 14 - yOff));
|
||||
this.input.add(new PositionedStack(getInputs(ingredients[0]), 49, 14 - yOff));
|
||||
}
|
||||
if(recipeSize > 1) {
|
||||
this.input.add(new PositionedStack(getInputs(ingredients.get(1)), 73, 4 - yOff));
|
||||
this.input.add(new PositionedStack(getInputs(ingredients[1]), 73, 4 - yOff));
|
||||
}
|
||||
if(recipeSize > 2) {
|
||||
this.input.add(new PositionedStack(getInputs(ingredients.get(2)), 98, 14 - yOff));
|
||||
this.input.add(new PositionedStack(getInputs(ingredients[2]), 98, 14 - yOff));
|
||||
}
|
||||
if(result != null) {
|
||||
this.output = new PositionedStack(result, 74, 54 - yOff);
|
||||
|
||||
@@ -5,8 +5,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
@@ -19,18 +17,11 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.RecipeReigistry;
|
||||
import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.enchanter.EnchanterRecipe;
|
||||
import crazypants.enderio.machine.enchanter.EnchanterRecipeManager;
|
||||
import crazypants.enderio.machine.enchanter.GuiEnchanter;
|
||||
import crazypants.enderio.machine.enchanter.TileEnchanter;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.nei.AlloySmelterRecipeHandler.AlloySmelterRecipe;
|
||||
|
||||
public class EnchanterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
@@ -10,9 +10,10 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
API.registerRecipeHandler(new AlloySmelterRecipeHandler());
|
||||
API.registerRecipeHandler(new SagMillRecipeHandler());
|
||||
API.registerRecipeHandler(new AlloySmelterRecipeHandler());
|
||||
API.registerUsageHandler(new AlloySmelterRecipeHandler());
|
||||
|
||||
API.registerRecipeHandler(new SagMillRecipeHandler());
|
||||
API.registerUsageHandler(new SagMillRecipeHandler());
|
||||
|
||||
API.registerRecipeHandler(new VatRecipeHandler());
|
||||
@@ -23,6 +24,13 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
|
||||
API.hideItem(new ItemStack(EnderIO.blockConduitFacade));
|
||||
API.hideItem(new ItemStack(EnderIO.itemEnderface));
|
||||
API.hideItem(new ItemStack(EnderIO.blockPaintedCarpet));
|
||||
API.hideItem(new ItemStack(EnderIO.blockPaintedDoubleSlab));
|
||||
API.hideItem(new ItemStack(EnderIO.blockPaintedFence));
|
||||
API.hideItem(new ItemStack(EnderIO.blockPaintedFenceGate));
|
||||
API.hideItem(new ItemStack(EnderIO.blockPaintedSlab));
|
||||
API.hideItem(new ItemStack(EnderIO.blockPaintedStair));
|
||||
API.hideItem(new ItemStack(EnderIO.blockPaintedWall));
|
||||
|
||||
if(!Config.photovoltaicCellEnabled) {
|
||||
API.hideItem(new ItemStack(EnderIO.blockSolarPanel));
|
||||
@@ -46,3 +54,4 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,14 +18,13 @@ import org.lwjgl.opengl.GL11;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.RecipeReigistry;
|
||||
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
|
||||
import crazypants.enderio.machine.crusher.GrindingBall;
|
||||
import crazypants.enderio.machine.crusher.GuiCrusher;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.Recipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
@@ -65,14 +64,13 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadCraftingRecipes(final ItemStack result) {
|
||||
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForOutput(IEnderIoRecipe.SAG_MILL_ID, result);
|
||||
|
||||
List<Recipe> recipes = CrusherRecipeManager.getInstance().getRecipes();
|
||||
List<MillRecipe> toAdd = new ArrayList<MillRecipe>();
|
||||
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
List<IRecipeOutput> ro = recipe.getOutputs();
|
||||
MillRecipe res = new MillRecipe(result, recipe.getRequiredEnergy(), recipe.getInputs().get(0), ro);
|
||||
toAdd.add(res);
|
||||
for (Recipe recipe : recipes) {
|
||||
if(recipe.hasOuput(result)) {
|
||||
MillRecipe res = new MillRecipe(result, recipe.getEnergyRequired(), recipe.getInputs()[0], recipe.getOutputs());
|
||||
toAdd.add(res);
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(toAdd, comparator);
|
||||
@@ -83,14 +81,13 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if(outputId.equals("EnderIOSagMill") && getClass() == SagMillRecipeHandler.class) {
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForCrafter(IEnderIoRecipe.SAG_MILL_ID);
|
||||
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
for (IRecipeOutput output : recipe.getOutputs()) {
|
||||
MillRecipe res = new MillRecipe(recipe.getRequiredEnergy(), recipe.getInputs().get(0), recipe.getOutputs());
|
||||
arecipes.add(res);
|
||||
}
|
||||
List<Recipe> recipes = CrusherRecipeManager.getInstance().getRecipes();
|
||||
for (Recipe recipe : recipes) {
|
||||
MillRecipe res = new MillRecipe(recipe.getEnergyRequired(), recipe.getInputs()[0], recipe.getOutputs());
|
||||
arecipes.add(res);
|
||||
}
|
||||
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
@@ -99,14 +96,13 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForCrafter(IEnderIoRecipe.SAG_MILL_ID);
|
||||
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
if (recipe.isInput(ingredient)) {
|
||||
MillRecipe res = new MillRecipe(recipe.getRequiredEnergy(), recipe.getInputs().get(0), recipe.getOutputs());
|
||||
List<Recipe> recipes = CrusherRecipeManager.getInstance().getRecipes();
|
||||
for (Recipe recipe : recipes) {
|
||||
if(recipe.isValidInput(0, ingredient)) {
|
||||
MillRecipe res = new MillRecipe(recipe.getEnergyRequired(), recipe.getInputs()[0], recipe.getOutputs());
|
||||
arecipes.add(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -159,10 +155,15 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
super.drawProgressBar(87 - 13, 37 - 16, 200, 0, 17, 24, completion, 1);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(IRecipeInput input) {
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
List<ItemStack> result = new ArrayList<ItemStack>();
|
||||
result.add(input.getItem());
|
||||
result.addAll(input.getEquivelentInputs());
|
||||
result.add(input.getInput());
|
||||
ItemStack[] eq = input.getEquivelentInputs();
|
||||
if(eq != null) {
|
||||
for (ItemStack st : eq) {
|
||||
result.add(st);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -192,7 +193,7 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
for (int i = 0; i < otherOutputs.size(); i++) {
|
||||
PositionedStack oo = otherOutputs.get(i);
|
||||
if(oo != null && oo.item.equals(stack) && i+1 < outputChance.length) {
|
||||
if(oo != null && oo.item.equals(stack) && i + 1 < outputChance.length) {
|
||||
return outputChance[i + 1];
|
||||
}
|
||||
}
|
||||
@@ -214,11 +215,11 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
return otherOutputs;
|
||||
}
|
||||
|
||||
public MillRecipe(float energy, IRecipeInput ingredient, List<IRecipeOutput> outputs) {
|
||||
public MillRecipe(float energy, RecipeInput ingredient, RecipeOutput[] outputs) {
|
||||
this(null, energy, ingredient, outputs);
|
||||
}
|
||||
|
||||
public MillRecipe(ItemStack targetedResult, float energy, IRecipeInput ingredient, List<IRecipeOutput> outputs) {
|
||||
public MillRecipe(ItemStack targetedResult, float energy, RecipeInput ingredient, RecipeOutput[] outputs) {
|
||||
this.energy = energy;
|
||||
|
||||
input = new ArrayList<PositionedStack>(2);
|
||||
@@ -226,26 +227,26 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
input.add(new PositionedStack(getBalls(), 122 - offset.x, 23 - offset.y));
|
||||
|
||||
output = new PositionedStack(outputs.get(0).getItem(), 49 - offset.x, 59 - offset.y);
|
||||
output = new PositionedStack(outputs[0].getOutput(), 49 - offset.x, 59 - offset.y);
|
||||
otherOutputs = new ArrayList<PositionedStack>();
|
||||
if(outputs.size() > 1) {
|
||||
otherOutputs.add(new PositionedStack(outputs.get(1).getItem(), 70 - offset.x, 59 - offset.y));
|
||||
if(outputs.length > 1) {
|
||||
otherOutputs.add(new PositionedStack(outputs[1].getOutput(), 70 - offset.x, 59 - offset.y));
|
||||
}
|
||||
if(outputs.size() > 2) {
|
||||
otherOutputs.add(new PositionedStack(outputs.get(2).getItem(), 91 - offset.x, 59 - offset.y));
|
||||
if(outputs.length > 2) {
|
||||
otherOutputs.add(new PositionedStack(outputs[2].getOutput(), 91 - offset.x, 59 - offset.y));
|
||||
}
|
||||
if(outputs.size() > 3) {
|
||||
otherOutputs.add(new PositionedStack(outputs.get(3).getItem(), 112 - offset.x, 59 - offset.y));
|
||||
if(outputs.length > 3) {
|
||||
otherOutputs.add(new PositionedStack(outputs[3].getOutput(), 112 - offset.x, 59 - offset.y));
|
||||
}
|
||||
|
||||
outputChance = new float[outputs.size()];
|
||||
outputChance = new float[outputs.length];
|
||||
indexOfTargetOutput = 0;
|
||||
numTargetOuput = 1;
|
||||
for (int i = 0; i < outputChance.length; i++) {
|
||||
outputChance[i] = outputs.get(i).getChance();
|
||||
if(targetedResult != null && outputs.get(i).isEquivalent(targetedResult)) {
|
||||
outputChance[i] = outputs[i].getChance();
|
||||
if(targetedResult != null && outputs[i].getOutput().isItemEqual(targetedResult)) {
|
||||
indexOfTargetOutput = i;
|
||||
numTargetOuput = outputs.get(i).getQuantity();
|
||||
numTargetOuput = outputs[i].getOutput().stackSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,7 +254,7 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
private List<ItemStack> getBalls() {
|
||||
List<GrindingBall> daBalls = CrusherRecipeManager.getInstance().getBalls();
|
||||
List<ItemStack> res = new ArrayList<ItemStack>();
|
||||
for(GrindingBall ball : daBalls) {
|
||||
for (GrindingBall ball : daBalls) {
|
||||
res.add(ball.getInput());
|
||||
}
|
||||
return res;
|
||||
|
||||
@@ -20,11 +20,11 @@ import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.RecipeInfo;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.RecipeReigistry;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.still.GuiVat;
|
||||
import crazypants.enderio.machine.still.VatRecipeManager;
|
||||
import crazypants.render.ColorUtil;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
@@ -73,35 +73,31 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
if(result == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(FluidContainerRegistry.isFilledContainer(result)) {
|
||||
FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(result);
|
||||
if(fluid != null) {
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForOutput(IEnderIoRecipe.VAT_ID, fluid);
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
InnerVatRecipe res = new InnerVatRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), recipe.getOutputs().get(0).getFluid());
|
||||
arecipes.add(res);
|
||||
List<IRecipe> recipes = VatRecipeManager.getInstance().getRecipes();
|
||||
for (IRecipe recipe : recipes) {
|
||||
FluidStack output = recipe.getOutputs()[0].getFluidOutput();
|
||||
if(output.isFluidEqual(fluid)) {
|
||||
InnerVatRecipe res = new InnerVatRecipe(recipe.getEnergyRequired(), recipe.getInputs(), output);
|
||||
arecipes.add(res);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForOutput(IEnderIoRecipe.VAT_ID, result);
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
InnerVatRecipe res = new InnerVatRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), recipe.getOutputs().get(0).getFluid());
|
||||
arecipes.add(res);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if(outputId.equals("EnderIOVat") && getClass() == VatRecipeHandler.class) {
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForCrafter(IEnderIoRecipe.VAT_ID);
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
InnerVatRecipe res = new InnerVatRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), recipe.getOutputs().get(0).getFluid());
|
||||
List<IRecipe> recipes = VatRecipeManager.getInstance().getRecipes();
|
||||
for (IRecipe recipe : recipes) {
|
||||
FluidStack output = recipe.getOutputs()[0].getFluidOutput();
|
||||
InnerVatRecipe res = new InnerVatRecipe(recipe.getEnergyRequired(), recipe.getInputs(), output);
|
||||
arecipes.add(res);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
@@ -109,15 +105,34 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForCrafter(IEnderIoRecipe.VAT_ID);
|
||||
|
||||
for (IEnderIoRecipe recipe : recipes) {
|
||||
if(recipe.isInput(ingredient)) {
|
||||
InnerVatRecipe res = new InnerVatRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), recipe.getOutputs().get(0).getFluid());
|
||||
res.setIngredientPermutation(res.inputs, ingredient);
|
||||
List<IRecipe> recipes = VatRecipeManager.getInstance().getRecipes();
|
||||
for (IRecipe recipe : recipes) {
|
||||
boolean addRecipe = false;
|
||||
if(recipe.isValidInput(0, ingredient) || recipe.isValidInput(1, ingredient)) {
|
||||
addRecipe = true;
|
||||
} else if(FluidContainerRegistry.isFilledContainer(ingredient)) {
|
||||
FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(ingredient);
|
||||
if(fluid != null) {
|
||||
if(recipe.isValidInput(fluid)) {
|
||||
addRecipe = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(addRecipe) {
|
||||
FluidStack output = recipe.getOutputs()[0].getFluidOutput();
|
||||
InnerVatRecipe res = new InnerVatRecipe(recipe.getEnergyRequired(), recipe.getInputs(), output);
|
||||
arecipes.add(res);
|
||||
}
|
||||
}
|
||||
|
||||
// List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForCrafter(IEnderIoRecipe.VAT_ID);
|
||||
// for (IEnderIoRecipe recipe : recipes) {
|
||||
// if(recipe.isInput(ingredient)) {
|
||||
// InnerVatRecipe res = new InnerVatRecipe(recipe.getRequiredEnergy(), recipe.getInputs(), recipe.getOutputs().get(0).getFluid());
|
||||
// res.setIngredientPermutation(res.inputs, ingredient);
|
||||
// arecipes.add(res);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -214,10 +229,15 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
super.drawProgressBar(87 - 13, 37 - 16, 200, 0, 17, 24, completion, 1);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(IRecipeInput input) {
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
List<ItemStack> result = new ArrayList<ItemStack>();
|
||||
result.add(input.getItem());
|
||||
result.addAll(input.getEquivelentInputs());
|
||||
result.add(input.getInput());
|
||||
ItemStack[] eq = input.getEquivelentInputs();
|
||||
if(eq != null) {
|
||||
for (ItemStack st : eq) {
|
||||
result.add(st);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -242,19 +262,19 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
public InnerVatRecipe(float energy, List<IRecipeInput> ingredients, FluidStack result) {
|
||||
public InnerVatRecipe(float energy, RecipeInput[] ingredients, FluidStack result) {
|
||||
ArrayList<ItemStack> inputsOne = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> inputsTwo = new ArrayList<ItemStack>();
|
||||
for (IRecipeInput input : ingredients) {
|
||||
if(input.getItem() != null) {
|
||||
for (RecipeInput input : ingredients) {
|
||||
if(input.getInput() != null) {
|
||||
List<ItemStack> equivs = getInputs(input);
|
||||
if(input.getSlot() == 0) {
|
||||
if(input.getSlotNumber() == 0) {
|
||||
inputsOne.addAll(equivs);
|
||||
} else if(input.getSlot() == 1) {
|
||||
} else if(input.getSlotNumber() == 1) {
|
||||
inputsTwo.addAll(equivs);
|
||||
}
|
||||
} else if(input.getFluid() != null) {
|
||||
inFluid = input.getFluid();
|
||||
} else if(input.getFluidInput() != null) {
|
||||
inFluid = input.getFluidInput();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package crazypants.enderio.teleport;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGlowstone;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
@@ -26,21 +22,12 @@ import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.block.BlockDarkSteelPressurePlate.PainterTemplate;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.crafting.IEnderIoRecipe;
|
||||
import crazypants.enderio.crafting.IRecipeInput;
|
||||
import crazypants.enderio.crafting.IRecipeOutput;
|
||||
import crazypants.enderio.crafting.impl.EnderIoRecipe;
|
||||
import crazypants.enderio.crafting.impl.RecipeInputClass;
|
||||
import crazypants.enderio.crafting.impl.RecipeOutput;
|
||||
import crazypants.enderio.gui.IResourceTooltipProvider;
|
||||
import crazypants.enderio.machine.MachineRecipeInput;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.IMachineRecipe.ResultStack;
|
||||
import crazypants.enderio.machine.painter.BasicPainterTemplate;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.machine.painter.TileEntityPaintedBlock;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.teleport.packet.PacketAccessMode;
|
||||
import crazypants.enderio.teleport.packet.PacketConfigSync;
|
||||
@@ -48,7 +35,6 @@ import crazypants.enderio.teleport.packet.PacketDrainStaff;
|
||||
import crazypants.enderio.teleport.packet.PacketOpenAuthGui;
|
||||
import crazypants.enderio.teleport.packet.PacketTravelEvent;
|
||||
import crazypants.util.Lang;
|
||||
import crazypants.util.Util;
|
||||
|
||||
public class BlockTravelAnchor extends BlockEio implements IGuiHandler, ITileEntityProvider, IResourceTooltipProvider {
|
||||
|
||||
@@ -253,15 +239,7 @@ public class BlockTravelAnchor extends BlockEio implements IGuiHandler, ITileEnt
|
||||
}
|
||||
return new ResultStack[] { new ResultStack(createItemStackForSourceBlock(Block.getBlockFromItem(paintSource.getItem()), paintSource.getItemDamage())) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IEnderIoRecipe> getAllRecipes() {
|
||||
IRecipeInput input = new RecipeInputClass<BlockTravelAnchor>(new ItemStack(EnderIO.blockTravelPlatform), BlockTravelAnchor.class);
|
||||
IRecipeOutput output = new RecipeOutput(new ItemStack(EnderIO.blockTravelPlatform, 1, 0));
|
||||
IEnderIoRecipe recipe = new EnderIoRecipe(getMachineName(), DEFAULT_ENERGY_PER_TASK, input, output);
|
||||
return Collections.singletonList(recipe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user