Uh oh!
There was an error while loading. Please reload this page.
ViaVersion bridge update - #418
Conversation
| public class ViaVersionBridge extends Bridge { | ||
| public static ViaAPI viaVersionInstance; |
There was a problem hiding this comment.
Is there any reason to keep this here vs just using Via#getAPI? I assume Via#getAPI is already cached and all
| PlayerTag.tagProcessor.registerTag(ElementTag.class, "viaversion_version", (attribute, object) -> { | ||
| int version = ViaVersionBridge.viaVersionInstance.getPlayerVersion(object.getUUID()); | ||
| return new ElementTag(ProtocolVersion.getProtocol(version).getName(), true); | ||
| }); |
There was a problem hiding this comment.
How do these 2 behave with offline players? would probably make sense to make it an online-only tag?
| // @returns ElementTag | ||
| // @plugin Depenizen, ViaVersion | ||
| // @description | ||
| // Returns the version based on the protocol version number of the player's client. |
There was a problem hiding this comment.
Would probably be useful to have a few examples so that you can see what format does it return them in
| // @description | ||
| // Returns the protocol version number of the player's client. | ||
| // See <@link url https://wiki.vg/Protocol_version_numbers> as a reference list. | ||
| // Note: When getting the players protocol, join events may not have the protocol linked with the player in time. It is suggested to delay this check by a few ticks. |
There was a problem hiding this comment.
Have you been able to replicate this in-game? they might be referring to very early connection events and not the regular join event
davight
commented
Aug 23, 2023
fixed |
| public static void register() { | ||
| // <--[tag] | ||
| // @attribute <PlayerTag.viaversion> |
There was a problem hiding this comment.
There's a double space here, that needs to be removed
davight
commented
Aug 26, 2023
oops, fixed |
Changes
ViaVersionPlayerProperties->ViaVersionPlayerExtensionsPlayerTag.viaversiontag ->PlayerTag.viaversion_protocolAdditions
PlayerTag.viaversion_versiontag