From b8ed619b1c391e10f75a7ab227fe7df22c5ddfc6 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 10 May 2021 15:42:44 +0200 Subject: [PATCH] Implemented search for safe-location on target-beacon --- .../listener/OnCustomPlayerMove.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java index aaaef60..82e1edd 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/listener/OnCustomPlayerMove.java @@ -84,9 +84,16 @@ public class OnCustomPlayerMove implements CustomPlayerMoveEventListener { // Set player as ignored on target-LinkedBeaconTeleporter (so he wont trigger the teleport again) playerBeaconLocation.put(uuid, lbtBlockPartner); + // Get safe-location on top of other beacon + Block safeBlock = Function.searchForMaterial( + lbtBlockPartner.block().getLocation().add(0, 1, 0), + new Vector(0, 1, 0), + Material.AIR + ); + // Teleport e.player().teleport( - lbtBlockPartner.block().getLocation().add(0.5, 1, 0.5) + safeBlock.getLocation().add(0.5, 0, 0.5) ); } }