[OUTDATED] Coming from Bukkit? Here's Some Tips and Tricks to Get you Started

Will Sponge have an easy file creation/editing method? Or would we have to create our own methods to use files…?

It’s in discussion, but according to the talk, yes, it will have easy file creation/editing methods (at least for the config files). However we’ll just have to wait and see.

3 Likes

Can’t you just java to create a new file, and load that somehow avaiable for us to edit?

  File playerconfig = new File(emp.getDataFolder() + File.separator  + "userdata" 
                 + File.separator + playername + ".yml"); 
    if (!playerconfig.exists()) {
        playerconfig.createNewFile();
    config = YamlConfiguration.loadItSomeHow(playerconfig);

config.editWhatever

I think that’ll be a nice idea, using java as a means to create the file, anyway

So basically end up the same as the Bukkit configuration system?

Kind of, the only thing you have to change is how you load and edit it.

Seems like there is only an init event for the plugin when the server is started. Will there be an independent plugin enable event (as it was in bukkit)? I liked the ability in bukkit to load and unload plugins selectively using plugman although that didn’t work for all plugins. Thanks.

Edit: just saw Plugin reloading/enabling

THANK GOD, no more plugin.yml files.

The major problem there with the Bukkit configuration system was that at least 75% of the plugin developers did NOT understand the system.

2 Likes

All you’re really doing is getting and setting plugin paths and putting values in there, doesn’t seem to hard but…I guess you were a bukkit documenter correct? I’ll take your word for it…

That’s kind of sad :confused:
Especially when the documentation for configuration actually kicked ass. I think my only problem with the documentation was serializing objects, other than that it nailed it and made perfectly clear how to use it.

Its true that 83% of statistics are made up on the spot. But on a serious note, I honestly find it hard to believe 75% had issues with it, it was very simple to use and understand. I believe most of the Bukkit staff was prone to overgeneralizing the majority with things like this based on the few that met the generalization… I hope this community doesnt end up like that. I hated seeing staff talk down to others like that instead of helping them out.

3 Likes

With the @Plugin design, my first impression is that more than one plugin can exist within a single built jar. Is this the case?

Right now it appears so.

I really love the @Plugin feature it prevents as well scammers from taking plugins from others and just editing the plugin.yml. Really loving the work being put on Sponge. Will be doing some PRs soon :smiley:

1 Like

The population sampled is very narrow being the forums.

The more important point is that a majority of the problems in the forums were lack of understanding how defaults work and the number of copies of the data.

Trueché, sir! I remember our IRC conversation about number of copies. I’m not going to lie, I still don’t fully grasp that one lmao :stuck_out_tongue:

The one thing that comes to mind if there is no yaml whatsoever, is how the user of the plugin is going to configure the plugin before the plugin runs. Not saying yaml was the best decision, I hated it, but this thought just crossed my mind.

Same way they do with Forge mods i would imagine. Forge already has config capabilities, it would be silly of the Sponge team to not use that.

Oh oh, did not know this. Then yes, get rid of it all! >:D

I always liked YAML for it’s config and it was more of a standard config. Sponge can set it’s own standard config, like XML or whatever Forge uses. Each programmer could use their own config but a standard would be nice so there will be less confusion for server owners who don’t know any languages, and YAML is good with that as it’s made for non-programmers(note why it’s called an “human-readable data serialization format”)

1 Like