use of gg.projecteden.nexus.models.nerd.Nerd 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);
}
use of gg.projecteden.nexus.models.nerd.Nerd in project Nexus by ProjectEdenGG.
the class Justice method mute_onMinecraftChatEvent.
@EventHandler(priority = EventPriority.LOWEST)
public void mute_onMinecraftChatEvent(MinecraftChatEvent event) {
Nerd nerd = Nerd.of(event.getChatter());
if (!isNewPlayer(nerd))
return;
if (nerd.hasMoved())
return;
event.setCancelled(true);
nerd.sendMessage("&cYou must move before you can speak in chat");
String message = "&e" + nerd.getNickname() + " &ctried to speak before moving: &7" + getMessageDetails(event);
Broadcast.staff().prefix("Justice").message(message).send();
}
use of gg.projecteden.nexus.models.nerd.Nerd in project Nexus by ProjectEdenGG.
the class NerdListener method onJoin.
@EventHandler(priority = EventPriority.LOWEST)
public void onJoin(AsyncPlayerPreLoginEvent event) {
NerdService service = new NerdService();
Nerd nerd = Nerd.of(event.getUniqueId());
nerd.setLastJoin(LocalDateTime.now());
nerd.setName(event.getName());
nerd.getPastNames().add(event.getName());
service.save(nerd);
}
use of gg.projecteden.nexus.models.nerd.Nerd in project Nexus by ProjectEdenGG.
the class NerdListener method onQuit.
@EventHandler
public void onQuit(PlayerQuitEvent event) {
NerdService service = new NerdService();
Nerd nerd = Nerd.of(event.getPlayer());
nerd.setLastQuit(LocalDateTime.now());
nerd.getPastNames().add(Name.of(event.getPlayer()));
nerd.setLocation(event.getPlayer().getLocation());
service.save(nerd);
}
use of gg.projecteden.nexus.models.nerd.Nerd in project Nexus by ProjectEdenGG.
the class MapCommand method map.
@Path("[player]")
void map(@Arg(value = "self", permission = Group.STAFF) Nerd nerd) {
Location location = nerd.getLocation();
String world = location.getWorld().getName().toLowerCase();
int x = (int) location.getX();
int z = (int) location.getZ();
Map<String, String> names = new HashMap<>();
BlueMapAPI.getInstance().ifPresent(api -> api.getMaps().forEach(map -> names.put(map.getWorld().getSaveFolder().toFile().getName().toLowerCase(), map.getId())));
String URL = MapCommand.URL;
if (isStaff())
if (!names.isEmpty() && !names.containsKey(world))
URL = MapCommand.STAFF_URL;
String link = URL + "/#" + names.getOrDefault(world, world) + ":" + x + ":0:" + z + ":30:0:0:0:0:perspective";
send(json("&3Map: &e" + URL).url(URL));
send(json("&3Current Location: &e" + link).url(link));
send("&eTip: &3Zoom in, right click and drag");
}
Aggregations