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

Annotation 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 - (hide annotations) (download)
Wed May 31 08:56:00 2017 UTC (7 years ago) by torben
File size: 609 byte(s)
Code cleanup(still doesn't compile)
1 torben 1673 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 torben 1674 if ( ! sender.isOp() ) {
15     sender.sendMessage("gc can only be called from console - or by a server operator");
16     return false;
17     }
18 torben 1673 }
19    
20     System.gc();
21     sender.sendMessage("ok");
22     return true;
23     }
24     }

  ViewVC Help
Powered by ViewVC 1.1.20