Guest User

Untitled

a guest
Nov 17th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.40 KB | None | 0 0
  1. package me.Fupery.MapCreateTest;
  2.  
  3. import org.bukkit.command.PluginCommand;
  4. import org.bukkit.plugin.java.JavaPlugin;
  5.  
  6. public class Main extends JavaPlugin
  7. {
  8.     public void onEnable()
  9.     {
  10.         getCommand("mapTest").setExecutor(new Executor(this));
  11.     }
  12.  
  13.     public void onDisable() {}
  14.  
  15.     class Executor implements CommandExecutor
  16.     {
  17.         Executor(Main this) {}
  18.  
  19.         public boolean onCommand(CommandSender sender, Command command, String s, String[] args)
  20.         {
  21.             World world;
  22.             if (args.length > 0) {
  23.                 world = Bukkit.getWorld(args[0]);
  24.             }
  25.             else {
  26.                 World world;
  27.                 if ((sender instanceof Player)) {
  28.                     world = ((Player)sender).getWorld();
  29.                 }
  30.                 else
  31.                 {
  32.                     return false;
  33.                 }
  34.             }
  35.             World world;
  36.             sender.sendMessage("---Starting Map Test---");
  37.             for (int i = 0; i < 5; i++) {
  38.                 MapView mapView = Bukkit.createMap(world);
  39.                 sender.sendMessage(String.format("%s) mapID: %s, hashCode: %s", new Object[] {
  40.                 Integer.valueOf(i), Short.valueOf(mapView.getId()), Integer.valueOf(mapView.hashCode()) }));
  41.             }
  42.             sender.sendMessage("---------------------");
  43.             return true;
  44.         }
  45.     }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment