2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
|
|
|
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -34,7 +34,16 @@
|
2021-05-25 00:24:08 +02:00
|
|
|
entityliving.stopRiding();
|
|
|
|
}
|
2016-03-05 23:46:57 +01:00
|
|
|
|
2021-05-25 00:24:08 +02:00
|
|
|
- if (entityliving.a(d3, d4, d5, true)) {
|
|
|
|
+ // CraftBukkit start - handle canceled status of teleport event
|
|
|
|
+ java.util.Optional<Boolean> status = entityliving.safeTeleport(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
|
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
|
|
|
|
|
|
|
world.playSound((EntityHuman) null, d0, d1, d2, soundeffect, SoundCategory.PLAYERS, 1.0F, 1.0F);
|