Merge remote-tracking branch 'origin/master'

This commit is contained in:
Tntrololol 2015-05-10 15:39:27 -05:00
commit 51071be80c
7 changed files with 38 additions and 10 deletions

View file

@ -6,6 +6,7 @@ import net.minecraftforge.oredict.OreDictionary;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiAlloySmelter;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.util.ItemUtils;
import java.util.List;
@ -13,10 +14,10 @@ public class AlloySmelterRecipeHandler extends GenericRecipeHander implements IN
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(OreDictionary.getOres(OreDictionary.getOreName(OreDictionary.getOreID(recipeType.getInputs().get(0)))), 56 - offset, 25 - offset);
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 25 - offset);
input.add(pStack);
PositionedStack pStack2 = new PositionedStack(OreDictionary.getOres(OreDictionary.getOreName(OreDictionary.getOreID(recipeType.getInputs().get(1)))), 56 - offset, 43 - offset);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 56 - offset, 43 - offset);
input.add(pStack2);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutputs().get(0), 116 - offset, 35 - offset);

View file

@ -5,6 +5,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiAssemblingMachine;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.util.ItemUtils;
import java.util.List;
@ -12,10 +13,10 @@ public class AssemblingMachineRecipeHandler extends GenericRecipeHander implemen
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(recipeType.getInputs().get(0), 47 - offset, 17 - offset);
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset);
input.add(pStack);
PositionedStack pStack2 = new PositionedStack(recipeType.getInputs().get(1), 65 - offset, 17 - offset);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
input.add(pStack2);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutputs().get(0), 116 - offset, 35 - offset);

View file

@ -7,6 +7,7 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.util.ItemUtils;
import java.util.ArrayList;
import java.util.List;
@ -15,10 +16,10 @@ public class ImplosionCompressorRecipeHandler extends GenericRecipeHander implem
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(OreDictionary.getOres(OreDictionary.getOreName(OreDictionary.getOreID(recipeType.getInputs().get(0)))), 34 - offset, 16 - offset);
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 34 - offset, 16 - offset);
input.add(pStack);
PositionedStack pStack2 = new PositionedStack(OreDictionary.getOres(OreDictionary.getOreName(OreDictionary.getOreID(recipeType.getInputs().get(1)))), 34 - offset, 34 - offset);
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 34 - offset, 34 - offset);
input.add(pStack2);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutputs().get(0), 86 - offset, 25 - offset);

View file

@ -6,6 +6,7 @@ import techreborn.api.recipe.IBaseRecipeType;
import techreborn.client.gui.GuiAlloySmelter;
import techreborn.client.gui.GuiImplosionCompressor;
import techreborn.client.gui.GuiLathe;
import techreborn.util.ItemUtils;
import java.util.List;
@ -13,7 +14,7 @@ public class LatheRecipeHandler extends GenericRecipeHander implements INeiBaseR
@Override
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
int offset = 4;
PositionedStack pStack = new PositionedStack(recipeType.getInputs().get(0), 56 - offset, 17 - offset);
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 17 - offset);
input.add(pStack);
PositionedStack pStack3 = new PositionedStack(recipeType.getOutputs().get(0), 116 - offset, 35 - offset);

View file

@ -198,7 +198,7 @@ public class ModRecipes {
Blocks.cobblestone);
TechRebornAPI.registerBlastFurnaceRecipe(new BlastFurnaceRecipe(new ItemStack(Items.apple), new ItemStack(Items.ender_pearl), new ItemStack(Items.golden_apple), new ItemStack(Items.diamond), 120, 1000));
RecipeHanderer.addRecipe(new ImplosionCompressorRecipe(new ItemStack(Blocks.planks, 4), IC2Items.getItem("copperIngot"), new ItemStack(Items.brewing_stand), new ItemStack(Items.carrot), 120, 5));
RecipeHanderer.addRecipe(new ImplosionCompressorRecipe(new ItemStack(Blocks.end_stone, 4), IC2Items.getItem("copperIngot"), new ItemStack(Items.brewing_stand), new ItemStack(Items.carrot), 120, 5));
RecipeHanderer.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.coal), new ItemStack(Blocks.sand), new ItemStack(Items.diamond), 120, 5));
RecipeHanderer.addRecipe(new AssemblingMachineRecipe(new ItemStack(Items.coal), new ItemStack(Blocks.sand), new ItemStack(Items.diamond), 120, 5));

View file

@ -3,6 +3,7 @@ package techreborn.tiles;
import ic2.api.energy.prefab.BasicSink;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import ic2.core.block.wiring.TileEntityElectricBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.api.recipe.RecipeCrafter;
@ -10,13 +11,15 @@ import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
public class TileAesu extends TileMachineBase implements IWrenchable, IEnergyTile {
public class TileAesu extends TileEntityElectricBlock implements IWrenchable {
public static final int MAX_OUTPUT = 8192;
public static final int MAX_STORAGE = 1000000000; //One billion!
public Inventory inventory = new Inventory(2, "TileAesu", 64);
public TileAesu()
{
super(5, TileAesu.MAX_OUTPUT, TileAesu.MAX_STORAGE);
}
@Override
@ -70,4 +73,10 @@ public class TileAesu extends TileMachineBase implements IWrenchable, IEnergyTil
return false;
}
@Override
public String getInventoryName()
{
return "AESU";
}
}

View file

@ -1,11 +1,13 @@
package techreborn.util;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.List;
/**
@ -110,4 +112,17 @@ public class ItemUtils {
{
return ItemStack.loadItemStackFromNBT(data);
}
public static List<ItemStack> getStackWithAllOre(ItemStack stack){
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
for (int oreID : OreDictionary.getOreIDs(stack)){
for(ItemStack ore : OreDictionary.getOres(OreDictionary.getOreName(oreID))){
list.add(ore);
}
}
if(list.isEmpty()){
list.add(stack);
}
return list;
}
}