Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Fupery.MapCreateTest;
- import org.bukkit.command.PluginCommand;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin
- {
- public void onEnable()
- {
- getCommand("mapTest").setExecutor(new Executor(this));
- }
- public void onDisable() {}
- class Executor implements CommandExecutor
- {
- Executor(Main this) {}
- public boolean onCommand(CommandSender sender, Command command, String s, String[] args)
- {
- World world;
- if (args.length > 0) {
- world = Bukkit.getWorld(args[0]);
- }
- else {
- World world;
- if ((sender instanceof Player)) {
- world = ((Player)sender).getWorld();
- }
- else
- {
- return false;
- }
- }
- World world;
- sender.sendMessage("---Starting Map Test---");
- for (int i = 0; i < 5; i++) {
- MapView mapView = Bukkit.createMap(world);
- sender.sendMessage(String.format("%s) mapID: %s, hashCode: %s", new Object[] {
- Integer.valueOf(i), Short.valueOf(mapView.getId()), Integer.valueOf(mapView.hashCode()) }));
- }
- sender.sendMessage("---------------------");
- return true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment