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


Java IGrowable.func_149851_a方法代码示例

本文整理汇总了Java中net.minecraft.block.IGrowable.func_149851_a方法的典型用法代码示例。如果您正苦于以下问题:Java IGrowable.func_149851_a方法的具体用法?Java IGrowable.func_149851_a怎么用?Java IGrowable.func_149851_a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.IGrowable的用法示例。


在下文中一共展示了IGrowable.func_149851_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_149851_a方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。