Posted October 18, 201410 yr I'm sure I'm doing something wrong but I can't find It. ps this is my first time using a gui GuiScreen: Reveal hidden contents package com.example.gammacraft.gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; public class CraftingTableGuiScreen extends GuiScreen { public static int Guid; public CraftingTableGuiScreen() { Guid=3; } public void drawBackground(int i){ System.out.println("rendering gui:"+i); } } GuiHandler: Reveal hidden contents package com.example.gammacraft.gui; import com.example.gammacraft.containers.CraftingTableContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler{ @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID==CraftingTableGuiScreen.Guid){ return new CraftingTableGuiScreen(); } return null; } @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID==CraftingTableGuiScreen.Guid){ return new CraftingTableContainer(); } return null; } } GuiHandler register: NetworkRegistry.INSTANCE.registerGuiHandler(Instance, new GuiHandler()); openGui code in block class: @Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int side,float hx,float hy,float hz{ player.openGui(gammacraft.Instance, 3, world, x, y, z); return true; } I'm sure its just some stupid mistake that I can't find. also this doesn't render anything, it just prints "render" in the console, but it doesn't do anything The proud(ish) developer of Ancients
October 18, 201410 yr It's because you're not rendering anything. You're just printing it in the console. It's working. You're just not doing anything. -Mitchellbrine Quote Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible. It may be freaking fucking hard though, but still possible If you create a topic on Modder Support, live by this motto: Quote I don't want your charity, I want your information
October 18, 201410 yr Author thats the thing though...its not printing anything The proud(ish) developer of Ancients
October 18, 201410 yr On 10/18/2014 at 9:11 PM, memcallen said: it just prints "render" in the console, but it doesn't do anything -Mitchellbrine Quote Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible. It may be freaking fucking hard though, but still possible If you create a topic on Modder Support, live by this motto: Quote I don't want your charity, I want your information
October 18, 201410 yr Author Mitchellbrine, that's what it's supposed to do, should've worded it better. diedieten07, what do you mean the server can't access the class? The proud(ish) developer of Ancients
October 18, 201410 yr The class is only accessed by the client. Put your id in, say the GuiHandler class so it's accessible on both client and server. -Mitchellbrine Quote Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible. It may be freaking fucking hard though, but still possible If you create a topic on Modder Support, live by this motto: Quote I don't want your charity, I want your information
October 18, 201410 yr Author Ok I think I got it to work, it still doesn't print anything but it can pause the game when I right click. and unpause when I press esc. now I need to figure out how to render it. The proud(ish) developer of Ancients
October 18, 201410 yr Author I've figured out how to make it render, but how can I get the height/width of the minecraft window? The proud(ish) developer of Ancients
October 18, 201410 yr xSize = #; ySize = #; drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize); There's 10 types of people in this world; Those that understand binary and those that don't.
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.