本文整理汇总了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);
}
}
}
示例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;
}
示例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);
}
}
}
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}