use of gg.projecteden.nexus.models.nerd.NerdService in project Nexus by ProjectEdenGG.
the class TeleportHereCommand method onJoin.
@EventHandler
public void onJoin(PlayerJoinEvent event) {
Nerd nerd = Nerd.of(event.getPlayer());
if (nerd.getTeleportOnLogin() == null)
return;
// No /back
event.getPlayer().teleportAsync(nerd.getTeleportOnLogin());
nerd.setTeleportOnLogin(null);
new NerdService().save(nerd);
}
use of gg.projecteden.nexus.models.nerd.NerdService in project Nexus by ProjectEdenGG.
the class VanishCommand method fakeQuit.
@Path("(fq|fakequit)")
@Permission("vanish.fakeannounce")
void fakeQuit() {
JoinQuit.quit(player());
new NerdService().edit(nerd(), nerd -> nerd.setLastVanish(LocalDateTime.now()));
runCommand("vanish on");
}
use of gg.projecteden.nexus.models.nerd.NerdService in project Nexus by ProjectEdenGG.
the class FirstLoginCommand method stats.
@Async
@Path("stats")
@Permission(Group.ADMIN)
void stats() {
StringBuilder data = new StringBuilder();
for (Nerd nerd : new NerdService().getAll()) if (nerd.getFirstJoin() != null)
data.append(nerd.getNickname()).append(",").append(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(nerd.getFirstJoin())).append(System.lineSeparator());
IOUtils.fileAppend("joindates.csv", data.toString());
send(PREFIX + "Generated joindates.csv");
}
use of gg.projecteden.nexus.models.nerd.NerdService in project Nexus by ProjectEdenGG.
the class BadgeCommand method convert.
@Async
@Permission(Group.ADMIN)
@Path("convert")
void convert() {
int i = 0;
int owned = 0;
int active = 0;
final List<Nerd> nerds = new NerdService().getAll();
send(PREFIX + "Converting checkmarks");
for (Nerd nerd : nerds) {
if (!LuckPermsUtils.hasPermission(nerd, "donated"))
continue;
final BadgeUser user = service.get(nerd);
user.give(Badge.SUPPORTER);
++owned;
if (nerd.isCheckmark()) {
user.setActive(Badge.SUPPORTER);
++active;
}
if (++i % 25 == 0)
send(PREFIX + "Converted &e" + i + "&3/&e" + nerds.size());
}
service.saveCache();
send(PREFIX + "Completed; &e" + owned + " &3owned, &e" + active + " &3active");
}
use of gg.projecteden.nexus.models.nerd.NerdService in project Nexus by ProjectEdenGG.
the class NerdListener method onJoin.
@EventHandler
public void onJoin(PlayerJoinEvent event) {
NerdService service = new NerdService();
Nerd nerd = Nerd.of(event.getPlayer());
nerd.setLoginLocation(event.getPlayer().getLocation());
service.save(nerd);
}
Aggregations