예제 #1
0
 /**
  * Removes a custom biome.
  *
  * @param customBiome The custom biome to remove.
  */
 public void removeCustomBiome(CustomBiome customBiome) {
   for (Iterator<CustomBiome> i = customBiomes.iterator(); i.hasNext(); ) {
     CustomBiome existingCustomBiome = i.next();
     if (existingCustomBiome.getId() == customBiome.getId()) {
       i.remove();
       for (CustomBiomeListener listener : listeners) {
         listener.customBiomeRemoved(customBiome);
       }
       return;
     }
   }
   throw new IllegalArgumentException(
       "There is no custom biome installed with ID " + customBiome.getId());
 }
예제 #2
0
 public void setCustomBiomes(List<CustomBiome> customBiomes) {
   List<CustomBiome> oldCustomBiomes = this.customBiomes;
   this.customBiomes = customBiomes;
   if (oldCustomBiomes != null) {
     for (CustomBiome customBiome : oldCustomBiomes) {
       for (CustomBiomeListener listener : listeners) {
         listener.customBiomeRemoved(customBiome);
       }
     }
   }
   if (customBiomes != null) {
     for (CustomBiome customBiome : customBiomes) {
       for (CustomBiomeListener listener : listeners) {
         listener.customBiomeAdded(customBiome);
       }
     }
   }
 }