SPIGOT-6713: Cancelling EntityTransformEvent Causes Deceased Slimes To Not Despawn

This commit is contained in:
md_5 2021-08-22 18:07:31 +10:00
parent 7c8bbcbee7
commit c949675e1f
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -44,7 +44,7 @@
for (int l = 0; l < k; ++l) {
float f1 = ((float) (l % 2) - 0.5F) * f;
float f2 = ((float) (l / 2) - 0.5F) * f;
@@ -214,8 +235,17 @@
@@ -214,8 +235,18 @@
entityslime.setInvulnerable(this.isInvulnerable());
entityslime.setSize(j, true);
entityslime.setPositionRotation(this.locX() + (double) f1, this.locY() + 0.5D, this.locZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);
@ -54,6 +54,7 @@
+
+ // CraftBukkit start
+ if (CraftEventFactory.callEntityTransformEvent(this, slimes, EntityTransformEvent.TransformReason.SPLIT).isCancelled()) {
+ super.a(entity_removalreason);
+ return;
+ }
+ for (EntityLiving living : slimes) {