Merge remote-tracking branch 'origin/1.20' into 1.21.1

This commit is contained in:
embeddedt 2026-01-24 10:44:07 -05:00
commit 97c4b35c82
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 11 additions and 8 deletions

View File

@ -32,10 +32,3 @@ jobs:
with:
files: 'bin/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Add changelog to release
uses: irongut/EditRelease@v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
id: ${{ github.event.release.id }}
replacebody: true
files: "CHANGELOG.md"

View File

@ -21,7 +21,17 @@ public class ModelLocationBuilder {
private record PropertyData(ImmutableList<String> nameValuePairs, int maxPairLength) {}
public void generateForBlock(Set<ModelResourceLocation> destinationSet, Block block, ResourceLocation baseLocation) {
var props = block.getStateDefinition().getProperties();
// Make sure to iterate over the properties in the order of the getValues() map rather than using
// StateDefinition.getProperties(), to match the logic in BlockModelShaper.statePropertiesToString.
// In vanilla, these have the same order, because the backing implementation of getValues() is a map
// that preserves insertion order. However, in some versions of FerriteCore, getValues() may not
// preserve insertion order, but instead rely on hash order of the keys. This results in BlockModelShape
// and ModelLocationBuilder producing different MRLs. Using the keySet produces the same ordering as
// BlockModelShaper, provided that all states were built with the keys inserted in the same order into the same
// map implementation (which should always be true in practice).
// The above issue only seems to affect versions of FerriteCore after the switch to fastutil maps, but it
// is harmless to be consistent on older versions too, especially if another mod backports the fastutil change.
var props = block.defaultBlockState().getValues().keySet();
List<ImmutableList<String>> optionsList = new ArrayList<>(props.size());
int requiredBuilderSize = Math.max(0, props.size() - 1); // commas
for (var prop : props) {