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
  • [17 -> 1.10] Puzzling Hang
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Draco18s

[17 -> 1.10] Puzzling Hang

By Draco18s, October 1, 2016 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15998 posts
Posted October 1, 2016

So I thought I'd try my hand at updating Custom Ore Gen from 1.7.10 to 1.10.2, figuring that I can bypass the blockstate issues by just letting COG handle it as metadata as it always has and translate back into blockstate only when it interfaces with vanilla code.

 

Not the greatest solution in the world, but one that would be quick and easy to pull off.  90% of everything else was just figuring out the new name something got.

 

That left me with a UI issue where the buttons and sliders weren't getting their mouse clicks (fixed) and....an issue I have no idea how to even diagnose.

 

The issue is that everything seems to run just fine.  Game loads up, I can use all UI, I can create a new world.

 

And that's it.  Once a world is created (either by loading a save or creating a new world) it reaches 100% says "Changing view distance to 12, from 10" and then hangs.  No further messages are printed, the game just displays a dirt background with "0%" written in the center.

 

I tried going into debug mode and seeing where the execution goes, but it appears to just be ticking the world as normal.  In so doing, I got it to print the "Can't keep up! Did the system time change, or is the server overloaded?" message.  Hitting escape on this "0%" screen returns me to the main menu and throws a NPE in ForgeChunkManager.unloadWorld (line 620).

 

I have a fork at https://github.com/Draco18s/CustomOreGen/tree/1.10-Update

  • Quote

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.

Share this post


Link to post
Share on other sites

jeffryfisher    183

jeffryfisher

jeffryfisher    183

  • World Shaper
  • jeffryfisher
  • Members
  • 183
  • 1283 posts
Posted October 1, 2016

Accidental infinite loop or recursion somewhere (like when generating ore for the spawn-area's chunks)? How far can you get in the debugger? If you put a print into the ore-gen, does the log fill as in infinite loop / circular calling?

 

Calling circles can occur when your program calls methods you're not expected to call. If their calls then come back to your method, the program gets stuck in infinite recursion.

 

Then again, maybe your ore-gen has a loop with an exit condition that sometimes can't be satisfied (like when an ore isn't allowed to replace anything, so the method keeps trying different randoms forever attempting to find a place for it).

  • Quote

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15998 posts
Posted October 1, 2016

No, the loop was the main game loop.  Everything was functioning as it should, except I couldn't see the game.

 

Ended up just commenting out event handlers until I could get into the game, narrowed it down to one.

 

https://github.com/Draco18s/CustomOreGen/blob/1.10-Update/src/main/java/CustomOreGen/FMLInterface.java#L87-L93

    @SubscribeEvent
    public void onServerTick(ServerTickEvent event)
    {
    	if (event.phase == TickEvent.Phase.END) {
    		ServerState.checkIfServerChanged(FMLServerHandler.instance().getServer(), (WorldInfo)null);
    	}
    }

 

Examining this in the debugger is actually difficult, because having the

checkIfServerChanged

commented lets the game run.  Having it uncommented prevents the game from running, but the breakpoint on it is never encountered.  Ended up having to round-about get at it (comment, run in debug, uncomment) and found that

FMLServerHandler.instance().getServer()

is returning null, and only null.

 

Is there another way to get the MinecraftServer instance without access to a World object serverside?

  • Quote

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.

Share this post


Link to post
Share on other sites

Leviathan143    40

Leviathan143

Leviathan143    40

  • Creeper Killer
  • Leviathan143
  • Forge Modder
  • 40
  • 211 posts
Posted October 2, 2016

Is there another way to get the MinecraftServer instance without access to a World object serverside?

 

FMLServerHandler.instance().getServer() will return null on an integrated server. Use FMLCommonHandler.INSTANCE.getMinecraftServerInstance() instead, it works for both integrated and dedicated servers.

 

 

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15998 posts
Posted October 2, 2016

Ah ha, brilliant.  I'll give that a bash.

 

Edit:

Yup, that prevented the problem.  Still some issues deeper on in (a command throws "error: null") but that's one step closer to a port.

  • Quote

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.

Share this post


Link to post
Share on other sites

diesieben07    7696

diesieben07

diesieben07    7696

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7696
  • 56382 posts
Posted October 2, 2016

Using

FMLServerHandler

directly is a bad idea anyways, since accessing this class will make FML think it's running on a dedicated server, there have been some crashes because of this in the past.

Use

FMLCommonHandler

, which has methods that wrap the ones in

FMLServerHandler

/

FMLClientHandler

, this is similar to a

@SidedProxy

.

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15998 posts
Posted October 2, 2016

Thanks diesieben07. I'm only trying to help the maintainers get it updated, so I don't know how it does most of what it does, so I was making an educated guess and was wrong, but couldn't find an alternative.

 

The change made it work, which is good. There's still two issues, neither of which I'm qualified to resolve, but the mod runs well enough for my purposes (cancels vanilla or been and does is own).

  • Quote

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.

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: Parkour Stairs Part 1!

      By cadbane86140 · Posted 43 minutes ago

      Hello There! Today we are playing a BRAND NEW parkour map that was actually just released about a month ago and all I gotta say is that this map is so freaking unique and the map creators did something with this map that we have never seen in parkour before! There are so many hilarious moments in this video 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! https://www.youtube.com/watch?v=5aGkMp5bExg
    • cadbane86140
      Revisiting our 2013 head shop!

      By cadbane86140 · Posted 43 minutes ago

      Hello there! With the recent re release of the old creative server I knew I had to make a video on there. So that is exactly what we did! We did a small tour of our old plot like we did last time but however we remembered some of our old friends and we checked out their old plots too! If you guys want us to do more where we just travel to different plots and talk about them let me know! But I hope you all enjoy this video and if you did don’t forget to like and sub for more videos Like this in the future! https://youtu.be/_m_lViaMlGU
    • kiou.23
      Block Rotate

      By kiou.23 · Posted 1 hour ago

      That's usually the case, always try to understand the code before copy and pasting, or else you'll get a lot of headaches later in the code's life
    • Varzac
      Forge jar file not opening

      By Varzac · Posted 1 hour ago

      I ran Jarfix and then tried installing again with the same results. Nothing happening I even tried using winrar, but as you said nothing happened
    • BeardlessBrady
      [1.16.4] Null when OpenGUI

      By BeardlessBrady · Posted 1 hour ago

      Ah.. Thats what I get for stopping half way through and not double checking, thanks!
  • Topics

    • cadbane86140
      0
      Minecraft: Parkour Stairs Part 1!

      By cadbane86140
      Started 43 minutes ago

    • cadbane86140
      0
      Revisiting our 2013 head shop!

      By cadbane86140
      Started 43 minutes ago

    • ehbean
      10
      Block Rotate

      By ehbean
      Started 8 hours ago

    • Varzac
      3
      Forge jar file not opening

      By Varzac
      Started 14 hours ago

    • BeardlessBrady
      2
      [1.16.4] Null when OpenGUI

      By BeardlessBrady
      Started 2 hours ago

  • Who's Online (See full list)

    • ash-122
    • Sqsuensay
    • Beethoven92
    • ThisIsNotOriginal
    • HappyAndJust
    • Funyaah
    • ehbean
    • kiou.23
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [17 -> 1.10] Puzzling Hang
  • Theme

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