Compare commits
2 Commits
b84e96f031
...
8bc992a707
Author | SHA1 | Date | |
---|---|---|---|
8bc992a707 | |||
8a86f15996 |
@ -4,7 +4,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import wtf.beatrice.limbomanager.listeners.CommandCanceller;
|
import wtf.beatrice.limbomanager.listeners.CommandCanceller;
|
||||||
import wtf.beatrice.limbomanager.listeners.PlayerHider;
|
import wtf.beatrice.limbomanager.listeners.PlayerChecker;
|
||||||
import wtf.beatrice.limbomanager.listeners.PlayerTeleporter;
|
import wtf.beatrice.limbomanager.listeners.PlayerTeleporter;
|
||||||
import wtf.beatrice.limbomanager.listeners.RiskyBlocksHandler;
|
import wtf.beatrice.limbomanager.listeners.RiskyBlocksHandler;
|
||||||
import wtf.beatrice.limbomanager.objects.LocationCheckRunnable;
|
import wtf.beatrice.limbomanager.objects.LocationCheckRunnable;
|
||||||
@ -23,7 +23,7 @@ public class LimboManager extends JavaPlugin {
|
|||||||
instance = this;
|
instance = this;
|
||||||
pluginManager = Bukkit.getServer().getPluginManager();
|
pluginManager = Bukkit.getServer().getPluginManager();
|
||||||
|
|
||||||
pluginManager.registerEvents(new PlayerHider(), this);
|
pluginManager.registerEvents(new PlayerChecker(), this);
|
||||||
pluginManager.registerEvents(new PlayerTeleporter(), this);
|
pluginManager.registerEvents(new PlayerTeleporter(), this);
|
||||||
pluginManager.registerEvents(new CommandCanceller(), this);
|
pluginManager.registerEvents(new CommandCanceller(), this);
|
||||||
pluginManager.registerEvents(new RiskyBlocksHandler(), this);
|
pluginManager.registerEvents(new RiskyBlocksHandler(), this);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package wtf.beatrice.limbomanager.listeners;
|
package wtf.beatrice.limbomanager.listeners;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -8,8 +9,9 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import wtf.beatrice.limbomanager.LimboManager;
|
import wtf.beatrice.limbomanager.LimboManager;
|
||||||
|
|
||||||
public class PlayerHider implements Listener
|
public class PlayerChecker implements Listener
|
||||||
{
|
{
|
||||||
|
// this class performs various checks on player join and quit to ensure general safety.
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -28,6 +30,13 @@ public class PlayerHider implements Listener
|
|||||||
otherPlayer.hidePlayer(plugin, joiner);
|
otherPlayer.hidePlayer(plugin, joiner);
|
||||||
joiner.hidePlayer(plugin, otherPlayer);
|
joiner.hidePlayer(plugin, otherPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable flight
|
||||||
|
joiner.setAllowFlight(false);
|
||||||
|
joiner.setFlying(false);
|
||||||
|
|
||||||
|
// set gamemode
|
||||||
|
joiner.setGameMode(GameMode.CREATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
Loading…
Reference in New Issue
Block a user