Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (e.getType().getName().contains("chattingnpc")) {
- //Dragon Trainer - Trigger NPC, outside the event
- if (npcLoc.getBlockX() == -1210 && npcLoc.getBlockY() == 60 && npcLoc.getBlockZ() == 4794) {
- event.setCancelled(true);
- LocalDateTime then = LocalDateTime.now().plusHours(18);
- ConfigurationNode nodeTimer = accountManager.getAccountsConfig().getNode(uuid.toString(), "Kanto Misc Timer", "Dragon Trainer", "then");
- if (LocalDateTime.now().isAfter(LocalDateTime.parse(nodeTimer.getString())) ||
- accountManager.getAccountsConfig().getNode(uuid.toString(), "Kanto Misc Timer", "Dragon Trainer", "then".toString()).getValue().equals("2000-01-07T01:01:01.01")) {
- player.sendMessage(Text.of(TextColors.DARK_AQUA, "Pixel", TextColors.BLUE, "Built", TextColors.YELLOW, " Events", TextColors.WHITE, "] ", TextColors.GRAY, "Dragon Trainer", TextColors.WHITE, ": Have fun with my dragons!"));
- accountManager.getAccountsConfig().getNode(uuid.toString(), "Kanto Misc Timer", "Dragon Trainer", "then".toString()).setValue(then.toString());
- accountManager.saveConfig();
- Location<World> dtRoom = new Location<World>(world, -1579, 63, -870);
- player.setLocation(dtRoom);
- } else {
- player.sendMessage(Text.of("[", TextColors.DARK_AQUA, "Pixel", TextColors.BLUE, "Built", TextColors.YELLOW, " Events", TextColors.WHITE, "] ", TextColors.RED, "No sight of any dragons right now. Try again later!"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement