當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。