mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
Fix itemexchange
This commit is contained in:
@@ -83,7 +83,7 @@ public record BulkExchangeRule(List<ExchangeRule> rules) implements ExchangeData
|
||||
return null;
|
||||
}
|
||||
final CustomData itemNBT = ItemUtils.getNMSItemStack(item).get(DataComponents.CUSTOM_DATA);
|
||||
if (itemNBT.copyTag().contains(BULK_KEY)) {
|
||||
if (itemNBT != null && itemNBT.copyTag().contains(BULK_KEY)) {
|
||||
var t = new NBTCompound(itemNBT.copyTag());
|
||||
|
||||
final var rulesNBT = t.getCompound(BULK_KEY).getCompoundArray(RULES_KEY);
|
||||
|
||||
@@ -461,7 +461,7 @@ public final class ExchangeRule implements ExchangeData {
|
||||
return null;
|
||||
}
|
||||
final CustomData itemNBT = ItemUtils.getNMSItemStack(item).get(DataComponents.CUSTOM_DATA);
|
||||
if (itemNBT.copyTag().contains(RULE_KEY)) {
|
||||
if (itemNBT != null && itemNBT.copyTag().contains(RULE_KEY)) {
|
||||
return fromNBT(new NBTCompound((CompoundTag) itemNBT.copyTag().get(RULE_KEY)));
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user