Jump to content

Recommended Posts

Posted

Heyho Guys!

 

I created a Item which has a gui, but when I click it to open the gui, close it and click again, I get this crash report:

 

  Reveal hidden contents

 

 

Item class:

 

  Reveal hidden contents

 

 

GuiClass: ( I left out some code which is used for internal stuff)

 

  Reveal hidden contents

 

 

Write if you need more code!

Posted

Put a breakpoint in NetHandlerPlayServer:657, and see which one of the parameters of S2FPacketSetSlot is null.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Here is the GUI Handler:

package com.bedrockminer.magicum.network;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;

import com.bedrockminer.magicum.block.tileentity.TileElementaryExtractor;
import com.bedrockminer.magicum.block.tileentity.TileMagicCrafting;
import com.bedrockminer.magicum.block.tileentity.TileMagicTable;
import com.bedrockminer.magicum.block.tileentity.TileMagicalBrewing;
import com.bedrockminer.magicum.client.gui.GuiCodexMagicum;
import com.bedrockminer.magicum.client.gui.container.ContainerElementaryExtractor;
import com.bedrockminer.magicum.client.gui.container.ContainerEmpty;
import com.bedrockminer.magicum.client.gui.container.ContainerMagicCrafting;
import com.bedrockminer.magicum.client.gui.container.ContainerMagicTable;
import com.bedrockminer.magicum.client.gui.container.ContainerMagicalBrewing;
import com.bedrockminer.magicum.client.gui.guicontainer.GuiElementaryExtractor;
import com.bedrockminer.magicum.client.gui.guicontainer.GuiMagicCrafting;
import com.bedrockminer.magicum.client.gui.guicontainer.GuiMagicTable;
import com.bedrockminer.magicum.client.gui.guicontainer.GuiMagicalBrewing;

import cpw.mods.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler {

public static final int IDCodexMagicum = 0;

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
	if (ID == IDCodexMagicum)
		return new ContainerEmpty();

	return null;
}

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
	if (ID == IDCodexMagicum)
		return new GuiCodexMagicum();

	return null;
}

}

 

ContainerEmpty:

package com.bedrockminer.magicum.client.gui.container;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;

public class ContainerEmpty extends Container {

@Override
public boolean canInteractWith(EntityPlayer player) {
	return true;
}

}

Posted

If you have a Gui extending GuiScreen, you don't need an inventory at all. Just leave the

getServerGuiElement

returning null and call

player.openGui()

on the client side, instead of the server side.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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.