SteamWar/BauSystem2.0
Archiviert
12
0

Add Gamemode Autoleave

Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-06-13 15:49:01 +02:00
Ursprung a41b3578a9
Commit 296d30b727
2 geänderte Dateien mit 5 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -49,6 +49,9 @@ public class GamemodeCommand extends SWCommand {
@Register @Register
public void gamemodeCommand(final Player p, final GameMode gameMode) { public void gamemodeCommand(final Player p, final GameMode gameMode) {
if (NoClipCommand.getNOCLIPS().contains(p)) {
p.performCommand("noclip");
}
p.setGameMode(gameMode); p.setGameMode(gameMode);
} }
} }

Datei anzeigen

@ -34,6 +34,7 @@ import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.core.VersionedRunnable; import de.steamwar.core.VersionedRunnable;
import lombok.Getter;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
@ -56,6 +57,7 @@ import java.util.logging.Level;
@Linked(LinkageType.LISTENER) @Linked(LinkageType.LISTENER)
public class NoClipCommand extends SWCommand implements Listener { public class NoClipCommand extends SWCommand implements Listener {
@Getter
private static final List<Player> NOCLIPS = new ArrayList<>(); private static final List<Player> NOCLIPS = new ArrayList<>();
private static final Map<Player, Long> LAST_TICKS = new HashMap<>(); private static final Map<Player, Long> LAST_TICKS = new HashMap<>();