Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge block state ignore textures #5615

Closed
ZeroNoRyouki opened this issue Mar 16, 2019 · 13 comments
Closed

Forge block state ignore textures #5615

ZeroNoRyouki opened this issue Mar 16, 2019 · 13 comments
Assignees
Labels
1.14 Bug This request reports or fixes a new or existing bug.

Comments

@ZeroNoRyouki
Copy link

ZeroNoRyouki commented Mar 16, 2019

The following (forge) block state worked fine in 1.12.2:

{
"forge_marker":1,
"defaults":{
"textures":{
"plate":"bigreactors:block/turbine/legacy/housing.plate",
"machine":"bigreactors:block/turbine/legacy/creativesteamgenerator",
"particle":"#machine",
"down":"#machine",
"up":"#machine",
"north":"#machine",
"south":"#machine",
"west":"#machine",
"east":"#machine"
},
"model":"cube"
},
"variants":{
"afstate":{
"disassembled":{
},
"assemblednorth":{
"textures":{
"down":"#plate",
"up":"#plate",
"south":"#plate",
"west":"#plate",
"east":"#plate"
}
},
"assembledsouth":{
"textures":{
"down":"#plate",
"up":"#plate",
"north":"#plate",
"west":"#plate",
"east":"#plate"
}
},
"assembledwest":{
"textures":{
"down":"#plate",
"up":"#plate",
"north":"#plate",
"south":"#plate",
"east":"#plate"
}
},
"assembledeast":{
"textures":{
"down":"#plate",
"up":"#plate",
"north":"#plate",
"south":"#plate",
"west":"#plate"
}
},
"assembledup":{
"textures":{
"down":"#plate",
"north":"#plate",
"south":"#plate",
"west":"#plate",
"east":"#plate"
}
},
"assembleddown":{
"textures":{
"up":"#plate",
"north":"#plate",
"south":"#plate",
"west":"#plate",
"east":"#plate"
}
}
},
"portdirection":{
"outlet":{
},
"inlet":{
}
}
}
}

Now in 1.13.2 (Forge 25.0.84) the default textures block is not applied and the block show up in game with the missing-texture texture. Setting the textures in all the variants has no effect too.

Loading that blockstate give the following warnings from ModelBakery :

Unable to resolve texture reference: #down in minecraft:block/cube
Unable to resolve texture reference: #up in minecraft:block/cube
Unable to resolve texture reference: #north in minecraft:block/cube
Unable to resolve texture reference: #south in minecraft:block/cube
Unable to resolve texture reference: #west in minecraft:block/cube
Unable to resolve texture reference: #east in minecraft:block/cube

Also note that no error is emitted if the texture path is wrong (eg: "blocks" instead of "block")

Z

@tterrag1098 tterrag1098 added Bug This request reports or fixes a new or existing bug. 1.13 labels Mar 16, 2019
@tterrag1098
Copy link
Contributor

A more complete repro case would be helpful, as is I would have to recreate a lot of your code.

@ZeroNoRyouki
Copy link
Author

Sure, here you go:

https://github.com/ZeroNoRyouki/forgetest5615

I kept the original (1.12.2) forge block state for the 2 blocks the example add (you can find them in the mics creative tab, sorry no langs) with the exception of modid and directory names

For the "turbinefluidport" block, you can cycle the "afstate" property by clicking on the block. If you sneak, you cycle the "portdirection" property. The same goes for the "turbinecreativesteamgenerator" block but only for the "afstate" property (the other one is fixed for that block)

Also note that those blockstates define an "inventory" variant but that is flagged as an error:


 [Sound Library Loader/INFO] [minecraft/SoundManager]: Sound engine started
 [Client thread/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'forgetest5615:blockstates/turbinefluidport.json' in resourcepack: 'main' for variant: 'inventory': Unknown blockstate property: 'inventory'
 [Client thread/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'forgetest5615:blockstates/turbinecreativesteamgenerator.json' in resourcepack: 'main' for variant: 'inventory': Unknown blockstate property: 'inventory'
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to load model: 'forgetest5615:turbinefluidport#inventory' referenced from: forgetest5615:turbinefluidport#inventory: java.io.FileNotFoundException: forgetest5615:models/item/turbinefluidport.json
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to load model: 'forgetest5615:turbinecreativesteamgenerator#inventory' referenced from: forgetest5615:turbinecreativesteamgenerator#inventory: java.io.FileNotFoundException: forgetest5615:models/item/turbinecreativesteamgenerator.json
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to resolve texture reference: #down in minecraft:block/cube
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to resolve texture reference: #up in minecraft:block/cube
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to resolve texture reference: #north in minecraft:block/cube
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to resolve texture reference: #south in minecraft:block/cube
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to resolve texture reference: #west in minecraft:block/cube
 [Client thread/WARN] [minecraft/ModelBakery]: Unable to resolve texture reference: #east in minecraft:block/cube
 [Client thread/INFO] [minecraft/TextureMap]: Max texture size: 8192

@MajorTuvok
Copy link
Contributor

MajorTuvok commented Mar 19, 2019

Just as a note: It says FileNotFoundException - I'm pretty sure that's your fault... (Though this exception message isn't the nicest...)

@ZeroNoRyouki
Copy link
Author

Nop, the exception itself is correct: the file do not exist. And it did not exist in 1.12.2 / 1.11.x / 1.10.x too

It should resolve the "inventory" variant using the forge block state, not by looking for an "external" model for the item

@LexManos
Copy link
Member

It appears the BlockState loading hooks have not been ported into 1.13, and thus the 'ForgeBlockstate' doesn't exists.
If someone wants to take a look into this that know more about rendering then I do then go for it. I wrote the original permutation hooks, but fry came along behind me and expanded it into a format I don't know anymore.

@mcenderdragon
Copy link
Contributor

it seems like BlockStateLoader$ForgeVariant#process is never called and thus the textures never get overwritten. The forgeblockstae itself is there though.

@MrCrayfish
Copy link
Contributor

Just ran into this problem myself. Hopefully it can fixed because it will save me creating hundreds of JSON files.

@tterrag1098 tterrag1098 added the Needs Update This request requires an update from the author to confirm whether the request is relevant. label Jun 12, 2019
@MrCrayfish
Copy link
Contributor

This is still an issue. Currently using forge-1.14.2-26.0.33

@tterrag1098 tterrag1098 self-assigned this Jun 21, 2019
@Ferdzz
Copy link

Ferdzz commented Jul 10, 2019

This issue appears to still be present as of forge-1.14.3-27.0.25, so I think we should update the tag to 1.14

I'm using a custom json model however, so this might not be the same exact repro as @ZeroNoRyouki & @MrCrayfish . The model refers to #texture which is defined in my BlockState, like in 1.12

{
  "forge_marker": 1,
  "defaults": {
    "model": "placeableitems:bone",
    "textures": {
      "texture": "placeableitems:block/bone"
    }
  },
  "variants": {
    "": [ { } ]
  }
}

However I'm getting the error

[minecraft/ModelBakery]: Unable to resolve texture reference: #texture in placeableitems:block/bone

I have a very basic commit you can have a look at for a minimal example

@Draco18s
Copy link
Contributor

Draco18s commented Jul 23, 2019

Using Forge 1.14.3-27.0.60
Additional information
It does not appear that texture overrides due to a variant property are being utilized at all either.

eg:

    "variants": {
        "int_prop": {
            "1": {
                "textures": {
                    "overlay": "harderores:block/ore/overlay_1"
                }
            },
         ...

That overlay texture override never gets used when rendering. Instead only the original texture specified in the model gets rendered. Using the debugger and examining the Forge BlockStateLoader it does correctly parse the JSON and generate the correct variants with the correct textures, correctly identifies "not vanilla compatible" and inserts the correctly constructed object into a list of models that eventually get baked.

As far as I can tell, its not an issue with parsing the JSON, constructing models, or baking those models, but in the game deciding how to render the variant.

The only thing that will cause a change in displayed texture is providing a new model which points to a different texture. If this is intentional on the part of Forge, then it should be noted on the update notes gist: https://gist.github.com/williewillus/353c872bcf1a6ace9921189f6100d09a

@Ferdzz
Copy link

Ferdzz commented Aug 10, 2019

@tterrag1098 Since we were able to reproduce on the latest version, and in 1.14, would it be possible to update the issue title & tags? Unless you need something more to help reproduce, in which case let me know!

@tterrag1098 tterrag1098 added 1.14 and removed 1.13 Needs Update This request requires an update from the author to confirm whether the request is relevant. labels Aug 10, 2019
@tterrag1098 tterrag1098 changed the title [1.13.2] Forge block state ignore textures Forge block state ignore textures Aug 10, 2019
@TeamSpen210
Copy link

From what I can tell, I think the problem is with the baking process itself. In VariantList.bake(), the textures data is entirely ignored and not passed down to the model that's baked.

@gigaherz
Copy link
Contributor

gigaherz commented Oct 8, 2019

Should be fixed as of 28.1.40 / 5e9380a

@gigaherz gigaherz closed this as completed Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.14 Bug This request reports or fixes a new or existing bug.
Projects
None yet
Development

No branches or pull requests

10 participants