weinberg/Actor — pull request #1 by Mitsugaru (2012-06-06 13:55:32+00:00)
Title: Logging, Config, and API changes

Here are the changes that I've made so far. I do suggest that you fix your class path should you accept this... And you ought to remove it from the remote repository. I added the Eclipse specific entries into the .gitignore file, but did not remove the files from the remote. Probably won't do that until you do as I'm not entirely sure how that is handled...

In any case, you should add in Vault as a library, since the added PermissionHandler class references it. Also, the commons-io is no longer needed.

As far as I know, I didn't modify the actual logic for actors and the API. Mostly just moved them around. Tested loading, recording, setting an actor, action record, fire, and a few other stuff. Seems to be in working order.

----

* Removed logging variable and used the JavaPlugin built-in method of getting its associated logger object.

No point in having the variable when its now built into the super class. Also, hid all log messages as a config option.

* Added a config class, so you can add entries to the normal config.yml and expand on it later on.

Config "defaults" occur in the constructor. If any entries are missing, they are added back in with their default values. boundsCheck method is to make sure that any user-given inputs (such as ints, doubles, etc) are valid inputs. If not, the associated variable should be changed to default and the user warned with a log in console. Just something to keep in mind for future use.

* Added permission nodes and uses either Vault or SuperPerms to check permissions.

Permission nodes per command are added into the plugin.yml. Each command has been updated to check their corresponding node before attempting to execute. If Vault is not available, it should default to the built-in Bukkit SuperPerms. Use of Vault is to ensure best compatibility with group permission systems.

* Restructured the API methods away from the per-command class method into a unified public static class.

Note, this does not change how other plugins interface with the previous methods. They can still grab the instance of the plugin and use the methods in there. However, may want to phase that out later on.

* Removed dependency on Apache commons-io library.

Replaced with using File.separator when necessary.

* Set all event listeners to MONITOR priority. Added option to include cancelled events, but this is disabled by default.

If an action is cancelled, the actor should not record it since it didn't happen... however, its understandable that maybe some users will still want it to be recorded, so, its now a config option.