[GEN] PlgEssentials v5.0 - time, give, tp, tphere, etc. [1.4]

Discussion in 'Archived: Plugin Releases' started by Plague, Jan 19, 2011.

  1. Offline

    Plague

    PlgEssentials - Essential commands for Plague's server:
    Version: v5.0

    I made this plugin for my own private server to have some basic commands under control.

    As in all my plugins, you can now edit the name of commands in plugin.yml.

    This will never support any permissions system, it is aimed at people using ops.txt.
    If you want them, there is a fork called AdminCmd.

    Commands:
    /time day|night|dusk|dawn|<raw> OR /day
    /i OR /item (id|name) [count] [damage] [player]
    /tp (player)
    /s OR /tphere (player)
    /playerlist
    /location OR /loc
    /c OR /color (colorid|colorname)
    /more
    /msg (player) (private message)
    /strike [player]
    /weather (off|calm|rain|snow|storm) [duration]
    /mob (name)
    /repair
    /setmode (survival|creative|s|c)

    Note: the creature names for /mob are CamelCase (e.g. Chicken, PigZombie). I *have* reasons for that, sorry.

    Download (source code in the .jar)
    Op-only version

    [​IMG]


    Changelog:
    Version 5.0:
    • updated to new bukkit API
    Version 4.7:
    • added /setmode command to change game mode for the caller.
    Older versions (open)

    Version 4.6:
    • added /repair command to repair any item in hand (watch out for colorables)
    Version 4.5:
    • added /mob (name) command to spawn monsters and animals
    Version 4.4:
    • fixed a bug in /msg (thanks DoodoM)
    Version 4.3:
    • /strike [player] - strikes a player with lightning (if no player given, strikes where your crosshair points)
    • /weather (off|calm|rain|snow|storm) [duration] - turn off weather (always sunny) or sets weather for a given amount of seconds (or default: 5m of bad weather 15m of good weather)
    Version 4.2:
    • fixed a bug in /item for other players (thanks Dark_Balor)
    Version 4.1:
    • /item can give to others, optional parameter [player]
    Version 4.0:
    • uses onCommand, CB 454+ compatible
    • you can edit all command names in plugin.yml/aliases:
    • added /msg command for private messages
    • code optimization
    Version 3.5:
    • added /more command (fills your hand with 64 items of what you are holding)
    • removed other features than commands (moved to PlgMisc)
    Version 3.4:
    • fixed a (possibly dangerous) bug in nick coloring
    Version 3.3:
    • fixed a bug when after respawn your name is not colored anymore
    • added coloring of slabs and doubleslabs (stone, cobblestone, sandstone, wood)
    Version 3.2:
    • Minecraft 1.3 compatible, craftbukkit 432 (actually no change needed for this)
    • slight internal code changes
    Version 3.1:
    • Updated to new craftbukkit API (300)
    Version 3.0:
    • updates for new craftbukkit API (232)
    • /item now takes block names
    • added /color to change color of wool, dyes and logs
    Version 2.2
    • bugfixes
    Version 2.1
    • Added /day alias for /time day
    • Added Login message telling how many players are on the server
    • Reformatted /location output to ## N, ## E, ## H (north, east, height)
    • Added /location line "Facing W/NW/N/NE/E/SE/S/SW"
    Version 2.0
    • added /s alias
    • new name matching
    Version 1.0
    • Initial release
     
  2. Offline

    Rodle26

    the /i and /item thing still does not work for other players.
     
  3. Offline

    Plague

    it should: /i stone 1 0 Rodle26
    if it doesn't please report and do you get the item or is it just not given to anyone? does the console report something?
     
  4. Offline

    Rodle26

    I wasn't typing the damage in the command. Thank you.
     
  5. Offline

    Andre_9796

    @Plague will you add /weather rain, snow ?
     
  6. Offline

    Plague

    Well since I am running my plugins on my server I will definitely want to control the weather.
    But it depends on bukkit if it will give me API for that.
     
  7. Offline

    Andre_9796

    Okay.
     
  8. Offline

    Andre_9796

  9. Offline

    Plague

    thanks for the link, i"I WANT the command to be in plgessentials, don't worry :)
     
  10. Offline

    Andre_9796

    Okay good to hear
     
  11. Offline

    Plague

    Okay, weather is in, but I'm not updating the main post since you should stay on 1.4 until bukkit gets recommended.

    Testing releases:
    Normal
    OPs

    Code:
    /weather (calm|rain|snow|storm) [duration]
    /strike [player]
    /weather sets the weather to sunny or rainy/snowing or storm (rain/snow + lightning), duration is in seconds (default 5minutes for bad weather, 15m for good one)

    /strike strikes a player with lightning, if no player given, it strikes where your crosshair is.
     
  12. Offline

    Plague

    Added DISABLING OF WEATHER

    Testing releases:
    Normal
    OPs

    Code:
    /weather off
    
    /weather off stops all weather changes and switches to sunny (normal) weather. After using any other /weather commands, weather is enabled again.

    Please test.


    Official version is out, enjoy!
    It's the same as last testing version, no need to redownload.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 6, 2016
  13. Offline

    Afotai

    I tried looking into the jar file if it came with an item table or something (as getting stone stairs or wooden halfsteps is a pain). I have no idea how I can find out the block names for the more complex ones.
     
  14. Offline

    Plague

    http://www.minecraftwiki.net/wiki/Data_values#Block_IDs
    just replace spaces with underscores, like "diamond_pickaxe"
     
    Afotai likes this.
  15. Offline

    Phealoon

    I tried out the weather commands and they work great except that when I set it to storm, random blocks of snow start to appear everywhere.

    -Phea
     
  16. Offline

    Plague

    Well storm starts also bad weather - rain/snow. Whether it is rain or snow is determined by the biome you are in. And in snow biomes (where it snows) the weather automatically regenerates snow on ground.

    There can be no error on my side since I only start the weather. Even bukkit cannot do this, because it only starts weather in minecraft. The problem is your world. Either it got badly edited or generated or you have snow biomes somewhere where you do not think they should be, but that's about it.
     
  17. Offline

    Tabannusi

    Any idea why, even after changing the slash-command for teleporting... it overrides Bukkit's original /tp command?

    I liked just /tp Player1 (to) Player2. =(

    Had a load of damn fun, with the lightning /strike command... until I screwed up, and made a typo, thus letting my friend know that it wasn't just "random, but incredibly accurate" lightning, rather... me spamming him with it. =(

    Other than the annoying way of teleporting (annoying, to me, as I prefer the original way... which seems to not function, with this plugin installed,) this plugin is really fun, thanks to the /strike command... as well as very useful, for the /day, and /weather commands. XD

    So, big thanks, for it. (Also - Thanks for the "cold lightning" plugin. Means I can chase people down, with lightning - wherever they are - and not worry about burning things down. =D
     
  18. Offline

    Plague

    Even if you edit the plugin.yml and remove the alias "tp"?
     
  19. Offline

    Tabannusi

    Even so, yes. I changed it to a totally different command, with no likeness, even, to "/tp," but still interfered with the regular/original /tp command. >_<

    Getting used to your teleport commands, though. They ARE quicker... I'm just more used to the old style. XD

    Love the plugin, though. I managed to trick my friend, again, and he now doesn't think I was controlling the lightning... more fun to be had. =D
     
  20. Offline

    DoodoM

    /msg command seems to omit blank spaces on messages.

    I would also like to know how does the /tp command work.

    Thanks for your support.

    UPDATE

    I have fixed it myself using Eclipse and programming in Java for the first time in my life. The problem was inside PlgEssentialsWorker.java (line 173):

    Code:
    public boolean playerMessage(Player player, String args[]) {
            Player buddy = player.getServer().getPlayer(args[0]);
            if (buddy != null) {
                String msg = "[" + ChatColor.RED + "private" + ChatColor.WHITE + "] <" +
                                player.getDisplayName() + "> ";
                for (int i = 1; i < args.length; ++i)
                    msg += args[i] + " ";
                buddy.sendMessage(msg);
                player.sendMessage(msg);
            } else
                player.sendMessage(ChatColor.RED + "Player " + ChatColor.WHITE + args[0] + ChatColor.RED + " not found!");
            return true;
        }
    I just added an space to the msg variable inside the for loop and it fixed it for me. I guess there are more elegant ways to do it, but this made the trick for me. I also changed the way the nickname is displayed on private messages.

    In conclusion:
    /msg DoodoM hi, how are you?
    then: [private] DoodoM - hi,howareyou?
    now: [private] <DoodoM> hi, how are you?

    If anyone needs the fixed PlgEssentials.jar or if you don't know how to compile it, please send me a private message and I'll send you a download link. Bug already fixed on official plugin. Thanks, Plague!
     
  21. Offline

    Plague

    Thanks for the bugreport, fixed.
    Please do not redistribute it under the same name, it could bring problems with support (sure in this case it can't, but still).
     
    DoodoM likes this.
  22. Offline

    DoodoM

    Thanks to you for your quick response. ;)

    I guess now the bug is fixed there's no need to share any modified version, because the official plugin is also fixed.
     
  23. Offline

    Unscrewed

    Hey there Plague, may I add Permission support to it soo you can add it to your topic:

    OPS only [Download]
    Permissions [Download]

    I will keep updating it as you update if you want that. :)
     
  24. Offline

    Dreadreaver

    READ THE MAINPOST >.<
     
  25. Offline

    Unscrewed

    Don't yell at me you cute little doggy made out of slimey slimeballs,
    I don't want to use the fork, I want to make it snow.
    If that isn't what you ment, talk to me like a grown-up person.
     
  26. Offline

    Plague

    exactly, read the main post, since this has already been done.

    ninja'd

    anyway the fork does update once I update so snow should be there.

    But you are free to fork if you like.

    Wait you don't want to use the existing fork and you do not even want to for yourself, so what is there to do?

    but updating for permissions == making a fork. Unless you want to do it only for your own use and then why even ask?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 6, 2016
  27. Offline

    Unscrewed

    With making a fork I ment make something that looks like your Plugin like AdminCmd.
    But I just wanted to add Permission support, yes that's called a fork too.
    Let me delete my earlier post to cleanup your topic.
     
  28. Offline

    Plague

    Added /mob command to spawn creatures.
    I know having to use CamelCase names (Chicken, Pig, PigZombie) can be annoying, but I have a reason for that. This prevents me from having to update for new creatures manually as bukkit will take care of that.
     
  29. Offline

    DoodoM

    I don't think anyway this plugin needs Permissions. This way is clean and simple. If you want to block certain commands from this plugin for normal users, you just have to use PlgDisableCmd (OP version), there's no need for any permission system. At least it works great for me.
     
  30. Offline

    Unscrewed

    Uhmm... In my server Donators get the /give and /i command.
    Soo it's needed for me, you can't just say globally that it isn't needed.
    I am using the permissions version already.
     
  31. Offline

    Trust518

    Please make a config where you enable the commands and take them off

    /time day|night|dusk|dawn|<raw> OR /day: true
    /i OR /item (id|name) [count] [damage] [player]: false
    /tp (player): true
    /s OR /tphere (player): true
    /playerlist: false
    /location OR /loc: true
    /c OR /color (colorid|colorname): false
    /more: true
    /msg (player) (private message): true
    /strike [player]: false
    /weather (off|calm|rain|snow|storm) [duration]: true
    /mob (name): false

    That would help me alot cuz there is some other plugins i have that does some of those things for me.

    Btw this new plgessentials dont work for me can som1 help?
     

Share This Page