Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Game crashes whenever animation is triggered, "anim" is null #83

Open
AdditionalRAM opened this issue Mar 11, 2024 · 1 comment
Open
Assignees
Labels
api Something with the API question Further information is requested

Comments

@AdditionalRAM
Copy link

Describe the bug
Basically title. Whenever I trigger an animation (from the example or my own implementation), the game crashes.

To Reproduce
Steps to reproduce the behavior:

  1. Implement example code
  2. Launch game, go in a world
  3. Right click a piece of paper to trigger animation
  4. Game crashes

Setup config (minecraft, modloader, libraries):

  • Minecraft version: 1.20.1 (Tried 1.20 as well)
  • Mod loader: Fabric Loader 0.15.7
  • PlayerAnimator Library version: 1.0.2-rc1+1.20
  • MC library version: 0.92.0+1.20.1

Other mods (If you use other mods, please specify! it might be an incompatibility):
Geckolib 4.4.2

It says the "anim" variable is null, but I couldn't figure out why. I originally had my own animation made in Blockbench, I scrapped it and cloned the one from the example projects. Tried downgrading to 1.20, no luck. Couldn't for the life of me get it to work.

Error:
java.lang.NullPointerException: Cannot invoke "dev.kosmx.playerAnim.core.data.KeyframeAnimation.mutableCopy()" because "anim" is null
Minecraft crash report:

// Uh... Did I do that?

Time: 2024-03-11 15:25:34
Description: Unexpected error

java.lang.NullPointerException: Cannot invoke "dev.kosmx.playerAnim.core.data.KeyframeAnimation.mutableCopy()" because "anim" is null
	at net.minecraft.item.Item.handler$zll000$restraints-mod$playAnimation(Item.java:1049)
	at net.minecraft.item.Item.use(Item.java)
	at net.minecraft.item.ItemStack.use(ItemStack.java:284)
	at net.minecraft.client.network.ClientPlayerInteractionManager.method_41929(ClientPlayerInteractionManager.java:387)
	at net.minecraft.client.network.ClientPlayerInteractionManager.sendSequencedPacket(ClientPlayerInteractionManager.java:278)
	at net.minecraft.client.network.ClientPlayerInteractionManager.interactItem(ClientPlayerInteractionManager.java:379)
	at net.minecraft.client.MinecraftClient.doItemUse(MinecraftClient.java:1822)
	at net.minecraft.client.MinecraftClient.handleInputEvents(MinecraftClient.java:2052)
	at net.minecraft.client.MinecraftClient.tick(MinecraftClient.java:1883)
	at net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1181)
	at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:802)
	at net.minecraft.client.main.Main.main(Main.java:250)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)


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

-- Head --
Thread: Render thread
Stacktrace:
	at net.minecraft.item.Item.handler$zll000$restraints-mod$playAnimation(Item.java:1049)
	at net.minecraft.item.Item.use(Item.java)
	at net.minecraft.item.ItemStack.use(ItemStack.java:284)
	at net.minecraft.client.network.ClientPlayerInteractionManager.method_41929(ClientPlayerInteractionManager.java:387)
	at net.minecraft.client.network.ClientPlayerInteractionManager.sendSequencedPacket(ClientPlayerInteractionManager.java:278)
	at net.minecraft.client.network.ClientPlayerInteractionManager.interactItem(ClientPlayerInteractionManager.java:379)
	at net.minecraft.client.MinecraftClient.doItemUse(MinecraftClient.java:1822)
	at net.minecraft.client.MinecraftClient.handleInputEvents(MinecraftClient.java:2052)

-- Affected level --
Details:
	All players: 1 total; [ClientPlayerEntity['Player436'/183, l='ClientLevel', x=86.99, y=73.00, z=-125.66]]
	Chunk stats: 225, 109
	Level dimension: minecraft:overworld
	Level spawn location: World: (76,63,-96), Section: (at 12,15,0 in 4,3,-6; chunk contains blocks 64,-64,-96 to 79,319,-81), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,-64,-512 to 511,319,-1)
	Level time: 1086 game time, 1086 day time
	Server brand: fabric
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.world.ClientWorld.addDetailsToCrashReport(ClientWorld.java:458)
	at net.minecraft.client.MinecraftClient.addDetailsToCrashReport(MinecraftClient.java:2406)
	at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:826)
	at net.minecraft.client.main.Main.main(Main.java:250)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)

-- Last reload --
Details:
	Reload number: 1
	Reload reason: initial
	Finished: Yes
	Packs: vanilla, fabric

-- System Details --
Details:
	Minecraft Version: 1.20.1
	Minecraft Version ID: 1.20.1
	Operating System: Windows 11 (amd64) version 10.0
	Java Version: 17.0.10, Eclipse Adoptium
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Eclipse Adoptium
	Memory: 417414656 bytes (398 MiB) / 1447034880 bytes (1380 MiB) up to 4137680896 bytes (3946 MiB)
	CPUs: 16
	Processor Vendor: AuthenticAMD
	Processor Name: AMD Ryzen 7 5800HS with Radeon Graphics         
	Identifier: AuthenticAMD Family 25 Model 80 Stepping 0
	Microarchitecture: Zen 3
	Frequency (GHz): 3.19
	Number of physical packages: 1
	Number of physical CPUs: 8
	Number of logical CPUs: 16
	Graphics card #0 name: NVIDIA GeForce RTX 3050 Laptop GPU
	Graphics card #0 vendor: NVIDIA (0x10de)
	Graphics card #0 VRAM (MB): 4095.00
	Graphics card #0 deviceId: 0x25a2
	Graphics card #0 versionInfo: DriverVersion=31.0.15.5152
	Graphics card #1 name: AMD Radeon(TM) Graphics
	Graphics card #1 vendor: Advanced Micro Devices, Inc. (0x1002)
	Graphics card #1 VRAM (MB): 512.00
	Graphics card #1 deviceId: 0x1638
	Graphics card #1 versionInfo: DriverVersion=30.0.14018.15002
	Memory slot #0 capacity (MB): 8192.00
	Memory slot #0 clockSpeed (GHz): 4.27
	Memory slot #0 type: LPDDR4
	Memory slot #1 capacity (MB): 8192.00
	Memory slot #1 clockSpeed (GHz): 4.27
	Memory slot #1 type: LPDDR4
	Virtual memory max (MB): 23187.68
	Virtual memory used (MB): 19929.21
	Swap memory total (MB): 7411.30
	Swap memory used (MB): 118.82
	JVM Flags: 0 total; 
	Fabric Mods: 
		fabric-api: Fabric API 0.92.0+1.20.1
		fabric-api-base: Fabric API Base 0.4.31+1802ada577
		fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.6.36+1802ada577
		fabric-biome-api-v1: Fabric Biome API (v1) 13.0.13+1802ada577
		fabric-block-api-v1: Fabric Block API (v1) 1.0.11+1802ada577
		fabric-block-view-api-v2: Fabric BlockView API (v2) 1.0.1+1802ada577
		fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.41+1802ada577
		fabric-client-tags-api-v1: Fabric Client Tags 1.1.2+1802ada577
		fabric-command-api-v1: Fabric Command API (v1) 1.2.34+f71b366f77
		fabric-command-api-v2: Fabric Command API (v2) 2.2.13+1802ada577
		fabric-commands-v0: Fabric Commands (v0) 0.2.51+df3654b377
		fabric-containers-v0: Fabric Containers (v0) 0.1.64+df3654b377
		fabric-content-registries-v0: Fabric Content Registries (v0) 4.0.11+1802ada577
		fabric-convention-tags-v1: Fabric Convention Tags 1.5.5+1802ada577
		fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.2.19+1802ada577
		fabric-data-attachment-api-v1: Fabric Data Attachment API (v1) 1.0.0+de0fd6d177
		fabric-data-generation-api-v1: Fabric Data Generation API (v1) 12.3.4+1802ada577
		fabric-dimensions-v1: Fabric Dimensions API (v1) 2.1.54+1802ada577
		fabric-entity-events-v1: Fabric Entity Events (v1) 1.6.0+1c78457f77
		fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.6.2+1802ada577
		fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.63+df3654b377
		fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.40+1802ada577
		fabric-gametest-api-v1: Fabric Game Test API (v1) 1.2.13+1802ada577
		fabric-item-api-v1: Fabric Item API (v1) 2.1.28+1802ada577
		fabric-item-group-api-v1: Fabric Item Group API (v1) 4.0.12+1802ada577
		fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.37+1802ada577
		fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.35+df3654b377
		fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 2.2.22+1802ada577
		fabric-loot-api-v2: Fabric Loot API (v2) 1.2.1+1802ada577
		fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.1.45+9e7660c677
		fabric-message-api-v1: Fabric Message API (v1) 5.1.9+1802ada577
		fabric-mining-level-api-v1: Fabric Mining Level API (v1) 2.1.50+1802ada577
		fabric-model-loading-api-v1: Fabric Model Loading API (v1) 1.0.3+1802ada577
		fabric-models-v0: Fabric Models (v0) 0.4.2+9386d8a777
		fabric-networking-api-v1: Fabric Networking API (v1) 1.3.11+1802ada577
		fabric-networking-v0: Fabric Networking (v0) 0.3.51+df3654b377
		fabric-object-builder-api-v1: Fabric Object Builder API (v1) 11.1.3+1802ada577
		fabric-particles-v1: Fabric Particles (v1) 1.1.2+1802ada577
		fabric-recipe-api-v1: Fabric Recipe API (v1) 1.0.21+1802ada577
		fabric-registry-sync-v0: Fabric Registry Sync (v0) 2.3.3+1802ada577
		fabric-renderer-api-v1: Fabric Renderer API (v1) 3.2.1+1802ada577
		fabric-renderer-indigo: Fabric Renderer - Indigo 1.5.1+1802ada577
		fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 3.2.46+df3654b377
		fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.3.37+92a0d36777
		fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 3.0.28+1802ada577
		fabric-rendering-v0: Fabric Rendering (v0) 1.1.49+df3654b377
		fabric-rendering-v1: Fabric Rendering (v1) 3.0.8+1802ada577
		fabric-resource-conditions-api-v1: Fabric Resource Conditions API (v1) 2.3.8+1802ada577
		fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.11.10+1802ada577
		fabric-screen-api-v1: Fabric Screen API (v1) 2.0.8+1802ada577
		fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.3.30+1802ada577
		fabric-sound-api-v1: Fabric Sound API (v1) 1.0.13+1802ada577
		fabric-transfer-api-v1: Fabric Transfer API (v1) 3.3.4+1802ada577
		fabric-transitive-access-wideners-v1: Fabric Transitive Access Wideners (v1) 4.3.1+1802ada577
		fabricloader: Fabric Loader 0.15.7
		geckolib: GeckoLib 4 4.4.2
		java: OpenJDK 64-Bit Server VM 17
		minecraft: Minecraft 1.20.1
		mixinextras: MixinExtras 0.3.5
		player-animator: Player Animator 1.0.2-rc1+1.20
		restraints-mod: Restraints 0.1-1.20.1
	Launched Version: Fabric
	Backend library: LWJGL version 3.3.1 SNAPSHOT
	Backend API: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 GL version 3.2.0 NVIDIA 551.52, NVIDIA Corporation
	Window size: 1920x1080
	GL Caps: Using framebuffer using OpenGL 3.2
	GL debug messages: 
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fabric'; Server brand changed to 'fabric'
	Type: Integrated Server (map_client.txt)
	Graphics mode: fast
	Resource Packs: fabric
	Current Language: en_us
	CPU: 16x AMD Ryzen 7 5800HS with Radeon Graphics 
	Server Running: true
	Player Count: 1 / 8; [ServerPlayerEntity['Player436'/183, l='ServerLevel[New World]', x=86.99, y=73.00, z=-125.66]]
	Data Packs: vanilla, fabric
	Enabled Feature Flags: minecraft:vanilla
	World Generation: Stable
@AdditionalRAM AdditionalRAM added the bug Something isn't working label Mar 11, 2024
@KosmX
Copy link
Owner

KosmX commented Mar 11, 2024

Have you tried not invoke anything on a null?
Or make sure you don't end up with a null?

@KosmX KosmX added question Further information is requested api Something with the API and removed bug Something isn't working labels Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Something with the API question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants