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


Java Blocks.NETHER_BRICK_FENCE属性代码示例

本文整理汇总了Java中net.minecraft.init.Blocks.NETHER_BRICK_FENCE属性的典型用法代码示例。如果您正苦于以下问题:Java Blocks.NETHER_BRICK_FENCE属性的具体用法?Java Blocks.NETHER_BRICK_FENCE怎么用?Java Blocks.NETHER_BRICK_FENCE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.init.Blocks的用法示例。


在下文中一共展示了Blocks.NETHER_BRICK_FENCE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canBeConnectedTo

@Override
public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing) {
	Block connector = world.getBlockState(pos.offset(facing)).getBlock();

	if (connector instanceof BlockFence) {
		if (this != Blocks.NETHER_BRICK_FENCE && connector == Blocks.NETHER_BRICK_FENCE) {
			return false;
		} else if (this == Blocks.NETHER_BRICK_FENCE && connector != Blocks.NETHER_BRICK_FENCE) {
			return false;
		}
		return true;
	}
	return false;
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:14,代码来源:BlockScornedBrickFence.java

示例2: safeImpact

@Override
public void safeImpact(BlockPos pos, @Nullable EnumFacing side, World world, int amplifier) {
	int box = 1 + (int) ((float) amplifier / 2F);

	BlockPos posI = pos.add(box, box, box);
	BlockPos posF = pos.add(-box, -box, -box);

	Iterable<BlockPos> spots = BlockPos.getAllInBox(posI, posF);
	for (BlockPos spot : spots) {
		Block block = world.getBlockState(spot).getBlock();
		IBlockState state = world.getBlockState(spot);
		boolean place = amplifier > 2 || world.rand.nextBoolean();
		if (place && stateMap.containsKey(block)) {
			world.setBlockState(spot, stateMap.get(block), 3);
		} else if (state.getBlock() == Blocks.LEAVES) {
			world.setBlockState(spot, ModBlocks.fake_ice.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.LEAVES2) {
			world.setBlockState(spot, ModBlocks.fake_ice.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.PLANKS) {
			world.setBlockState(spot, ModBlocks.fake_ice.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.STONE) {
			world.setBlockState(spot, ModBlocks.fake_ice.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.BRICK_BLOCK) {
			world.setBlockState(spot, ModBlocks.embittered_bricks.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.STONEBRICK) {
			world.setBlockState(spot, ModBlocks.embittered_bricks.getDefaultState(), 3);
		} else if (BlockStairs.isBlockStairs(state)) {
			IBlockState newState = ModBlocks.fake_ice_stairs.getDefaultState()
					.withProperty(BlockStairs.FACING, state.getValue(BlockStairs.FACING))
					.withProperty(BlockStairs.HALF, state.getValue(BlockStairs.HALF));
			world.setBlockState(spot, newState);
		} else if (state.getBlock() == Blocks.OAK_FENCE) {
			world.setBlockState(spot, ModBlocks.fake_ice_fence.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.ACACIA_FENCE) {
			world.setBlockState(spot, ModBlocks.fake_ice_fence.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.BIRCH_FENCE) {
			world.setBlockState(spot, ModBlocks.fake_ice_fence.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.DARK_OAK_FENCE) {
			world.setBlockState(spot, ModBlocks.fake_ice_fence.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.JUNGLE_FENCE) {
			world.setBlockState(spot, ModBlocks.fake_ice_fence.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.SPRUCE_FENCE) {
			world.setBlockState(spot, ModBlocks.fake_ice_fence.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.NETHER_BRICK_FENCE) {
			world.setBlockState(spot, ModBlocks.fake_ice_fence.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.SANDSTONE) {
			world.setBlockState(spot, ModBlocks.fake_ice.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.NETHER_BRICK) {
			world.setBlockState(spot, ModBlocks.embittered_bricks.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.RED_NETHER_BRICK) {
			world.setBlockState(spot, ModBlocks.embittered_bricks.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.END_BRICKS) {
			world.setBlockState(spot, ModBlocks.embittered_bricks.getDefaultState(), 3);
		} else if (state.getBlock() == ModBlocks.scorned_bricks) {
			world.setBlockState(spot, ModBlocks.embittered_bricks.getDefaultState(), 3);
		} else if (state.getBlock() == ModBlocks.nethersteel) {
			world.setBlockState(spot, Blocks.PACKED_ICE.getDefaultState(), 3);
		}
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:60,代码来源:IceWorldBrew.java


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