mirror of
https://github.com/Phoenix616/RandomTeleport.git
synced 2024-11-22 02:25:38 +01:00
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.
This commit is contained in:
parent
66b02e8201
commit
e979043e14
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user