AnvilGUI icon indicating copy to clipboard operation
AnvilGUI copied to clipboard

Send experience packets to support Bedrock via Geyser

Open PikaMug opened this issue 1 year ago • 0 comments

Fixes #332

Bedrock does not allow the result slot to be clicked when the player's experience level is 0. This change sends a packet which sets the Bedrock client's level to 20 (number is trivial) on anvil open, and then again back to the actual value when closed. It adds a .gesyer-compat(boolean) to the builder, which is enabled by default. A second constructor has been added to AnvilGUI for backwards compatibility.

In writing this, it occurs to me it may be preferred to have the method be something like .disableGeyserCompat() instead, to match .preventClose(). Let me know if that's what you'd prefer.

Other changes I made in order to test this:

  • Removed jvm.config. As mentioned in #329 it is no longer required with the newer version of Spotless we're on, see https://github.com/diffplug/spotless/blob/main/plugin-maven/CHANGES.md#2227---2022-06-10
  • Added a jitpack.yml file which allows AnvilGUI to be compiled on the popular jitpack.io repository

PikaMug avatar Jun 27 '24 03:06 PikaMug