MehVahdJukaar / polytone

Other
31 stars 2 forks source link

Issue of changing Redstone dust particle #47

Closed MrdotDex closed 1 month ago

MrdotDex commented 1 month ago

I've been able to change the color of the redstone wire AND it changes the redstone dust color to match, but the redstone dust color coming off of the repeaters, torches ect... doesn't change to the color of the redstone color.

I'm trying to change the color of redstone to blue and the particles as well, but as stated above, only the dust for the redstone wire gets changed appropriately, the rest stay the vanilla color of red.

I tried particle modifiers but they change the minecraft:dust particle for other blocks as well AND I'd like to keep things as close to vanilla as possible, meaning, if you change the color of the minecraft:dust particle inside of a particle modifier, I don't know if it's possible to make it cycle through the different color brightness's of redstone.

Also particle modifiers's "target" attribute doesn't seem to work, at least for repeaters.

Here's my particle modifier file text:

{
  "targets": ["minecraft:dust"],
  "red": "0.027",
  "green": "0.404",
  "blue": "0.902",
  "filter": {
    "block": "minecraft:repeater"
  }
}
MehVahdJukaar commented 1 month ago

so i see the wiki actually has some incorrect info. When a particle it spawned it reatains no history of where of why it was spawned. The filter block is only able to do so because some of them do have a BlockState field, which is used to determine their texture. These are just terrain particles or item broken particles. Unlike whats written on the wiki, dust particles are not included. I'll update that.

your json seems correct except for the filter block which wl be ignored. Since dust particles are used in many places not just redstone, the easiest way to change redstone dust color is via the color.properties /color.json file. That allows to replace the color array that is used across all those things. Check that section

another method would be to hardcode a color check in the color fields of the modifier, in preudo code, if originalcolor==redstone color 0 then color=new color otherwise keep the old

MrdotDex commented 1 month ago

I forgot to mention that I did do the redstone colors in the colors.json, here's what I have. But as I mentioned, it only changes the redstone dust color, it doesn't change any of the other blocks like repeaters, torches ect... If possible I'd love if the others would change as well or could be modified in a specific way, cause they HAVE to be taking that redstone color from somewhere. Also, thanks for the quick response.

{
  "redstone": {
    "0": "001023",
    "1": "00152f",
    "2": "011a3c",
    "3": "012149",
    "4": "022655",
    "5": "022c62",
    "6": "03316f",
    "7": "03377b",
    "8": "033e8b",
    "9": "044397",
    "10": "044aa4",
    "11": "054fb0",
    "12": "0654bd",
    "13": "065aca",
    "14": "0660d6",
    "15": "0767e6"
  }
}
MehVahdJukaar commented 1 month ago

in vanilla this is all very hadcoded. Very odd as instead of sampling from that color at power 15 they just have a shade of red hardcoded in there. I'll modify that but will likely still not work with mod stuf fas mods can spawn a dust particle with a red color and theres no way of knowing if its supposed to be redstone particle or something else that is also red

MrdotDex commented 1 month ago

Thanks, I honestly only care for the vanilla aspect of this, not other mod related things, cause I'm guessing when you say "mod stuff" you literally mean other mods like Tinkers Constructs and things like that. Also, I have no idea how this works, when you update the mod, do I go on modrinth to get the latest update of the mod or how does this works as I'd like to test it before closing this "issue".

MehVahdJukaar commented 1 month ago

try new version. 1.20.1 for now

MrdotDex commented 1 month ago

I can confirm that the redstone colors in the colors.json are now appearing in the dust in redstone torches, repeater ect... in the 1.20.1 version