aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/ChorusFruitItem.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/item/ChorusFruitItem.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/item/ChorusFruitItem.java.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/ChorusFruitItem.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/ChorusFruitItem.java.patch
new file mode 100644
index 0000000000..b5bec9cc49
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/ChorusFruitItem.java.patch
@@ -0,0 +1,30 @@
+--- a/net/minecraft/world/item/ChorusFruitItem.java
++++ b/net/minecraft/world/item/ChorusFruitItem.java
+@@ -33,11 +33,22 @@
+ entityLiving.stopRiding();
+ }
+
+- Vec3 vec3 = entityLiving.position();
+- if (entityLiving.randomTeleport(d, d1, d2, true)) {
+- level.gameEvent(GameEvent.TELEPORT, vec3, GameEvent.Context.of(entityLiving));
+- SoundSource soundSource;
+- SoundEvent soundEvent;
++ Vec3 vec3d = entityLiving.position();
++
++ // CraftBukkit start - handle canceled status of teleport event
++ java.util.Optional<Boolean> status = entityLiving.randomTeleport(d0, d1, d2, 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
++ level.gameEvent(GameEvent.TELEPORT, vec3d, GameEvent.Context.of((Entity) entityLiving));
++ SoundEvent soundeffect;
++ SoundSource soundcategory;
++
+ if (entityLiving instanceof Fox) {
+ soundEvent = SoundEvents.FOX_TELEPORT;
+ soundSource = SoundSource.NEUTRAL;