Jump to content

[1.7.10] People reporting weird occasional crash with my mod - sound issue?


Recommended Posts

Posted

I have a mod on the Minecraft Forums, but a few people have been complaining of a crash they are receiving when near farms (lots of animal sounds combined with NPC sounds). Here is the log: http://pastebin.com/raw.php?i=qKx8MbuC

 

I have absolutely no idea what is causing it, but some users have reported successfully stopping it by manually going into the jar file and deleting all the sounds. I have only had this crash once, so it appears that users with better computers (such as myself) receive the crash less frequently than the users with lesser quality computers. One user even said the mod was unplayable because they received the crash seconds after logging into their world.

 

Please help me work out what is causing this.

Posted

It looks like either there are too many sounds for the sound handler to process, or some sounds are being registered or modified while the game is trying to play them. Might be a problem with Minecraft, and not your mod.

Romejanic

 

Creator of Witch Hats, Explosive Chickens and Battlefield!

Posted

I have cut out a lot of unnecessary code for this post, so any uneven brackets are actually even, but their opposite bracket has been cut out.

 

@Override
public void onUpdate() {

		// // greet player
		if (System.currentTimeMillis() - greetTimer > 1000) {
			Random r = new Random();
			double dist = this.theData.getDistanceToPlayer();

			if (SimukraftReloaded.states != null) {
				Long ls=System.currentTimeMillis()- theData.anyFolkLastSpoke;
				if (SimukraftReloadedConfig.configFolkTalkingEnglish == true
						&& ls > 5000) {
					if ((!theData.greetedToday & dist < 5) || (theData.vocation==Vocation.BURGERSWAITER && dist <5 && r.nextInt(20)==2)) {
						theData.greetedToday = true;
						theData.anyFolkLastSpoke = System
								.currentTimeMillis();

						int sf = r.nextInt(25) + 1;
						String fn = "ashjacksimukraftreloaded:";

						if(theData.vocation !=null && theData.vocation==Vocation.BURGERSWAITER) {
							 sf=r.nextInt(6);  // 0 to 5
							 fn+="burger";
							 switch(sf) {
							 case 0:
								 if(theData.gender==0) {
									 fn+="ma";
								 } else {
									 fn+="fa";
								 }
								 break;
							 case 1:
								 if(theData.gender==0) {
									 fn+="mb";
								 } else {
									 fn+="fb";
								 }
								 break;
							 case 2:
								 if(theData.gender==0) {
									 fn+="mc";
								 } else {
									 fn+="fc";
								 }
								 break;
							 case 3:
								 if(theData.gender==0) {
									 fn+="md";
								 } else {
									 fn+="fd";
								 }
								 break;
							 case 4:
								 if(theData.gender==0) {
									 fn+="me";
								 } else {
									 fn+="fe";
								 }
								 break;
							 case 5:
								 if(theData.gender==0) {
									 fn+="mf";
								 } else {
									 fn+="ff";
								 }
								 break;
							 }

						} else { // non Vocational

						if (theData.age >= 18) {
							if (SimukraftReloaded.isDayTime()) {
								if (sf == 1) {
									if (theData.gender == 0) {
										fn += "daymone";
									} else {
										fn += "dayfone";
									}
								} else if (sf == 2) {
									if (theData.gender == 0) {
										fn += "daymtwo";
									} else {
										fn += "dayftwo";
									}
								} else if (sf == 3) {
									if (!this.worldObj.isRaining()) {
										if (theData.gender == 0) {
											fn += "daymthree";
										} else {
											fn += "dayfthree";
										}
									} else {
										if (theData.gender == 0) {
											fn += "mwxbad";
										} else {
											fn += "fwxbad";
										}
									}
								} else if (sf == 4) {
									if (theData.gender == 0) {
										fn += "meight";
									} else {
										fn += "feight";
									}
								} else if (sf == 5) {
									if (theData.gender == 0) {
										fn += "mnine";
									} else {
										fn += "fnine";
									}
								} else if (sf == 6) {
									if (theData.gender == 0) {
										fn += "mseven";
									} else {
										fn += "fseven";
									}
								} else if (sf > 6) {
									// 7 > 97
									if (theData.gender == 0) {
										fn += "mspeak";
									} else {
										fn += "fspeak";
									}

									fn = fn
											+ Character
													.toString((char) (sf + 90));
								}

							} else {
								if (sf == 1) {
									if (theData.gender == 0) {
										fn += "nightmone";
									} else {
										fn += "nightfone";
									}
								} else if (sf == 2) {
									if (theData.gender == 0) {
										fn += "nightmtwo";
									} else {
										fn += "nightftwo";
									}
								} else if (sf == 3) {
									if (theData.gender == 0) {
										fn += "nightmthree";
									} else {
										fn += "nightfthree";
									}
								} else if (sf == 4) {
									if (theData.gender == 0) {
										fn += "meight";
									} else {
										fn += "feight";
									}
								} else if (sf == 5) {
									if (theData.gender == 0) {
										fn += "mnine";
									} else {
										fn += "fnine";
									}
								} else if (sf == 6) {
									if (theData.gender == 0) {
										fn += "mseven";
									} else {
										fn += "fseven";
									}
								}
							}
						} else // child speaking
						{
							sf = r.nextInt(3) + 1;
							fn += "cspeak";
							fn = fn + Character.toString((char) (sf + 96));
						}

						}


						if (r.nextBoolean()) {
							try {
								// SimukraftReloaded.log("greeting: " + fn);
								ModSimukraft.proxy.getClientWorld()
										.playSound(this.posX, this.posY,
												this.posZ, fn, 1.0f, 1.0f,
												false);
							} catch (Exception e) {
							}
						}
					}
				}
			}

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.