Skip to content

Commit

Permalink
Allow dead bush placement on grass
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriM1 authored Oct 24, 2023
1 parent 859aa11 commit 908e39e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/cn/nukkit/block/BlockDeadBush.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cn.nukkit.math.BlockFace;
import cn.nukkit.utils.BlockColor;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

/**
* Created on 2015/12/2 by xtypr.
Expand Down Expand Up @@ -42,7 +42,7 @@ public boolean canBeReplaced() {
public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {
Block down = this.down();
int id = down.getId();
if (id == SAND || id == TERRACOTTA || id == STAINED_TERRACOTTA || id == DIRT || id == PODZOL || id == MYCELIUM) {
if (id == SAND || id == TERRACOTTA || id == STAINED_TERRACOTTA || id == DIRT || id == PODZOL || id == MYCELIUM || id == GRASS) {
this.getLevel().setBlock(block, this, true, true);
return true;
}
Expand Down Expand Up @@ -70,7 +70,7 @@ public Item[] getDrops(Item item) {
};
} else {
return new Item[]{
new ItemStick(0, new Random().nextInt(3))
new ItemStick(0, ThreadLocalRandom.current().nextInt(3))
};
}
}
Expand Down

0 comments on commit 908e39e

Please sign in to comment.