Compare commits

...

2 Commits

Author SHA1 Message Date
8bc992a707 Set creative gamemode on join
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-11 23:17:15 +01:00
8a86f15996 Disable player flight 2022-11-11 23:16:59 +01:00
2 changed files with 12 additions and 3 deletions

View File

@ -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);

View File

@ -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