当前位置: 首页>>代码示例>>Java>>正文


Java EnumFacing.equals方法代码示例

本文整理汇总了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;
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:21,代码来源:ItemTripod.java

示例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;
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:9,代码来源:MobDetectorBlock.java

示例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);
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:11,代码来源:MobDetectorBlock.java

示例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);
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:11,代码来源:MobDetectorBlock.java

示例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);
}
 
开发者ID:cjburkey01,项目名称:MiningWells,代码行数:13,代码来源:TileEntityMiningWell.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:BlockTorch.java

示例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);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:7,代码来源:BlockTorch.java

示例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);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:7,代码来源:BlockTorch.java


注:本文中的net.minecraft.util.EnumFacing.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。