Project-RT / RandomTweaker

Provides many more mods support and great features for CraftTweaker.
https://www.curseforge.com/minecraft/mc-mods/randomtweaker
MIT License
21 stars 8 forks source link

Botania custom flower using ISubTileEntityGenerating can't locate texture location #84

Closed TabakaSIM closed 3 weeks ago

TabakaSIM commented 3 weeks ago

I've created a custom flower for Botania using ISubTileEntityGenerating. Name localisation works fine.

However, it can't locate (or load) the texture location. According to the wiki it should be in the resources/contenttweaker/textures/blocks folder and the texture file should be named "custom_flower.png" (with flower unlocalisedName is custom_flower).

I also tried file names like flower_gen_custom_flower.png and changing the location of the structure to resources/botania/textures/blocks, but still no luck :(

Block texture doesn't load at all and item texture is default as on ss Screenshot_20240823_143813

ikexing-cn commented 3 weeks ago

See https://github.com/Project-RT/RandomTweaker/blob/1.12.2-New/src/main/java/ink/ikx/rt/impl/mods/contenttweaker/MCBotaniaContentEvent.java#L27-L44

You should check the specific location from auto-gen blockstate(usually located in resources/contenttweaker/blockstates/ur_flower_unlocalized_name.json)

TabakaSIM commented 3 weeks ago

Do I understand correctly that it should be auto-generated? I searched all my computer files, but ur_flower_unlocalized_name.json doesn't generate.

I also tried to make one blockstate file myself with resource loader but it doesn't work too.

Another question: I've also tried to create two lang file (using resource loader) located

  1. resources/contenttweaker/lang/en_us.lang
  2. resources/botania/lang/en_us.lang (1.) file didn't worked, but (2.) file actually worked and displayed flower name. Could it be related?
ikexing-cn commented 3 weeks ago

Yes, it should indeed be auto-generated, but what I mean is to find the "name of your flower", not that it's name should literally be "ur_flower_unlocalized_name".

As for the language file, I think their location shouldn't matter. Could you show me your code and the CrT logs?

TabakaSIM commented 3 weeks ago

jikanacea.zs file

# priority 100

import mods.contenttweaker.VanillaFactory;
import mods.randomtweaker.cote.ISubTileEntity;
import mods.randomtweaker.cote.BlockAdded;
import mods.randomtweaker.cote.ISubTileEntityGenerating;
import mods.randomtweaker.cote.ISubTileEntityFunctional;
import mods.contenttweaker.Color;

var jikanacea as ISubTileEntityFunctional = VanillaFactory.createSubTileFunctional("jikanacea");
jikanacea.register();

Here's my texture image location (it's literally other botania flower texture) Screenshot_20240824_125830

crafttweaker.log

ikexing-cn commented 3 weeks ago

Your code is missing CoT loader, so the blockstate file can't be auto-generated. If you want to know the specific details, you can check the Forge lifecycle documentation.

To resolve this issue, add the following line at the top of jikanacea.zs: #loader contenttweaker This should make it work properly.

TabakaSIM commented 3 weeks ago

Thank you so much! Everything works perfectly now!