From 9056e665549101a6b43c7a6570d4ce0c505894e9 Mon Sep 17 00:00:00 2001 From: Melair Date: Wed, 2 Mar 2016 17:51:36 +0000 Subject: [PATCH] Enable support of PotionMeta on SPLASH_POTION, LINGERING_POTION and TIPPED_ARROW. --- .../org/bukkit/craftbukkit/inventory/CraftItemFactory.java | 3 +++ .../java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 3 +++ .../java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java index 82f2045567..0c685e4461 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -76,6 +76,9 @@ public final class CraftItemFactory implements ItemFactory { case LEATHER_BOOTS: return meta instanceof CraftMetaLeatherArmor ? meta : new CraftMetaLeatherArmor(meta); case POTION: + case SPLASH_POTION: + case LINGERING_POTION: + case TIPPED_ARROW: return meta instanceof CraftMetaPotion ? meta : new CraftMetaPotion(meta); case MAP: return meta instanceof CraftMetaMap ? meta : new CraftMetaMap(meta); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 8bb128e601..b120a7ed28 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -338,6 +338,9 @@ public final class CraftItemStack extends ItemStack { case LEATHER_BOOTS: return new CraftMetaLeatherArmor(item.getTag()); case POTION: + case SPLASH_POTION: + case LINGERING_POTION: + case TIPPED_ARROW: return new CraftMetaPotion(item.getTag()); case MAP: return new CraftMetaMap(item.getTag()); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java index 5b2d12bb6f..f68453075d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java @@ -109,6 +109,9 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { boolean applicableTo(Material type) { switch(type) { case POTION: + case SPLASH_POTION: + case LINGERING_POTION: + case TIPPED_ARROW: return true; default: return false;