mirror of
https://github.com/kaboomserver/extras.git
synced 2025-02-05 06:02:55 +00:00
Don't randomly cancel TNT unless limit reached
This commit is contained in:
parent
56f36294ec
commit
b5e1aa0ac0
1 changed files with 3 additions and 1 deletions
|
@ -240,7 +240,9 @@ public final class EntitySpawn implements Listener {
|
|||
|
||||
@EventHandler
|
||||
void onTNTPrime(final TNTPrimeEvent event) {
|
||||
if (ThreadLocalRandom.current().nextBoolean()) {
|
||||
if (event.getBlock()
|
||||
.getWorld().getEntitiesByClass(TNTPrimed.class).size() >= MAX_TNTS_PER_WORLD
|
||||
&& ThreadLocalRandom.current().nextBoolean()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue