Fix null crash due to initialization order

This commit is contained in:
Sollace 2024-11-17 18:29:57 +00:00
parent e074728a13
commit fb6ad2f25e
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -24,8 +24,10 @@ public record Appearance(ItemStack item, boolean replaceFully) {
); );
public Appearance { public Appearance {
if (UDataComponentTypes.APPEARANCE != null) {
item.remove(UDataComponentTypes.APPEARANCE); item.remove(UDataComponentTypes.APPEARANCE);
} }
}
public ItemStack unwrap(ItemStack stack) { public ItemStack unwrap(ItemStack stack) {
return item().isEmpty() ? stack : item(); return item().isEmpty() ? stack : item();