Jump to content

[1.15] NullPointerException Crash with FluidStackItemHandlerCapability


Recommended Posts

Posted

I'm trying to make a custom capability wrapper for an item that stores a fluid and my game crashes when writing the capability data to NBT.

 

Crash Report:

---- Minecraft Crash Report ----
// My bad.

Time: 8/12/20 6:49 PM
Description: mouseClicked event handler

java.lang.NullPointerException: mouseClicked event handler
	at net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack.getFluid(FluidHandlerItemStack.java:76) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading}
	at awsome.techmod.capability.MoldCapabilityWrapper.serializeNBT(MoldCapabilityWrapper.java:39) ~[main/:?] {re:classloading}
	at awsome.techmod.capability.MoldCapabilityWrapper.serializeNBT(MoldCapabilityWrapper.java:1) ~[main/:?] {re:classloading}
	at net.minecraftforge.common.capabilities.CapabilityDispatcher.serializeNBT(CapabilityDispatcher.java:127) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading}
	at net.minecraftforge.common.capabilities.CapabilityProvider.serializeCaps(CapabilityProvider.java:86) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading}
	at net.minecraft.item.ItemStack.copy(ItemStack.java:375) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading}
	at net.minecraft.client.gui.screen.inventory.CreativeScreen.handleMouseClick(CreativeScreen.java:191) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.mouseClicked(ContainerScreen.java:341) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.inventory.CreativeScreen.mouseClicked(CreativeScreen.java:443) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:87) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:446) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.mouseButtonCallback(MouseHelper.java:85) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:173) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:86) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.MouseHelper.lambda$registerCallbacks$5(MouseHelper.java:172) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
	at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] {}
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
	at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:85) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MainWindow.flipFrame(MainWindow.java:296) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:983) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:558) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_162] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_162] {}
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_162] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.2.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.2.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.2.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.2.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.2.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {}


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

-- Head --
Thread: Render thread
Stacktrace:
	at net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack.getFluid(FluidHandlerItemStack.java:76)
	at awsome.techmod.capability.MoldCapabilityWrapper.serializeNBT(MoldCapabilityWrapper.java:39)
	at awsome.techmod.capability.MoldCapabilityWrapper.serializeNBT(MoldCapabilityWrapper.java:1)
	at net.minecraftforge.common.capabilities.CapabilityDispatcher.serializeNBT(CapabilityDispatcher.java:127)
	at net.minecraftforge.common.capabilities.CapabilityProvider.serializeCaps(CapabilityProvider.java:86)
	at net.minecraft.item.ItemStack.copy(ItemStack.java:375)
	at net.minecraft.client.gui.screen.inventory.CreativeScreen.handleMouseClick(CreativeScreen.java:191)
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.mouseClicked(ContainerScreen.java:341)
	at net.minecraft.client.gui.screen.inventory.CreativeScreen.mouseClicked(CreativeScreen.java:443)
	at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:87)

-- Affected screen --
Details:
	Screen name: net.minecraft.client.gui.screen.inventory.CreativeScreen
Stacktrace:
	at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:446)
	at net.minecraft.client.MouseHelper.mouseButtonCallback(MouseHelper.java:85)
	at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:173)
	at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:86)
	at net.minecraft.client.MouseHelper.lambda$registerCallbacks$5(MouseHelper.java:172)
	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101)
	at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:85)

-- Affected level --
Details:
	All players: 1 total; [ClientPlayerEntity['Awsomekeldeo'/34, l='MpServer', x=-989.35, y=69.00, z=-29.36]]
	Chunk stats: Client Chunk Cache: 841, 447
	Level dimension: DimensionType{minecraft:overworld}
	Level name: MpServer
	Level seed: 322288368513725192
	Level generator: ID 00 - default, ver 1. Features enabled: false
	Level generator options: {}
	Level spawn location: World: (256,72,144), Chunk: (at 0,4,0 in 16,9; contains blocks 256,0,144 to 271,255,159), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 96693 game time, 30187 day time
	Known server brands: 
	Level was modded: false
	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
	Server brand: forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.world.ClientWorld.fillCrashReport(ClientWorld.java:457)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:1839)
	at net.minecraft.client.Minecraft.run(Minecraft.java:572)
	at net.minecraft.client.main.Main.main(Main.java:177)
	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.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105)

-- System Details --
Details:
	Minecraft Version: 1.15.2
	Minecraft Version ID: 1.15.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_162, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 455283944 bytes (434 MB) / 1143472128 bytes (1090 MB) up to 1908932608 bytes (1820 MB)
	CPUs: 2
	JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
	ModLauncher: 5.1.2+70+master.2845bb9
	ModLauncher launch target: fmluserdevclient
	ModLauncher naming: mcp
	ModLauncher services: 
		/eventbus-2.2.0-service.jar eventbus PLUGINSERVICE 
		/forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-launcher.jar object_holder_definalize PLUGINSERVICE 
		/forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-launcher.jar runtime_enum_extender PLUGINSERVICE 
		/accesstransformers-2.1.3-shadowed.jar accesstransformer PLUGINSERVICE 
		/forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-launcher.jar capability_inject_definalize PLUGINSERVICE 
		/forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-launcher.jar runtimedistcleaner PLUGINSERVICE 
		/forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-launcher.jar fml TRANSFORMATIONSERVICE 
	FML: 31.2
	Forge: net.minecraftforge:31.2.31
	FML Language Providers: 
		[email protected]
		minecraft@1
	Mod List: 
		client-extra.jar Minecraft {[email protected] DONE}
		forge-1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1-recomp.jar Forge {[email protected] DONE}
		main Untitled Tech Mod {[email protected] DONE}
	Launched Version: MOD_DEV
	Backend library: LWJGL version 3.2.2 build 10
	Backend API: GeForce GTX 1050/PCIe/SSE2 GL version 4.6.0 NVIDIA 451.67, NVIDIA Corporation
	GL Caps: Using framebuffer using OpenGL 3.0
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'forge'
	Type: Client (map_client.txt)
	Resource Packs: vanilla, mod_resources, file/§9[§5§lTMoTF§9] §f- §eResource Pack§2 v1.03 (incompatible)
	Current Language: English (US)
	CPU: 2x Pentium(R) Dual-Core CPU E5700 @ 3.00GHz

 

Source:

Item Capability Wrapper:

https://github.com/Awsomekeldeo/TechMod/blob/test/src/main/java/awsome/techmod/capability/MoldCapabilityWrapper.java

Item Class:

https://github.com/Awsomekeldeo/TechMod/blob/test/src/main/java/awsome/techmod/items/CeramicMoldItem.java

Posted (edited)

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.

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

    • Maybe there are other mods, not compatible with 47.4.4 - the 2nd 4 indicates mayor changes - so some mods may not compatible with it
    • Nope still the same issue exit code 1
    • I have no idea what the flip is going on, I can load the modpack just fine at forge 42.2.0 but any forge version above it insta-crashes with exit code 1. Can somebody tell me what's going on, this is minecraft 1.20.1 Latest.log: https://pastebin.com/pBUL1ZFa
    • does anyone know how to incorporate custom noise settings into a custom dimension through the use of datagen, I have created a custon json file for the noise settings that I want but I just don't know how to get it to register with the generated json file of the custom dimension.   here is the code for the dimension class package net.hurst.lustria.worldgen.dimension; import com.mojang.datafixers.util.Pair; import net.hurst.lustria.Lustria; import net.hurst.lustria.worldgen.biome.ModBiomes; import net.hurst.lustria.worldgen.registries.LustriaNoiseSettings; import net.minecraft.core.HolderGetter; import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.util.valueproviders.ConstantInt; import net.minecraft.world.level.Level; import net.minecraft.world.level.biome.*; import net.minecraft.world.level.dimension.BuiltinDimensionTypes; import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.dimension.LevelStem; import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator; import net.minecraft.world.level.levelgen.NoiseGeneratorSettings; import java.util.List; import java.util.OptionalLong; public class ModDimensions { public static final ResourceKey<LevelStem> LUSTRIA_KEY = ResourceKey.create(Registries.LEVEL_STEM, ResourceLocation.fromNamespaceAndPath(Lustria.MOD_ID, "lustriadim")); public static final ResourceKey<Level> LUSTRIA_LEVEL_KEY = ResourceKey.create(Registries.DIMENSION, ResourceLocation.fromNamespaceAndPath(Lustria.MOD_ID, "lustriadim")); public static final ResourceKey<DimensionType> LUSTRIA_DIM_TYPE = ResourceKey.create(Registries.DIMENSION_TYPE, ResourceLocation.fromNamespaceAndPath(Lustria.MOD_ID, "lustriadim_type")); public static void bootstrapType(BootstapContext<DimensionType> context) { context.register(LUSTRIA_DIM_TYPE, new DimensionType( OptionalLong.of(12000), // fixedTime false, // hasSkylight true, // hasCeiling false, // ultraWarm false, // natural 1.0, // coordinateScale true, // bedWorks false, // respawnAnchorWorks -64, // minY 256, // height 256, // logicalHeight BlockTags.INFINIBURN_OVERWORLD, // infiniburn BuiltinDimensionTypes.OVERWORLD_EFFECTS, // effectsLocation 0.0f, // ambientLight new DimensionType.MonsterSettings(false, false, ConstantInt.of(0), 0))); } public static void bootstrapStem(BootstapContext<LevelStem> context) { HolderGetter<Biome> biomeRegistry = context.lookup(Registries.BIOME); HolderGetter<DimensionType> dimTypes = context.lookup(Registries.DIMENSION_TYPE); HolderGetter<NoiseGeneratorSettings> noiseGenSettings = context.lookup(Registries.NOISE_SETTINGS); NoiseBasedChunkGenerator wrappedChunkGenerator = new NoiseBasedChunkGenerator( new FixedBiomeSource(biomeRegistry.getOrThrow(Biomes.BEACH)), noiseGenSettings.getOrThrow(NoiseGeneratorSettings.CAVES)); NoiseBasedChunkGenerator noiseBasedChunkGenerator = new NoiseBasedChunkGenerator( MultiNoiseBiomeSource.createFromList( new Climate.ParameterList<>(List.of(Pair.of( Climate.parameters(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F), biomeRegistry.getOrThrow(Biomes.BEACH)), Pair.of( Climate.parameters(0.1F, 0.2F, 0.0F, 0.2F, 0.0F, 0.0F, 0.0F), biomeRegistry.getOrThrow(Biomes.BIRCH_FOREST)), Pair.of( Climate.parameters(0.3F, 0.6F, 0.1F, 0.1F, 0.0F, 0.0F, 0.0F), biomeRegistry.getOrThrow(Biomes.OCEAN)), Pair.of( Climate.parameters(0.4F, 0.3F, 0.2F, 0.1F, 0.0F, 0.0F, 0.0F), biomeRegistry.getOrThrow(Biomes.DARK_FOREST)) ))), noiseGenSettings.getOrThrow(NoiseGeneratorSettings.CAVES)); LevelStem stem = new LevelStem(dimTypes.getOrThrow(ModDimensions.LUSTRIA_DIM_TYPE), noiseBasedChunkGenerator); context.register(LUSTRIA_KEY, stem); } } minecraft version is 1.20.1
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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