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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3201 - (show annotations) (download)
Wed May 31 08:56:00 2017 UTC (6 years, 11 months ago) by torben
File size: 609 byte(s)
Code cleanup(still doesn't compile)
1 package dk.thoerup.bukkit.hoeruputils;
2
3 import org.bukkit.command.Command;
4 import org.bukkit.command.CommandExecutor;
5 import org.bukkit.command.CommandSender;
6 import org.bukkit.entity.Player;
7
8 public class GcCommand implements CommandExecutor {
9
10 @Override
11 public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
12
13 if ( sender instanceof Player) {
14 if ( ! sender.isOp() ) {
15 sender.sendMessage("gc can only be called from console - or by a server operator");
16 return false;
17 }
18 }
19
20 System.gc();
21 sender.sendMessage("ok");
22 return true;
23 }
24 }

  ViewVC Help
Powered by ViewVC 1.1.20