-
Posts
5 -
Joined
-
Last visited
Posts posted by Daveyx0
-
-
Hey there,
Throughout the years I worked on many entities and spawning systems but one problem seems to often arrise: users report their global mob spawns being reduced.
So I made a new system and voila, I receive the same complaints on day-one of release. So I am obviously missing an essential point of mob spawning.
In my current iteration I have a vanilla-inspired spawning system that uses an event to trigger, shown here: https://github.com/Daveyx0/MultiMob/blob/master/main/java/net/daveyx0/multimob/spawn/MMWorldSpawner.java
(all other relevant files are in the parent "spawn" package). It grabs spawn entries from configs to create spawns, but that presumably has nothing to do with my issue. It works (seemingly) completely seperate from the vanilla version of the system; yet it appears to affect it anyways. Reason for using this system is essentially the option to input my own conditions for spawning on a mod-basis-level and for flexibility.
I looked around in the source code for MC and was not able to detect a clue on why my code would hamper the spawning of vanilla mobs. In fact, it always APPEARS to work fine in dev environment, but users then report something completely different.
My question here essentially is if people know about a common mistake I'm running into (like a complete newb) or if there is something else at play here. Or am I cursed? Having a hard time with this one.
Thanks in advance!
Daveyx0
-
Thanks for the quick reply diesieben07. Although this wasn't my problem, it did lead me to the solution. I actually put my check in the wrong location I feel so dumb. Thanks again!
-
Hey there,
I was wondering if it was in some way possible to get the domains or modIDs of all the mods currently installed through code. I want to use this for a class that gets information out of certain textures. I would love to add mod compatibility to this, but I'm having trouble getting into the assets folder and looking for the other mod's block textures. I was able to do it with the original Minecraft textures through it's domain.
Sadly this resulted in only Minecraft's domain:
SimpleReloadableResourceManager resourceManager; resourceManager = (SimpleReloadableResourceManager)Minecraft.getMinecraft().getResourceManager(); Set set = resourceManager.getResourceDomains(); Object[] domains = set.toArray();
Another way would be to get the path for the assets folder and getting the name of the folders inside. However I don't know what this will do after a build. Would that still work? Or could I do it with inputStreams somehow? I couldn't find someone with simular needs so therefore I am posting here.
Thanks in advance for any answers!
-
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]
[1.12.2] Entity spawn system reducing global entity spawns
in Modder Support
Posted
Thanks for the response, diesieben. (Nice to see you are still at it on these forums :P ) Yes, I do use countEntities, but I use it to limit the spawn of that specific entity class, not ALL mobs. I received reports of modded mobs also spawning less and I cannot even check for those classes so I find it hard to believe that that would be the issue... I'll try to remove it when I get home from work and see, but I doubt it's the problem.
If you find anything else suspicious, please let me know. I'm still stumped.