Reset spawner timer when spawner event is cancelled
This commit is contained in:
parent
08aaee1b77
commit
d00d3df166
1 changed files with 11 additions and 1 deletions
|
@ -40,7 +40,7 @@
|
|||
} else {
|
||||
boolean flag = false;
|
||||
RandomSource randomsource = world.getRandom();
|
||||
@@ -157,13 +164,25 @@
|
||||
@@ -157,13 +164,26 @@
|
||||
((Mob) entity).finalizeSpawn(world, world.getCurrentDifficultyAt(entity.blockPosition()), EntitySpawnReason.SPAWNER, (SpawnGroupData) null);
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
|||
|
||||
- if (!world.tryAddFreshEntityWithPassengers(entity)) {
|
||||
+ entity.spawnedViaMobSpawner = true; // Paper
|
||||
+ flag = true; // Paper
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
|
||||
+ continue;
|
||||
|
@ -68,3 +69,12 @@
|
|||
this.delay(world, pos);
|
||||
return;
|
||||
}
|
||||
@@ -174,7 +194,7 @@
|
||||
((Mob) entity).spawnAnim();
|
||||
}
|
||||
|
||||
- flag = true;
|
||||
+ //flag = true; // Paper - moved up above cancellable event
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue