本文整理汇总了Java中net.minecraft.init.Items.LINGERING_POTION属性的典型用法代码示例。如果您正苦于以下问题:Java Items.LINGERING_POTION属性的具体用法?Java Items.LINGERING_POTION怎么用?Java Items.LINGERING_POTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Items
的用法示例。
在下文中一共展示了Items.LINGERING_POTION属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPotion
public ItemStack getPotion()
{
ItemStack itemstack = (ItemStack)this.getDataManager().get(ITEM);
if (itemstack.getItem() != Items.SPLASH_POTION && itemstack.getItem() != Items.LINGERING_POTION)
{
if (this.world != null)
{
LOGGER.error("ThrownPotion entity {} has no item?!", new Object[] {Integer.valueOf(this.getEntityId())});
}
return new ItemStack(Items.SPLASH_POTION);
}
else
{
return itemstack;
}
}
示例2: getCraftingResult
/**
* Returns an Item that is the result of this recipe
*/
public ItemStack getCraftingResult(InventoryCrafting inv)
{
ItemStack itemstack = inv.getStackInRowAndColumn(1, 1);
if (itemstack.getItem() != Items.LINGERING_POTION)
{
return ItemStack.field_190927_a;
}
else
{
ItemStack itemstack1 = new ItemStack(Items.TIPPED_ARROW, 8);
PotionUtils.addPotionToItemStack(itemstack1, PotionUtils.getPotionFromItem(itemstack));
PotionUtils.appendEffects(itemstack1, PotionUtils.getFullEffectsFromItem(itemstack));
return itemstack1;
}
}
示例3: canCombineItems
private boolean canCombineItems(ItemStack stackA, ItemStack stackB)
{
if (ItemStack.areItemsEqual(stackA, stackB)) return true;
if (stackA.getItem() == Items.POTIONITEM && stackB.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackB.getMetadata() == 0) return true;
if (stackA.getItem() == Items.SPLASH_POTION && stackB.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackB.getMetadata() == 1) return true;
if (stackA.getItem() == Items.LINGERING_POTION && stackB.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackB.getMetadata() == 2) return true;
if (stackB.getItem() == Items.POTIONITEM && stackA.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackA.getMetadata() == 0) return true;
if (stackB.getItem() == Items.SPLASH_POTION && stackA.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackA.getMetadata() == 1) return true;
if (stackB.getItem() == Items.LINGERING_POTION && stackA.getItem() == Item.getByNameOrId("potioncore:custom_potion") && stackA.getMetadata() == 2) return true;
if (stackA.getItem() == Items.TIPPED_ARROW && stackB.getItem() == Item.getByNameOrId("potioncore:custom_arrow")) return true;
if (stackB.getItem() == Items.TIPPED_ARROW && stackA.getItem() == Item.getByNameOrId("potioncore:custom_arrow")) return true;
return false;
}
示例4: getOutputStack
private ItemStack getOutputStack(ItemStack inputStack)
{
Item item = inputStack.getItem();
if (item == Items.POTIONITEM || (item == Item.getByNameOrId("potioncore:custom_potion") && inputStack.getMetadata() == 0))
{
return new ItemStack(Items.POTIONITEM, 1, 0);
}
else if (item == Items.SPLASH_POTION || (item == Item.getByNameOrId("potioncore:custom_potion") && inputStack.getMetadata() == 1))
{
return new ItemStack(Items.SPLASH_POTION, 1, 0);
}
else if (item == Items.LINGERING_POTION || (item == Item.getByNameOrId("potioncore:custom_potion") && inputStack.getMetadata() == 2))
{
return new ItemStack(Items.LINGERING_POTION, 1, 0);
}
else if (item == Items.TIPPED_ARROW || item == Item.getByNameOrId("potioncore:custom_arrow"))
{
return new ItemStack(Items.TIPPED_ARROW, 1, 0);
}
else return ItemStack.EMPTY;
}
示例5: getPotion
public ItemStack getPotion()
{
ItemStack itemstack = (ItemStack)((Optional)this.getDataManager().get(ITEM)).orNull();
if (itemstack == null || itemstack.getItem() != Items.SPLASH_POTION && itemstack.getItem() != Items.LINGERING_POTION)
{
if (this.worldObj != null)
{
LOGGER.error("ThrownPotion entity {} has no item?!", new Object[] {Integer.valueOf(this.getEntityId())});
}
return new ItemStack(Items.SPLASH_POTION);
}
else
{
return itemstack;
}
}
示例6: getCraftingResult
/**
* Returns an Item that is the result of this recipe
*/
@Nullable
public ItemStack getCraftingResult(InventoryCrafting inv)
{
ItemStack itemstack = inv.getStackInRowAndColumn(1, 1);
if (itemstack != null && itemstack.getItem() == Items.LINGERING_POTION)
{
ItemStack itemstack1 = new ItemStack(Items.TIPPED_ARROW, 8);
PotionUtils.addPotionToItemStack(itemstack1, PotionUtils.getPotionFromItem(itemstack));
PotionUtils.appendEffects(itemstack1, PotionUtils.getFullEffectsFromItem(itemstack));
return itemstack1;
}
else
{
return null;
}
}
示例7: matches
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting inv, World worldIn)
{
if (inv.getWidth() == 3 && inv.getHeight() == 3)
{
for (int i = 0; i < inv.getWidth(); ++i)
{
for (int j = 0; j < inv.getHeight(); ++j)
{
ItemStack itemstack = inv.getStackInRowAndColumn(i, j);
if (itemstack.func_190926_b())
{
return false;
}
Item item = itemstack.getItem();
if (i == 1 && j == 1)
{
if (item != Items.LINGERING_POTION)
{
return false;
}
}
else if (item != Items.ARROW)
{
return false;
}
}
}
return true;
}
else
{
return false;
}
}
示例8: isItemValidForSlot
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For
* guis use Slot.isItemValid
*/
public boolean isItemValidForSlot(int index, ItemStack stack)
{
if (index == 3)
{
return PotionHelper.isReagent(stack);
}
else
{
Item item = stack.getItem();
return index == 4 ? item == Items.BLAZE_POWDER : (item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE) && this.getStackInSlot(index) == ItemStack.field_190927_a;
}
}
示例9: matches
@Override
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack tempStack = ItemStack.EMPTY;
int potionEffects = 0;
for (int i = 0; i < inv.getSizeInventory(); i++)
{
ItemStack stack = inv.getStackInSlot(i);
if (!stack.isEmpty())
{
Item item = stack.getItem();
if (item != Items.TIPPED_ARROW && item != Items.POTIONITEM && item != Items.SPLASH_POTION && item != Items.LINGERING_POTION) return false;
if (tempStack.isEmpty())
{
tempStack = stack.copy();
}
else
{
if (!ItemStack.areItemsEqual(tempStack, stack)) return false;
}
if (ModConfiguration.maxPotionEffects >= 0)
{
potionEffects += PotionUtils.getEffectsFromStack(stack).size();
if (potionEffects > ModConfiguration.maxPotionEffects) return false;
}
}
}
return true;
}
示例10: isInput
/**
* Code adapted from TileEntityBrewingStand.isItemValidForSlot(int index, ItemStack stack)
*/
@Override
public boolean isInput(ItemStack stack)
{
Item item = stack.getItem();
return item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
}
示例11: matches
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting inv, World worldIn)
{
if (inv.getWidth() == 3 && inv.getHeight() == 3)
{
for (int i = 0; i < inv.getWidth(); ++i)
{
for (int j = 0; j < inv.getHeight(); ++j)
{
ItemStack itemstack = inv.getStackInRowAndColumn(i, j);
if (itemstack == null)
{
return false;
}
Item item = itemstack.getItem();
if (i == 1 && j == 1)
{
if (item != Items.LINGERING_POTION)
{
return false;
}
}
else if (item != Items.ARROW)
{
return false;
}
}
}
return true;
}
else
{
return false;
}
}
示例12: isLingering
private boolean isLingering()
{
return this.getPotion().getItem() == Items.LINGERING_POTION;
}
示例13: canHoldPotion
public static boolean canHoldPotion(ItemStack stack)
{
Item item = stack.getItem();
return item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
}
示例14: getModelTextures
private String[] getModelTextures()
{
if (this.type == 1 && this.items.length == 1)
{
Item item = Item.getItemById(this.items[0]);
boolean flag = item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION;
if (flag && this.damage != null && this.damage.getCountRanges() > 0)
{
RangeInt rangeint = this.damage.getRange(0);
int i = rangeint.getMin();
boolean flag1 = (i & 16384) != 0;
String s5 = this.getMapTexture(this.mapTextures, "texture.potion_overlay", "items/potion_overlay");
String s6 = null;
if (flag1)
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_splash", "items/potion_bottle_splash");
}
else
{
s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_drinkable", "items/potion_bottle_drinkable");
}
return new String[] {s5, s6};
}
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER)
{
String s = "leather";
String s1 = "helmet";
if (itemarmor.armorType == EntityEquipmentSlot.HEAD)
{
s1 = "helmet";
}
if (itemarmor.armorType == EntityEquipmentSlot.CHEST)
{
s1 = "chestplate";
}
if (itemarmor.armorType == EntityEquipmentSlot.LEGS)
{
s1 = "leggings";
}
if (itemarmor.armorType == EntityEquipmentSlot.FEET)
{
s1 = "boots";
}
String s2 = s + "_" + s1;
String s3 = this.getMapTexture(this.mapTextures, "texture." + s2, "items/" + s2);
String s4 = this.getMapTexture(this.mapTextures, "texture." + s2 + "_overlay", "items/" + s2 + "_overlay");
return new String[] {s3, s4};
}
}
}
return new String[] {this.texture};
}