Sleep Preventer #178
@ -74,6 +74,7 @@ public class FightSystem extends JavaPlugin {
|
||||
new TestListener();
|
||||
new NormalJoinListener();
|
||||
new RankedJoinListener();
|
||||
new SleepListener();
|
||||
if(Core.getVersion() > 8)
|
||||
new ExtendedInventoryListener();
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerBedEnterEvent;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class SleepListener extends BasicListener{
|
||||
|
||||
public SleepListener() {
|
||||
super(EnumSet.allOf(FightState.class));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onSleep(PlayerBedEnterEvent e) {
|
||||
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren
Das ist ein Eingriff ins gameplay, bitte einfach event canceln.
wenn man ein sleep event cancelt wird man immernoch herumtransportiert (jedenfalls in der 1.12)