geforkt von Mirrors/Paper
Reset spawner timer when spawner event is cancelled
Dieser Commit ist enthalten in:
Ursprung
08aaee1b77
Commit
d00d3df166
@ -40,7 +40,7 @@
|
|||||||
} else {
|
} else {
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
RandomSource randomsource = world.getRandom();
|
RandomSource randomsource = world.getRandom();
|
||||||
@@ -157,13 +164,25 @@
|
@@ -157,13 +164,26 @@
|
||||||
((Mob) entity).finalizeSpawn(world, world.getCurrentDifficultyAt(entity.blockPosition()), EntitySpawnReason.SPAWNER, (SpawnGroupData) null);
|
((Mob) entity).finalizeSpawn(world, world.getCurrentDifficultyAt(entity.blockPosition()), EntitySpawnReason.SPAWNER, (SpawnGroupData) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +59,7 @@
|
|||||||
|
|
||||||
- if (!world.tryAddFreshEntityWithPassengers(entity)) {
|
- if (!world.tryAddFreshEntityWithPassengers(entity)) {
|
||||||
+ entity.spawnedViaMobSpawner = true; // Paper
|
+ entity.spawnedViaMobSpawner = true; // Paper
|
||||||
|
+ flag = true; // Paper
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
|
||||||
+ continue;
|
+ continue;
|
||||||
@ -68,3 +69,12 @@
|
|||||||
this.delay(world, pos);
|
this.delay(world, pos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -174,7 +194,7 @@
|
||||||
|
((Mob) entity).spawnAnim();
|
||||||
|
}
|
||||||
|
|
||||||
|
- flag = true;
|
||||||
|
+ //flag = true; // Paper - moved up above cancellable event
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren