Jump to content

[1.7.2] Barrel that works like a furnace (Container/TE problem)


Recommended Posts

Posted

Ok, I admit I don't know what I am doing wrong now... Let me explain what I'm trying to achieve:

 

- I am trying to create an barrel that acts like a furnace. Instead of using items as fuel, the player must click the barrel with an water bucket, or add the bucket in the GUI... This will increase the progress bar (working fine).

 

- I have 1 slot (slot[0]) that accepts paper, one that gives me wet paper (slot[1]), another that accepts water buckets (slot[2]), and finally one that gives me the bucket back (slot[3]).

 

- As I already explained, I added an method that adds water if the player has an water bucket on hands, if so I increase the water stored in the barrel (working fine).

 

Problems:

1. Slots act very weird. I can add items, but they will show 2x more items (some thing about client, I think), and if I left-click to remove, they just disappear, and right-click remove only one item (I tried to create an custom Slot, but it didn't work as well).

 

2. All barrels have different stored water values and GUI interfaces, but when the method that decreases the stored water is called, all barrels act like one, and all water stored values get mess up.

 

I believe that both problems are connected... but I can't find a solution.

 

TileEntity, Container, and GuiContainer code:

https://gist.github.com/anonymous/5e4a6b8ece48b61d718a

 

I've tried so hard on this piece of code and nothing... T-T

Posted

Wow, I haven't seen that! That explains why I could access the same items from different blocks, which was a bug that I haven't notices before, hahaha. Thanks diesieben07, you've just made my day!  :D

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.