当前位置: 首页>>代码示例>>Java>>正文


Java Items.LINGERING_POTION属性代码示例

本文整理汇总了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;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:EntityPotion.java

示例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;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:RecipeTippedArrow.java

示例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;
}
 
开发者ID:crazysnailboy,项目名称:CombinedPotions,代码行数:17,代码来源:RecipeCombinedPotions2.java

示例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;
}
 
开发者ID:crazysnailboy,项目名称:CombinedPotions,代码行数:23,代码来源:RecipeCombinedPotions2.java

示例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;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:EntityPotion.java

示例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;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:RecipeTippedArrow.java

示例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;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:41,代码来源:RecipeTippedArrow.java

示例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;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:TileEntityBrewingStand.java

示例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;
}
 
开发者ID:crazysnailboy,项目名称:CombinedPotions,代码行数:34,代码来源:RecipeCombinedPotions.java

示例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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:VanillaBrewingRecipe.java

示例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;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:41,代码来源:RecipeTippedArrow.java

示例12: isLingering

private boolean isLingering()
{
    return this.getPotion().getItem() == Items.LINGERING_POTION;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:EntityPotion.java

示例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;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:ContainerBrewingStand.java

示例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};
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:66,代码来源:CustomItemProperties.java


注:本文中的net.minecraft.init.Items.LINGERING_POTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。