lishid / OpenInv

Open anyone's inventory as a chest, real-time!
GNU General Public License v3.0
119 stars 94 forks source link

Suggestions for inventories #92

Closed ArtelGG closed 2 months ago

ArtelGG commented 5 years ago

Here's a list of things you guys should try to add for online players' inventories:

  1. Show what the player has attached to their cursor; image

    1.a Just in case it's not already a thing, the player's off-hand slot for newer versions.

  2. Show what the user has in their crafting inventory, including the result slot; image
  3. Have an item formatted with the user's potion effects, UUID, perhaps their hunger and saturation, gamemode, location, etc.
RoboMWM commented 5 years ago

Are users really hiding things in these (temporary) slots?

  1. IMO is outside the scope of the plugin, this generic info can be found in many other plugins.
ArtelGG commented 5 years ago

There are instances where users who are trying to hide an item will pick the item up in their cursor to hide it from others (most likely staff) trying to find said item until they give up. Also, some modified clients can make it so the four crafting slots can be changed to store items rather than drop them when the inventory is closed.

Jikoo commented 5 years ago

1 and 2 I'll look into. 3 is included in #54 to a degree, probably more in line for an addon. Offhand slot is already handled. I won't show the crafting result slot - that should not be insertable by the client. If it is, that's really on the server implementation to prevent. I believe actual anticheat features to be outside of the scope of OI.

ArtelGG commented 5 years ago

1 and 2 I'll look into. 3 is included in #54 to a degree, probably more in line for an addon. Offhand slot is already handled. I won't show the crafting result slot - that should not be insertable by the client. If it is, that's really on the server implementation to prevent. I believe actual anticheat features to be outside of the scope of OI.

Sounds good. If the crafting result slot is just a simple grab of a slot ID think you could implement it anyway?

RoboMWM commented 5 years ago

There's no reason to show the crafting result slot if the client can't store an item in there, which I see no reason why it would be able to.

Jikoo commented 5 years ago

Sounds good. If the crafting result slot is just a simple grab of a slot ID think you could implement it anyway?

After some thought, no. It looks simple, but then you start to consider what do we do if the viewer modifies the result. Do we rewrite all of OpenInv's click handling so the viewer can't modify the result slot? Do we "craft" the item, and do we then have to manually include all crafting logic? Gets messy and time-consuming very quickly.

The server should be rejecting inserts to that slot, so there's no need for it. It's not a simple addition.

Jikoo commented 2 months ago

OI now offers a view of the crafting slots and cursor. If the player's inventory is the expected size, a view of the result is also available. The result view is only for clarity of what the player is doing, and is not editable.