Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

onTickInGUI


crazyputje
 Share

Recommended Posts

hi,

 

I'm having trouble with the new FML. onTickInGUI doesn't seem to work in the menu but only ingame.

It doesn't give any errors, it just starts to tick when loading a game. Is this intentional or is this a bug?

If this is intentional is their an other way to do the same thing but in the menu?

 

Thanks in advance,

 

Crazyputje

Ymzd0.png
Link to comment
Share on other sites

Mind posting up a small example mod to showcase this difference.

I haven't loaded up eclipse to look into it, but last I recall all of ML's ticks are called in world.doTick which doesn't exist in the main menu.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

An example is easily made: just print a string on each tick and watch when the spam appears. When using FML: spam starts when loading a game

When using ML: spam starts when loading minecraft

 

And modloader gets its ticks from the EnityRendererProxy  (I think)

 

package net.minecraft.src;

import net.minecraft.client.Minecraft;

public class EntityRendererProxy extends EntityRenderer
{
    private Minecraft game;

    public EntityRendererProxy(Minecraft minecraft)
    {
        super(minecraft);
        game = minecraft;
    }

    /**
     * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI
     */
    public void updateCameraAndRender(float f)
    {
        super.updateCameraAndRender(f);
        ModLoader.onTick(f, game);
    }
}

 

updateCameraAndRender is called from runGameLoop in Minecraft.class

Ymzd0.png
Link to comment
Share on other sites

I'll have to look into this, Been a while seince I've looked at ModLoader itself, I've left it all to cpw to do all the FML stuff. And we're trying to get it as compatible as we can. So its good to get these discrepancy reports.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

FYI, when I analyzed this (and I spent some time on this) I did not observe this behaviour. Can you indicate your ModLoader "inGameHook" and "inGUIHook" values please?

 

Likely it's a small change to ModLoaderModContainer to accomodate your requirements. If you wish to grab the fml source and send a pull request...

Link to comment
Share on other sites

Do you mean this?

 

		ModLoader.setInGUIHook(this, true, false);
	ModLoader.setInGameHook(this, true, false);

 

I found the problem and i have removed the code that check's if the world isn't null and it worked.

I requested a pull so you can see what i changed and so you can maybe implement the fix.

Ymzd0.png
Link to comment
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.   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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.