Exemplo n.º 1
0
 @Listener(order = Order.FIRST)
 public void onPlayerChat(MessageChannelEvent.Chat event, @First Player player) {
   String message = event.getRawMessage().toPlain();
   if (player.getUniqueId().equals(uuid)) {
     if (message.equalsIgnoreCase("[cancel]")) {
       // Cancel the creation
       cancel();
       player.sendMessage(messages.getMessage("creation.cancelled"));
     }
   }
 }
Exemplo n.º 2
0
 public CreatingJob(UUID uuid) {
   this.uuid = uuid;
   // Add tasks
   addTasks(
       new NameTask(this),
       new MaxLevelTask(this),
       new ColorTask(this),
       new BlockDataTask(this),
       new BreakTask(this),
       new PlaceTask(this),
       new KillTask(this),
       new SilkTouchTask(this),
       new WorldGenTask(this),
       new FinalTask(this));
   // Send cancel message
   for (Player player : Sponge.getServer().getOnlinePlayers()) {
     if (player.getUniqueId().equals(uuid))
       player.sendMessage(messages.getMessage("creation.cancel"));
   }
   // Register listener
   Sponge.getEventManager().registerListeners(JobsLite.getInstance(), this);
   // Start task
   nextTask();
 }