本文整理匯總了Java中net.minecraft.init.Items.glass_bottle方法的典型用法代碼示例。如果您正苦於以下問題:Java Items.glass_bottle方法的具體用法?Java Items.glass_bottle怎麽用?Java Items.glass_bottle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.init.Items
的用法示例。
在下文中一共展示了Items.glass_bottle方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onItemUseFinish
import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
* Called when the player finishes using this Item (E.g. finishes eating.). Not called when the player stops using
* the Item before the action is complete.
*/
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn)
{
if (!playerIn.capabilities.isCreativeMode)
{
--stack.stackSize;
}
if (!worldIn.isRemote)
{
List<PotionEffect> list = this.getEffects(stack);
if (list != null)
{
for (PotionEffect potioneffect : list)
{
playerIn.addPotionEffect(new PotionEffect(potioneffect));
}
}
}
playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
if (!playerIn.capabilities.isCreativeMode)
{
if (stack.stackSize <= 0)
{
return new ItemStack(Items.glass_bottle);
}
playerIn.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
}
return stack;
}
示例2: isItemValidForSlot
import net.minecraft.init.Items; //導入方法依賴的package包/類
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
if (slot == 4)
return stack.getItem() == Items.blaze_powder;
else if (slot == 3)
return stack.getItem().isPotionIngredient(stack);
else
return stack.getItem() instanceof ItemPotion || stack.getItem() == Items.glass_bottle;
}
示例3: canHoldPotion
import net.minecraft.init.Items; //導入方法依賴的package包/類
public static boolean canHoldPotion(ItemStack stack)
{
return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle);
}
示例4: isItemValidForSlot
import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
*/
public boolean isItemValidForSlot(int index, ItemStack stack)
{
return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle;
}
示例5: canHoldPotion
import net.minecraft.init.Items; //導入方法依賴的package包/類
public static boolean canHoldPotion(ItemStack stack) {
return stack != null && (stack.getItem() instanceof ItemPotion || stack.getItem() == Items.glass_bottle);
}