Inactive [FUN] PvPToggle v2.2.1 - Allows players to enable or disable individual pvp status [1.3.2-R1.0]

Discussion in 'Inactive/Unsupported Plugins' started by Sleelin, May 22, 2011.

  1. Offline

    Sleelin

    PvPToggle - PvP Toggling Plugin:
    Version: v2.1.0

    Project moved to BukkitDev
    (this thread will no longer be updated)

    Show Spoiler

    Allows players to decide whether or not they want PvP to be enabled or disabled, and stops PvP attacks when either the attacker or defender has PvP disabled. Also allows admins to toggle global or world-specific PvP, or the PvP status of a specific player, in a specific world. Muti-world compatible, Permissions combatible.

    Features:
    Pretty much stated above, but hey, here they are anyway:
    • Individual, player-specific enabling or disabling of PvP
    • Global PvP control
    • World-specific PvP control
    • Permissions support - only allow certain groups or players access to specific functions
    • Multiworld support - configure which world you want the plugin to be active in
    • Cooldown timer - set time since last conflict in seconds before users can disable PvP again
    Download: here (see BukkitDev)​
    Source Code: here

    Commands:
    • /pvp [on|off|status] [player] [world] - Toggles or checks status of PvP for you or a specific player
    • /tpvp [on|off|status] [player] [world] - Alias for /pvp
    • /gpvp [on|off|status] [world] - Toggles or checks status of global or world-specific PvP
    Installing:

    • Place in your Bukkit plugins folder, run/reload once, this autogenerates a config file.
    • For each world, set logindefault to either true or false depending on whether you want it enabled or disabled for each player on login, and pvpenabled to either true or false to depending on whether you want world-wide PvP enabled or disabled on startup
    • The autogenerated config file should contain a list of all your worlds, but if it doesn't, add them manually as follows:
      • Edit the config file, and add the name of each world you run under the "worlds" parameter, in the YAML format (see sample config below).
      • In addition to entering your worlds, you must also specify whether or not you want PvP to be enabled or disabled by default. To do this, under the name of the world, enter both pvpenabled and logindefault as mentioned above (see config example below).
    • Make sure your world config files have PvP set to allowed, or this plugin won't work.
    Sample Config File:

    Replace all "----" with 4 spaces (i.e. 4 of this: " ")
    Show Spoiler
    globalDiabled: false
    cooldown: 5
    worlds:
    ----world:
    --------logindefault: true
    --------pvpenabled: false
    ----testing:
    --------logindefault: true
    --------pvpenabled: true
    ----herp:
    --------logindefault: false
    --------pvpenabled: false
    ----derp:
    --------logindefault: true
    --------pvpenabled: true

    Permissions nodes:
    • pvptoggle.use
      • Enable usage of the pvptoggle plugin (i.e. status check when hit)
    • pvptoggle.command.toggle
      • /pvp [on|off]: individual pvp toggling
    • pvptoggle.command.status
      • /pvp status: check individual pvp status
    • pvptoggle.admin
      • /pvp [on|off|status] [player]: modify or check status of specific player in sender's current world
      • /pvp [on|off|status] [player] [world]: modify or check status of specific player in specified world
      • /pvp [on|off] *: modify status of all players in sender's current world
      • /pvp [on|off] * [world]: modify status of all players in specified world
    • pvptoggle.gcommand.status
      • /gpvp status: checks global pvp status
      • /gpvp status [world]: checks pvp status in specified world
    • pvptoggle.gadmin
      • /gpvp [on|off]: toggles global pvp status
      • /gpvp [on|off] [world]: toggles pvp status in specified world
    To-Do:


    - Create automatically enable PvP on combat flag

    Changelog:
    v0.3.1:
    - Added support for Citizens NPC plugin: no longer spews console errors when players attack NPCs
    v0.3.0:
    - Added option for cooldown between last conflict and disabling PvP
    - Added console support for toggling PvP status of specific players, or all players in a specific world, or across all worlds
    v0.2.5:
    - Updated multiworld support to use bukkit-dependent world detection (fixes issues with misconfiguration causing errors)
    - Swapped to YAML config file format for ease of use
    Show Spoiler
    v0.2.3:
    - Added persistence across player sessions
    - Fixed bug in /pvp with no arguments
    v0.2.1:
    - Fixed severe errors on reload (to do with initialising players)
    - Fixed /pvp status [player] [world] - it actually works now
    v0.2.0:
    - Added multiworld support
    - Tidied up command handling
    v0.1.0:
    - Initial release
     
    AS1LV3RN1NJA likes this.
  2. Offline

    Juze

    @Sleelin : Posted a moment ago, moved. :D

    EDIT: No offense to other plugin devs, I'm just doing plugin submissions fast right now.
     
  3. Offline

    Sleelin

    Woah... that was quick!
     
  4. Offline

    marco213

    I have seen a similar plugin like this, but this one is exellent because he have a config file. Nice work :D
     
  5. Offline

    Sleelin

    I thought I saw that around some place as well, but I couldn't find it, so I just wrote my own :p
     
  6. Offline

    marco213

    i got error:

    10:40:23 [SEVERE] Could not pass event PLAYER_JOIN to PvPToggle
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
    at java.util.ArrayList.RangeCheck(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at com.sleelin.pvptoggle.PvPToggle.pvpEnable(PvPToggle.java:139)
    at com.sleelin.pvptoggle.PvPTogglePlayerListener.onPlayerJoin(PvPToggleP
    layerListener.java:22)
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:232)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:289)
    at net.minecraft.server.ServerConfigurationManager.a(ServerConfiguration
    Manager.java:94)
    at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:95)
    at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:74)
    at net.minecraft.server.Packet1Login.a(SourceFile:43)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:40)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:87)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    10:40:24 [WARNING] Can't keep up! Did the system time change, or is the server o
    verloaded?
    10:40:38 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'pvp'
    in plugin PvPToggle v0.2
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85
    )
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:2
    78)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:682)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:645)

    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:639)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at com.sleelin.pvptoggle.commands.pvpPluginCommand.onCommand(pvpPluginCo
    mmand.java:26)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 12 more

    hope it is fixable
     
  7. Offline

    Sleelin

    Which version? It could be because your worlds parameter doesn't include every world you have, or it could just be you need to update to v0.2.1.
     
  8. Offline

    Delois

    Could you add a timer on of turning pvp off? Much like many mmo's have. I know some people on my server would make macros to turn it on and off real fast to kill people (Dam G12 Keyboards -_-)
     
  9. Offline

    marco213

    witch version? like my bukkit version? mine is 766. and i cant even type the command
     
  10. Offline

    Sleelin

    @marco213: no, I mean the version of my plugin. About an hour after I submitted this I had to upload a new version, as a major bug arose.

    @delois: It's planned in the near future (when I work out how to do timers in Bukkit/Java). See the To-Do section. It's probably coming in v0.3.0, which will be released within the week (I have nothing better to do :p)
     
  11. Offline

    marco213

    Work. thanks
     
    Sleelin likes this.
  12. Offline

    Jonathan Thorpe

    Great plugin, simple to use. Just created a "boxing ring" (6x6 plank base, 6x6 blue wool top, fences all around) and used the Turnstile plugin to create entry and exit points to the arena, with switch plates on either side of the turnstiles which, in conjunction with the TriggerCmd plugin, turn PvP on and off as players enter and exit the ring.
     
    firtvid20 likes this.
  13. Offline

    Nitnelave

    ToDo : persistence? remember if the player last was on or off.
     
    AS1LV3RN1NJA likes this.
  14. Offline

    G1R Productions

    13:41:28 [SEVERE] Could not pass event PLAYER_JOIN to PvPToggle
    java.lang.NullPointerException
    at com.sleelin.pvptoggle.PvPTogglePlayerListener.onPlayerJoin(PvPTogglePlayerListener.java:19)
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:243)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:302)
    at net.minecraft.server.ServerConfigurationManager.a(ServerConfigurationManager.java:94)
    at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:96)
    at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:33)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:87)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:292)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)


    13:43:53 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'pvp' in plugin PvPToggle v0.2.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:127)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:279)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:699)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:666)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:660)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:292)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at com.sleelin.pvptoggle.commands.pvpPluginCommand.onCommand(pvpPluginCommand.java:26)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 12 more
    >
     
  15. Offline

    Shuan

    This version is not compatible with 766, i keep getting errors
    Code:
    2011-05-22 18:22:45 [SEVERE] null loading PvPToggle v0.2.1 (Is it up to date?)
    java.lang.NullPointerException
        at com.sleelin.pvptoggle.PvPToggle.registerOnlinePlayers(PvPToggle.java:85)
        at com.sleelin.pvptoggle.PvPToggle.onEnable(PvPToggle.java:78)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:336)
        at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:201)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:270)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:396)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:381)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
     
  16. Offline

    Kiwii

    Cool, one of my moderators just asked for this a few days ago and we could not find a plugin for that. I will try this asap. We would need warm-up timers (so you have to wait like 20s for the setting to take effect) but that's on the list, right? (Well, would not need timers btw: on player damage just look how long ago the status has been toggled) Just two questions: Does this interfere with other plugins controling pvp like WorldGuard for example? And does this keep the players status after player logout and server restart?
     
  17. Offline

    Bronski

    Getting the same error as you guys on 766. Hopefully we'll get an update soon :)
     
  18. Offline

    Sleelin

    Everyone getting errors, please try the method detailed under the "Important" tag until I can add proper world detection.

    @Kiwii: warm up timers? I don't see much use for it, but I can look into adding the warmup time as a configurable parameter, that is, if warm up times are possible :confused:

    After the next release, provided it's stable, I will be taking a short break from this plugin to work on a small new one called MultiHealth, which in it's initial release will allow for different health across worlds.
     
  19. Offline

    Kiwii

    @Sleelin What do I have to set the 'worlds' setting to if I have multiple worlds?
    I tried to separate them with commas but that does not seem to work. And what about capital letters in world names?

    worlds=Kiwilande,SnowWorld,Deltaebene

    Bukkit build 803, PvPToggle 0.2.1

    Code:
    11:56:14 [SEVERE] Error occurred while enabling PvPToggle v0.2.1 (Is it up to date?): 1
    java.lang.ArrayIndexOutOfBoundsException: 1
            at com.sleelin.pvptoggle.PvPToggle.loadProcedure(PvPToggle.java:121)
            at com.sleelin.pvptoggle.PvPToggle.onEnable(PvPToggle.java:63)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
    EDIT: Of course, I checked the world names twice ;D
     
  20. Offline

    Sleelin

    @Kiwii: so it's fixed then?

    @Joy: I'll add /pvpt to the next release, thanks for pointing that out!

    EDIT: and by add, I mean add, not replace.

    @Nitnelave: persistence across user sessions will be added next release. I'll think about adding persistence across server sessions at a later stage, but first priority is proper world handling and then pvp sparring/warmup/cooldown.

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

    Kiwii

    @Sleelin nope, just wanted to make clear that the error is not supposed to be related to misspelling. I think I failed. xD
     
  22. Offline

    Sleelin

    @Kiwii: can you post your entire config file for me please?
    Also, did you remember to set either true or false for each world?
     
  23. Offline

    Daniel Bang

    i did that :/ cant get it working, or am i doing someathing wrong? i get same error as kiwi

     
  24. Offline

    Sleelin

    @Daniel Bang: I just added that to the installation information up the top. Can you try that and tell me if it works please?
    In any case, this error will be updated in the next release, which will automatically detect all loaded worlds.
     
  25. Offline

    Daniel Bang

    i dont get what u mean by that? could u post the config file according to the one at my other post? i dont really understand it, sry :/
     
  26. Offline

    Sleelin

    @Daniel Bang: your config file should look like this:
    Code:
    #PvPToggle Config File
    #Mon May 23 09:00:31 CDT 2011
    worldPvPStatus=true,true #here is the change
    worlds=world,nether
    defaultDisabled=false
    globalDisabled=false
     
  27. Offline

    Daniel Bang

    oh ;D

    its working now :) thank you

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

    Shuan

    Well i added the fixed config text
    Code:
    #PvPToggle Config File
    #Mon May 23 09:00:31 CDT 2011
    worldPvPStatus=true,true #here is the change
    worlds=Romev2
    defaultDisabled=false
    globalDisabled=false
    This DID solve the first error i was having
    Code:
    2011-05-22 18:22:45 [SEVERE] null loading PvPToggle v0.2.1 (Is it up to date?)
    java.lang.NullPointerException
        at com.sleelin.pvptoggle.PvPToggle.registerOnlinePlayers(PvPToggle.java:85)
        at com.sleelin.pvptoggle.PvPToggle.onEnable(PvPToggle.java:78)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:676)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:249)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:336)
        at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:201)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:270)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:396)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:381)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    But when i tried using /pvp i came across this error in console
    Code:
    2011-05-23 17:34:58 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'pvp' in plugin PvPToggle v0.2.1
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:278)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:682)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:645)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:639)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at com.sleelin.pvptoggle.commands.pvpPluginCommand.onCommand(pvpPluginCommand.java:26)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    Seems this plugin does not work for the version it was built on.
     
  29. Offline

    Sleelin

    This is incorrect, as you can see, there are others who have it working fine.
    The second problem is just a bug with v0.2.1 when you don't have any arguments after /pvp.
    This bug will be fixed in the next release.

    In the mean time, you can use /pvp [on|off|status] as it says.
     

Share This Page