Jump to content

[SOLVED] [1.7.10] Player kicked with NullPointerException on block break


Recommended Posts

Posted

So I cannot seem to find a solution to this problem. I've done tons of debugging and I've seemed to narrow it down some, but not as much as I'd like. It seems that after I initiate a teleport command that is handled by my mod (doesn't have to actually teleport me just start the command, however it is only with the teleport commands) I cannot break any block without it kicking me from the server printing out a NullPointerException as follows:

 

 

  Reveal hidden contents

 

If I was to then log back in and break a block after this it will do the same thing over and over unless I remove my PlayerLoggedInEvent listener, in which case I have to teleport each time before I get the error.

 

I really have almost no idea which classes it's relevant to, but here are all the ones I can think of. I can post more if needed.

 

PlayerLoginListener:

http://pastebin.com/qtJLUCLZ

 

ListenerRegistry (The only classes that actually contain anything atm are the BlockBreak, Command, ChatListener, PlayerMove, PlayerTick, ServerTick, PlayerLogin, and PlayerLogout)

 

  Reveal hidden contents

 

BlockBreak (I can remove all code from this class and doesn't change the outcome):

 

  Reveal hidden contents

 

CommandHandler (This is where the CommandListener directs all commands):

http://pastebin.com/kUQ9J9XC

 

MyEssentials (@mod class):

http://pastebin.com/C6bsGhyq

 

And the two teleport commands that actually seem to cause the problem:

http://pastebin.com/5JXXJXmG

 

These commands don't actually have to go through, just called. I know this is a lot, but any help is extremely appreciated!

Posted

I know that it's throwing the NullPointerException from either the onBlockBreakEvent method in ForgeHooks or in the method that calls that one. My only suspicion is that somehow my position is invalidated after I teleport and the client doesn't know where the block is that I broke? Or something to that effect maybe?

Posted

BreakEvent is fired when any block is broken by any means.  Read the javadoc.

 

What happens if water pours on the ground and encounters tall grass?

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.

Posted

Actually, BlockEvent.BreakEvent is only posted when a player breaks a block. At least to call the method onBlockBreakEvent in ForgeHooks EntityPlayerMP is one of the parameters. I did try it though and water doesn't throw the exception when it breaks a block. Do you know what I'm doing wrong that this would be happening?

Posted

Hmmm, sorry about that. There is an event that does what I said.  Not that one then, hum.

 

What is the line of code at ForgeHooks.java line 459?  That'll help narrow down what was null, even if it isn't your code: you'll be able to figure out--by working backwards--what it was that your code did to cause it.

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.

Posted

This is the if statement that correlates to:

        // Tell client the block is gone immediately then process events
        if (world.getTileEntity(x, y, z) == null)
        {
            S23PacketBlockChange packet = new S23PacketBlockChange(x, y, z, world);
            packet.field_148883_d = Blocks.air;
            packet.field_148884_e = 0;
            entityPlayer.playerNetServerHandler.sendPacket(packet);
        }

 

Line 459 is:

packet.field_148883_d = Blocks.air;

Posted

Any idea why that would throw a NullPointer? What makes the packet handle fail? My best guess is that it can't find the player that broke the block or the World, but I can't figure out anything beyond that as to why my code would effect it.

Posted

If I break the block in survival it actually crashes the server instead of just kicking me. What's nice about that is it gives me a crash report. To me it looks like the player is somehow null.

 

Here's the crash report:

 

  Reveal hidden contents

 

Would teleporting somehow make the EntityType for me null? How does that happen? Sorry for so many comments I just really need help with this.

Posted

Okay, I believe I just figured out. Turns out it was in my personal player object that was extending EntityPlayerMP and was using the super constructor. I'm thinking that's where the null Entity Type was coming in. Removed that and everything works fine. Thank you for the help. :) I really appreciate the effort.

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

    • So i have a forge modded aternos server that worked just fine for a month untill today it suddenly crashes most of the time giving errors and idk which mod is causing the error or its smth else here is the crash log link https://mclo.gs/gGkzGKT
    • Struggling to decipher a crash report I'm getting in a custom modpack I'm tinkering with. The crash happens on startup, but weirdly, only some of the time. It seems to be related to Steves Carts, but weirdly it only started happening recently, and I can't identify if another mod is conflicting, or why it is only happening some of the time:   java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.m_20202_()" because "player" is null at vswe.stevescarts.events.OverlayEventHandler.onRenderTick(OverlayEventHandler.java:24) ~[stevescarts-1.20.1-1.1.14.jar%23527!/:1.20.1-1.1.14] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(ForgeEventFactory.java:919) ~[forge-1.20.1-47.1.106-universal.jar%23581!/:?] {re:mixin,re:classloading,pl:mixin:APP:modernfix-forge.mixins.json:perf.potential_spawns_alloc.ForgeEventFactoryMixin,pl:mixin:A} at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1148) ~[client-1.20.1-20230612.114412-srg.jar%23576!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:mixin:A,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:718) ~[client-1.20.1-20230612.114412-srg.jar%23576!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:mixin:A,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:218) ~[minecraft-1.20.1-client.jar:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:flywheel.mixins.json:ClientMainMixin,pl:mixin:A,pl:runtimedistcleaner:A}     Including some extra info in case any of it is relevant^. Appreciate any ideas/advice!    
    • Try the JVM argument in this post, just sub xmx/xms numbers for what you want/need allocated.  https://www.reddit.com/r/feedthebeast/s/lzmKUNZFrG I'm having the same issue with a huge modpack using the 3 culprits to your issue.  Let me know if this helps!
    • i have been trying to  lauch a modpack and it crashes in the lauching phase   
    • nope, even the log is the exact same, i also tried with the Dimensional doors just in case and nothing.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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