1 |
package dk.thoerup.bukkit.hoeruputils; |
package dk.thoerup.bukkit.hoeruputils; |
2 |
|
|
|
import java.io.File; |
|
|
import java.io.IOException; |
|
|
|
|
|
import org.bukkit.ChatColor; |
|
|
import org.bukkit.Location; |
|
|
import org.bukkit.World; |
|
3 |
import org.bukkit.command.Command; |
import org.bukkit.command.Command; |
4 |
import org.bukkit.command.CommandExecutor; |
import org.bukkit.command.CommandExecutor; |
5 |
import org.bukkit.command.CommandSender; |
import org.bukkit.command.CommandSender; |
6 |
import org.bukkit.entity.Player; |
import org.bukkit.entity.Player; |
|
import org.bukkit.plugin.Plugin; |
|
|
import org.bukkit.configuration.Configuration; |
|
|
import org.bukkit.configuration.file.YamlConfiguration; |
|
7 |
|
|
8 |
public class GcCommand implements CommandExecutor { |
public class GcCommand implements CommandExecutor { |
9 |
|
|
11 |
public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { |
public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { |
12 |
|
|
13 |
if ( sender instanceof Player) { |
if ( sender instanceof Player) { |
14 |
sender.sendMessage("gc can only be called from console!"); |
if ( ! sender.isOp() ) { |
15 |
return false; |
sender.sendMessage("gc can only be called from console - or by a server operator"); |
16 |
|
return false; |
17 |
|
} |
18 |
} |
} |
19 |
|
|
20 |
System.gc(); |
System.gc(); |