NucleusPowered / Nucleus

The Ultimate Essentials Plugin for Sponge.
http://nucleuspowered.org
MIT License
160 stars 69 forks source link

Invsee Issue #454

Closed GershonR closed 7 years ago

GershonR commented 8 years ago

Nucleus-0.13.1-S5-1.10.2 spongeforge-1.10.2-2107-6.0.0-BETA-1856

When using /invsee on a person from a distance the inventory screen will flash really quick then close, it only works when you're near a player.

/enderchest seems to work perfectly from distances though

dualspiral commented 8 years ago

Huh, that's interesting. I'll investigate, but I think that might be something that the Sponge guys don't intend to happen.

Line in question is here: https://github.com/NucleusPowered/Nucleus/blob/sponge-api/5/src/main/java/io/github/nucleuspowered/nucleus/modules/inventory/commands/InvSeeCommand.java#L77

AussieWarGod commented 7 years ago

can confirm this issue.

We have had issues with other player inventory plugins, could be a sponge inventory API issue?

dualspiral commented 7 years ago

It depends whether they think it's expected behaviour. I would say it isn't. I'm working on a workaround for now, but it might very well be that this is unintended behaviour from Sponge. If it is intended, it needs to be documented.

@Faithcaio @Aaron1011 - you two seem to have touched the Inventory API more than most recently - would you be able to clarify if this is a Sponge issue that will get resolved, or something we have to work with? Thanks!

Faithcaio commented 7 years ago

Vanilla is doing this. InventoryPlayers isUsableByPlayer function limits the distance to 8 blocks (and alive players). We might need to handle PlayerInventory separatly.

dualspiral commented 7 years ago

Thanks, that's good to know.

dualspiral commented 7 years ago

I've updated the Nucleus Mixins project to try to offer a workaround for now - I alter the method isUsableByPlayer as mentioned above to return true if the player trying to access the inventory is not the owner of the inventory:

NucleusMixins-0.14.0-5.0-SNAPSHOT.zip

Install it like a mod. If you get problems with world pre-generation, look for a mixins.conf file in config/nucleus. Set world-generation to false - then restart the server.

This is somewhat untested. Use at your own risk.

If you do use it, let me know how it goes.

zed65 commented 7 years ago

So far working perfect!!