mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Remove duplicate forwardCrackedCommand()
The forwardCrackedCommand() method is invoked before, the removed code, that does the exact same thing.
This commit is contained in:
@ -62,25 +62,20 @@ public class CrackedCommand extends ToggleCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.getBungeeManager().isEnabled()) {
|
// todo: load async if
|
||||||
sendBungeeActivateMessage(sender, sender.getName(), false);
|
StoredProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
|
||||||
plugin.getCore().sendLocaleMessage("wait-on-proxy", sender);
|
if (profile.isPremium()) {
|
||||||
} else {
|
plugin.getCore().sendLocaleMessage("remove-premium", sender);
|
||||||
//todo: load async if
|
|
||||||
StoredProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
|
|
||||||
if (profile.isPremium()) {
|
|
||||||
plugin.getCore().sendLocaleMessage("remove-premium", sender);
|
|
||||||
|
|
||||||
profile.setPremium(false);
|
profile.setPremium(false);
|
||||||
profile.setId(null);
|
profile.setId(null);
|
||||||
plugin.getScheduler().runAsync(() -> {
|
plugin.getScheduler().runAsync(() -> {
|
||||||
plugin.getCore().getStorage().save(profile);
|
plugin.getCore().getStorage().save(profile);
|
||||||
plugin.getServer().getPluginManager().callEvent(
|
plugin.getServer().getPluginManager().callEvent(
|
||||||
new BukkitFastLoginPremiumToggleEvent(profile, PremiumToggleReason.COMMAND_OTHER));
|
new BukkitFastLoginPremiumToggleEvent(profile, PremiumToggleReason.COMMAND_OTHER));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
plugin.getCore().sendLocaleMessage("not-premium", sender);
|
plugin.getCore().sendLocaleMessage("not-premium", sender);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user