From 2595209204693075bd223f9acd7646211ce07c2b Mon Sep 17 00:00:00 2001 From: Daniel V Date: Tue, 28 Feb 2017 14:07:32 -0500 Subject: [PATCH 1/3] Update example in README.md The proposed changes changes the econ, perms, and chat variables to private, and created a public static getter for them. --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1af4f34..f4a2c24 100644 --- a/README.md +++ b/README.md @@ -73,9 +73,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() { @@ -147,5 +147,17 @@ public class ExamplePlugin extends JavaPlugin { return false; } } + + public static Economy getEcononomy() { + return econ; + } + + public static Permission getPermissions() { + return perms; + } + + public static Chat getChat() { + return chat; + } } ``` From b305ed5f0b788d785bfc4725452873b99abb51a3 Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Wed, 10 Jan 2018 00:35:27 -0500 Subject: [PATCH 2/3] Correct itemByStack(), fixes #10 and #36 --- .gitignore | 3 ++- src/main/java/net/milkbowl/vault/item/Items.java | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) 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/src/main/java/net/milkbowl/vault/item/Items.java b/src/main/java/net/milkbowl/vault/item/Items.java index 548976d..afb42ac 100644 --- a/src/main/java/net/milkbowl/vault/item/Items.java +++ b/src/main/java/net/milkbowl/vault/item/Items.java @@ -817,10 +817,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; + } } } From 8884a12f99057796ef1400fd3fc67a0ec9398ac2 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 11 Jan 2018 21:52:22 +1030 Subject: [PATCH 3/3] Fix #42 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4a2c24..26fc72e 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ public class ExamplePlugin extends JavaPlugin { } } - public static Economy getEcononomy() { + public static Economy getEconomy() { return econ; }