本文整理汇总了Java中net.minecraft.util.EnumFacing.equals方法的典型用法代码示例。如果您正苦于以下问题:Java EnumFacing.equals方法的具体用法?Java EnumFacing.equals怎么用?Java EnumFacing.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.EnumFacing
的用法示例。
在下文中一共展示了EnumFacing.equals方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemUse
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos,
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!worldIn.isRemote) {
if(!facing.equals(EnumFacing.UP)){
playerIn.addChatComponentMessage(new TextComponentTranslation("chat.tripod.mustup"));
return EnumActionResult.PASS;
}
Entity entity = new EntityTripod(worldIn);
entity.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
entity.rotationYaw = playerIn.rotationYaw;
entity.rotationPitch = playerIn.rotationPitch;
worldIn.spawnEntityInWorld(entity);
// worldIn.updateEntities();
stack.stackSize--;
return EnumActionResult.SUCCESS;
}
return EnumActionResult.PASS;
}
示例2: canConnectRedstone
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
if (world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof MobDetectorTile) {
MobDetectorTile tile = (MobDetectorTile) world.getTileEntity(pos);
return side == null || side.equals(tile.getFacing().getOpposite());
}
return true;
}
示例3: getWeakPower
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
if (blockAccess.getTileEntity(pos) != null && blockAccess.getTileEntity(pos) instanceof MobDetectorTile) {
MobDetectorTile tile = (MobDetectorTile) blockAccess.getTileEntity(pos);
if (side.equals(tile.getFacing().getOpposite())) {
return tile.getRedstoneSignal();
}
}
return super.getStrongPower(blockState, blockAccess, pos, side);
}
示例4: getStrongPower
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
@Override
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
if (blockAccess.getTileEntity(pos) != null && blockAccess.getTileEntity(pos) instanceof MobDetectorTile) {
MobDetectorTile tile = (MobDetectorTile) blockAccess.getTileEntity(pos);
if (side.equals(tile.getFacing().getOpposite())) {
return tile.getRedstoneSignal();
}
}
return super.getStrongPower(blockState, blockAccess, pos, side);
}
示例5: hasCapability
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
if (facing == null || capability == null) {
return false;
}
if (facing.equals(EnumFacing.DOWN)) {
return false;
}
if (capability == CapabilityEnergy.ENERGY) {
return true;
}
return super.hasCapability(capability, facing);
}
示例6: canPlaceAt
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing)
{
BlockPos blockpos = pos.offset(facing.getOpposite());
boolean flag = facing.getAxis().isHorizontal();
return flag && worldIn.isBlockNormalCube(blockpos, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos);
}
示例7: canPlaceAt
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing) {
BlockPos blockpos = pos.offset(facing.getOpposite());
boolean flag = facing.getAxis().isHorizontal();
return flag && worldIn.isBlockNormalCube(blockpos, true)
|| facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos);
}
示例8: canPlaceAt
import net.minecraft.util.EnumFacing; //导入方法依赖的package包/类
private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing)
{
BlockPos blockpos = pos.offset(facing.getOpposite());
boolean flag = facing.getAxis().isHorizontal();
return flag && worldIn.isSideSolid(blockpos, facing, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos);
}