Skip to content

Commit

Permalink
refactor: remove unnecessary use of Objects.equals
Browse files Browse the repository at this point in the history
  • Loading branch information
derklaro committed Jan 29, 2025
1 parent c8a04cd commit 2f26150
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public void handleSneak(@NotNull PlayerToggleSneakEvent event) {
double distance = BukkitPlatformUtil.distance(npc, player.getLocation());

// check if we should imitate the action
if (Objects.equals(player.getWorld(), npc.world())
if (npc.world().equals(player.getWorld())
&& npc.tracksPlayer(player)
&& distance <= this.imitateDistance
&& npc.flagValueOrDefault(Npc.SNEAK_WHEN_PLAYER_SNEAKS)) {
Expand All @@ -197,7 +197,7 @@ public void handleLeftClick(@NotNull PlayerInteractEvent event) {
double distance = BukkitPlatformUtil.distance(npc, player.getLocation());

// check if we should imitate the action
if (Objects.equals(player.getWorld(), npc.world())
if (npc.world().equals(player.getWorld())
&& npc.tracksPlayer(player)
&& distance <= this.imitateDistance
&& npc.flagValueOrDefault(Npc.HIT_WHEN_PLAYER_HITS)) {
Expand Down

0 comments on commit 2f26150

Please sign in to comment.