if (!world.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3)
@Override public void executeSFX(boolean isFilling, @Nonnull World world, @Nonnull BlockPos pos) { if (!isFilling) { BlockPos eventPos = pos; if (world.rand.nextBoolean()) { eventPos = eventPos.south(); } if (world.rand.nextBoolean()) { eventPos = eventPos.east(); } world.playEvent(2002, eventPos, PotionUtils.getPotionColor(PotionTypes.WATER)); } } },
private BlockPos getMasterPosForNewMB(@Nonnull World worldIn, @Nonnull BlockPos swCorner, @Nonnull BlockPos ignorePos) { BlockPos testPos = swCorner; for (int i = 0; i < 3; i++) { testPos = swCorner.offset(EnumFacing.NORTH, i); for (int j = 0; j < 3; j++) { if (!testPos.equals(ignorePos) && !isSingle(worldIn, testPos)) { return null; } testPos = testPos.east(); } } return swCorner.offset(EnumFacing.NORTH).offset(EnumFacing.EAST); }
@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); }
public void generateArchNS(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).east(width / 2), ModBlocks.frozenCobblestone.getDefaultState(), 3); world.setBlockState(position.up(sides).west(width / 2), ModBlocks.frozenCobblestone.getDefaultState(), 3); } for (int way = -1; way < width; way++) { world.setBlockState(position.up(height).east(way), ModBlocks.frozenCobblestone.getDefaultState(), 3); } }
public void generateArchNS(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).east(width / 2), ModBlocks.charedCobblestone.getDefaultState(), 3); world.setBlockState(position.up(sides).west(width / 2), ModBlocks.charedCobblestone.getDefaultState(), 3); } for (int way = -1; way < width; way++) { world.setBlockState(position.up(height).east(way), ModBlocks.charedCobblestone.getDefaultState(), 3); } }
@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; }
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); }
@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 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); }
@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); }
private boolean incrementClear() { clearPos = clearPos.east(); if (clearPos.getX() > bb.max.getX()) { clearPos = new BlockPos(bb.min.getX(), clearPos.getY(), clearPos.getZ()); clearPos = clearPos.south(); if (clearPos.getZ() > bb.max.getZ()) { clearPos = new BlockPos(bb.min.getX(), clearPos.up().getY(), bb.min.getZ()); return clearPos.getY() <= bb.max.getY(); } } return true; }