Skip to content

Commit

Permalink
maaaaybe improve potion stuff, for #1476
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 28, 2016
1 parent fca1cd2 commit 13557fc
Showing 1 changed file with 5 additions and 2 deletions.
@@ -1,5 +1,7 @@
package net.aufdemrand.denizen.objects.properties.item;

import net.aufdemrand.denizen.nms.NMSHandler;
import net.aufdemrand.denizen.nms.NMSVersion;
import net.aufdemrand.denizen.objects.dColor;
import net.aufdemrand.denizen.objects.dItem;
import net.aufdemrand.denizen.utilities.debugging.dB;
Expand All @@ -17,8 +19,9 @@ public class ItemPotion implements Property {
public static boolean describes(dObject item) {
return item instanceof dItem
&& (((dItem) item).getItemStack().getType() == Material.POTION
|| ((dItem) item).getItemStack().getType() == Material.SPLASH_POTION
|| ((dItem) item).getItemStack().getType() == Material.LINGERING_POTION);
|| (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_9_R2)
&& (((dItem) item).getItemStack().getType() == Material.SPLASH_POTION
|| ((dItem) item).getItemStack().getType() == Material.LINGERING_POTION)));
}

public static ItemPotion getFrom(dObject _item) {
Expand Down

0 comments on commit 13557fc

Please sign in to comment.