Jump to content

Recommended Posts

Posted

I was recently trying to create a custom Effect and a custom glass pane.

But I had to make my own custom class that extended the Effect class since it's constructor is marked protected. I had to the same thing with my custom glass pane.

I don't get why these constructors are protected? Is there actually a reason for it? Seems unnecessary to have to create empty classes just to access a constructor of a vanilla one.

 

I mean yeah, if you're want implement some custom behavior then you obviously have to create a custom class, but I just want custom textures, not custom functionality which means that creating a brand new class is really wasteful.

Posted
  On 3/28/2020 at 3:54 PM, diesieben07 said:

Vanilla Minecraft code is not written with mods in mind. It is written for the vanilla game and only that.

Plus, Minecraft code is ran through an obfuscator, which often does some optimizations and might reduce the actual visibility of the constructors.

 

All that said, there is nothing wrong with just making a subclass, it is not "really wasteful".

Expand  

Yeah I know vanilla isn't developed for mods, but it would still be convenient if you could easily make custom variants of certain blocks and things like effects.

It's not really a big deal to have to create a brand new class, but it's still more convenient if don't have to. Especially since you might not want to add custom behavior.

Posted

Pretty sure simply using Reflection is also a viable option

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

Forge can add ATs to class constructors. We do it for quite a bit. However you cant just be vague and say "some classes".

Make a specific PR and explain why.

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

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.