2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
|
|
|
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -39,7 +39,16 @@
|
|
|
|
|
|
|
|
Vec3D vec3d = entityliving.position();
|
2016-03-05 23:46:57 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- if (entityliving.randomTeleport(d3, d4, d5, true)) {
|
2021-05-25 00:24:08 +02:00
|
|
|
+ // CraftBukkit start - handle canceled status of teleport event
|
2021-11-21 23:00:00 +01:00
|
|
|
+ java.util.Optional<Boolean> status = entityliving.randomTeleport(d3, d4, d5, 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
|
2022-06-07 18:00:00 +02:00
|
|
|
world.gameEvent(GameEvent.TELEPORT, vec3d, GameEvent.a.of((Entity) entityliving));
|
2021-06-11 07:00:00 +02:00
|
|
|
SoundEffect soundeffect = entityliving instanceof EntityFox ? SoundEffects.FOX_TELEPORT : SoundEffects.CHORUS_FRUIT_TELEPORT;
|
2021-05-25 00:24:08 +02:00
|
|
|
|