Jump to content

Extending Blocks/Entities from other mods breaks resource paths


Go to solution Solved by The Insanity God,

Recommended Posts

Posted

 

Version: v1.21.6 (Stable)

 

Summary:

While Extending the basic survival mod's Axle Block Entity Behavior class, the hard coded references to "block/wood/mechanics/axle-stand-*" search for the source files in myfirstmod:block/wood/mechanics/ instead of game:block/wood/mechanics

Is there a way to fix this without duplicating the underlying code with a new string "game:block/wood/mechanics/axle-stand-*" ?

 

Detailed Description:

I am attempting to extend the Axle Class in the same way as the "Brake" mechanical block in the survival mod.

When I override the Initialise function and call `base.Initialize(api, properties);` , the game then tries to find the resources at myfirstmod:block/wood/mechanics/ instead of game:block/wood/mechanics

 

The Code tutorials are fairly light on details and I couldn't find any guides on how to do this, or if its possible at all. Is there a way to reuse the base.Initialise without copying the code or the resources into my own mod? 

 

 

MyFirstMod.zip

Posted

It tries to look into myfirstmod because it's in \myfirstmod\blocktypes probably

  • You can try to move it into \game domain, it's not a clean way and can confuse players/modders later though
  • Rewrite Initialize and don't call base
  • Patch it with harmony, to replace this hardcoded strings when you need it

Maybe somebody with more expirience with mechanical blocks will suggest something better

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.