[ADMN/GEN/INFO] WorldSize v1.0 - Check the size of your world ingame [1000]

Discussion in 'Inactive/Unsupported Plugins' started by badbh222, May 11, 2011.

  1. Offline

    badbh222

    WorldSize - Check the size of your world ingame.
    Version: 1.0


    Description:

    WorldSize is my first plugin, it can be used in 2 ways, one reads the folder names specified in "Worlds.txt" and then broadcasts them to the server, the second takes the arguments from the "/worldsize" command to find the size of that folder alone.

    There are also commands to add and remove folder names from "Worlds.txt" ingame and also to add and remove aliases for each folder.

    Big thanks to Sammy for helping me get this working in the end. :D


    Basic Usage:

    Drop "WorldSize.jar" in the "plugins" directory and restart the server or reload the plugins.
    A folder appropriately named "WorldSize" will be created in the "plugins" directory along with a text file named "WorldSize.txt".
    Open "WorldSize.txt" in any text editor and enter the name(s) of the folder(s) you wish to get the size of, each on their own line, you can use any folder in the servers main directory such as "plugins" and the world folder, and also subfolders such as "plugins/WorldSize".
    Since version 0.4, you can specify aliases for your folders by separating the folder and the alias you want for that folder with a colon ":".
    For example, I have 3 folders in my server's main directory "world", "world_nether" and "plugins". But I also want to get the size of "plugins/WorldSize" and instead of having it show "world: x megabytes" and "world_nether: x megabytes" I want it to show cool names, like "Minecraftville 2020: x megabytes" and "The Nether: x megabytes", to do this, I need to specify aliases for "world" and "world_nether".
    My "Worlds.txt" file would look like this:

    Code:
    world:Minecraftville 2020
    world_nether:The Nether
    plugins
    plugins/WorldSize
    
    Then, while ingame, I would type "/worldsize" into chat. Each folder, followed by its size, will be be broadcast to every player currently on the server, for example:

    Minecraftville 2020: x megabytes
    The Nether: x megabytes
    plugins: x kilobytes
    plugins/WorldSize: x kilobytes

    You could also type the name of one folder after "/worldsize" to get the size of just that folder. Eg. "/worldsize plugins" which will broadcast the size of the "plugins" folder and none of the folders from "Worlds.txt". Subdirectories will work. Folders with spaces in them need special care, if I had a folder named "My Folder" in my server's main directory, I won't be able to type "/worldsize My Folder" to get the size of it, instead, in place of all the spaces, I would type a colon ":". Eg. "/worldsize My:Folder" the colon will then be read as a space, and this will be broadcast:

    My Folder: x megabytes

    Since version 0.9, you can type "/worldsize help" or "/worldsize ?" for the list of commands. Hopefully no one has folders named "help" or "?". :rolleyes:


    Permissions:

    Currently only officially supporting Permissions 2.x, will update when my server upgrades to 3.x, but it might still work, who knows...

    To use any of the commands this plugin provides, the player must be an Op, or have the corresponding permission node(s).

    If Permissions is not installed, the player must be an Op to use any commands.


    Commands:

    • /worldsize - Shows the size of all folders in "Worlds.txt"
      • 'worldsize.list'
    • /worldsize <FolderName> - Shows the size of <FolderName>
      • 'worldsize.single'
    • /worldsize add <FolderName> - Adds <FolderName> to "Worlds.txt"
      • 'worldsize.add'
    • /worldsize remove <FolderName> - Removes <FolderName> from "Worlds.txt"
      • 'worldsize.remove'
    • /worldsize alias <FolderName> <Alias> - Adds an alias to <FolderName>
      • 'worldsize.alias'
    • /worldsize alias <FolderName> - Removes the alias for <FolderName>
      • 'worldsize.alias'
    • /worldsize help or /worldsize ? - Shows the list of commands
      • No permissions required

    Adding/removing folders or aliases work the same as getting the size of a single folder, colons ":" must be used in place of spaces. Eg. "/worldsize add folder:with:spaces" will add the folder "folder with spaces" to "Worlds.txt"
    "/worldsize alias world Awesome:Minecraft:World" will give the "world" folder the alias "Awesome Minecraft World".
    If you want to remove a folder that has been given an alias, you simply need to type "/worldsize remove <FolderName>", you do not need to type the alias as well.


    Features:
    • (0.1) My first plugin! :D
    • (0.1) Shows the size of any folder specified in "Worlds.txt" in the correct units: kilobyte(s), megabyte(s) and gigabyte(s) (Bigger/smaller units can be added if needed (why?))
    • (0.1) "Worlds.txt" is read each time the command is run; meaning you don't have to restart your server or reload your plugins to get the sizes of more/different folders.
    • (0.4) Per-folder aliases. See above for usage.
    • (0.5) Permissions support. See above for usage.
    • (0.6) Get the size of a single folder. See above for usage.
    • (0.8) Ingame commands to add or remove folder names and aliases. See above for usage.
    • (0.9) Ingame help menu. See above for usage.
    • (1.0) Commands now work from the server console... again

    Download:

    WorldSize.jar - Hosted by Dropbox [diamond]


    Known Problems:
    • None, let me know if you find any.

    Possible Features:
    • Suggestions?

    Changelog:

    Version 1.0
    • Re-added the ability to use the commands from the console.
    • Fixed a bug where the console feedback for "/worldsize" was stuck in a while loop, repeating for each folder in "Worlds.txt".
    • Something else that I can't remember, I should keep track of what I do... :rolleyes:
    • Shortened the code by a few lines... then added 200 or so.
    • This will be the final release unless a quick bug fix is needed or if I think of an awesome feature to add. (Or if it breaks in a Bukkit update. (Unlikely))
    Version 0.9
    • Added an ingame help menu, showing the list of commands.
    • Added some user feedback for incorrect commands. Eg. "/worldsize add" with no arguments tells you to put some arguments.
    • Getting the size of a single folder with "/worldsize <FolderName>" now needs the 'worldsize.single' permission node.
    Previous Versions (open)

    Version 0.8.1
    • Fixed adding/removing folder names or aliases ingame. Mostly.
    Version 0.8
    • Added commands for adding and removing folder names.
    • Added commands for adding and removing aliases for each folder.
    • Fixed not being able to get the size of a single folder with spaces using "/worldsize <FolderName>" when permissions was disabled.
    • A bunch of other stuff that I really can't remember. :D
    Version 0.7.2
    • Changed console feedback once again, last time... I think.
    Version 0.7.1
    • Fixed errors being thrown when trying to run the command from the console, now simply says you can't.
    • Fixed the console feedback added in v0.7 which would only display when permissions was being used.
    Version 0.7
    • Fixed getting the size of folders with spaces in them using "/worldsize <FolderName>"... somewhat. See above.
    • Added some console feedback upon using a command. Eg. "badbh222 used /worldsize" or "badbh222 used /worldsize plugins".
    Version 0.6
    • Added a command to get the size of a single folder.
    Version 0.5
    • Permissions support implemented.
    • Defaulting to Op only to use the command, instead of anyone.
    Version 0.4
    • Added the ability to specify aliases for folders.
    Version 0.3
    • Added "Warning: No folders are specified in Worlds.txt" message which is self explanatory.
    • Added "Warning: There should be no blank lines in Worlds.txt" message which is also self explanatory.
    Version 0.2
    • Fixed getting the size of folders with spaces in them. Oops. :rolleyes:
    • Added "Warning: <FolderName> does not exist" message when trying to get the size of a non-existent folder.
    • Cleaned up the code a little bit.
    Version 0.1
    • Initial release. [diamond]
     
    iCloakz likes this.
  2. Offline

    Juze

    Oh nice, exactly what I'll need (kind of). Permissions support?
     
  3. Offline

    badbh222

    0.5 Released.

    Permissions support and defaulting to Op only instead of anyone if Permissions is not installed.
     
  4. Offline

    FOOD

    or you can just hold the mau5 over it and see its size?
     
  5. Offline

    badbh222

    I suppose people hosting local servers could do that very easily, this plugin is just a way to do it without being at the server machine or through an FTP client or similar and/or to make it easier for people to see the size of their world ingame, and how fast it grows, like myself.

    It is also a great way for me to learn Java in general.

    If you have no need for this plugin, don't use it, however, I do hope others find it useful.


    Side note: 0.8.1 Released, fixing the bugs from 0.8. Mostly.
     
  6. Offline

    jmg27

    great! this is exactly what I was looking for, i'll try it out soon.
     
  7. Offline

    noahwhygodwhy

    this is nice, maybe a future feature would be to cap the size? first land discovered gets the memory?
     
  8. Offline

    badbh222

    Uhhh, all this plugin does is broadcast the size of the folders (or files, if you want) that you specify, it has nothing to do with the actual worlds or maps... :confused:
     
  9. Offline

    noahwhygodwhy

    yea...guess i am kinda wishing, but knowing the world size is still a nice feature.
     

Share This Page