Skip to content

Commit 1375dec

Browse files
committed
fix test
1 parent cfc4516 commit 1375dec

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/test/java/net/dmulloy2/protocol/wrappers/game/serverbound/WrappedServerboundPlayerCommandPacketTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.comphenix.protocol.PacketType;
55
import com.comphenix.protocol.events.PacketContainer;
66
import com.comphenix.protocol.wrappers.EnumWrappers;
7+
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
78
import org.junit.jupiter.api.BeforeAll;
89
import org.junit.jupiter.api.Test;
910

@@ -21,40 +22,40 @@ void testCreate() {
2122
// NMS constructor takes Entity; use wrapper-based approach
2223
WrappedServerboundPlayerCommandPacket w = new WrappedServerboundPlayerCommandPacket();
2324
w.setEntityId(10);
24-
w.setAction(EnumWrappers.PlayerAction.START_SNEAKING);
25+
w.setAction(EnumWrappers.PlayerAction.START_SPRINTING);
2526
w.setData(0);
2627

2728
assertEquals(PacketType.Play.Client.ENTITY_ACTION, w.getHandle().getType());
2829
assertEquals(10, w.getEntityId());
29-
assertEquals(EnumWrappers.PlayerAction.START_SNEAKING, w.getAction());
30+
assertEquals(EnumWrappers.PlayerAction.START_SPRINTING, w.getAction());
3031
assertEquals(0, w.getData());
3132
}
3233

3334
@Test
3435
void testReadFromExistingPacket() {
3536
WrappedServerboundPlayerCommandPacket src = new WrappedServerboundPlayerCommandPacket();
3637
src.setEntityId(15);
37-
src.setAction(EnumWrappers.PlayerAction.START_SPRINTING);
38+
src.setAction(EnumWrappers.PlayerAction.STOP_SPRINTING);
3839
src.setData(0);
3940

4041
WrappedServerboundPlayerCommandPacket wrapper = new WrappedServerboundPlayerCommandPacket(src.getHandle());
4142

4243
assertEquals(15, wrapper.getEntityId());
43-
assertEquals(EnumWrappers.PlayerAction.START_SPRINTING, wrapper.getAction());
44+
assertEquals(EnumWrappers.PlayerAction.STOP_SPRINTING, wrapper.getAction());
4445
assertEquals(0, wrapper.getData());
4546
}
4647

4748
@Test
4849
void testModifyExistingPacket() {
4950
WrappedServerboundPlayerCommandPacket w = new WrappedServerboundPlayerCommandPacket();
5051
w.setEntityId(5);
51-
w.setAction(EnumWrappers.PlayerAction.START_SNEAKING);
52+
w.setAction(EnumWrappers.PlayerAction.START_RIDING_JUMP);
5253
w.setData(0);
5354

54-
w.setAction(EnumWrappers.PlayerAction.STOP_SNEAKING);
55+
w.setAction(EnumWrappers.PlayerAction.STOP_RIDING_JUMP);
5556

5657
assertEquals(5, w.getEntityId());
57-
assertEquals(EnumWrappers.PlayerAction.STOP_SNEAKING, w.getAction());
58+
assertEquals(EnumWrappers.PlayerAction.STOP_RIDING_JUMP, w.getAction());
5859
}
5960

6061
@Test

0 commit comments

Comments
 (0)