Level-Specific Plugin Data

Discussion in 'Plugin Development' started by azoundria, Feb 1, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    azoundria

    In server.properties, there is a line for example:
    level-name=world5

    This allows multiple levels to exist on the same server.

    I am building a town mod, which keeps track of towns. They consist of a location, radius, depth, and name. On a different level, the towns would be in irrelevant places. Some would be underground, suffocating you when you tried to warp there, while others would be at high altitude, and you would take a lot of fall damage when you warped there.

    So, when you want to load a new level, you need to clear your configuration. If you revert, you need to load that same configuration you had already. If you want to send a particular world to your friend, you'd need to include all the configuration for those towns and special instructions of where to place it. If they are also using the town mod, they need to keep track of their towns and yours separately.

    Other mods have level-specific data. For example, the data of your chests you've locked in world1 will not help in world2. If you add protection to a block in world5, you wouldn't also want it protected in world3.

    At the moment, the general standard appears to be storing this data inside the /plugins/Plugin/ folder along with all the global settings (which may be relevant to more than one level). My proposed idea would be to store this data instead in the level folder. So:
    /world5/plugindata/Plugin/

    I would like to know what would be the general reaction to this idea, and if someone can see anything I may have overlooked?

    Also, would it be possible to add a getLevelName() to the Server and/or World class? This would fetch for example 'world5', and I would not have to manually read the server.properties file with my code, something Minecraft already did when starting up.
    --- merged: Feb 2, 2011 7:18 AM ---
    Sorry. I'd really love to know what you guys think. If you have any questions, then do let me know.
     
Thread Status:
Not open for further replies.

Share This Page