[INACTIVE][CHAT/MISC] LastCommand 1.4 - Repeat Last Command With "//" [860]

Discussion in 'Inactive/Unsupported Plugins' started by weasel5i2, Feb 17, 2011.

  1. Offline

    weasel5i2

    LastCommand - Repeat your last entered command with //.
    Version: v1.4

    Description:

    This plugin simply records the last command typed into the game by each player and re-sends it when that player types // (or /LAST or /! or /. or /L).

    These happen on a per-server-session basis, so if you reboot the Minecraft server or reload the plugin, it will lose all recorded last commands -- i.e., it doesn't save them anywhere physically. However, if a player disconnects and then logs back in, their last command will still be saved (assuming the server stays up in between)..

    Features:
    • Repeat your last entered command by typing // (or /LAST or /! or /. or /L).
    • In the console, typing these commands will list all of the connected players' stored last commands.
    Installation:
    1. Copy the JAR into your plugins folder. No configuration needed.
    Download:
    Download the Plugin (JAR) v1.4​
    Download the Plugin (ZIP) v1.4​


    Changelog:
    Version 1.4: 13-Jun-2011
    • Recompiled against latest recommended CraftBukkit build #860.
    • Looked into bug, the cmdHandler was being initially defined as a org.bukkit.command.CommandExecutor instance, rather than an instance of the CommandHandler class (which extends CommandExecutor).. Should be fixed now!
    Version 1.3: 09-Jun-2011
    • Recompiled against latest recommended CraftBukkit build #818.
    • Changed handling to CommandExecutor-implementing classes
      instead of the onCommand() event. Works as originally planned now. :)
    • Changed commands to their original intended form.
    Version 1.22: 30-Mar-2011
    • Recompiled against latest recommended CraftBukkit build #602.
    Version 1.21: 22-Mar-2011
    • Fixed a minor bug (I accidentally left a loop-prevention routine in there to thwart an infinite-loop issue I was having -- the end result of which LastCommand would only work every other time)
    • Fixed a bug with the onCommand returning the wrong booleans
    • Changed /L to /LL and /. to /.. because /L and /. weren't working for some reason.
    Version 1.2: 21-Mar-2011
    • Figured out how to intercept all player commands! Special thanks to LRFLEW, without whose command logging plugin's source I wouldn't have been able to figure it out and do this update.
    • Figured out how to dispatch commands to the server! w00t!
    • Rewrote the command handler code to work again.
    • Players are removed from command list when they disconnect.
    • Added functionality to list all players' last commands from the console.
    • Recompiled against latest recommended CraftBukkit build #556.
    Version 1.01: 24-Feb-2011
    • Removed stupidly long constructor and compiled against CB build 432
    Version 1.0: 17-Feb-2011
    • Created plugin
    To Do:
    • Add user-configurable (or admin-configurable) last command capability
    • Add Permissions, maybe?
    • Implement programmable macros: /1 /2 /3 /4 /5 /6 /7 /8 /9 /0
    • Add persistence for users' last-command (and eventually macro) data
    • Should I change this to only use // for the last command, so it doesn't interfere with other plugins?

     
    Noppoly likes this.
  2. Offline

    chibirubara

    Thanks! Will be trying and giving feedback.
     
  3. Offline

    weasel5i2

    It seems to not repeat certain plugin commands for some odd reason, I noticed.. Is this also happening for anyone else?
     
  4. Offline

    chibirubara

    worked well in most cases, i'll be leaving the minecraft scene for an uncertain amount of time however, sorry i can't be more specific.
     
  5. Offline

    Daveyo

    cool story. so this does work then orrrr?
     
    anchoredpirate likes this.
  6. Offline

    Max Black

    The problem is when I try to repeat any user specific command, at least with worldedit, the server doesn't know who to use the command on. aka /heal doesn't work..
    Good idea, hope to see some fixes.
     
  7. Offline

    Juze

    Done before, but minimal/lite port. :)
     
  8. Offline

    Daveyo

    spams console with lastcommand notfound. good idea though
     
  9. Offline

    Avis

    Doesn't this do the same thing ?
     
  10. Offline

    kwg

    agreed with worldedit. I've been busy working with other mods this weekend, but as of friday night it looked like /! wasnt putting the / on the last worldedit commands. from console it looked like it was trying to run "forestgen 15 tree 1" instead of "/forestgen 15 tree 1"

    --kai
     
  11. Offline

    weasel5i2

    I'll look into why it's being wonky and not passing the commands properly. :)
     
  12. Offline

    jmcneely

    Wow, I just installed it and everybody in my server LOVES IT!!!!!!!!!

    Thank you for making a very useful and simple command!
     
  13. Offline

    Racha

    It is not working for me ;/
     
  14. Offline

    kwg

    incoming ;)

    Code:
    21:17:57 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-474-gc3d930f-b463jnks (MC: 1.3)
    ...
    21:15:29 [SEVERE] PLAYER_COMMAND loading LastCommand v1.01 (Is it up to date?)
    java.lang.NoSuchFieldError: PLAYER_COMMAND
            at net.weasel.LastCommand.LastCommand.onEnable(LastCommand.java:34)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:414)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
     
  15. Offline

    weasel5i2

    Hmmm, it seems they removed the PLAYER_COMMAND event from the recent Bukkit builds, I need to find the alternative (and once again there is a distinct lack of documentation about this..) :p Searching the forums now...
     
  16. Offline

    kwg

  17. Offline

    weasel5i2

    OK, I finally figured out how player command handling works since the change. Now I need to re-figure-out how to send commands on behalf of a player. The old way involved passing the args to the server with setCancelled=false and reassigning the command string.. They've changed all that, but I will figure that out too. :)

    Working update to come soon.

    --- merged: Mar 2, 2011 3:55 AM ---

    Uggh. It seems that this plugin will only see commands specified in the plugin.yml file, thanks to the new Bukkit changes. I'm not entirely sure it's even possible for one plugin to "see" all commands issued to other plugins. If I specify other plugins' commands in my plugin.yml, it will break things.

    Doing some research on it now, perhaps a help thread to the Bukkit devs is in order..
     
  18. Offline

    SquallSeeD31

    Hahaha welcome to Bukkit hell!

    All the plugin devs who wanted to listen to other commands for security purposes or what-have-you are out of work for the time being.

    In all seriousness, if you *do* find a workaround, by all means please share it with the community. A fellow coder of mine really needs the ability to use dynamic commands, so he either has to use onPlayerCommand (which is now removed) or register plugin commands at runtime (Which is not currently possible).

    So, in short, I feel for you. =(
     
  19. Offline

    kwg

    so then bukkit has no way for a plugin to see what a player did? how about logs? (is digging in bukkit looking atm)
     
  20. Offline

    weasel5i2

    That is a good idea, maybe have the plugin check the server log (if that's exposed to plugins by the API -- although, if not, it's probably trivial to check the server.log file itself from within the plugin) and see if all player commands are logged there.. It looks like they are, but I'll have to double-check that..
     
  21. Hi Weasel5i2,

    Love your plugin, but what about a new version working with new Craftbukkit (514 for ex.) ?

    Cause i just update my server and it doesn't run (459 ok, but 514 no)

    Hope read you soon ! Thx for this plug.

    P.S. : Sorry for my bad english, i speak french. ;-)
     
  22. Offline

    Antari Adul

    I think its incompatible with minecartmania. Like when I use noon, it can't use noon due to essentials command. I have alot of pluggins, so its not off the end of the array. It would be even cooler if you could use /?, since you would have to use /help with essentials.
     
  23. Offline

    jmcneely

    Can you please update it with the newest craftbukkit build.
    I am using build #531 just so you know.
     
  24. Offline

    weasel5i2

    Updated and working with CB #556!

    The solution was elegantly simple:
    Code:
    getServer().dispatchCommand(CommandSender sender, String command)
    And for implementors out there, String command is the command minus the leading "/". So it would be like this:
    Code:
    String command = "give " + player.getName() + " 3 20"; // give player 20 dirt blocks
    
    boolean result = getServer().dispatchCommand((CommandSender)player, command );
    or..
    boolean result = getServer().dispatchCommand(sender, command );
    
    
    result = true if successful, false if the command failed.

    :D

    --W5i2
     
  25. Offline

    weasel5i2

    Another update.. Bugs fixed and I had to change /L to /LL and /. to /.. because they weren't working for some odd reason. Maybe some kind of plugin command conflict? But it's working now. ^_^
     
  26. Offline

    StankMeaner

    Really cool plugin, although it'd be really cool if you could maybe make it so you could right click with an item in hand and do the /last command for you rather than having to type it out.
     
  27. Offline

    Plague

    considered inactive
     
  28. Offline

    weasel5i2

    I'll update this one ASAP and also see if I can't implement CommandExecutor instead of onCommand in order to make /l and /. work again.
     
  29. Can anyone tell us if it work for CB818 ?

    Thx !
     
  30. Offline

    weasel5i2

    It's now updated for CB #818! And now // works, and the other commands
    have been changed to /L, /LAST, /. and /! ^_^

    --W5i2
     

Share This Page