Jump to content

Recommended Posts

Posted

Hello guys (Again :( )

 

I'm now on a problem. I made a Gui which is a GuiContainer designed to be like the inventory. I can open it without problem but then, i cant take any items to move to another slots (It gets quickly taken by the mouse then it get back to his slot) and the second is i dont know how make a slot part of my ExtendedEntityProperties player. I made a ItemStack array which is saved by the NBT but i dont know how to use it in a slot, because the first parameter of a slot is the "InventoryPlayer" so it get the slot from an ID and i cant use mine :( I tried to make my own Slot class but it did'nt worked :(

 

Thanks for awnsers

Posted

Ok so I made a packet which open the Gui serverside and its work !

The items seems to work too :) Thanks man !

 

The last problem is that i dont know where is it saved. I printedout the itemstack that Ive made in my ext player and hes empty ...

 

Mh I thinks its saved in the player's inventory ..  Its the first armor slot ;_;

Posted
If you want to open the GUI on key press, you need a) a KeyHandler (not a TickHandler) and b) Packets

 

no actually "openGui(Object, int, World, int, int, int)" from class EntityPlayer doesnt required packet to allow gui to open.

 

example of my code:

@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb,
		boolean tickEnd, boolean isRepeat) {
	if (Minecraft.getMinecraft().inGameHasFocus && tickEnd) {
		if (kb.keyCode == Keyboard.KEY_P) {
			Minecraft.getMinecraft().thePlayer.openGui(TheMod.instance, PartyGUI.GUI_ID,
					Minecraft.getMinecraft().theWorld, 0, 0, 0);

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.