Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Disconnection From Server When Placing Modded Block
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
octa

Disconnection From Server When Placing Modded Block

By octa, January 27 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

octa    0

octa

octa    0

  • Tree Puncher
  • octa
  • Members
  • 0
  • 8 posts
Posted January 27 (edited)

I'm playing around with making my own mod. It works fine in Singleplayer but when I test it on a server my client gets disconnected with error message Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException (there is no further stack trace) when I place the Portal Base block. I can reconnect just fine, but will get disconnected again when I place another of those blocks.

I haven't found much about this specific issue. Any help would be appreciated.

Code: https://github.com/eddie1101/PortalTest/

 

logs: (Though they're not very helpful, is there some way to make the error more verbose? A stack trace would really help)

Server: https://pastebin.com/JN6gnQyx

Client: https://pastebin.com/AWVavatz

 

Thanks in advance.

 

Edit: Attached .jar if you want to try to reproduce

basicportals-0.1.jar

Edited January 27 by octa
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted January 27

Your repository is not complete, the gradle wrapper and build.gradle should be included to make it usable. The MDK comes with a properly configured .gitignore file for a reason.

 

Start the game with the system property forge.logging.mojang.level=debug to see the stacktrace.

  • Quote

Share this post


Link to post
Share on other sites

octa    0

octa

octa    0

  • Tree Puncher
  • octa
  • Members
  • 0
  • 8 posts
Posted January 27

Repo is fixed. How do I run my client with system properties? It works on the server but when I add it to JVM arguments in the launcher's installation settings the game crashes.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted January 27

Your repository crashes for a different reason: You have two items with the same name.

Additionally, you are not registering your registry entries properly. You need to either use @ObjectHolder or DeferredRegister.

  • Quote

Share this post


Link to post
Share on other sites

octa    0

octa

octa    0

  • Tree Puncher
  • octa
  • Members
  • 0
  • 8 posts
Posted January 27

Woops. Fixed the item names.

According to the docs, RegistryEvent.Register is a valid way of registering entries, so I'll stick with that since I know it better.

The repo should build now, so back to my original question: Why when placing a Portal Base does the client get disconnected from the server?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted January 27
33 minutes ago, octa said:

According to the docs, RegistryEvent.Register is a valid way of registering entries, so I'll stick with that since I know it better.

That is fine, but then you must use @ObjectHolder instead of manually assigning fields.

 

37 minutes ago, octa said:

Why when placing a Portal Base does the client get disconnected from the server?

It crashes because your TileEntityPortalBase creates an SUpdateTileEntityPacket with a null BlockPos.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

octa    0

octa

octa    0

  • Tree Puncher
  • octa
  • Members
  • 0
  • 8 posts
Posted January 27 (edited)

Oh, that makes sense. Do you have a suggested way of initializing that BlockPos? I can't think of anything other than assigning a symbolic value which gets verified before use, but that seems clumsy.

Edit: Nvm, I was trying to return some nbt data instead of the tileentity's actual position. Thanks for the help.

Edited January 27 by octa
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56376 posts
Posted January 27

It makes no sense to return any position there but the TEs own, which you can get via TileEntity#getPos.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • cadbane86140
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140 · Posted 1 hour ago

      Hello There! Today we are back on Hunger Games after a little break but we are finally back! In this episode we are on the good ol' map Survival Games 4 and it ACTUALLY went well for once. Also we have so many great battles on rooftops, small rooms and just out in the open! We also use shears to fight at one point and that was pretty crazy! There are so many hilarious moments in this episode that I know you guys are gonna love! I hope you all enjoy this video and if you did don't forget to like and sub for more Hunger Games in the future!  
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 1 hour ago

      latest.log
    • diesieben07
      Game crashes whenever I try to increase the RAM

      By diesieben07 · Posted 1 hour ago

      In the logs folder of your game directory.
    • Unusualty
      GUI'S and player editing

      By Unusualty · Posted 1 hour ago

      So I'm trying to make a mod that is inspired by Origin's because this mod isn't for forge I was wondering if anyone can help me do something like this where you get a GUI when you join the world where you can select a race that has abilities and down sides to them, I also want to have classes but first I want these race's done so if anyone can help this would be appreciated.
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 1 hour ago

      Would you mind explaining where I can find the debug.log
  • Topics

    • cadbane86140
      0
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140
      Started 1 hour ago

    • Sad Whale
      6
      Game crashes whenever I try to increase the RAM

      By Sad Whale
      Started 2 hours ago

    • Unusualty
      0
      GUI'S and player editing

      By Unusualty
      Started 1 hour ago

    • fluiX
      1
      server wont start

      By fluiX
      Started 3 hours ago

    • Luis_ST
      6
      [1.16.5] Help with custom Event

      By Luis_ST
      Started 7 hours ago

  • Who's Online (See full list)

    • Beethoven92
    • matezz
    • NullDev
    • diesieben07
    • Kawaiialexplays
    • CookieLukas
    • LexManos
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Disconnection From Server When Placing Modded Block
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community