Fix some crashes

This commit is contained in:
PeytonPlayz595 2024-07-29 15:00:33 -04:00
parent e66bcfa081
commit 890a2f9afd
3 changed files with 22 additions and 11 deletions

View File

@ -429,13 +429,13 @@ public class Minecraft implements Runnable {
} }
} }
} catch (MinecraftError var20) { } catch (MinecraftError var20) {
} catch (Throwable var21) { } /*catch (Throwable var21) {
this.func_28002_e(); this.func_28002_e();
var21.printStackTrace(); var21.printStackTrace();
this.onMinecraftCrash(new UnexpectedThrowable("Unexpected error", var21)); this.onMinecraftCrash(new UnexpectedThrowable("Unexpected error", var21));
} finally { } finally {
this.shutdownMinecraftApplet(); this.shutdownMinecraftApplet();
} }*/
} }

View File

@ -168,10 +168,10 @@ public class NetworkManager {
} catch(EOFException e) { } catch(EOFException e) {
stream.reset(); stream.reset();
break; break;
} catch(IOException e) { } catch(Exception e) {
continue; continue;
} catch(Throwable t) { } catch(Throwable t) {
t.printStackTrace(); continue;
} }
} }

View File

@ -77,14 +77,20 @@ public class SoundManager {
if(loaded && this.options.musicVolume != 0.0F) { if(loaded && this.options.musicVolume != 0.0F) {
if(!GL11.isPlaying(BgMusic)) { if(!GL11.isPlaying(BgMusic)) {
try {
if(this.ticksBeforeMusic > 0) { if(this.ticksBeforeMusic > 0) {
--this.ticksBeforeMusic; --this.ticksBeforeMusic;
return; return;
} }
int var1 = rand.nextInt((music.length - 1) + 1) + 1; //Apparently I DO NOT know how to use random.nextInt
int var1 = rand.nextInt(music.length);
this.ticksBeforeMusic = this.rand.nextInt(12000) + 12000; this.ticksBeforeMusic = this.rand.nextInt(12000) + 12000;
BgMusic = GL11.beginPlaybackStatic(music[var1].replace(".", "/").replace("_", "."), this.options.musicVolume, 1.0F); BgMusic = GL11.beginPlaybackStatic(music[var1].replace(".", "/").replace("_", "."), this.options.musicVolume, 1.0F);
} catch(Exception e) {
BgMusic = -1;
return;
}
} }
} }
} }
@ -124,7 +130,12 @@ public class SoundManager {
} }
if(loaded && this.options.soundVolume != 0.0F) { if(loaded && this.options.soundVolume != 0.0F) {
String var7 = "sounds/" + var1.replace(".", "/") + number + ".ogg"; if(var1 == null) {
return;
}
String var7;
var7 = "sounds/" + var1.replace(".", "/") + number + ".ogg";
if(var7 != null && var5 > 0.0F) { if(var7 != null && var5 > 0.0F) {
if(var5 > 1.0F) { if(var5 > 1.0F) {
var5 = 1.0F; var5 = 1.0F;