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


Java Direction.facingToDirection方法代码示例

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


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

示例1: onItemUse

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
 * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
 */
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
    if (p_77648_7_ == 0)
    {
        return false;
    }
    else if (p_77648_7_ == 1)
    {
        return false;
    }
    else
    {
        int i1 = Direction.facingToDirection[p_77648_7_];
        EntityHanging entityhanging = this.createHangingEntity(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, i1);

        if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_))
        {
            return false;
        }
        else
        {
            if (entityhanging != null && entityhanging.onValidSurface())
            {
                if (!p_77648_3_.isRemote)
                {
                    p_77648_3_.spawnEntityInWorld(entityhanging);
                }

                --p_77648_1_.stackSize;
            }

            return true;
        }
    }
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:40,代码来源:ItemEpicProportionsPainting.java

示例2: onItemUse

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
 * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
 */
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
    if (par7 == 0)
    {
        return false;
    }
    else if (par7 == 1)
    {
        return false;
    }
    else
    {
        int var11 = Direction.facingToDirection[par7];
        EntityHanging var12 = this.createHangingEntity(par3World, par4, par5, par6, var11);

        if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
        {
            return false;
        }
        else
        {
            if (var12 != null && var12.onValidSurface())
            {
                if (!par3World.isClient)
                {
                    par3World.spawnEntityInWorld(var12);
                }

                --par1ItemStack.stackSize;
            }

            return true;
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:40,代码来源:ItemHangingEntity.java

示例3: onBlockPlaced

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
{
    if (p_149660_5_ == 1 || p_149660_5_ == 0)
    {
        p_149660_5_ = 2;
    }

    return Direction.rotateOpposite[Direction.facingToDirection[p_149660_5_]];
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:BlockCocoa.java

示例4: onItemUse

import net.minecraft.util.Direction; //导入方法依赖的package包/类
public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
{
    if (p_77648_7_ == 0)
    {
        return false;
    }
    else if (p_77648_7_ == 1)
    {
        return false;
    }
    else
    {
        int i1 = Direction.facingToDirection[p_77648_7_];
        EntityHanging entityhanging = this.createHangingEntity(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, i1);

        if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_))
        {
            return false;
        }
        else
        {
            if (entityhanging != null && entityhanging.onValidSurface())
            {
                if (!p_77648_3_.isRemote)
                {
                    p_77648_3_.spawnEntityInWorld(entityhanging);
                }

                --p_77648_1_.stackSize;
            }

            return true;
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:36,代码来源:ItemHangingEntity.java

示例5: onItemUse

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
 * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
 */
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
    if (par7 == 0)
    {
        return false;
    }
    else if (par7 == 1)
    {
        return false;
    }
    else
    {
        int i1 = Direction.facingToDirection[par7];
        EntityHanging entityhanging = this.createHangingEntity(par3World, par4, par5, par6, i1);

        if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
        {
            return false;
        }
        else
        {
            if (entityhanging != null && entityhanging.onValidSurface())
            {
                if (!par3World.isRemote)
                {
                    par3World.spawnEntityInWorld(entityhanging);
                }

                --par1ItemStack.stackSize;
            }

            return true;
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:40,代码来源:ItemHangingEntity.java

示例6: onBlockPlaced

import net.minecraft.util.Direction; //导入方法依赖的package包/类
/**
 * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
 */
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
{
    if (par5 == 1 || par5 == 0)
    {
        par5 = 2;
    }

    return Direction.rotateOpposite[Direction.facingToDirection[par5]];
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:13,代码来源:BlockCocoa.java


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