Almost finished Ritual for item routing
This commit is contained in:
parent
539bb564fa
commit
3b590fab6c
12 changed files with 120 additions and 65 deletions
|
@ -1,6 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.routing;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
|
||||
|
@ -52,11 +56,28 @@ public class OutputRoutingFocus extends RoutingFocus
|
|||
case 1:
|
||||
addedString = "modItem";
|
||||
break;
|
||||
case 2:
|
||||
addedString = "ignMeta";
|
||||
break;
|
||||
case 3:
|
||||
addedString = "matchNBT";
|
||||
break;
|
||||
}
|
||||
|
||||
return super.getUnlocalizedName() + "." + addedString;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
|
||||
{
|
||||
for (int meta = 0; meta < 4; ++meta)
|
||||
{
|
||||
list.add(new ItemStack(id, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoutingFocusLogic getLogic(int damage)
|
||||
{
|
||||
switch(damage)
|
||||
|
|
|
@ -6,13 +6,14 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusLogic;
|
||||
import WayofTime.alchemicalWizardry.api.RoutingFocusPosAndFacing;
|
||||
|
||||
public class RoutingFocus extends Item
|
||||
|
@ -152,4 +153,35 @@ public class RoutingFocus extends Item
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public RoutingFocusLogic getLogic(int damage)
|
||||
{
|
||||
return new RoutingFocusLogic();
|
||||
}
|
||||
|
||||
public int getDefaultStackLimit(int damage)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getStackLimitAmount(ItemStack itemStack)
|
||||
{
|
||||
if (!(itemStack.getTagCompound() == null))
|
||||
{
|
||||
return itemStack.getTagCompound().getInteger("stackLimit");
|
||||
} else
|
||||
{
|
||||
return getDefaultStackLimit(itemStack.getItemDamage());
|
||||
}
|
||||
}
|
||||
|
||||
public void setStackLimitAmount(ItemStack itemStack, int amt)
|
||||
{
|
||||
if ((itemStack.getTagCompound() == null))
|
||||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemStack.getTagCompound().setInteger("stackLimit", amt);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue