Useful Backpacks

Useful Backpacks

20M Downloads

[1.21.1] Crash on fabric with trinkets

HyCraftHD opened this issue · 2 comments

commented

Bug description and reproduction steps

Crash when trinkets api is installed and an item is picked up while no backpack is in the trinkets slot

Log files and Screenshots

---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 2023-06-15 20:29:07
Description: Ticking player

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	at java.base/java.util.Objects.checkIndex(Objects.java:359)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	at info.u_team.useful_backpacks.integration.trinkets.impl.TrinketsBackpackSlotModUtil.lambda$find$1(TrinketsBackpackSlotModUtil.java:15)
	at java.base/java.util.Optional.map(Optional.java:260)
	at info.u_team.useful_backpacks.integration.trinkets.impl.TrinketsBackpackSlotModUtil.find(TrinketsBackpackSlotModUtil.java:15)
	at info.u_team.useful_backpacks.integration.slot_mod.util.BackpackSlotModUtil.findBackpack(BackpackSlotModUtil.java:14)
	at info.u_team.useful_backpacks.integration.slot_mod.init.SlotModIntegrationAddBackpackIntegration.lambda$register$0(SlotModIntegrationAddBackpackIntegration.java:13)
	at info.u_team.useful_backpacks.event.ItemPickupCommonEventHandler.insertInBackpacks(ItemPickupCommonEventHandler.java:50)
	at net.minecraft.class_1542.handler$zlm000$usefulbackpacks$drop(class_1542.java:569)
	at net.minecraft.class_1542.method_5694(class_1542.java)
	at net.minecraft.class_1657.method_7341(class_1657.java:627)
	at net.minecraft.class_1657.method_6007(class_1657.java:600)
	at net.minecraft.class_1309.method_5773(class_1309.java:2419)
	at net.minecraft.class_1657.method_5773(class_1657.java:283)
	at net.minecraft.class_3222.method_14226(class_3222.java:510)
	at net.minecraft.class_3244.method_18784(class_3244.java:269)
	at net.minecraft.class_2535.method_10754(class_2535.java:259)
	at net.minecraft.class_3242.method_14357(class_3242.java:172)
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:908)
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:824)
	at net.minecraft.class_1132.method_3748(class_1132.java:105)
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:671)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265)
	at java.base/java.lang.Thread.run(Thread.java:833)


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

-- Head --
Thread: Server thread
Stacktrace:
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	at java.base/java.util.Objects.checkIndex(Objects.java:359)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	at info.u_team.useful_backpacks.integration.trinkets.impl.TrinketsBackpackSlotModUtil.lambda$find$1(TrinketsBackpackSlotModUtil.java:15)
	at java.base/java.util.Optional.map(Optional.java:260)
	at info.u_team.useful_backpacks.integration.trinkets.impl.TrinketsBackpackSlotModUtil.find(TrinketsBackpackSlotModUtil.java:15)
	at info.u_team.useful_backpacks.integration.slot_mod.util.BackpackSlotModUtil.findBackpack(BackpackSlotModUtil.java:14)
	at info.u_team.useful_backpacks.integration.slot_mod.init.SlotModIntegrationAddBackpackIntegration.lambda$register$0(SlotModIntegrationAddBackpackIntegration.java:13)
	at info.u_team.useful_backpacks.event.ItemPickupCommonEventHandler.insertInBackpacks(ItemPickupCommonEventHandler.java:50)
	at net.minecraft.class_1542.handler$zlm000$usefulbackpacks$drop(class_1542.java:569)
	at net.minecraft.class_1542.method_5694(class_1542.java)
	at net.minecraft.class_1657.method_7341(class_1657.java:627)
	at net.minecraft.class_1657.method_6007(class_1657.java:600)
	at net.minecraft.class_1309.method_5773(class_1309.java:2419)
	at net.minecraft.class_1657.method_5773(class_1657.java:283)

-- Player being ticked --
Details:
	Entity Type: minecraft:player (net.minecraft.class_3222)
	Entity ID: 153
	Entity Name: HyCraftHD
	Entity's Exact location: 5.15, 123.00, 27.12
	Entity's Block location: World: (5,123,27), Section: (at 5,11,11 in 0,7,1; chunk contains blocks 0,-64,16 to 15,319,31), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
	Entity's Momentum: 0.00, -0.08, 0.00
	Entity's Passengers: []
	Entity's Vehicle: null
Stacktrace:
	at net.minecraft.class_3222.method_14226(class_3222.java:510)
	at net.minecraft.class_3244.method_18784(class_3244.java:269)
	at net.minecraft.class_2535.method_10754(class_2535.java:259)
	at net.minecraft.class_3242.method_14357(class_3242.java:172)
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:908)
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:824)
	at net.minecraft.class_1132.method_3748(class_1132.java:105)
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:671)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265)
	at java.base/java.lang.Thread.run(Thread.java:833)

-- System Details --
Details:
	Minecraft Version: 1.20.1
	Minecraft Version ID: 1.20.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 17.0.3, Microsoft
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
	Memory: 730043120 bytes (696 MiB) / 2294284288 bytes (2188 MiB) up to 8589934592 bytes (8192 MiB)
	CPUs: 24
	Processor Vendor: GenuineIntel
	Processor Name: 12th Gen Intel(R) Core(TM) i9-12900K
	Identifier: Intel64 Family 6 Model 151 Stepping 2
	Microarchitecture: Alder Lake
	Frequency (GHz): 3.19
	Number of physical packages: 1
	Number of physical CPUs: 16
	Number of logical CPUs: 24
	Graphics card #0 name: NVIDIA GeForce RTX 3070 Ti
	Graphics card #0 vendor: NVIDIA (0x10de)
	Graphics card #0 VRAM (MB): 4095.00
	Graphics card #0 deviceId: 0x2482
	Graphics card #0 versionInfo: DriverVersion=31.0.15.3203
	Graphics card #1 name: Intel(R) UHD Graphics 770
	Graphics card #1 vendor: Intel Corporation (0x8086)
	Graphics card #1 VRAM (MB): 1024.00
	Graphics card #1 deviceId: 0x4680
	Graphics card #1 versionInfo: DriverVersion=31.0.101.3959
	Memory slot #0 capacity (MB): 16384.00
	Memory slot #0 clockSpeed (GHz): 3.20
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MB): 16384.00
	Memory slot #1 clockSpeed (GHz): 3.20
	Memory slot #1 type: DDR4
	Virtual memory max (MB): 39215.87
	Virtual memory used (MB): 19797.23
	Swap memory total (MB): 6656.00
	Swap memory used (MB): 0.00
	JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx8192m -Xms256m
	Fabric Mods: 
		fabric-api: Fabric API 0.83.1+1.20.1
			fabric-api-base: Fabric API Base 0.4.29+b04edc7a77
			fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.6.34+4d8536c977
			fabric-biome-api-v1: Fabric Biome API (v1) 13.0.10+b3afc78b77
			fabric-block-api-v1: Fabric Block API (v1) 1.0.9+e022e5d177
			fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.39+b3afc78b77
			fabric-client-tags-api-v1: Fabric Client Tags 1.0.20+b3afc78b77
			fabric-command-api-v1: Fabric Command API (v1) 1.2.32+f71b366f77
			fabric-command-api-v2: Fabric Command API (v2) 2.2.11+b3afc78b77
			fabric-commands-v0: Fabric Commands (v0) 0.2.49+df3654b377
			fabric-containers-v0: Fabric Containers (v0) 0.1.61+df3654b377
			fabric-content-registries-v0: Fabric Content Registries (v0) 4.0.7+b3afc78b77
			fabric-convention-tags-v1: Fabric Convention Tags 1.5.3+b3afc78b77
			fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.2.18+aeb40ebe77
			fabric-data-generation-api-v1: Fabric Data Generation API (v1) 12.1.11+b3afc78b77
			fabric-dimensions-v1: Fabric Dimensions API (v1) 2.1.51+b3afc78b77
			fabric-entity-events-v1: Fabric Entity Events (v1) 1.5.21+b3afc78b77
			fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.6.0+b3afc78b77
			fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.61+df3654b377
			fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.38+b04edc7a77
			fabric-item-api-v1: Fabric Item API (v1) 2.1.26+b3afc78b77
			fabric-item-group-api-v1: Fabric Item Group API (v1) 4.0.7+b3afc78b77
			fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.36+fb8d95da77
			fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.34+df3654b377
			fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 2.2.20+b3afc78b77
			fabric-loot-api-v2: Fabric Loot API (v2) 1.1.37+b3afc78b77
			fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.1.41+9e7660c677
			fabric-message-api-v1: Fabric Message API (v1) 5.1.6+b3afc78b77
			fabric-mining-level-api-v1: Fabric Mining Level API (v1) 2.1.47+b3afc78b77
			fabric-models-v0: Fabric Models (v0) 0.3.35+b3afc78b77
			fabric-networking-api-v1: Fabric Networking API (v1) 1.3.8+b3afc78b77
			fabric-networking-v0: Fabric Networking (v0) 0.3.48+df3654b377
			fabric-object-builder-api-v1: Fabric Object Builder API (v1) 11.0.6+b3afc78b77
			fabric-particles-v1: Fabric Particles (v1) 1.0.28+b3afc78b77
			fabric-recipe-api-v1: Fabric Recipe API (v1) 1.0.18+b3afc78b77
			fabric-registry-sync-v0: Fabric Registry Sync (v0) 2.2.6+b3afc78b77
			fabric-renderer-api-v1: Fabric Renderer API (v1) 3.0.1+b3afc78b77
			fabric-renderer-indigo: Fabric Renderer - Indigo 1.3.1+b3afc78b77
			fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 3.2.44+df3654b377
			fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.3.33+b3afc78b77
			fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 3.0.26+b3afc78b77
			fabric-rendering-v0: Fabric Rendering (v0) 1.1.47+df3654b377
			fabric-rendering-v1: Fabric Rendering (v1) 3.0.6+b3afc78b77
			fabric-resource-conditions-api-v1: Fabric Resource Conditions API (v1) 2.3.5+ea08f9d877
			fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.11.7+f7923f6d77
			fabric-screen-api-v1: Fabric Screen API (v1) 2.0.6+b3afc78b77
			fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.3.27+b3afc78b77
			fabric-sound-api-v1: Fabric Sound API (v1) 1.0.12+b3afc78b77
			fabric-transfer-api-v1: Fabric Transfer API (v1) 3.2.2+b3afc78b77
			fabric-transitive-access-wideners-v1: Fabric Transitive Access Wideners (v1) 4.2.0+b3afc78b77
		fabricloader: Fabric Loader 0.14.21
		java: OpenJDK 64-Bit Server VM 17
		jei: Just Enough Items 15.0.0.12
		minecraft: Minecraft 1.20.1
		musicplayer: Music Player 2.6.0.216
		trinkets: Trinkets 3.7.0
			cardinal-components-base: Cardinal Components API (base) 5.2.0
			cardinal-components-entity: Cardinal Components API (entities) 5.2.0
		usefulbackpacks: Useful Backpacks 2.0.1.116
		uteamcore: U Team Core 5.1.2.264
	Server Running: true
	Player Count: 1 / 8; [class_3222['HyCraftHD'/153, l='ServerLevel[New World]', x=5.15, y=123.00, z=27.12]]
	Data Packs: vanilla, fabric
	Enabled Feature Flags: minecraft:vanilla
	World Generation: Stable
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'fabric'; Server brand changed to 'fabric'
	Launched Version: fabric-loader-0.14.21-1.20.1

Used minecraft version

1.20.x

Used forge or fabric version

1.20.1

Used mod version

2.0.1.116

commented

Could you fix this bug for 1.20? Thanks.

commented

Its fixed in the latest 1.20 releases. But you should update to 1.20.1 either way.