Posted August 14, 201510 yr This does not happen in the dev environment, it only happens when I put the mod on my server and a client logs out. I'm not sure if it matters if multiple clients are connected or just one. Haven't tested yet. I get the following crash for a concurrent modification Console : [13:15:12] [server thread/INFO] [sTDOUT]: [clandoolittle.dimension_multiplyer.Common.Events.MyEvents_FML:tick:272]: - TICK Console : [13:15:12] [server thread/INFO] [sTDOUT]: [clandoolittle.dimension_multiplyer.Common.Blocks.Tile.Tile_Manager:tick:26]: - tick Console : [13:15:12] [server thread/INFO] [sTDOUT]: [clandoolittle.dimension_multiplyer.Common.Blocks.Tile.Tile_Manager:tick:30]: - server Console : [13:15:12] [server thread/INFO] [sTDOUT]: [clandoolittle.dimension_multiplyer.Common.Blocks.Tile.Tile_Manager:tick:37]: - item : clandoolittle.dimension_multiplyer.Common.Blocks.Tile.Types.Protection_Admin_Tile@1fce3adc Console : [13:15:12] [server thread/INFO] [sTDOUT]: [clandoolittle.dimension_multiplyer.Common.Blocks.Tile.Tile_Manager:tick:40]: - tile : clandoolittle.dimension_multiplyer.Common.Blocks.Tile.Types.Protection_Admin_Tile@1fce3adc Console : [13:15:12] [server thread/INFO] [sTDOUT]: [clandoolittle.dimension_multiplyer.Common.Events.MyEvents_FML:onServerTickEvent:256]: - Phase : START / SERVER Console : [13:15:13] [server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$ServerTickEvent@481e9d02: Console : java.util.ConcurrentModificationException Console : at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859) ~[?:1.7.0_79] Console : at java.util.ArrayList$Itr.next(ArrayList.java:831) ~[?:1.7.0_79] Console : at clandoolittle.custom_npc.Common.Blocks.Tile.Tile_Manager.tick(Tile_Manager.java:22) ~[Tile_Manager.class:?] Console : at clandoolittle.custom_npc.Common.Events.MyEvents_FML.tick(MyEvents_FML.java:42) ~[MyEvents_FML.class:?] Console : at clandoolittle.custom_npc.Common.Events.MyEvents_FML.onServerTickEvent(MyEvents_FML.java:33) ~[MyEvents_FML.class:?] Console : at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_MyEvents_FML_onServerTickEvent_ServerTickEvent.invoke(.dynamic) ~[?:?] Console : at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) ~[ASMEventHandler.class:?] Console : at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) [EventBus.class:?] Console : at net.minecraftforge.fml.common.FMLCommonHandler.onPostServerTick(FMLCommonHandler.java:288) [FMLCommonHandler.class:?] Console : at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:642) [MinecraftServer.class:?] Console : at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?] Console : at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79] Console : [13:15:13] [server thread/ERROR] [FML]: Index: 1 Listeners: Console : [13:15:13] [server thread/ERROR] [FML]: 0: NORMAL Console : [13:15:13] [server thread/ERROR] [FML]: 1: ASM: clandoolittle.custom_npc.Common.Events.MyEvents_FML@17249f80 onServerTickEvent(Lnet/minecraftforge/fml/common/gameevent/TickEvent$ServerTickEvent;)V Console : [13:15:13] [server thread/ERROR] [FML]: 2: ASM: clandoolittle.dimension_manager.Common.Events.MyEvents_FML@48637ff4 onServerTickEvent(Lnet/minecraftforge/fml/common/gameevent/TickEvent$ServerTickEvent;)V Console : [13:15:13] [server thread/ERROR] [FML]: 3: ASM: clandoolittle.dimension_multiplyer.Common.Events.MyEvents_FML@40497eb8 onServerTickEvent(Lnet/minecraftforge/fml/common/gameevent/TickEvent$ServerTickEvent;)V Console : [13:15:13] [server thread/ERROR] [FML]: 4: ASM: clandoolittle.permissions.Common.Events.MyEvents_FML@14c64f65 onServerTickEvent(Lnet/minecraftforge/fml/common/gameevent/TickEvent$ServerTickEvent;)V Console : [13:15:13] [server thread/ERROR]: Encountered an unexpected exception Console : java.util.ConcurrentModificationException Console : at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859) ~[?:1.7.0_79] Console : at java.util.ArrayList$Itr.next(ArrayList.java:831) ~[?:1.7.0_79] Console : at clandoolittle.custom_npc.Common.Blocks.Tile.Tile_Manager.tick(Tile_Manager.java:22) ~[Tile_Manager.class:?] Console : at clandoolittle.custom_npc.Common.Events.MyEvents_FML.tick(MyEvents_FML.java:42) ~[MyEvents_FML.class:?] Console : at clandoolittle.custom_npc.Common.Events.MyEvents_FML.onServerTickEvent(MyEvents_FML.java:33) ~[MyEvents_FML.class:?] Console : at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_MyEvents_FML_onServerTickEvent_ServerTickEvent.invoke(.dynamic) ~[?:?] Console : at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) ~[ASMEventHandler.class:?] Console : at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) ~[EventBus.class:?] Console : at net.minecraftforge.fml.common.FMLCommonHandler.onPostServerTick(FMLCommonHandler.java:288) ~[FMLCommonHandler.class:?] Console : at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:642) ~[MinecraftServer.class:?] Console : at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?] Console : at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79] Console : [13:15:13] [server thread/ERROR]: This crash report has been saved to: /home/minecraft/McMyAdmin_2/Minecraft/./crash-reports/crash-2015-08-14_13.15.13-server.txt CrashLog - not really much detail ---- Minecraft Crash Report ---- // Hey, that tickles! Hehehe! Time: 8/14/15 1:15 PM Description: Exception in server tick loop java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859) at java.util.ArrayList$Itr.next(ArrayList.java:831) at clandoolittle.custom_npc.Common.Blocks.Tile.Tile_Manager.tick(Tile_Manager.java:22) at clandoolittle.custom_npc.Common.Events.MyEvents_FML.tick(MyEvents_FML.java:42) at clandoolittle.custom_npc.Common.Events.MyEvents_FML.onServerTickEvent(MyEvents_FML.java:33) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_MyEvents_FML_onServerTickEvent_ServerTickEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraftforge.fml.common.FMLCommonHandler.onPostServerTick(FMLCommonHandler.java:288) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:642) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) at java.lang.Thread.run(Thread.java:745) 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: Linux (amd64) version 3.5.0-54-generic Java Version: 1.7.0_79, Oracle Corporation Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 212908352 bytes (203 MB) / 504889344 bytes (481 MB) up to 8555069440 bytes (8158 MB) JVM Flags: 2 total; -XX:+UseConcMarkSweepGC -Xmx8192M IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1450 7 mods loaded, 7 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (ForgeMod.jar) UCHIJAAAA Forge{11.14.3.1450} [Minecraft Forge] (ForgeMod.jar) UCHIJAAAA custom_npc{1.1} [Custom NPC] (Custom NPC-Forge-1.8-11.14.3.1450 3.0.jar) UCHIJAAAA dimension_manager{1.1} [Dimension Manager] (Dimension Manager-Forge-1.8-11.14.3.1450 3.0.jar) UCHIJAAAA dimension_multiplyer{1.2} [Dimension Multiplyer] (Dimension Multiplyer-Forge-1.8-11.14.3.1450 3.0.jar) UCHIJAAAA permissions{1.2} [Permissions] (Permissions-Forge-1.8-11.14.3.1450 3.0.jar) Loaded coremods (and transformers): Profiler Position: N/A (disabled) Player Count: 0 / 40; [] Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt) I added the print statements to try and determine where it is crashing. It makes no sense where it is crashing. The ServerTickEvent is called. It then goes to call my routine 'tick()' and it never gets into 'tick()' to its print statement. I tried it without the phase check, failure was the same. I actually just added the phase deal as part of testing this. // TickEvents @SubscribeEvent public void onServerTickEvent(ServerTickEvent event) { //public void onServerTickEvent(ServerTickEvent event) { System.out.println(" - Phase : " + event.phase + " / " + event.type); // Phase if (event.phase.equals(Phase.END)) { // Handle Tick tick(); tick_1sec(); tick_5sec(); tick_30sec(); } } private void tick() { System.out.println(" - TICK"); // Call tick functions instance.tile_manager().tick(Side.SERVER); instance.player_manager().tick(Side.SERVER); instance.entity_manager().tick(Side.SERVER); instance.world_manager().tick(Side.SERVER); } I traced the calls to make sure nothing is calling this tick from somewehre else and it isn't. I don't understand why a client logging out would cause a concurrent error on something that is only called from one place... EDIT : Correction, I read the print statement timing wrong. It fails between the start and end tick without ever calling 'tick()' To make it more interested I commented out the call to 'tick()' and it still crashes with the exact same error and claimed location even though that peice of code is never called now. EDIT 2 : Just noticed it happens when I change dimensions as well. Long time Bukkit & Forge Programmer Happy to try and help
August 14, 201510 yr Author here it is public class Tile_Manager { // Declare Variables private List<MyBaseTile> tiles_Tick = new ArrayList<MyBaseTile>(); private HashMap<Integer, Protection_Admin_Tile_List> tiles_Protection = new HashMap<Integer, Protection_Admin_Tile_List>(); private List<Protection_Admin_Tile> tile_Protection_init = new ArrayList<Protection_Admin_Tile>(); public Tile_Manager() { } // Handle Tick public void tick(Side side) { //System.out.println(" - tick"); // Check for server if (side.equals(Side.SERVER)) { //System.out.println(" - server"); // Setup Variables List<MyBaseTile> tiles_delete = new ArrayList<MyBaseTile>(); // Cycle Tiles for (MyBaseTile item : tiles_Tick) { //System.out.println(" - item : " + item); MyBaseTile tile = (MyBaseTile) item.getWorld().getTileEntity(item.getPos()); System.out.println(" - tile : " + tile + " / " + item.getWorld().provider.getDimensionId() + " / " + item.getPos()); // Check for tile if (tile != null) { tile.tick(Side.SERVER); } else { tiles_delete.add(item); } } // Clear empties tiles_Tick.removeAll(tiles_delete); } } public void tick_1sec(Side side) { // Check for server if (side.equals(Side.SERVER)) { // Action tick_tile_Protection_init(); // Setup Variables List<MyBaseTile> tiles_delete = new ArrayList<MyBaseTile>(); // Cycle Tiles for (MyBaseTile item : tiles_Tick) { // Get the tile MyBaseTile tile = (MyBaseTile) item.getWorld().getTileEntity(item.getPos()); // Check for tile if (tile != null) { tile.tick_1sec(Side.SERVER); } else { tiles_delete.add(item); } } // Clear empties tiles_Tick.removeAll(tiles_delete); } } public void tile_Tick(MyBaseTile tile) { tiles_Tick.add(tile); } public void tile_Protection_init(Protection_Admin_Tile tile) { if (!tile_Protection_init.contains(tile)) {tile_Protection_init.add(tile);} } private void tick_tile_Protection_init() { // Setup Variables List<Protection_Admin_Tile> delete = new ArrayList<Protection_Admin_Tile>(); // Cycle for (Protection_Admin_Tile item : tile_Protection_init) { // Check for world if (item.getWorld() != null) { // add to delete list delete.add(item); // Process tile_Protection(item); } } // Remove tile_Protection_init.removeAll(delete); } public void tile_Protection(Protection_Admin_Tile tile) { // Setup Variables int dimension = tile.getWorld().provider.getDimensionId(); // Check for dimension if (tiles_Protection.containsKey(dimension)) { // Add to List tiles_Protection.get(dimension).tile_Protection(tile); } else { // Create new list and populate Protection_Admin_Tile_List tile_List = new Protection_Admin_Tile_List(); tile_List.tile_Protection(tile); // Add to map tiles_Protection.put(dimension, tile_List); } } public boolean blocked (EntityPlayer player, BlockPos pos) { // Setup Variables int dimension = player.worldObj.provider.getDimensionId(); // Check for dimension if (tiles_Protection.containsKey(dimension)) { // Add to List return tiles_Protection.get(dimension).blocked(player, pos); } else { // Nothing found return false; } } } Edit : Also just went and found the one tile currently in the world and deleted it, now it doesn't crash. Going to try other type tiles to see if it is just that block Edit 2 : yep, its just the protection block. The search narrows Edit 3: the search widens back. Even with no tiles (from that mod) in the world, it still creates the error teleporting to certain dimensions. Long time Bukkit & Forge Programmer Happy to try and help
August 14, 201510 yr Author I misunderstood something in a post about TileEntities not ticking on their own in 1.8 early on in the conversion. Just never changed it after I realized what the post really meant. And, it worked so... But, maybe that is the solution. Still don't understand the error with concurrent modification of something that really doesn't look to be. Long time Bukkit & Forge Programmer Happy to try and help
August 14, 201510 yr I misunderstood something in a post about TileEntities not ticking on their own in 1.8 early on in the conversion. Yeah, there's a boolean in the TileEntity class that controls their tick/not-tick behavior. There's a setter for it. Use it. (Or a function you override, I haven't actually messed with 1.8 yet, but the standard behavior still exists) Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 14, 201510 yr Author Going to convert it now. This error still bugs me though, even though I shouldn't do it this way, I don't understand why it works in dev environment but not on server. Long time Bukkit & Forge Programmer Happy to try and help
August 14, 201510 yr Author I was a bit overwhelmed when I was doing the conversion of all my mods. Can't remember why I settled on this. It isn't that hard to implement what I did. I realize you don't like it. Edit : Thank you both for the help and advice. Long time Bukkit & Forge Programmer Happy to try and help
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.