[MECH] DeathControl v2.1.0 - Take control over item deaths [BukkitDev]

Discussion in 'Archived: Plugin Releases' started by Bone008, Jun 22, 2011.

  1. @Revenger I see, but I think that question is outside my province. If a plugin adds additionnal elements to a player's inventory which aren't managed by the standard bukkit methods, it is apparent that it interferes with other inventory managing plugins.
    I have higher priority targets at the moment than providing special treatment for such modifications. I'm sorry.

    @Hutt132
    Yes, it does work fine with #1337. And "it" probably says that because I just (finally) created a BukkitDev page for this. It is far from being finished, though, so I'll link this thread to it when it is complete.

    @Retribution831
    Thanks :) It would be possible, but I don't think it's very reasonable in general. You probably have a use for it since you suggested it, but yeah ... I might add it sometime when the more important stuff is done.

    Development here is unfortunately going on pretty slowly at the moment. But I am still working on it, but not very quickly.
     
  2. Offline

    Hutt132

    I configured everything correctly but when I die I lose all my items and don't get them back. I even tried the command /death back.
     
  3. "I configured everything correctly" isn't exactly a statement that I can work with when trying to help you.
    How about those informations: console log, config file, what you expect your config file to do, other plugins that could interfere?
    Then I might be able to help you ...
     
  4. Offline

    DarthNomad

    I´ve got a problem on my server: when my players use /death back, it says "you´ve got your items back", but nothing happens and the items instantly drop at death location. When I use the command (I am admin), I got all my items back, but it doesn´t charge money (I use BukkitPermissions and iConomy6).
    The console says:
    22:21:17 [SEVERE] Could not pass event ENTITY_DEATH to DeathControl
    java.lang.IncompatibleClassChangeError: Expected static method com.nijikokun.reg
    ister.payment.Methods.getMethod()Lcom/nijikokun/register/payment/Method;
    at bone008.bukkit.deathcontrol.DeathControl.getRegisterMethod(DeathContr
    ol.java:229)
    at bone008.bukkit.deathcontrol.DeathManager.pay(DeathManager.java:298)
    at bone008.bukkit.deathcontrol.DeathManager.handle(DeathManager.java:117
    )
    at bone008.bukkit.deathcontrol.DeathControlEntityListener.onEntityDeath(
    DeathControlEntityListener.java:37)
    at org.bukkit.plugin.java.JavaPluginLoader$64.execute(JavaPluginLoader.j
    ava:707)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:339)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerDeathEvent(C
    raftEventFactory.java:303)
    at net.minecraft.server.EntityPlayer.die(EntityPlayer.java:160)
    at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:469)

    at net.minecraft.server.EntityHuman.damageEntity(EntityHuman.java:584)
    at net.minecraft.server.EntityPlayer.damageEntity(EntityPlayer.java:202)

    at net.minecraft.server.Entity.aa(Entity.java:271)
    at net.minecraft.server.EntityLiving.aa(EntityLiving.java:124)
    at net.minecraft.server.Entity.s_(Entity.java:192)
    at net.minecraft.server.EntityLiving.s_(EntityLiving.java:268)
    at net.minecraft.server.EntityHuman.s_(EntityHuman.java:153)
    at net.minecraft.server.EntityPlayer.b(EntityPlayer.java:215)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:305)
    at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java
    :618)
    at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java
    :500)
    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)

    I hope you can help me, your mod is great.
    Oh, and I think the new death cause for CONTACT is CACTUS, because in the help-file it still says CONTACT^^
     
  5. @DarthNomad
    That's a well-known issue with Register. One of the plugins you are using has statically included an outdated version of Register in their jar-file (without changing the namespace). That means that plugins that correctly use newer version of Register (like this one) will fail because the old Register will actually be loaded (by the other plugin that incorrectly embedded it). There's really nothing I can do about that.
    If you go ahead and find out which plugin causes that (it is likely one that uses economy somewhere), you can nag its author about that - because that's the wrong way to use Register.

    You are probably OP, that means you have the permission "deathcontrol.free" by default. If you don't want that, you can explicitly set it to false through BukkitPermissions.

    It is (also stated in the first post). I forgot to change it in help.txt in 1.3, but I fixed it in 1.31 (see changelog). However, help.txt isn't automatically updated at the moment, so you probably still have the old one.
    If you want the new one, just delete it and load the plugin (v1.31) once.
     
    DarthNomad likes this.
  6. Offline

    DarthNomad

    Ok, I have removed all plugins and downloaded them again, now it works without this error,
    all players get their items back, but it still charges no money from the players/admins, although I add the deathcontrol.free: false -node to all groups.
    The console says:
    02:41:05 [WARNING] [DeathControl] XYZ123 can't pay for his death because no econo
    my-plugin was found!

    I still use iConomy6, it works correctly with other plugins I installed (ChestShop,...)
    Thx for your help!
     
  7. Make sure you installed Register as a plugin again (you should have Register.jar in your plugins/ directory), otherwise the connection to iConomy won't work.
     
    DarthNomad likes this.
  8. Offline

    DarthNomad

    Oh, ok, it works now very well. Sry, I didn´t see that we have to use Register now.
    Thank you :)
     
  9. Offline

    jdev21

    I have register installed and it is correctly identifying ico5 on server startup. However, no money is subtracted on death. No error messages either. All items are restored correctly though. I'm using CB1.9 #21. Here is my config:
    Code:
    # ====== Settings for DeathControl ======
    # IMPORTANT: Do NOT use tabs in this file! Only use spaces!
    #
    #
    # Make sure to check the server log after editing this file! Detailed warnings will show up when you made a mistake.
    
    
    # Set to true to use native bukkit permissions (recommended)
    # Set to false if you want to use the old permissions plugin or the op system
    use-bukkit-permissions: true
    
    
    # Set to 0 if you don't want any console-log at all when a death is handled.
    # Set to 1 if you want a short notification in the console when a death is handled.
    # Set to 2 if you want a detailed report in the console when a death is handled.
    logging-level: 1
    
    
    # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    # FOR A DESCRIPTION ON HOW TO CONFIGURE THIS SECTION (which is the main part of the plugin), LOOK AT help.txt!
    # If you are upgrading from an earlier version, make sure to read the help as well, alot has changed!
    # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    #
    # The death causes that are configured by default are just usage examples, they will probably not fit your needs
    DeathCauses:
        VOID:
            keep-inventory: true
            cost: 500
            method: auto
        PLAYER:
            keep-inventory: true
            cost: 300
            method: auto
            timeout: 10
        LAVA:
            keep-inventory: true
            cost: 700
            method: auto
        SUFFOCATION:
            keep-inventory: true
            cost: 500
            method: auto
        DROWNING:
            keep-inventory: true
            cost: 500
            method: auto
        FALL:
            keep-inventory: true
            cost: 500
            method: auto
        STARVATION:
            keep-inventory: true
            cost: 500
            method: auto
        FIRE:
            keep-inventory: true
            cost: 500
            method: auto
        MOB:
            keep-inventory: true
            cost: 500
            method: auto
        UNKNOWN:
            keep-inventory: true
            cost: 500
            method: auto
        
    I have only tried dying from falling and lava to test money.
     
  10. I haven't tested this with 1.9 builds, but as there is no error it should probably work.

    That could be the case for you. If it isn't, please set "logging-level" to 2 in the config, and post what is getting dumped to the console when you die.
     
  11. Offline

    jdev21

    This was exactly the problem and I found it while reading through the rest of the replies. I'm sorry I didn't find out sooner. Everything seems to be working great now. Thank you for this great plugin! If I find any 'actual' errors with the newest dev build I'll be sure to post here.
     
  12. Offline

    Revenger

    I asked for the new backpack dev to see about stuff he sent a message on your commands page on bukkitdev saying he has a API and would be happy for you to hook into it.

    Link
     
  13. Offline

    jdev21

    I realize this plugin isn't for 1.9 but I found a bug incase you plan on upgrading. Enchanted items lose their enchantment when items are returned after death.
     
  14. Offline

    Revenger

    Supposedly users are charged regardless if they chose to get there items back or not.

    From a mod who stepped down due to not liking my changes and that I wanting more performance from the team.

    I don't know if you will find this any useful its not written how I would expect a bug report to be to pass onto you developers.

    I presume this one he waited the time limit 60 seconds.
     
  15. Offline

    Revenger

    The bug pin the post above I can confirm this is the case from the logs.

     
  16. @Revenger
    I think you are referring to the bug that money is charged when the player dies instead of when they return their items via command. I'm aware of that, it's on the To-Do list, and I already did the code fix for it, until I for some reason froze development on that build (RL issues and stuff ...).
    Thanks for the detailed error description though, it's perfect :)

    I'll go ahead and hopefully finish the things I've been working on since 1.31 (if I remember them correctly) to release a stable new build soon (I'm also going to check if the enchantment bug which @jdev21 mentioned is still there in 1.0.0, even though I suppose it would a bukkit issue of not yet having implemented enchantments API).
     
  17. Offline

    Royalgamer06

    Please update? I love this plugin. I have bukkit RB 1.0.1-r1 (win7,java 1.7) error log (if someone dies):

    08:45:21 [SEVERE] Could not pass event ENTITY_DEATH to DeathControl java.lang.IncompatibleClassChangeError: Expected static method com.nijikokun.reg ister.payment.Methods.getMethod()Lcom/nijikokun/register/payment/Method; at bone008.bukkit.deathcontrol.DeathControl.getRegisterMethod(DeathContr ol.java:229) at bone008.bukkit.deathcontrol.DeathManager.pay(DeathManager.java:298) at bone008.bukkit.deathcontrol.DeathManager.handle(DeathManager.java:117 ) at bone008.bukkit.deathcontrol.DeathControlEntityListener.onEntityDeath( DeathControlEntityListener.java:37) at org.bukkit.plugin.java.JavaPluginLoader$65.execute(JavaPluginLoader.j ava:718) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav a:58) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j ava:339) at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerDeathEvent(C raftEventFactory.java:320) at net.minecraft.server.EntityPlayer.die(EntityPlayer.java:168) at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:502)
    at net.minecraft.server.EntityHuman.damageEntity(EntityHuman.java:609) at net.minecraft.server.EntityPlayer.damageEntity(EntityPlayer.java:210)
    at net.minecraft.server.EntityLiving.b(EntityLiving.java:657) at net.minecraft.server.EntityHuman.b(EntityHuman.java:1173) at net.minecraft.server.Entity.a(Entity.java:670) at net.minecraft.server.EntityPlayer.b(EntityPlayer.java:433) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:380) at net.minecraft.server.Packet10Flying.a(SourceFile:126) at net.minecraft.server.NetworkManager.b(NetworkManager.java:226) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:93) at net.minecraft.server.NetworkListenThread.a(SourceFile:108) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:527) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425) at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
     
  18. Offline

    Kozzy68

    Hi, would be nice to include command option to teleport back for money and get items that way.
    Also it it possible to configure it way that youser loses 50% of items but wont get option to pay to get back rest ? timeout value 0
     
  19. Interesting idea, I've personally never thought about that. It should be pretty easy to implement. Added to ToDo list (BukkitDev), I'll take a look at it when I have time.

    Yes, that is possible. You just write the following:
    Code:
    {your death cause(s)}:
        keep-inventory: true
        loss-percentage: 50
    Having the option to do something is only present when you set the setting "method" to "command".
     
  20. Offline

    Quotation

    How do I change the config so everyone (OP or non-OP) can get their items back?
     
  21. If you are having a permissions handling plugin: give everyone the permission node "deathcontrol.use".
    If not, set "use-bukkit-permissions" in the config to false, then everyone can get their items back by default.
     
  22. Offline

    Kozzy68

    Is there some alias for all death causes so I dont have to configure same thing 10 times ? Like "any" would be prehaps good idea to add if there is no such thing it might prehaps even speed up plugin if used like that so it wont have to check for speciall reasons. :)
     
  23. Currently not, but I'll add it eventually. However, I recently added a possibility to specify multiple causes in one block, which is explained here. So you can just list all causes comma-separated, and only have one set of parameters to edit. Not an optimal solution, but better than before.
    And you would probably not notice any speed improvement if the death cause check would be gone. The few nanoseconds that would save every time a player dies are not really noticable ;)
     
  24. Offline

    Kozzy68

    It seems that when I set plugin to keep 50% of items it will chose some random stacks and keeps half of them. Would be better to actually keep 50% of stacks to make it more precise. this way you can lose stack of diamods or just one dirt :).
    What do you think ?
    thanks plugins works great so far.
     
  25. Thanks for the suggestion. I had it like you suggested once, but then there was the problem that for example tools would never drop when the percentage was lower than 50% (amount: 1; it rounds, so it doesn't drop) and you could theoretically force-keep your stuff by splitting it up in multiple stacks (you have 4 diamonds -> split it up into 4 stacks with 1 diamond).
    Maybe I could add an option which "loss-mode" you would want, so the admin can decide for himself.
     
  26. Offline

    Kozzy68

    Hi,
    :) use this formula it will be much better. Lets say you keep 33% (1/3) of items and you have 2 diamonds that is 2/3=0.666 = you have 66% chance to keep that one diamond. Scenario 2 when you have 4 diamonds 4/3 = 1.33 you keep one diamond always and have 33% chance to keep also second one. Its elegant fast solution and spliting diamonds would not give you any adventage.
    I hope its clear how I explained it might sound bit geeky but its simple.
    Another idea would be not bad to have option to keep items that you are wearig. :)
     
  27. Hiya. Not sure how everybody's reacting to the news today, but on the 'Testing for Science' side of things I was checking all my plugins for R5 compatibility against the 1959 dev build. Traceback occurs on server start as follows:
    OMG TEH SKIEZ! (open)
    Code:
    [SEVERE] Could not load 'plugins/DeathControl.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/bukkit/event/entity/EntityListener
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:288)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:212)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:190)
            at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:166)
            at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    Caused by: java.lang.NoClassDefFoundError: org/bukkit/event/entity/EntityListener
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
            at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
            at bone008.bukkit.deathcontrol.DeathControl.<init>(DeathControl.java:34)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149)
            ... 8 more
    Caused by: java.lang.ClassNotFoundException: org.bukkit.event.entity.EntityListener
            at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
            ... 26 more
    The Enrichment Center would like to take this opportunity to thank you for your mandatory volunteer service.
     
  28. Hey there, thanks for the heads-up. As you likely noticed, the event system was recently changed. I haven't released an update since then, so the current version 1.41 still uses the old one - which apparently isn't any longer supported in R5.
    The changes to the new system are already completed, but I'm still working on some more new features.
    As soon as R5 will be officially promoted, I'll push the update out - maybe even earlier if I finish stuff ahead of time.

    Thank you for participating in this Aperture Science computer-aided enrichment activity ;)

    Make sure you check back when R5 came out. If it's important for anyone for some reason to have R5 compatibility now, feel free to point it out, then I'll come up with a working dev-build.

    Okay, so R5 is coming very soon (tonight, apparently), so I released the update now:
    http://dev.bukkit.org/server-mods/deathcontrol/files/5-version-1-5/

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

    shazman333

    Hello guys!
    I have tried to fallow the thread and google on how to do it, but cant figure it out.
    If someone could help me it would be really appriciated, anyway how should i code if i want;
    Only to keep diamonds in inventory when i die (For all sorts of deathcauses), and rest of items just to be dropped.
    As said, if someone could help me on how to do this, it will be really appriciated.
    Thanks /Shazman333
     
  30. shazman333 Your goal is actually pretty straight forward:
    Declare the death causes you want (separated by comma, as explained on BukkitDev).
    Set "keep-inventory" to true and use a new whitelist called "MyListWithDiamonds" or whatever you want to call it.
    Your config should look something like this then:
    Code:
    DeathCauses:
        LAVA, PVP, VOID, FALL:
            keep-inventory: true
            whitelist:
            - MyListWithDiamonds
    Now you need to create your list in lists.txt. Simply put the diamond item in it, since that is what you want:
    Code:
    $list MyListWithDiamonds
    diamond
    Done :)
     

Share This Page