mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-21 15:41:38 +01:00
Make tests compile
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
1a606285c0
commit
220217fcc1
@ -1918,7 +1918,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
* @return a {@link PlayerInfoRemovePacket} to remove the player
|
||||
*/
|
||||
protected @NotNull PlayerInfoRemovePacket getRemovePlayerToList() {
|
||||
return new PlayerInfoRemovePacket(List.of(getUuid()));
|
||||
return new PlayerInfoRemovePacket(getUuid());
|
||||
}
|
||||
|
||||
private PlayerInfoUpdatePacket.Entry infoEntry() {
|
||||
|
@ -9,6 +9,10 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public record PlayerInfoRemovePacket(@NotNull List<@NotNull UUID> uuids) implements ServerPacket {
|
||||
public PlayerInfoRemovePacket(@NotNull UUID uuid) {
|
||||
this(List.of(uuid));
|
||||
}
|
||||
|
||||
public PlayerInfoRemovePacket {
|
||||
uuids = List.copyOf(uuids);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import net.minestom.server.coordinate.Vec;
|
||||
import net.minestom.server.entity.EquipmentSlot;
|
||||
import net.minestom.server.entity.GameMode;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import net.minestom.server.entity.PlayerSkin;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import net.minestom.server.item.Material;
|
||||
import net.minestom.server.network.packet.client.ClientPacket;
|
||||
@ -110,18 +111,16 @@ public class PacketWriteReadTest {
|
||||
SERVER_PACKETS.add(new EntityPropertiesPacket(5, List.of()));
|
||||
SERVER_PACKETS.add(new EntityRotationPacket(5, 45f, 45f, false));
|
||||
|
||||
SERVER_PACKETS.add(new PlayerInfoPacket(PlayerInfoPacket.Action.UPDATE_DISPLAY_NAME,
|
||||
new PlayerInfoPacket.UpdateDisplayName(UUID.randomUUID(), COMPONENT)));
|
||||
SERVER_PACKETS.add(new PlayerInfoPacket(PlayerInfoPacket.Action.UPDATE_DISPLAY_NAME,
|
||||
new PlayerInfoPacket.UpdateDisplayName(UUID.randomUUID(), (Component) null)));
|
||||
SERVER_PACKETS.add(new PlayerInfoPacket(PlayerInfoPacket.Action.UPDATE_GAMEMODE,
|
||||
new PlayerInfoPacket.UpdateGameMode(UUID.randomUUID(), GameMode.CREATIVE)));
|
||||
SERVER_PACKETS.add(new PlayerInfoPacket(PlayerInfoPacket.Action.UPDATE_LATENCY,
|
||||
new PlayerInfoPacket.UpdateLatency(UUID.randomUUID(), 5)));
|
||||
SERVER_PACKETS.add(new PlayerInfoPacket(PlayerInfoPacket.Action.ADD_PLAYER,
|
||||
new PlayerInfoPacket.AddPlayer(UUID.randomUUID(), "TheMode911",
|
||||
List.of(new PlayerInfoPacket.AddPlayer.Property("name", "value")), GameMode.CREATIVE, 5, COMPONENT, null)));
|
||||
SERVER_PACKETS.add(new PlayerInfoPacket(PlayerInfoPacket.Action.REMOVE_PLAYER, new PlayerInfoPacket.RemovePlayer(UUID.randomUUID())));
|
||||
final PlayerSkin skin = new PlayerSkin("hh", "hh");
|
||||
List<PlayerInfoUpdatePacket.Property> prop = List.of(new PlayerInfoUpdatePacket.Property("textures", skin.textures(), skin.signature()));
|
||||
var entry = new PlayerInfoUpdatePacket.Entry(UUID.randomUUID(), "TheMode911", prop,
|
||||
true, 5, GameMode.CREATIVE, Component.text("display"));
|
||||
|
||||
SERVER_PACKETS.add(new PlayerInfoUpdatePacket(PlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, entry));
|
||||
SERVER_PACKETS.add(new PlayerInfoUpdatePacket(PlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, entry));
|
||||
SERVER_PACKETS.add(new PlayerInfoUpdatePacket(PlayerInfoUpdatePacket.Action.UPDATE_LATENCY, entry));
|
||||
SERVER_PACKETS.add(new PlayerInfoUpdatePacket(PlayerInfoUpdatePacket.Action.UPDATE_LISTED, entry));
|
||||
SERVER_PACKETS.add(new PlayerInfoRemovePacket(UUID.randomUUID()));
|
||||
|
||||
//SERVER_PACKETS.add(new MultiBlockChangePacket(5,5,5,true, new long[]{0,5,543534,1321}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user