9 |
import org.bukkit.command.CommandSender; |
import org.bukkit.command.CommandSender; |
10 |
import org.bukkit.entity.Player; |
import org.bukkit.entity.Player; |
11 |
|
|
12 |
|
import java.util.HashMap; |
13 |
|
|
14 |
public class GeneralContractorCommands implements CommandExecutor{ |
public class GeneralContractorCommands implements CommandExecutor{ |
15 |
|
|
16 |
|
class StoredCommand { |
17 |
|
public StoredCommand(String l, String a[]) { |
18 |
|
this.label = l; |
19 |
|
this.args = a; |
20 |
|
} |
21 |
|
public String label; |
22 |
|
public String args[]; |
23 |
|
} |
24 |
|
|
25 |
final static int Y_MAX = 255; |
final static int Y_MAX = 255; |
26 |
|
|
27 |
|
HashMap<String,StoredCommand> commands = new HashMap<String,StoredCommand>(); |
28 |
|
|
29 |
//@Override |
//@Override |
30 |
public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { |
public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { |
40 |
player.sendMessage( ChatColor.RED + "This command may only be used in creative world" ); |
player.sendMessage( ChatColor.RED + "This command may only be used in creative world" ); |
41 |
return true; |
return true; |
42 |
} |
} |
43 |
|
|
44 |
|
commands.put(player.getName(), new StoredCommand(label,args) ); |
45 |
|
|
46 |
|
if (label.equals("replay") || label.equals("*") ) { |
47 |
|
StoredCommand cmd = commands.get(player.getName() ); |
48 |
|
if (cmd != null) { |
49 |
|
label = cmd.label; |
50 |
|
args = cmd.args; |
51 |
|
} |
52 |
|
} |
53 |
|
|
54 |
//System.out.println( ">>" + label); //DEBUG |
//System.out.println( ">>" + label); //DEBUG |
55 |
|
|
182 |
for (int x=(playerX-radius); x<=(playerX+radius); x++) { |
for (int x=(playerX-radius); x<=(playerX+radius); x++) { |
183 |
for (int z=(playerZ-radius); z<=(playerZ+radius); z++) { |
for (int z=(playerZ-radius); z<=(playerZ+radius); z++) { |
184 |
//int y = getGroundLevel(x,z) - 1; |
//int y = getGroundLevel(x,z) - 1; |
185 |
int y = world.getHighestBlockYAt(x, z) - 1; |
int y = world.getHighestBlockYAt(x, z) ; |
186 |
|
|
187 |
world.getBlockAt(x, y, z).setTypeId(blockid); |
world.getBlockAt(x, y, z).setTypeId(blockid); |
188 |
} |
} |