Data fix for previous bug

This commit is contained in:
Bruno Rybársky 2024-08-24 17:39:08 +02:00
parent f4a08c795d
commit 375750fca6
2 changed files with 4 additions and 2 deletions

@ -6,7 +6,7 @@ minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3 yarn_mappings=1.21.1+build.3
loader_version=0.16.2 loader_version=0.16.2
# Mod Properties # Mod Properties
mod_version=1.4.7 mod_version=1.4.8
maven_group=systems.brn maven_group=systems.brn
archives_base_name=servershop archives_base_name=servershop
# Dependencies # Dependencies

@ -16,6 +16,8 @@ import java.util.Scanner;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import static systems.brn.servershop.lib.Util.hasPrices;
public class PriceStorage { public class PriceStorage {
public final MinecraftServer server; public final MinecraftServer server;
@ -86,7 +88,7 @@ public class PriceStorage {
for (NbtElement element : nbtList) { for (NbtElement element : nbtList) {
if (element instanceof NbtCompound nbt) { if (element instanceof NbtCompound nbt) {
ItemPriceRecord itemPriceRecord = ItemPriceRecord.fromNbt(nbt, wrapperLookup); ItemPriceRecord itemPriceRecord = ItemPriceRecord.fromNbt(nbt, wrapperLookup);
if (itemPriceRecord.stack() != null) { if (itemPriceRecord.stack() != null && !hasPrices(itemPriceRecord.stack())) {
prices.put(itemPriceRecord.stack(), itemPriceRecord); prices.put(itemPriceRecord.stack(), itemPriceRecord);
} }
} }