當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。