Jump to content

[ 1.7.10 ] Where is the null point exception?


Guebeul

Recommended Posts

Hi, I'm going to ask a question.
I'm implementing the player's movements through the Obsidian API. But there was a problem..

1. first person
2018-08-18_13_36_14.png.52e82cd5ec4a691e27aafd160e7df098.png

2. Third person
2018-08-18_13_36_19.png.5af6f4d8c48c6d2417bb7c90fb802f34.png

 

In this way, the player is invisible when you are in third person, and it emits the following error. (Repeat continuously)

[13:36:21] [Client thread/ERROR]: Couldn't render entity
java.lang.NullPointerException
    at obsidianAPI.render.player.ModelAnimatedPlayer.setRotationAngles(ModelAnimatedPlayer.java:62) ~[ModelAnimatedPlayer.class:?]
    at obsidianAPI.render.ModelObj.render(ModelObj.java:355) ~[ModelObj.class:?]
    at net.minecraft.client.renderer.entity.RendererLivingEntity.renderModel(RendererLivingEntity.java:309) ~[RendererLivingEntity.class:?]
    at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:165) [RendererLivingEntity.class:?]
    at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:167) [RenderPlayer.class:?]
    at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:565) [RenderPlayer.class:?]
    at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]
    at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) [RenderManager.class:?]
    at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) [RenderManager.class:?]
    at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) [RenderGlobal.class:?]
    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) [EntityRenderer.class:?]
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087) [EntityRenderer.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_172]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_172]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_172]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_172]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
    at GradleStart.main(Unknown Source) [start/:?]


These two pictures are CommonProxy and ClientProxy I touched.
1. CommonProxy
2.PNG.d768b6bffe728794537fee480288fb31.PNG

2. ClientProxy
1094895406_.thumb.PNG.8df3d33c6dbd220ea2c8fcbc00881c7d.PNG

 

As noted in the log, NullPointerException is a problem. I really wonder where this NullPointerException happens.

RenderPlayerAnimated: https://github.com/ObsidianSuite/ObsidianSuite/blob/master/API/src/main/java/com/dabigjoe/obsidianAPI/render/player/RenderPlayerAnimated.java
ModelAnimatedPlayer: https://github.com/ObsidianSuite/ObsidianSuite/blob/master/API/src/main/java/com/dabigjoe/obsidianAPI/render/player/ModelAnimatedPlayer.java

 

If you know where NullPointerException is happening, the developer can help.
Please help me...!

Link to comment
Share on other sites

1 minute ago, Guebeul said:

Please help me...!

Anything below 1.8 is unsupported on this forum update if you want help. Soon 1.8.9 support will also be dropped if it isn't already. A Moderator will lock this thread later.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

5 minutes ago, Animefan8888 said:

Anything below 1.8 is unsupported on this forum update if you want help. Soon 1.8.9 support will also be dropped if it isn't already. A Moderator will lock this thread later.

You can not ask questions below version 1.8? It's really important that it is ...

Link to comment
Share on other sites

1 minute ago, Guebeul said:

You can not ask questions below version 1.8? It's really important that it is ...

Other forums will answer this question, it just makes it difficult to answer questions on older versions because supporting the massive changes between 1.7 and 1.8 and the changes between every other version that changed some core system. Would you expect Mojang to go back and update 1.7 versions to fix a bug or Oracle to go back to Java 6 to add new features? Or supply support? No. That is why other places exist. What makes your reason so important?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Anyway, a null pointer is a Java problem, not really a modding problem. It means that at that point in the code, something is null when it is not expected to be. Just use your debugger or console statements to trace through the execution leading up to that point in the code. Basically the error message tells you what is wrong so now up to you to fix it.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
    • It is an issue with quark - update it to this build: https://www.curseforge.com/minecraft/mc-mods/quark/files/3642325
  • Topics

×
×
  • Create New...

Important Information

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