mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
b3a8254758
By: md_5 <git@md-5.net>
20 lines
1,007 B
Diff
20 lines
1,007 B
Diff
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
|
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
|
@@ -34,7 +34,16 @@
|
|
entityliving.stopRiding();
|
|
}
|
|
|
|
- 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);
|
|
+
|
|
+ if (!status.isPresent()) {
|
|
+ // teleport event was canceled, no more tries
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ if (status.get()) {
|
|
+ // CraftBukkit end
|
|
SoundEffect soundeffect = entityliving instanceof EntityFox ? SoundEffects.FOX_TELEPORT : SoundEffects.CHORUS_FRUIT_TELEPORT;
|
|
|
|
world.playSound((EntityHuman) null, d0, d1, d2, soundeffect, SoundCategory.PLAYERS, 1.0F, 1.0F);
|