Jump to content

OOB Exception when adding entity to world.


AkitaAttribute

Recommended Posts

[Exception ticking world] - [Caused by: java.lang.ArrayIndexOutOfBoundsException: -1]

 

Really hoping someone has seen this before.  I'm probably doing something dumb (doing a lot dumb) that I just don't know is wrong when it comes to "world" stuff.

 

My code: Main SRC Dir

 

Subscribe Event where I'm replacing entities with custom ones: Line 247

 

Where I'm actually adding the entity to the world: Line 52

 

I know this is working because I've seen it in my world.  After one working instance, the world hangs, and eventually crashes with the below log dump.

 

Please don't harp on poor coding style (the threading for the world I would like to know if that's the issue), as this is a work in progress.

 

Spoiler
14:23:32.420
game
[14:23:32] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Tried to add glowing. [GlowingEntities][6]
14:23:32.420
game
[14:23:32] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Attempted to add glowing. [Item][ItemEntity['Raw Beef'/1509, l='ServerLevel[maybe]', x=-81.28, y=75.00, z=-155.20]][Glowing][true]
14:23:32.420
game
[14:23:32] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Key not found, manually swapping... [1 leather]->[1 leather]
14:23:32.421
game
[14:23:32] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Key not found, manually swapping... [3 beef]->[3 beef]
14:23:43.012
game
[14:23:43] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Attempted to remove glowing. [Item][3 beef][Glowing][false]
14:23:54.860
game
[14:23:54] [Server thread/INFO] [ma.rp.RpgElements/]: [BTK7] picked up [minecraft:beef]
14:24:24.559
game
[14:24:24] [Server thread/INFO] [ma.rp.RpgElements/]: [BTK7] picked up [minecraft:dirt]
14:24:26.988
game
[14:24:26] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Tried to add glowing. [GlowingEntities][6]
14:24:27.688
game
[14:24:27] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Tried to add glowing. [GlowingEntities][6]
14:24:27.690
game
[14:24:27] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Tried to add glowing. [GlowingEntities][7]
14:24:27.691
game
[14:24:27] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Attempted to add glowing. [Item][ItemEntity['Raw Beef'/1706, l='ServerLevel[maybe]', x=-85.62, y=72.23, z=-157.60]][Glowing][true]
14:24:27.692
game
[14:24:27] [Server thread/INFO] [minecraft/NewChatGui]: [CHAT] Key not found, manually swapping... [3 beef]->[3 beef]
14:24:30.512
game
[14:24:30] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 05e7ebbe-83fa-43e2-9ff5-562bfb690496
14:24:30.515
game
[14:24:30] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
14:24:30.515
game
net.minecraft.crash.ReportedException: Exception ticking world
14:24:30.516
game
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:855) ~[?:?] {re:classloading,pl:accesstransformer:B}
14:24:30.516
game
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?] {re:classloading,pl:accesstransformer:B}
14:24:30.516
game
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:78) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
14:24:30.516
game
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) [?:?] {re:classloading,pl:accesstransformer:B}
14:24:30.516
game
at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) [?:?] {re:classloading,pl:accesstransformer:B}
14:24:30.516
game
at net.minecraft.server.MinecraftServer$$Lambda$5101/1446321154.run(Unknown Source) [?:?] {}
14:24:30.516
game
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51] {}
14:24:30.516
game
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
14:24:30.516
game
at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap.fixPointers(Int2ObjectLinkedOpenHashMap.java:1038) ~[fastutil-8.2.1.jar:?] {re:classloading}
14:24:30.516
game
at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap$MapIterator.remove(Int2ObjectLinkedOpenHashMap.java:1269) ~[fastutil-8.2.1.jar:?] {}
14:24:30.516
game
at it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap$EntryIterator.remove(Int2ObjectLinkedOpenHashMap.java:1309) ~[fastutil-8.2.1.jar:?] {re:classloading}
14:24:30.516
game
at net.minecraft.world.server.ServerWorld.func_72835_b(ServerWorld.java:411) ~[?:?] {re:classloading}
14:24:30.516
game
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:851) ~[?:?] {re:classloading,pl:accesstransformer:B}
14:24:30.516
game
... 6 more
14:24:31.315
game
AL lib: (EE) alc_cleanup: 1 device not closed
14:24:32.078
monitor
Process Monitor
Process crashed with exit code -1

 

 

Link to comment
Share on other sites

https://github.com/AkitaAttribute/rpg-elements/blob/working_but_crashing/src/main/java/magicsixteen/rpgelements/RpgElements.java#L252
item.isEmpty()

https://github.com/AkitaAttribute/rpg-elements/blob/working_but_crashing/src/main/java/magicsixteen/rpgelements/events/item/GlowingItemEntity.java#L15
Why are you storing an item entity inside your custom item entity? Just use the details of that entity to create yours using an existing constructor. You're trying to replace the entity, not wrap it.

https://github.com/AkitaAttribute/rpg-elements/blob/working_but_crashing/src/main/java/magicsixteen/rpgelements/RpgElements.java#L255
Not sure this check is needed.

https://github.com/AkitaAttribute/rpg-elements/blob/working_but_crashing/src/main/java/magicsixteen/rpgelements/events/item/GlowingItemEntity.java#L62-L108
This is a disgusting hack. One that I'm not even sure works.

https://github.com/AkitaAttribute/rpg-elements/blob/working_but_crashing/src/main/java/magicsixteen/rpgelements/util/GlowHelper.java#L61
This check almost certainly won't pass. Existing item entities will never appear in the glowing list.
Actually wait a minute. This entire class is useless.

Jesus fucking christ.

Just use the GlowingItemEntity to store a number of ticks and then in its on-tick, subtract one, and if it's less than 0, set glowing to false. You don't need a globally accessible list of all glowing item entities and when they should stop glowing. Nothing cares except the entity itself, so just store that data in the entity.

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.

Link to comment
Share on other sites

https://gist.github.com/AkitaAttribute/52e1a06ee0c54256f50d615884aadf6f

 

New issues.

 

So @Draco18s, LivingDropsEvent happens first.  Which means that I can't run a check on the source of the dropped item to determine duration of the glow, and add that duration to the custom entity.

 

The updated branch takes most of your comments into consideration.  I tried to do a tracker for the brief moment I assume exists between LivingDrops and JoinedWorld events to pass the duration between them.  This doesn't work, and I'm getting a crash that I thought I had resolved by putting the world.addEntity onto another thread.

 

I'd love to hear input on what you think is the best solution for dealing with the duration between these two events.  And more importantly, why I'm getting the ConcurrentModificationException

Link to comment
Share on other sites

I think you can modify the drops array during the LivingDropsEvent, though (well, collection, but it's not read-only so I don't see why you couldn't remove the originals and add yours).

  • Like 1

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.

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I cant craft any of the epic fight mod weapons. I try using the recipes in the crafting table but nothing is working. and when i click on the epic fight weapon in jei there is no recipe at all.
    • Oklahoma Nation Cowboys at Youngstown Country PenguinsYoungstown, Ohio; Wednesday, 7 p.m. EDTBOTTOM LINE: The Youngstown Region Penguins facial area the Oklahoma Country Cowboys within the Countrywide Invitation Penguins include absent 15-5 versus Horizon League rivals, with a 9-4 history within non-meeting participate in. Youngstown Region is 1-2 inside online games resolved as a result of considerably less than 4 facts. The Cowboys are 8-10 in just Massive 12 engage in. Oklahoma Region ranks 9th within just the Large 12 taking pictures 31.1% towards 3-stage wide PERFORMERS: Dwayne Cohill is averaging 17.8 details and 4.8 helps for the Penguins. Adrian Nelson is averaging 17.1 info higher than the remaining 10 game titles for Youngstown Thompson is averaging 11.7 details for the Cowboys. Caleb Asberry is averaging 13.1 facts about the very last 10 video games for Oklahoma last 10 Video games: Penguins: 7-3 Zeke Zaragoza Jersey, averaging 79.7 info, 33.4 rebounds, 14.8 helps, 5.3 steals and 2.7 blocks for each video game despite the fact that capturing 48.1% versus the marketplace. Their rivals incorporate averaged 72.4 details for every : 4-6, averaging 66.4 specifics, 33.1 rebounds, 11.1 helps Jake Henry Jersey, 4.9 steals and 3.6 blocks for each sport even though taking pictures 41.3% towards the sector. Their rivals consist of averaged 72.0 info. The made this tale making use of technological innovation delivered by means of Information and facts Skrive and info against Sportradar. Cowboys Shop
    • Oklahoma Nation Cowboys at Youngstown Country PenguinsYoungstown, Ohio; Wednesday, 7 p.m. EDTBOTTOM LINE: The Youngstown Region Penguins facial area the Oklahoma Country Cowboys within the Countrywide Invitation Penguins include absent 15-5 versus Horizon League rivals, with a 9-4 history within non-meeting participate in. Youngstown Region is 1-2 inside online games resolved as a result of considerably less than 4 facts. The Cowboys are 8-10 in just Massive 12 engage in. Oklahoma Region ranks 9th within just the Large 12 taking pictures 31.1% towards 3-stage wide PERFORMERS: Dwayne Cohill is averaging 17.8 details and 4.8 helps for the Penguins. Adrian Nelson is averaging 17.1 info higher than the remaining 10 game titles for Youngstown Thompson is averaging 11.7 details for the Cowboys. Caleb Asberry is averaging 13.1 facts about the very last 10 video games for Oklahoma last 10 Video games: Penguins: 7-3 Zeke Zaragoza Jersey, averaging 79.7 info, 33.4 rebounds, 14.8 helps, 5.3 steals and 2.7 blocks for each video game despite the fact that capturing 48.1% versus the marketplace. Their rivals incorporate averaged 72.4 details for every : 4-6, averaging 66.4 specifics, 33.1 rebounds, 11.1 helps Jake Henry Jersey, 4.9 steals and 3.6 blocks for each sport even though taking pictures 41.3% towards the sector. Their rivals consist of averaged 72.0 info. The made this tale making use of technological innovation delivered by means of Information and facts Skrive and info against Sportradar. Cowboys Shop
    • DUTA89 agen slot online terbaik dan sering memberikan kemenangan kepada setiap member yang deposit diatas 50k dengan tidak klaim bonus sepeser pun.   Link daftar : https://heylink.me/DUTA89OFFICIAL/  
    • Hello All! Started a MC Eternal 1.6.2.2 server on Shockbyte hosting. The only other mod I added was betterfarmland v0.0.8BETA. Server is 16GB and Shockbyte wont tell me how many CPU cores i have.  We are having problems now when players log in it seems to crash the server. At other times it seems fine and we can have 3 people playing for hours at a time. Usually always when it does crash it is when someone logs in. Crash Reports Below. To the person who can post the fix I will reward $100 via Paypal.   ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 2024-09-19 21:04:58 UTC Description: Exception in server tick loop java.lang.StackOverflowError     at net.minecraft.advancements.PlayerAdvancements.hasCompletedChildrenOrSelf(PlayerAdvancements.java:451)     at net.minecraft.advancements.PlayerAdvancements.shouldBeVisible(PlayerAdvancements.java:419)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:385)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.P  
  • Topics

×
×
  • Create New...

Important Information

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