Advertisement
acuddlyheadcrab

Untitled

Nov 13th, 2011
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.acuddlyheadcrab.AcuddlyTrading;
  2.  
  3. import java.util.logging.Logger;
  4. import org.bukkit.Server;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.event.Event.Priority;
  9. import org.bukkit.event.Event.Type;
  10. import org.bukkit.plugin.PluginDescriptionFile;
  11. import org.bukkit.plugin.PluginManager;
  12. import org.bukkit.plugin.java.JavaPlugin;
  13. import org.getspout.spoutapi.gui.GenericLabel;
  14. import org.getspout.spoutapi.gui.GenericPopup;
  15. import org.getspout.spoutapi.gui.InGameHUD;
  16. import org.getspout.spoutapi.gui.Label;
  17. import org.getspout.spoutapi.gui.Widget;
  18. import org.getspout.spoutapi.player.SpoutPlayer;
  19.  
  20. public class AcuddlyTrading extends JavaPlugin
  21. {
  22.   public static AcuddlyTrading plugin;
  23.   public final Logger log = Logger.getLogger("Minecraft");
  24.   public PluginManager pm;
  25.   public final AcuddlyTradingPL playerListener = new AcuddlyTradingPL(this);
  26.  
  27.   public void onDisable()
  28.   {
  29.     PluginDescriptionFile plugdes = getDescription();
  30.     this.log.info(plugdes.getName() + " is now disabled :("); }
  31.  
  32.   public void onEnable() {
  33.     this.pm = getServer().getPluginManager();
  34.     PluginDescriptionFile plugdes = getDescription();
  35.     this.log.info("[" + plugdes.getName() + "] " + plugdes.getVersion() + " - by acuddlyheadcrab - is enabled");
  36.     this.pm.registerEvent(Event.Type.PLAYER_INTERACT_ENTITY, this.playerListener, Event.Priority.Normal, this);
  37.     this.pm.registerEvent(Event.Type.PLAYER_JOIN, this.playerListener, Event.Priority.Normal, this);
  38.   }
  39.  
  40.   public long longSeconds(int x)
  41.   {
  42.     long z = x * 20;
  43.     return z;
  44.   }
  45.  
  46.   public boolean onCommand(CommandSender cmdsndr, Command cmd, String commandLabel, String[] args) {
  47.     Boolean one = Boolean.valueOf(cmd.getName().equalsIgnoreCase("showgui"));
  48.     Boolean two = Boolean.valueOf(cmdsndr instanceof Player);
  49.     Boolean three = Boolean.valueOf(cmdsndr instanceof SpoutPlayer);
  50.  
  51.     Boolean no_args = Boolean.valueOf(args.length < 1);
  52.     if (no_args.booleanValue()) return false;
  53.     Boolean argsnull = Boolean.valueOf(args[0] != null);
  54.     Boolean cmdarg1 = Boolean.valueOf((argsnull.booleanValue()) && (args[0].equalsIgnoreCase("test")));
  55.  
  56.     if (one.booleanValue()) {
  57.       if (two.booleanValue()) {
  58.         if (three.booleanValue()) {
  59.           if (no_args.booleanValue()) return false;
  60.           SpoutPlayer player = (SpoutPlayer)cmdsndr;
  61.  
  62.           if (cmdarg1.booleanValue())
  63.           {
  64.             player.sendMessage("derp");
  65.  
  66.             GenericPopup popup = new GenericPopup();
  67.             GenericLabel label = new GenericLabel();
  68.             label.setAuto(false).setX(10).setY(10).setWidth(100).setHeight(30);
  69.  
  70.             popup.attachWidget(plugin, label);
  71.  
  72.             player.getMainScreen().attachPopupScreen(popup);
  73.  
  74.             return false;
  75.           }
  76.  
  77.           return false;
  78.         }
  79.         cmdsndr.sendMessage("You must have Spoutcraft to do this!"); return true; }
  80.       cmdsndr.sendMessage("You must be a player to do this!"); return true; }
  81.     return true;
  82.   }
  83. }
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement