MetadataTP
ITeleporter
Basic Description
I have tried a different approach to a teleport request system, using Bukkit's Metadata system. The request attaches a custom object to a Metadata value on a Player, which allows for easy access and a simple way of creating an accept command without the use of any Lists or Maps defined by my plugin.
My Vision
I have a vision for this plugin and all of its predecessors, and that is to make Bukkit's metadata system more popular. If you go through the Bukkit's plugin development, you'll see that not many people ask questions about it or post resources about it, or even use it much. I'd like this to change. I will be going through a large form of plugin ideas and trying to recreate them with metadata (I.E. some of Essential's commands), and will be updating the links here and on my BukkitDev account.
Detailed Description
In a developer's perspective: The interface for Entity extends Metadatable, allowing for the use of its functions. The functions provide a base for all Entities to store data about themself using Metadata, allowing for storage of Objects on Entities, and many other things. The plugin basically uses an object I made that stores the type of teleport request, who sent it, and who it is going to, and using that Object, I attach it to a Player (which has a superinterface of Entity), along with a plugin variable for identification of what plugin attached it. The object is then retrieved on a command, and logic is preformed to handle the request based on what was attached to the entity and what command they used.
Commands and Permissions
| Command | Aliases | Permission |
|---|---|---|
| /tprequestaccept | /tpra, /tpraccept | metadatatp.tpra |
| /tprequestdeny | /tprd, /tprdeny | metadatatp.tprd |
| /tphererequest | /tprh, /tprhere | metadatatp.tprh |
| /tprequest | /tpr, /tpreq | metadatatp.tpr |
Source Code
Quote from TigerReborn:I have decided to make the plugin Open Source, the GitHub Repo can be found at: https://github.com/TigerReborn/MetadataTP Note: The repo may not be updated frequently as I may forget to make pushes
Planned Features
(?) - Questioned feature
- Delays and cooldowns
- Language files to allow changing the message
- API (?)
- Update to handle Bukkit's change to UUID (?)
Suggestions
Feel free to give suggestions in the comments or on the ticket page!
-
View User Profile
-
Send Message
Posted May 20, 2014@Nonam82
The whole quoted section in the post of https://forums.bukkit.org/threads/metadata-q-a-i-wrote-the-metadata-api-ama.68447/ explains it fairly well, but the basic concept is that it allows the data to be shared easily across plugins, and Metadata allows you to attach Objects of any kind to Entities (while you could easily do the same with a UUID-Object hashmap aswell), I prefer the MetadataAPI as it reaches across plugins, extends to a variety of targets (Blocks, Worlds, Entities), and its just fun to use :P
-
View User Profile
-
Send Message
Posted May 17, 2014@TigerRebornX
What exactly is Metadata? What makes it preferrable over hashmaps in situations? I read the metadata section of the plugin tutorial but was kind of confused. I never tried it because the instructions for doing hashmaps are a lot more clear.
-
View User Profile
-
Send Message
Posted Apr 12, 2014Hope you guys enjoy messing with the plugin, please leave any bugs you find.
Remember, the Source is on Github, so feel free to poke through it if you are a developer and criticize my code :P