Dieser Commit ist enthalten in:
Ursprung
d3e937ec78
Commit
4f7ca74a43
@ -19,8 +19,10 @@
|
|||||||
|
|
||||||
package de.steamwar.tutorial.listener;
|
package de.steamwar.tutorial.listener;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
public class Joining extends BasicListener {
|
public class Joining extends BasicListener {
|
||||||
|
|
||||||
@ -28,4 +30,11 @@ public class Joining extends BasicListener {
|
|||||||
public void onJoin(PlayerJoinEvent event) {
|
public void onJoin(PlayerJoinEvent event) {
|
||||||
event.getPlayer().setOp(true);
|
event.getPlayer().setOp(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
|
if (Bukkit.getOnlinePlayers().isEmpty() || (Bukkit.getOnlinePlayers().size() == 1 && Bukkit.getOnlinePlayers().contains(event.getPlayer()))) {
|
||||||
|
Bukkit.shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren