Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observer Tools not working on specific maps #726

Closed
applenick opened this issue Nov 27, 2020 · 4 comments · Fixed by #916
Closed

Observer Tools not working on specific maps #726

applenick opened this issue Nov 27, 2020 · 4 comments · Fixed by #916
Labels
bug Something isn't working

Comments

@applenick
Copy link
Member

Observer Tools not working on specific maps

It was brought to my attention by Darkrowo, that on certain maps the observer tools are not working. I attempted to debug this and came up with nothing as to why it would not be working. Basically when clicking any of the tools, the onInventoryClick method is just not being called only on these maps.

The maps we’ve found this issue on

  • Tetrad
  • Golden Drought

There may be additional, and I’ll update this list if others are found.

Video

https://youtu.be/R7GlxdvC6xo

Any ideas on how to fix this would be appreciated!

@applenick applenick added the bug Something isn't working label Nov 27, 2020
@KingOfSquares
Copy link
Contributor

This might also explain why the stat thing also does not work sometimes

@Pablete1234
Copy link
Member

Check if such maps have observer-specific kits, they may be changing something there that could cause this

@applenick
Copy link
Member Author

@Pablete1234 Golden Drought does not give any observer-specific kit. However Tetrad does give Night Vision.

@Pugzy
Copy link
Contributor

Pugzy commented Jun 6, 2021

I have had a look into this and found something interesting
When it doesn't work the item lore inside the clicked shows as §k§0§k§3§1§k§0§k§7Current Speed: §eNormal when it should be
§7Current Speed: §eNormal so the equals check fails and the item click does nothing

This is because maps with item-mods module checks on inventory open:

public void onInventoryOpen(InventoryOpenEvent event) {

This sets the APPLIED meta on every item to mark it as checked (any mods applied)

This meta is set using the LegacyItemTag which modifies the lore with extra color codes

lore.set(0, sequence + encode(value) + sequence + regex.matcher(lore.get(0)).replaceAll(""));
(read class docs at top of class to see how this works)

So the produced inventory has messed up color codes for item lore but the version the equals checked against does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

4 participants