Plugin category: Tp/fun/admn Suggested name: CW What I want: This plugin is based on /warp - ish commands. The idea is that instead of using /warp [Place] is to have a custom command that does the EXACT same thing. So if i type /cw create port, it creates a /port. If i type /addport PvP then /port PvP i get ported to the place i did /addport PvP. So it is the same as /warp, just that you can make custom commands! Ideas for commands: /cw create [WarpName] - Creates a Custom warp. /add[WarpName] [PlaceToPort] - Adds a port to X place. /[WarpName] [place] - Tp's you to the specific place. /cw remove [WarpName] - Removes the custom warp. *Bump* Anyone have any ideas they could "put on" the request? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
And if Fyre decides not to, you can use the plugin "MyCommand" to create command aliases for /warp (for instance I use dragontravel for my homes on my server, and instead of making players use /dt home, I have an alias through MyCommand where when they type /home, it REALLY runs /dt home.) lol that was probably a bit confusing, but you should get the main idea
No need for that really, I can just use getServer().getPluginCommand(String) to check if it's taken. If it isn't I'll use PlayerCommandPreprocessEvent. Jok do you want permissions? Or should it use Op? If so what commands should be restricted to Op? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Here it is. Link Commands: /cw create <warp> - Creates a warp with the specified name. - Permission: cw.createwarps /cw remove <warp> - Removes the specified warp if it exists. - Permission: cw.removewarps /cw list - Displays a list of all warps. - Permission: cw.list /<warp> - Displays a list of all ports for the specified warp. Permission: currently none /<warp> <port> - Teleports you to the specified port of the specified warp. Permission: currently none (woops) /<warp> add <port> - Adds a port at your current location with the specified name to the specified warp. - Permissions: - cw.addports (gives permission for ALL existing warps)- cw.addports.<warp> (gives permission for only the specified warp) /<warp> remove <port> - Removes a port with the specified name from the specified warp. - Permissions: - cw.removeports (gives permission for ALL existing warps)- cw.removeports.<warp> (gives permission for only the specified warp)Any feedback shall be appreciated, also it's still not fully tested so if you find any bugs please tell me.
Fyre I like the way you've coded this... I had no idea Google's Gson was included with bukkit. On a side note there seems to be a harmless NPE when the plugin can't find the json file.
Hm? I thought I'd checked for that. And most don't know, because it's not in the API, only in craftbukkit.
Fyre 22:28:42 [SEVERE] [CustomWarps] Failed reading warps.json: 22:28:42 [SEVERE] java.lang.NullPointerException 22:28:42 [SEVERE] at me.fyre.CustomWarps.CustomWarps.loadWarps(CustomWarps.java:102) 22:28:42 [SEVERE] at me.fyre.CustomWarps.CustomWarps.onEnable(CustomWarps.java:45) 22:28:42 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215) 22:28:42 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:336) 22:28:42 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) 22:28:42 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:250) 22:28:42 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:232) 22:28:42 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:374) 22:28:42 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:361) 22:28:42 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:187) 22:28:42 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425) 22:28:42 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:490) Is this supposed to happen?
Actually that's what Ne0nx3r0 meant by a harmless NPE on startup. It tries to load the data from the newly created file. But since the file is newly created (and thus a blank, empty file), it can't find anything. However this has no effect on the functionality of the plugin, and will only happen the first time you start it up. You should never see it again. I'll fix it anyway and upload it to the same link as before though. EDIT: Fixed