Пример #1
0
 @EventHandler
 public void onGamemodeChange(PlayerGameModeChangeEvent e) {
   if (e.getNewGameMode().equals(GameMode.ADVENTURE)) {
     Player p = e.getPlayer();
     p.setAllowFlight(true);
     p.setFlying(false);
   }
 }
Пример #2
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onGamemode(PlayerGameModeChangeEvent e) {
   if (!plugin.getConfig().getBoolean("Complete")) return;
   Player p = e.getPlayer();
   if (plugin.spieler == p) {
     if (e.getNewGameMode() == GameMode.CREATIVE) {
       e.setCancelled(true);
     }
   }
 }
Пример #3
0
	@EventHandler(priority = EventPriority.HIGH)
	public void onGamemodeChange(PlayerGameModeChangeEvent e) {
		SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getPlayer());

		if (!player.isActive()) {
			return;
		}

		if (e.getNewGameMode() == GameMode.SURVIVAL) {
			return;
		}

		player.sendMessage(I18N._("cantChangeGamemode"));
		e.setCancelled(true);
	}