Jump to content

[1.15.2] How to edit raw vanilla code with forge


KdotDevelopment

Recommended Posts

I used mcp-reborn but i could not figure out how to make a proper json for the version file.

 

Anyway, before you respond that editing vanilla code is dead, i need you to realize that this is the only way to do it. I want to make all barriers visible even if you arent holding the item. I sucessfully made it in mcp, but building the jar didnt work properly and i dont know how to make a json for the version.

 

So if you know how i can either edit the vanilla code using forge or import the code I already wrote in MCP, please respond.

 

Edit: im new to this forums so this may be in the wrong place. Thanks!

Edited by KdotDevelopment
Link to comment
Share on other sites

You don't. Specifically.

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

2 hours ago, KdotDevelopment said:

Anyway, before you respond that editing vanilla code is dead, i need you to realize that this is the only way to do it.

Modifying vanilla isn't supported on these forums.

 

In your case, modifying vanilla code isn't even necessary (People always say "my case definitely need a core mod", but it is in fact not needed in 99% of their case. You just have to be creative with the system ;)).

Simply replace the barrier renderer with your own implementation.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

1 minute ago, DavidM said:

Modifying vanilla isn't supported on these forums.

In your case, modifying vanilla code isn't even necessary.

 

Well, i already made the whole mod from just vanilla code, i was just wondering if I could port it over to forge so I can actually make it run. And if you wouldnt mind, could you explain how I could do this without modifying the vanilla code?

Link to comment
Share on other sites

15 minutes ago, KdotDevelopment said:

Well, i already made the whole mod from just vanilla code, i was just wondering if I could port it over to forge so I can actually make it run.

Depends. If all you did is created a rendering method that would integrate well into Forge's event driven system, then yes.

 

15 minutes ago, KdotDevelopment said:

And if you wouldnt mind, could you explain how I could do this without modifying the vanilla code?

In vanilla Minecraft, barriers are rendered as particles, and handled inside ClientWorld. This might sound impossible, however you could replace the barrier block itself by overriding the registry and its entry in the Blocks class. After that, you have control over the full block. Simply use a TESR or subscribe to RenderWorldLastEvent and render the barrier sprite or emit the vanilla barrier particle in the block.

 

If you feel like replacing the block entry may cause incompatibilities, you can also subscribe to RenderWorldLastEvent and render the barrier sprite at the vanilla barrier blocks (or use vanilla particles); however, this method would require you to set up a system to record all the barrier blocks in the world.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

What i did was find the little part that said "holdingBarrier &&" and removed it. I made an abstract option within video settings to toggle it on and off. As a bonus for myself, i created a creative tab just for the items you can only get with commands (like barriers and command blocks). Also, i didnt make this clear but I need it to work on multiplayer. I can definitely try overriding the block and use that event to show the particle. Im not too familiar with forge code, but forge has a lot of tutorials so it shouldnt be too hard to find. Thanks!

PS it may be impossible, but i still think my vanilla code can be injected somehow into forge. Whether this be overriding classes within a mod or overriding classes as a modified version of forge itself. Just an idea.

Link to comment
Share on other sites

9 minutes ago, KdotDevelopment said:

What i did was find the little part that said "holdingBarrier &&" and removed it. I made an abstract option within video settings to toggle it on and off.

You can still do this with the method I described above. Add an if statement before the rendering to check for this option would work.

 

9 minutes ago, KdotDevelopment said:

As a bonus for myself, i created a creative tab just for the items you can only get with commands (like barriers and command blocks).

In Forge, you can create a new ItemGroup and add in the items by overriding ItemGroup#fill.

 

9 minutes ago, KdotDevelopment said:

Also, i didnt make this clear but I need it to work on multiplayer.

Overriding the registry on a specific side is fine as long as the entries still matches up with the server/client. I.e. the server and client can have completely different blocks under the entry "dirt block", but there will be no problem with the game; it would render as the block on the client, while certain server-side functions are handled by the server-side block under the same entry.

 

Note that overriding registry entries might cause incompatibilities (when 2 mods try to modify the same entry, only one mod will succeed). However it is still better in terms of compatibility than using a core mod as the former still respects the Forge system.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

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.