Fix charge type predicate

This commit is contained in:
Eclipse 2024-12-12 13:57:32 +00:00
parent 361df163b8
commit b80c054f53
No known key found for this signature in database
GPG key ID: 95E6998F82EC938A

View file

@ -75,7 +75,6 @@ public final class CustomItemTranslator {
}
Key itemModel = components.getOrDefault(DataComponentType.ITEM_MODEL, MinecraftKey.key("air"));
System.out.println(itemModel + " is the model!");
Collection<Pair<CustomItemDefinition, ItemDefinition>> customItems = allCustomItems.get(itemModel);
if (customItems.isEmpty()) {
return null;
@ -111,7 +110,7 @@ public final class CustomItemTranslator {
if (match.property() == MatchPredicateProperty.CHARGE_TYPE) {
ChargeType expected = (ChargeType) match.data();
List<ItemStack> charged = components.get(DataComponentType.CHARGED_PROJECTILES);
if (charged == null) {
if (charged == null || charged.isEmpty()) {
return expected == ChargeType.NONE;
} else if (expected == ChargeType.ROCKET) {
for (ItemStack projectile : charged) {