Add Page Command #130
@ -22,6 +22,8 @@ package de.steamwar.schematicsystem;
|
|||||||
import de.steamwar.message.Message;
|
import de.steamwar.message.Message;
|
||||||
import de.steamwar.schematicsystem.commands.DownloadCommand;
|
import de.steamwar.schematicsystem.commands.DownloadCommand;
|
||||||
import de.steamwar.schematicsystem.commands.SchematicCommand;
|
import de.steamwar.schematicsystem.commands.SchematicCommand;
|
||||||
|
import de.steamwar.schematicsystem.listener.PlayerEventListener;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class SchematicSystem extends JavaPlugin {
|
public class SchematicSystem extends JavaPlugin {
|
||||||
@ -35,6 +37,8 @@ public class SchematicSystem extends JavaPlugin {
|
|||||||
|
|
||||||
new SchematicCommand();
|
new SchematicCommand();
|
||||||
new DownloadCommand();
|
new DownloadCommand();
|
||||||
|
|
||||||
|
Bukkit.getPluginManager().registerEvents(new PlayerEventListener(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SchematicSystem getInstance() {
|
public static SchematicSystem getInstance() {
|
||||||
|
@ -472,6 +472,11 @@ public class SchematicCommandUtils {
|
|||||||
inv.open();
|
inv.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void quitPlayer(Player player) {
|
||||||
|
CACHED_LISTS.remove(player);
|
||||||
|
PUBLIC_TOGGLED.remove(player);
|
||||||
|
}
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@With
|
@With
|
||||||
static class CachedSchematicList {
|
static class CachedSchematicList {
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
package de.steamwar.schematicsystem.listener;
|
||||||
|
|
||||||
|
import de.steamwar.schematicsystem.commands.SchematicCommandUtils;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
|
public class PlayerEventListener implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
|
SchematicCommandUtils.quitPlayer(event.getPlayer());
|
||||||
|
}
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren