Fix Auction House ID Saving

This commit is contained in:
Kam committed 2026-03-15 18:23:14 -04:00
1 parent 85ef28ca76
commit f6e7809a29
2 files changed
+6 -8

No files matched your search

@@ -2,6 +2,7 @@ package noppes.npcs.controllers.data;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.api.handler.data.IAuctionClaim;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.config.ConfigMarket;
@@ -209,9 +210,7 @@ public class AuctionClaim implements IAuctionClaim {
compound.setInteger("Type", type.ordinal());
if (item != null) {
NBTTagCompound itemTag = new NBTTagCompound();
item.writeToNBT(itemTag);
compound.setTag("Item", itemTag);
compound.setTag("Item", NoppesUtilServer.writeItem(item, new NBTTagCompound()));
}
compound.setString("ItemName", itemName != null ? itemName : "");
@@ -235,7 +234,7 @@ public class AuctionClaim implements IAuctionClaim {
type = EnumClaimType.fromOrdinal(compound.getInteger("Type"));
if (compound.hasKey("Item")) {
item = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("Item"));
item = NoppesUtilServer.readItem(compound.getCompoundTag("Item"));
} else {
item = null;
}
@@ -2,6 +2,7 @@ package noppes.npcs.controllers.data;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.api.handler.data.IAuctionListing;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.config.ConfigMarket;
@@ -214,9 +215,7 @@ public class AuctionListing implements IAuctionListing {
compound.setString("SellerName", sellerName != null ? sellerName : "");
if (item != null) {
NBTTagCompound itemTag = new NBTTagCompound();
item.writeToNBT(itemTag);
compound.setTag("Item", itemTag);
compound.setTag("Item", NoppesUtilServer.writeItem(item, new NBTTagCompound()));
}
compound.setLong("StartingPrice", startingPrice);
@@ -243,7 +242,7 @@ public class AuctionListing implements IAuctionListing {
sellerName = compound.getString("SellerName");
if (compound.hasKey("Item")) {
item = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("Item"));
item = NoppesUtilServer.readItem(compound.getCompoundTag("Item"));
}
startingPrice = compound.getLong("StartingPrice");