コード例 #1
0
  public static void updateLocationToMercury(PrisonPearl pp, PrisonPearlEvent.Type type) {
    if (plugin.isMercuryLoaded()) {
      String message = "";
      Location loc = pp.getLocation();
      message =
          type.name()
              + "|"
              + pp.getImprisonedId().toString()
              + "|"
              + pp.getImprisonedName()
              + "|"
              + loc.getWorld().getName()
              + "|"
              + loc.getBlockX()
              + "|"
              + loc.getBlockY()
              + "|"
              + loc.getBlockZ();
      message += "|" + pp.getUniqueIdentifier();

      if (type.equals(PrisonPearlEvent.Type.FREED) && plugin.getConfig().getBoolean("free_tppearl"))
        message += "|" + MercuryAPI.serverName();
      MercuryAPI.sendGlobalMessage(message, "PrisonPearlUpdate");
    }
  }
コード例 #2
0
  public static void updateAllPearlLocations() {
    List<UUID> uuids = plugin.getPrisonPearlStorage().getAllUUIDSforPearls();
    for (UUID uuid : uuids) {
      PrisonPearl pp = plugin.getPrisonPearlStorage().getByImprisoned(uuid);
      Location loc = pp.getLocation();

      if (loc instanceof FakeLocation)
        continue; // If it isn't your pearl don't worry about it.  The server that has it will send
                  // the messages.
      if (pp.getHolderPlayer()
          == null) // If they aren't being held by a player then no need to update the location.
      continue;
      String message =
          uuid.toString()
              + "|"
              + loc.getWorld().getName()
              + "|"
              + loc.getBlockX()
              + "|"
              + loc.getBlockY()
              + "|"
              + loc.getBlockZ()
              + "|"
              + pp.getUniqueIdentifier()
              + "|"
              + pp.getMotd();
      MercuryAPI.sendGlobalMessage(message, "PrisonPearlMove");
    }
  }
コード例 #3
0
 public static void returnPPSummon(UUID uuid) {
   String message = "return|" + uuid.toString();
   MercuryAPI.sendGlobalMessage(message, "PrisonPearlSummon");
 }
コード例 #4
0
 public static void denyPPSummon(UUID uuid, String reason) {
   String message = "deny|" + uuid.toString() + "|" + reason;
   MercuryAPI.sendGlobalMessage(message, "PrisonPearlSummon");
 }
コード例 #5
0
 public static void requestPPSummon(UUID uuid) {
   String message = "request|" + uuid.toString() + "|" + MercuryAPI.serverName();
   MercuryAPI.sendGlobalMessage(message, "PrisonPearlSummon");
 }
コード例 #6
0
 public static void updateTransferToMercury(UUID imprisoner, UUID pearled) {
   String message = "";
   message += imprisoner.toString() + "|" + pearled.toString();
   MercuryAPI.sendGlobalMessage(message, "PrisonPearlTransfer");
 }