/[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 1673 - (hide annotations) (download)
Fri Dec 23 10:27:05 2011 UTC (12 years, 5 months ago) by torben
Original Path: miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GcCommand.java
File size: 817 byte(s)
add a garbage collection command
1 torben 1673 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     }

  ViewVC Help
Powered by ViewVC 1.1.20