Fixed player being removed from ignoreList directly after teleport.

master
Ruakij 4 years ago
parent 63bab8ae2e
commit b010280111

@ -6,6 +6,7 @@ import eu.ruekov.ruakij.LinkedBeaconTeleporters.customPlayerMoveEvent.CustomPlay
import eu.ruekov.ruakij.LinkedBeaconTeleporters.customPlayerMoveEvent.CustomPlayerMoveEventListener;
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporter;
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterBlock;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -29,10 +30,18 @@ public class OnCustomPlayerMove implements CustomPlayerMoveEventListener {
Player p = e.player();
UUID uuid = p.getUniqueId();
// If player found in ignoreList, remove
// FIXME: Will remove player from list, even though he should be ignored :/
if(playerBeaconLocation.containsKey(uuid))
playerBeaconLocation.remove(uuid);
// If player found in ignoreList, check if he stepped out of the Beacon-light
if(playerBeaconLocation.containsKey(uuid)) {
LinkedBeaconTeleporterBlock lbtBlock = playerBeaconLocation.get(uuid);
Location lbtBlockLoc = lbtBlock.block().getLocation();
Location pLoc = p.getLocation();
if(lbtBlockLoc.getBlockX() != pLoc.getBlockX() || lbtBlockLoc.getBlockZ() != pLoc.getBlockZ()){
playerBeaconLocation.remove(uuid);
}
else
// Player still on beacon, ignore
return;
}
// Check if player is on-top of a beacon
Block block = Function.searchForMaterial(

Loading…
Cancel
Save