當前位置: 首頁>>代碼示例>>Java>>正文


Java ItemPotion.isSplash方法代碼示例

本文整理匯總了Java中net.minecraft.item.ItemPotion.isSplash方法的典型用法代碼示例。如果您正苦於以下問題:Java ItemPotion.isSplash方法的具體用法?Java ItemPotion.isSplash怎麽用?Java ItemPotion.isSplash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.item.ItemPotion的用法示例。


在下文中一共展示了ItemPotion.isSplash方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPotionFromInventory

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private int getPotionFromInventory() {
    int pot = -1;
    int counter = 0;
    int i = 1;
    while (i < 45) {
        ItemStack is;
        ItemPotion potion;
        Item item;
        if (this.mc.thePlayer.inventoryContainer.getSlot(i).getHasStack() && (item = (is = this.mc.thePlayer.inventoryContainer.getSlot(i).getStack()).getItem()) instanceof ItemPotion && (potion = (ItemPotion)item).getEffects(is) != null) {
            for (Object o : potion.getEffects(is)) {
                PotionEffect effect = (PotionEffect)o;
                if (effect.getPotionID() != Potion.heal.id || !ItemPotion.isSplash((int)is.getItemDamage())) continue;
                ++counter;
                pot = i;
            }
        }
        ++i;
    }
    Character colorFormatCharacter = new Character('\u00a7');
    this.suffix = OptionManager.getOption((String)"Hyphen", (Module)ModuleManager.getModule(HUD.class)).value ? colorFormatCharacter + "7 - " + counter : colorFormatCharacter + "7 " + counter;
    return pot;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:23,代碼來源:AutoPot.java

示例2: getCraftingResult

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
/**
 * Returns an Item that is the result of this recipe
 */
public ItemStack getCraftingResult( InventoryCrafting inv )
{
	ItemStack item = doCheck( inv );
	if ( item == null )
	{
		return null;
	}
	
	int id = ItemPotion.isSplash( item.getItemDamage() ) ? CondensedPotions.condensedSplashItem.itemID : CondensedPotions.condensedNormalItem.itemID;
	ItemStack pot = new ItemStack( id, 1, 1 );
	
	NBTTagCompound potTag = new NBTTagCompound();
	item.writeToNBT( potTag );
	
	NBTTagCompound comp = new NBTTagCompound();
	comp.setTag( "Potion", potTag );
	pot.setTagCompound( comp );
	
	return pot;
}
 
開發者ID:spacechase0,項目名稱:OldMods,代碼行數:24,代碼來源:CondensedPotionRecipes.java

示例3: canBrew

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private boolean canBrew() {
	if (fuel > 0 && inventory[3] != null && inventory[3].stackSize > 0) {
		ItemStack itemstack = inventory[3];

		if (!itemstack.getItem().isPotionIngredient(itemstack))
			return false;
		else if (itemstack.getItem() == ModItems.dragon_breath) {
			for (int i = 0; i < 3; i++)
				if (inventory[i] != null && inventory[i].getItem() == Items.potionitem)
					if (ItemPotion.isSplash(inventory[i].getItemDamage()))
						return true;
			return false;
		} else {
			boolean flag = false;

			for (int i = 0; i < 3; i++)
				if (inventory[i] != null && inventory[i].getItem() instanceof ItemPotion) {
					int j = inventory[i].getItemDamage();
					int k = applyIngredient(j, itemstack);

					if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k)) {
						flag = true;
						break;
					}

					List<?> list = Items.potionitem.getEffects(j);
					List<?> list1 = Items.potionitem.getEffects(k);

					if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) && j != k) {
						flag = true;
						break;
					}
				}

			return flag;
		}
	} else
		return false;
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:40,代碼來源:TileEntityNewBrewingStand.java

示例4: brewPotions

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private void brewPotions() {
	if (ForgeEventFactory.onPotionAttemptBreaw(new ItemStack[] { inventory[0], inventory[1], inventory[2], inventory[3] }))
		return;
	if (canBrew()) {
		for (int i = 0; i < 3; i++)
			if (inventory[i] != null && inventory[i].getItem() instanceof ItemPotion) {
				int j = inventory[i].getItemDamage();
				if (ItemPotion.isSplash(j) && inventory[3].getItem() == ModItems.dragon_breath)
					inventory[i] = new ItemStack(ModItems.lingering_potion, inventory[i].stackSize, inventory[i].getItemDamage());
				else {
					int k = applyIngredient(j, inventory[3]);
					List<?> list = Items.potionitem.getEffects(j);
					List<?> list1 = Items.potionitem.getEffects(k);

					if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null)) {
						if (j != k)
							inventory[i].setItemDamage(k);
					} else if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
						inventory[i].setItemDamage(k);
				}
			}

		boolean hasContainerItem = inventory[3].getItem().hasContainerItem(inventory[3]);
		if (--inventory[3].stackSize <= 0)
			inventory[3] = hasContainerItem ? inventory[3].getItem().getContainerItem(inventory[3]) : null;
		else if (hasContainerItem && !worldObj.isRemote) {
			float f = 0.7F;
			double x = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
			double y = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
			double z = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
			EntityItem entityitem = new EntityItem(worldObj, xCoord + x, yCoord + y, zCoord + z, inventory[3].getItem().getContainerItem(inventory[3]));
			entityitem.delayBeforeCanPickup = 10;
			worldObj.spawnEntityInWorld(entityitem);
		}

		fuel--;
		ForgeEventFactory.onPotionBrewed(new ItemStack[] { inventory[0], inventory[1], inventory[2], inventory[3] });
		worldObj.playSound(xCoord, yCoord, zCoord, Reference.MOD_ID + ":block.brewing_stand.brew", 1.0F, 1.0F, true);
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:41,代碼來源:TileEntityNewBrewingStand.java

示例5: canBrew

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private boolean canBrew()
{
    if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0)
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        if (!itemstack.getItem().isPotionIngredient(itemstack))
        {
            return false;
        }
        else
        {
            boolean flag = false;

            for (int i = 0; i < 3; ++i)
            {
                if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem)
                {
                    int j = this.brewingItemStacks[i].getMetadata();
                    int k = this.getPotionResult(j, itemstack);

                    if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
                    {
                        flag = true;
                        break;
                    }

                    List<PotionEffect> list = Items.potionitem.getEffects(j);
                    List<PotionEffect> list1 = Items.potionitem.getEffects(k);

                    if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) && j != k)
                    {
                        flag = true;
                        break;
                    }
                }
            }

            return flag;
        }
    }
    else
    {
        return false;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:47,代碼來源:TileEntityBrewingStand.java

示例6: brewPotions

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private void brewPotions()
{
    if (this.canBrew())
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        for (int i = 0; i < 3; ++i)
        {
            if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem)
            {
                int j = this.brewingItemStacks[i].getMetadata();
                int k = this.getPotionResult(j, itemstack);
                List<PotionEffect> list = Items.potionitem.getEffects(j);
                List<PotionEffect> list1 = Items.potionitem.getEffects(k);

                if (j > 0 && list == list1 || list != null && (list.equals(list1) || list1 == null))
                {
                    if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
                    {
                        this.brewingItemStacks[i].setItemDamage(k);
                    }
                }
                else if (j != k)
                {
                    this.brewingItemStacks[i].setItemDamage(k);
                }
            }
        }

        if (itemstack.getItem().hasContainerItem())
        {
            this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem());
        }
        else
        {
            --this.brewingItemStacks[3].stackSize;

            if (this.brewingItemStacks[3].stackSize <= 0)
            {
                this.brewingItemStacks[3] = null;
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:45,代碼來源:TileEntityBrewingStand.java

示例7: func_145934_k

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private boolean func_145934_k()
{
    if (this.field_145945_j[3] != null && this.field_145945_j[3].stackSize > 0)
    {
        ItemStack var1 = this.field_145945_j[3];

        if (!var1.getItem().isPotionIngredient(var1))
        {
            return false;
        }
        else
        {
            boolean var2 = false;

            for (int var3 = 0; var3 < 3; ++var3)
            {
                if (this.field_145945_j[var3] != null && this.field_145945_j[var3].getItem() == Items.potionitem)
                {
                    int var4 = this.field_145945_j[var3].getItemDamage();
                    int var5 = this.func_145936_c(var4, var1);

                    if (!ItemPotion.isSplash(var4) && ItemPotion.isSplash(var5))
                    {
                        var2 = true;
                        break;
                    }

                    List var6 = Items.potionitem.getEffects(var4);
                    List var7 = Items.potionitem.getEffects(var5);

                    if ((var4 <= 0 || var6 != var7) && (var6 == null || !var6.equals(var7) && var7 != null) && var4 != var5)
                    {
                        var2 = true;
                        break;
                    }
                }
            }

            return var2;
        }
    }
    else
    {
        return false;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:47,代碼來源:TileEntityBrewingStand.java

示例8: func_145940_l

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private void func_145940_l()
{
    if (this.func_145934_k())
    {
        ItemStack var1 = this.field_145945_j[3];

        for (int var2 = 0; var2 < 3; ++var2)
        {
            if (this.field_145945_j[var2] != null && this.field_145945_j[var2].getItem() == Items.potionitem)
            {
                int var3 = this.field_145945_j[var2].getItemDamage();
                int var4 = this.func_145936_c(var3, var1);
                List var5 = Items.potionitem.getEffects(var3);
                List var6 = Items.potionitem.getEffects(var4);

                if ((var3 <= 0 || var5 != var6) && (var5 == null || !var5.equals(var6) && var6 != null))
                {
                    if (var3 != var4)
                    {
                        this.field_145945_j[var2].setItemDamage(var4);
                    }
                }
                else if (!ItemPotion.isSplash(var3) && ItemPotion.isSplash(var4))
                {
                    this.field_145945_j[var2].setItemDamage(var4);
                }
            }
        }

        if (var1.getItem().hasContainerItem())
        {
            this.field_145945_j[3] = new ItemStack(var1.getItem().getContainerItem());
        }
        else
        {
            --this.field_145945_j[3].stackSize;

            if (this.field_145945_j[3].stackSize <= 0)
            {
                this.field_145945_j[3] = null;
            }
        }
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:45,代碼來源:TileEntityBrewingStand.java

示例9: canBrew

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private boolean canBrew()
{
    if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0)
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        if (!itemstack.getItem().isPotionIngredient(itemstack))
        {
            return false;
        }
        else
        {
            boolean flag = false;

            for (int i = 0; i < 3; ++i)
            {
                if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion)
                {
                    int j = this.brewingItemStacks[i].getItemDamage();
                    int k = this.func_145936_c(j, itemstack);

                    if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
                    {
                        flag = true;
                        break;
                    }

                    List list = Items.potionitem.getEffects(j);
                    List list1 = Items.potionitem.getEffects(k);

                    if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) && j != k)
                    {
                        flag = true;
                        break;
                    }
                }
            }

            return flag;
        }
    }
    else
    {
        return false;
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:47,代碼來源:TileEntityBrewingStand.java

示例10: brewPotions

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private void brewPotions()
{
    if (this.canBrew())
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        // CraftBukkit start
        if (getOwner() != null)
        {
            BrewEvent event = new BrewEvent(worldObj.getWorld().getBlockAt(xCoord, yCoord, zCoord), (org.bukkit.inventory.BrewerInventory) this.getOwner().getInventory());
            org.bukkit.Bukkit.getPluginManager().callEvent(event);

            if (event.isCancelled())
            {
                return;
            }
        }

        // CraftBukkit end

        for (int i = 0; i < 3; ++i)
        {
            if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion)
            {
                int j = this.brewingItemStacks[i].getItemDamage();
                int k = this.func_145936_c(j, itemstack);
                List list = Items.potionitem.getEffects(j);
                List list1 = Items.potionitem.getEffects(k);

                if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null))
                {
                    if (j != k)
                    {
                        this.brewingItemStacks[i].setItemDamage(k);
                    }
                }
                else if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
                {
                    this.brewingItemStacks[i].setItemDamage(k);
                }
            }
        }

        if (itemstack.getItem().hasContainerItem(itemstack))
        {
            this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack);
        }
        else
        {
            --this.brewingItemStacks[3].stackSize;

            if (this.brewingItemStacks[3].stackSize <= 0)
            {
                this.brewingItemStacks[3] = null;
            }
        }
        MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(brewingItemStacks));
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:60,代碼來源:TileEntityBrewingStand.java

示例11: brewPotions

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private void brewPotions()
{
    if (this.canBrew())
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        for (int i = 0; i < 3; ++i)
        {
            if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion)
            {
                int j = this.brewingItemStacks[i].getItemDamage();
                int k = this.func_145936_c(j, itemstack);
                List list = Items.potionitem.getEffects(j);
                List list1 = Items.potionitem.getEffects(k);

                if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null))
                {
                    if (j != k)
                    {
                        this.brewingItemStacks[i].setItemDamage(k);
                    }
                }
                else if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
                {
                    this.brewingItemStacks[i].setItemDamage(k);
                }
            }
        }

        if (itemstack.getItem().hasContainerItem(itemstack))
        {
            this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack);
        }
        else
        {
            --this.brewingItemStacks[3].stackSize;

            if (this.brewingItemStacks[3].stackSize <= 0)
            {
                this.brewingItemStacks[3] = null;
            }
        }
        MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(brewingItemStacks));
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:46,代碼來源:TileEntityBrewingStand.java

示例12: dispense

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
/**
 * Dispenses the specified ItemStack from a dispenser.
 */
public ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
{
    return ItemPotion.isSplash(par2ItemStack.getItemDamage()) ? (new DispenserBehaviorPotionProjectile(this, par2ItemStack)).dispense(par1IBlockSource, par2ItemStack) : this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack);
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:8,代碼來源:DispenserBehaviorPotion.java

示例13: canBrew

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private boolean canBrew()
{
    if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0)
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        if (!Item.itemsList[itemstack.itemID].isPotionIngredient())
        {
            return false;
        }
        else
        {
            boolean flag = false;

            for (int i = 0; i < 3; ++i)
            {
                if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion)
                {
                    int j = this.brewingItemStacks[i].getItemDamage();
                    int k = this.getPotionResult(j, itemstack);

                    if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
                    {
                        flag = true;
                        break;
                    }

                    List list = Item.potion.getEffects(j);
                    List list1 = Item.potion.getEffects(k);

                    if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) && j != k)
                    {
                        flag = true;
                        break;
                    }
                }
            }

            return flag;
        }
    }
    else
    {
        return false;
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:47,代碼來源:TileEntityBrewingStand.java

示例14: brewPotions

import net.minecraft.item.ItemPotion; //導入方法依賴的package包/類
private void brewPotions()
{
    if (this.canBrew())
    {
        ItemStack itemstack = this.brewingItemStacks[3];

        for (int i = 0; i < 3; ++i)
        {
            if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion)
            {
                int j = this.brewingItemStacks[i].getItemDamage();
                int k = this.getPotionResult(j, itemstack);
                List list = Item.potion.getEffects(j);
                List list1 = Item.potion.getEffects(k);

                if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null))
                {
                    if (j != k)
                    {
                        this.brewingItemStacks[i].setItemDamage(k);
                    }
                }
                else if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k))
                {
                    this.brewingItemStacks[i].setItemDamage(k);
                }
            }
        }

        if (Item.itemsList[itemstack.itemID].hasContainerItem())
        {
            this.brewingItemStacks[3] = Item.itemsList[itemstack.itemID].getContainerItemStack(brewingItemStacks[3]);
        }
        else
        {
            --this.brewingItemStacks[3].stackSize;

            if (this.brewingItemStacks[3].stackSize <= 0)
            {
                this.brewingItemStacks[3] = null;
            }
        }
        
        MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(brewingItemStacks));
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:47,代碼來源:TileEntityBrewingStand.java


注:本文中的net.minecraft.item.ItemPotion.isSplash方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。