Jump to content

[SOLVED][1.7.10] GuiScreen initializing but not drawing?


Recommended Posts

Posted

	ClientCommandHandler.instance.registerCommand(new CommandShow());

@Override
public void processCommand(ICommandSender ics, String[] s)
{
	if (s.length != 0)
	{
		System.out.println("COMMANDSHOW");
		if (s.length >= 1)
		{
			System.out.println(s[0]);
			EntityPlayer player = ics.getEntityWorld().getPlayerEntityByName(s[0]);
			System.out.println(player);
			if (player != null)
			{
				Minecraft.getMinecraft().displayGuiScreen(new GuiCharacter((EntityPlayer) player));
			}
		}
	}
}

....
public GuiCharacter(EntityPlayer player)
{
	this.player = player;
}
@Override
public void initGui()
{
	System.out.println("INIT");
//stuff
	System.out.println("DONE");
	super.initGui();
}

@Override
public void drawScreen(int mouseX, int mouseY, float f)
{
	System.out.println("DRWING");
....
}
.....

LOG

[21:37:39] [Client thread/INFO] [sTDOUT]: [com.midstcraft.ernio.RoA.common.commands.CommandShow:processCommand:22]: COMMANDSHOW
[21:37:39] [Client thread/INFO] [sTDOUT]: [com.midstcraft.ernio.RoA.common.commands.CommandShow:processCommand:25]: ernio333
[21:37:39] [Client thread/INFO] [sTDOUT]: [com.midstcraft.ernio.RoA.common.commands.CommandShow:processCommand:27]: EntityClientPlayerMP['ernio333'/214, l='MpServer', x=-218,28, y=124,62, z=189,14]
[21:37:39] [Client thread/INFO] [sTDOUT]: [com.midstcraft.ernio.RoA.client.gui.GuiCharacter:initGui:38]: INIT
[21:37:39] [Client thread/INFO] [sTDOUT]: [com.midstcraft.ernio.RoA.client.gui.GuiCharacter:initGui:51]: DONE

there is no "DRAWING" in log.

 

Why? And what should I do?

 

Edit:

Gui normally works (opened with key using: mc.displayGuiScreen(new GuiCharacter(mc.thePlayer));)

I also tried putting Minecraft.getMinecraft().displayGuiScreen(new GuiCharacter((EntityPlayer) ics)); (ics = commandSender), not working either. Also mc.thePlayer - no success.

1.7.10 is no longer supported by forge, you are on your own.

Posted

Anyone has the slightest idea what's up with this?

 

What could be causing this? Is there something that might be reseting my Screen?

Note that screen opened with key works fine.

1.7.10 is no longer supported by forge, you are on your own.

Posted

Thanks for idea.

 

Seems like:

Open chat (chat new screen) -> Write cmd -> Client processes cmd (my new screen)-> Chat closes (screen = null)

So basically right after I open it, it's closed by Chat-closing.

 

Any ideas on how can I launch CLIENT side command that opens screen?

1.7.10 is no longer supported by forge, you are on your own.

Posted

I'll probably use GuiOpenEvent since there will be few commands like this.

 

Just gonna ask:

"Delay by one tick?"

It's either me that has not a slightest idea how to do it SIMPLE (inside command), or you just proposed that I make new client tick event add some int static that will be set to 1 when command launches and when it is decremented to 0 the client ticker will open new custom screen? And simple "yes" will make my mind, otherwise - teach me master :o

 

Thread solved :) (I rly think they (forge) should process command after screen is closed)

1.7.10 is no longer supported by forge, you are on your own.

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.