Skip to content

Commit

Permalink
Fixed detection of events when trying to get the used hand (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Mar 30, 2024
1 parent 814171e commit 22d6b91
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ private static void updateInventory(Inventory inventory) {
public static EquipmentSlot getHand(Event event) {
ReflectMethod<EquipmentSlot> getHandMethod;

if (event.getClass() == PlayerInteractEvent.class) {
if (event instanceof PlayerInteractEvent) {
getHandMethod = PLAYER_INTERACT_EVENT_GET_HAND;
} else if (event.getClass() == PlayerInteractEntityEvent.class) {
} else if (event instanceof PlayerInteractEntityEvent) {
getHandMethod = PLAYER_INTERACT_ENTITY_EVENT_GET_HAND;
} else if (event.getClass() == BlockPlaceEvent.class) {
} else if (event instanceof BlockPlaceEvent) {
getHandMethod = BLOCK_PLACE_EVENT_GET_HAND;
} else if (event instanceof PlayerBucketEvent) {
getHandMethod = PLAYER_BUCKET_EVENT_GET_HAND;
Expand Down

0 comments on commit 22d6b91

Please sign in to comment.