Skip to content

Commit

Permalink
small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Dec 4, 2021
1 parent 9584722 commit 18c17d1
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -232,16 +232,16 @@ public void setEntityNavigationTarget(org.bukkit.entity.Entity entity, Location
@Override
public void setEntityLeftHanded(org.bukkit.entity.Entity ent, boolean left) {
Entity nmsEntity = ((CraftEntity) ent).getHandle();
if (nmsEntity instanceof net.minecraft.world.entity.Mob) {
((net.minecraft.world.entity.Mob) nmsEntity).setLeftHanded(left);
if (nmsEntity instanceof net.minecraft.world.entity.Mob mob) {
mob.setLeftHanded(left);
}
}

@Override
public boolean isEntityLeftHanded(org.bukkit.entity.Entity ent) {
Entity nmsEntity = ((CraftEntity) ent).getHandle();
if (nmsEntity instanceof net.minecraft.world.entity.Mob) {
return ((net.minecraft.world.entity.Mob) nmsEntity).isLeftHanded();
if (nmsEntity instanceof net.minecraft.world.entity.Mob mob) {
return mob.isLeftHanded();
}
return false;
}
Expand Down

0 comments on commit 18c17d1

Please sign in to comment.