Jump to content

Overridding vanilla block without extending its class


EMT32

Recommended Posts

Hello,

I recently added rail intersection and turnout to my mod. They're working properly with minecart, but not with the other rails (problem with connecting), so I decided to modify minecraft rail system, add more rail shapes to it and modify some methods to support them. I created a class that overrides AbstractRailBolck and now I've a problem because standard rail classes extend AbstractRailBlock, so I've to create class that extends my AbstractRailBlock extended class to override default rail. When I tried to run minecraft I received this error:

java.lang.RuntimeException: Invalid vanilla replacement. See log for details.

Is it possible to override vanilla rails without extending their classes? I know that minecart code also must be modified, but this is task for another time. Obliviusly my rail class has got the same names of block properties as the default one. I'm using Minecraft 1.16.5 and Forge 36.2.0.

PS: Sorry for my English.

Link to comment
Share on other sites

The class must extend the vanilla block's class or only properties must be same?

My rail has a shape property like the vanilla one, but I created for it a new enum with more states. Will it be a problem even if I modify all scripts that are using the old rail properties?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.