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

[Feature request] custom textures for every color of a CEM bed #2709

Closed
Maluscat opened this issue Jul 31, 2019 · 6 comments
Closed

[Feature request] custom textures for every color of a CEM bed #2709

Maluscat opened this issue Jul 31, 2019 · 6 comments

Comments

@Maluscat
Copy link

Maluscat commented Jul 31, 2019

Hey,
In the last few days, I have transferred my bed model from 1.11- to OptiFine's CEM system so that it can be used in 1.12+ again.
I think it looks kinda cool:
image

Sadly, custom bed models can only have one fixed texture for its color, and having no colored beds is a huge drawback for most people. As you know, as it's an entity, resource packs can't control anything except the texture by default, so it would be amazing if you added a system to apply color to CEM beds again!

I'm thinking of something a bit like the custom GUI system, here is my proposal:


In optifine/cem, there's a file e.g. called "cem_bed_colors.property". The file contains properties of what texture is applied to what color of the bed, for example like this:

entity=bed
property=color
red=bed_red
blue=bed_blue
cyan=bed_cyan
...

Where bed, bed_red, bed_blue, etc. are .png files in the same folder of the .properties file or in subfolders when specified. I also thought that just throwing colors in the file is maybe a bit too specific, so I added a property trait to define what is being customized (But you can decide best on how the structure should look).
In the actual CEM model, one will define something like a property or properties property, in which a .property file is specified. This is then read and applied to the model part!
Example:

"texture": "bed",
"textureSize": [16, 16],
"property": "cem_bed_colors",
"boxes": [
   ...
]

A "texture" property still needs to be specified - it functions as the default texture if not all colors are specified in the .properties file and as fallback if the file cannot be read correctly.
I hope this helps a bit!

Cheers,
Hallo89

Maluscat added a commit to Maluscat/Dandelion-With-Mods that referenced this issue Jul 31, 2019
@Francy-chan
Copy link

Actually you can do it, just don't specify the texture path, so it will use the default minecraft path.
Example:
2019-10-24_14 58 05
image

@Maluscat
Copy link
Author

You deserve a price, my man.
Although it's still not as good as having separate configurable textures, I didn't think of the fact that custom entity models will take the Minecraft texture by default, even if it has multiple variants.
You are a genius, thanks so much!

I've actually already finished the new models:
Colored bed models

Gonna close the issue, a solution, even if it's not the proposed one, has been found after all

Maluscat added a commit to Maluscat/Dandelion-With-Mods that referenced this issue Oct 24, 2019
- Optifine's custom entity models use the default texture for the model by default, so I have moved the color-sensitive textures over to the default textures in /textures/entity/bed & adapted the UV coordinates
- Also improved the default Minecraft bed texture (frame)
@ZenithRogue
Copy link
Collaborator

I believe this issue should be reopened. If a user is not using optifine, their bed textures will be entirely warped and distorted.

@ZenithRogue
Copy link
Collaborator

The only way around that for a resource pack, is by having these changes in a separate addon pack

@Maluscat
Copy link
Author

This is not true, the default UV does not have to be modified in any way.
The texture UV does not fill the whole 64x64 texture, so there is quite a bit unused space which one can use to add custom textures. That is, if one actually needs custom textures: I did in my case because the model is quite different from the default model, but in most cases one should be able to use the default texture

@Francy-chan
Copy link

Correctly, I use that method for some custom mob models based on biome or variant, and it doesn't glitch without optifine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants