Deprecate TeleportCause CHORUS_FRUIT for CONSUMABLE_EFFECT (#12546)

This commit is contained in:
Pedro
2025-05-18 10:33:21 -04:00
committed by GitHub
parent f1dbed072c
commit cc38032bee
2 changed files with 13 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
Vec3 vec3 = entity.position();
- if (entity.randomTeleport(d, d1, d2, true)) {
+ // CraftBukkit start - handle canceled status of teleport event
+ java.util.Optional<Boolean> status = entity.randomTeleport(d, d1, d2, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
+ java.util.Optional<Boolean> status = entity.randomTeleport(d, d1, d2, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CONSUMABLE_EFFECT);
+
+ // teleport event was canceled, no more tries
+ if (status.isEmpty()) break;