本文整理匯總了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);
}