Jump to content

Recommended Posts

Posted

I have a problem in my gui, where everytime I try to lift items from the gui, it just puts it back in. I just cant pickup items in my gui. Please help, I have been looking for a solution for the past week! I am really sorry but i am new to this forum, and for some reason all the other spoilers are in the main class spoiler

 

MainClass:

 

  Reveal hidden contents
Posted
  On 5/2/2014 at 4:41 PM, larsgerrits said:

In your container class, you have 7 slots using ids 1-7. You need to use ids 0-6.

I tried that and nothing changed?

Posted

Could you please post the code for the TileEntity? I think your problem is in there.

if (user.hasKnowledgeOfJava) {

    if (user.question.hasCode) {

        return interpetHelpfulResponse(user.getQuestion());

    } else {

        return "Could you post your code please?";

    }

} else {

    return "Learn some freaking Java!";

}

Posted
  On 5/2/2014 at 6:08 PM, DiabolusNeil said:

Could you please post the code for the TileEntity? I think your problem is in there.

Oh, just added it  :)

Posted

@Override
public ItemStack getStackInSlot(int i) {
	return null;

}

@Override
public ItemStack decrStackSize(int i, int j) {

	return null;
}

You need to properly implement those methods to make it work (use TileEntityFurnace.java as a example).

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

If you read the javadoc for the decrStackSize, you'll see that it handles removing items from slots. Think about it: what would you think happen when you return null for a decreasing stack size method? Exactly, the stack won't be decreased, and thus your frustration about not being able to remove items.

 

Tip: please read Forge's amazing javadoc. It wasn't written just for kicks and giggles, it was meant to be a help.

Posted

I made a 1.6.4 mod a little bit ago dealing with simple inventories. This: https://github.com/DiabolusNeil/MoreStorage/tree/master/common/diabolusneil/morestorage should help you greatly.

if (user.hasKnowledgeOfJava) {

    if (user.question.hasCode) {

        return interpetHelpfulResponse(user.getQuestion());

    } else {

        return "Could you post your code please?";

    }

} else {

    return "Learn some freaking Java!";

}

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.