Jump to content

How to update Codec for extension of Abstract class?


Recommended Posts

Posted

I am creating a new class which extends FoliagePlacer. I would like to add a new argument to the constructor, but that is giving me problems with the Codec definition for the class.

public CustomFoliagePlacer(FeatureSpread fs1, FeatureSpread fs2, int height, CustomTree customTree) {
        super(fs1, fs2);
        this.height = height;
        this.customTree = customTree;
    }

The new argument is a custom type so it's not possible to add it as you would like 

Codec.INT

Is there a way I can update the Codec definition so I can use this new argument?

Posted

You don't, the entire point of the codecs is that it knows what type its constructing.

You'll have to make your own codec.

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.