--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/creative/GeneralContractorCommands.java 2012/03/12 20:25:30 1728 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/creative/GeneralContractorCommands.java 2012/03/13 07:58:31 1729 @@ -9,10 +9,22 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.HashMap; public class GeneralContractorCommands implements CommandExecutor{ + class StoredCommand { + public StoredCommand(String l, String a[]) { + this.label = l; + this.args = a; + } + public String label; + public String args[]; + } + final static int Y_MAX = 255; + + HashMap commands = new HashMap(); //@Override public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { @@ -28,6 +40,16 @@ player.sendMessage( ChatColor.RED + "This command may only be used in creative world" ); return true; } + + commands.put(player.getName(), new StoredCommand(label,args) ); + + if (label.equals("replay") || label.equals("*") ) { + StoredCommand cmd = commands.get(player.getName() ); + if (cmd != null) { + label = cmd.label; + args = cmd.args; + } + } //System.out.println( ">>" + label); //DEBUG @@ -160,7 +182,7 @@ for (int x=(playerX-radius); x<=(playerX+radius); x++) { for (int z=(playerZ-radius); z<=(playerZ+radius); z++) { //int y = getGroundLevel(x,z) - 1; - int y = world.getHighestBlockYAt(x, z) - 1; + int y = world.getHighestBlockYAt(x, z) ; world.getBlockAt(x, y, z).setTypeId(blockid); }