Jump to content

Coremod - Replace base class with an extended one


SergiX44

Recommended Posts

Hi,

as a title, I want to extend some minecraft classes (like CustomWorldServer extends WorldServer) and replace some methods or fields. But how can I load those classes that extends the originals? 

I read about core modding, so i can remove via ASM the body of a function and add a static call to my classes, but if i need to replace multiple functions, this can be very awkward. 

There are best practices to do this in an easy manner?

Thanks!

Link to comment
Share on other sites

The experts don't teach core modding here. If you want to use Forge, then learn Forge (a wrapper that core-mods the game so you don't need to).

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

1 hour ago, diesieben07 said:

In theory yes, but in practice this is a terrible idea.

Please describe what you want to achieve, not how you want to code it.

 

I'm designing a better ticking system for forge, that will allow to parallelize the tick of certain types of entities or the tracking of them. All this to improve the performance of large servers that have many entities. To do this i need to override some methods of the Minecraft server base classes, and create a better scheduling system.

 

1 hour ago, jeffryfisher said:

The experts don't teach core modding here. If you want to use Forge, then learn Forge (a wrapper that core-mods the game so you don't need to).

 But this needs to be compatible with forge, I know how Forge work, but i never done before this type of modifications.

Link to comment
Share on other sites

On 3/19/2017 at 11:55 AM, SergiX44 said:

I'm designing a better ticking system for forge

 

What's wrong with the ticking system? Maybe you should visit the Forge repository at gitHub and start leaving comments and/or offering upgrades.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

On 21/3/2017 at 3:15 AM, jeffryfisher said:

 

What's wrong with the ticking system? Maybe you should visit the Forge repository at gitHub and start leaving comments and/or offering upgrades.

The main reason is because is not multithread: in our server we have the problem that when we have lot of players logged and a lot of entity loaded we have some performace issues. I've already improved the ticking of our mods, and i've also overrided via asm some vanilla methods, but now i want to try to design a decent multithread structure to attach to forge.

Link to comment
Share on other sites

I recall that Keybounce was dealing with multithreaded ticking with a finite fluid mod (ticks only for the mod's fluids, on top of the vanilla system). I think he was trying to update it, but I don't remember his target version.

 

Long story short, it was convoluted, a mess, fraught with peril, and confusing. I think he managed to get it to a "functional" stage, but still not efficient enough to replace whole oceans with.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

×
×
  • Create New...

Important Information

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