diff --git a/.gitignore b/.gitignore index 006f41c..37cc1ae 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /dependency-reduced-pom.xml /.classpath /.project -/.settings \ No newline at end of file +/.settings +/bin/ diff --git a/README.md b/README.md index bbea138..a511e02 100644 --- a/README.md +++ b/README.md @@ -92,9 +92,9 @@ import org.bukkit.plugin.java.JavaPlugin; public class ExamplePlugin extends JavaPlugin { private static final Logger log = Logger.getLogger("Minecraft"); - public static Economy econ = null; - public static Permission perms = null; - public static Chat chat = null; + private static Economy econ = null; + private static Permission perms = null; + private static Chat chat = null; @Override public void onDisable() { @@ -166,5 +166,17 @@ public class ExamplePlugin extends JavaPlugin { return false; } } + + public static Economy getEconomy() { + return econ; + } + + public static Permission getPermissions() { + return perms; + } + + public static Chat getChat() { + return chat; + } } ``` diff --git a/src/main/java/net/milkbowl/vault/item/Items.java b/src/main/java/net/milkbowl/vault/item/Items.java index cdd5a38..6ccd806 100644 --- a/src/main/java/net/milkbowl/vault/item/Items.java +++ b/src/main/java/net/milkbowl/vault/item/Items.java @@ -836,10 +836,16 @@ public static ItemInfo itemByStack(ItemStack itemStack) { } for (ItemInfo item : items) { - if (itemStack.getType().equals(item.getType()) && item.isDurable()) { - return item; - } else if (itemStack.getType().equals(item.getType()) && item.getSubTypeId() == itemStack.getDurability()) { - return item; + if (itemStack.getType().equals(item.getType())) { + if (itemStack.getType().isSolid() && item.getType().isSolid()) { + //Solid, so check durability (Podzol, Colored Wool, et al.) + if (item.isDurable()) { + return item; + } + } else { + //Not solid, so ignore durability (Stick, Stone Button, et al.) + return item; + } } } @@ -1170,4 +1176,4 @@ public static String join(List list, String glue) { return joined; } } -} +} \ No newline at end of file