Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.acuddlyheadcrab.AcuddlyTrading;
- import java.util.logging.Logger;
- import org.bukkit.Server;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.event.Event.Priority;
- import org.bukkit.event.Event.Type;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.getspout.spoutapi.gui.GenericLabel;
- import org.getspout.spoutapi.gui.GenericPopup;
- import org.getspout.spoutapi.gui.InGameHUD;
- import org.getspout.spoutapi.gui.Label;
- import org.getspout.spoutapi.gui.Widget;
- import org.getspout.spoutapi.player.SpoutPlayer;
- public class AcuddlyTrading extends JavaPlugin
- {
- public static AcuddlyTrading plugin;
- public final Logger log = Logger.getLogger("Minecraft");
- public PluginManager pm;
- public final AcuddlyTradingPL playerListener = new AcuddlyTradingPL(this);
- public void onDisable()
- {
- PluginDescriptionFile plugdes = getDescription();
- this.log.info(plugdes.getName() + " is now disabled :("); }
- public void onEnable() {
- this.pm = getServer().getPluginManager();
- PluginDescriptionFile plugdes = getDescription();
- this.log.info("[" + plugdes.getName() + "] " + plugdes.getVersion() + " - by acuddlyheadcrab - is enabled");
- this.pm.registerEvent(Event.Type.PLAYER_INTERACT_ENTITY, this.playerListener, Event.Priority.Normal, this);
- this.pm.registerEvent(Event.Type.PLAYER_JOIN, this.playerListener, Event.Priority.Normal, this);
- }
- public long longSeconds(int x)
- {
- long z = x * 20;
- return z;
- }
- public boolean onCommand(CommandSender cmdsndr, Command cmd, String commandLabel, String[] args) {
- Boolean one = Boolean.valueOf(cmd.getName().equalsIgnoreCase("showgui"));
- Boolean two = Boolean.valueOf(cmdsndr instanceof Player);
- Boolean three = Boolean.valueOf(cmdsndr instanceof SpoutPlayer);
- Boolean no_args = Boolean.valueOf(args.length < 1);
- if (no_args.booleanValue()) return false;
- Boolean argsnull = Boolean.valueOf(args[0] != null);
- Boolean cmdarg1 = Boolean.valueOf((argsnull.booleanValue()) && (args[0].equalsIgnoreCase("test")));
- if (one.booleanValue()) {
- if (two.booleanValue()) {
- if (three.booleanValue()) {
- if (no_args.booleanValue()) return false;
- SpoutPlayer player = (SpoutPlayer)cmdsndr;
- if (cmdarg1.booleanValue())
- {
- player.sendMessage("derp");
- GenericPopup popup = new GenericPopup();
- GenericLabel label = new GenericLabel();
- label.setAuto(false).setX(10).setY(10).setWidth(100).setHeight(30);
- popup.attachWidget(plugin, label);
- player.getMainScreen().attachPopupScreen(popup);
- return false;
- }
- return false;
- }
- cmdsndr.sendMessage("You must have Spoutcraft to do this!"); return true; }
- cmdsndr.sendMessage("You must be a player to do this!"); return true; }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement