本文整理汇总了Java中baubles.api.cap.IBaublesItemHandler.setStackInSlot方法的典型用法代码示例。如果您正苦于以下问题:Java IBaublesItemHandler.setStackInSlot方法的具体用法?Java IBaublesItemHandler.setStackInSlot怎么用?Java IBaublesItemHandler.setStackInSlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类baubles.api.cap.IBaublesItemHandler
的用法示例。
在下文中一共展示了IBaublesItemHandler.setStackInSlot方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemRightClick
import baubles.api.cap.IBaublesItemHandler; //导入方法依赖的package包/类
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
if (!world.isRemote) {
IBaublesItemHandler baubles = BaublesApi.getBaublesHandler(player);
for (int i = 0; i < baubles.getSlots(); i++)
if (baubles.getStackInSlot(i).isEmpty() && baubles.isItemValidForSlot(i, player.getHeldItem(hand), player)) {
baubles.setStackInSlot(i, player.getHeldItem(hand).copy());
if (!player.capabilities.isCreativeMode) {
player.setHeldItem(hand, ItemStack.EMPTY);
}
onEquipped(player.getHeldItem(hand), player);
break;
}
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
}
示例2: setPlayerBaubles
import baubles.api.cap.IBaublesItemHandler; //导入方法依赖的package包/类
public static void setPlayerBaubles(EntityPlayer player, NBTTagCompound compound)
{
IBaublesItemHandler baubles = BaublesApi.getBaublesHandler(player);
IInventory stored = getSavedBaubles(compound, baubles);
for (int i=0; i < baubles.getSlots(); i++)
{
baubles.setStackInSlot(i, stored.getStackInSlot(i));
}
}
示例3: clearBaubles
import baubles.api.cap.IBaublesItemHandler; //导入方法依赖的package包/类
public static void clearBaubles(EntityPlayer player)
{
IBaublesItemHandler handler = BaublesApi.getBaublesHandler(player);
for (int i=0; i < handler.getSlots(); i++)
{
handler.setStackInSlot(i, null);
}
}
示例4: setPlayerBaubles
import baubles.api.cap.IBaublesItemHandler; //导入方法依赖的package包/类
private void setPlayerBaubles(EntityPlayerMP player, NBTTagList taglist)
{
IBaublesItemHandler baubles = BaublesApi.getBaublesHandler(player);
for (int i=0; i < taglist.tagCount(); i++)
{
NBTTagCompound slot = (NBTTagCompound)taglist.get(i);
baubles.setStackInSlot(slot.getInteger("Slot"), new ItemStack(slot));
}
}
示例5: setToBaubles
import baubles.api.cap.IBaublesItemHandler; //导入方法依赖的package包/类
public void setToBaubles(EntityPlayer player, int slot, ItemStack stack)
{
IBaublesItemHandler baubles = BaublesApi.getBaublesHandler(player);
baubles.setStackInSlot(slot, stack);
}
示例6: setBauble
import baubles.api.cap.IBaublesItemHandler; //导入方法依赖的package包/类
public static void setBauble(EntityPlayer p, int slot, ItemStack stack)
{
IBaublesItemHandler hand = p.getCapability(BaublesCapabilities.CAPABILITY_BAUBLES, null);
hand.setStackInSlot(slot, stack);
}