Developers
Main | Advantages | Usage | Developers
Just in case another developer ever wanted to use this to make their own plugin, (Wouldn't that be great for mini-games? Imagine automatic displays of changing Minecraft text in your mini-game!) I have created some basic API inside the plugin to allow other plugins to easily use BlockPrinter. To access BlockPrinter API, first create a new "Text" object...
Text text = new Text(String message, String direction);
The message string is the message the text will print. The direction is the direction the text prints in. (North, south, east, or west, caps don't matter) Creating a print object will not actually print the text. Next, you need to set the location it will print at...
text.setLocation(Location loc);
That is the location the text will print at. (You never would have guessed that, huh? =P) After you have set the location, now you need to set the material it will print in.
text.setMaterial(Material mat);
After you have set the material, another optional thing you can add is data...
text.setData(Byte b);
Now that you have set all the required items for the Text object, use the print() method to print it.
text.print();
That will place the blocks to form the text. In order to use this method, you must at least define a location and a material to print in, or it will throw a NullPointerException. After printing, the Text object will automatically write temporary data about changed blocks, so you can easily undo it later with the undo() method.
text.undo();
You may see some methods and public variables that are defined as single letters. They are just data/methods used by the more obvious methods, so you can ignore them.
Comments