diff --git a/src/main/java/mc/nightmarephoenix/anchorsell/api/StorageManager.java b/src/main/java/mc/nightmarephoenix/anchorsell/api/StorageManager.java index 3393cee..ff97752 100644 --- a/src/main/java/mc/nightmarephoenix/anchorsell/api/StorageManager.java +++ b/src/main/java/mc/nightmarephoenix/anchorsell/api/StorageManager.java @@ -436,7 +436,7 @@ public static void cacheAllAnchors() { * @return */ public static Anchor getAnchorFromLoc(Location location) { - for(Anchor anchor: Global.getAllAnchors()) { + for(Anchor anchor : Global.getAllAnchors()) { if(anchor.getLocation().equals(location)) { return anchor; } diff --git a/src/main/java/mc/nightmarephoenix/anchorsell/events/AnchorBreak.java b/src/main/java/mc/nightmarephoenix/anchorsell/events/AnchorBreak.java index 596bbfb..174c3ad 100644 --- a/src/main/java/mc/nightmarephoenix/anchorsell/events/AnchorBreak.java +++ b/src/main/java/mc/nightmarephoenix/anchorsell/events/AnchorBreak.java @@ -64,12 +64,6 @@ public void breakEv(BlockBreakEvent e) { location.getZ() + ")"); - - /** - * Removes anchor from cache - */ - Global.removeAnchor(anchor); - /** * Playing sound on anchor break. */ @@ -105,8 +99,12 @@ public void breakEv(BlockBreakEvent e) { * Saves to the database the broken anchor. */ StorageManager.removeAnchor(StorageManager.getAnchorFromLoc(location)); - } + /** + * Removes anchor from cache + */ + Global.removeAnchor(anchor); + } }, 20L); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index fd7ad5f..ffc7e80 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: AnchorSell -version: 1.4.1 +version: 1.4.2 main: mc.nightmarephoenix.anchorsell.AnchorSell api-version: 1.16 depend: [ Vault, Essentials ]