use of com.github.games647.craftapi.model.Profile in project ChangeSkin by games647.
the class LoginListener method setDefaultSkin.
private void setDefaultSkin(UserPreference preferences, GameProfile profile) {
Optional<SkinModel> randomSkin = getRandomSkin();
if (randomSkin.isPresent()) {
SkinModel targetSkin = randomSkin.get();
preferences.setTargetSkin(targetSkin);
plugin.getApi().applyProperties(profile, targetSkin);
}
}
use of com.github.games647.craftapi.model.Profile in project FastLogin by games647.
the class NameCheckTask method startCrackedSession.
@Override
public void startCrackedSession(ProtocolLibLoginSource source, StoredProfile profile, String username) {
BukkitLoginSession loginSession = new BukkitLoginSession(username, profile);
plugin.putSession(player.getAddress(), loginSession);
}
use of com.github.games647.craftapi.model.Profile in project FastLogin by games647.
the class ProtocolSupportListener method callFastLoginPreLoginEvent.
@Override
public FastLoginPreLoginEvent callFastLoginPreLoginEvent(String username, ProtocolLoginSource source, StoredProfile profile) {
BukkitFastLoginPreLoginEvent event = new BukkitFastLoginPreLoginEvent(username, source, profile);
plugin.getServer().getPluginManager().callEvent(event);
return event;
}
use of com.github.games647.craftapi.model.Profile in project FastLogin by games647.
the class ProtocolSupportListener method startCrackedSession.
@Override
public void startCrackedSession(ProtocolLoginSource source, StoredProfile profile, String username) {
BukkitLoginSession loginSession = new BukkitLoginSession(username, profile);
plugin.putSession(source.getAddress(), loginSession);
}
use of com.github.games647.craftapi.model.Profile in project FastLogin by games647.
the class CrackedCommand method onCrackedOther.
private void onCrackedOther(CommandSender sender, Command command, String[] args) {
if (!hasOtherPermission(sender, command)) {
return;
}
if (forwardCrackedCommand(sender, args[0])) {
return;
}
// todo: load async
StoredProfile profile = plugin.getCore().getStorage().loadProfile(args[0]);
if (profile == null) {
sender.sendMessage("Error occurred");
return;
}
// existing player is already cracked
if (profile.isSaved() && !profile.isPremium()) {
plugin.getCore().sendLocaleMessage("not-premium-other", sender);
} else {
plugin.getCore().sendLocaleMessage("remove-premium", sender);
profile.setPremium(false);
plugin.getScheduler().runAsync(() -> {
plugin.getCore().getStorage().save(profile);
plugin.getServer().getPluginManager().callEvent(new BukkitFastLoginPremiumToggleEvent(profile, PremiumToggleReason.COMMAND_OTHER));
});
}
}
Aggregations