hopefully fixed long standing bug

This commit is contained in:
hyperdefined
2022-08-18 11:59:20 -04:00
parent 05f940026f
commit 082f529c32
5 changed files with 24 additions and 24 deletions

View File

@@ -70,17 +70,18 @@ public class BlocksMined implements Listener {
}
// read the current stats from the item
// if they don't exist, then start from 0
Integer blocksMined = 0;
Integer blocksMined = null;
PersistentDataContainer container = meta.getPersistentDataContainer();
if (container.has(toolStats.genericMined, PersistentDataType.INTEGER)) {
blocksMined = container.get(toolStats.genericMined, PersistentDataType.INTEGER);
}
if (blocksMined == null) {
return;
} else {
blocksMined++;
blocksMined = 0;
}
blocksMined++;
container.set(toolStats.genericMined, PersistentDataType.INTEGER, blocksMined);
String configLore = toolStats.getLoreFromConfig("blocks-mined", false);
String configLoreRaw = toolStats.getLoreFromConfig("blocks-mined", true);