Small problem

This commit is contained in:
ZeroEpoch1969 2018-05-29 14:30:29 -07:00
parent f82f3932b9
commit aad947a354
No known key found for this signature in database
GPG Key ID: E0AAB104FB9F8FDF

View File

@ -3,6 +3,7 @@ package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.discord.Discord;
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
import me.totalfreedom.totalfreedommod.player.FPlayer;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
@ -93,6 +94,34 @@ public class Command_verify extends FreedomCommand
admin.setName(playerSender.getName());
admin.addIp(Ips.getIp(playerSender));
}
if (!plugin.mbl.isMasterBuilder(playerSender))
{
MasterBuilder masterBuilder = null;
for (MasterBuilder loopMasterBuilder : plugin.mbl.getAllMasterBuilders().values())
{
if (loopMasterBuilder.getName().equalsIgnoreCase(playerSender.getName()))
{
masterBuilder = loopMasterBuilder;
break;
}
}
if (masterBuilder != null)
{
if (playerSender!= null)
{
masterBuilder.setName(playerSender.getName());
masterBuilder.addIp(Ips.getIp(playerSender));
}
masterBuilder.setLastLogin(new Date());
plugin.mbl.save();
plugin.mbl.updateTables();
}
}
admin.setActive(true);
admin.setLastLogin(new Date());
plugin.al.save();