From d87c13281809eeeae5a12122af791f037127e5ab Mon Sep 17 00:00:00 2001 From: ArcticZeroo Date: Sun, 5 Nov 2017 14:35:26 -0500 Subject: [PATCH] Move _openedChests up so the location is added regardless of further errors --- .../src/mineplex/core/treasure/TreasureSession.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureSession.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureSession.java index 788f7c439..60ee62bc6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureSession.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureSession.java @@ -110,6 +110,9 @@ public class TreasureSession implements Listener RewardData rewardData = _rewardData.get(_openedChests.size()); RewardRarity rarity = rewardData.getRarity(); TreasureRewardAnimation rewardAnimation = TreasureRewardAnimation.getAnimationFor(_treasure, _treasureLocation, location.clone().add(0.5, 1, 0.5), rewardData); + + _openedChests.add(location); + Material material = event.getClickedBlock().getType(); if (material == Material.CHEST || material == Material.TRAPPED_CHEST || material == Material.ENDER_CHEST) @@ -129,8 +132,6 @@ public class TreasureSession implements Listener rewardAnimation.setRunning(true); } - _openedChests.add(location); - if (isDone()) { UtilServer.runSyncLater(this::cleanup, 5 * 20);