SteamWar/BauSystem2.0
Archiviert
12
0
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-06-04 00:25:49 +02:00
Ursprung 69f499afb6
Commit 535d8f497b

Datei anzeigen

@ -42,6 +42,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockCanBuildEvent;
import org.bukkit.event.player.PlayerGameModeChangeEvent; import org.bukkit.event.player.PlayerGameModeChangeEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList; import java.util.ArrayList;
@ -121,4 +122,12 @@ public class NoClipCommand extends SWCommand implements Listener {
event.setBuildable(true); event.setBuildable(true);
} }
} }
@EventHandler(ignoreCancelled = true)
public void onPlayerToggleFlight(PlayerToggleFlightEvent event) {
if (NOCLIPS.contains(event.getPlayer())) {
event.setCancelled(true);
event.getPlayer().setFlying(true);
}
}
} }