Skip to content

Armor Equip and Event Handling Enhancements#1

Open
PYZR wants to merge 2 commits intoUnp1xelt:mainfrom
PYZR:main
Open

Armor Equip and Event Handling Enhancements#1
PYZR wants to merge 2 commits intoUnp1xelt:mainfrom
PYZR:main

Conversation

@PYZR
Copy link

@PYZR PYZR commented Oct 9, 2024

ArmorEvent.java

Changes are made so that if toCancel has already been canceled, the process is not undone.

ArmorListener.java

Version Checking

A static block was added to calculate and store a CAN_SWAP flag based on the Minecraft version (major, minor, patch). This flag checks if the current Minecraft version supports armor swapping (version >= 1.19.4).

Player Interact Event

Improved handling of armor equipping when a player right-clicks with an armor item. If the player’s current armor slot is empty or can be swapped (based on the CAN_SWAP flag), the appropriate callEquip or callUnequip method is triggered.

Overall

  • the IDE has made some formatting changes (sorry for that)
  • Version compatibility (armor swapping) was added for Minecraft versions 1.19.4 and above.

@Unp1xelt Unp1xelt self-assigned this Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments