Skip to content

Commit

Permalink
test: add tests for overloaded Dimension.get_block_at function
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Sep 9, 2024
1 parent ae552ff commit dfc9be7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/endstone_test/tests/on_player_join/test_block.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from babel import Locale
from endstone import Player, Server, GameMode
from endstone.plugin import Plugin
import pytest


@pytest.fixture
def server(player: Player) -> Server:
return player.server


def test_get_block_at_xyz(player: Player) -> None:
location = player.location
block = player.dimension.get_block_at(location.block_x, -64, location.block_z)
assert block.type == "minecraft:bedrock"
block = player.dimension.get_block_at(location.block_x, 320, location.block_z)
assert block.type == "minecraft:air"


def test_get_block_at_location(player: Player) -> None:
location = player.location
block = player.dimension.get_block_at(location)
assert block.data.type == block.type

0 comments on commit dfc9be7

Please sign in to comment.