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