ProtocolLib

3M Downloads

[1.17.1] Could not find packet for type WORLD_BORDER

Drc-DEV opened this issue ยท 1 comments

commented

Describe the bug
java.lang.IllegalArgumentException: Could not find packet for type WORLD_BORDER
at com.comphenix.protocol.injector.packet.PacketRegistry.lambda$getPacketClassFromType$0(PacketRegistry.java:379) ~[ProtocolLib-531.jar:?]

To Reproduce

    public static void sendWorldBorderPacket(Player player, int dist, double oldRadius, double newRadius, long delay) {
        PacketContainer container = new PacketContainer(PacketType.Play.Server.WORLD_BORDER);
        container.getWorldBorderActions().write(0, EnumWrappers.WorldBorderAction.INITIALIZE);
        container.getIntegers().write(0, 29999984); 
        container.getDoubles().write(0, player.getLocation().getX());
        container.getDoubles().write(1, player.getLocation().getZ());
        container.getDoubles().write(2, oldRadius);
        container.getDoubles().write(3, newRadius);
        container.getIntegers().write(1,0);
        container.getIntegers().write(2, dist);
        container.getLongs().write(0, delay);
        getProtocolManager().sendServerPacket(player, container);
    }

Expected behavior
The packet for initializing world border changed in 1.17. The packet name appears now to be "ClientboundInitializeBorderPacket" in 1.17

Version Info
ProtocolLib Version: ProtocolLib v4.7.1-SNAPSHOT-b531
Bukkit Version: 1.17.1-R0.1-SNAPSHOT
Server Version: git-Paper-263 (MC: 1.17.1)
Java Version: 16.0.2

commented

Should have used INITIALIZE_BORDER