SteamWar/BauSystem2.0
Archiviert
12
0

Fix SmartPlaceListener for spectators

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-09-18 12:53:28 +02:00
Ursprung 5cb670d3f7
Commit 689bc52e2f

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.smartplace;
import de.steamwar.bausystem.configplayer.Config;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
@ -61,6 +62,7 @@ public class SmartPlaceListener implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getPlayer().getGameMode() == GameMode.SPECTATOR) return;
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("smartPlace", false)) return;
if (event.getPlayer().isSneaking()) {