当前位置: 首页>>代码示例>>Java>>正文


Java IBaublesItemHandler.setStackInSlot方法代码示例

本文整理汇总了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));
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:17,代码来源:ItemRemedyTalisman.java

示例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));
    }
}
 
开发者ID:M4thG33k,项目名称:TombManyGraves,代码行数:12,代码来源:BaubleHandler.java

示例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);
    }
}
 
开发者ID:M4thG33k,项目名称:TombManyGraves,代码行数:10,代码来源:BaubleHandler.java

示例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));
    }
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:11,代码来源:GamemodeInventoryBaubles.java

示例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);
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:6,代码来源:BeltFinderBaubles.java

示例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);
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:6,代码来源:ItemUtils.java


注:本文中的baubles.api.cap.IBaublesItemHandler.setStackInSlot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。