• Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None

      The Potion class is broken. Use it and you just get an untextured water bottle
      https://pbs.twimg.com/media/Cci7AToW4AA7ckf.jpg:large

          [SPIGOT-1638] Potion class error

          Faris Rehman added a comment -

          Thanks tastybento. I use my own class, however your class seems more neater and useful. I'll be making a remake of yours using reflection and if you don't mind, I could post it here.

          LEGOlord 208, 'it's not that hard to use' for normal developers, but for new people, this would be hard to use. I myself have made a version using reflection but someone new to programming bukkit plugins most likely won't be able to do what I did.

          Everything that PseudoKnight said, I agree with.

          Faris Rehman added a comment - Thanks tastybento. I use my own class, however your class seems more neater and useful. I'll be making a remake of yours using reflection and if you don't mind, I could post it here. LEGOlord 208, 'it's not that hard to use' for normal developers, but for new people, this would be hard to use. I myself have made a version using reflection but someone new to programming bukkit plugins most likely won't be able to do what I did. Everything that PseudoKnight said, I agree with.

          PseudoKnight added a comment -

          Your comment is problematic. There are multiple reasons the API exists, and ease-of-use is only one of those. I've done workarounds for my server's issues related to this. But for the users of the plugin I contribute to, this isn't workable. Even if I was okay with doing a temporary patch using the NBT or the nms.PotionRegistry, this could cause more problems later for a couple reasons.

          PseudoKnight added a comment - Your comment is problematic. There are multiple reasons the API exists, and ease-of-use is only one of those. I've done workarounds for my server's issues related to this. But for the users of the plugin I contribute to, this isn't workable. Even if I was okay with doing a temporary patch using the NBT or the nms.PotionRegistry, this could cause more problems later for a couple reasons.

          LEGOlord 208 added a comment -

          In that case you have to use NBT tags. Come on it's not that hard to use. I had to do it instead of SpawnEgg#getType, and to make an item glowing effect. It's easy! So you don't have to hurry spigot so much!

          LEGOlord 208 added a comment - In that case you have to use NBT tags. Come on it's not that hard to use. I had to do it instead of SpawnEgg#getType, and to make an item glowing effect. It's easy! So you don't have to hurry spigot so much!

          tastybento added a comment -

          For those who want a stand-in class for Potions, I'm using this on ASkyblock. https://github.com/tastybento/askyblock/blob/master/src/com/wasteofplastic/askyblock/util/Potion1_9.java

          tastybento added a comment - For those who want a stand-in class for Potions, I'm using this on ASkyblock. https://github.com/tastybento/askyblock/blob/master/src/com/wasteofplastic/askyblock/util/Potion1_9.java

          Faris Rehman added a comment - - edited

          LEGOlord 208, what about getting the actual main type of potion (e.g. serializing/saving a regeneration II potion)? It's not part of getCustomEffect, it's in the NBT tags.

          Faris Rehman added a comment - - edited LEGOlord 208, what about getting the actual main type of potion (e.g. serializing/saving a regeneration II potion)? It's not part of getCustomEffect, it's in the NBT tags.

          LEGOlord 208 added a comment -

          You should use ItemMeta for setting. And you can loop through getCustomEffects for getter

          LEGOlord 208 added a comment - You should use ItemMeta for setting. And you can loop through getCustomEffects for getter

          Faris Rehman added a comment - - edited

          Agreed.

          I have no idea why it's taking so long for Spigot to fix this, unless they avoid NBT tags completely which I doubt.

          I've already made my own NBT tag reader and setter using reflection:
          https://github.com/KingFaris10/KingKits/blob/master/src/main/java/com/faris/kingkits/helper/util/PotionUtilities.java

          Faris Rehman added a comment - - edited Agreed. I have no idea why it's taking so long for Spigot to fix this, unless they avoid NBT tags completely which I doubt. I've already made my own NBT tag reader and setter using reflection: https://github.com/KingFaris10/KingKits/blob/master/src/main/java/com/faris/kingkits/helper/util/PotionUtilities.java

          This is not a minor bug. This is holding up my server's entire switch over to 1.9

          Kimberly Boynton added a comment - This is not a minor bug. This is holding up my server's entire switch over to 1.9

          Is there any progress on it, or anything on this issue?

          Faris Rehman added a comment - Is there any progress on it, or anything on this issue?

          PseudoKnight added a comment -

          If we're listing reasons why this is important, I contribute to a large scripting plugin where the item objects depend on this when doing anything with potions that aren't custom potions. It's one of the last things that is keeping me from updating my server to 1.9. I can workaround the issue on my own server with NMS, but I shouldn't have to push something like that to the scripting plugin.

          I have the same problem with the new spawn eggs, which unfortunately are used on my server a lot too. SPIGOT-1592

          PseudoKnight added a comment - If we're listing reasons why this is important, I contribute to a large scripting plugin where the item objects depend on this when doing anything with potions that aren't custom potions. It's one of the last things that is keeping me from updating my server to 1.9. I can workaround the issue on my own server with NMS, but I shouldn't have to push something like that to the scripting plugin. I have the same problem with the new spawn eggs, which unfortunately are used on my server a lot too. SPIGOT-1592

            Assignee:
            Black Hole
            Reporter:
            LEGOlord 208
            Votes:
            9 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: