Move _openedChests up so the location is added regardless of further errors
This commit is contained in:
parent
c281603898
commit
d87c132818
@ -110,6 +110,9 @@ public class TreasureSession implements Listener
|
|||||||
RewardData rewardData = _rewardData.get(_openedChests.size());
|
RewardData rewardData = _rewardData.get(_openedChests.size());
|
||||||
RewardRarity rarity = rewardData.getRarity();
|
RewardRarity rarity = rewardData.getRarity();
|
||||||
TreasureRewardAnimation rewardAnimation = TreasureRewardAnimation.getAnimationFor(_treasure, _treasureLocation, location.clone().add(0.5, 1, 0.5), rewardData);
|
TreasureRewardAnimation rewardAnimation = TreasureRewardAnimation.getAnimationFor(_treasure, _treasureLocation, location.clone().add(0.5, 1, 0.5), rewardData);
|
||||||
|
|
||||||
|
_openedChests.add(location);
|
||||||
|
|
||||||
Material material = event.getClickedBlock().getType();
|
Material material = event.getClickedBlock().getType();
|
||||||
|
|
||||||
if (material == Material.CHEST || material == Material.TRAPPED_CHEST || material == Material.ENDER_CHEST)
|
if (material == Material.CHEST || material == Material.TRAPPED_CHEST || material == Material.ENDER_CHEST)
|
||||||
@ -129,8 +132,6 @@ public class TreasureSession implements Listener
|
|||||||
rewardAnimation.setRunning(true);
|
rewardAnimation.setRunning(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
_openedChests.add(location);
|
|
||||||
|
|
||||||
if (isDone())
|
if (isDone())
|
||||||
{
|
{
|
||||||
UtilServer.runSyncLater(this::cleanup, 5 * 20);
|
UtilServer.runSyncLater(this::cleanup, 5 * 20);
|
||||||
|
Loading…
Reference in New Issue
Block a user