13
0
geforkt von Mirrors/Paper

Added new getDefaultWorldGenerator method to Plugin

By: Dinnerbone <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-06-22 18:26:32 +01:00
Ursprung ba32a78b3b
Commit 22bfa512a9
2 geänderte Dateien mit 16 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -4,6 +4,7 @@ import com.avaje.ebean.EbeanServer;
import java.io.File; import java.io.File;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.util.config.Configuration; import org.bukkit.util.config.Configuration;
/** /**
@ -88,4 +89,13 @@ public interface Plugin extends CommandExecutor {
* @return Ebean server instance * @return Ebean server instance
*/ */
public EbeanServer getDatabase(); 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);
} }

Datei anzeigen

@ -13,6 +13,7 @@ import org.bukkit.Server;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand; import org.bukkit.command.PluginCommand;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginLoader; import org.bukkit.plugin.PluginLoader;
@ -232,6 +233,11 @@ public abstract class JavaPlugin implements Plugin {
public void onLoad() {} // Empty! 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() { public final boolean isNaggable() {
return naggable; return naggable;
} }