sp614x / optifine

1.79k stars 418 forks source link

CIT for modded items doesn't work upon initial game launch #1234

Open PetasiGit opened 6 years ago

PetasiGit commented 6 years ago

I'm using CIT for some modded items and it doesn't work until I reload the pack while in a world. CIT for vanilla items work fine. The CIT are using models to get around a rendering issue which seems to happen if I try to use textures for modded items in the minecraft/mcpatcher folders.

Tell me if you need pictures or more info on anything.

sp614x commented 6 years ago

Link to sample resource pack?

PetasiGit commented 6 years ago

The CITs are for The Betweenlands mod. The mod has a feature where you can craft gear with 3 different types of gems, and most normal armor has special textures for when the gems are applied.

However, the mod makers haven't added special textures for rubber boots or the upgraded version of rubber boots called "Boots of the Marsh Runner". That's why I'm using CIT in the first place.

Rubber Boots CIT.zip

PetasiGit commented 6 years ago

Appears to not happen any more in D1.

nihiluis commented 5 years ago
type=item
matchItems=gss-client-rpg:weapon_10000 gss-client-rpg:weapon_5000 gss-client-rpg:weapon_2500 gss-client-rpg:weapon_1000 gss-client-rpg:weapon_500 gss-client-rpg:weapon_200
texture=hardened_wood_sword
model=gs_sword
nbt.display.Name=regex:^.*Hardened Wood Sword.*$

I have the same issue with newest 1.12.2 U E7. Can you reopen this please? @sp614x @okl1001

nihiluis commented 5 years ago

I think the culprit may be that the client has given different ids (numeric) than the server and when the resource pack is being reloaded (on the server) it will only then use the proper ids.

just a guess/intuition though.

sp614x commented 5 years ago

If the items have dynamic IDs depending on current world/server then this may not be easy to fix.

nihiluis commented 5 years ago

it's not really dynamic, but in respect to item ids sometimes changing on startup/joining the server. I often get the log msg that a certain item hasn't received the right id.

See:

[15:35:38] [Netty Epoll Client IO #0/DEBUG] [FML]: Registry Item: Fixed minecraft:items id mismatch my-mod:puzzle_pillar: 4650 (init) -> 4337 (map).

sp614x commented 5 years ago

This looks like dynamically changing an item id, probably to avoid conflicts. At startup 4650 (init), on world load 4337 (map).

nihiluis commented 5 years ago

Ah ok, so you were thinking about that already. That sucks then...

Do you know if there is anything to prevent this from happening? Will this perhaps be fixed with later versions of the game? (because no ids exist anymore?)

The server has exactly the same mods as client.

Thank you.

sp614x commented 5 years ago

IDs still exist internally, but they are not fixed anymore. The only way to fix it would be to reload all item related resources when joining a server.

Kompreya commented 4 years ago

This issue is still occurring on preview_OptiFine_1.12.2_HD_U_F6_pre1

I am using CIT to replace textures of modded items based on their NBT.

Example properties file: type=item items=dungeontactics:magic_scroll enchantmentIDs=dungeontactics:companion

Steps to reproduce: Launch modpack with CIT texture files in correct folders, with OF installed Enter world View modded item which texture was replaced using CIT Texture is still the original texture, not the replaced texture using CIT Hit esc, options, and resource packs Disable, then enable resource pack Resume game, CIT texture is applied as expected.

I'm a modpack dev and relying on CIT to replace some textures, so for players who download the modpack and install OF, they won't see replaced textures unless the reload the resource pack on every play session. You can imagine that the number of players who are willing to do this would be extremely low, essentially rendering my texture replacements useless.

Ski-z commented 2 years ago

Did this ever get resolved with latest 1.12.2 OF?

Sazuzaki commented 1 year ago

1.16.5 G8 works only if the world has the same mods it was created with. Adding/removing any mods breaks modded CIT completely. Wondering if editing certain world data would fix the issue?

Sazuzaki commented 1 year ago

Okay, found a fix that's worked for me on 1.16.5.

Download NBTExplorer Launch NBTExplorer and have it open your world's level.dat Delete the fml tag and the forge tag (DO NOT TOUCH THE DATA TAG) File -> Save Launch your world

I might have no idea what I'm doing, but this seems to delete all mod registries in the world and forces the game to refresh them, which in turn fixes the CIT? Idk, but hope this helps someone.