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