Sadly, this did not work, and the game now crashes, but I'm a little stumped as to why.
My EntityJoinWorldEvent now looks like this:
[spoiler=EntityJoinWorldEvent]
@SubscribeEvent
public void replaceHorses(EntityJoinWorldEvent event){
if(!event.world.isRemote){
if (event.entity instanceof EntityHorse && !(event.entity instanceof EntityAdvancedHorse)){
EntityHorse theHorse = (EntityHorse) event.entity;
EntityAdvancedHorse newHorse = new EntityAdvancedHorse(event.world);
newHorse.setPosition(event.entity.posX, event.entity.posY, event.entity.posZ);
System.out.println("Makey advanced");
event.world.spawnEntityInWorld(newHorse);
event.setCanceled(true);
}
}
}
When entering my world, the game crashes with the following stack trace:
[spoiler=Stack trace]
[06:52:51] [main/INFO] [FML]: Forge Mod Loader version 8.99.0.1405 for Minecraft 1.8 loading
[06:52:51] [main/INFO] [FML]: Java is Java HotSpot(TM) Client VM, version 1.8.0_45, running on Windows XP:x86:5.1, installed at C:\Program Files\Java\jre1.8.0_45
[06:52:51] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[06:52:51] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[06:52:51] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[06:52:51] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[06:52:51] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[06:52:51] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[06:52:51] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[06:52:51] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[06:52:51] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[06:52:51] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[06:52:52] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[06:52:56] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[06:52:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[06:52:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[06:52:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[06:52:56] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[06:52:56] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[06:52:56] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[06:52:57] [Client thread/INFO]: Setting user: QueenNuffer
[06:52:59] [Client thread/INFO]: LWJGL Version: 2.9.1
[06:53:00] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:224]: ---- Minecraft Crash Report ----
// I let you down. Sorry
Time: 6/11/15 6:53 AM
Description: Loading screen debug info
java.lang.Throwable
at net.minecraftforge.fml.client.SplashProgress.start(SplashProgress.java:223)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:195)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:446)
at net.minecraft.client.Minecraft.run(Minecraft.java:356)
at net.minecraft.client.main.Main.main(Main.java:117)
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 net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows XP (x86) version 5.1
Java Version: 1.8.0_45, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation
Memory: 61930704 bytes (59 MB) / 127631360 bytes (121 MB) up to 259522560 bytes (247 MB)
JVM Flags: 0 total;
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML:
Loaded coremods (and transformers):
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 347.25' Renderer: 'GeForce GT 630/PCIe/SSE2'
[06:53:00] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[06:53:00] [Client thread/INFO] [FML]: MinecraftForge v11.14.1.1405 Initialized
[06:53:00] [Client thread/INFO] [FML]: Replaced 204 ore recipies
[06:53:00] [Client thread/INFO] [FML]: Preloading CrashReport classes
[06:53:00] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[06:53:00] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[06:53:00] [Client thread/INFO] [FML]: Searching G:\ForgeDev\Mods\HorsinAround\mods for mods
[06:53:01] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[06:53:01] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, HorsinAround] at CLIENT
[06:53:01] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, HorsinAround] at SERVER
[06:53:02] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Horsin' Around
[06:53:02] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[06:53:02] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations
[06:53:02] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[06:53:02] [Client thread/INFO] [FML]: Applying holder lookups
[06:53:02] [Client thread/INFO] [FML]: Holder lookups applied
[06:53:05] [sound Library Loader/INFO]: Starting up SoundSystem...
[06:53:05] [Thread-9/INFO]: Initializing LWJGL OpenAL
[06:53:05] [Thread-9/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
[06:53:07] [Thread-9/INFO]: OpenAL initialized.
[06:53:07] [sound Library Loader/INFO]: Sound engine started
[06:53:10] [Client thread/INFO]: Created: 512x512 textures-atlas
[06:53:10] [Client thread/ERROR] [FML]: Model definition for location horsinaround:PaddedLeather#inventory not found
[06:53:10] [Client thread/ERROR] [FML]: Model definition for location horsinaround:staticator#inventory not found
[06:53:10] [Client thread/ERROR] [FML]: Model definition for location horsinaround:ToffeeApple#inventory not found
[06:53:10] [Client thread/ERROR] [FML]: Model definition for location horsinaround:CookedZombieFlesh#inventory not found
[06:53:11] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[06:53:11] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Horsin' Around
[06:53:11] [Client thread/INFO]: SoundSystem shutting down...
[06:53:11] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[06:53:11] [sound Library Loader/INFO]: Starting up SoundSystem...
[06:53:12] [Thread-11/INFO]: Initializing LWJGL OpenAL
[06:53:12] [Thread-11/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
[06:53:12] [Thread-11/INFO]: OpenAL initialized.
[06:53:12] [sound Library Loader/INFO]: Sound engine started
[06:53:16] [Client thread/INFO]: Created: 512x512 textures-atlas
[06:53:16] [Client thread/ERROR] [FML]: Model definition for location horsinaround:PaddedLeather#inventory not found
[06:53:16] [Client thread/ERROR] [FML]: Model definition for location horsinaround:staticator#inventory not found
[06:53:16] [Client thread/ERROR] [FML]: Model definition for location horsinaround:ToffeeApple#inventory not found
[06:53:16] [Client thread/ERROR] [FML]: Model definition for location horsinaround:CookedZombieFlesh#inventory not found
[06:53:22] [server thread/INFO]: Starting integrated minecraft server version 1.8
[06:53:22] [server thread/INFO]: Generating keypair
[06:53:22] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[06:53:22] [server thread/INFO] [FML]: Applying holder lookups
[06:53:22] [server thread/INFO] [FML]: Holder lookups applied
[06:53:22] [server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@1415cef)
[06:53:22] [server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@1415cef)
[06:53:22] [server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@1415cef)
[06:53:22] [server thread/INFO]: Preparing start region for level 0
[06:53:23] [server thread/INFO] [sTDOUT]: [com.queennuffer.horsinaround.BreedManager:replaceHorses:37]: Makey advanced
[06:53:23] [server thread/ERROR]: Encountered an unexpected exception
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(Unknown Source) ~[?:1.8.0_45]
at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.8.0_45]
at com.google.common.collect.AbstractMapBasedMultimap$WrappedCollection$WrappedIterator.next(AbstractMapBasedMultimap.java:486) ~[guava-17.0.jar:?]
at net.minecraft.util.ClassInheritanceMultiMap$2.computeNext(ClassInheritanceMultiMap.java:125) ~[forgeSrc-1.8-11.14.1.1405.jar:?]
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) ~[guava-17.0.jar:?]
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) ~[guava-17.0.jar:?]
at net.minecraft.world.World.loadEntities(World.java:3372) ~[World.class:?]
at net.minecraft.world.chunk.Chunk.onChunkLoad(Chunk.java:1017) ~[Chunk.class:?]
at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:46) ~[ChunkIOProvider.class:?]
at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:12) ~[ChunkIOProvider.class:?]
at net.minecraftforge.common.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:344) ~[AsynchronousExecutor.class:?]
at net.minecraftforge.common.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:302) ~[AsynchronousExecutor.class:?]
at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:12) ~[ChunkIOExecutor.class:?]
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:133) ~[ChunkProviderServer.class:?]
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:108) ~[ChunkProviderServer.class:?]
at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:343) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:113) ~[integratedServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:130) ~[integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:500) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
[06:53:23] [server thread/ERROR]: This crash report has been saved to: G:\ForgeDev\Mods\HorsinAround\.\crash-reports\crash-2015-06-11_06.53.23-server.txt
[06:53:23] [server thread/INFO] [FML]: Applying holder lookups
[06:53:23] [server thread/INFO] [FML]: Holder lookups applied
[06:53:23] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded.
[06:53:24] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: ---- Minecraft Crash Report ----
// I feel sad now
Time: 6/11/15 6:53 AM
Description: Exception in server tick loop
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at com.google.common.collect.AbstractMapBasedMultimap$WrappedCollection$WrappedIterator.next(AbstractMapBasedMultimap.java:486)
at net.minecraft.util.ClassInheritanceMultiMap$2.computeNext(ClassInheritanceMultiMap.java:125)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at net.minecraft.world.World.loadEntities(World.java:3372)
at net.minecraft.world.chunk.Chunk.onChunkLoad(Chunk.java:1017)
at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:46)
at net.minecraftforge.common.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:12)
at net.minecraftforge.common.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:344)
at net.minecraftforge.common.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:302)
at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:12)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:133)
at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:108)
at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:343)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:113)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:130)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:500)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows XP (x86) version 5.1
Java Version: 1.8.0_45, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation
Memory: 77899184 bytes (74 MB) / 208257024 bytes (198 MB) up to 259522560 bytes (247 MB)
JVM Flags: 0 total;
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.10 FML v8.99.0.1405 Minecraft Forge 11.14.1.1405 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
FML{8.99.0.1405} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1405.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
Forge{11.14.1.1405} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1405.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
HorsinAround{1.0} [Horsin' Around] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available
Loaded coremods (and transformers):
GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
Profiler Position: N/A (disabled)
Player Count: 0 / 8; []
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
[06:53:24] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2015-06-11_06.53.23-server.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Things I've tried:
- Adding the spawnEntityInWorld to the server's scheduled tasks as a new Runnable (thinking maybe it was a threading issue). Same effect.
- Making newHorse an instance of EntityPig, just to rule out being an issue with my class. Same effect.
Any pointers please?