[Plugin Request] -Custom warps/tp's-

Discussion in 'Archived: Plugin Requests' started by Jok, May 1, 2012.

  1. Offline

    Jok

    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! :D

    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? :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  2. Offline

    Jok

    *Double bump*
    Sorry
     
  3. Offline

    SnRolls

    I can try doing that :)
     
    Jok likes this.
  4. Offline

    Fyre

    That's actually pretty simple, if SnRolls passes I'll make it for you.
     
    Jok likes this.
  5. Offline

    l4pierce

    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 :p
     
  6. Offline

    Fyre

    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.
     
    Last edited by a moderator: May 25, 2016
    Jok likes this.
  7. Offline

    Jok

    Permissions, and commands that could be restricted to op, such as /cw create and /cw remove :)
     
  8. Offline

    Fyre

    Which permissions plugin do you use?
     
  9. Offline

    Jok

    PermissionsBukkit
     
  10. Offline

    Fyre

    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) :oops:

    /<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.
     
    Ne0nx3r0 and Jok like this.
  11. Offline

    Ne0nx3r0

    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.
     
  12. Offline

    Fyre

    Hm? I thought I'd checked for that. And most don't know, because it's not in the API, only in craftbukkit.
     
  13. Offline

    Ne0nx3r0

    That is impressive, this was me when I first saw you using Gson:

    [​IMG]
     
    Jok and Fyre like this.
  14. Offline

    Jok

    Fyre

    You are my man! :D Seems so easy for you to make these plugins :p
     
  15. Offline

    Fyre

    I just have too much free time on my hands. This one still took 4-6 hours.
     
  16. Offline

    Jok

    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?
     
  17. Offline

    Fyre

    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
     
    Jok likes this.
  18. Offline

    yafos

    I've created a warp /cw create freebuild and /freebuild is not working ;(
     

Share This Page