本文整理汇总了Java中net.minecraft.item.ItemStack.field_190927_a方法的典型用法代码示例。如果您正苦于以下问题:Java ItemStack.field_190927_a方法的具体用法?Java ItemStack.field_190927_a怎么用?Java ItemStack.field_190927_a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.item.ItemStack
的用法示例。
在下文中一共展示了ItemStack.field_190927_a方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: detectAndSendChanges
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
* Looks for changes made in the container, sends them to every listener.
*/
public void detectAndSendChanges()
{
for (int i = 0; i < this.inventorySlots.size(); ++i)
{
ItemStack itemstack = ((Slot)this.inventorySlots.get(i)).getStack();
ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i);
if (!ItemStack.areItemStacksEqual(itemstack1, itemstack))
{
itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.copy();
this.inventoryItemStacks.set(i, itemstack1);
for (int j = 0; j < this.listeners.size(); ++j)
{
((IContainerListener)this.listeners.get(j)).sendSlotContents(this, i, itemstack1);
}
}
}
}
示例2: notifyDataManagerChange
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void notifyDataManagerChange(DataParameter<?> key)
{
super.notifyDataManagerChange(key);
if (HAND_STATES.equals(key) && this.world.isRemote)
{
if (this.isHandActive() && this.activeItemStack.func_190926_b())
{
this.activeItemStack = this.getHeldItem(this.getActiveHand());
if (!this.activeItemStack.func_190926_b())
{
this.activeItemStackUseCount = this.activeItemStack.getMaxItemUseDuration();
}
}
else if (!this.isHandActive() && !this.activeItemStack.func_190926_b())
{
this.activeItemStack = ItemStack.field_190927_a;
this.activeItemStackUseCount = 0;
}
}
}
示例3: decrStackSize
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
* Removes up to a specified number of items from an inventory slot and returns them in a new stack.
*/
public ItemStack decrStackSize(int index, int count)
{
List<ItemStack> list = null;
for (NonNullList<ItemStack> nonnulllist : this.allInventories)
{
if (index < nonnulllist.size())
{
list = nonnulllist;
break;
}
index -= nonnulllist.size();
}
return list != null && !((ItemStack)list.get(index)).func_190926_b() ? ItemStackHelper.getAndSplit(list, index, count) : ItemStack.field_190927_a;
}
示例4: damageShield
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
protected void damageShield(float damage)
{
if (damage >= 3.0F && this.activeItemStack.getItem() == Items.SHIELD)
{
int i = 1 + MathHelper.floor(damage);
this.activeItemStack.damageItem(i, this);
if (this.activeItemStack.func_190926_b())
{
EnumHand enumhand = this.getActiveHand();
if (enumhand == EnumHand.MAIN_HAND)
{
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, ItemStack.field_190927_a);
}
else
{
this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, ItemStack.field_190927_a);
}
this.activeItemStack = ItemStack.field_190927_a;
this.playSound(SoundEvents.ITEM_SHIELD_BREAK, 0.8F, 0.8F + this.world.rand.nextFloat() * 0.4F);
}
}
}
示例5: removeStackFromSlot
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
* Removes a stack from the given slot and returns it.
*/
public ItemStack removeStackFromSlot(int index)
{
if (index == 0)
{
ItemStack itemstack = this.payment;
this.payment = ItemStack.field_190927_a;
return itemstack;
}
else
{
return ItemStack.field_190927_a;
}
}
示例6: MerchantRecipe
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public MerchantRecipe(NBTTagCompound tagCompound)
{
this.itemToBuy = ItemStack.field_190927_a;
this.secondItemToBuy = ItemStack.field_190927_a;
this.itemToSell = ItemStack.field_190927_a;
this.readFromTags(tagCompound);
}
示例7: findMatchingRecipe
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
* Retrieves an ItemStack that has multiple recipes for it.
*/
public ItemStack findMatchingRecipe(InventoryCrafting craftMatrix, World worldIn)
{
for (IRecipe irecipe : this.recipes)
{
if (irecipe.matches(craftMatrix, worldIn))
{
return irecipe.getCraftingResult(craftMatrix);
}
}
return ItemStack.field_190927_a;
}
示例8: CPacketCreativeInventoryAction
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public CPacketCreativeInventoryAction(int slotIdIn, ItemStack stackIn)
{
this.slotId = slotIdIn;
this.stack = stackIn.func_190926_b() ? ItemStack.field_190927_a : stackIn.copy();
}
示例9: func_190732_dj
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
protected ItemStack func_190732_dj()
{
return ItemStack.field_190927_a;
}
示例10: clear
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void clear()
{
this.payment = ItemStack.field_190927_a;
}
示例11: matches
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack itemstack = ItemStack.field_190927_a;
ItemStack itemstack1 = ItemStack.field_190927_a;
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack2 = inv.getStackInSlot(i);
if (!itemstack2.func_190926_b())
{
if (itemstack2.getItem() != Items.BANNER)
{
return false;
}
if (!itemstack.func_190926_b() && !itemstack1.func_190926_b())
{
return false;
}
EnumDyeColor enumdyecolor = ItemBanner.getBaseColor(itemstack2);
boolean flag = TileEntityBanner.getPatterns(itemstack2) > 0;
if (!itemstack.func_190926_b())
{
if (flag)
{
return false;
}
if (enumdyecolor != ItemBanner.getBaseColor(itemstack))
{
return false;
}
itemstack1 = itemstack2;
}
else if (!itemstack1.func_190926_b())
{
if (!flag)
{
return false;
}
if (enumdyecolor != ItemBanner.getBaseColor(itemstack1))
{
return false;
}
itemstack = itemstack2;
}
else if (flag)
{
itemstack = itemstack2;
}
else
{
itemstack1 = itemstack2;
}
}
}
return !itemstack.func_190926_b() && !itemstack1.func_190926_b();
}
示例12: transferStackInSlot
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
* Take a stack from the specified inventory slot.
*/
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack itemstack = ItemStack.field_190927_a;
Slot slot = (Slot)this.inventorySlots.get(index);
if (slot != null && slot.getHasStack())
{
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (index < 9)
{
if (!this.mergeItemStack(itemstack1, 9, 45, true))
{
return ItemStack.field_190927_a;
}
}
else if (!this.mergeItemStack(itemstack1, 0, 9, false))
{
return ItemStack.field_190927_a;
}
if (itemstack1.func_190926_b())
{
slot.putStack(ItemStack.field_190927_a);
}
else
{
slot.onSlotChanged();
}
if (itemstack1.func_190916_E() == itemstack.func_190916_E())
{
return ItemStack.field_190927_a;
}
slot.func_190901_a(playerIn, itemstack1);
}
return itemstack;
}
示例13: getStackInSlot
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
* Returns the stack in the given slot.
*/
public ItemStack getStackInSlot(int index)
{
return index >= 0 && index < this.brewingItemStacks.size() ? (ItemStack)this.brewingItemStacks.get(index) : ItemStack.field_190927_a;
}
示例14: matches
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack itemstack = ItemStack.field_190927_a;
ItemStack itemstack1 = ItemStack.field_190927_a;
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack2 = inv.getStackInSlot(i);
if (!itemstack2.func_190926_b())
{
if (itemstack2.getItem() == Items.BANNER)
{
if (!itemstack1.func_190926_b())
{
return false;
}
itemstack1 = itemstack2;
}
else
{
if (itemstack2.getItem() != Items.SHIELD)
{
return false;
}
if (!itemstack.func_190926_b())
{
return false;
}
if (itemstack2.getSubCompound("BlockEntityTag") != null)
{
return false;
}
itemstack = itemstack2;
}
}
}
if (!itemstack.func_190926_b() && !itemstack1.func_190926_b())
{
return true;
}
else
{
return false;
}
}
示例15: getItem
import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
Item item = this.getSeedItem();
return item == null ? ItemStack.field_190927_a : new ItemStack(item);
}