Jump to content

Custom sound not working


Taji34

Recommended Posts

So I followed a tutorial about adding sounds in forge 1.6.2 but it doesn't seem to be working for me. The sound should play while it is selected in the hotbar. I tested this with the "random.bow" sound and it worked, however, with my custom sound it doesn't. Here is the code I have:

 

Troncraft.java:

package taji34.troncraft;

import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.Item;

import net.minecraftforge.common.MinecraftForge;

import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="Troncraft", name="Troncraft", version="0.0.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false, channels={"troncraft"}, packetHandler = TajiPacketHandler.class)

public class Troncraft {
        // The instance of your mod that Forge uses.
        @Instance("Troncraft")
        public static Troncraft instance;
        public final static Item identityDisk = new IdentityDisk(5001);
        int diskItemID = identityDisk.itemID;
    	private final static Item baton = new Baton(5002);
    	int batonItemID = baton.itemID;
        // Says where the client and server 'proxy' code is loaded.
        @SidedProxy(clientSide="taji34.troncraft.client.ClientProxy", serverSide="taji34.troncraft.CommonProxy")
        public static CommonProxy proxy;
        @EventHandler
        public void preInit(FMLPreInitializationEvent event) {
                // Stub Method
        }
        @EventHandler
        public void load(FMLInitializationEvent event) {
            LanguageRegistry.addName(identityDisk, "Identity Disk");
            LanguageRegistry.addName(baton, "Baton");
            EntityRegistry.registerModEntity(EntityIdentityDisk.class, "IdentityDisk", 5001, this, 40, 3, true);
            RenderingRegistry.registerEntityRenderingHandler(EntityIdentityDisk.class, new RenderSnowball(identityDisk));
        	KeyBindingRegistry.registerKeyBinding(new TajiKeyHandler());
        	MinecraftForge.EVENT_BUS.register(new TajiEvents());
        }
        @EventHandler
        public void postInit(FMLPostInitializationEvent event) {
                // Stub Method
        }
}

 

TajiEvents.java:

package taji34.troncraft;

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingHurtEvent;

public class TajiEvents {
public boolean isPlayerDamage(DamageSource source)
{
	if ((source.getSourceOfDamage() != null) && !(source.isExplosion()) && !(source.isFireDamage()) && !(source.isMagicDamage()) && !(source.isProjectile()))
	{
		return true;
	}
	return false;
}
@ForgeSubscribe
public void entityAttacked(LivingHurtEvent event)
{
	EntityLiving attackedEnt = (EntityLiving) event.entityLiving;
	DamageSource attackSource = event.source;
	if (isPlayerDamage(attackSource))
	{
		EntityPlayer player = (EntityPlayer) attackSource.getSourceOfDamage();
		if(player.getHeldItem() != null)
		{
			ItemStack itemstack = player.getHeldItem();
			if (itemstack.getDisplayName().equals("Baton"))
			{
				NBTTagCompound tag = itemstack.getTagCompound();
				int damageAmmount = tag.getInteger("Damage");
				event.ammount = damageAmmount;
			}
		}
	}
}
public void onSound(SoundLoadEvent event) {
	event.manager.addSound("troncraft:freezer-hum.ogg");
}
}

 

IdentityDisk.Java:

package taji34.troncraft;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class IdentityDisk extends Item {
        public IdentityDisk(int id) {
                super(id);
                setMaxStackSize(1);
                setCreativeTab(CreativeTabs.tabMisc);
                setUnlocalizedName("identityDisk");
        }
        @Override
        @SideOnly(Side.CLIENT)
        public void registerIcons(IconRegister iconRegister) {
            this.itemIcon = iconRegister.registerIcon("troncraft:IdentityDisk");
        }
        public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
        	if (par5){
        		par2World.playSoundAtEntity(par3Entity, "troncraft:freezer-hum", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
        	}
        }
        public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
        {
            if (!par3EntityPlayer.capabilities.isCreativeMode)
            {
                --par1ItemStack.stackSize;
            }

            par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

            if (!par2World.isRemote)
            {
                par2World.spawnEntityInWorld(new EntityIdentityDisk(par2World, par3EntityPlayer));
            }

            return par1ItemStack;
        }
}

Link to comment
Share on other sites

Make sure you put @ForgeSubscribe on your SoundLoadEvent.

And that your sound is in mcp/src/minecraft/assets/troncraft/sound/..

the sound is in the correct area, and when I put @ForgeSubscribe before the SoundLoadEvent, all sound goes away...

Link to comment
Share on other sites

Well you definately need the @ForgeSubscribe annotation. It's normal to surround the addSound() method with a try-catch statement. Do this and print in the catch part something like "Problem when trying to load TronCraft sounds".

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

Link to comment
Share on other sites

Well you definately need the @ForgeSubscribe annotation. It's normal to surround the addSound() method with a try-catch statement. Do this and print in the catch part something like "Problem when trying to load TronCraft sounds".

 

Sorry for the delay, was a bit busy the past couple of days. So now my onSound block reads:

public void onSound(SoundLoadEvent event) {
	try {
		event.manager.addSound("troncraft:freezer-hum.ogg");
	}
	catch(Exception e){ 
		System.out.println("Something went wrong loading Troncraft Sounds!");
	}
}

 

However, the same error is occurring without the catch printing anything to the console. I noticed something though, sound works fine up until I load a world, in which case this Exception prints to the console:

2013-08-01 15:35:20 [iNFO] [sTDERR] Exception in thread "Thread-13" java.lang.NullPointerException
2013-08-01 15:35:20 [iNFO] [sTDERR] 	at paulscode.sound.codecs.CodecJOrbis.readHeader(CodecJOrbis.java:448)
2013-08-01 15:35:20 [iNFO] [sTDERR] 	at paulscode.sound.codecs.CodecJOrbis.initialize(CodecJOrbis.java:301)
2013-08-01 15:35:20 [iNFO] [sTDERR] 	at paulscode.sound.libraries.LibraryLWJGLOpenAL.loadSound(LibraryLWJGLOpenAL.java:392)
2013-08-01 15:35:20 [iNFO] [sTDERR] 	at paulscode.sound.libraries.LibraryLWJGLOpenAL.newSource(LibraryLWJGLOpenAL.java:640)
2013-08-01 15:35:20 [iNFO] [sTDERR] 	at paulscode.sound.SoundSystem.CommandNewSource(SoundSystem.java:1800)
2013-08-01 15:35:20 [iNFO] [sTDERR] 	at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2415)
2013-08-01 15:35:20 [iNFO] [sTDERR] 	at paulscode.sound.CommandThread.run(CommandThread.java:121)

 

Then sound stops working everywhere, even after exiting the world. Upon exiting the game this prints to the console:

2013-08-01 15:38:04 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-08-01 15:38:09 [iNFO] [sTDOUT] Error in class 'SoundSystem'
2013-08-01 15:38:09 [iNFO] [sTDOUT]     Command thread did not die!
2013-08-01 15:38:09 [iNFO] [sTDOUT] Ignoring errors... continuing clean-up.
2013-08-01 15:38:09 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com

 

Any ideas?

Link to comment
Share on other sites

The sound may be too long.

 

 

And also, if the Item is in your hotbar, and it is supposed to PLAY the sound when it is in your hotbar, does it not make sense that the thread may have trouble "dying"?

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

The sound may be too long.

 

 

And also, if the Item is in your hotbar, and it is supposed to PLAY the sound when it is in your hotbar, does it not make sense that the thread may have trouble "dying"?

OK, do you know how long is too long? I want to create something like the industrialcraft machines the have a recurring sound. And It's only plays while it's in your hand, not just the hotbar, but yes that does make sense. Let me see what happens when I close the game with it not in my hand.

 

Edit: Alright, so the Sound error is only thrown when my custom sound tries to play. If I log on with the item not selected and log off without selecting it, sound plays fine with no errors or trouble closing the thread. However, if at any point I select the item, the error gets thrown and sound completely cuts out. The error seems to be what is causing the thread to have trouble closing. I am going to see if shortening the sound helps...

Link to comment
Share on other sites

I'm very interested in the solution to this problem, I havent encountered it myself but sounds code fascinates me.

I hope you can report back when you find out something :)

 

How long is the sound file? I did manage to play rather large files without a problem although I didn't thread it :)

 

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

I'm very interested in the solution to this problem, I havent encountered it myself but sounds code fascinates me.

I hope you can report back when you find out something :)

 

How long is the sound file? I did manage to play rather large files without a problem although I didn't thread it :)

 

It is currently 1:00 which is way longer than I need it to be now that i think about it. I'm going to shorten it to 0:10 to see if that works. If not, then I am going to shorten it to one second as a last resort to see if length is causing the problem.

Link to comment
Share on other sites

That lenght is not the problem, you can confirm this easly by creating a custom block which plays the sound on activation/r-click!

 

I do have several sounds longer than 2 minutes and they work! :)

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

That lenght is not the problem, you can confirm this easly by creating a custom block which plays the sound on activation/r-click!

 

I do have several sounds longer than 2 minutes and they work! :)

Ok, So If length isn't the problem, it has to be something with my code right? Could you please make sure I have everything and have it in the right place?

Link to comment
Share on other sites

Doesn't seem to be the code. Could be something in your file codec. How did you make it ?

I downloaded the original file of off the internet as a mp3. I manipulated it in Adobe Soundbooth CS4 saving it as an mp3 again (as soundbooth doesn't natively save to ogg) and then used an online converter to convert it to ogg.

Link to comment
Share on other sites

I also have this issue and I'm curious on what fixes it. Any luck yet? I personally converted my sound using Audacity which, to my knowledge, is quite universal. Also, I used stone.ogg by Mojang as a replacement for my sound and it still doesn't work (it's in assets/modID/sound). So I can hardly imagine that the codec of the sound file is the issue.

 

Does it perhaps have anything to do with the fact that it asks for a pack.mcmeta for my mod?

 

I'm really stuck on this so I hope this gets solved.

 

Here is my code btw, just so you guys can check.

 

 

My mod file

package mods.atmosmobs;

import java.util.logging.Logger;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;

@Mod(modid = "atmosmobs", name = "atmosmobs", version = "0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class AtmosMobs {

@PreInit
public void preInit(FMLPreInitializationEvent event) {

	MinecraftForge.EVENT_BUS.register(new AtmosMobs());
	MinecraftForge.EVENT_BUS.register(new AtmosMobsSounds());

	AMlogger = Logger.getLogger("atmosmobs");
	AMlogger.setParent(FMLLog.getLogger());

	tabAtmosMobs = new TabAtmosMobs(CreativeTabs.getNextID(), "AtmosMobs");
	AddItems();
	AtmosMobsConfiguration.init(event.getSuggestedConfigurationFile());
	AchievementPage.registerAchievementPage(new AtmosMobsAchievementPage());
	new EntitySpawning();

	AtmosMobs.AMlogger
			.info("Atmosmobs: preInit complete: sounds loaded and config loaded");
	AtmosMobs.AMlogger.info(" ");
}

public AtmosMobs() {

}

public String getVersion() {
	return "v0.1 (MC 1.6.2)";
}

@Mod.Init
public void load(FMLInitializationEvent event) {
	AddNames();
	AddRecipes();
	AddEggs();
	proxy.registerRenderInformation();
	AtmosMobs.AMlogger.info(" ");
	AtmosMobs.AMlogger.info("Atmosmobs: init complete");
	AtmosMobs.AMlogger.info(" ");
}

@PostInit
public void loadAPIs(FMLPostInitializationEvent event) {
	AtmosMobs.AMlogger.info(" ");
	AtmosMobs.AMlogger.info("Atmosmobs: Starting API load");
	AtmosMobs.AMlogger.info(" ");
	new ImplementAPIs();
	AtmosMobs.AMlogger.info(" ");
	AtmosMobs.AMlogger.info("Atmosmobs: postInit and API load complete");
	AtmosMobs.AMlogger.info(" ");
}

private void AddEggs() {
	EntityList.IDtoClassMapping.put(800,
			mods.atmosmobs.EntityButterfly.class);
	EntityList.entityEggs.put(Integer.valueOf(800), new EntityEggInfo(800,
			0x606051, 0xBD8B72));
	EntityList.IDtoClassMapping.put(801, mods.atmosmobs.EntityFox.class);
	EntityList.entityEggs.put(Integer.valueOf(801), new EntityEggInfo(801,
			0x606051, 0xBD8B72));
	AtmosMobs.AMlogger.info(" ");
	AtmosMobs.AMlogger.info("Atmosmobs: spawn Eggs registered");
	AtmosMobs.AMlogger.info(" ");
}

private void AddItems() {
	// SpiderEgg = new ItemSpiderEgg(SpiderEggID)
	// .setUnlocalizedName("Spider Egg");
	AtmosMobs.AMlogger.info(" ");
	AtmosMobs.AMlogger.info("Atmosmobs: items registered");
	AtmosMobs.AMlogger.info(" ");
}

private void AddNames() {
	// LanguageRegistry.addName(SpiderEgg, "Spider Egg");
	AtmosMobs.AMlogger.info(" ");
	AtmosMobs.AMlogger.info("Atmosmobs: language registry completed");
	AtmosMobs.AMlogger.info(" ");
}

private void AddRecipes() {
	// GameRegistry.addRecipe(new ItemStack(Item.dyePowder, 1, 14),
	// new Object[] { "#", '#', ButterflyMod.SpiderEggShell });
	// GameRegistry.addSmelting(AtmosMobs.CrabMeatRaw.itemID, new
	// ItemStack(AtmosMobs.CrabMeatCooked, 1), 1F);
}

public static void sendNameInfo(int i, String s) {
}

@SidedProxy(clientSide = "mods.atmosmobs.ClientProxy", serverSide = "mods.atmosmobs.CommonProxy")
public static mods.atmosmobs.CommonProxy proxy;
@Instance("atmosmobs")
public static AtmosMobs instance;
public static long lastTickRun = 0L;
public static Logger AMlogger;
public static CreativeTabs tabAtmosMobs;
}

My Sound Event file

package mods.atmosmobs;

import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class AtmosMobsSounds {
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSound(SoundLoadEvent event) {
	try {
		event.manager.addSound("atmosmobs:foxidle.ogg");
		// event.manager.addSound("atmosmobs:foxidle2.ogg");
		// event.manager.addSound("atmosmobs:foxhurt.ogg");
	} catch (Exception e) {
		System.err.println("Sounds not loaded");
	}
}
}

Entity that plays the sound

package mods.atmosmobs;

import net.minecraft.block.Block;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class EntityFox extends EntityMammel {

public EntityFox(World par1World) {
	super(par1World);
}

public void determineSpecies(World worldObj) {
	byte byte0 = 0;

	if (getOnSpawn()) {
		AxisAlignedBB axisalignedbb = boundingBox.expand(8D, 8D / 2D, 8D);
		int n = MathHelper.floor_double(axisalignedbb.minX);
		int o = MathHelper.floor_double(axisalignedbb.maxX + 1.0D);
		int p = MathHelper.floor_double(axisalignedbb.minY);
		int q = MathHelper.floor_double(axisalignedbb.maxY + 1.0D);
		int n1 = MathHelper.floor_double(axisalignedbb.minZ);
		int o1 = MathHelper.floor_double(axisalignedbb.maxZ + 1.0D);

		for (int p1 = n; p1 < o; p1++) {
			for (int q1 = p; q1 < q; q1++) {
				for (int n2 = n1; n2 < o1; n2++) {
					int o2 = worldObj.getBlockId(p1, q1, n2);

					if (o2 == 0) {
						continue;
					}

					if (o2 == Block.snow.blockID) {

						byte0 = 1;
					}
				}
			}
		}
	}

	setOnSpawn(false);
	setSpecies(byte0);
}

@Override
public void onUpdate() {
	determineSpecies(worldObj);
	super.onUpdate();
}

@Override
protected String getLivingSound() {
	return "atmosmobs:foxidle";
}

@Override
protected String getHurtSound() {
	return null;
}

@Override
protected String getDeathSound() {
	return null;
}

@Override
protected void playStepSound(int par1, int par2, int par3, int par4) {
	this.playSound("mob.pig.step", 0.15F, 1.0F);
}
}

My console before it stops the sound

aug 10, 2013 10:40:23 PM net.minecraft.launchwrapper.LogWrapper log
INFO: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker
2013-08-10 22:40:23 [iNFO] [ForgeModLoader] Forge Mod Loader version 6.2.35.804 for Minecraft 1.6.2 loading
2013-08-10 22:40:23 [iNFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_25, running on Windows 8:amd64:6.2, installed at C:\Program Files\Java\jre7
2013-08-10 22:40:23 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
2013-08-10 22:40:24 [iNFO] [sTDOUT] Loaded 39 rules from AccessTransformer config file fml_at.cfg
2013-08-10 22:40:24 [iNFO] [sTDOUT] Loaded 107 rules from AccessTransformer config file forge_at.cfg
2013-08-10 22:40:24 [sEVERE] [ForgeModLoader] The binary patch set is missing. Either you are in a development environment, or things are not going to work!
2013-08-10 22:40:24 [iNFO] [ForgeModLoader] Launching wrapped minecraft
2013-08-10 22:40:25 [iNFO] [Minecraft-Client] Setting user: Player796
2013-08-10 22:40:25 [iNFO] [Minecraft-Client] (Session ID is null)
2013-08-10 22:40:25 [iNFO] [Minecraft-Client] LWJGL Version: 2.9.0
2013-08-10 22:40:26 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default
2013-08-10 22:40:26 [iNFO] [sTDOUT] 
2013-08-10 22:40:26 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-08-10 22:40:26 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization
2013-08-10 22:40:26 [iNFO] [sTDOUT] MinecraftForge v9.10.0.804 Initialized
2013-08-10 22:40:26 [iNFO] [ForgeModLoader] MinecraftForge v9.10.0.804 Initialized
2013-08-10 22:40:26 [iNFO] [sTDOUT] Replaced 101 ore recipies
2013-08-10 22:40:26 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization
2013-08-10 22:40:26 [iNFO] [ForgeModLoader] Reading custom logging properties from F:\My Files\minecraft_modding\Modding\minecraftforge-src-1.6.2-9.10.0.804\forge\mcp\jars\config\logging.properties
2013-08-10 22:40:26 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
2013-08-10 22:40:26 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-08-10 22:40:26 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2013-08-10 22:40:26 [iNFO] [ForgeModLoader] Searching F:\My Files\minecraft_modding\Modding\minecraftforge-src-1.6.2-9.10.0.804\forge\mcp\jars\mods for mods
2013-08-10 22:40:26 [iNFO] [sTDOUT] OpenAL initialized.
2013-08-10 22:40:27 [iNFO] [sTDOUT] 
2013-08-10 22:40:28 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
2013-08-10 22:40:28 [iNFO] [mcp] Activating mod mcp
2013-08-10 22:40:28 [iNFO] [FML] Activating mod FML
2013-08-10 22:40:28 [iNFO] [Forge] Activating mod Forge
2013-08-10 22:40:28 [iNFO] [atmosmobs] Activating mod atmosmobs
2013-08-10 22:40:28 [WARNING] [atmosmobs] Mod atmosmobs is missing a pack.mcmeta file, things may not work well
2013-08-10 22:40:28 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:atmosmobs
2013-08-10 22:40:28 [iNFO] [sTDOUT] 
2013-08-10 22:40:28 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-08-10 22:40:28 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com
2013-08-10 22:40:28 [iNFO] [sTDOUT] 
2013-08-10 22:40:28 [iNFO] [sTDOUT] 
2013-08-10 22:40:28 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-08-10 22:40:28 [iNFO] [ForgeModLoader] Registering Forge Packet Handler
2013-08-10 22:40:28 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
2013-08-10 22:40:28 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
2013-08-10 22:40:28 [iNFO] [atmosmobs]  
2013-08-10 22:40:28 [iNFO] [atmosmobs] Atmosmobs: items registered
2013-08-10 22:40:28 [iNFO] [atmosmobs]  
2013-08-10 22:40:28 [iNFO] [atmosmobs]  
2013-08-10 22:40:28 [iNFO] [atmosmobs] Atmosmobs: achievement registry completed
2013-08-10 22:40:28 [iNFO] [atmosmobs]  
2013-08-10 22:40:28 [iNFO] [atmosmobs] atmosmobs: entity Butterfly registered
2013-08-10 22:40:28 [iNFO] [atmosmobs] atmosmobs: entity Fox registered
2013-08-10 22:40:28 [iNFO] [atmosmobs] Atmosmobs: preInit complete: sounds loaded and config loaded
2013-08-10 22:40:28 [iNFO] [atmosmobs]  
2013-08-10 22:40:28 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-08-10 22:40:28 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2013-08-10 22:40:28 [iNFO] [sTDOUT] OpenAL initialized.
2013-08-10 22:40:28 [iNFO] [sTDOUT] 
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: language registry completed
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: spawn Eggs registered
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: init complete
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: Starting API load
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: ExtraBiomesXL not found: continue
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: BiomesOPlenty not found: continue
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: Highlands not found: continue
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [atmosmobs] Atmosmobs: postInit and API load complete
2013-08-10 22:40:29 [iNFO] [atmosmobs]  
2013-08-10 22:40:29 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
2013-08-10 22:40:29 [WARNING] [atmosmobs] Mod atmosmobs is missing a pack.mcmeta file, things may not work well
2013-08-10 22:40:29 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:atmosmobs
2013-08-10 22:40:29 [iNFO] [sTDOUT] 
2013-08-10 22:40:29 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-08-10 22:40:29 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com
2013-08-10 22:40:29 [iNFO] [sTDOUT] 
2013-08-10 22:40:29 [iNFO] [sTDOUT] 
2013-08-10 22:40:29 [iNFO] [sTDOUT] Starting up SoundSystem...
2013-08-10 22:40:29 [iNFO] [sTDOUT] Initializing LWJGL OpenAL
2013-08-10 22:40:29 [iNFO] [sTDOUT]     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
2013-08-10 22:40:29 [iNFO] [sTDOUT] OpenAL initialized.
2013-08-10 22:40:30 [iNFO] [sTDOUT] 
2013-08-10 22:40:30 [sEVERE] [Minecraft-Client] Realms: Invalid session id
2013-08-10 22:40:36 [iNFO] [Minecraft-Server] Starting integrated minecraft server version 1.6.2
2013-08-10 22:40:36 [iNFO] [Minecraft-Server] Generating keypair
2013-08-10 22:40:36 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@34d24c94)
2013-08-10 22:40:36 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@34d24c94)
2013-08-10 22:40:36 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@34d24c94)
2013-08-10 22:40:36 [iNFO] [Minecraft-Server] Preparing start region for level 0
2013-08-10 22:40:37 [iNFO] [sTDOUT] loading single player
2013-08-10 22:40:37 [iNFO] [Minecraft-Server] Player796[/127.0.0.1:0] logged in with entity id 53 at (1669.5907000626871, 3.0, 573.7725058052233)
2013-08-10 22:40:37 [iNFO] [Minecraft-Server] Player796 joined the game
2013-08-10 22:40:37 [iNFO] [sTDOUT] Setting up custom skins
2013-08-10 22:40:38 [iNFO] [sTDERR] Exception in thread "Thread-13" java.lang.NullPointerException
2013-08-10 22:40:38 [iNFO] [sTDERR] 	at paulscode.sound.codecs.CodecJOrbis.readHeader(CodecJOrbis.java:448)
2013-08-10 22:40:38 [iNFO] [sTDERR] 	at paulscode.sound.codecs.CodecJOrbis.initialize(CodecJOrbis.java:301)
2013-08-10 22:40:38 [iNFO] [sTDERR] 	at paulscode.sound.libraries.LibraryLWJGLOpenAL.loadSound(LibraryLWJGLOpenAL.java:392)
2013-08-10 22:40:38 [iNFO] [sTDERR] 	at paulscode.sound.libraries.LibraryLWJGLOpenAL.newSource(LibraryLWJGLOpenAL.java:640)
2013-08-10 22:40:38 [iNFO] [sTDERR] 	at paulscode.sound.SoundSystem.CommandNewSource(SoundSystem.java:1800)
2013-08-10 22:40:38 [iNFO] [sTDERR] 	at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2415)
2013-08-10 22:40:38 [iNFO] [sTDERR] 	at paulscode.sound.CommandThread.run(CommandThread.java:121)
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving and pausing game...
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Stopping server
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving players
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Player796 left the game
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving worlds
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2013-08-10 22:40:40 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2013-08-10 22:40:40 [iNFO] [ForgeModLoader] Unloading dimension 0
2013-08-10 22:40:40 [iNFO] [ForgeModLoader] Unloading dimension -1
2013-08-10 22:40:40 [iNFO] [ForgeModLoader] Unloading dimension 1
2013-08-10 22:40:41 [iNFO] [Minecraft-Client] Stopping!
2013-08-10 22:40:41 [iNFO] [sTDOUT] 
2013-08-10 22:40:41 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-08-10 22:40:46 [iNFO] [sTDOUT] Error in class 'SoundSystem'
2013-08-10 22:40:46 [iNFO] [sTDOUT]     Command thread did not die!
2013-08-10 22:40:46 [iNFO] [sTDOUT] Ignoring errors... continuing clean-up.
2013-08-10 22:40:46 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com
2013-08-10 22:40:46 [iNFO] [sTDOUT] 

 

 

 

 

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache  and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
    • When I came across the 'Exit Code: I got a 1 error in my Minecraft mods, so I decided to figure out what was wrong. First, I took a look at the logs. In the mods folder (usually where you'd find logs or crash reports), I found the latest.log file or the corresponding crash report. I read it through carefully, looking for any lines with errors or warnings. Then I checked the Minecraft Forge support site, where you can often find info on what causes errors and how to fix them. I then disabled half of my mods and tried running the game. If the error disappeared, it meant that the problem was with the disabled mod. I repeated this several times to find the problem mod.
  • Topics

×
×
  • Create New...

Important Information

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