Skip to content

Commit

Permalink
Fix for #264
Browse files Browse the repository at this point in the history
Bees coming from hives trigger creature spawn event with SpawnReason BEEHIVE, however when using Paper's Entity#getEntitySpawnReason they retain their original spawn reason.

We could change it so that the spawn event uses the Paper method for checking blacklists etc, but there would be problems for spigot users, requiring checks for use of Paper. But if an entity was previously destacked - they would become stacked again.

(description copied from 50d6ee0)
  • Loading branch information
ploppyperson committed Sep 8, 2024
1 parent a150743 commit 92b6594
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public void onSpawn(CreatureSpawnEvent event) {
if (!(event.getEntity() instanceof Mob)) {
return;
}
if (event.getEntity() instanceof Bee) {
if (event.getSpawnReason() == CreatureSpawnEvent.SpawnReason.BEEHIVE) {
return;
}
}
sm.getScheduler().runTask(sm, event.getEntity(), () -> {
if (sm.getEntityManager().isStackedEntity(event.getEntity())) {
StackEntity stackEntity = sm.getEntityManager().getStackEntity(event.getEntity());
Expand Down

0 comments on commit 92b6594

Please sign in to comment.