Jump to content

Recommended Posts

Posted

Hi There! when I put the specific item into the slot(Custom Container) I want to play a sound that loops until I get this item out of the slot, here is the crashing report:

 

---- Minecraft Crash Report ----

// Don't be sad, have a hug! <3

 

Time: 06/04/15 19:06

Description: Unexpected error

 

java.util.ConcurrentModificationException

at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:886)

at java.util.ArrayList$Itr.next(ArrayList.java:836)

at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:220)

at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:224)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:2093)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1028)

at net.minecraft.client.Minecraft.run(Minecraft.java:951)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:483)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78)

at GradleStart.main(GradleStart.java:45)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:886)

at java.util.ArrayList$Itr.next(ArrayList.java:836)

at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:220)

at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:224)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Alanzote'/378, l='MpServer', x=-254,05, y=95,62, z=271,53]]

Chunk stats: MultiplayerChunkCache: 625, 625

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (-256,64,256), Chunk: (at 0,4,0 in -16,16; contains blocks -256,0,256 to -241,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

Level time: 130678 game time, 43955 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: 146 total; [EntityCreeper['Creeper'/256, l='MpServer', x=-196,28, y=97,00, z=266,48], EntitySlime['Slime'/257, l='MpServer', x=-191,01, y=27,00, z=259,31], EntityZombie['Zombie'/258, l='MpServer', x=-176,59, y=21,00, z=259,94], EntitySkeleton['Skeleton'/259, l='MpServer', x=-188,47, y=74,00, z=284,94], EntityPig['Pig'/260, l='MpServer', x=-191,69, y=80,00, z=284,50], EntityPig['Pig'/261, l='MpServer', x=-182,69, y=95,00, z=278,47], EntityPig['Pig'/262, l='MpServer', x=-177,72, y=86,00, z=293,84], EntityPig['Pig'/263, l='MpServer', x=-178,03, y=90,00, z=288,50], EntitySpider['Spider'/264, l='MpServer', x=-184,97, y=69,00, z=305,72], EntitySheep['Sheep'/265, l='MpServer', x=-185,53, y=73,00, z=330,66], EntityPig['Pig'/266, l='MpServer', x=-191,94, y=70,00, z=331,13], EntityPig['Pig'/267, l='MpServer', x=-185,69, y=90,00, z=335,53], EntityPig['Pig'/268, l='MpServer', x=-192,53, y=74,00, z=341,78], EntityCreeper['Creeper'/274, l='MpServer', x=-172,78, y=25,32, z=221,44], EntityCreeper['Creeper'/277, l='MpServer', x=-174,50, y=83,00, z=253,50], EntitySlime['Slime'/284, l='MpServer', x=-172,17, y=32,78, z=275,69], EntityPig['Pig'/285, l='MpServer', x=-172,03, y=89,00, z=275,50], EntitySheep['Sheep'/47, l='MpServer', x=-327,94, y=71,00, z=253,03], EntitySheep['Sheep'/49, l='MpServer', x=-326,22, y=71,00, z=254,94], EntitySkeleton['Skeleton'/50, l='MpServer', x=-318,50, y=69,00, z=265,13], EntitySheep['Sheep'/52, l='MpServer', x=-329,44, y=72,00, z=335,81], EntitySheep['Sheep'/53, l='MpServer', x=-329,91, y=71,00, z=344,53], EntityCreeper['Creeper'/61, l='MpServer', x=-307,94, y=39,00, z=208,47], EntitySheep['Sheep'/62, l='MpServer', x=-309,63, y=64,00, z=247,84], EntitySheep['Sheep'/63, l='MpServer', x=-309,03, y=64,00, z=258,78], EntitySheep['Sheep'/64, l='MpServer', x=-306,72, y=64,00, z=266,72], EntitySheep['Sheep'/65, l='MpServer', x=-307,75, y=67,00, z=273,84], EntityCreeper['Creeper'/66, l='MpServer', x=-306,69, y=67,00, z=284,09], EntitySpider['Spider'/67, l='MpServer', x=-305,50, y=67,00, z=278,84], EntitySheep['Sheep'/68, l='MpServer', x=-315,50, y=68,00, z=290,50], EntitySheep['Sheep'/69, l='MpServer', x=-314,47, y=68,00, z=292,47], EntitySheep['Sheep'/70, l='MpServer', x=-317,25, y=68,00, z=297,41], EntitySpider['Spider'/71, l='MpServer', x=-310,72, y=68,00, z=291,09], EntitySheep['Sheep'/72, l='MpServer', x=-309,09, y=68,00, z=312,09], EntityCreeper['Creeper'/73, l='MpServer', x=-305,50, y=68,00, z=311,50], EntitySheep['Sheep'/74, l='MpServer', x=-318,19, y=70,00, z=328,22], EntitySheep['Sheep'/75, l='MpServer', x=-316,25, y=72,00, z=333,41], EntityZombie['Zombie'/84, l='MpServer', x=-294,59, y=45,19, z=197,09], EntityBat['Bat'/85, l='MpServer', x=-295,81, y=45,78, z=193,42], EntityZombie['Zombie'/86, l='MpServer', x=-293,25, y=73,00, z=236,53], EntitySheep['Sheep'/87, l='MpServer', x=-300,44, y=64,00, z=254,34], EntitySheep['Sheep'/88, l='MpServer', x=-302,53, y=63,00, z=257,69], EntitySheep['Sheep'/89, l='MpServer', x=-300,03, y=63,00, z=256,03], EntityPig['Pig'/90, l='MpServer', x=-304,19, y=64,00, z=259,13], EntityPig['Pig'/91, l='MpServer', x=-300,25, y=67,00, z=274,50], EntitySheep['Sheep'/92, l='MpServer', x=-299,53, y=69,00, z=280,78], EntitySkeleton['Skeleton'/93, l='MpServer', x=-294,13, y=63,00, z=297,63], EntitySheep['Sheep'/94, l='MpServer', x=-294,50, y=71,00, z=316,34], EntitySpider['Spider'/95, l='MpServer', x=-302,34, y=63,00, z=333,63], EntityCreeper['Creeper'/96, l='MpServer', x=-303,50, y=63,00, z=338,50], EntityWitch['Witch'/97, l='MpServer', x=-292,50, y=64,00, z=343,50], EntitySheep['Sheep'/104, l='MpServer', x=-289,19, y=87,00, z=213,09], EntitySheep['Sheep'/105, l='MpServer', x=-287,53, y=81,00, z=222,53], EntitySheep['Sheep'/106, l='MpServer', x=-283,53, y=76,00, z=234,38], EntitySheep['Sheep'/107, l='MpServer', x=-274,47, y=80,00, z=234,41], EntitySheep['Sheep'/108, l='MpServer', x=-281,72, y=63,00, z=308,31], EntitySheep['Sheep'/109, l='MpServer', x=-283,84, y=70,00, z=313,91], EntitySpider['Spider'/110, l='MpServer', x=-277,63, y=64,00, z=314,03], EntityPig['Pig'/111, l='MpServer', x=-280,16, y=64,00, z=323,88], EntitySheep['Sheep'/112, l='MpServer', x=-283,50, y=64,00, z=334,50], EntitySheep['Sheep'/113, l='MpServer', x=-280,53, y=64,00, z=326,88], EntityPig['Pig'/114, l='MpServer', x=-277,50, y=67,00, z=338,75], EntitySheep['Sheep'/115, l='MpServer', x=-284,25, y=65,00, z=346,75], EntitySheep['Sheep'/116, l='MpServer', x=-285,53, y=65,00, z=345,44], EntityPig['Pig'/117, l='MpServer', x=-284,91, y=65,00, z=344,16], EntitySheep['Sheep'/118, l='MpServer', x=-281,69, y=65,00, z=338,47], EntityPig['Pig'/119, l='MpServer', x=-287,47, y=65,00, z=352,66], EntitySpider['Spider'/126, l='MpServer', x=-254,50, y=40,00, z=193,59], EntitySkeleton['Skeleton'/127, l='MpServer', x=-257,94, y=39,00, z=200,59], EntitySkeleton['Skeleton'/128, l='MpServer', x=-251,47, y=31,00, z=206,31], EntityBat['Bat'/129, l='MpServer', x=-258,90, y=31,03, z=207,99], EntitySkeleton['Skeleton'/130, l='MpServer', x=-270,44, y=82,00, z=191,84], EntitySkeleton['Skeleton'/131, l='MpServer', x=-259,25, y=33,00, z=221,53], EntityZombie['Zombie'/132, l='MpServer', x=-260,06, y=82,00, z=229,22], EntitySquid['Squid'/133, l='MpServer', x=-258,44, y=61,09, z=273,59], EntitySquid['Squid'/134, l='MpServer', x=-261,03, y=61,00, z=267,81], EntitySquid['Squid'/135, l='MpServer', x=-270,50, y=61,38, z=269,50], EntitySquid['Squid'/136, l='MpServer', x=-261,41, y=62,38, z=290,88], EntityClientPlayerMP['Alanzote'/378, l='MpServer', x=-254,05, y=95,62, z=271,53], EntitySquid['Squid'/137, l='MpServer', x=-266,34, y=61,00, z=285,91], EntitySquid['Squid'/138, l='MpServer', x=-263,44, y=61,00, z=287,50], EntitySquid['Squid'/139, l='MpServer', x=-256,50, y=61,00, z=277,09], EntitySquid['Squid'/140, l='MpServer', x=-256,28, y=61,34, z=285,50], EntitySquid['Squid'/141, l='MpServer', x=-260,16, y=62,00, z=293,47], EntitySheep['Sheep'/142, l='MpServer', x=-258,22, y=77,00, z=326,50], EntityZombie['Zombie'/143, l='MpServer', x=-265,88, y=73,00, z=324,50], EntitySheep['Sheep'/144, l='MpServer', x=-265,47, y=70,00, z=345,03], EntitySheep['Sheep'/145, l='MpServer', x=-266,59, y=69,00, z=343,53], EntitySheep['Sheep'/146, l='MpServer', x=-264,50, y=71,00, z=349,50], EntitySheep['Sheep'/147, l='MpServer', x=-267,59, y=74,00, z=337,66], EntitySkeleton['Skeleton'/160, l='MpServer', x=-255,31, y=40,00, z=197,28], EntitySkeleton['Skeleton'/161, l='MpServer', x=-251,59, y=31,00, z=211,03], EntityMinecartChest['entity.MinecartChest.name'/162, l='MpServer', x=-242,50, y=25,50, z=259,50], EntityChicken['Chicken'/163, l='MpServer', x=-249,38, y=82,00, z=260,66], EntitySquid['Squid'/164, l='MpServer', x=-245,16, y=61,38, z=274,09], EntitySheep['Sheep'/165, l='MpServer', x=-247,56, y=69,00, z=298,16], EntityChicken['Chicken'/175, l='MpServer', x=-232,47, y=84,00, z=221,38], EntityChicken['Chicken'/176, l='MpServer', x=-229,47, y=85,00, z=233,47], EntitySpider['Spider'/177, l='MpServer', x=-235,34, y=86,00, z=258,34], EntitySkeleton['Skeleton'/178, l='MpServer', x=-231,30, y=14,73, z=286,30], EntityMinecartChest['entity.MinecartChest.name'/179, l='MpServer', x=-233,09, y=20,34, z=280,16], EntityBat['Bat'/180, l='MpServer', x=-231,25, y=30,10, z=282,25], EntityBat['Bat'/181, l='MpServer', x=-236,55, y=16,33, z=299,25], EntitySquid['Squid'/182, l='MpServer', x=-235,50, y=61,34, z=282,50], EntityCreeper['Creeper'/183, l='MpServer', x=-224,31, y=29,00, z=293,94], EntityBat['Bat'/184, l='MpServer', x=-232,60, y=27,30, z=300,61], EntityZombie['Zombie'/185, l='MpServer', x=-222,72, y=64,00, z=302,22], EntitySheep['Sheep'/186, l='MpServer', x=-226,53, y=63,00, z=299,03], EntityCreeper['Creeper'/187, l='MpServer', x=-235,06, y=63,00, z=298,47], EntityCreeper['Creeper'/188, l='MpServer', x=-233,50, y=16,00, z=307,03], EntityBat['Bat'/189, l='MpServer', x=-227,81, y=20,27, z=313,71], EntitySheep['Sheep'/190, l='MpServer', x=-232,78, y=75,00, z=316,53], EntityEnderman['Enderman'/191, l='MpServer', x=-231,69, y=68,15, z=315,09], EntityEnderman['Enderman'/192, l='MpServer', x=-228,00, y=64,00, z=309,56], EntityBat['Bat'/200, l='MpServer', x=-214,50, y=20,84, z=245,54], EntityCreeper['Creeper'/201, l='MpServer', x=-210,16, y=82,00, z=226,66], EntityMinecartChest['entity.MinecartChest.name'/202, l='MpServer', x=-218,50, y=30,50, z=262,50], EntityZombie['Zombie'/203, l='MpServer', x=-210,03, y=26,00, z=257,53], EntityChicken['Chicken'/204, l='MpServer', x=-213,47, y=91,00, z=256,41], EntityZombie['Zombie'/205, l='MpServer', x=-209,69, y=41,13, z=276,34], EntitySheep['Sheep'/206, l='MpServer', x=-208,50, y=72,00, z=277,50], EntitySheep['Sheep'/207, l='MpServer', x=-214,09, y=64,00, z=294,88], EntitySheep['Sheep'/208, l='MpServer', x=-217,94, y=66,00, z=313,97], EntityZombie['Zombie'/209, l='MpServer', x=-211,50, y=25,00, z=345,50], EntityBat['Bat'/219, l='MpServer', x=-192,50, y=23,10, z=207,44], EntityBat['Bat'/221, l='MpServer', x=-200,38, y=15,10, z=260,75], EntityZombie['Zombie'/222, l='MpServer', x=-207,03, y=25,00, z=258,97], EntityPig['Pig'/223, l='MpServer', x=-198,56, y=93,00, z=269,50], EntityPig['Pig'/224, l='MpServer', x=-198,13, y=102,00, z=264,63], EntitySheep['Sheep'/225, l='MpServer', x=-200,19, y=72,00, z=278,53], EntitySheep['Sheep'/226, l='MpServer', x=-195,47, y=72,00, z=284,47], EntitySheep['Sheep'/227, l='MpServer', x=-195,47, y=72,00, z=282,53], EntityPig['Pig'/228, l='MpServer', x=-201,94, y=70,00, z=280,69], EntitySheep['Sheep'/229, l='MpServer', x=-202,34, y=72,00, z=276,50], EntitySheep['Sheep'/230, l='MpServer', x=-192,59, y=72,00, z=287,38], EntitySheep['Sheep'/231, l='MpServer', x=-192,53, y=72,00, z=285,69], EntitySheep['Sheep'/232, l='MpServer', x=-200,53, y=70,00, z=284,34], EntitySheep['Sheep'/233, l='MpServer', x=-196,56, y=69,00, z=298,81], EntityPig['Pig'/234, l='MpServer', x=-193,16, y=67,00, z=316,41], EntitySheep['Sheep'/235, l='MpServer', x=-196,09, y=68,00, z=304,81], EntityCreeper['Creeper'/236, l='MpServer', x=-202,50, y=14,00, z=324,50], EntitySheep['Sheep'/237, l='MpServer', x=-195,22, y=68,00, z=329,50], EntitySheep['Sheep'/238, l='MpServer', x=-206,34, y=67,00, z=326,69], EntityBat['Bat'/253, l='MpServer', x=-187,75, y=40,10, z=208,56], EntityMinecartChest['entity.MinecartChest.name'/254, l='MpServer', x=-187,50, y=29,50, z=233,50], EntitySkeleton['Skeleton'/255, l='MpServer', x=-188,53, y=88,00, z=239,16]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555)

at net.minecraft.client.Minecraft.run(Minecraft.java:980)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:483)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78)

at GradleStart.main(GradleStart.java:45)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8.1 (amd64) version 6.3

Java Version: 1.8.0_11, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 731518560 bytes (697 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94

FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

gpa_startrekmod{0.1.5} [star Trek Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Launched Version: 1.7.10

LWJGL: 2.9.1

OpenGL: AMD Radeon HD 6800 Series GL version 4.4.12874 Compatibility Profile Context 14.100.0.0, ATI Technologies Inc.

GL Caps: Using GL 1.3 multitexturing.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Anisotropic filtering is supported and maximum anisotropy is 16.

Shaders are available because OpenGL 2.1 is supported.

 

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)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Anisotropic Filtering: Off (1)

 

Any Indeas? I think the sound is playing A LOT OF TIMES!!! Even using isSoundPlaying, here is the code:

 

MySoundClass:

 

package com.gpa.startrekmod.ISound;

 

import ibxm.Player;

 

import com.gpa.startrekmod.tileentities.TileEntityReplicatorBlock;

 

import cpw.gpa.startrekmod.help.STReferencies;

import net.minecraft.client.audio.ISound;

import net.minecraft.client.audio.MovingSound;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.MathHelper;

import net.minecraft.util.ResourceLocation;

 

public class TOS_WorkSound extends MovingSound{

 

public TOS_WorkSound(TileEntity entity) {

super(new ResourceLocation(STReferencies.MODID + ":tos_computer_compute"));

this.repeat = true;

this.field_147666_i = ISound.AttenuationType.NONE;

this.xPosF = entity.xCoord;

this.yPosF = entity.yCoord;

this.zPosF = entity.zCoord;

}

 

@Override

public void update() {

 

}

}

 

 

My Check for Item and the functions to play and stop the sound:

 

public void updateEntity(){

 

if(slots[0] != null)

{

if(slots[0].getItem().equals(STModItems.EnergyCell))

{

if(slots[0].getItemDamage() >= slots[0].getMaxDamage())

{}

else

{

if(power >= maxPower){}

else

{takePower(); WorkSound();}

if(slots[0] == null){sWorkSound();}

}

}

}

}

 

 

private void WorkSound(){

if(Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(new TOS_WorkSound(this))){}

else

{Minecraft.getMinecraft().getSoundHandler().playSound(new TOS_WorkSound(this));}

}

private void sWorkSound(){

Minecraft.getMinecraft().getSoundHandler().stopSound(new TOS_WorkSound(this));

}

 

Any Ideas why is it playing A LOT OF TIMES?

Thanks!

Posted

Hi

 

THe ConcurrentModification exception means that you are updating that array in both the server and the client thread, which is a very bad thing.

 

In other words, your updateEntity method is running on the server; it shouldn't - add a check for this.worldObj.isRemote() before adding the sound.

 

Also, this line is supposed to check if the sound is playing

      if(Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(new TOS_WorkSound(this))){}

but it won't work as you expect because you're creating a new sound instance each time, which of course wasn't playing before, so the check always returns true.

You need to keep your instance of the playing sound and check if it has finished.

 

-TGG

Posted

I added this.worldObj.isRemote() but i got an error in code(needs to cast)

 

if(this.worldObj.isRemote())

 

Removed () from this.worldObj.isRemote() and worked

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.

Announcements



×
×
  • Create New...

Important Information

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