Merge pull request 'Sleep Preventer' (#178) from Insomnia into master
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
bbbe0ef174
@ -74,6 +74,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
new TestListener();
|
new TestListener();
|
||||||
new NormalJoinListener();
|
new NormalJoinListener();
|
||||||
new RankedJoinListener();
|
new RankedJoinListener();
|
||||||
|
new SleepListener();
|
||||||
if(Core.getVersion() > 8)
|
if(Core.getVersion() > 8)
|
||||||
new ExtendedInventoryListener();
|
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