[FUN/MECH] ElixirMod v1.00 - A Drink to Victory! [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Steeveeo, Jun 18, 2011.

  1. Offline

    Steeveeo

    ElixirMod - A Drink to Victory!
    Version: v1.00

    ElixirMod is my first plugin for Bukkit, and is tested and working under build 860. This plugin adds a few "simulated items" that users can toy with, which are listed in Features.
    The way this mod works is that a user holds an empty bowl in hand, right clicks, and if they have the proper ingredients, will give them a buff for a period of time. But if they are not careful, they could hurt themselves, as each drink racks up "Toxicity" which can hurt more than it helps.

    Features:
    • Works with Permissions 2.7.4 and equivalent (tested with Essentials Group Manager).
    • Every aspect of each Elixir is, or will be modifiable.
    • Several fun and useful Potions and Elixirs, see the Potion List below for details
    [​IMG] Download ElixirMod.jar
    [​IMG] Source Code

    Issues:
    Having issues with ElixirMod? Have a suggestion? Posting it here tends to get lost in chatter, instead:

    PermissionsBukkit Hotfix:
    When version 1.00 of ElixirMod came out, it did not support PermissionsBukkit. The fix for this is relatively simple, and just requires a quick edit to the ElixirMod.jar file. Make sure the server is off before attempting this, and then open ElixirMod.jar in something like 7zip, open "plugin.yml" and replace its content with the stuff in the following spoiler tag, save and make sure your archive program updated the file inside it, then run the server and enjoy ElixirMod on PermissionsBukkit (note, requires SuperPermsBridge):
    Show Spoiler

    Code:yaml
    1. name: ElixirMod
    2. main: me.steeveeo.ElixirMod.ElixirMod
    3. version: 1.00
    4. load: startup
    5. commands:
    6. elixir:
    7. description: Command container for all ElixirMod Admin commands.
    8. permissions:
    9. elixirmod.*:
    10. description: Gives access to all ElixirMod permissions.
    11. default: false
    12. children:
    13. elixirmod.command.*: true
    14. elixirmod.allpotions: true
    15. elixirmod.command.*:
    16. description: Gives access to all ElixirMod chat commands
    17. default: false
    18. children:
    19. elixirmod.command.gettox: true
    20. elixirmod.command.gettox.others: true
    21. elixirmod.command.settox: true
    22. elixirmod.command.settox.others: true
    23. elixirmod.command.reset: true
    24. elixirmod.command.reset.others: true
    25. elixirmod.command.givebuff: true
    26. elixirmod.command.takebuff: true
    27. elixirmod.allpotions:
    28. description: Grants access to all ElixirMod potions
    29. default: true
    30. children:
    31. elixirmod.cactusrum: true
    32. elixirmod.firetouch: true
    33. elixirmod.haste: true
    34. elixirmod.obbyskin: true
    35. elixirmod.wheatseedtea: true
    36. elixirmod.featherfall: true
    37. elixirmod.diversale: true
    38. elixirmod.frosttouch: true
    39. elixirmod.health: true
    40. elixirmod.dragonsdraught: true
    41. elixirmod.command.gettox:
    42. default: false
    43. elixirmod.command.gettox.others:
    44. default: false
    45. elixirmod.command.settox:
    46. default: false
    47. elixirmod.command.settox.others:
    48. default: false
    49. elixirmod.command.reset:
    50. default: false
    51. elixirmod.command.reset.others:
    52. default: false
    53. elixirmod.command.givebuff:
    54. default: false
    55. elixirmod.command.takebuff:
    56. default: false
    57. elixirmod.cactusrum:
    58. default: true
    59. elixirmod.firetouch:
    60. default: true
    61. elixirmod.haste:
    62. default: true
    63. elixirmod.obbyskin:
    64. default: true
    65. elixirmod.wheatseedtea:
    66. default: true
    67. elixirmod.featherfall:
    68. default: true
    69. elixirmod.diversale:
    70. default: true
    71. elixirmod.frosttouch:
    72. default: true
    73. elixirmod.health:
    74. default: true
    75. elixirmod.dragonsdraught:
    76. default: true



    Changelog:
    Note, when updating to or through any version with the "(Config Reinstall Required)" flag in the changelog, you must delete the ElixirMod folder in Plugins, then run the server to let the plugin regenerate the file.

    Version 1.00
    (Config Reinstall Required)
    • First off, a note. Many, many things changed, so this is not a complete list. Instead, just the main points of the changes made, nothing fine.
    • Complete rewrite of how potions work and act, systematically. Now uses a modular class-based system instead of the stupid CopyPasta I had going on in prior versions. YAY, it's now officially an Object Oriented Program! Derp.
    • Added some new stuff to the config files for existing potions.
    • Made the ability for Firetouch users to ignite Netherrack with rightclick. This casts a BLOCK_IGNITE_EVENT with the cause of FLINTANDSTEEL before igniting, so it can be canceled. Handy for region protection.
    • Added support for specifying the ENTIRE recipe within the config files. Syntax is as follows: "Item : Data * Amount,..." Specifically, Item is the type of inventory item to look for, Data is the datavalue associated with the item (use them for dyes, it's what I built it for), and amount is, well, the amount. 351:1*5,1*1 would be 5 Rose Red dye and 1 Stone, for example.
    • Added Diver's Ale. Costs 8 glowstone dust and 1 rose, gives 5 times the breath underwater.
    • Added Elixir of Frosttouch. Costs 4 Snowblocks and 1 waterbucket. 75% chance to stun a hit target for 3 seconds.
    • Added Health Potion (generic name HO!). Costs 1 brown mushroom, 1 red mushroom, and 1 milkbucket. Gives a half-heart per 1 second for 15 seconds.
    • Added Dragon's Draught. Costs 2 lavabuckets and 4 obsidian. Gives heat-damage immunity. Lava immunity is on by default, but is a toggle in the config for admins who don't like it.
    • Added a Chat Command system. Commands are as follows (player can be the * wildcard to select the entire server):
      • /elixir Prints out the help and usage
      • /elixir gettox[ player] Prints out your toxicity, or the specified player(s)
      • /elixir settox[ player] amount Sets the Toxicity variable on self or player(s).
      • /elixir givebuff player buffname Grants a buff by name to player(s).
      • /elixir takebuff player buffname Inverse of the above.
    • Got rid of some useless and unused events. All of the other events are handled in the potion objects now, and there's no need for a joiner event anymore.
    • Made the util.takeItemAmount() function check for data values as well as special behavior for bucket contents. If a potion recipe asks for, say, a lava bucket, this function will now replace the lava bucket with an empty one.
    Previous Versions (open)

    Version 0.75:
    Show Spoiler
    (Config Reinstall Required)
    • Removed "Plugin Enabled" from config, really didn't do anything and was a remnant from the config tutorial I based it on.
    • Fixed some pretty severe NullPointerError spam with the Elixir of Haste and some with Elixir of Obbyskin. This was due to reloading plugins making my hashtables reset. Now checks for null hashes before doing anything with them.
    • Added Elixir of Featherfall. Costs 16 feathers and negates fall damage for 2 minutes.
    • Added Elixir of Firetouch. Costs 16 netherrack and gives the user a 75% chance to ignite a target for 5 seconds. Currently ignites via any damage from a user, but can be configured to only work when unarmed.

    Version 0.66:
    Show Spoiler

    • Fixed Wheatseed Tea use check. Failed copypasta from Obsidian Skin made it check to see if the user had leather as well as the required ingredients.

    Version 0.65:
    Show Spoiler
    (Config Reinstall Required)
    • Added Elixir of Obsidian Skin - 50% damage reduction for 5 minutes, takes 1 obsidian and 8 leather.
    • Added Wheatseed Tea - 50% toxicity reduction, 25% buff reduction, 2 hearts health regen. Takes 16 seeds.
    • Reworked Toxicity system, will now cause damage over time if overtoxic.
    • Added in more options and renamed some entries on the Config file to make them more clear.
    • Added in the ability to toggle each Elixir in the Config file.

    Version 0.31
    Show Spoiler

    • Fixed a divide-by-zero error in Cactus Rum that enabled users to get infinite health by taking a second dose after the first wore off.

    Version 0.3
    Show Spoiler

    • Official Public Release.
    • Redid entire "Toxicity" system to work with multiple types of potion buffs.
    • Added in Elixir of Haste. Note, this is just a LITTLE bit out of whack, and admins might want to restrict this for now.

    Version 0.2
    Show Spoiler

    • Refactored the plugin to be called ElixirMod, as a brainstorm session with fellow players pushed me to expand this.
    • Added Config File support.
    • Added Permissions support.

    Version 0.1
    Show Spoiler

    • Plugin Created under the name CactusRum.
    • Got Cactus Rum working.


    List of Elixirs and Potions
    Show Spoiler

    • Cactus Rum - Requires 16 cactus. Does a default of 3 hearts of damage, then grants 3 minutes of health regen (1/2 heart every 3 seconds).
      • Permission Node: elixirmod.cactusrum
    • Elixir of Haste - Requires 16 sugar. Makes the drinker run much faster than normal. Currently not working 100% as intended, but still fun to play with.
      • Permission Node: elixirmod.haste
    • Elixir of Obsidian Skin - Requires 1 obsidian, 8 leather. Drinker gets 50% damage reduction for a default of 5 minutes.
      • Permission Node: elixirmod.obbyskin
    • Wheatseed Tea - Requires 16 seeds. Reduces toxicity by half, and for balance, reduces buff durations by 25%. Also restores 4 (2 hearts of) health.
      • Permission Node: elixirmod.wheatseedtea
    • Elixir of Featherfall - Requires 16 feathers. Negates fall damage while active for a default of 2 minutes.
      • Permission Node: elixirmod.featherfall
    • Elixir of Firetouch - Requires 16 netherrack. Default 75% chance to ignite mobs on-hit. Defaults to working with any damage, but configs allow the ability to limit it to unarmed only.
      • Permission Node: elixirmod.firetouch
    • Elixir of Frosttouch - Requires 4 snowblocks, 1 water bucket. 75% chance to stun a target for 3 seconds.
      • Permission Node: elixirmod.frosttouch
    • Diver's Ale - Requires 8 glowstone dust, 1 rose. Default 5 minutes of 5 times the breath underwater.
      • Permission Node: elixirmod.diversale
    • Health Potion - Requires 1 red mushroom, 1 brown mushroom, 1 milk bucket. Gives 1 half heart per 1 second for 15 seconds.
      • Permission Node: elixirmod.health
    • Dragon's Draught - Requires 2 lava buckets, 4 obsidian. Gives fire immunity for default 5 minutes. Lava immunity can be toggled.
      • Permission Node: elixirmod.dragonsdraught


    Admin Commands
    Show Spoiler

    Note, all <player> fields can be either a player's partial name, full name, or the * wildcard to select everyone in the server. Fields surrounded by [ ] are optional (in the case of <player>, if not specified, will act on the calling player).
    • /elixir - Prints out the help and usage for all ElixirMod commands.
    • /elixir gettox[ <player>] - Prints out the toxicity level over the maximum "safe" toxicity level (i.e., greater than the second number = damage over time from being toxic).
    • /elixir settox[ <player>] <amount> - Sets the toxicity level of a player.
    • /elixir givebuff <player> <buffname> - Gives a buff by potion name to a player. Bypasses the "Drink" function, so toxicity is not applied.
    • /elixir takebuff <player> <buffname> - Inverse of the above.


    Planned Potions
    Note, I am generally only a moderately original creator, and thus I can only come up with a finite number of ideas. New suggestions are always welcome!
    Show Spoiler
    (Subject to change due to new ideas and limits on possibility.)
    • Elixir of Stealth - Blocks mob targeting unless the user attacks.
    • Greater Potion of Invulnerability - Very expensive potion that would grant godmode to the user. By "expensive", I mean it. Probably as bad as a diamond version of a Golden Apple, but more likely a callback to the Yogscast's Mistral City ark with its ingredients. ;)
    • Elixir of Protection - Gives a stackable "over-shield" buff for some time that absorbs a flat amount of damage (possibly 5 for the default, might bump that up when I enter the balancing phase of the next version.
    • Potion of Blinding Strikes - Gives a chance to "blind" the target on-hit. This will not affect player visibility or mob targeting, but will make attacks have a high chance to miss.
    • Thornskin Brew - Returns about 30% of damage taken back to its source.
    • Dread Venom - Causes the next attack to poison the target, reducing damage output by half, blocking healing (or reducing it by half, if possible), and perhaps a light slow in future versions. The Health Potion would act as an antidote and resume healing as normal.


    Known Issues
    This is a list of all the bugs that I personally know about and am planning to fix in the next couple of versions.
    Show Spoiler

    • Elixir of Haste - Wildly uncontrollable, jumping impossible while hasting. This is due to Minecraft not having any way via stock functions to get what keys a player is pressing down, meaning that the only way to Haste is to throw the player in the direction he/she is looking. Sadly, this also means that it overrides the jump velocity, due to how movement is broadcast across the net. In order to jump in the current version, you need to stop speeding by holding "Sneak". I plan to fix this by adding BukkitContrib support in the next version (planned version 1.2). Those without BukkitContrib Client installed will still have to deal with the same crappy movement code, sadly.
    • Dragon's Draught - Sinking into lava and hitting the bottom of a pool more than 2-deep will cause damage. This is due to how Minecraft treats lava, which is more like Web than Water. The user actually takes fall damage while sinking, and I am not sure how to go about fixing this, other than some wildly extensive checks that might actually bring the server to its knees if I do it improperly.
    • Heroes plugin - Health-restoring potions do not work with this plugin, as Heroes completely rewrites how health works in Bukkit, and ElixirMod uses stock Bukkit health. No plans to write an interface for this.
     
    CJits and kahlilnc like this.
  2. Offline

    RazorFlint

    Aha sweet I'll try this in the morning but for now its...
    Half 3 in the morning and im tired!
     
  3. Offline

    Steeveeo

    Version 0.31 released:
    • Fixed a divide-by-zero error in Cactus Rum that enabled users to get infinite health by taking a second dose after the first wore off.
     
  4. Offline

    BioRage

    Um... YES?!

    This looks pretty badass.

    However, I noticed with any speed buff's in MC, it's buggy as hell, especially if you jump and run with a speed buff, you get quad times 999.

    Looks good, I'll try it out when I can, keep up the good work.
     
  5. Offline

    Steeveeo

    Thanks, but I'm not quite sure what you mean by "quad times 999". I am aware how bugged out my current implementation of "Haste" is, though, and it's mainly in for the fun of it. I'm going to improve it when I get through with finals, as I just recently found out about the BukkitContrib library that allows me to see key presses.
     
  6. Offline

    BioRage

    Hm, I havent got to test it yet, however, I'm not sure if it's the same, but I noticed some "moving" plugin or "speed buffs" will increase your speed if you jump, regardless I'll give you feedback when I test it!

    @Steeveeo

    Haste you can't control, really.. and if you fall into the water, you can't get out.

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

    Steeveeo

    Yeah, that's why I said the things I did. The haste controller needs bit of an overhaul, which I'll get to after finals. You can stop the speed temporarily by sneaking, though, which will enable you to jump. I believe the main reason why jumping doesn't work is because the speed hook is probably not properly getting the Y velocity from the stock Minecraft movement. Again, once I get BukkitContrib imported and some time, I'll use the key hooks from that to make a better Haste system.

    If you care, the formula for controlling haste is this:
    Code:
    //Haste Stuffs
        private static double defaultSpeed = 1.8;
        public void onPlayerMove(PlayerMoveEvent event)
        {
            Player player = event.getPlayer();
    
            //Can this person speed?
            if(plugin.hasteEnabled.get(player))
            {
                //Unless crouched, speed the hell up
                if(!player.isSneaking())
                {
                    //Make sure to only speed up if on solid ground
                    int material = player.getWorld().getBlockAt(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ()).getTypeId();
                    if(material != 0 && material != 8 && material != 9 && material != 10 && material != 11 && material != 30 && material != 65 && material != 88)
                    {
                        //Vector dir = player.getLocation().getDirection().multiply(defaultSpeed).setY(0.1);
                        Vector dir = player.getLocation().getDirection().setY(0); //player.getVelocity();
                        Vector veloc = player.getVelocity();
                        dir.setX(Math.max(Math.min((dir.getX() * defaultSpeed)+(veloc.getX()*0.3), 2), -2));
                        dir.setZ(Math.max(Math.min((dir.getZ() * defaultSpeed)+(veloc.getZ()*0.3), 2), -2));
                        dir.setY(veloc.getY());
                        player.setVelocity(dir);
                    }
                }
            }
        }
    You can see why it needs changing, it's rather bunk.
     
  8. Offline

    Samylots

    Can we have a video of this plugin?
     
  9. Offline

    Steeveeo

    Not just yet. The currently implemented Haste elixir is definitely not final, and the cactus rum isn't really video worthy. In other words, at this point, a video would be rather uneventful.

    However, when I get it to version 1.0 or so (when I get most of the planned elixirs complete), it should be ready to actually need a video.

    UPDATE: Looks like I will not be able to do much about how the Haste Elixir works, actually. Seems BukkitContrib key hooks rely on a clientside mod to work properly, something I can't have for my server, and would like to stay away from since I will primarily be making mods for that. If someone would like to contribute a much better movement code, I'll add your credit to the project and give you many thanks.

    Other than that, it seems like the Elixir of Haste should remain restricted for now. I think I'll start working on the Elixir of Obsidian Skin, and possibly a "Chooser" algorithm, just in case a user has multiple potion ingredients in their inventory. Currently, it just goes down a cascading If Then Else If, currently with Cactus Rum at the top. The Chooser script will check each inventory slot in order until it finds the "Potion Alias" item, which will most likely just be the main ingredient to a certain potion. That seems alright to me, at least.

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

    martijn4life

    works also in version 818 :D
     
    Steeveeo likes this.
  11. Offline

    Steeveeo

    Thanks for the tip-off, changing the title.
     
  12. Offline

    Steeveeo

    Sorry that took a bit, been spending time with the folks for summer break. I've got a new version out, two new potions and a lot of system changes, see the changelog for details:

    Version 0.65:
    (Config Reinstall Required)
    • Added Elixir of Obsidian Skin - 50% damage reduction for 5 minutes, takes 1 obsidian and 8 leather.
    • Added Wheatseed Tea - 50% toxicity reduction, 25% buff reduction, 2 hearts health regen. Takes 16 seeds.
    • Reworked Toxicity system, will now cause damage over time if overtoxic.
    • Added in more options and renamed some entries on the Config file to make them more clear.
    • Added in the ability to toggle each Elixir in the Config file.

    Can someone see if it works alright with Bukkit Build 935? It would help a fair bit, thank you.

    Fixed a whoops:

    Version 0.66:
    • Fixed Wheatseed Tea use check. Failed copypasta from Obsidian Skin made it check to see if the user had leather as well as the required ingredients.

    Also, seems to work well enough in 935, marking in title.

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

    Steeveeo

    Minecraft updated to 1.7, this mod is tested and working in stable build #950. Please let me know if you guys run across any compatibility issues that I haven't found yet.
     
    Redyugi likes this.
  14. Offline

    CJits

    Whenever I try to use an elixir I get an error in my console ( And the elixir doesn't work.. ) : 2011-07-02 01:13:30 [SEVERE] Could not pass event PLAYER_INTERACT to ElixirMod
    java.lang.NoClassDefFoundError: com/nijiko/permissions/PermissionHandler
    at me.steeveeo.ElixirMod.ElixirModPlayerListener.onPlayerInteract(ElixirModPlayerListener.java:55)
    at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:307)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:139)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:520)
    at net.minecraft.server.Packet15Place.a(SourceFile:57)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    Could it be that this plugin isn't for Bukkit 953 yet? because in your last post you wrote "build #950" soo.. Is it possible..?
     
  15. Offline

    Steeveeo

    My server is running #953 and it's running well enough. Are you running Permissions 3.x.x or 2.7.4? Any permissions at all? The first three lines of the error make me think it's that.
     
  16. Offline

    CJits

    Can I use permissions for 1.7.2? Because I thought it wasn't possible ^^".. My bad, will try it right away.
    Thanks for your fast reply.
     
  17. Offline

    Steeveeo

    I do believe it's working, I haven't encountered any errors in my setup, but I've been running Group Manager, which is, I think, equivalent to 2.7.4 (if I'm wrong on this, someone please correct me so I can get this more accurate).
     
  18. Offline

    CJits

    So if I'd use Group Manager it should work? I'll try permissions and if that doesn't work I'll send another reply.
     
    Steeveeo likes this.
  19. Offline

    Steeveeo

    Something like that, thanks for checking.
     
  20. Offline

    CJits

    Okay! It worked! Plugin looks nice ;D Took the Haste Elixir xD It's fun! :p
    So I just downloaded the newest permissions and it worked. Thanks for your help!
    You actually taught me something lol.
    I'll be following this plugin for sure. :)
     
    Steeveeo likes this.
  21. Offline

    Steeveeo

    Thanks for the feedback, much appreciated!

    BTW, just going to note this now, the next version will contain the Dragon's Draught and the Elixir of Firetouch, along with some bugfixes. Also possibly in the next version: configurable ingredient use per-potion and the Elixir of Featherfall.
     
  22. Offline

    CJits

    Exciting :D
    I'll burn those bloody creepers! xD
    Will look forward to it :D

    Oh, one last thing, just looked at my console again and it has another error ^^" But not that it bothers, it came after I took the haste elixir :
    [SEVERE] Could not pass event PLAYER_MOVE to ElixirMod
    java.lang.NullPointerException
    at me.steeveeo.ElixirMod.ElixirModPlayerListener.onPlayerMove(ElixirModPlayerListener.java:97)
    at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:286)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:163)
    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:84)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    I don't know if I'm bothering you with it or helping you but here it is xD
    It's not doing anything special so.. It'd just be nice if you'd know what the problem is :)
    Thanks in advance.

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

    Steeveeo

    That one I do know about, and it's a spammer, as my giant log file could tell you. I'm really not sure what causes it, but I hope to kill it with the bugfixes in the next patch.

    Tell me, did you die or disconnect at any point between the first swig and that error? The error spam is random to me, but I'm thinking it is something related to that.
     
  24. Offline

    CJits

    Yes, I died. I ran of the roof. xD So that's probably it then?
    I wish you luck!
    And my log file's full of it as well lol.
     
  25. Offline

    Steeveeo

    Hmm, that could very well be it. I just realized that my log file is 200 MB large now, so it's getting really hard to look at it over a VPN. XD
     
  26. Offline

    CJits

    Haha. Then I REALLY wish you good luck! xD

    EDIT: Mine's only 1.7 MB so far lol
     
  27. Offline

    locutus

    Build 953, java 1.6 on Debian
    It's spamming this exception at me. Doesn't seem related to whether I'm using elixirs, or deaths. It just spams this out whenever someone moves.

    Please fix, because I really like this plugin.

    22:56:38 [SEVERE] Could not pass event PLAYER_MOVE to ElixirMod
    java.lang.NullPointerException
    at me.steeveeo.ElixirMod.ElixirModPlayerListener.onPlayerMove(ElixirModPlayerListener.java:97)
    at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:286)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:163)
    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:84)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  28. Offline

    Steeveeo

    Yeah, I know about this. The thing is, it's completely random, at least to me, when it starts happening. I am really not sure why it's doing it, or what causes it, as it mostly does not spam, but it sometimes does. When it happens to spam like this, try restarting the server and/or reloading the addons through /reloadall (if the command is available on your setup) and tell me if it stops the spam, please.

    I'm working as I can to track it down, but I am going to need the help of some volunteers to actually sniff out the cause; only then can I make a solution.
     
  29. Offline

    locutus

    I am unwilling to restart often, as this is a producton server, but I own and am sitting next to the box, so I'll do everything else I can. I'd love to help you get this figured out!
     
  30. Offline

    Steeveeo

    Well, if anyone wants to attempt a debug directly on the code, this is the section that's producing the NPE:

    Code:java
    1. //Haste Stuffs
    2. private static double defaultSpeed = 1.8;
    3. public void onPlayerMove(PlayerMoveEvent event)
    4. {
    5. Player player = event.getPlayer();
    6.  
    7. //Can this person speed?
    8. if(plugin.hasteEnabled.get(player))
    9. {
    10. //Unless crouched, speed the hell up
    11. if(!player.isSneaking())
    12. {
    13. //Make sure to only speed up if on solid ground
    14. int material = player.getWorld().getBlockAt(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ()).getTypeId();
    15. if(material != 0 && material != 8 && material != 9 && material != 10 && material != 11 && material != 30 && material != 65 && material != 88)
    16. {
    17. //Vector dir = player.getLocation().getDirection().multiply(defaultSpeed).setY(0.1);
    18. Vector dir = player.getLocation().getDirection().setY(0); //player.getVelocity();
    19. Vector veloc = player.getVelocity();
    20. dir.setX(Math.max(Math.min((dir.getX() * defaultSpeed)+(veloc.getX()*0.3), 2), -2));
    21. dir.setZ(Math.max(Math.min((dir.getZ() * defaultSpeed)+(veloc.getZ()*0.3), 2), -2));
    22. dir.setY(veloc.getY());
    23. player.setVelocity(dir);
    24. }
    25. }
    26. }
    27. }


    Does anyone see a part that could be randomly stuck NULL? I don't suppose that the event can fire on non-players (making 'player' = null), right?
     

Share This Page