当前位置: 首页>>代码示例>>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;未经允许,请勿转载。