From e394260621859d6b123122399bc5b75f24fc863d Mon Sep 17 00:00:00 2001 From: Th3Shadowbroker Date: Sun, 13 Oct 2019 11:36:05 +0200 Subject: [PATCH 1/2] Fixed grief-prevention injection --- src/org/inventivetalent/bookshelves/Bookshelves.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/inventivetalent/bookshelves/Bookshelves.java b/src/org/inventivetalent/bookshelves/Bookshelves.java index 059241e..bf3a580 100644 --- a/src/org/inventivetalent/bookshelves/Bookshelves.java +++ b/src/org/inventivetalent/bookshelves/Bookshelves.java @@ -22,6 +22,7 @@ import java.io.*; import java.lang.reflect.Field; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; public class Bookshelves extends JavaPlugin { @@ -87,9 +88,9 @@ public void onEnable() { getLogger().warning("Could not find PlayerEventHandler for GriefPrevention"); } else { Field inventoryHolderCacheField = AccessUtil.setAccessible(PlayerEventHandler.getDeclaredField("inventoryHolderCache")); - Map inventoryHolderCache = (Map) inventoryHolderCacheField.get(playerEventHandlerInstance); + ConcurrentHashMap inventoryHolderCache = (ConcurrentHashMap) inventoryHolderCacheField.get(playerEventHandlerInstance); - inventoryHolderCache.put(Material.BOOKSHELF.getId(), true); + inventoryHolderCache.put(Material.BOOKSHELF, true); getLogger().info("Injected Bookshelf as container type into GriefPrevention"); } } catch (Exception e) { From 469ec0b176c292ed7f81025e25c1b97906791fd0 Mon Sep 17 00:00:00 2001 From: Th3Shadowbroker Date: Sun, 13 Oct 2019 11:36:20 +0200 Subject: [PATCH 2/2] Bumped 1.5.1-SNAPSHOT -> 1.5.2-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fdf0e4d..ae272cb 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ org.inventivetalent bookshelves - 1.5.1-SNAPSHOT + 1.5.2-SNAPSHOT