/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GcCommand.java
ViewVC logotype

Contents of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GcCommand.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1674 - (show annotations) (download)
Fri Dec 23 10:29:00 2011 UTC (12 years, 5 months ago) by torben
File size: 877 byte(s)
gc can also be called by server operators
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 if ( ! sender.isOp() ) {
24 sender.sendMessage("gc can only be called from console - or by a server operator");
25 return false;
26 }
27 }
28
29 System.gc();
30 sender.sendMessage("ok");
31 return true;
32 }
33 }

  ViewVC Help
Powered by ViewVC 1.1.20