Jump to content

[1.7.10]Item disappears when removing it from slot. (SlotFurnace)


dude22072

Recommended Posts

When I use setInventorySlotContents to set a slot to an item the item disappears when removing it from the slot.

@Override
public void setInventorySlotContents(int var1, ItemStack var2) {
	this.slots[var1] = var2;

	if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) {
		var2.stackSize = this.getInventoryStackLimit();
	}
}

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

Link to comment
Share on other sites

You are chainging slot contents client-side. Make sure to do that on server, it's the server that holds data, client is only a vessel.

What methods do I need to change it server-side?

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

Link to comment
Share on other sites

Where are you calling your changes? That is the key.

The function is being called when a button on the GUI is pressed.

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

Link to comment
Share on other sites

That is obviously the problem.

 

Gui's are client-side, server doesn't know about them.

You will need to send packet from client to server on button click that will tell server to change your eq.

 

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2137055-1-7-2-customizing-packet-handling-with

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

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.