Skip to content

Commit

Permalink
Only call equipItem on server
Browse files Browse the repository at this point in the history
  • Loading branch information
powerboat9 committed Apr 9, 2024
1 parent c58ca5d commit 51dd5c6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ class NeuralInterfaceItem(settings: Settings?) : TrinketItem(settings), ICompute
}

override fun useOnEntity(stack: ItemStack?, user: PlayerEntity?, entity: LivingEntity?, hand: Hand?): ActionResult {
return if (!entity!!.isPlayer && equipItem(entity, stack)) {
ActionResult.SUCCESS
return if (!entity!!.isPlayer) {
if (!entity.world.isClient) {
if (!equipItem(entity, stack)) {
return ActionResult.FAIL;
}
}
ActionResult.success(!entity.world.isClient)
} else {
ActionResult.FAIL
}
Expand Down

0 comments on commit 51dd5c6

Please sign in to comment.