Permalink
Browse files

Added new getDefaultWorldGenerator method to Plugin

  • Loading branch information...
1 parent 90ca47e commit 5738f2e6fe5d06394695df238c57b3e10ec4d063 @Dinnerbone Dinnerbone committed Jun 22, 2011
@@ -4,6 +4,7 @@
import java.io.File;
import org.bukkit.Server;
import org.bukkit.command.CommandExecutor;
+import org.bukkit.generator.ChunkGenerator;
import org.bukkit.util.config.Configuration;
/**
@@ -88,4 +89,13 @@
* @return Ebean server instance
*/
public EbeanServer getDatabase();
+
+ /**
+ * Gets a {@link ChunkGenerator} for use in a default world, as specified in the server configuration
+ *
+ * @param worldName Name of the world that this will be applied to
+ * @param id Unique ID, if any, that was specified to indicate which generator was requested
+ * @return ChunkGenerator for use in the default world generation
+ */
+ public ChunkGenerator getDefaultWorldGenerator(String worldName, String id);
}
@@ -13,6 +13,7 @@
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
+import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginLoader;
@@ -232,6 +233,11 @@ public PluginCommand getCommand(String name) {
public void onLoad() {} // Empty!
+ public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
+ getServer().getLogger().severe("Plugin " + getDescription().getFullName() + " does not contain any generators that may be used in the default world!");
+ return null;
+ }
+
public final boolean isNaggable() {
return naggable;
}

0 comments on commit 5738f2e

Please sign in to comment.