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