@SubscribeEvent
public void ItemCraftedEvent(cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent event)
{
//System.out.println("[EVENT] Player crafted something.");
if (event.crafting != null && event.crafting.getItem() instanceof ERA)
{
ItemStack stack = event.craftMatrix.getStackInSlot(1);
if (stack != null && stack.stackSize > 1)
{
stack.stackSize -= 26;
if (stack.stackSize <= 0) { event.craftMatrix.setInventorySlotContents(1, null); } // Nothing left
}
// else, nothing in there or only a single rail, meaning this is a repairing event. I'm fine with that
}
// else, not mine, so don't care
else if (event.crafting != null && event.crafting.getItem() instanceof _WeaponBase) // More generic weapon check
{
this.copyName(event.craftMatrix, event.crafting);
}
}
Listener.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:minecraft-quiverbow
作者:
评论列表
文章目录