Jump to content

Recommended Posts

Posted

Is there a way in forge or otherwise to Remove or Disable or replace base blocks and/or Recipes without modifying the base classes?

 

Posted

There is no special way in forge no.

But all things you can do with basic java.

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

Posted

There is no special way in forge no.

But all things you can do with basic java.

More or less I just didn't want to edit the base classes.

 

Try replacing some blocks in the Block.blockList array by setting them to null.

 

Hrmm I might try to check into this but most of the variables in Block are finial so they might not be editable.

 

 

That isn't a bad idea.  Would be interesting to just replace them all then write a whole new game out of it.  Problem is the world generation.

Generation would be a problem but I actually plan on editing that or at least making a new world gen mode.

 

 

Posted

More or less I just didn't want to edit the base classes.

 

Lex is talking about reflection.

 

http://java.sun.com/developer/technicalArticles/ALT/Reflection/

Oh hrmm interesting. Sounds familiar but it has been a long time since I have worked with Java. I have mostly worked with c++ and actionscript lately. But I guess Ill check that out a bit.

 

though will that really work with Finial variables anyway. Though whole point of them is so you don't change them after they are made...

 

Though I probably wouldn't call that technique Basic. Although it might be built into java it doesn't seem like something you would use on a regular basis. But hey java is not my primary language

Posted

It is used for working around the java security model.  In C++ terms think of just directly accessing class variables and such using pointer manipulation, but in an easier format, kind of like Boost::Mirror for C++, but for Java instead.

Posted

It is used for working around the java security model.  In C++ terms think of just directly accessing class variables and such using pointer manipulation, but in an easier format, kind of like Boost::Mirror for C++, but for Java instead.

Yeah I understand it in concept, I just wouldnt label it as a "Basic" lol I think it would be more of an advanced java technique
Posted

It is used for working around the java security model.  In C++ terms think of just directly accessing class variables and such using pointer manipulation, but in an easier format, kind of like Boost::Mirror for C++, but for Java instead.

Yeah I understand it in concept, I just wouldnt label it as a "Basic" lol I think it would be more of an advanced java technique

True, but it is common in MC modding because you have to for *many* things.  ;)

Posted

Suppose so lol. Tried it out but didnt seem to work the way I wanted to that or Im not sure if Im doing it properly. Though Im not sure how exactly you are suppose to use it to replace objects especially since all the block types are final =/

Posted

Magic

And thats all your getting because if you're to stupid/lazy to figure it out yourself, you'd probably fuck a lot of things up if you used it.

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

Posted

Magic

And thats all your getting because if you're to stupid/lazy to figure it out yourself, you'd probably fuck a lot of things up if you used it.

Ouch I don't think I deserve quite such a comeback. I get you probably get a lot of questions for rude and inexperienced programmers but Its not like I was complaining or begging for info.

 

This was the first time I heard of this method since Im not a pro Java programmer. Im thankful that someone mentioned that method though, it was helpful. I am only doing this in I'm my free time and haven't used Java all that extensively. I am a programmer by trade and I understand that doing it yourself is the best way to understand it. All I was asking for was a guideline in the right direction.

 

All I meant was the term basic should refer to the techniques you absolutely must know to use a language and it does not quite fit a technique that is suppose to used to bypass security of a class.

Posted

Yes basic can be interpreted many ways.

Would you of preferred 'vanilla java'

or some other terms that ment NOT FORGE?

Either way, topic closed.

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

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Please see https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/ for information on how to post your log correctly.
    • Hello!  The detailed description of how you got to where you are is certainly valuable.  But, at the end of the day (well, any time of the day actually), it is going to be the actual logs that going to provide the necessary details to hopefully solve your startup issue. Part of me wonders if you have installed a client-only mod on a dedicated server.  But I may very well be wrong, and it will be the logs that will tell that story.
    • Hello there! I didn't quite know where to go regarding this, but ended up deciding to post it here. I have been running a forge server with around 200 mods for me and some friends to play on casually, but have recently started to get an issue when booting the server. This all started after I decided to add some new mods to the server. Like usual, I add a mod, test run the server for any issues, and if all is well, I'll add a next one and so on until I have added all that I wanted to. After doing so, in all test runs, it all seemed to work just fine. However, the next day, after trying to boot the server, I kept getting an error regarding java.lang.NullPointerException, towards one of the mods I had recently added. So far so good, I removed the mod that was causing the issue, started up the server again, and here in when things took a turn for the worse. I received another java.lang.NullPointerException null error that wouldn't allow me to boot the server, but this time with a mod that wasn't part of the new ones I had recently added. I found this weird, but nonetheless, I removed it thinking it might be causing some conflicts with some of the new ones. Afterwards, booting the server again proved to be impossible, as it gave me another java.lang.NullPointerException null error with the 3rd mod I had ever installed on the server! This mod was there since the start, it added some biomes and had been just fine so far. This turn of events made me remove all the newer mods I had recently added in hopes to fix this whole ordeal, but alas, to no avail. Same error, with that same biome mod that had been there since day one. Reluctantly, I removed the biome mod, booted the server, and voila! The server was running, although without a major mod that had always been there to begin with. As I do not wish to part ways with this mod, specially since it had been working so far without any issues, I tried to bring everything back to how it was before I added those new mods, but kept on getting the same java.lang.NullPointerException null error for the biome mod. Even adding the newer mods won't cause me this error, with exception of the one that started it all, which I find quite odd since the mods I had been using without any issues are now giving me the same error the newer one that started it all gave me. Now, I have checked that everything is up to date regarding the mods, forge (forge-1.20.1-47.3.12) and java. The modpack runs perfectly fine when I start Minecraft itself, and play singleplayer, or even when I open a LAN world, everything works. Everything aside from the server. From what I could gather, this java.lang.NullPointerException null error would point to a missing value of sorts, for an item perhaps, within the mod that is causing the error, but aside from removing the whole mod, I lack the knowledge on how to fix this. With this in mind, if anyone would be so kind as to shine some light into this situation, with a way to fix all this blunder, I would be most grateful!
    • If you want a mana GUI, call Minecraft.getInstance().setScreen(new ManaScreen()); somewhere display your GUI. I would recommend creating a keybind and listening to key events, and if your key bind is pressed down, running that code.
    • You are creating an entire new screen, or GUI. What you probably want is an Overlay.
  • Topics

×
×
  • Create New...

Important Information

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