@@ -1,12 +1,12 @@
|
||||
--- a/net/minecraft/world/item/ItemChorusFruit.java
|
||||
+++ b/net/minecraft/world/item/ItemChorusFruit.java
|
||||
@@ -39,7 +39,16 @@
|
||||
@@ -35,7 +35,16 @@
|
||||
|
||||
Vec3D vec3d = entityliving.position();
|
||||
|
||||
- if (entityliving.randomTeleport(d3, d4, d5, true)) {
|
||||
- if (entityliving.randomTeleport(d0, d1, d2, true)) {
|
||||
+ // CraftBukkit start - handle canceled status of teleport event
|
||||
+ java.util.Optional<Boolean> status = entityliving.randomTeleport(d3, d4, d5, true, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT);
|
||||
+ 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
|
||||
@@ -16,5 +16,5 @@
|
||||
+ if (status.get()) {
|
||||
+ // CraftBukkit end
|
||||
world.gameEvent(GameEvent.TELEPORT, vec3d, GameEvent.a.of((Entity) entityliving));
|
||||
SoundEffect soundeffect = entityliving instanceof EntityFox ? SoundEffects.FOX_TELEPORT : SoundEffects.CHORUS_FRUIT_TELEPORT;
|
||||
|
||||
SoundEffect soundeffect;
|
||||
SoundCategory soundcategory;
|
||||
|
||||
Reference in New Issue
Block a user