[FUN] PvPToggle v0.4.2 - Allows players to enable or disable individual PvP Status [1060]

Discussion in 'Inactive/Unsupported Plugins' started by AlexDGr8r, Aug 27, 2011.

  1. Offline

    AlexDGr8r

    PvPToggle - PvP Toggling plugin:
    Version: v0.4.2

    Please note that this is an updated plugin from sleelin who wrote the original plugin. He wrote the majority of code for this plugin. I just took upon myself to update his great plugin so other people could use it. His old thread is located here: http://forums.bukkit.org/threads/fu...e-or-disable-individual-pvp-status-860.18217/


    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.

    Features:
    • Individual, player-specific enabling or disabling of PvP
    • Global PvP control
    • World-specific PvP control
    • 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
    • Force PvP in specific worlds - make pvp untoggleable in certain worlds so that players are forced to PvP. Good for hardcore PvP worlds or faction worlds.
    Download: here
    Source: 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).
      • If you are updating from version 0.3.*, please either delete the old config file or add "forcepvp: false" below "pvpenabled:" in each world. Make sure to use appropiate spacing as well.
    • Make sure your world config files have PvP set to allowed, or this plugin won't work.
    • Also, please note that this plugin does not use the old way of permissions anymore. It uses PermissionsBukkit now.
    Configuration:
    When you start PvPToggle for the first time, it will automatically generate a configuration file. In that file you'll have something like this:
    Code:
    globalDiabled: false
    cooldown: 5
    worlds:
        world:
            logindefault: true
            pvpenabled: true
            forcepvp: false
    
    The first option (globalDiabled) which is actually a typo and means globalDisabled. If set to true, it will turn off PvP for all worlds. The second option (cooldown) is the amount of time in seconds that you want a player to stay in his current toggle before changing over. So a player will do /pvp off and it will take 5 seconds before his PvP is turned off. Same with turning on pvp.
    The rest is the list of your current worlds. Under a world you have logindefault which is what players are automatically set at when they login. The second option is pvpenabled which defines whether or not you want PvP enabled in that particular world. Then the final option is forcepvp. Forve pvp is used if you want to make players fight in that world. They cannot turn off pvp for themselves in a forced pvp world.

    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
    --------forcepvp:false
    ----testing:
    --------logindefault: true
    --------pvpenabled: true
    --------forcepvp:false
    ----herp:
    --------logindefault: false
    --------pvpenabled: false
    --------forcepvp:true
    ----derp:
    --------logindefault: true
    --------pvpenabled: true
    --------forcepvp:false

    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
    Changelog:
    Version 0.4.2:
    • Added ability to make worlds force PvP (for hardcore PvP worlds or faction worlds)
    • Updated for 1060
    Old Changelog (open)

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

    morizuki

    can u explain the configuration? i mean like what is logindefault or something like that..
     
  3. Offline

    AlexDGr8r

    Sure, added to thread above example config.
     
    morizuki likes this.
  4. Offline

    Bobsqeezeorg

    what do you mean by "Also, please note that the permissions plugin is no longer supported with this plugin. Moved over to new way of permissions."
     
  5. Offline

    Wickot

    BukkitPermissions? I believe that's what he means by the ''new way of permissions'' :D
     
  6. Offline

    AlexDGr8r

    LOL, yes. I wrote this going off of 4 hours of sleep.
     
  7. Offline

    spunkiie

    You're the man.

    Goob job
     
  8. Offline

    Stefenatefun

    Love it. Thank you for the citizens support! So many people are asking for plugins that support citizens.
     
  9. Offline

    Tha_Wolf

    For some reason in my 1.8 server it wont allow anyone to attack someone with OP status and the * permisson node. However, setting force pvp to on will allow it and prevent it based on the Gpvp status.
     
  10. Offline

    drsprite

    Can't get this to work on git-Bukkit-0.0.0-1067-g6301507-b1185jnks (MC: 1.8.1)

    PvPToggle v0.4.2

    I have pvp=true in server.properties, and my config is below. I type /gpvp on, and then when a user does /pvp on, and they go to hit someone else who has /pvp on, it says Global PVP is disabled!

    Thoughts?

    Code:
    globalDiabled: false
    cooldown: 0
    worlds:
        world:
            logindefault: false
            pvpenabled: false
            forcepvp: false
        world_nether:
            logindefault: true
            pvpenabled: true
            forcepvp: false
    
     
  11. Offline

    soccercheese

    I have 2 worlds on my server, a freebuild and a survival. I set it all up right but when i type /gpvp on Survival it says World not found. When i do /gpvp status Survival, I get the internal error occurred message.
    This message comes up in the log. Can someone help me please??

    org.bukkit.command.CommandException: Unhandled exception executing command 'gpvp' in plugin PvPToggle v0.3.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:358)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:757)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:722)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:715)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    Caused by: java.lang.NullPointerException
    at com.sleelin.pvptoggle.commands.pvpPluginCommand.isWorld(pvpPluginCommand.java:247)
    at com.sleelin.pvptoggle.commands.globalpvpPluginCommand.printWorldStatus(globalpvpPluginCommand.java:67)
    at com.sleelin.pvptoggle.commands.globalpvpPluginCommand.onCommand(globalpvpPluginCommand.java:45)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
    ... 12 more
     
  12. Offline

    Blackbirddddd

    Does it matter what it says about PVP in server.properties?
     
  13. Offline

    DaFastRapper

    When i put the pvptoggle.jar into the plugins, i get an error and it doesn't generate the config...

    17.05 15:19:34 [Server] INFO ... 27 more
    17.05 15:19:34 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    17.05 15:19:34 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    17.05 15:19:34 [Server] INFO at java.security.AccessController.doPrivileged(Native Method)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    17.05 15:19:34 [Server] INFO Caused by: java.lang.ClassNotFoundException: org.bukkit.event.player.PlayerListener
    17.05 15:19:34 [Server] INFO ... 8 more
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:144)
    17.05 15:19:34 [Server] INFO at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    17.05 15:19:34 [Server] INFO at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    17.05 15:19:34 [Server] INFO at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    17.05 15:19:34 [Server] INFO at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    17.05 15:19:34 [Server] INFO at com.sleelin.pvptoggle.PvPToggle.<init>(PvPToggle.java:44)
    17.05 15:19:34 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    17.05 15:19:34 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    17.05 15:19:34 [Server] INFO at java.security.AccessController.doPrivileged(Native Method)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    17.05 15:19:34 [Server] INFO at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    17.05 15:19:34 [Server] INFO at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    17.05 15:19:34 [Server] INFO at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    17.05 15:19:34 [Server] INFO at java.lang.ClassLoader.defineClass1(Native Method)
    17.05 15:19:34 [Server] INFO Caused by: java.lang.NoClassDefFoundError: org/bukkit/event/player/PlayerListener
    17.05 15:19:34 [Server] INFO at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
    17.05 15:19:34 [Server] INFO at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:422)
    17.05 15:19:34 [Server] INFO at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:156)
    17.05 15:19:34 [Server] INFO at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:53)
    17.05 15:19:34 [Server] INFO at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:183)
    17.05 15:19:34 [Server] INFO at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:207)
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
    17.05 15:19:34 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:148)
    17.05 15:19:34 [Server] INFO org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/bukkit/event/player/PlayerListener
    17.05 15:19:34 [Server] SEVERE Could not load 'plugins/PvPToggle.jar' in folder 'plugins'
     

Share This Page