Jump to content

Editing Vanilla Classes | Vertical Slabs (1.15.2-forge-31.1.0)


Crasseyon

Recommended Posts

What is the cleanest way of 'editing' vanilla classes?
As for more detail to my current predicament:
I decided to add vertical slabs to my mod so I wrote a new block template (ComplexSlabBlock) as well as a class for the required blockstates. Most slabs I register with my mod I add with "... Block EXAMPLE_SLAB = register(new ComplexSlabBlock(...))". This method works for new slabs but I can't find a way to make slabs that are already in the game use this template.
Simply changing the line "... Block COBBLESTONE_SLAB = register("cobblestone_slab", new SlabBlock(...))" would do the trick. (I don't care about mod compatibility for now)
I did some research and found that one way of overwriting classes is "reloading" but from what I've read so far it sounds fairly advanced and easy to mess up so I want to stay away from that as much as possible.

Link to comment
Share on other sites

I've thought about doing that but decided against it. (I'm kind of a stickler for consistency ingame)
In this case splitting vertical from horizontal slabs only makes sense from a coding perspective but not from a gameplay one. It would create this imaginary line between modded and vanilla content that makes it feel detached from the vanilla game. I would honestly go the extra mile just to make additional content feel as integrated and natural as possible even if the result is incompatibility with other mods.

Link to comment
Share on other sites

So.. all you want is to have the vanilla item place both the vertical and horizontal slab based on how its used?

Ok. Then just replace the Slab item in the registry. Its a simple process. You control the placing, so the BLOCK itself can be separate blocks, but the item in your inventory is the same.

  • Thanks 1

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.