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


Java TileEntityFlowerPot.func_145964_a方法代码示例

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


在下文中一共展示了TileEntityFlowerPot.func_145964_a方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBlockHarvested

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
/**
 * Called when the block is attempted to be harvested
 */
public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
{
    super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);

    if (p_149681_6_.capabilities.isCreativeMode)
    {
        TileEntityFlowerPot var7 = this.func_149929_e(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_);

        if (var7 != null)
        {
            var7.func_145964_a(Item.getItemById(0), 0);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:18,代码来源:BlockFlowerPot.java

示例2: onBlockHarvested

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
{
    super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);

    if (p_149681_6_.capabilities.isCreativeMode)
    {
        TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_);

        if (tileentityflowerpot != null)
        {
            tileentityflowerpot.func_145964_a(Item.getItemById(0), 0);
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:15,代码来源:BlockFlowerPot.java

示例3: generatePotContents

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public static void generatePotContents(Random rand, TileEntityFlowerPot te) {
	int[] possibleContents = {6, 32, 37, 38, 39, 40, 81}; //{"minecraft:sapling", "minecraft:deadbush", "minecraft:yellow_flower", "minecraft:red_flower", "minecraft:brown_mushroom", "minecraft:red_mushroom", "minecraft:cactus"}
	int[][] possibleMeta = {{0, 1, 2, 3, 4, 5}, {0}, {0}, {0, 1, 2, 3, 4, 5, 6, 7, 8}, {0}, {0}, {0}};
	
	int contentIndex = rand.nextInt(possibleContents.length);
	int metaIndex = rand.nextInt(possibleMeta[contentIndex].length);
	
	te.func_145964_a(Item.getItemById(possibleContents[contentIndex]), possibleMeta[contentIndex][metaIndex]);
}
 
开发者ID:Draco18s,项目名称:Artifacts,代码行数:10,代码来源:StructureGenHelper.java

示例4: onBlockActivated

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
/**
 * Called upon block activation (right click on the block.)
 */
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
    ItemStack var10 = p_149727_5_.inventory.getCurrentItem();

    if (var10 != null && var10.getItem() instanceof ItemBlock)
    {
        if (p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_) != 0)
        {
            return false;
        }
        else
        {
            TileEntityFlowerPot var11 = this.func_149929_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);

            if (var11 != null)
            {
                Block var12 = Block.getBlockFromItem(var10.getItem());

                if (!this.func_149928_a(var12, var10.getItemDamage()))
                {
                    return false;
                }
                else
                {
                    var11.func_145964_a(var10.getItem(), var10.getItemDamage());
                    var11.onInventoryChanged();

                    if (!p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, var10.getItemDamage(), 2))
                    {
                        p_149727_1_.func_147471_g(p_149727_2_, p_149727_3_, p_149727_4_);
                    }

                    if (!p_149727_5_.capabilities.isCreativeMode && --var10.stackSize <= 0)
                    {
                        p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, (ItemStack)null);
                    }

                    return true;
                }
            }
            else
            {
                return false;
            }
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:55,代码来源:BlockFlowerPot.java

示例5: onBlockActivated

import net.minecraft.tileentity.TileEntityFlowerPot; //导入方法依赖的package包/类
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
{
    ItemStack itemstack = p_149727_5_.inventory.getCurrentItem();

    if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
    {
        TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);

        if (tileentityflowerpot != null)
        {
            if (tileentityflowerpot.getFlowerPotItem() != null)
            {
                return false;
            }
            else
            {
                Block block = Block.getBlockFromItem(itemstack.getItem());

                if (!this.func_149928_a(block, itemstack.getItemDamage()))
                {
                    return false;
                }
                else
                {
                    tileentityflowerpot.func_145964_a(itemstack.getItem(), itemstack.getItemDamage());
                    tileentityflowerpot.markDirty();

                    if (!p_149727_1_.setBlockMetadataWithNotify(p_149727_2_, p_149727_3_, p_149727_4_, itemstack.getItemDamage(), 2))
                    {
                        p_149727_1_.markBlockForUpdate(p_149727_2_, p_149727_3_, p_149727_4_);
                    }

                    if (!p_149727_5_.capabilities.isCreativeMode && --itemstack.stackSize <= 0)
                    {
                        p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, (ItemStack)null);
                    }

                    return true;
                }
            }
        }
        else
        {
            return false;
        }
    }
    else
    {
        return false;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:52,代码来源:BlockFlowerPot.java


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