Deprecated the item cells class, it now returns the ic2 version instead of the tr one for recipes
This commit is contained in:
parent
345fa8e4a0
commit
8058867eb1
1 changed files with 26 additions and 8 deletions
|
@ -1,26 +1,44 @@
|
||||||
package techreborn.items;
|
package techreborn.items;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import ic2.api.item.IC2Items;
|
||||||
|
import ic2.core.Ic2Items;
|
||||||
|
import ic2.core.item.ItemFluidCell;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
|
import techreborn.util.LogHelper;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public class ItemCells extends ItemTR {
|
public class ItemCells extends ItemTR {
|
||||||
public static ItemStack getCellByName(String name, int count)
|
public static ItemStack getCellByName(String name, int count)
|
||||||
{
|
{
|
||||||
int index = -1;
|
ItemFluidCell itemFluidCell = (ItemFluidCell) Ic2Items.FluidCell.getItem();
|
||||||
for (int i = 0; i < types.length; i++) {
|
Fluid fluid = FluidRegistry.getFluid("fluid" + name.toLowerCase());
|
||||||
if (types[i].equals(name)) {
|
if(fluid != null){
|
||||||
index = i;
|
ItemStack stack = Ic2Items.FluidCell.copy();
|
||||||
break;
|
itemFluidCell.fill(stack, new FluidStack(fluid.getID(), 2147483647), true);
|
||||||
}
|
return stack;
|
||||||
}
|
} else {
|
||||||
return new ItemStack(ModItems.cells, count, index);
|
LogHelper.error("Could not find " + "fluid" + name + " in the fluid registry!");
|
||||||
|
}
|
||||||
|
int index = -1;
|
||||||
|
for (int i = 0; i < types.length; i++) {
|
||||||
|
if (types[i].equals(name)) {
|
||||||
|
index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new ItemStack(ModItems.cells, count, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack getCellByName(String name)
|
public static ItemStack getCellByName(String name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue