Skip to content

[1.20/1.3.3] Missing crop textures #36

@JL2210

Description

@JL2210

(and yes, this was hell to debug. Don't even ask.)

I think previously the mod would try to automatically pull textures from block/cropname_[0-7]? That doesn't appear to work now. Dead and young dead crops still work.

This commit looks to be the culprit (present starting in 1.3.2): 7dc357e

before:

final String texture = newID("block/", "_" + i).toString();
generator.blockModel(age, m -> {
m.parent("block/crop");
m.texture("crop", texture);
});

after:

@Override
protected void generateBlockModelJsons(AssetJsonGenerator generator) {
for (int i = 0 ; i <= stages ; i++) {
generator.blockModel(newID("", "_age_" + i), models[i]);
}
}

workaround (in code):

const cropCropname = e.create("modid:cropname", "tfc:crop");
for(var i = 0; i < 8; i++) {
  cropCropname.textureAt(i, "modid:block/cropname_" + i);
}

While I was at it it looks like I found an off-by-one error here as well? Should be <stages and not <=? Might be too late to fix this one.

@Override
protected void generateBlockModelJsons(AssetJsonGenerator generator) {
for (int i = 0 ; i <= stages ; i++) {
generator.blockModel(newID("", "_age_" + i), models[i]);
}
}
@Override
protected void generateBlockStateJson(VariantBlockStateGenerator bs) {
for (int i = 0 ; i <= stages ; i++) {
bs.simpleVariant("age=" + i, newID("block/", "_age_" + i).toString());
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements, additions, or problems with the documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions