Jump to content

[1.10.2] Unexpected error java.util.ConcurrentModificationException.


Recommended Posts

Posted

Fellow modder, I am stuck on this for a while. if I replace the defaultstate to anything else, it will work. But it will crash when being changed to FIRE.

 

(I am trying to make a molotov that creates a patch of fire. If you have any tips on how to improve my code, please do so).

 

Error log:

 

[20:34:21] [Client thread/FATAL]: Unreported exception thrown!
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(Unknown Source) ~[?:1.8.0_101]
at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.8.0_101]
at net.minecraft.client.renderer.RenderGlobal.updateClouds(RenderGlobal.java:1194) ~[RenderGlobal.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1874) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
[20:34:21] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: ---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 3-10-16 20:34
Description: Unexpected error

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at net.minecraft.client.renderer.RenderGlobal.updateClouds(RenderGlobal.java:1194)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1874)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118)
at net.minecraft.client.Minecraft.run(Minecraft.java:406)
at net.minecraft.client.main.Main.main(Main.java:118)
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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)


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

-- Head --
Thread: Client thread
Stacktrace:
at java.util.HashMap$HashIterator.nextNode(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at net.minecraft.client.renderer.RenderGlobal.updateClouds(RenderGlobal.java:1194)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityPlayerSP['Player948'/132, l='MpServer', x=-248,57, y=79,47, z=570,47]]
Chunk stats: MultiplayerChunkCache: 287, 287
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (-185,64,373), Chunk: (at 7,4,5 in -12,23; contains blocks -192,0,368 to -177,255,383), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 16424 game time, 2607 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 61 total; [molotovEntity['Molotov_Entity'/272, l='MpServer', x=-237,42, y=64,28, z=593,05], EntitySkeleton['Skeleton'/150, l='MpServer', x=-324,50, y=21,00, z=619,50], EntityCreeper['Creeper'/151, l='MpServer', x=-303,92, y=20,00, z=632,42], EntityZombie['Zombie'/23, l='MpServer', x=-324,50, y=20,00, z=527,50], EntitySkeleton['Skeleton'/152, l='MpServer', x=-318,47, y=23,00, z=632,27], EntityCreeper['Creeper'/153, l='MpServer', x=-314,20, y=18,00, z=622,64], EntitySquid['Squid'/158, l='MpServer', x=-267,84, y=61,99, z=591,24], EntityBat['Bat'/160, l='MpServer', x=-280,25, y=28,10, z=637,44], EntityBat['Bat'/33, l='MpServer', x=-320,43, y=16,56, z=525,60], EntityCreeper['Creeper'/34, l='MpServer', x=-312,62, y=42,00, z=544,17], EntityCreeper['Creeper'/35, l='MpServer', x=-308,50, y=18,00, z=546,50], EntitySkeleton['Skeleton'/163, l='MpServer', x=-273,50, y=24,00, z=618,50], EntityZombie['Zombie'/36, l='MpServer', x=-317,54, y=15,00, z=545,83], EntitySkeleton['Skeleton'/164, l='MpServer', x=-278,26, y=23,00, z=616,47], EntityBat['Bat'/166, l='MpServer', x=-266,07, y=28,10, z=630,67], EntityZombie['Zombie'/167, l='MpServer', x=-271,70, y=28,00, z=628,07], EntityZombie['Zombie'/168, l='MpServer', x=-271,30, y=28,00, z=627,30], EntityBat['Bat'/169, l='MpServer', x=-267,54, y=17,45, z=626,89], EntityCreeper['Creeper'/174, l='MpServer', x=-261,50, y=24,00, z=645,50], EntityChicken['Chicken'/178, l='MpServer', x=-238,10, y=64,00, z=601,62], EntityZombie['Zombie'/51, l='MpServer', x=-292,50, y=44,00, z=490,50], EntityChicken['Chicken'/179, l='MpServer', x=-235,41, y=64,00, z=598,09], EntityZombie['Zombie'/52, l='MpServer', x=-291,99, y=44,00, z=492,06], EntityChicken['Chicken'/180, l='MpServer', x=-224,08, y=66,00, z=589,56], EntityCreeper['Creeper'/53, l='MpServer', x=-294,20, y=44,00, z=491,47], EntitySkeleton['Skeleton'/181, l='MpServer', x=-193,90, y=20,00, z=604,53], EntitySkeleton['Skeleton'/54, l='MpServer', x=-299,50, y=20,00, z=511,50], EntityCreeper['Creeper'/182, l='MpServer', x=-192,19, y=19,00, z=601,48], EntitySkeleton['Skeleton'/55, l='MpServer', x=-299,50, y=20,00, z=508,50], EntityZombie['Zombie'/56, l='MpServer', x=-302,58, y=27,00, z=508,48], EntityBat['Bat'/184, l='MpServer', x=-177,25, y=25,10, z=590,25], EntityBat['Bat'/57, l='MpServer', x=-296,70, y=14,51, z=553,76], EntityZombie['entity.Zombie.name'/185, l='MpServer', x=-181,50, y=24,00, z=591,50], EntityCreeper['Creeper'/58, l='MpServer', x=-296,50, y=27,00, z=564,50], EntityCreeper['Creeper'/186, l='MpServer', x=-186,50, y=22,00, z=610,50], EntityZombie['Zombie'/64, l='MpServer', x=-287,77, y=44,00, z=494,45], EntityCreeper['Creeper'/65, l='MpServer', x=-280,50, y=44,00, z=510,84], EntityRabbit['Rabbit'/66, l='MpServer', x=-273,49, y=64,00, z=508,53], EntitySquid['Squid'/67, l='MpServer', x=-277,91, y=51,51, z=549,16], EntitySquid['Squid'/68, l='MpServer', x=-273,27, y=55,97, z=565,79], EntityCreeper['Creeper'/72, l='MpServer', x=-263,50, y=28,00, z=496,50], EntityRabbit['Rabbit'/73, l='MpServer', x=-265,90, y=62,00, z=501,47], EntityRabbit['Rabbit'/74, l='MpServer', x=-264,65, y=63,00, z=502,14], EntitySkeleton['Skeleton'/75, l='MpServer', x=-268,21, y=43,00, z=537,51], EntityCreeper['Creeper'/203, l='MpServer', x=-256,50, y=33,00, z=540,50], EntityBat['Bat'/76, l='MpServer', x=-259,54, y=28,29, z=544,79], EntityPlayerSP['Player948'/132, l='MpServer', x=-248,57, y=79,47, z=570,47], EntityCreeper['Creeper'/86, l='MpServer', x=-247,37, y=51,00, z=540,85], EntityBat['Bat'/89, l='MpServer', x=-238,95, y=30,04, z=498,80], EntityBat['Bat'/90, l='MpServer', x=-233,25, y=37,00, z=492,49], EntityZombie['entity.Zombie.name'/92, l='MpServer', x=-227,49, y=40,00, z=507,17], EntityZombie['entity.Zombie.name'/93, l='MpServer', x=-226,50, y=40,00, z=514,50], EntityZombie['entity.Zombie.name'/94, l='MpServer', x=-228,50, y=40,00, z=515,50], EntityRabbit['Rabbit'/95, l='MpServer', x=-228,26, y=70,00, z=515,07], EntityCreeper['Creeper'/99, l='MpServer', x=-222,50, y=18,00, z=497,50], EntityBat['Bat'/100, l='MpServer', x=-213,25, y=23,00, z=518,51], EntityRabbit['Rabbit'/101, l='MpServer', x=-217,30, y=69,00, z=520,49], EntityRabbit['Rabbit'/102, l='MpServer', x=-202,52, y=71,00, z=517,82], EntityRabbit['Rabbit'/103, l='MpServer', x=-199,55, y=74,00, z=528,99], EntityCreeper['Creeper'/104, l='MpServer', x=-193,50, y=18,00, z=544,50], EntityZombie['Zombie'/107, l='MpServer', x=-181,50, y=28,00, z=523,50]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:451)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2779)
at net.minecraft.client.Minecraft.run(Minecraft.java:435)
at net.minecraft.client.main.Main.main(Main.java:118)
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 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.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)

-- System Details --
Details:
Minecraft Version: 1.10.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_101, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 691740144 bytes (659 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 1, tcache: 1, allocated: 12, tallocated: 94
FML: MCP 9.32 Powered by Forge 12.18.1.2095 5 mods loaded, 5 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.19} [Minecraft Coder Pack] (minecraft.jar) 
UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2095.jar) 
UCHIJAAAA	Forge{12.18.1.2095} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2095.jar) 
UCHIJAAAA	universalcache{1.0.0.0} [universal Cache] (bin) 
UCHIJAAAA	JEI{3.7.8.234} [Just Enough Items] (jei_1.10.2-3.7.8.234.jar) 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 372.70' Renderer: 'GeForce GT 755M/PCIe/SSE2'
Launched Version: 1.10.2
LWJGL: 2.9.4
OpenGL: GeForce GT 755M/PCIe/SSE2 GL version 4.5.0 NVIDIA 372.70, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: 
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: 8x Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
[20:34:21] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: #@!@# Game crashed! Crash report saved to: #@!@# D:\MegaDrive\EigenWerk\GitHub\Dodge-Utilities\run\.\crash-reports\crash-2016-10-03_20.34.21-client.txt
[20:34:21] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.
[20:34:21] [server thread/INFO] [FML]: Applying holder lookups
[20:34:21] [server thread/INFO] [FML]: Holder lookups applied
[20:34:21] [Client thread/INFO] [FML]: Server terminated.

 

 

Entity Class:

 

package com.nlxdodge.universalcache.entity;

import com.sun.org.apache.xpath.internal.operations.Bool;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.datafix.DataFixer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import scala.Console;

public class molotovEntity extends EntityThrowable
{

public World currentWorld;
public Entity throwingEntity;
public boolean inUse;

public molotovEntity(World worldIn, Entity thrower) 
{
	super(worldIn);
	currentWorld = worldIn;
	throwingEntity = thrower;
	inUse = false;
}

public molotovEntity(World worldIn) {
	super(worldIn);
}

public molotovEntity(World worldIn, EntityLivingBase shooter) {
	super(worldIn, shooter);
}

public molotovEntity(World worldIn, double x, double y, double z) {
	super(worldIn, x, y, z);
}

public static void func_189662_a(DataFixer df)
    {
        EntityThrowable.func_189661_a(df , "Molotov");
    }

@Override
protected void onImpact(RayTraceResult result) 
{
	if(!inUse)
	{
		inUse = true;
		this.worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
		BlockPos impactPos = result.getBlockPos();
		createFire(impactPos, 3, Minecraft.getMinecraft().theWorld);
	}
	this.setDead();
}

public void createFire(BlockPos pos, int Width, World worldIn)
{		
	for(int i=-Width; i<Width; i++)
	{
		for(int e=-Width; e<Width; e++)
		{
			BlockPos calculated = new BlockPos(pos.getX() + i, pos.getY(), pos.getZ() + e);
			BlockPos offset = new BlockPos(calculated.getX(), calculated.getY() + 1, calculated.getZ());
			if(worldIn.isBlockFullCube(calculated) && worldIn.isAirBlock(offset)&& worldIn.canBlockBePlaced(Blocks.FIRE, offset, true, EnumFacing.NORTH, null, null))
			{
				worldIn.setBlockState(offset, Blocks.FIRE.getDefaultState());
			}
		}
	}
}	
}

 

 

Molotov Class:

 

package com.nlxdodge.universalcache.items;

import com.nlxdodge.universalcache.entity.molotovEntity;
import com.nlxdodge.universalcache.proxy.commonProxy;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;

public class molotov extends Item
{
public molotov(String unlocalizedName)
{
	super();
	this.setMaxStackSize(16);
	this.setCreativeTab(commonProxy.UniversalCache);
	this.setRegistryName(unlocalizedName);
	this.setUnlocalizedName(this.getRegistryName().toString());
}

public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
    {
        if (!playerIn.capabilities.isCreativeMode)
        {
            --itemStackIn.stackSize;
        }

        //TODO SOUND IMPLEMENT THROW & IGNITE
        if (!worldIn.isRemote)
        {
        molotovEntity MolotovEntity = new molotovEntity(worldIn, playerIn);
        MolotovEntity.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
        worldIn.spawnEntityInWorld(MolotovEntity);
        }
        return new ActionResult(EnumActionResult.SUCCESS, itemStackIn);
    }
}

 

 

If you have any good tutorials, I would be happy to follow and learn from them.

Posted

UCHIJAAAA	JEI{3.7.8.234} [Just Enough Items] (jei_1.10.2-3.7.8.234.jar) 

 

Is Just Enough Items a core mod? Forge often doesn't play nice with other core mods.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

UCHIJAAAA	JEI{3.7.8.234} [Just Enough Items] (jei_1.10.2-3.7.8.234.jar) 

 

Is Just Enough Items a core mod? Forge often doesn't play nice with other core mods.

 

JEI is explicitly not a coremod.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

I fixed my code I saw that the constructor I made was not used. And the worldIn was sometimes null. Thanks.

onImpact

will fire on the server (not sure if it fires on the client as well, but it definitely fires on the server). You are using

Minecraft.getMinecraft

inside there. This will not work.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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