2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
|
|
|
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -36,7 +36,16 @@
|
2022-06-07 18:00:00 +02:00
|
|
|
|
|
|
|
Vec3D vec3d = entityliving.position();
|
2016-03-05 23:46:57 +01:00
|
|
|
|
2023-12-05 17:40:00 +01:00
|
|
|
- if (entityliving.randomTeleport(d0, d1, d2, true)) {
|
2021-05-25 00:24:08 +02:00
|
|
|
+ // CraftBukkit start - handle canceled status of teleport event
|
2023-12-05 17:40:00 +01:00
|
|
|
+ java.util.Optional<Boolean> status = entityliving.randomTeleport(d0, d1, d2, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
|
2016-11-17 02:41:03 +01:00
|
|
|
+
|
2021-05-25 00:24:08 +02:00
|
|
|
+ if (!status.isPresent()) {
|
|
|
|
+ // teleport event was canceled, no more tries
|
|
|
|
+ break;
|
2016-03-05 23:46:57 +01:00
|
|
|
+ }
|
|
|
|
+
|
2021-05-25 00:24:08 +02:00
|
|
|
+ if (status.get()) {
|
|
|
|
+ // CraftBukkit end
|
2024-04-23 17:15:00 +02:00
|
|
|
world.gameEvent((Holder) GameEvent.TELEPORT, vec3d, GameEvent.a.of((Entity) entityliving));
|
2023-12-05 17:40:00 +01:00
|
|
|
SoundEffect soundeffect;
|
|
|
|
SoundCategory soundcategory;
|