Example #1
0
 /**
  * Called when a klaxon has been received.
  *
  * @param task the task.
  */
 private static synchronized void gotKlaxon(IDownload task) {
   String name = task.getName();
   File file = task.getFile();
   FMLLog.log(MOD_ID, Level.INFO, "Klaxon %s saved to %s", name, file.getAbsolutePath());
   // Adds the klaxon to the sound manager.
   Minecraft.getMinecraft().sndManager.addSound(name + ".ogg", file);
   // Adds to the list of loaded klaxons.
   loadedKlaxons.add(name);
   loadingKlaxons.remove(name);
 }
Example #2
0
 /** {@inheritDoc} */
 @Override
 public void onDownloadException(IDownload task) {
   if (task.getChannel().equals(MOD_ID)) {
     gotKlaxonFailed(task);
   }
 }
Example #3
0
 /**
  * Called when a klaxon has not been received because of an error.
  *
  * @param task the task.
  */
 private static synchronized void gotKlaxonFailed(IDownload task) {
   String name = task.getName();
   loadingKlaxons.remove(name);
   loadedKlaxons.remove(name);
   FMLLog.log(MOD_ID, Level.SEVERE, task.getError(), "Failed to get the klaxon %s", name);
 }