• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InventoryBaubles类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中baubles.common.container.InventoryBaubles的典型用法代码示例。如果您正苦于以下问题:Java InventoryBaubles类的具体用法?Java InventoryBaubles怎么用?Java InventoryBaubles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InventoryBaubles类属于baubles.common.container包,在下文中一共展示了InventoryBaubles类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onWornTick

import baubles.common.container.InventoryBaubles; //导入依赖的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.container.InventoryBaubles; //导入依赖的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.container.InventoryBaubles; //导入依赖的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.container.InventoryBaubles; //导入依赖的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: dropAll

import baubles.common.container.InventoryBaubles; //导入依赖的package包/类
public boolean dropAll(EntityPlayer player, String timestamp)
    {
        boolean didWork = true;

        String filename = TombManyGraves.file + DeathInventoryHandler.FILE_PREFIX + "/" + player.getName() + "#" + timestamp + ".json";

        BufferedReader reader;

        try
        {
            reader = new BufferedReader(new FileReader(filename));
            String fileData = reader.readLine();
            allNBT = JsonToNBT.getTagFromJson(fileData);
            InventoryPlayer inventoryPlayer = new InventoryPlayer(player);
            inventoryPlayer.readFromNBT(allNBT.getTagList("Main",10));
            InventoryHelper.dropInventoryItems(player.worldObj, player.getPosition(), inventoryPlayer);

            if (TombManyGraves.isBaublesInstalled)
            {
                InventoryBaubles inventoryBaubles = new InventoryBaubles(player);
                inventoryBaubles.readNBT(allNBT.getCompoundTag("Baubles"));
                InventoryHelper.dropInventoryItems(player.worldObj, player.getPosition(), inventoryBaubles);
            }
        }
        catch (Exception e)
        {
//            e.printStackTrace();
            didWork = false;
        }

        return didWork;
    }
 
开发者ID:M4thG33k,项目名称:TombManyGraves-NOT-FOR-1.9.4-,代码行数:33,代码来源:DeathInventory.java


示例6: restoreAll

import baubles.common.container.InventoryBaubles; //导入依赖的package包/类
public boolean restoreAll(EntityPlayer player, String timestamp)
    {
        boolean didWork = true;

        String filename = TombManyGraves.file + DeathInventoryHandler.FILE_PREFIX + "/" + player.getName() + "#" + timestamp + ".json";

        BufferedReader reader;

        try
        {
            reader = new BufferedReader(new FileReader(filename));
            String fileData = reader.readLine();
            allNBT = JsonToNBT.getTagFromJson(fileData);
            player.inventory.readFromNBT(allNBT.getTagList("Main",10));

            if (TombManyGraves.isBaublesInstalled)
            {
                InventoryBaubles inventoryBaubles = new InventoryBaubles(player);
                inventoryBaubles.readNBT(allNBT.getCompoundTag("Baubles"));
                PlayerHandler.setPlayerBaubles(player,inventoryBaubles);
            }
        }
        catch (Exception e)
        {
//            e.printStackTrace();
            didWork = false;
        }

        return didWork;
    }
 
开发者ID:M4thG33k,项目名称:TombManyGraves-NOT-FOR-1.9.4-,代码行数:31,代码来源:DeathInventory.java


示例7: replaceBaublesInventory

import baubles.common.container.InventoryBaubles; //导入依赖的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


示例8: dropAllItems

import baubles.common.container.InventoryBaubles; //导入依赖的package包/类
public void dropAllItems()
{
    InventoryHelper.dropInventoryItems(worldObj, pos, savedPlayerInventory);
    if (TombManyGraves.isBaublesInstalled)
    {
        InventoryBaubles baubles = new InventoryBaubles(null);
        baubles.readNBT(baublesNBT);
        InventoryHelper.dropInventoryItems(worldObj, pos, baubles);
    }
}
 
开发者ID:M4thG33k,项目名称:TombManyGraves-NOT-FOR-1.9.4-,代码行数:11,代码来源:TileDeathBlock.java


示例9: drawBaublesHudIcons

import baubles.common.container.InventoryBaubles; //导入依赖的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


示例10: onItemRightClick

import baubles.common.container.InventoryBaubles; //导入依赖的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


示例11: onItemRightClick

import baubles.common.container.InventoryBaubles; //导入依赖的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


示例12: getPlayerBaubles

import baubles.common.container.InventoryBaubles; //导入依赖的package包/类
public static InventoryBaubles getPlayerBaubles(EntityPlayer player) {
	if (!playerBaubles.containsKey(player.getCommandSenderName())) {
		InventoryBaubles inventory = new InventoryBaubles(player);
		playerBaubles.put(player.getCommandSenderName(), inventory);
	}
	return playerBaubles.get(player.getCommandSenderName());
}
 
开发者ID:Romejanic,项目名称:RuneMagic,代码行数:8,代码来源:PlayerHandler.java


示例13: setPlayerBaubles

import baubles.common.container.InventoryBaubles; //导入依赖的package包/类
public static void setPlayerBaubles(EntityPlayer player, InventoryBaubles inventory) {
	playerBaubles.put(player.getCommandSenderName(), inventory);
}
 
开发者ID:Romejanic,项目名称:RuneMagic,代码行数:4,代码来源:PlayerHandler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GeckoDriverService类代码示例发布时间:2022-05-22
下一篇:
Java ListSingleSelection类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap