本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}