Jump to content

[1.10.2][CLOSED] How to stop all minecraft at once without extra log lines


Recommended Posts

Posted

So.. Yeah... I dont like just saying "read title" because its rude in my opinion...

 

How would I stop the whole proccess without any thinking and extra log lines...

(I feel like i need to mention that this is planned to occur at PreInit in spesific conditions..)

Doing stuff n' things

Posted

So.. Yeah... I dont like just saying "read title" because its rude in my opinion...

 

How would I stop the whole proccess without any thinking and extra log lines...

(I feel like i need to mention that this is planned to occur at PreInit in spesific conditions..)

What do you mean stop the whole process? Why would you do this?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

I want under a condition to just crash the game without the stacktrace stuff and exit codes and all of that...

I don't understand the purpose but your could try System.exit(0);

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

I want under a condition to just crash the game without the stacktrace stuff and exit codes and all of that...

I don't understand the purpose but your could try System.exit(0);

 

The SecurityManager no longer allows for mods to use System.exit.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

I want under a condition to just crash the game without the stacktrace stuff and exit codes and all of that...

I don't understand the purpose but your could try System.exit(0);

 

The SecurityManager no longer allows for mods to use System.exit.

Ok then I don't see why Forge has blocked that from being accessed from Mods but I guess they had a reason.

 

I want under a condition to just crash the game without the stacktrace stuff and exit codes and all of that...

I don't understand the purpose but your could try System.exit(0);

Instead use

Minecraft.getMinecraft().shutdown();

This sets a boolean to false stopping the main Game Loop and eventually stops the thread of Minecraft.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Instead use

Minecraft.getMinecraft().shutdown();

This sets a boolean to false stopping the main Game Loop and eventually stops the thread of Minecraft.

I did use it first but it gave alot of log lines, That's why I came to here..

 

I would try:

FMLCommonHandler.instance().exitJava(0, true/false)

Thank you! works perfectly!

Setting the boolean to false seems to produce less lines so its false for me I guess..

Unless its a really super duper importent that its set to true...

 

Also, What's the effect of the exit code? In modded I've seen some times -1 and 0s.. But Idk what they mean...

Doing stuff n' things

Posted

It's a return value from main. Generally speaking "0" means "everything's fine" while other values are some variant of an error.

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.

Posted

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.

Posted

This is the exact reason we added the security manager, so that people CAN'T exit minecraft "without extra log lines"

If minecraft closes, you NEED to know why.

And if any mod is trying to HIDE from explaining why then that is a shit mod and should never be release/encouraged.

 

We don't prevent the stop functionality, we just add a stacktrace so you know WHO stopped it.

Just use the systems in place.

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

This is the exact reason we added the security manager, so that people CAN'T exit minecraft "without extra log lines"

If minecraft closes, you NEED to know why.

And if any mod is trying to HIDE from explaining why then that is a shit mod and should never be release/encouraged.

 

We don't prevent the stop functionality, we just add a stacktrace so you know WHO stopped it.

Just use the systems in place.

 

I'm doing so to have a diffrent system for explaining the error that happened in the mod..

The stacktrace is nice for modders and developers but it has no use for the avrage player...

My system is explaining why it crashed with a detailed information and telling the player where he could go for help....

 

Although I am using stacktrace while modding, While playing, It burries all the codes that explain why......

And in the run I never want the player to be confused as to why he cant load minecraft because he doesnt know how to read properly the stacktrace and the vanilla error...

 

 

In the end, I will make sure all of the errors that I know that might occur while playing will never cause a real crash...

Doing stuff n' things

Posted

Either way we dont support hiding the cause.

So you're out of luck, however just make your information as clear as possible as it will be printed directly above the trace.

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

then that is a shit mod and should never be release/encouraged.

And I dont know who you think you are to call a mod shit and say it should never be released or encouraged...

The idea of modding is allowing people to work creativly on whatever they want to do....

Doing stuff n' things

Posted

then that is a shit mod and should never be release/encouraged.

And I dont know who you think you are to call a mod shit and say it should never be released or encouraged...

The idea of modding is allowing people to work creativly on whatever they want to do....

I am LexManos, the lead developer of the most popular modding api for the Minecraft environment. I have over 4 years of experience working with Minecraft mods and the community. As well as over 20 years of development and modding experience in non-Minecraft realms. THAT is who I am.

 

The ability for mods to kill the client SILENTLY was removed because people like YOU abused it for egotistical and petty reasons which harmed the end user and purposefully sent users to the wrong place for the cause. I have NOT removed any functionality. I have NOT hindered any mod in any way. You can still stop the process of you wish. I simply force the log to capture the correct cause so that the end user, and us here doing support, know how to handle it.

  • Like 1

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

    • I am having some issues starting an RLCraft server on a minimal install of Debian 12. I have Java installed and I'm able to start the vanilla Minecraft server jar no problem and people can join and play without any issues, as soon as I try to create a new directory with the Forge jar the initial install with the INSTALLER jar works when I use the java command with the --installServer flag, but as soon as I try to start the server using the forge jar that is NOT labelled with installer I get the following error: A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.base/java.lang.reflect.Method.invoke(Method.java:569)         at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)         at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34) Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')         at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)         at net.minecraft.launchwrapper.Launch.main(Launch.java:28)         ... 6 more   I have tried using newer versions of Java directly from Oracle as well. Has anybody been successful in starting and running a RLCraft server from the terminal on a Linux machine? I cannot figure out why it doesn't want to work but the vanilla jar works without issue. Thank you in advance!
    • This is my latest attempt :  public class ManaScreen extends Screen { Mana mana = new Mana(); boolean removeManaBar = false; ResourceLocation manaBar = ResourceLocation.fromNamespaceAndPath(RSGArmoury.MOD_ID, "/textures/block/spawnable_arena_wall.png"); public ManaScreen() { super(Component.literal("Mana")); } @Override protected void init() { super.init(); Minecraft.getInstance().setScreen(this); } @Override public boolean isPauseScreen() { return false; } @Override public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) { pGuiGraphics.blit(manaBar, 10, -10, 0, 0, mana.getMana(), 10, mana.getMana(), 10); if (removeManaBar) { this.onClose(); return; } super.render(pGuiGraphics, pMouseX, pMouseY, pPartialTick); } public void addManaBar() { removeManaBar = false; Minecraft.getInstance().setScreen(new ManaScreen()); } public boolean removeManaBar() { return removeManaBar = true; } }
    • I tried a few different things that all didnt work. Right now I have nothing but what I had that seemed most likely to work was just a guiOverlay.blit(x, y, z, vx, vy, getMana()). I dont remember the exact code but it was somthing along those lines. It was in a new class extending screen I believe.
    • yo help pls  i get this error message The game crashed whilst rendering screen Error: java.lang.NullPointerException: Rendering screen https://pastebin.com/fHwr7nXA
  • Topics

×
×
  • Create New...

Important Information

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