mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 20:12:54 +00:00
#539 new config . remove-god-on-discon if people discon with godmode on it will be turned off on quit.
This commit is contained in:
parent
71c11d05fd
commit
da8d5454d4
3 changed files with 153 additions and 139 deletions
|
@ -210,7 +210,13 @@ public class EssentialsPlayerListener extends PlayerListener
|
|||
public void onPlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
|
||||
if (ess.getSettings().removeGodOnDiscon())
|
||||
{
|
||||
if (user.isGodModeEnabled())
|
||||
{
|
||||
user.toggleGodModeEnabled();
|
||||
}
|
||||
}
|
||||
if (user.getSavedInventory() != null)
|
||||
{
|
||||
user.getInventory().setContents(user.getSavedInventory());
|
||||
|
|
|
@ -390,4 +390,10 @@ public class Settings implements IConf
|
|||
{
|
||||
return config.getBoolean("economy-log-enabled", false);
|
||||
}
|
||||
|
||||
boolean removeGodOnDiscon()
|
||||
{
|
||||
return config.getBoolean("remove-god-on-discon", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -191,6 +191,8 @@ debug: false
|
|||
# If you don't set this, the default locale of the server will be used.
|
||||
#locale: de_DE
|
||||
|
||||
#turn off god mode when people exit
|
||||
remove-god-on-discon: false
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsHome | #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue