2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
|
|
|
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
2021-06-11 15:00:00 +10:00
|
|
|
@@ -34,7 +34,16 @@
|
2021-05-25 08:24:08 +10:00
|
|
|
entityliving.stopRiding();
|
|
|
|
}
|
2016-03-06 09:46:57 +11:00
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
- if (entityliving.randomTeleport(d3, d4, d5, true)) {
|
2021-05-25 08:24:08 +10:00
|
|
|
+ // CraftBukkit start - handle canceled status of teleport event
|
2021-11-22 09:00:00 +11:00
|
|
|
+ java.util.Optional<Boolean> status = entityliving.randomTeleport(d3, d4, d5, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
|
2016-11-17 12:41:03 +11:00
|
|
|
+
|
2021-05-25 08:24:08 +10:00
|
|
|
+ if (!status.isPresent()) {
|
|
|
|
+ // teleport event was canceled, no more tries
|
|
|
|
+ break;
|
2016-03-06 09:46:57 +11:00
|
|
|
+ }
|
|
|
|
+
|
2021-05-25 08:24:08 +10:00
|
|
|
+ if (status.get()) {
|
|
|
|
+ // CraftBukkit end
|
2021-06-11 15:00:00 +10:00
|
|
|
SoundEffect soundeffect = entityliving instanceof EntityFox ? SoundEffects.FOX_TELEPORT : SoundEffects.CHORUS_FRUIT_TELEPORT;
|
2021-05-25 08:24:08 +10:00
|
|
|
|
|
|
|
world.playSound((EntityHuman) null, d0, d1, d2, soundeffect, SoundCategory.PLAYERS, 1.0F, 1.0F);
|