#velocity-dev

164 messages · Page 5 of 1

burnt dragon
#

although, i don't think velocity supports sending even named sounds tbh

dreamy kite
#

where i can modify the velocity language message?

bold wharf
#

at this moment, modifying the jar is the only supported way

#

can extract the locale file and place it back in

dreamy kite
#

the file location?

bold wharf
#

don't remember, see the search 🤷‍♂️

dreamy kite
#

:/

bronze yoke
#

com/velocitypowered/proxy/l10n/

inner skiff
#

i'm having a kinda of an weird issue where the first item of the message is not colored

#

all the rest of the message is normal

#

except for this first [

#

and it makes no sense for my why

burnt dragon
#

.style sets the entire style of the component

#

as you've created a style that just contains bold text, the colour will not exist in that style

inner skiff
#

so i should put a .color after?

#

the .style?

burnt dragon
#

just do Component.text("hi", NamedTextColor.RED, TextDecoration.BOLD)

vestal prawn
#

is there a documentation on how to use Configurate ?

#

found, i let it here for those who wonders

patent portal
ashen fiber
#

¯_(ツ)_/¯

#

I have no idea.

#

I have ran into this before with a different event.

#

I never found a solution.

patent portal
fossil sundial
patent portal
#

is this not the log4j one?

ashen fiber
#

org.slf4j.Logger is definitely the one you are meant to use.

fossil sundial
#

Alright my bad

#

But I’m surprised nonetheless

patent portal
#

i'm just confused lol

ashen fiber
#

@patent portal I suspect something wen't wrong when building your plugin, have you tried a clean build?

patent portal
#

if what you're referring to is ./gradlew clean build, then it still yeilds the same results

ashen fiber
#

Hmmm

#

Ya then I have no idea.

#

¯_(ツ)_/¯

patent portal
#

ok i fixed it

#

i'd forgotten to add that org.xyz.something folder structure to my src, and thus the files were at the root of the jar
i'm no java wizard but for some reason that fixed it

twilit timber
patent portal
dreamy kite
#

where i can download velocity 3.1.2

#

i had problem with authme velocity

worldly torrent
#

Heya
Interesting query for anyone familiar with Velocity internals

A little while ago I ported the FakeProtocol plugin to Velocity so I could do a network migration from bungee to velocity because... well velocity 🙂

Everything in principle operates fine. I can define my list of allowed protocols. If the client is unsupported, I can display my custom message showing what versions our network supports. Happy days.

However. If the client is using an allowed version. They can connect OK. And they see the player count format expected and stuff. But the ping status shows incompatible version (as per the attached screenshot). Has anyone got any thoughts on this? I can't make sense of it for the life of me!

#

Actually
Ignore this completely!
As soon as I posted this I had another thought of where the issue lies and it turns out the bug is with ServerListPlus - not my port of FakeProtocol. I'll direct the query their way.

hollow merlin
#

Is there any possibility to fork Velocity like one can fork paper or waterfall?

proper steeple
#

Yes

hollow merlin
#

Is there any documentation on this topic or maybe even an example?

agile ore
#

hi it tells me this velocity error when i run a command how can i fix it?

proper steeple
#

No need to cross post

agile ore
#

ah ok

agile ore
proper steeple
#

By not crossposting and patiently waiting for a reply, by providing the most information possible.

agile ore
#

ok sorry i tagged you but it's an urgent problem

proper steeple
#

That doesn't change anything

agile ore
#

ok

hollow merlin
fossil sundial
light tendon
#

I want to send a player message containing a link, but it doesn't seem to be clickable

#

anyone can help me?

fossil sundial
real kelp
#

right now i have a network library that hooks into paper plugins on my subservers and automatically loads and saves data from MongoDB. the issue i am currently having is figuring out how to update this data when someone does /link (from a velocity plugin). would redis be the best way to do this?

Also, would it be better to just cache playerdata on the velocity plugin and put it in the redis database, so that when a player joins a subserver i dont have to query mongodb but rather redis? not sure what is best for data synchronization

worldly torrent
valid bone
#

How would I go about getting the ip address the player is using, when connecting to the proxy server? I know I need to listen on the server ping event, and I believe I need to use the getConnection method on the event. But I'm unsure how Velocity passes the IP from there.

ashen fiber
#

InboundConnection.getRemoteAddress()

#

Please check the javadocs in future.

#

@valid bone

warm gulch
#

maybe they want getVirtualHost, unclear wording

ashen fiber
#

maybe?

valid bone
#

I want the forced hosted ip

ashen fiber
#

What do you mean by that?

valid bone
#

I would say it's the getVirtualHost method, but the InetSocketAddress class link returns a 404.

valid bone
valid bone
#

I'll check it out. Thank you.

neon shuttle
neon shuttle
#

it can be null, but I don't under which circumstances it could be

valid bone
#

I'll keep an eye out for that. Thank you for the heads up.

real kelp
ashen fiber
real kelp
ashen fiber
#

Use Plugin Messaging Channels

ashen pawn
#

yes, all commands are executed asynchronously

latent coyote
#

Is the velocity still updating ? Because I didn't see any new commit since a long time

coarse topaz
#

Yes it is

latent coyote
#

Ok, and is there a branch of somethings else to know the development status ?

coarse topaz
#

There are a few PR's open that will likely be merged in the future. Tux, the primary author of Velocity has a full-time job, and is very limited on how much he can contribute

latent coyote
#

ok thanks 🙂

latent coyote
#

is there a way to disable velocity tablist overriding ? I'm trying to send tab from server, but doesn't work on velocity

coarse topaz
#

I know this was brought up before, but I would like to get some opinions on adding a trailing comma to the versions in ProtocolVersion, the only benefit of this is to not override git commit history

valid gazelle
#

i always use trailinmg commas in programming because of that

oblique haven
coarse topaz
#

With how it is currently setup, the last version enum has a ";". With that, every time a new version is added the version before it has a new commit message

#

for example, this is the current way we do it:

#

Do note, my commit message has changed the message for MINECRAFT_1_18

#

this is what I am proposing

valid gazelle
#

yeah

maiden hawk
#

So, I cloned Velocity and needed to edit log4j2.xml, however now Gradle refuses to build. Is configuration editing forbidden?

thick bramble
#

no, but you don't need to edit velocity directly to do that. you can specify a custom log4j config file by starting velocity with -Dlog4j2.configurationFile=file.xml before -jar.

maiden hawk
#

So this is intentional.

bronze yoke
#

why not contribute

maiden hawk
bronze yoke
#

ah alright

maiden hawk
#

However I want it to build first before contributing

#

(Which kinda makes sense)

thick bramble
#

yeah of course, I am not familiar with velocity, but my guess on your issue is that you accidentally edited the license header at the top of the file which it checks on build

maiden hawk
glacial kraken
#

Bungee plugin messages (especially the one to move player to another server) work on velocity too? Or there are changes

rich hawk
#

They work

maiden hawk
brisk mortar
#

Can I open a Inventory through velocity

ashen fiber
#

Velocity can not access information about the servers state*

brisk mortar
#

That means i can not?

glacial kraken
#

Exactly

#

You cant

#

But depends on what you want

#

You can manage to open inventory gui

brisk mortar
#

But not listen to a click? Or what you mean

maiden hawk
round quiver
#

Hey, a quick question, does Velocity have a broadcast method? (I can't find one)

burnt dragon
#

Anything that is an Audience has sendMessage methods - this includes ProxyServer and RegisteredServer, etc

round quiver
#

So f.e. ProxServer#sendMessage sends to all connected players, and RegisteredServer#sendMessage to all players on that server?

burnt dragon
#

yes

round quiver
#

thx

obtuse locust
#

what event is handled when spigot server shuts down and kicks players? And can I move players to another spigot server?

burnt dragon
#

the disconnect event is fired

#

er, or is it the kick event

maiden hawk
#

Tho it would need some more testing to prove.

burnt dragon
maiden hawk
#

Just saying, that whether disconnect or kick event will fire may vary on the server you are using.

reef jacinth
#

That wasn't meant for you, the question that was responded to was deleted.

maiden hawk
bold wharf
#

paper kicks players too

#

all of them do, it's literally a vanilla thing

#

big thing is gonna be the order of which stuff occurs

#

I have a feeling that purpur fucked with that one

maiden hawk
#

On all server's except Purpur I just received a general disconnect.

bold wharf
#

don't mention

maiden hawk
#

oh ok

bold wharf
#

player are kicked late in the process

#

so, you're not gonna even get an event fired because your plugin is disabled before then

#

iirc, purpur messed with the order so that the events are fired or something

#

but, I don't really care to track what they do, I just remember there being some complaints around that

maiden hawk
#

So if you have a velocity plugin, it is still going to be enabled when players get kicked from those servers WeSmart

amber ridge
#

Hi, where do i find list of all events and description of it?

rich hawk
#

channel topic

amber ridge
#

Um, okay but i need help which event is called when player just disconnect from proxy, not get kicked

bold wharf
#

the connection closing is the connection closing

burnt dragon
#

that's the cleverly and aptly named "disconnect event"

brisk mortar
#

Hello! I want to create a Velocity Plugin with Kotlin. But, I have following error: ```com.velocitypowered.api.plugin.InvalidPluginException: Did not find a valid velocity-plugin.json.
at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.loadCandidate(JavaPluginLoader.java:64) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:92) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:324) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:222) ~[velocity.jar:3.1.1]
at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity.jar:3.1.1]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at de.dytanic.cloudnet.wrapper.Wrapper.lambda$startApplication$5(Wrapper.java:487) ~[wrapper.jar:3.4.3-RELEASE-cca9610]
at java.lang.Thread.run(Thread.java:833) [?:?]

bold wharf
#

you need to use kapt to run the annotation processor, iirc

brisk mortar
#

how?

bold wharf
#

idr

brisk mortar
#

um, sorry but I don't understand?

bold wharf
#

I don't remember

brisk mortar
#

ah sorry

#

hm

brisk mortar
burnt dragon
#

kapt processor

tawdry sky
#

Where in velocity's code are the log files?

#

need to make some edits to how velocity logs things for my server but can't find it

#

I need to remove the player IP from logs

tawdry sky
oblique haven
#

or this

tawdry sky
#

this should hopefully work

oblique haven
#

that has no context so

#

maybe, maybe not

tawdry sky
#

playerIp string

oblique haven
#

0,0 oh

#

okay

#

that's definitely the wrong way to go about things, but... okei

tawdry sky
#

would it break something else

#

?

oblique haven
#

I mean, it's just a very bad way to solve the issue, you can just replace IPs in the filter

tawdry sky
#

and how exactly would I do that? I don't know this log4j stuff

oblique haven
#

or match whatever thing you want

oblique haven
#

in the log4j configuration file, one is already provided by velocity, and since you have the source open it's in one of the resources folders, you just have to look for it

tawdry sky
#

ty

oblique haven
#

yep

#

can also use -Dlog4j2.configurationFile=file://file/path/log4j2.xml sys property

tawdry sky
#

tried it to no success

oblique haven
oblique haven
#

just use the sys property

#

java -Dlog4j2.configurationFile=/home/fixed/server/log4j2.xml -jar server.jar

#

there's some example usage

tawdry sky
tawdry sky
#

only takes one person to fuck up

#

GDPR is not a fun thing

oblique haven
tawdry sky
oblique haven
# tawdry sky

Don’t modify the source of the proxy, that’s such a bad idea

oblique haven
# tawdry sky why?

It forces you to constantly maintain the fork rather than taking a non intrusive approach

oblique haven
#

And pre main set the sys property

oblique haven
tawdry sky
oblique haven
tawdry sky
oblique haven
tawdry sky
oblique haven
#

Read the documentation for log4j

#

I’m not gonna write your config for you

#

Use the PatternLayout and use %replace to match IPs, I gave you a resource for regex matching IPs earlier

hidden breach
#

How can I get the plugin config in Velocity from a plugin?

worn pond
#

Hey, I have a small issue with Velocity.
How can I redirect a player when a server went down ? According to velocity's java doc, It should be done when the KickedFromServerEvent is fired and then I should use KickedFromServerEvent.RedirectPlayer to redirect player to another server but it doesn't works for me. Player is kicked from the proxy with "Disconnected" message.
Here is what I use to do that :

KickedFromServerEvent.RedirectPlayer.create(foundServer());

foundServer() is a private method aims to found a available server, it's return a RegisteredServer object
I've also tried to done that redirection with the following code :

player.createConnectionRequest(foundServer()).fireAndForget();

Thanks for your help.

burnt dragon
#

redirect player is definitely the correct thing to use

#

are you sure you're setting it correctly?

worn pond
#

I found my mistake : I did not use the event.setResult(), I thought that what I wrote above was correct but not.
The correct way to do that is :

event.setResult(KickedFromServerEvent.RedirectPlayer.create(registeredServer));
craggy pecan
amber ridge
#

How do i send player to server X in paper plugin?

bold wharf
#

use the bungee messaging channel

#

see the spigot wiki

amber ridge
#

Okay, thanks

#

I found this
server.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); but i didnt know if i have to change Bungee to Velo

bold wharf
#

No need to change anything, it works the exact same, otherwise having it built into velocity would be somewhat pointless

amber ridge
#

Hm i got a little problem, i have

Player player = playerAll.get(0);
player.sendPluginMessage((Plugin) this, "BungeeCord", out.toByteArray());```, intellij marks me `(Plugin) this` but i dont know how to fix it, my error
```java.lang.ClassCastException: class pl.siecmc.siecmcqueue.SiecMCQueue$1 cannot be cast to class org.bukkit.plugin.Plugin (pl.siecmc.siecmcqueue.SiecMCQueue$1 is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @28#0703af815b; org.bukkit.plugin.Plugin is in unnamed module of loader 'app')```
bold wharf
#

wrong channel

#

it wants the Plugin instance, you can't cast random things to random things and expect it to work

dusty mesa
#

Is there an easy way to create a new @Inject instance?

#

Or I would have to use the guava injection stuff?

vapid prawn
#

Hi how can I get the absolute path of the plugins folder?

gritty valve
#

Hey guys, how can I kick by ip in the event.connection.ConnectionHandshakeEvent?
The player object has not been created yet

bold wharf
#

See the javadocs...

#

if you look at that event class on the JDs it'll basically spell it out

agile ore
#

hello do you know how to solve this error when i try to connect tell me this how i can solve i await answer thanks: 0
[19:56:41 ERROR]: [connected player] MrRaffus_ (/(IP) ): unable to connect to server lobby-1 com.velocitypowered.proxy.util.except.QuietRuntimeException: The connection to the remote server was unexpectedly closed. This is usually because the remote server does not have BungeeCord IP forwarding correctly enabled. See https://velocitypowered.com/wiki/users/forwarding/ for instructions on how to configure player info forwarding correctly.

bronze yoke
#

it basically tells you what's wrong

gray hedge
#

How do I load a plugin runtime?

coarse topaz
#

You don't load a plugin after Velocity is already running

#

The plugin should be loaded during startup

gray hedge
#

Yea well what I have is a jar loader which downloads the jar at runtime and loads

#

And one solution would be to just include in the class path and load it, but that is not an option since that would have breaking changes

#

I guess I'd have to use some reflection magic

warm thistle
#

hi

bold wharf
#

the docs site includes information on porting

warm thistle
bold wharf
#

don't mention

#

are you a dev?

warm thistle
warm thistle
bold wharf
#

no

warm thistle
bold wharf
#

Stop mentioning me

#

This isn't the place for solicitation

warm thistle
bold wharf
#

seriously.

warm thistle
#

it is out of habit

outer flower
#

So I've got a ticket management plugin that I'm looking to make work with Velocity. Would it be better to make a Velocity-specific plugin that gets placed only on the Velocity server, or should I make the individual Paper plugins communicate with each other? Not sure how it all works and what is/isn't possible

bold wharf
#

depends on needs

#

if it's just using commands/chat, etc, no reason it has to be on the server

outer flower
#

Yeah, it's purely through commands and chat

#

Awesome, thank you!

oblique haven
bold wharf
#

something like that would be trivial to abstract out into being able to run it in multiple environments

outer flower
#

Weird question, but is there a way to asynchronously send out a channel message and wait for a response inside the same function? Trying to grab permission groups for particular users, and I was going to delegate that to some plugin on the individual server

half locust
#

Luckperms-velocity + LP api

outer flower
#

Yeahhh, that's the first thing that came to mind. I was just trying to not rely on a particular permission system

#

Sounds like the only practical route though

bold wharf
#

I mean, it pretty much is outside of sync calls off main and praying that the perm plugin deals with that properly (and, many just don't)

#

theres no built-in way to wait for a response to a plugin message, you'd basically need to do that yourself and implement the entire layer yourself

craggy pecan
#
gray hedge
#

Can anyone explain this?

#

Found the issue

royal pulsar
#

There's no way to mess with arbitrary packets being sent, right?

#

Only chat and plugin messages?

oblique haven
#

Also C2S or S2C, they both have different specs for what’s even decoded

royal pulsar
#

S2C, trying to replace colors in chat, books, signs (obviously all three of those work differently and I'm aware of that, I've just never used Velocity before)

#

Honestly, what I'm doing might be out of scope for Velocity now that I look at it more

#

All I want to do is intercept chat messages, items being put in slots (so I can intercept book text), and block entity data being sent

#

Protocolize might be able to pull it off, actually

oblique haven
#

is there any reason you're not doing this on the server?

#

like is there a specific reason for it to be going on the proxy? The server can handle it in a much better way

royal pulsar
#

Sponge doesn't really make it easy to do this either, honestly, just because of how its API is

oblique haven
royal pulsar
#

Ideally this would just be a client mod, honestly

oblique haven
#

the issue is the proxy needs to take care of 1.7~1.18.1, that's quite a lot of versions - the less packets it has to take care of the better

#

and that's true for any proxy

royal pulsar
#

That's fair

oblique haven
#

the server has to take care of all of em

#

so they're already in their raw form when you need to intervene

#

intervening before they get dumped into bytes and sent into those channels is probably the best way to go about it

#

creates the least amount of strain on the system since you're not doing a bunch of translations to get there

#

or put it on the client - that's always a good way to go

royal pulsar
#

Yeah, that'd be ideal, I was just trying to avoid Mixin hell, but if it's not gonna work well on the proxy, I'll go back to trying to do it on the server. Thanks for the advice on that!

outer flower
#

Anyone familiar with using Luckperms with Velocity?

valid gazelle
#

yes

outer flower
#

Is there a way to (a) get the roles on a particular server, and (b) check a user's permission for a particular server? The server in question is the server the player is actively on

#

Not sure if when you check a player's permissions it checks for the server they're actively on or not. The lp documentation seems to be written mostly under the impression that it's operating on a single server

#

That and I'm also rather unfamiliar with the LP api. Read the documentation, but it feels more oriented towards single-server stuff

last cliff
#

configure luckperms to sync its data
https://luckperms.net/wiki/Syncing-data-between-servers

#

then use context

obtuse lintel
#

I don't suppose there's any documentation relating to manipulating the tab list with Velocity?

bold wharf
#

given that theres no scoreboard API, yet; etc

rancid crypt
#

If i want to use a plugin in all other servers. It's good if i develop one plugin in bungeecord ? or i can add one by one plugin in all servers ?

bold wharf
#

This is the channel for velocity, not bungee; and it depends, if you can do everything on the proxy that generally makes a good chunk of sense but that's not always possible or sometimes it's just easier/more viable to be on all the servers

rancid crypt
#

Sorry, i think the problem can transform for velocity too

#

Ok thank you ^^

topaz geyser
oblique haven
#

You can’t just cast it

topaz geyser
#

Thank you! I'll try that

maiden hawk
#

So, can I integrate Spring into my Velocity plugin?

topaz geyser
#

no errors

#

plugin is registered too

oblique haven
#

Like the whole file

#

Not just a snippet

turbid jay
#

Hey. Is it possible for a velocity plugin to read the hostname that the user uses to connect to the server?

round quiver
#

Hey, a questions, is there a way in velocity to do sth. like sending a PacketPlayOutCustomPayload to send the player some message over PluginMessaging?

civic tiger
#

Hey, how can you enter something in a config in a Velocity plugin and read it out?

coarse topaz
worthy smelt
#

Does Velocity support 1.18?

half locust
#

yes

nova sparrow
#

I love velocity!

#

🤤

opaque escarp
#

Is there a possibility to integrate Configurate 4 into Velocity and deprecate the use of Configurate 3 as happened with text and adventure in Velocity 1.1.x?

wary tiger
#

It's entirely possible to shade the configuration library you want to use into your plugin. There's very little downside.

valid gazelle
#

this has to be something obvious, but i'm trying to build velocity with ./gradlew build but the file build/libs/velocity-3.1.2-SNAPSHOT.jar is 261 bytes, with only a META-INF/MANIFEST.MF file in it and that's it

thick bramble
#

go in proxy/build/libs

oblique haven
valid gazelle
#

oh

#

oops

oblique haven
valid gazelle
#

yep that one works

oblique haven
opaque escarp
steel dagger
#

https://bin.birdflop.com/uvudamenug.xml
I have no idea what the issue is but im getting this error
Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project VelocityJoinLeaveMessages: Error creating shaded jar: null

bold wharf
#

update maven shade 🤷‍♂️

#

otherwise, can't really say as there ain't too much info there

steel dagger
#

anyone know a tutorial on making a config for a velocity plugin idk how toml works

oblique haven
steel dagger
#

how could i in yml then since i know the way i do for spigot plugins won’t work sine it uses bukkit api

oblique haven
wind pebble
#

Hi!
How can i dispatch command in console from code?

native oasis
#

Hey, I was wondering if it is possible to send data between servers, for example: A request Velocity -> PaperMC and PaperMC -> Velocity

rich hawk
#

plugin messaging

native oasis
#

That helps alot!

craggy pecan
native oasis
#

Is there a way to get all network servers?

dusty mesa
elfin snow
#

Anyone know which event I have to use to change which server the player connects to? seems like PostLoginEvent or LoginEvent doesn't have a .setTarget method or something

#

or should I use LoginEvent and run
event.getPlayer().createConnectionRequest(someserver).connect()

burnt dragon
#

choose initial server event

elfin snow
#

Thanks!

steady trellis
#

i havent touched velocity for like a year, is there any documentation on the config api?

steady trellis
#

gracias

#

oh no

#

it's still configurate

oblique haven
#

feel free to use your own

#

I think snakeyaml is open sourced and publicly available

#

so is Jackson, gson, etc...

steady trellis
#

do people use configurate like

#

commonly

oblique haven
#

not sure, I use jackson or gson

#

jackson yaml is pretty solid if you want yaml configurations, I prefer json personally

#
        VelocityConfiguration configuration;
        try (BufferedReader reader = Files.newBufferedReader(configurationPath)) {
            configuration = new Yaml(
              new CustomClassLoaderConstructor(VelocityPlugin.class.getClassLoader())
            ).loadAs(reader, VelocityConfiguration.class);
        } catch (IOException | YAMLException exception) {
            JsonLogger.error("Error loading configuration: ", exception);
            this.server.shutdown(Component.text("Failed configuration load."));
            return;
        }``` this is what we use in production actually
#

idk if this is standard or the recommended way but shrug it's not bad

steady trellis
#

legacy ip forwarding doesn't support the velocity in paper.yml does it?

oblique haven
steady trellis
#

gotcha

steady trellis
#

is there a method that gets u the main container or the data folder

oblique haven
#

Yep

#

Look at the “getting started” page of the documentation section of the website

#

I think

steady trellis
#

there it is

#

xD

oblique haven
#

Yee

steady trellis
#

thank u :d

oblique haven
#

No problem

steady trellis
#

there's no toml configuration loader?

bold wharf
#

Well, the library is there, at least some aspect of it

#

configurate exists

coarse topaz
#

Configurate is really good tbf

steady trellis
#

configurate is built in right because fixed did say it's bundled

bold wharf
#

yes

steady trellis
#

epic

oblique haven
#

But you don’t have to use it if you don’t want to

#

It just decreases final jar size - but if you don’t care about storage or this is personal it really doesn’t matter

#

There’s a few good toml loaders out there

#

If you want a reference on how to use configurate for toml, velocity is open sourced so you can see how it does it

steady trellis
#

ahh alright epic, i may just stick to yaml for rn 😅

#

doesnt velocity have like annotations for keys or am i thinking of something else

#

"Expose"

steady trellis
#

how do yu determine whether a server is online with RegisteredServer#ping

#

if throwable is not null then server is offline? else its online?

pastel bone
#

is there a TabCompleteEvent alternative to use on 1.12.2 and above?

craggy pecan
#

No, the client now handles suggestions mostly on its own

#

Use the appropriate methods on Command or add a suggestion provider to Brigadier nodes

pastel bone
#

Okay Thank you

tawny hollow
#

Velocity works on 1.18.1?

oblique haven
limpid void
#

where download dev velocity?

oblique haven
#

I think velocity has a ci you can download it from, or you can just build it yourself

oblique haven
steady trellis
#

how do you make a command source run a command?

#

found it

#

its CommandManager#executeAsync right

#

is it possible to edit single strings in a component? i.e. i have a placeholder in a string and i want to replace that string with a clickevent

#

for example someone inputs in a config file

format: {back} Test {forward}```
I could do a component and replace back and forward with their specific characters and click events?
#

oh it's replaceText i think

burnt dragon
#

yup, that's the set of methods to use

#

note that you're better off just doing the placeholders before you have a component with a tool like minimessage

steady trellis
burnt dragon
#

yup

atomic leafBOT
steady trellis
waxen mirage
#

Hello, is there any equivalent to ```java
|ChatColor.translateAlternateColorCodes('&', SomeString);

bold wharf
#

use the legacy component serialiser

limpid void
#

after I collected

rich hawk
#

proxy/build/libs

limpid void
bold wharf
#

I mean

#

I'd guess whichever jar file is bigger

steady trellis
#

i am assuming the legacy component serializer wont work for hex colors

#

since its legacy

bold wharf
#

it does given spigot shoe horned that crap in

steady trellis
#

ahhh alright thank you

steady trellis
#

is there an event that gets the player on login without sending the login message

#

so i can check for perms

#

i think its chooseinitialserverevent i hope

verbal tartan
#

is there not a change server event?

valid gazelle
#

the way i did it in my plugin was using ServerConnectedEvent, and then checking event.getPreviousServer() which is an Optional<RegisteredServer>

verbal tartan
#

also what is an Optional?

#

Can I get it to return the server name

#

nvm I can just getcurrent server

#

but also returns an Optional

valid gazelle
#

look up how to use Optional in java for more info, but you can use .isPresent() and .isEmpty() to check if it has a value, and then after checking that, you can use .get() to get the actual value

verbal tartan
valid gazelle
#

it returns an Optional<RegisteredServer>, so after checking if it has a value, then using .get() would give you a RegisteredServer

valid gazelle
verbal tartan
#

I see

#

thanks

steady trellis
#

ahh alright ty all :d

#

how do you use RegisteredServer.ping() properly? is it .whenComplete?

bold wharf
#

well, that's one way

#

suggest reading up on Futures

steady trellis
# bold wharf well, that's one way

i've been looking into it but i cant figure out how to properly loop through multiple server pings because im trying to make a /glist command that shows whether a server is online or offline as well

#

serverping just tells me if its off or on but the registeredserver gives me the server information

analog dew
#

Pings are not synchronous, it takes time for Velocity to ping a server

#

Most likely you want to get info for each server from RegisteredServer, ping all the servers then wait for responses to all those pings

bold wharf
#

just create a list of futures or something, think there is even a Future util which will let you wait until you have a list of them completed

maiden hawk
#

So when I annotate my class with @Plugin, fill in the info package and then open the jar in zip viewer,
velocity-plugin.json appears out of nowhere with the info from the annotation.
This seems very interesting, how does it work?

rich hawk
#

annotation processor

maiden hawk
#

but for that, I would need to have some kind of velocity plugin installed when building right?

rich hawk
maiden hawk
#

thanks, gonna look into it, seems very interesting

rich hawk
#

It’s the annotationProcessor dep

maiden hawk
#

So that just get's called by my build system automatically at compile time?

rich hawk
#

you add the api as compileOnly and annotationProcessor

#

Yes

maiden hawk
#

hmm

#

thanks

rich hawk
half locust
#

looks like someone is setting off a code reformat on the entire bloody project..?

elfin snow
#

anyone knows how to load an integer from a yaml file? (YAMLConfigurationLoader)
rootNode.getNode("redis.port").getValue(new TypeToken<>() {}),
Doesn't seem to work

rich hawk
#

@agile ore

agile ore
#

im doing that accidentally

#

sorry, i forgot the compare thing

steady trellis
steady trellis
elfin snow
#
[19:17:57 ERROR]: Couldn't pass ProxyInitializeEvent to serverstatus
com.zercraft.server_status.internal.redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
Caused by: java.net.UnknownHostException: {redis={ip=127.0.0.1, port=6379, password=somelongpassword}}
        at sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) ~[?:?]

Any idea what's happening here? redis isn't able to connect and the host format looks kinda weird but idk, worked fine on bungee but fails on velocity

bold wharf
#

UnknownHostException

rich hawk
#

pterodactyl?

bold wharf
#

eeeerrrrr

rich hawk
#

make sure that the Redis server is up & firewall etc

elfin snow
# bold wharf > UnknownHostException

Yeah I know, but using 127.0.0.1 or the actual ip fails, worked fine on bungee and same config works fine on paper servers running on the same machine

elfin snow
bold wharf
#

I mean

#

I can't tell you WHY you got that exception

#

but

#

you got that exception

elfin snow
#

Yeah I get you 😅 I'm just confused as everything seems fine, service is up, everything else can contact it fine, can telnet on it,

[19:17:57 INFO]: Listening on /[0:0:0:0:0:0:0:0%0]:25565
not sure if that's normal but guess that's just the ipv6 showing,

also have never seen an UnknownHostException with the message formatted like that, "{redis{ip= etc.."

bold wharf
#

well, I mean

#

it shouldn't be

#

that suggests that something passed in the redis instance or something, but 🤷‍♂️

elfin snow
#

yeah, wonder if it parsed the host wrongly or something

rich hawk
#

does your Redis instance have ipv6 enabled?

elfin snow
#

should be, config says:

The server only accepts connections from clients connecting from the

IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain

sockets.

rich hawk
#

what do you have it set to?

elfin snow
#

Found the issue, was using

rootNode.getString("redis.ip")

instead of

rootNode.getNode("redis").getNode("ip").getString();

🙃

maiden hawk
valid gazelle
#

speaking of that someone should do that, looking at !something.isPresent() annoys me

#

hehe

pastel bone
#

Is it possible to Register Brigadier Commands on runtime or do i HAVE to register them on initialization

#

It seems like my command just wont register...

#
@EventHandler
  public void onPrexorCommandRegister(CommandRegisterEvent event) {
    CommandInstance instance = event.getInstance();

    LiteralArgumentBuilder<CommandSource> parent = LiteralArgumentBuilder.literal(
        instance.getLabel());

    if (instance.hasChildren()) {
      instance.getChildrens().forEach(children -> {
        String label = children.getLabel();
        parent.then(LiteralArgumentBuilder.literal(label));
      });
    }

    PrexorProxy.getInstance().getServer().getCommandManager()
        .register(new BrigadierCommand(parent.build()));
  }

I already debugged everything -> LiteralCommandNode is setup perfectly everything how i want it to be It's just that in game it tells me Unknown Command

steady trellis
#

why use brigadier

valid gazelle
#

Why not

pastel bone
steady trellis
valid gazelle
#

because it has argument parsing

pastel bone
# steady trellis *why*

So now the command is working but it wont suggest the command itself? I have to type it myself any idea why?

steady trellis
#

hmmm

#

i have no idea how brigadier works but there is documentation on velocity's website

pastel bone
#

I think I'll try my luck using SimpleCommand

pastel bone
#
PrexorProxy.getInstance().getServer().getCommandManager().register(
        instance.getLabel(), new PrexorVelocityCommand(instance)
    );

I don't understand what I'm doing wrong hahahaha The command just won't register

#

(I'm now using SimpleCommand)

#

Sorry the command is getting registered but it just won't suggest it

oblique haven
pastel bone
#

What exactly do you mean by "setup"

pastel bone
oblique haven
#

That’s odd

steady trellis
#

proxyinitialize event

pastel bone
#

Yes, I mean would the command even work in the first place if I'm not doing it on Init

#

Is there even a way to register command on runtime?

steady trellis
#

try using a commandmeta instead of a label call

pastel bone
#

Ight gonna try that tomorrow, thank you

bold wharf
#

I mean, afaik there is nothing preventing ou registering commands whenever you want

#

Just, note that it won't show in tab completion unless the backend server resends the command definitions to the client

pastel bone
#

Can I force the server to resend the command definitions?

bold wharf
#

don't mention

#

from paper, there is a method on Player

#

but you'd need to send a message to the server to do that

pastel bone
#

I know there was a way to do it in bucket but that won't work in velocity

#

Bukkit*

pastel bone
bold wharf
#

stop mentioning

pastel bone
#

Ah sorry hahah

bold wharf
#

You'd need to have a plugin on the server and use plugin messaging or something

pastel bone
#

Hm okay will try that tomorrow thanks for the help

pastel bone
#

Both approaches didn't work unfortunately I tried using ComandMeta instead of String and I've updated the Commands for the Player

pastel bone
#

I legitimately don't get what I'm doing wrong.... like why isn't it suggesting my commands 😂

craggy pecan
#

electroniccat already told you, new command registrations aren't sent right away to all clients. The proxy waits for a new command tree to be sent by the backend server (e.g. during server switch) to inject its own commands

#

This is a wontfix since live command tree updates require lots of memory, and arguably this is a bit of an edge case

magic forum
#

Hello, I'm encountering io.netty.util.IllegalReferenceCountException after handeling a packet

#

It seems like it's getting double deallocated somewhere

#

o shit, just fund out why. Sorry for bothering you

#

The channelRead function in Minecraftconnection.java automatically deallocates but since I already did that on my side, it throws that error

maiden hawk
valid gazelle
#

yeah

#

That one PR was doing a little more than. Just reformatting like that though

maiden hawk
#

If I use "FORCE_ONLINE" in preloginevent, will a new player receive an online mode uuid? Or will it still be generated using offline mode method?

maiden hawk
#

it does.

pastel bone
#

Could it have something to do with that I'm using Velocity and Tuinity?

pastel bone
#

Alright. For anyone ever encountering this problem you have to set "announce-proxy-commands" to "true" in velocity.toml

bold wharf
#

that's on by default...

pastel bone
#

well I definitely didn't turn it off... Maybe it was set to false by default in older versions perhaps?

#

I really have no clue

craggy pecan
#

Nah, has always been true

steady trellis
magic forum
#

Bruh, why is the modern forge support taking so long?

#

It was 5 major mc updates ago modern forge came

rich hawk
#

search for modern forge here

#

You’ll figure out why

magic forum
#

But only basic support like joining a server?

#

No need for re-syncing

#

It's only a small modification in the code and it's done

#

I have already got it to work and it took about 3-4 hours

#

Can't understand what's taking so long

analog dew
#

Any sane implementation needs changes to Forge as well as to Velocity, and people are busy

bold wharf
#

no need for resyncing

#

sigh

#

yes, if you wanna go for a half baked solution which has many dozens of issues with server switching,etc, yea, sure, it can "work"

#

if you wanna actually have cross server switching which actually works long term and allows shit to handshake properly vs the years of bastardisation which has consistently caused issues, no, the client needs to support re-handshaking in some respect and resyncing data, etc

long kelp
#

hello i am new to velocity development. coming from bungee/spigot development. i am getting this stacktrace and i am unsure as to what to do. cant find anything relating to it on the docs

com.velocitypowered.api.plugin.InvalidPluginException: Did not find a valid velocity-plugin.json.
        at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.loadCandidate(JavaPluginLoader.java:64) ~[velocity.jar:3.1.1]
        at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:92) ~[velocity.jar:3.1.1]
        at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:324) ~[velocity.jar:3.1.1]
        at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:222) ~[velocity.jar:3.1.1]
        at com.velocitypowered.proxy.Velocity.main(Velocity.java:64) ~[velocity.jar:3.1.1]```
bold wharf
#

your plugin is missing the file it says

#

depends on how you're building the plugin, make sure that you're using gradle or maven

#

or, if you're using the IDE thing, make sure that you've at least got annotation processors running

#

(also, make sure that you have the annotation on your main class)

long kelp
#

figured out i needed an annotation processor

#

except im confused on how i actually implement one

bold wharf
#

velocity includes the annotation processor

#

like, it's part of the API

#

do you have the Plugin annotation added or whtever it was?

#

how are you building the jar?

long kelp
#

maven

bold wharf
#

make sure that you're running the package task and not building with your IDE i'd guess

long kelp
#

if i try to do that it just tells me
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project velocitytest3: Compilation failure

bold wharf
#

if building with maven blows up then you've not been building with maven

long kelp
#

however it does build if i use jar

bold wharf
#

there is a way to see the full output of the task

long kelp
bold wharf
#

Well, there you go

#

in the mven config set the version of java to something newer

#

(or, update the compiler plugin)

#

(I have a dream where maven stops using multi year old plugins by default...

long kelp
#

maven is a mess in itself

#

i probably should learn gradle

bold wharf
#

yea, I mean, gradle has its own set of issues, but, I mean, outside of tryna learn it it seems to generally be a much smoother experience

long kelp
#

true

#

half of my bungee and spigot plugins are maven so i just got used to it

#

and the plugin i need to make a velocity port of is maven so thats fun

nova radish
#

I'm using 3.0.1

maiden hawk
#

Sorry but why do you think that getCommandManager does not exist?

bold wharf
#

are you looking at the JDs for 3.0.1?

#

published jd's are for 3.1.2-snapshot

nova radish
maiden hawk
#

gimme a sec gonna check JD

#

wait

#

which version do you use?

nova radish
#

previously I was using 3.0.1

but I was looking at 3.1.2-snapshot javadocs by accident

#

I bumped the version to 3.1.0

maiden hawk
#

oh ok

nova radish
#

and it worked

bold wharf
#

the thing was added in 3.0.2

queen pasture
#

is there any plugin similar to jpremium for velocity?

agile ore
#

Mojang has one, it's called online mode

queen pasture
#

breh

quick quail
#

is there a way to get the proxy's minecraft version?

quick quail
#

found it

maiden hawk
signal jasper
#

building my project (with annotation-processor and api 4.0.0) generates a jar with a velocity-plugin-info.json

#

trying to load it within the latest velocity (3.1.2) gives an error

#

that the velocity-plugin.json files doesn't exist

maiden hawk
#

uhhh shouldn't it be velocity-plugin.json instead of velocity-plugin.info.json ?

signal jasper
#

renaming velocity-plugin-info.json to velocity-plugin.json doesn't solve the issue

#

as it's now complaining about invalid json structure

signal jasper
maiden hawk
#

do you use gradle or maven?

signal jasper
#

gradle

#

using an auto generated build.gradle by the minecraft dev plugin

maiden hawk
#

wait

#

I see the issue

signal jasper
#

ye?

maiden hawk
#

you are using velocity api v4 on velocity 3.1.2

signal jasper
#

yeah, I wasn't able to use api v3.1.2 nor velocity 4

maiden hawk
signal jasper
maiden hawk
#

just do

    annotationProcessor 'com.velocitypowered:velocity-api:3.1.2'

    compileOnly 'com.velocitypowered:velocity-api:3.1.2'

in your dependencies

#

it works for me

signal jasper
#

what repos are you using

maiden hawk
#

make sure to use 3.1.2 not v3.1.2

signal jasper
maiden hawk
#

this is... odd

#

maybe try to clear your local cache?

signal jasper
#

alright

maiden hawk
signal jasper
#

welp

signal jasper
#

(talking about 3.1.0)

#

wait no

agile ore
#

Try using the paper repo, might've moved over there

signal jasper
#

it can only not find the ap now

warm solar
#
repositories {
    maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
}
dependencies {
    compileOnly("com.velocitypowered:velocity-api:3.1.1")
    annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
}
``` i've been using this
signal jasper
#

ok let me try that repo

#

pretty sure I've already tried that

#

but let's give it a go

#

nope

#

also doesn't work

#

can't find the ap this time either

#

where's 3

#

ok using 2.0 works

#

but now it can't find any events

#

nvm they just moved packages

maiden hawk
#

uh

signal jasper
#

yes it works now

#

let me try building

maiden hawk
#

the annotation processor has the same name like api

signal jasper
#

nvm lol now the ap crashes lol

maiden hawk
#

can you please send your build.gradle again? (the new one)

signal jasper
maiden hawk
#

btw, the paper repo might be redundant

signal jasper
#

ffs that works

#

thanks so much!

maiden hawk
#

np

signal jasper
#

let me try running it now

#

nice it works now

#

just a lil' encoding problem now :p

#

thanks for the help

maiden hawk
#

np

#

May I ask what is that client?

signal jasper
#

badlion client

maiden hawk
#

hmm, ok.

thorn bronze
#

Hi, how can I register plugin messaging channel without colon? I need it for FastLogin becase FastLogin use plugin messaging channel force.

maiden hawk
#

fastlogin has a velocity port, lemme check

#

well according to their source code, they do not use channel force at all but only
FastLogin:ch-st
FastLogin:succ

thorn bronze
# maiden hawk are you sure it uses that channel? To my knowledge, bukkit should also throw an ...
GitHub

Checks if a minecraft player has a valid paid account. If so, they can skip offline authentication automatically. (premium auto login) - FastLogin/LoginActionMessage.java at main · games647/FastLogin

thorn bronze
maiden hawk
bold wharf
#

the protocol literally does NOT allow channels to exist without a :

thorn bronze
maiden hawk
maiden hawk
thorn bronze
#

Yeah

maiden hawk
#

Then it probably uses lowercase name

analog dew
maiden hawk
#

and that makes sense, the fastlogin port for Velocity does not use the force channel

thorn bronze
#

I've tried it in lowercase

maiden hawk
thorn bronze
maiden hawk
#

they only use succ and ch-st

#

not force

#

or at least, I cannot find it

#

they only register these channels:

        this.successChannel = MinecraftChannelIdentifier.create(plugin.getName(), SuccessMessage.SUCCESS_CHANNEL).getId();
        this.changeChannel = MinecraftChannelIdentifier.create(plugin.getName(), ChangePremiumMessage.CHANGE_CHANNEL).getId();
thorn bronze
thorn bronze
#

I need to add FastLogin compatibility for my Auth plugin in Velocitypowered.

maiden hawk
#

well GL then

thorn bronze
#

😩

maiden hawk
#

tho if your auth plugin is on velocity and fastlogin is also on velocity, why don't you just hook into it?

thorn bronze
#

Does FastLogin for Velocitypowered has API?

maiden hawk
#

no idea

thorn bronze
#

I didn't found any documentation

agile ore
#

it should

maiden hawk
#

i mean in worst case scenario you can just hook into it and hope it won't break with future updates

thorn bronze
#

Ok, I found these events: VelocityFastLoginAutoLoginEvent, VelocityFastLoginPreLoginEvent, VelocityFastLoginPremiumToggleEvent but none of these events run when connecting to the server.

#

This is how it looks like:

    @Subscribe
    public void onTest(VelocityFastLoginAutoLoginEvent e) {
        main.getServer().sendMessage(Component.text("Test message"));
    }
#

I tried also: FastLoginAutoLoginEvent, FastLoginPreLoginEvent, FastLoginPremiumToggleEvent

thorn bronze
#

When I use e.setResult(PreLoginEvent.PreLoginComponentResult.forceOnlineMode()); in PreLoginEvent it changes UUID of player.

#

Is there any way to keep same player UUID?

maiden hawk
#

if you want to know how uuids are generated defaultly take a look in velocity src

#

But iirc it is done by taking bytes from string OfflinePlayer:player_name and then making uuid from it

lost cypress
twin ingot
#

Hi, I'm creating plugin for authentication tokens like BungeeGuard, and my question is how I can do it on velocity?

lost cypress
#

I think BungeeGuard is built in to velocity btw :)

twin ingot
#

Now i have all created for bungeecord and spigot.

twin ingot
fierce tundra
#

Does anyone here know of or have documentation on custom packets via the proxy; specifically keepalive packets?

craggy pecan
lost cypress
craggy pecan
#

You can get the player for which the root node is for with getPlayer(). Do your own logic with it

dusk timber
#

WTF 3 files with one data

#

why?

#

papermc code

burnt dragon
#

that's how patches work

#

patches show the code that surrounds the changes you've made, meaning if you make changes to similar areas of code in different patches then you'll get stuff like this happening

dusk timber
#

you can somehow ask the developers to correct the translations a little, they have a color in the code at the beginning of each message of the type chatColor.RED

можно как то попросить разработчиков чтобы они немного подправили переводы, у них в коде указ цвет вначале каждого сообщения по типу chatColor.RED

#

because it is strange to do this if you can set the color of the text inside the message itself

потому что странно так делать если внутри самого сообщения можэно задавать цвет текста

#

and sometimes you have to call the server like §fLobby§r

и иногда приходится называть сервер, например §fLobby§r

fierce tundra
steady trellis
thorn bronze
#

Hi, is it possible to get which player sent message via plugin messaging channel?

#

I found player is stored in getSource() and getTarget() but I don't know how can I get the player from there.

bold wharf
#

see the JDs

#

iirc those methods return some object which contains the relative thing

#

may need to cast towards something else from that result

thorn bronze
bold wharf
#

don't mention

#

see the known subinterfaces

thorn bronze
#

Sorry, I forgot.

#

I found Player and ServerConnection subinterfaces.

#

But I didn't found anything useful there.

bold wharf
#

instanceof Player

thorn bronze
#

Worked, thank you so much!

#

Actually, it doesn't work. The getSource() is not instanceof Player.

bold wharf
#

or, well

#

that assumes that the client sent the message

#

if it came from the server, see the ServerConnection

thorn bronze
#

I'm sending message in bukkit plugin message channel using: p.sendPluginMessage(main, "test:plugin", out.toByteArray());

bold wharf
#

oh, so, yea, server connection

thorn bronze
#

Now worked, thanks.

long kelp
#

my command just doesnt work. it just says it doesnt exist

#

this is all the code

#

im stumped

#

ive looked at references, everything

#

cant find anything that works

oblique haven
#

@long kelp can you show us your imports

#

In your plugin source

long kelp
#

theres no errors in the editor

#

and no stacktrace

#

infact heres it loading just fine

#

but when i do the command

oblique haven
#

You’re using one from google’s event bus - not the velocity one

#

Since this is so common it might be nice if velocity threw a warning for methods tagged with this

long kelp
#

oh

#

yeah i see now

#

thanks

#

and thats worse

slate hamlet
long kelp
#

i figured it out

long kelp
slate hamlet
#

Yea thats how the command system works

long kelp
#

rn im just referencing off source code i can find on the internet lol

#

cant really find any forums threads relating to issues with this stuff

slate hamlet
#

Here are some basic references for the api

long kelp
#

those references didnt do much for me

slate hamlet
#

At least the command api is explained there correctly xdd

long kelp
#

true

#

setting up the plugin tho

#

thats a lot different

slate hamlet
#

Really?

long kelp
#

yeah

slate hamlet
#

It looks correct to me

long kelp
#

it was a lot more of a struggle than just popping in some dependencys

#

mainly cause my ide refused to build it

slate hamlet
#

What was the issue?

long kelp
#

unsure

#

just knew that my ide was like what is this garbage

#

and decided not to compile

#

it did eventually work after a bit of fiddling with the settings

#

velocity work is a lot different than bungee work

#

and i have to convert an entire bungee plugin over to velocity soo

#

yikes

slate hamlet
#

After you get the basics it's much easier and cleaner to work with the velocity api xD

long kelp
#

true

#

it was kinda the same with bungee and spigot

#

its hard at first but once you have some references and some knowledge on how they work its pretty straight forward

scarlet spruce
#

How would I go about executing a console command on a proxied server? (knowing that sometimes the server could be empty)
Tried plugin messages & no luck, or I'm just really bad with them but onPluginMessageReceived just never gets called on the spigot server, despite me in the proxy plugin calling getServer("factions").get().sendPluginMessage(MinecraftChannelIdentifier.create("test", "testchannel"), out.toByteArray());

bold wharf
#

if the server is empty you can't

#

otherwise you'll need to make sure that your plugin message channels are registered properly, idk how velocity deals with that one

#

if you need reliable message sending, use a message broker

#

i.e. rabbit, redis, etc

scarlet spruce
#

Thank you, will look into redis.

long kelp
#

anyone know why im unable to load my config

#

Exception in thread "main" com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/spongepowered/configurate/hocon/HoconConfigurationLoader

burnt dragon
#

velocity only ships the toml configurate

#

you need to shade/relocate hocon i think

long kelp
#

im unsure of what im suppost to do

#

i did exactly as followed on the docs for configurate

burnt dragon
#

you are supposed to shade and relocate the hocon loader

long kelp
#

i dont even know what that means

#

excuse my terrible java skills im still learning

burnt dragon
#

plenty of online guides/tutorials for how to shade and relocate libraries for your build tool

rich hawk
#

it has hocon, gson & yaml

#

errr, I think that’s configurate v4? velocity only has 3.x iirc

nova notch
#

Can someone from the development team update the velocity site, please? Site currently says that the newest supported paper version is 1.17.1, but that's not true, it should be 1.18.1.

bold wharf
#

that site is deprecated

#

i'll have to see what the plan for it was

nova notch
#

Ah, cool.

#

Wait, github points you to the site. So how is the site deprecated, if it's the main download point for the jar?

bold wharf
#

fun area where much of our own web content needs redoing, offering downloads on the velocity site directly makes little sense given our own downloads page which is more smrt

#

I think in the meantime I'll just make the dev build button link to our own downloads page and update the text

elfin snow
#

Anyone know how I merge player count for sever lists when I have multiple proxies? Can I just return another number on the ping or will sever lists think I'm faking player count then?
(already got player count synced to each instance)

valid gazelle
#

well, what's the server lists' methods of detecting if you're fakng player coumt

elfin snow
#

Good question haha, was thinking it maybe did a query to get player list

bold wharf
#

The proxy substitutes the info it has for some stuff in the correct config, iirc

#

otherwise you'd need to like, sync counts across proxies

#

i.e. store counts on redis

#

and then populate the info in the events

elder quarry
#

I'm trying to make custom events, which Event class do I need to import?

robust mural
elder quarry
#

I'm on there, doesn't tell you which class to use...

robust mural
#

Look at "Creating an event class"

elder quarry
#

it says implements Event, which Event class?

robust mural
#

From velocity

elder quarry
#

I though so too, but...

robust mural
#

Oh

#

I think the docs are old..

#

I've looked in the other events, you don't need to implement anything

elder quarry
#

Reading the docs again it says under the example;
You'll notice that your events don't need to extend or implement anything. They just work.
But in the example they do implement Event... kinda annoying

steady trellis
#

u just need an instance of a class with @subscribe on the methods

rich hawk
#

It doesn’t tell you to implement anything?

visual adder
#

every few hours, the server breaks and people cant join

#

it says this error

fleet sailBOT
visual adder
#

been happening since auth change by mojang

#

how do i fix? it's killing my server

bold wharf
#

something apparently managled a packet

#

given that the auth api at that phase is basically 100% irrelevant, I'd imagine it's some plugin on the server

visual adder
#

any idea how i would go about figuring out which plugin it is

#

as this only occurs completely randomly

#

lol

#

then itll only last a few min, 30min to an hour and its done

bold wharf
#

cleanly, no

#

most things are often a binary search or modifying the server to try to detect such states

visual adder
#

that doesnt sound good

visual adder
#

So what steps should I realistically take to fix this?

#

Find a dev that can modify the server to detect such states?

#

is it this?

bold wharf
#

yes

iron sundial
#

how can you get the server address a player joined with?

fringe thicket
#

not talking about plugins, but that could tell you too if it's meant to

round gulch
#

So Im struggling with something. Im using the essential player plugin for velocity to handle my tablist and my global msgs. Ive succeeded in altering the source, compiling and running it on my server. But I am struggling to add color to the "join" messages.

The source is as follows, and I thought I could simply just add "&e" in front of it to change the color, so like :

private void connectNote(ServerConnectedEvent event){
    Player player = event.getPlayer();
    String sendMessage;
    if (event.getPreviousServer().isPresent()){
        sendMessage = **"&e" +** player.getUsername() + " has joined the "
                + event.getServer().getServerInfo().getName() + " world";

But ofcourse, that doesnt work. Can anyone help me along? 🙂

#

Cause this, will just output the msg like "&ePlayername has joined the XX world"

atomic leafBOT
burnt dragon
#

^ is probably what you're looking for

burnt dragon
#

Is it possible to not respond to a ping request (i.e. can I "pretend" that a server is offline)?

ripe cobalt
#

Does Velocity have a built-in basic messaging channel system like Bungeecord's default message channel?

#

And can the get virtual host method read from the proxy something like a random srv address (ex. play.server.com) entered by the player on the client?

burnt dragon
#

uh.. well, 1) gs4 isn't the server list ping and 2) im not asking in paper help :')

#

ah no, i meant for pings coming into velocity with the ServerPingEvent

dense glen
#

Ip?

maiden hawk
burnt dragon
#

id be surprised if that worked but i suppose it's worth a shot

maiden hawk
burnt dragon
#

haven't got a chance to test it yet, will keep ya posted

maiden hawk
#

ty

valid gazelle
#

I mean technically you could make your listener block for a minute or something so it times out

#

That's a horrible idea though

light tendon
#

Hello I am trying to convert BossShopPro bungeecord part to velocity, a PluginMessageEvent. I tried changing it to velocity functions and still doesn't work, The debug messages even dont show.
Here's the code:

    public void onPluginMessage(PluginMessageEvent e) {
        System.out.println("result - " + e.getResult());
        System.out.println("identifier - " + e.getIdentifier().getId());
        System.out.println("data - " + e.getData());

        if (e.getIdentifier().getId().equalsIgnoreCase("BungeeCord")) {
            DataInputStream dis = new DataInputStream(new ByteArrayInputStream(e.getData()));
            try {
                String subchannel = dis.readUTF();
                if (subchannel.equalsIgnoreCase("BossShopPro")) {
                    String type = dis.readUTF();
                    if (type.equalsIgnoreCase("Command")) {
                        String command = dis.readUTF();
                        server.getCommandManager().executeImmediatelyAsync(server.getConsoleCommandSource(), command);
                    }
                }
            } catch (IOException e1) {
                e1.printStackTrace();
            }
        }
    }```
daring imp
light tendon
#

its the good import but no longer relevant

#

thanks anyways.

dense sand
#

hi all, i am getting a weird Guice error with a Velocity plugin I'm trying to get to run (velocity-api:3.0.1 with the latest version Velocity 3.1.2-SNAPSHOT (git-7bd0f9ea-b114))

[17:05:05 ERROR]: Can't create plugin arcoviaproxy
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/ErrorInjectingConstructor]: IllegalArgumentException: ArcoviaProxy does not have a container.
  at ArcoviaProxy.<init>(ArcoviaProxy.java:28)
  at VelocityPluginModule.configure(VelocityPluginModule.java:48)
  while locating ArcoviaProxy

this is literally the whole class, which leads me to believe i'm missing something super basic in my project setup, but I couldn't find any discrepancies while reading the docs

@Plugin(
        id = "arcoviaproxy",
        name = "ArcoviaProxy",
        version = "1.0.0",
        dependencies = {
                @Dependency(id = "luckperms", optional = true)
        }
)
public class ArcoviaProxy {
    @Inject
    public ArcoviaProxy(final @NonNull ProxyServer server) {
        if (server.getPluginManager().isLoaded("luckperms")) {
            final LuckPerms luckPerms = LuckPermsProvider.get();
            server.getEventManager().register(this, new ChatEventListener(this, luckPerms));
        }

        server.getEventManager().register(this, new ServerJoinListener(this));
    }
}
rich hawk
#

I don’t think you can register events in the constructor?

dense sand
#

oh

#

my god

#

yeah I read the section on ProxyInitializeEvent but I guess I decided to not comprehend it, thank you catching that

woven stag
#

is the massaging service api is same as bungee?

ripe cobalt
#

How does using the EventTask.async() method in Velocity's event handler work differently compared to not using it?

#

If I use EventTask.Async() , is there no blocking on player handling to do something that takes a long time like a web API?

#

So, you mean if I apply Thread.sleep(9999 Minutes) 100 times with EventTask.Async() , it won't cause any problems handling other players' events, right?

#

I was wondering if there is a similar function in velocity like intents of event api used in bungeecord.

valid gazelle
#

but doesn't velocity have no main thread

maiden hawk
#

??? Velocity does not have main thread

maiden hawk
burnt dragon
#

haha nope, ill get to it and some point dw

#

will most likely just submit a PR to add the ability to prevent a ping if not

maiden hawk
ripe cobalt
#

What method should I use to check if a specific server is online among the registered servers to Velocity?

bold wharf
#

basically, ping it

ripe cobalt
#

Is ping() the only way?

bold wharf
#

Well, yea

#

only way to see if something is online is to make a connection to it, basically

#

unless you tracked that state yourself using some form of system

ripe cobalt
#

thanks sir

maiden hawk
oblique haven
#

Does anyone have plans on writing the PR for protocol 758? I don’t think anything should change on the proxy end for it.

#

If not - I can write a simple one to just add the version to the list