當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumFacing.getDirectionFromEntityLiving方法代碼示例

本文整理匯總了Java中net.minecraft.util.EnumFacing.getDirectionFromEntityLiving方法的典型用法代碼示例。如果您正苦於以下問題:Java EnumFacing.getDirectionFromEntityLiving方法的具體用法?Java EnumFacing.getDirectionFromEntityLiving怎麽用?Java EnumFacing.getDirectionFromEntityLiving使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.EnumFacing的用法示例。


在下文中一共展示了EnumFacing.getDirectionFromEntityLiving方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: placeBlockAt

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
{
    boolean flag = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);

    TileEntity te = world.getTileEntity(pos);
    if(te instanceof TileEntityGlassMaster)
    {
        ((TileEntityGlassMaster)te).placingFace = EnumFacing.getDirectionFromEntityLiving(pos, player);
    }

    return flag;
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:14,代碼來源:ItemGlass.java

示例2: onBlockPlacedBy

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
    if(!worldIn.isRemote)
    {
        TileEntity te = worldIn.getTileEntity(pos);
        if(te instanceof TileEntityGlassTerminal)
        {
            TileEntityGlassTerminal terminal = (TileEntityGlassTerminal)te;
            terminal.facing = EnumFacing.getDirectionFromEntityLiving(pos, placer);
            terminal.markDirty();
        }
    }
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:15,代碼來源:BlockGlassTerminal.java

示例3: getDirectionalFacingForPlacement

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
protected final EnumFacing getDirectionalFacingForPlacement(BlockPos pos, EnumFacing facing, int meta, EntityLivingBase placer)
{
    if (content.faceBySide.get(meta).orElse(false))
        return facing;
    else
        return EnumFacing.getDirectionFromEntityLiving(pos, placer);
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:8,代碼來源:BlockOrientable.java

示例4: getPlacementState

import net.minecraft.util.EnumFacing; //導入方法依賴的package包/類
@Override
public IBlockState getPlacementState(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
	EnumFacing facing = EnumFacing.getDirectionFromEntityLiving(pos, placer);
	/*EnumFacing facing = EnumFacing.UP;
	Vec2f rot = placer.getPitchYaw();
	
	if (rot.x > 45) {
		facing = EnumFacing.DOWN;
	} else if (rot.x > -45) {
		facing = placer.getAdjustedHorizontalFacing();
	}*/
	
	return state.withProperty(BlockDirectional.FACING, facing);
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:15,代碼來源:BlockStateBehavior.java


注:本文中的net.minecraft.util.EnumFacing.getDirectionFromEntityLiving方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。