Jump to content

[1.7.10] [Solved] Gui acting WIERD.


Awesome_Spider

Recommended Posts

I made a block that has it's own gui, when I rightClick it however, it does something really wierd. Here is a sceenshot:

Nk5bvKV.png

Here is my code:

 

 

The gui:

public class ArcaneHarnesserGui 
			extends GuiScreen{
public static final int GUI_ID = 20;

private static final ResourceLocation guiTexture = new ResourceLocation("wizardry", "/textures/gui/arcaneHarnesserGui.png");

private int ImageWidth = 176;
    private int ImageHeight = 166;
    
    @Override
    public void drawScreen(int x, int y, float par3){ 	
        int k = (this.width - this.ImageWidth) / 2;
        byte b0 = 2;
    	
    	this.drawTexturedModalRect(k, b0, 0, 0, this.ImageWidth, this.ImageHeight);
    	
    	this.mc.getTextureManager().bindTexture(guiTexture);
    }
}

 

The code in my block that opens the gui:

@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_){
	player.openGui(Wizardry.instance, ArcaneHarnesserGui.GUI_ID, world, x, y, z);

	return true;
}

 

My guiHandler:

public class GuiHandler
			implements IGuiHandler {

    @Override
    public Object getServerGuiElement ( int ID, EntityPlayer player, World world, int x, int y, int z ) {
            return null;
    }

    @Override
    public Object getClientGuiElement ( int ID, EntityPlayer player, World world, int x, int y, int z ) {
    	Object result = null;
    	
            if (ID == ArcaneHarnesserGui.GUI_ID){
                    result = new ArcaneHarnesserGui();
            }
            		return result;
    }
}

 

 

 

Edit: Here is what it should look like:

clX43Ll.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.
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.