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


Java PlayerHandler.getPlayerBaubles方法代码示例

本文整理汇总了Java中baubles.common.lib.PlayerHandler.getPlayerBaubles方法的典型用法代码示例。如果您正苦于以下问题:Java PlayerHandler.getPlayerBaubles方法的具体用法?Java PlayerHandler.getPlayerBaubles怎么用?Java PlayerHandler.getPlayerBaubles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在baubles.common.lib.PlayerHandler的用法示例。


在下文中一共展示了PlayerHandler.getPlayerBaubles方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onWornTick

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@Override
    public void onWornTick(ItemStack arg0, EntityLivingBase pEntity) {
        if (!(pEntity instanceof EntityPlayer)) {
            return;
        }

        if (_mRnd.nextInt(20) == 0)
        {         
            EntityPlayer tPlayer = (EntityPlayer)pEntity;
            InventoryBaubles tBaubles = PlayerHandler.getPlayerBaubles(tPlayer);
            //PotionEffect tEff = getNBTPotionEffect(arg0);
            //int tStoredVictus = GetNBTVictusVis(arg0);
            
            /*if (tEff == null || tStoredVictus < 1)
            {
                return;
            }
*/
            Potion tPot = Potion.wither;
            if (tPlayer.isPotionActive(tPot))
            {
                tPlayer.removePotionEffect(tPot.id);
                //DamageItem(arg0);
            }
        }
    }
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsCoreMod,代码行数:27,代码来源:WitherProtectionRing.java

示例2: onItemRightClick

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
	if(!par2World.isRemote) { 
		InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
		for(int i = 0; i < baubles.getSizeInventory(); i++)
			if(baubles.getStackInSlot(i) == null && baubles.isItemValidForSlot(i, par1ItemStack)) {
				baubles.setInventorySlotContents(i, par1ItemStack.copy());
				if(!par3EntityPlayer.capabilities.isCreativeMode){
					par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
				}
				onEquipped(par1ItemStack, par3EntityPlayer);
				break;
			}
	}

	return par1ItemStack;	
}
 
开发者ID:Romejanic,项目名称:RuneMagic,代码行数:18,代码来源:SoulPendant.java

示例3: playerTick

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@SubscribeEvent
public void playerTick(PlayerEvent.LivingUpdateEvent event) {
	
	//player events
	if (event.entity instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer)event.entity;
		
		InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
		for (int a=0;a<baubles.getSizeInventory();a++) {
			if (baubles.getStackInSlot(a)!=null && baubles.getStackInSlot(a).getItem() instanceof IBauble) {
				((IBauble)baubles.getStackInSlot(a).getItem()).onWornTick(baubles.getStackInSlot(a), player);
			}
		}
		
	}
	
}
 
开发者ID:Romejanic,项目名称:RuneMagic,代码行数:18,代码来源:EventHandlerEntity.java

示例4: onItemRightClick

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
    if (!par2World.isRemote)
    {
        InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
        for (int i = 0; i < baubles.getSizeInventory(); i++)
            if (baubles.getStackInSlot(i) == null && baubles.isItemValidForSlot(i, par1ItemStack))
            {
                baubles.setInventorySlotContents(i, par1ItemStack.copy());
                if (!par3EntityPlayer.capabilities.isCreativeMode)
                {
                    par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
                }
                onEquipped(par1ItemStack, par3EntityPlayer);
                break;
            }
    }
    return par1ItemStack;
}
 
开发者ID:Arouka,项目名称:Clothier,代码行数:20,代码来源:ItemBauble.java

示例5: onItemRightClick

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@Method(modid="Baubles")
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
	if(!par2World.isRemote) { 
		baubles.common.container.InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
		for(int i = 0; i < baubles.getSizeInventory(); i++)
			if(baubles.getStackInSlot(i) == null && baubles.isItemValidForSlot(i, par1ItemStack)) {
				baubles.setInventorySlotContents(i, par1ItemStack.copy());
				if(!par3EntityPlayer.capabilities.isCreativeMode){
					par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
				}
				onEquipped(par1ItemStack, par3EntityPlayer);
				break;
			}
	}

	return par1ItemStack;	
}
 
开发者ID:OmgImAlexis,项目名称:TheStuffMod,代码行数:19,代码来源:ItemRing.java

示例6: replaceBaublesInventory

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
public void replaceBaublesInventory(EntityPlayer player)
{
    IInventory currentBaubles = PlayerHandler.getPlayerBaubles(player);
    InventoryBaubles savedBaubles = new InventoryBaubles(player);
    savedBaubles.readNBT(baublesNBT);

    replaceSpecificInventory(player,currentBaubles,savedBaubles);

    baublesNBT = new NBTTagCompound();

}
 
开发者ID:M4thG33k,项目名称:TombManyGraves-NOT-FOR-1.9.4-,代码行数:12,代码来源:TileDeathBlock.java

示例7: drawBaublesHudIcons

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
public void drawBaublesHudIcons(ScaledResolution res) 
{
	EntityPlayer player = mc.thePlayer;
	InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);

	// Renders the ItemStacks from the players baubles inventory in the
	// correct
	// X, Y Cordinates
	for (int i = 0; i < 4; i++)
	{
		renderItemStack(inv.getStackInSlot(i), LocX + i * LocOffsetX, LocY + i * LocOffsetY);
	}
}
 
开发者ID:gigabit101,项目名称:BaublesHud,代码行数:14,代码来源:HudBaubles.java

示例8: onItemRightClick

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@Override
// Equips Talismans When Right Clicked In Players Hand
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
		EntityPlayer par3EntityPlayer)
{
	InventoryBaubles baubles = PlayerHandler
			.getPlayerBaubles(par3EntityPlayer);
	for (int i = 0; i < baubles.getSizeInventory(); i++) {
		if (baubles.isItemValidForSlot(i, par1ItemStack)) {
			ItemStack stackInSlot = baubles.getStackInSlot(i);

			if (stackInSlot == null
					|| ((IBauble) stackInSlot.getItem()).canUnequip(
							stackInSlot, par3EntityPlayer)) {
				if (!par2World.isRemote) {
					baubles.setInventorySlotContents(i,
							par1ItemStack.copy());

					if (!par3EntityPlayer.capabilities.isCreativeMode)
						par3EntityPlayer.inventory
								.setInventorySlotContents(
										par3EntityPlayer.inventory.currentItem,
										null);
				}

				onEquipped(par1ItemStack, par3EntityPlayer);

				if (stackInSlot != null) {
					((IBauble) stackInSlot.getItem()).onUnequipped(
							stackInSlot, par3EntityPlayer);
					return stackInSlot.copy();
				}
				break;
			}
		}
	}

	return par1ItemStack;
}
 
开发者ID:TeamC4,项目名称:Talismans2,代码行数:40,代码来源:ItemTalismanBauble.java

示例9: onItemRightClick

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
		EntityPlayer par3EntityPlayer) {
	InventoryBaubles baubles = PlayerHandler
			.getPlayerBaubles(par3EntityPlayer);
	for (int i = 0; i < baubles.getSizeInventory(); i++) {
		if (baubles.isItemValidForSlot(i, par1ItemStack)) {
			ItemStack stackInSlot = baubles.getStackInSlot(i);
			if (stackInSlot == null
					|| ((IBauble) stackInSlot.getItem()).canUnequip(
							stackInSlot, par3EntityPlayer)) {
				if (!par2World.isRemote) {
					baubles.setInventorySlotContents(i,
							par1ItemStack.copy());
					if (!par3EntityPlayer.capabilities.isCreativeMode)
						par3EntityPlayer.inventory
								.setInventorySlotContents(
										par3EntityPlayer.inventory.currentItem,
										null);
				}

				onEquipped(par1ItemStack, par3EntityPlayer);

				if (stackInSlot != null) {
					((IBauble) stackInSlot.getItem()).onUnequipped(
							stackInSlot, par3EntityPlayer);
					return stackInSlot.copy();
				}
				break;
			}
		}
	}

	return par1ItemStack;
}
 
开发者ID:gigabit101,项目名称:Talismans,代码行数:36,代码来源:ItemTalisman.java

示例10: onUnequipped

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@Override
public void onUnequipped(ItemStack itemstack, EntityLivingBase player) {
       ((EntityPlayer)player).setGameType(GameType.SURVIVAL);
       for(ItemStack bau: PlayerHandler.getPlayerBaubles((EntityPlayer) player).stackList)
       	if(bau != null && bau.getItem() == NFMain.flyBelt)
       		((EntityPlayer)player).capabilities.isFlying = true;
}
 
开发者ID:mookie1097,项目名称:NightfallMod,代码行数:8,代码来源:CreativeAmulet.java

示例11: handleClientSide

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
@Override
public void handleClientSide(EntityPlayer player) {
	World world = player.worldObj;
	if (world==null) return;
	Entity p = world.getEntityByID(playerId);
	if (p !=null && p instanceof EntityPlayer) {
		PlayerHandler.getPlayerBaubles((EntityPlayer) p).stackList[slot]=bauble;
	}
}
 
开发者ID:Romejanic,项目名称:RuneMagic,代码行数:10,代码来源:PacketSyncBauble.java

示例12: ContainerPlayerExpanded

import baubles.common.lib.PlayerHandler; //导入方法依赖的package包/类
public ContainerPlayerExpanded(InventoryPlayer playerInv, boolean par2, EntityPlayer player)
{
    this.isLocalWorld = par2;
    this.thePlayer = player;
    baubles = new InventoryBaubles(player);
    baubles.setEventHandler(this);
    if (!player.worldObj.isRemote) {
    	baubles.stackList = PlayerHandler.getPlayerBaubles(player).stackList;
    }
    
    this.addSlotToContainer(new SlotCrafting(playerInv.player, this.craftMatrix, this.craftResult, 0, 144, 36));
    int i;
    int j;

    for (i = 0; i < 2; ++i)
    {
        for (j = 0; j < 2; ++j)
        {
            this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 2, 106 + j * 18, 26 + i * 18));
        }
    }

    for (i = 0; i < 4; ++i)
    {
        final int k = i;
        this.addSlotToContainer(new Slot(playerInv, playerInv.getSizeInventory() - 1 - i, 8, 8 + i * 18)
        {
            @Override
            public int getSlotStackLimit() { return 1; }
            @Override
            public boolean isItemValid(ItemStack par1ItemStack)
            {
                if (par1ItemStack == null) return false;
                return par1ItemStack.getItem().isValidArmor(par1ItemStack, k, thePlayer);
            }
        });
    }
    
    this.addSlotToContainer(new SlotBauble(baubles,BaubleType.AMULET,0,80,8 + 0 * 18));
    this.addSlotToContainer(new SlotBauble(baubles,BaubleType.RING,1,80,8 + 1 * 18));
    this.addSlotToContainer(new SlotBauble(baubles,BaubleType.RING,2,80,8 + 2 * 18));
    this.addSlotToContainer(new SlotBauble(baubles,BaubleType.BELT,3,80,8 + 3 * 18));

    for (i = 0; i < 3; ++i)
    {
        for (j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(playerInv, j + (i + 1) * 9, 8 + j * 18, 84 + i * 18));
        }
    }

    for (i = 0; i < 9; ++i)
    {
        this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
    }

    this.onCraftMatrixChanged(this.craftMatrix);
}
 
开发者ID:Romejanic,项目名称:RuneMagic,代码行数:59,代码来源:ContainerPlayerExpanded.java


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