Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

  • Author

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?

  • Author

Ok, but when the properties are exactly the same, my rail's class doesn't have to extend the vanilla one?

  • Author

Thank you. I'll try without extending. When something crashes I'll think about changing my code.

  • Author

This diagram should make it easier to understand:

mod-classes.thumb.png.744be98d245e10e786a0bc194743d625.pngAfter changing the code to use original block properties I'm able to run it without any errors.

you can't extends the RailShapes, if you are overwrite a block because:

12 hours ago, diesieben07 said:

The properties must match exactly, you cannot add, remove or modify any properties.

so your own RailShapes != VanillaRailShapes

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.