mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-04 21:01:02 -05:00
Fix block tests.
This commit is contained in:
parent
480f339742
commit
0adb269ae1
2 changed files with 4 additions and 3 deletions
|
@ -49,8 +49,8 @@ public class ByteBufHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void assertBlock(BlockChangeRecord record, int block, int data) {
|
public static void assertBlock(BlockChangeRecord record, int block, int data) {
|
||||||
assertEquals("Received incorrect block id", block, record.getId());
|
assertEquals("Received incorrect block id", block, record.getBlock().getId());
|
||||||
assertEquals("Received incorrect block data", data, record.getData());
|
assertEquals("Received incorrect block data", data, record.getBlock().getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.junit.Test;
|
||||||
import org.spacehq.mc.auth.data.GameProfile;
|
import org.spacehq.mc.auth.data.GameProfile;
|
||||||
import org.spacehq.mc.protocol.data.game.entity.metadata.Position;
|
import org.spacehq.mc.protocol.data.game.entity.metadata.Position;
|
||||||
import org.spacehq.mc.protocol.data.game.world.block.BlockChangeRecord;
|
import org.spacehq.mc.protocol.data.game.world.block.BlockChangeRecord;
|
||||||
|
import org.spacehq.mc.protocol.data.game.world.block.BlockState;
|
||||||
import org.spacehq.mc.protocol.data.message.TextMessage;
|
import org.spacehq.mc.protocol.data.message.TextMessage;
|
||||||
import org.spacehq.mc.protocol.data.status.PlayerInfo;
|
import org.spacehq.mc.protocol.data.status.PlayerInfo;
|
||||||
import org.spacehq.mc.protocol.data.status.ServerStatusInfo;
|
import org.spacehq.mc.protocol.data.status.ServerStatusInfo;
|
||||||
|
@ -117,7 +118,7 @@ public class MinecraftProtocolTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBlockBreak() throws IOException {
|
public void testBlockBreak() throws IOException {
|
||||||
BlockChangeRecord record = new BlockChangeRecord(new Position(1, 61, -1), 3, 2);
|
BlockChangeRecord record = new BlockChangeRecord(new Position(1, 61, -1), new BlockState(3, 2));
|
||||||
ServerBlockChangePacket packet = writeAndRead(new ServerBlockChangePacket(record));
|
ServerBlockChangePacket packet = writeAndRead(new ServerBlockChangePacket(record));
|
||||||
|
|
||||||
assertPosition(packet.getRecord().getPosition(), 1, 61, -1);
|
assertPosition(packet.getRecord().getPosition(), 1, 61, -1);
|
||||||
|
|
Loading…
Reference in a new issue