Jump to content

Sounds stop working when the mod is on the server


blfngl

Recommended Posts

Hi, I'm getting an error when trying to use sounds on the server. This method works in ssp, but for some reason not smp.

 

---- Minecraft Crash Report ----

// Uh... Did I do that?

 

Time: 3/17/13 7:45 PM

Description: Exception in server tick loop

 

cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/audio/SoundManager

at cpw.mods.fml.common.LoadController.transition(LoadController.java:142)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:506)

at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:85)

at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:352)

at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429)

at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/audio/SoundManager

at java.lang.Class.getDeclaredConstructors0(Native Method)

at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)

at java.lang.Class.getConstructor0(Unknown Source)

at java.lang.Class.getConstructor(Unknown Source)

at net.minecraftforge.event.EventBus.register(EventBus.java:69)

at net.minecraftforge.event.EventBus.register(EventBus.java:53)

at blfngl.fallout.common.FalloutMain.preInit(FalloutMain.java:317)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:505)

... 5 more

Caused by: java.lang.ClassNotFoundException: net.minecraft.client.audio.SoundManager

at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:210)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

... 38 more

Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/audio/SoundManager for invalid side SERVER

at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50)

at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:277)

at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:198)

... 40 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.5

Operating System: Windows 7 (x86) version 6.1

Java Version: 1.7.0_17, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 1017832064 bytes (970 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 4 mods loaded, 4 mods active

mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized

FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized

Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized

fallout [The Fallout Mod] (bin) Unloaded->Constructed->Errored

Profiler Position: N/A (disabled)

Is Modded: Definitely; Server brand changed to 'fml'

Type: Dedicated Server (map_server.txt)

 

Link to comment
Share on other sites

So I added this method to my common proxy:

public void registerSoundHandler()
{
	MinecraftForge.EVENT_BUS.register(new FalloutSoundHandler());
    }

Also, the sound file looks like this:

 

public class FalloutSoundHandler
{
@ForgeSubscribe
public void onSound(SoundLoadEvent event)
{
	try 
	{
		event.manager.soundPoolSounds.addSound("blfngl/LaserFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/LaserFire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/IncineratorShoot.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/IncineratorShoot.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/357Fire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/357Fire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/44Fire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/44Fire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/RCWFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/RCWFire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/Silenced22Fire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/Silenced22Fire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/SniperFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/SniperFire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/LaserPistolFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/LaserPistolFire.ogg"));

		event.manager.soundPoolSounds.addSound("blfngl/AntTalk.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntTalk.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/AntTalk1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntTalk1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/AntHurt.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntHurt.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/AntHurt2.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntHurt1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulTalk.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulTalk.ogg"));         
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulTalk1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulTalk1.ogg"));         
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulTalk2.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulTalk2.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulHurt.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulHurt.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulHurt1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulHurt1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulHurt2.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulHurt2.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/NightstalkerTalk.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/NightstalkerTalk.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/NightstalkerTalk1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/NightstalkerTalk1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/NightstalkerHurt.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/NightstalkerHurt.ogg"));

		//event.manager.soundPoolSounds.addSound("blfngl/RadioNV.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/RadioNV/RadioNV.ogg"));
	}

	catch (Exception e)
	{
		System.err.println("Failed to register one or more sounds.");
	}
}

 

However, it still won't work.

Link to comment
Share on other sites

CommonProxy:

 

package blfngl.fallout.common;

import net.minecraftforge.common.MinecraftForge;
import blfngl.fallout.sounds.FalloutSoundHandler;

public class FalloutCommonProxy
{
//public static String ITEMS_PNG = "/mod/blfngl/textures/items/TungstenIngot.png";
//public static String BLOCK_PNG = "/blfngl/fallout/textures/blocks.png";

// Client stuff
public void registerRenderers()
{

}

public void registerSoundHandler()
{
	MinecraftForge.EVENT_BUS.register(new FalloutSoundHandler());
    }
}

 

 

ClientProxy:

 

package blfngl.fallout.client;

import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelSilverfish;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import blfngl.fallout.common.FalloutCommonProxy;
import blfngl.fallout.common.FalloutMain;
import blfngl.fallout.common.SoundHandler;
import blfngl.fallout.entity.EntityBOSPaladin;
import blfngl.fallout.entity.EntityBrahmin;
import blfngl.fallout.entity.EntityFGhoul;
import blfngl.fallout.entity.EntityGecko;
import blfngl.fallout.entity.EntityGiantAnt;
import blfngl.fallout.entity.EntityGlowingOne;
import blfngl.fallout.entity.EntityNightStalker;
import blfngl.fallout.entity.EntityRadio;
import blfngl.fallout.entity.EntityRadroach;
import blfngl.fallout.entity.ModelBrahmin;
import blfngl.fallout.entity.ModelGecko;
import blfngl.fallout.entity.ModelGiantAnt;
import blfngl.fallout.entity.ModelNightStalker;
import blfngl.fallout.entity.ModelRadio;
import blfngl.fallout.entity.RenderBOSPaladin;
import blfngl.fallout.entity.RenderBrahmin;
import blfngl.fallout.entity.RenderFGhoul;
import blfngl.fallout.entity.RenderGecko;
import blfngl.fallout.entity.RenderGiantAnt;
import blfngl.fallout.entity.RenderGlowingOne;
import blfngl.fallout.entity.RenderNightStalker;
import blfngl.fallout.entity.RenderRadio;
import blfngl.fallout.entity.RenderRadroach;
import blfngl.fallout.gun.RenderRevolver;
import cpw.mods.fml.client.registry.RenderingRegistry;

public class FalloutClientProxy extends FalloutCommonProxy
{

@Override
public void registerRenderers()
{
	//MinecraftForgeClient.preloadTexture(ITEMS_PNG);

	RenderingRegistry.registerEntityRenderingHandler(EntityFGhoul.class, new RenderFGhoul(new ModelBiped(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(EntityGlowingOne.class, new RenderGlowingOne(new ModelBiped(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(EntityBrahmin.class, new RenderBrahmin(new ModelBrahmin(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(EntityGiantAnt.class, new RenderGiantAnt(new ModelGiantAnt(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(EntityNightStalker.class, new RenderNightStalker(new ModelNightStalker(), 1.0F));
	RenderingRegistry.registerEntityRenderingHandler(EntityBOSPaladin.class, new RenderBOSPaladin(new ModelBiped(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(EntityRadroach.class, new RenderRadroach(new ModelSilverfish(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(EntityRadio.class, new RenderRadio(new ModelRadio(), 0.5F));
	RenderingRegistry.registerEntityRenderingHandler(EntityGecko.class, new RenderGecko(new ModelGecko(), 0.5F));

	//TODO MinecraftForgeClient.registerItemRenderer(FalloutMain.LaserRifle.itemID, (IItemRenderer)new RenderLaserRifle());
	//TODO MinecraftForgeClient.registerItemRenderer(FalloutMain.g357Mag.itemID, (IItemRenderer)new RenderRevolver());
	MinecraftForgeClient.registerItemRenderer(FalloutMain.g44Mag.itemID, (IItemRenderer)new RenderRevolver());
	//TODO MinecraftForgeClient.registerItemRenderer(FalloutMain.Incinerator.itemID, (IItemRenderer)new RenderIncinerator());
}        

public int addArmor(String Armor)
{
	return RenderingRegistry.addNewArmourRendererPrefix(Armor);
}

@Override
    public void registerSoundHandler()
{
        //MinecraftForge.EVENT_BUS.register(new SoundHandler());
    }
}

 

 

SoundHandler:

 

package blfngl.fallout.sounds;

import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
import blfngl.fallout.common.FalloutMain;

public class FalloutSoundHandler
{
@ForgeSubscribe
public void onSound(SoundLoadEvent event)
{
	try 
	{
		event.manager.soundPoolSounds.addSound("blfngl/LaserFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/LaserFire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/IncineratorShoot.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/IncineratorShoot.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/357Fire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/357Fire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/44Fire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/44Fire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/RCWFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/RCWFire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/Silenced22Fire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/Silenced22Fire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/SniperFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/SniperFire.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/LaserPistolFire.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/LaserPistolFire.ogg"));

		event.manager.soundPoolSounds.addSound("blfngl/AntTalk.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntTalk.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/AntTalk1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntTalk1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/AntHurt.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntHurt.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/AntHurt2.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/AntHurt1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulTalk.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulTalk.ogg"));         
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulTalk1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulTalk1.ogg"));         
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulTalk2.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulTalk2.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulHurt.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulHurt.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulHurt1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulHurt1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/FGhoulHurt2.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/FGhoulHurt2.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/NightstalkerTalk.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/NightstalkerTalk.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/NightstalkerTalk1.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/NightstalkerTalk1.ogg"));
		event.manager.soundPoolSounds.addSound("blfngl/NightstalkerHurt.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/NightstalkerHurt.ogg"));

		//event.manager.soundPoolSounds.addSound("blfngl/RadioNV.ogg", FalloutMain.class.getResource("/blfngl/fallout/sounds/RadioNV/RadioNV.ogg"));
	}

	catch (Exception e)
	{
		System.err.println("Failed to register one or more sounds.");
	}
}
}

 

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.