Skip to content

Commit

Permalink
Allow BlockState to be compared with any other type
Browse files Browse the repository at this point in the history
  • Loading branch information
SmylerMC committed Aug 3, 2024
1 parent f234aac commit e1e561f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litemapy/minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ def to_block_state_identifier(self, skip_empty: bool = True) -> str:

return identifier

def __eq__(self, other: 'BlockState') -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, BlockState):
raise ValueError("Can only compare BlockStates with BlockStates")
return False
return other.__block_id == self.__block_id and other.__properties == self.__properties

def __hash__(self) -> int:
Expand Down

0 comments on commit e1e561f

Please sign in to comment.