Advertisement
Guest User

Untitled

a guest
May 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. if (e.getType().getName().contains("chattingnpc")) {
  2. //Dragon Trainer - Trigger NPC, outside the event
  3. if (npcLoc.getBlockX() == -1210 && npcLoc.getBlockY() == 60 && npcLoc.getBlockZ() == 4794) {
  4. event.setCancelled(true);
  5. LocalDateTime then = LocalDateTime.now().plusHours(18);
  6. ConfigurationNode nodeTimer = accountManager.getAccountsConfig().getNode(uuid.toString(), "Kanto Misc Timer", "Dragon Trainer", "then");
  7. if (LocalDateTime.now().isAfter(LocalDateTime.parse(nodeTimer.getString())) ||
  8. accountManager.getAccountsConfig().getNode(uuid.toString(), "Kanto Misc Timer", "Dragon Trainer", "then".toString()).getValue().equals("2000-01-07T01:01:01.01")) {
  9. 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!"));
  10. accountManager.getAccountsConfig().getNode(uuid.toString(), "Kanto Misc Timer", "Dragon Trainer", "then".toString()).setValue(then.toString());
  11. accountManager.saveConfig();
  12. Location<World> dtRoom = new Location<World>(world, -1579, 63, -870);
  13. player.setLocation(dtRoom);
  14.  
  15. } else {
  16. 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!"));
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement