From e979043e147845d9d281e7dc318be803593de224 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Thu, 19 Sep 2019 18:21:10 +0100 Subject: [PATCH] Send target location block change to player (possibly related to #33) This has been shown to stop the client from falling into blocks while teleporting in the past and might as well still solve some issues where the client hasn't received the chunk data yet. --- .../main/java/de/themoep/randomteleport/RandomTeleport.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java index e064b62..fe48731 100644 --- a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java +++ b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java @@ -344,6 +344,10 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI { searcher.search().thenApply(targetLoc -> { searcher.getTargets().forEach(e -> { cooldowns.put(searcher.getId(), e.getUniqueId(), new AbstractMap.SimpleImmutableEntry<>(System.currentTimeMillis(), searcher.getCooldown())); + if (e instanceof Player) { + Location belowLoc = targetLoc.clone().subtract(0, 1, 0); + ((Player) e).sendBlockChange(belowLoc, belowLoc.getBlock().getBlockData()); + } e.teleport(targetLoc); sendMessage(e, "teleport", "worldname", targetLoc.getWorld().getName(),