1 |
package dk.thoerup.bukkit.hoeruputils; |
2 |
|
3 |
import java.io.File; |
4 |
import java.io.IOException; |
5 |
|
6 |
import org.bukkit.ChatColor; |
7 |
import org.bukkit.Location; |
8 |
import org.bukkit.World; |
9 |
import org.bukkit.command.Command; |
10 |
import org.bukkit.command.CommandExecutor; |
11 |
import org.bukkit.command.CommandSender; |
12 |
import org.bukkit.entity.Player; |
13 |
import org.bukkit.plugin.Plugin; |
14 |
import org.bukkit.configuration.Configuration; |
15 |
import org.bukkit.configuration.file.YamlConfiguration; |
16 |
|
17 |
public class GcCommand implements CommandExecutor { |
18 |
|
19 |
@Override |
20 |
public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { |
21 |
|
22 |
if ( sender instanceof Player) { |
23 |
sender.sendMessage("gc can only be called from console!"); |
24 |
return false; |
25 |
} |
26 |
|
27 |
System.gc(); |
28 |
sender.sendMessage("ok"); |
29 |
return true; |
30 |
} |
31 |
} |