Minor optimization when turning MRL into blockstate list

This commit is contained in:
embeddedt 2023-05-08 14:22:50 -04:00
parent 85025b77fb
commit 833fdc9ae5
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -321,6 +321,10 @@ public class ModelBakeryHelpers {
}
}
}
// check if there is only one possible state
if(fixedProperties.size() == stateDefinition.getProperties().size()) {
return ImmutableList.of(fixedState);
}
// generate all possible blockstates from the remaining properties
ArrayList<Property<?>> anyProperties = new ArrayList<>(stateDefinition.getProperties());
anyProperties.removeAll(fixedProperties);