Jump to content

Recommended Posts

Posted (edited)

Alright at the risk of sounding and looking stupid I make this post. I'd like to preface this with I ported this code over from 1.9.2 or 1.8.2 (I can't exactly remeber as it has been quite some time) and I know there may have obivously been some changes, because this code worked in 1.9.2 and i beleive 1.8.2 on both Client and Server. But like I said I may be totally wrong as it has been quite some time. 

 

Now for some reason it works perfectly on the client but once you try to run the server with the mod it causes the server to crash with the following: https://pastebin.com/vqHcSXMs

 

It clearly appears to be a NullPointer in my WorldGen. Here is the:

WorldGen code: https://pastebin.com/eGLwqf8C

Main: https://pastebin.com/ikm5Y1fd

ClientProxy: https://pastebin.com/tU18bTPe

CommonProxy: https://pastebin.com/B5kpeXSJ

 

That should be all the relevant files. Perhaps it is because I don't have any .withProperty (I didn't think I needed properties unless 1.11.2 now requires them on my gens? Or maybe BlockMatcher is no longer used? Or hell maybe I am just registering it in the wrong spot on the proxy) Either way that is why I am posting here. I need some help, it's been a while since I have done modding and despite how dumb the error might be I will learn from it as I have done in the past. But I need the extra eyes to point it out to me. So I appologize in advanced for the noobyness but it has been some time. Also most of this setup was learned from old tutorials and older videos, that may have been good for their time, but perhaps there have been a number of changes that render those old tutorials obsolete (the way the main is setup, and proxies etc.) therefore rendering my code style obsolete at least for the 1.11.2.

 

EDIT:

I'm a flipping idiot. I registered all my items and blocks in my ClientProxy and not my CommonProxy (derp the server needs to know what is being registered also) and I was registering my worldGen in the CommonProxy. Moving my items and block registration into the CommonProxy fixed the issue. I'm guessing the same golden rule of ClientProxy ONLY handles renders and client side crap ONLY still stands strong? Feedback is still aprreciated or perhaps registering them this way is only a temp fix and something else may crash. 

Edited by HalestormXV
Posted (edited)
gen_AngelicOre = new WorldGenMinable(eAngelusBlocks.angelicOre.getDefaultState(), 2, BlockMatcher.forBlock(Blocks.STONE));

eAngelusBlocks.angelicOre

This is null. And it is null because you are initializing your blocks/items in your client proxy(aka client side only). 

Edit - well, I'm late. Anyway you should not use proxies for common code, just move it somewhere else, pereferrably to the new registry events.

Edited by V0idWa1k3r
  • Like 1
Posted (edited)

Yeah i noticed it after i made the post and made the edit up top. Thanks for the response though. Honestly sometimes i think the knowing "Your going to look like an idiot when somone sees this" fear sometimes makes you see the code better lol. At least for me because I may not be a phenomenal coder and still have a lot to learn, but stupid and silly mistakes like this always make me cringe especially when I know they are stupid and silly and I just can't see it.  Any tips that you might have with the layout of the code?

Edited by HalestormXV

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



×
×
  • Create New...

Important Information

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