About CSBF
Okay, so what does it do?
So, the tl;dr says that it assists with four things. Player data management, command flexibility, command verification, and plugin modularity.
Player Data Management
CSBF manages a data file for every player that joins the server it is running on. That means, whenever a player joins, it will look for their data file. if it cant find it, it will create a new, empty one. As any and all plugins access the same data files while using CSBF, you'll need to register your plugin a data accessor object. Through that, you can obtain player data objects that are tailored to your plugin specifically. with that in mind, while using the standard getter and setter methods, your plugin can safely use the players data object without having to worry about impeeding on another plugins data. However, there are ways to obtain and edit the raw data object. The data object uses NBT format as its data type.
Command Flexibility
When I was designing my chat channel system for my servers main plugin, one snag that i ran into was that it was an arduous affair to register new channel names on the fly. I'd have to listen to the player command preprocess event, and check the command, and cancel it if its a channel name, and blah blah blah. it was an extremely work-around way to do it, and i was completely unhappy. So i fixed it by hijacking the command map, and created methods to dynamically add, remove, create, and modify commands, on the fly!
Command Verification
After designing the new command map, I was in a fairly creative mode, and somehow came up with the idea of command verification, via command metadata. Basically, the idea is this. How much of your code is actually coming up with verification? Do you have the required number of arguments? Is the command sender a player or console? Sheesh! I applied the age old idea that "if you have to write it twice, make a method for it" to my tools. I actually call this command metadata, but in actuality, verification is a better word. There are varying levels of verification you can use. You can simply set how many arguments the command requires, and what kind of sender it requires. Or you can go deeper, and use the verification ruleset function! (more on that later!)
Plugin Modularity
A little background on me. My name is Corrie Kay (short for Coraline). I'm a (soon to be) 23 year old Java Developer. I'm technically a newbie, as I've only been coding for about a year and a half, and all of my experience is with bukkit, and maybe a little swing. I don't have a formal development education, as I've been 100% completely self taught (with some friends helping on the side sometimes). My coding practices are not the best, and they're definitely not up to industry standard. That said, everything that I've learned, I've learned through trial and error. I rarely do something just because "its how you're supposed to do it". If I do something, it's because I tried it, and it worked. That said, I've found that the best way to manage your plugins, is to keep them modular. If you have to do something, write a class that does it. Don't put everything in your main class just because your plugin is small. With the Command Executor class included with this toolset, it will really help with organizing your plugin!
Comments