Skip to content

Commit

Permalink
Attempt to fix #122 + spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin452 committed Nov 15, 2024
1 parent 96411e5 commit 8e681d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ public class BlockGrass2 {
int i1 = x + random.nextInt(3) - 1;
int j1 = y + random.nextInt(5) - 3;
int k1 = z + random.nextInt(3) - 1;

if (worldIn.blockExists(i1, j1 + 1, k1)) {
int lightValue = worldIn.getBlockLightValue_do(i1, j1 + 1, k1, true);
int lightOpacity = worldIn.getBlockLightOpacity(i1, j1 + 1, k1);

if (lightValue >= 4 && lightOpacity <= 2) {
int localX = i1 & 15;
int localZ = k1 & 15;
if (j1 >= 0 && j1 < 256) {
Block block = chunk.getBlock(localX, j1, localZ);
int metadata = chunk.getBlockMetadata(localX, j1, localZ);

Block block = chunk.getBlock(localX, j1, localZ);
int metadata = chunk.getBlockMetadata(localX, j1, localZ);

if (block == Blocks.dirt && metadata == 0) {
worldIn.setBlock(i1, j1, k1, Blocks.grass, 0, 2);
if (block == Blocks.dirt && metadata == 0) {
worldIn.setBlock(i1, j1, k1, Blocks.grass, 0, 2);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected static ChunkPosition func_151350_a(World p_151350_0_, int p_151350_1_,
}

public static CompletableFuture<Integer> findChunksForSpawningAsync(WorldServer world, boolean spawnHostileMobs,
boolean spawnPeacefulMobs, boolean spawnAnimals) {
boolean spawnPeacefulMobs, boolean spawnAnimals) {
return CompletableFuture.supplyAsync(() -> {
if (!spawnHostileMobs && !spawnPeacefulMobs) {
return 0;
Expand Down

0 comments on commit 8e681d5

Please sign in to comment.