Sleep Preventer #178
@ -1,19 +1,19 @@
|
|||||||
package de.steamwar.fightsystem.listener;
|
package de.steamwar.fightsystem.listener;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.event.player.PlayerBedEnterEvent;
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.player.PlayerBedEnterEvent;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
public class SleepListener extends BasicListener{
|
||||||
|
|
||||||
public class SleepListener extends BasicListener{
|
public SleepListener() {
|
||||||
public SleepListener() {super(EnumSet.allOf(FightState.class));}
|
super(EnumSet.allOf(FightState.class));
|
||||||
@EventHandler
|
}
|
||||||
public void onSleep(PlayerBedEnterEvent e) {
|
|
||||||
e.setCancelled(true);
|
@EventHandler
|
||||||
//Block b=e.getBed();
|
public void onSleep(PlayerBedEnterEvent e) {
|
||||||
|
|||||||
//b.getWorld().createExplosion(b.getLocation(),4.0F); //4==tnt => dosnt have any advantage in WS (noFire,sameStrength,moreInvSpace,selfDamage)
|
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)