Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

setting an icon in empty pressed slot #79

Open
GustavHaavik opened this issue Sep 10, 2020 · 10 comments
Open

setting an icon in empty pressed slot #79

GustavHaavik opened this issue Sep 10, 2020 · 10 comments

Comments

@GustavHaavik
Copy link

Title says it all. I want to set the item that the cursor as an editable item in the empty slot.

@GustavHaavik
Copy link
Author

or get an itemstack at a slotpos

@portlek
Copy link
Collaborator

portlek commented Sep 10, 2020

you can use InventoryContents#setEditable(boolean) method? I'm not sure what you are trying to do but also there is a InventoryContents#getTopInventory()

@GustavHaavik
Copy link
Author

How do I set an item onto the cursor then?

@portlek
Copy link
Collaborator

portlek commented Sep 10, 2020

I can't understand what you are saying, sorry. Can you explain with code and images?

@GustavHaavik
Copy link
Author

a method that lets me set the cursor item, which is the itemstack the cursor is holding

@portlek
Copy link
Collaborator

portlek commented Sep 12, 2020

so you mean, you are holding an item on the cursor and you want to place it into the slot which is empty right?

@GustavHaavik
Copy link
Author

Yeah pretty much:

  1. Click an icon or a slot, if it is not an empty, I want to make the cursor hold the item
  2. if the clicking the slot that holds the same item as the one the cursor holds. than increase the cursor item by 1

@portlek
Copy link
Collaborator

portlek commented Sep 12, 2020

you can make it with the library so, it's possible but you should write some algorithms. there is contents.getTopInventory() method so you can use it.

@GustavHaavik
Copy link
Author

Can you perhaps help me, been trying too do it for 3 days...

@portlek
Copy link
Collaborator

portlek commented Sep 12, 2020

probably i can't, i must finish my other projects so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants