From 0203252b6398cbf6ae9dc5c78c25d32e8849d927 Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Thu, 17 Mar 2016 16:52:41 -0500 Subject: [PATCH 1/3] Bump java compat version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 201cae6c7..904f81fda 100755 --- a/pom.xml +++ b/pom.xml @@ -53,8 +53,8 @@ maven-compiler-plugin 2.3.2 - 1.6 - 1.6 + 1.7 + 1.7 From d58d621f968dcc9886f7bc47c9e861d964c1ee4a Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Thu, 17 Mar 2016 16:57:27 -0500 Subject: [PATCH 2/3] Bump java compat version (reverted from commit 0203252b6398cbf6ae9dc5c78c25d32e8849d927) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 904f81fda..201cae6c7 100755 --- a/pom.xml +++ b/pom.xml @@ -53,8 +53,8 @@ maven-compiler-plugin 2.3.2 - 1.7 - 1.7 + 1.6 + 1.6 From a711d3a3e33b85675aa985e3959d128fea4d16c7 Mon Sep 17 00:00:00 2001 From: Dor Date: Fri, 18 Mar 2016 02:18:40 +0200 Subject: [PATCH 3/3] Stop duplicate messages from abilities. --- .../com/gmail/nossr50/listeners/PlayerListener.java | 5 +++-- .../nossr50/skills/herbalism/HerbalismManager.java | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 57dfdcaa9..c61b3419e 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -65,6 +65,7 @@ import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.adapter.SoundAdapter; import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.skills.SkillUtils; +import org.bukkit.inventory.EquipmentSlot; public class PlayerListener implements Listener { private final mcMMO plugin; @@ -427,7 +428,7 @@ public class PlayerListener implements Listener { public void onPlayerInteractLowest(PlayerInteractEvent event) { Player player = event.getPlayer(); - if (!UserManager.hasPlayerDataKey(player) || player.getGameMode() == GameMode.CREATIVE) { + if (event.getHand() != EquipmentSlot.HAND || !UserManager.hasPlayerDataKey(player) || player.getGameMode() == GameMode.CREATIVE) { return; } @@ -519,7 +520,7 @@ public class PlayerListener implements Listener { public void onPlayerInteractMonitor(PlayerInteractEvent event) { Player player = event.getPlayer(); - if (!UserManager.hasPlayerDataKey(player) || player.getGameMode() == GameMode.CREATIVE) { + if (event.getHand() != EquipmentSlot.HAND || !UserManager.hasPlayerDataKey(player) || player.getGameMode() == GameMode.CREATIVE) { return; } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 4ab0bff76..77a945a5d 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -303,23 +303,23 @@ public class HerbalismManager extends SkillManager { private void processGreenThumbPlants(BlockState blockState, boolean greenTerra) { Player player = getPlayer(); PlayerInventory playerInventory = player.getInventory(); - ItemStack seed = null; + Material seed = null; switch (blockState.getType()) { case CARROT: - seed = new ItemStack(Material.CARROT_ITEM); + seed = Material.CARROT_ITEM; break; case CROPS: - seed = new ItemStack(Material.SEEDS); + seed = Material.SEEDS; break; case NETHER_WARTS: - seed = new ItemStack(Material.NETHER_STALK); + seed = Material.NETHER_STALK; break; case POTATO: - seed = new ItemStack(Material.POTATO_ITEM); + seed = Material.POTATO_ITEM; break; default: @@ -338,7 +338,7 @@ public class HerbalismManager extends SkillManager { return; } - playerInventory.removeItem(seed); + playerInventory.removeItem(new ItemStack(seed)); player.updateInventory(); // Needed until replacement available new HerbalismBlockUpdaterTask(blockState).runTaskLater(mcMMO.p, 0); }