AutoReferee

AutoReferee

9.1k Downloads

Clear player's inventories on entering lobby

arahpthos opened this issue ยท 0 comments

commented

A current issue with AR is that when a player logs in, after logging out in an unloaded world, the player will retain their inventories. This is fine, as players in the lobby who don't have admin privileges cannot interact with the world, however players can still place entities such as paintings, item frames and boats.

This can be done by changing AutoReferee.src.main.java.org.mctourney.autoreferee.listeners.lobby. LobbyListener.java starting at line 141 from:

    if (player.getWorld() == plugin.getLobbyWorld())
    {
        if (!player.hasPlayedBefore())
            player.teleport(player.getWorld().getSpawnLocation());
        PlayerUtil.setGameMode(player, GameMode.ADVENTURE, true);
    }

to:

    if (player.getWorld() == plugin.getLobbyWorld())
    {
        if (!player.hasPlayedBefore())
            player.teleport(player.getWorld().getSpawnLocation());
        PlayerUtil.setGameMode(player, GameMode.ADVENTURE, true);
        PlayerUtil.reset(player);
    }