if (!world.isBlockFullCube(blockpos.north()) && d2 < d3)
@Deprecated @Override public @Nonnull AxisAlignedBB getSelectedBoundingBox(@Nonnull IBlockState bs, @Nonnull World world, @Nonnull BlockPos pos) { if (bs.getBlock() == this) { BlockType bt = bs.getValue(BLOCK_TYPE); if (bt != BlockType.SINGLE) { BlockPos masterLoc = bt.getLocationOfMaster(pos); AxisAlignedBB res = new AxisAlignedBB(masterLoc.south().south().west(), masterLoc.north().east().east().up()); return res; } } return super.getSelectedBoundingBox(bs, world, pos); }
@Nonnull @Override public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos) { IBlockState origState = state; state = state.withProperty(BLOCK_UP, worldIn.getBlockState(pos.up()).equals(origState)); state = state.withProperty(BLOCK_DOWN, worldIn.getBlockState(pos.down()).equals(origState)); state = state.withProperty(BLOCK_NORTH, worldIn.getBlockState(pos.north()).equals(origState)); state = state.withProperty(BLOCK_SOUTH, worldIn.getBlockState(pos.south()).equals(origState)); state = state.withProperty(BLOCK_WEST, worldIn.getBlockState(pos.west()).equals(origState)); state = state.withProperty(BLOCK_EAST, worldIn.getBlockState(pos.east()).equals(origState)); return state; }
@Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { boolean flag = canConnectTo(worldIn, pos.north()); boolean flag1 = canConnectTo(worldIn, pos.east()); boolean flag2 = canConnectTo(worldIn, pos.south()); boolean flag3 = canConnectTo(worldIn, pos.west()); boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3; return state.withProperty(UP, Boolean.valueOf(!flag4 || !worldIn.isAirBlock(pos.up()))).withProperty(NORTH, Boolean.valueOf(flag)).withProperty(EAST, Boolean.valueOf(flag1)).withProperty(SOUTH, Boolean.valueOf(flag2)).withProperty(WEST, Boolean.valueOf(flag3)); }
@Override public @Nonnull IBlockState getActualState(@Nonnull IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos) { EnumFacing.Axis enumfacing$axis = state.getValue(FACING).getAxis(); if (enumfacing$axis == EnumFacing.Axis.Z && (worldIn.getBlockState(pos.west()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.east()).getBlock() instanceof BlockWall) || enumfacing$axis == EnumFacing.Axis.X && (worldIn.getBlockState(pos.north()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.south()).getBlock() instanceof BlockWall)) { state = state.withProperty(IN_WALL, true); } return state; }
@Override public List<BlockPos> getPositionsToHarvest(World world, BlockPos pos, IBlockState state) { List<BlockPos> ret = new ArrayList<>(); addPositionIfGourd(ret, world, pos.north()); addPositionIfGourd(ret, world, pos.west()); addPositionIfGourd(ret, world, pos.south()); addPositionIfGourd(ret, world, pos.east()); return ret; }
public void generateArchEW(World world, Random rand, BlockPos position) { int height = 3 + rand.nextInt(1); int width = 1 + rand.nextInt(2); for (int sides = 0; sides < height; sides++) { world.setBlockState(position.up(sides).north(width / 2), ModBlocks.frozenCobblestone.getDefaultState(), 3); world.setBlockState(position.up(sides).south(width / 2), ModBlocks.frozenCobblestone.getDefaultState(), 3); } for (int way = 0; way < width; way++) { world.setBlockState(position.up(height).south(way), ModBlocks.frozenCobblestone.getDefaultState(), 3); } } }
protected void breakAroundOnLevel(World world, BlockPos origin, BlockPos center, float maxHardness) { affectBlock(world, origin, center, maxHardness); affectBlock(world, origin, center.north(), maxHardness); affectBlock(world, origin, center.east(), maxHardness); affectBlock(world, origin, center.west(), maxHardness); affectBlock(world, origin, center.south(), maxHardness); affectBlock(world, origin, center.north().east(), maxHardness); affectBlock(world, origin, center.east().south(), maxHardness); affectBlock(world, origin, center.south().west(), maxHardness); affectBlock(world, origin, center.west().north(), maxHardness); }
public void generateArchEW(World world, Random rand, BlockPos position) { int height = 3 + rand.nextInt(1); int width = 1 + rand.nextInt(2); for (int sides = 0; sides < height; sides++) { world.setBlockState(position.up(sides).north(width / 2), ModBlocks.charedCobblestone.getDefaultState(), 3); world.setBlockState(position.up(sides).south(width / 2), ModBlocks.charedCobblestone.getDefaultState(), 3); } for (int way = 0; way < width; way++) { world.setBlockState(position.up(height).south(way), ModBlocks.charedCobblestone.getDefaultState(), 3); } } }
@Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { VariedChests.ChestType myType = getCustomType(source, pos); return getCustomType(source, pos.north()) == myType ? NORTH_CHEST_AABB : getCustomType(source, pos.south()) == myType ? SOUTH_CHEST_AABB : getCustomType(source, pos.west()) == myType ? WEST_CHEST_AABB : getCustomType(source, pos.east()) == myType ? EAST_CHEST_AABB : NOT_CONNECTED_AABB; }
@Override @ParametersAreNonnullByDefault public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { return (isBaseValid(worldIn.getTileEntity(pos.north())) || isBaseValid(worldIn.getTileEntity(pos.east())) || isBaseValid(worldIn.getTileEntity(pos.south())) || isBaseValid(worldIn.getTileEntity(pos.west()))); }
@Override public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos) { int smasherCount = 0; smasherCount += world.getBlockState(pos.east()).getBlock() == ROCK_SMASHER ? 1 : 0; smasherCount += world.getBlockState(pos.west()) == ROCK_SMASHER ? 1 : 0; smasherCount += world.getBlockState(pos.north()) == ROCK_SMASHER ? 1 : 0; smasherCount += world.getBlockState(pos.south()) == ROCK_SMASHER ? 1 : 0; if (smasherCount < 2) { world.setBlockToAir(pos); } }
@Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { if (source.getBlockState(pos.north()).getBlock() == this) { return NORTH_CHEST_AABB; } else if (source.getBlockState(pos.south()).getBlock() == this) { return SOUTH_CHEST_AABB; } else if (source.getBlockState(pos.west()).getBlock() == this) { return WEST_CHEST_AABB; } else { return source.getBlockState(pos.east()).getBlock() == this ? EAST_CHEST_AABB : NOT_CONNECTED_AABB; } }
@Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { return state.withProperty(NORTH, isCoffeeTable(world, pos.north())).withProperty(EAST, isCoffeeTable(world, pos.east())).withProperty(SOUTH, isCoffeeTable(world, pos.south())).withProperty(WEST, isCoffeeTable(world, pos.west())); }
@Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { return state.withProperty(NORTH, isHedge(world, pos.north())).withProperty(EAST, isHedge(world, pos.east())).withProperty(SOUTH, isHedge(world, pos.south())).withProperty(WEST, isHedge(world, pos.west())); }
@Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { boolean canNorth = this.canConnectTo(worldIn, pos.north()); boolean canEast = this.canConnectTo(worldIn, pos.east()); boolean canSouth = this.canConnectTo(worldIn, pos.south()); boolean canWest = this.canConnectTo(worldIn, pos.west()); boolean flag4 = canNorth && !canEast && canSouth && !canWest || !canNorth && canEast && !canSouth && canWest; return state.withProperty(UP, !flag4 || !worldIn.isAirBlock(pos.up())).withProperty(NORTH, canNorth).withProperty(EAST, canEast).withProperty(SOUTH, canSouth).withProperty(WEST, canWest); }
public boolean matchesAt(World world, Random rand, BlockPos pos) { return this.descriptorMatchesAt(center, world, rand, pos) && this.descriptorMatchesAt(above, world, rand, pos.up()) && this.descriptorMatchesAt(below, world, rand, pos.down()) && (this.descriptorMatchesAt(beside, world, rand, pos.north()) || this.descriptorMatchesAt(beside, world, rand, pos.east()) || this.descriptorMatchesAt(beside, world, rand, pos.south()) || this.descriptorMatchesAt(beside, world, rand, pos.west())) && this.touchesAt(world, rand, pos); }
@Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){ boolean flag = this.canConnectTo(worldIn, pos.north()); boolean flag1 = this.canConnectTo(worldIn, pos.east()); boolean flag2 = this.canConnectTo(worldIn, pos.south()); boolean flag3 = this.canConnectTo(worldIn, pos.west()); boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3; return state.withProperty(BlockWall.UP, !flag4 || !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, flag).withProperty(BlockWall.EAST, flag1).withProperty(BlockWall.SOUTH, flag2).withProperty(BlockWall.WEST, flag3); }
@Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { boolean forward = world.getBlockState(pos.north()).getBlock() == this; boolean back = world.getBlockState(pos.south()).getBlock() == this; boolean left = world.getBlockState(pos.west()).getBlock() == this; boolean right = world.getBlockState(pos.east()).getBlock() == this; return state.withProperty(BACK, back).withProperty(FORWARD, forward).withProperty(LEFT, left).withProperty(RIGHT, right); }
@Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { boolean back = world.getBlockState(pos.south()).getBlock() == this; boolean forward = world.getBlockState(pos.north()).getBlock() == this; boolean left = world.getBlockState(pos.west()).getBlock() == this; boolean right = world.getBlockState(pos.east()).getBlock() == this; return state.withProperty(BACK, back).withProperty(FORWARD, forward).withProperty(LEFT, left).withProperty(RIGHT, right); }