GithubHelp home page GithubHelp logo

Version specific motds about cleanmotd HOT 6 CLOSED

arkflame avatar arkflame commented on August 16, 2024
Version specific motds

from cleanmotd.

Comments (6)

linsaftw avatar linsaftw commented on August 16, 2024

Hi, how do you get the protocol version of a player with ViaVersion api? It seems you need the Player object which you can't get on ping event.

from cleanmotd.

kaxlabs avatar kaxlabs commented on August 16, 2024

For spigot, you can add it to your maven like so:

<repository>
    <id>viaversion-repo</id>
    <url>https://repo.viaversion.com</url>
</repository>

<dependency>
    <groupId>us.myles</groupId>
    <artifactId>viaversion</artifactId>
    <version>2.2.2</version>
    <scope>provided</scope>
</dependency>

and then use it in your code like this:

Player player = // some reference of the player
int protocolVersion = Via.getAPI().getPlayerVersion(player.getUniqueId());

For bungeecord this is not needed, you can just use event.getConnection().getVersion(); from the ProxyPingEvent.

from cleanmotd.

linsaftw avatar linsaftw commented on August 16, 2024

I will try to implement this for BungeeCord. It will not be possible to do in Bukkit as you can't get the "Player" on ServerListPing.

from cleanmotd.

linsaftw avatar linsaftw commented on August 16, 2024

I will try to implement this for BungeeCord. It will not be possible to do in Bukkit as you can't get the "Player" on ServerListPing.

You can do it with ProtocolLib tho... We will probably have an implementation soon :)

from cleanmotd.

linsaftw avatar linsaftw commented on August 16, 2024

Closed with 4f13ced

from cleanmotd.

linsaftw avatar linsaftw commented on August 16, 2024

I had to revert the changes because they broke some stuff and only work on BungeeCord if ViaVersion is installed.

from cleanmotd.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.