Update to 1.21.8

Hopefully everything is compatible
This commit is contained in:
2025-07-20 08:32:58 +02:00
parent ebbf3a6983
commit 1b9155d480
6 changed files with 20 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.10-SNAPSHOT'
id 'fabric-loom' version '1.11-SNAPSHOT'
id 'maven-publish'
}

View File

@@ -2,20 +2,20 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.5
yarn_mappings=1.21.5+build.1
minecraft_version=1.21.8
yarn_mappings=1.21.8+build.1
loader_version=0.16.14
# Mod Properties
mod_version=1.5.6
mod_version=1.5.8
maven_group=systems.brn
archives_base_name=servershop
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.121.0+1.21.5
fabric_version=0.129.0+1.21.8
# Dependencies
polymer_version=0.12.3+1.21.5
server_translations_api_version=2.5.0+1.21.5-rc1
servergui_version=1.9.0+1.21.5
placeholder_api=2.6.2+1.21.5
polymer_version=0.13.7+1.21.8
server_translations_api_version=2.5.1+1.21.5
servergui_version=1.10.2+1.21.8
placeholder_api=2.7.1+1.21.6

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@@ -4,6 +4,7 @@ import com.mojang.authlib.GameProfile;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtOps;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.server.MinecraftServer;
@@ -20,10 +21,12 @@ public record AuctionRecord(double buyPrice, ItemStack stack, UUID sellerUUID) {
nbt.putDouble("BuyPrice", this.buyPrice);
putUUID(nbt, "SellerUUID", sellerUUID);
// Serialize the ItemStack to NBT and add it to the compound
NbtElement stackNbt = stack.toNbt(wrapperLookup);
nbt.put("ItemStack", stackNbt); // Adds the ItemStack's NBT data to the main NBT compound
// Serialize the ItemStack to NBT and add it to the compound
nbt.put("ItemStack", ItemStack.CODEC, stack);
return nbt;
}
@@ -37,9 +40,8 @@ public record AuctionRecord(double buyPrice, ItemStack stack, UUID sellerUUID) {
Optional<UUID> sellerUUID = getUUID(nbt, "SellerUUID");
// Deserialize the ItemStack from the NBT
NbtElement stackElement = nbt.get("ItemStack");
Optional<ItemStack> stack = nbt.get("ItemStack", ItemStack.CODEC);
Optional<ItemStack> stack = ItemStack.fromNbt(wrapperLookup, stackElement);
return sellerUUID.flatMap(uuid -> stack.map(itemStack -> new AuctionRecord(buyPrice, itemStack, uuid))).orElse(null);
}

View File

@@ -17,8 +17,7 @@ public record ItemPriceRecord(double buyPrice, double sellPrice, ItemStack stack
// Serialize the ItemStack to NBT and add it to the compound
if (stack != null && !stack.isEmpty()) {
NbtElement stackNbt = stack.toNbt(wrapperLookup);
nbt.put("ItemStack", stackNbt); // Adds the ItemStack's NBT data to the main NBT compound
nbt.put("ItemStack", ItemStack.CODEC, stack);
return nbt;
}
return null;
@@ -32,10 +31,8 @@ public record ItemPriceRecord(double buyPrice, double sellPrice, ItemStack stack
if (sellPrice > buyPrice && buyPrice != 0) {
buyPrice = sellPrice;
}
// Deserialize the ItemStack from the NBT
NbtElement stackElement = nbt.get("ItemStack");
Optional<ItemStack> stack = ItemStack.fromNbt(wrapperLookup, stackElement);
Optional<ItemStack> stack = nbt.get("ItemStack", ItemStack.CODEC);
double finalBuyPrice = buyPrice;
return stack.map(itemStack -> new ItemPriceRecord(finalBuyPrice, sellPrice, itemStack)).orElse(null);

View File

@@ -93,6 +93,7 @@ public class PriceStorage {
if (element instanceof NbtCompound nbt) {
ItemPriceRecord itemPriceRecord = ItemPriceRecord.fromNbt(nbt, wrapperLookup);
if (itemPriceRecord != null && itemPriceRecord.stack() != null && !hasPrices(itemPriceRecord.stack())) {
itemPriceRecord.stack().remove(DataComponentTypes.TOOLTIP_DISPLAY);
prices.put(itemPriceRecord.stack(), itemPriceRecord);
}
}