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


Java IGrowable.func_149852_a方法代碼示例

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


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

示例1: func_150919_a

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
public static boolean func_150919_a(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_)
{
    Block var5 = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_);

    if (var5 instanceof IGrowable)
    {
        IGrowable var6 = (IGrowable)var5;

        if (var6.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isClient))
        {
            if (!p_150919_1_.isClient)
            {
                if (var6.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_))
                {
                    var6.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
                }

                --p_150919_0_.stackSize;
            }

            return true;
        }
    }

    return false;
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:27,代碼來源:ItemDye.java

示例2: useOnBlock

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
@Override
public boolean useOnBlock(World world, EntityPlayer player, IPlayerSession session, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int boost, int cost) {
    for (int j = -(1 + boost); j < (2 + boost); j++)
        for (int k = -(1 + boost); k < (2 + boost); k++) {
            if (session.hasEnoughMana(cost())) {
                Block blk = world.getBlock(x + j, y, z + k);
                if (blk != null && !world.isAirBlock(x + j, y, z + k)) {
                    BonemealEvent event = new BonemealEvent(player, world, blk, x + j, y, z + k);
                    if (MinecraftForge.EVENT_BUS.post(event))
                        return false;
                    if (blk instanceof IGrowable) {
                        IGrowable grow = (IGrowable) blk;
                        if (grow.func_149851_a(world, x + j, y, z + k, world.isRemote)) {
                            world.spawnParticle("happyVillager", x + j + 0.5, y + 0.5, z + k + 0.5, world.rand.nextDouble() + 2, world.rand.nextDouble() + 2, world.rand.nextDouble() + 2);
                            if (!world.isRemote) {
                                if (grow.func_149852_a(world, world.rand, x + j, y, z + k)) {
                                    session.adjustMana(-cost(), false);
                                    //blk.updateTick(world, x + j, y, z + k, world.rand);
                                    grow.func_149853_b(world, world.rand, x + j, y, z + k);
                                }
                            }
                        }
                    }
                }
            } else
                break;
        }
    return false;
}
 
開發者ID:Lomeli12,項目名稱:MagicalRings,代碼行數:30,代碼來源:Harvest.java

示例3: applyBonemeal

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
public static boolean applyBonemeal(ItemStack itemstack, World world, int x, int y, int z, EntityPlayer player) {
	Block block = world.getBlock(x, y, z);

	BonemealEvent event = new BonemealEvent(player, world, block, x, y, z);
	if (MinecraftForge.EVENT_BUS.post(event)) {
		return false;
	}

	if (event.getResult() == Result.ALLOW) {
		if (!world.isRemote) {
			itemstack.stackSize--;
		}
		return true;
	}

	if (block instanceof IGrowable) {
		IGrowable igrowable = (IGrowable) block;

		if (igrowable.func_149851_a(world, x, y, z, world.isRemote)) {
			if (!world.isRemote) {
				if (igrowable.func_149852_a(world, world.rand, x, y, z)) {
					igrowable.func_149853_b(world, world.rand, x, y, z);
				}

			}

			return true;
		}
	}

	return false;
}
 
開發者ID:mookie1097,項目名稱:NausicaaMod,代碼行數:33,代碼來源:VoluciteNecklace.java

示例4: applyBonemeal

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player) {
	Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_);

	if (block instanceof IGrowable) {
		IGrowable igrowable = (IGrowable) block;

		if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote)) {
			if (!p_150919_1_.isRemote) {
				if (igrowable.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_)) {

					if (StringUtils.isShiftKeyDown()) {
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_ - 1, p_150919_3_, p_150919_4_);

						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_ + 1, p_150919_3_, p_150919_4_);

						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_ - 1);

						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_ + 1);

					} else {
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
					}
				}

				// --p_150919_0_.stackSize;
			}

			return true;
		}
	}

	return false;
}
 
開發者ID:jaredlll08,項目名稱:Fluxed-Trinkets,代碼行數:39,代碼來源:EffectHelper.java

示例5: applyBonemeal

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player, boolean superStrength) {
	Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_);

	if (block instanceof IGrowable) {
		IGrowable igrowable = (IGrowable) block;

		if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote)) {
			if (!p_150919_1_.isRemote) {
				if (igrowable.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_)) {
					if (superStrength) {
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
					}else{
						igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
					}
					
				}
				

				// --p_150919_0_.stackSize;
			}

			return true;
		}
	}

	return false;
}
 
開發者ID:jaredlll08,項目名稱:Fluxed-Trinkets,代碼行數:32,代碼來源:EffectHelper.java

示例6: applyBonemeal

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
public static boolean applyBonemeal(World world, int x, int y, int z, EntityPlayer player)
{
	Block block = world.getBlock(x, y, z);

	BonemealEvent event = new BonemealEvent(player, world, block, x, y, z);
	if (MinecraftForge.EVENT_BUS.post(event))
	{
		return false;
	}

	if (event.getResult() == Result.ALLOW)
	{
		return true;
	}

	if (block instanceof IGrowable)
	{
		IGrowable igrowable = (IGrowable) block;

		if (igrowable.func_149851_a(world, x, y, z, world.isRemote))
		{
			if (!world.isRemote)
			{
				if (igrowable.func_149852_a(world, world.rand, x, y, z))
				{
					igrowable.func_149853_b(world, world.rand, x, y, z);
				}
			}

			return true;
		}
	}

	return false;
}
 
開發者ID:wuppy29,項目名稱:WuppyMods,代碼行數:36,代碼來源:EntityBonemealBottle.java

示例7: onItemUse

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int xPos, int yPos, int zPos, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
    Block block = world.getBlock(xPos, yPos, zPos);

    BonemealEvent event = new BonemealEvent(player, world, block, xPos, yPos, zPos);
    if (MinecraftForge.EVENT_BUS.post(event)) { return false; }

    if (event.getResult() == Result.ALLOW)
    {
        if (!world.isRemote)
        {
            stack.stackSize--;
        }
        return true;
    }

    if (block instanceof IGrowable)
    {
        IGrowable igrowable = (IGrowable) block;

        if (igrowable.func_149851_a(world, xPos, yPos, zPos, world.isRemote))
        {
            if (!world.isRemote)
            {
                if (igrowable.func_149852_a(world, world.rand, xPos, yPos, zPos))
                {
                    igrowable.func_149853_b(world, world.rand, xPos, yPos, zPos);
                }

                --stack.stackSize;
                world.playAuxSFX(2005, xPos, yPos, zPos, 0);
            }

            return true;
        }
    }

    return false;

}
 
開發者ID:TeamMetallurgy,項目名稱:Metallurgy4,代碼行數:42,代碼來源:ItemFeritilizer.java

示例8: applyBonemeal

import net.minecraft.block.IGrowable; //導入方法依賴的package包/類
public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player)
{
    Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_);

    BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_);
    if (MinecraftForge.EVENT_BUS.post(event))
    {
        return false;
    }

    if (event.getResult() == Result.ALLOW)
    {
        if (!p_150919_1_.isRemote)
        {
            p_150919_0_.stackSize--;
        }
        return true;
    }

    if (block instanceof IGrowable)
    {
        IGrowable igrowable = (IGrowable)block;

        if (igrowable.func_149851_a(p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, p_150919_1_.isRemote))
        {
            if (!p_150919_1_.isRemote)
            {
                if (igrowable.func_149852_a(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_))
                {
                    igrowable.func_149853_b(p_150919_1_, p_150919_1_.rand, p_150919_2_, p_150919_3_, p_150919_4_);
                }

                --p_150919_0_.stackSize;
            }

            return true;
        }
    }

    return false;
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:42,代碼來源:ItemDye.java


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