diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/item/ItemChorusFruit.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/item/ItemChorusFruit.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/item/ItemChorusFruit.patch b/patch-remap/og/net/minecraft/world/item/ItemChorusFruit.patch new file mode 100644 index 0000000000..8915087352 --- /dev/null +++ b/patch-remap/og/net/minecraft/world/item/ItemChorusFruit.patch @@ -0,0 +1,20 @@ +--- a/net/minecraft/world/item/ItemChorusFruit.java ++++ b/net/minecraft/world/item/ItemChorusFruit.java +@@ -35,7 +35,16 @@ + + Vec3D vec3d = entityliving.position(); + +- if (entityliving.randomTeleport(d0, d1, d2, true)) { ++ // CraftBukkit start - handle canceled status of teleport event ++ java.util.Optional<Boolean> status = entityliving.randomTeleport(d0, d1, d2, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT); ++ ++ if (!status.isPresent()) { ++ // teleport event was canceled, no more tries ++ break; ++ } ++ ++ if (status.get()) { ++ // CraftBukkit end + world.gameEvent(GameEvent.TELEPORT, vec3d, GameEvent.a.of((Entity) entityliving)); + SoundEffect soundeffect; + SoundCategory soundcategory; |