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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GcCommand.java revision 1673 by torben, Fri Dec 23 10:27:05 2011 UTC miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/GcCommand.java revision 3201 by torben, Wed May 31 08:56:00 2017 UTC
# Line 1  Line 1 
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    
# Line 20  public class GcCommand implements Comman Line 11  public class GcCommand implements Comman
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();

Legend:
Removed from v.1673  
changed lines
  Added in v.3201

  ViewVC Help
Powered by ViewVC 1.1.20