How to use a Wrapper ? (ProtocolLib)

Discussion in 'Spigot Plugin Development' started by Lxct, Nov 10, 2018.

  1. Hi. I need to get the render distance of a player in his settings. This is how i do it :

    Code (Text):
        public void run() {
            WrapperPlayClientSettings viewDistanceWrapper = new WrapperPlayClientSettings();
            viewDistanceWrapper.receivePacket(player);
            Variable.tmpClientViewDistance = viewDistanceWrapper.getViewDistance();
        }
    It doesn't give me any errors, but it doesn't store the view distance inside the "Variable.tmpClientViewDistance".
    Can someone tell me where I made an error, or what i should do ?

    WrapperPlayClientSettings can be found here, and here.
     
  2. Bump. It return 0 inside tmpClientViewDistance
     

Share This Page