#velocity-dev

164 messages Ā· Page 8 of 1

queen pasture
#

but it uses a dependecy

#

called kyori-adventure-platform-bukkit

oblique haven
#

why not just ask clip to update it or port it?

#

seems like something he'd do

queen pasture
#

yea then i would need to wait for it im already halfway done porting im just tuck

oblique haven
#
PlaceholderAPI is a plugin for Spigot servers that allows server owners to display information from various plugins with a uniform format.``` wait whut
queen pasture
#

in this part

oblique haven
#

then you'll know where it's being used and find alternatives

queen pasture
#

i mean i cloned the repo

oblique haven
#

okay

#

it doesn't have kyori-adventure-platform-bukkit, maybe delete it and see what goes wrong 🤷

#

then you'll know where it's being used and find alternatives

queen pasture
#

yea so got a couple of errors

oblique haven
#

now you know where it's being used and can find alternatives

queen pasture
#

hmm i'll check

#

damn its working

#

it was using adventure for the ecloud list command

#

i deleted the whole class lol

burnt dragon
#

it's gonna be impossible to port it

#

the entire ecosystem depends on bukkit

queen pasture
#

nah

#

its possible

burnt dragon
#

yes it does, like every single expansion is gonna be using bukkit stuff

#

so you'll port it but it'll be useless as nothing else will work

oblique haven
queen pasture
#

i only need the math expansion rest my plugin will handle

burnt dragon
#

oh sure, so like the entire point of the plugin then :')

oblique haven
#

he's basically using it as an advanced replace("xyz", "xyz")

burnt dragon
#

you'd be better off just making a math minimessage placeholder, save yourself some time

oblique haven
#

or just use the js engine to do math which I'm pretty sure is what that expansion does

queen pasture
#

like i will limit the number of downloadable expansion

#

and put some custom coded expansion so that it will work like a smaller version of placeholder api on both bungeecord and velocity

#

it will be usefull in the future for accessing values across plugins

tawdry sky
fossil sundial
# tawdry sky what

id must be lowercase and cannot contain spaces, numbers or special characters outside of -

tawdry sky
#

Thank you

#

Still

#

ohh I think I know what might be the issue

opaque escarp
jolly sandal
#

Hi is there a way to make a player perform a command to my spigot servers directly without sending it to velocity

fossil sundial
jolly sandal
#

and I wanted to forward the command from velocity to my spigot server in order to open the gui

fossil sundial
#

yea, unless a command with the same name exists registered on velocity or a plugin on velocity is blocking it then it should just work

jolly sandal
#

/guild is registered on velocity and I created /guildgui on my spigot server but is there a way to like when someone use /guild gui it forwards it to my spigot server to open the gui?

fossil sundial
jolly sandal
#

I love you man

#

really

fossil sundial
#

I’d do something like getCommand().toLowerCase().startsWith(ā€œguild guiā€) ….

jolly sandal
#

thank you so much

fossil sundial
#

no problem

jolly sandal
#

pray for australia šŸ‡¦šŸ‡ŗ

oblique haven
# fossil sundial no problem

Seems like there could be a way to force a chat message or a command for a specific user and just throw the command downstream - without the event

craggy pecan
#

There is no clean way to do this with InvocableCommands

fossil sundial
soft slate
#

Is there an event that is invoked if a connected server comes online/shutdsdown?

zealous epoch
#
public static LiteralCommandNode<CommandSource> rootCommand() {
        return LiteralArgumentBuilder
                .<CommandSource>literal("vss")
                .executes(context -> {
                    //
                    Component message = Component.text("§4Too few arguments! §e/vss help§4 for help");
                    context.getSource().sendMessage(message);
                    return 1; // indicates success
                    //
                }).build();
    }
#

how can add suggestions for my Child commands?

#

I get this but I have 2 commands [ start, help]

#

and when I input anything I get this:

opaque escarp
zealous epoch
#

it was only for testing šŸ™‚

#

first time coding with brigadier so yea I have nothing I can work on

queen pasture
#

how do i make a command in evelocity

#

?

#

the doc seems outdated

#

this dont work

#

the interface is empty

queen pasture
#

nvr mind found it

#

its SimpleCommand

rigid vine
#

Is there a tutorial for SimpleCommand, which shows me how I can suggest a list for argument 0, if I enter something or leave it blank and then for argument 1?

#

And please don't direct me to the docs.

robust mural
craggy pecan
wary tiger
mild crest
wary tiger
#

I'm not an administrator but someone who is can

opaque escarp
#

It's not perfect, I need to explain better the RequiredArgumentBuilder, but I think it works

vernal compass
thick bramble
#

its not marked as such but that's still a bit todo. the velocity docs are a mess right now

#

but as its been public on the site for a while/not marked as that i'll add redirects for anything changed

craggy pecan
opaque escarp
royal pulsar
#

Is there any way to send additional information to a server that you're forwarding a player to while you're forwarding that player? Things like a location to move them to?

#

(or really just any arbitrary data)

molten ember
#

If you're intending to make calls to a paperMC server without any players connected, your only options are to either use websockets, or some database like system (like redis with pub/sub).

#

I'm not too sure as I was trying to do something similar, but it seems that plugin messages require a player to be connected to the server you're sending them to.

royal pulsar
#

Yeah, I guess I'll just send something to the target server ahead of time out of band

#

Was hoping there was an in-band way with login requests or something

#

But whatever works lol

opaque escarp
#

Is there a stable alternative to "https://jd.velocitypowered.com/" ? 2 months ago it was announced that it would stop working in ||3 days|| but so far there is no replacement as far as I can see

rich hawk
#

that one is updated

opaque escarp
#

in velocity discord

rich hawk
#

oh idk

opaque escarp
#

wait...

#

"March" šŸ¤”

rich hawk
#

probably get moved? since everything else is getting moved

royal pulsar
#

When things go get moved, will there be a single source of truth for docs? Right now I get most Google results going to the ReadTheDocs-style site instead of the wiki where current docs seem to be

fleet sailBOT
nova sparrow
#

Making a plugin with a gui, however all my item lore and names are italic

#

setItem(49, new ItemBuilder(ItemType.EMERALD).name(VelocityChat.color("&a&lCreate new")).lore(VelocityChat.color("&7Click to create a new announcement")).build());

bold wharf
#

Disable the italic on the root component

oblique haven
#

but yeah - you need to explicitly disable it, if that doesn't work then shrug

nova sparrow
#

Cheers you two, ill try that

thick bramble
oblique haven
covert folio
#

Does velocity have some documentation on it's internal structure? Been reading through it's network code for a while and some things there are kinda confusing

maiden hawk
bold wharf
#

no

maiden hawk
bold wharf
#

GUIs are not supported but, I mean, it's just packets

maiden hawk
#

I know that there exists some Library for it

nova sparrow
rigid vine
#
RegisteredServer rs = proxyServer.getServer("servername");
boolean rsState = rs.isPresent();

rsState should be true, if the server is online, right?

robust mural
#

No

rigid vine
#

no?

#

okay

#

then I don't have any ideas, how I can check, if a server is online 🤣

#

can someone tell me, how I can ping the server to check, if it's online?

#

I don't get it to work

bold wharf
#

have you looked at the javadocs?

#

Generally the only way to know it's online is to ping it or have some external system which tracks that

rigid vine
#

the ping method is not the latency, right?

bold wharf
#

no

#

it actually pings the server and returns a response, as per the javadocs

rigid vine
#

where can I find it in the javadocs?

#

I searched with the word ping

bold wharf
rich hawk
#

wrong ping

rigid vine
#

okay

#

I don't get it

#

I'm too stupid for this

#

||And I'm going to sleep now.||

rigid vine
fossil sundial
rigid vine
fossil sundial
#

the .ping() gives you a future that will be completed at some point. if you want to wait for it to complete then do .complete() to wait for the future

#

this may thrown an exception if the server is down or some other interruption occurs

rigid vine
#

I want to check, if it's online or offline

#

Do I have to do it like this?

#

Btw. I saw, what you wrote here, Five šŸ˜…

fossil sundial
#

sec

rigid vine
#

KK

#

šŸ˜…

fossil sundial
#
@Inject
private ProxyServer proxyServer;

public boolean testIsOnline(String serverName){
    Optional<RegisteredServer> toTest = proxyServer.getServer(serverName);
    if (toTest.isPresent()){
        RegisteredServer server = toTest.get();
        try{
            ServerPing response = server.ping().get();
            return true;
        } catch (Exception err){
            // Ideally check for IO error or interrupt here
        }
    }
    return false;
}
#

something like that

rigid vine
fossil sundial
#

my bad; it was .get() remembered wrong

ruby spear
#

is this intentional

rigid vine
cerulean charm
#

Hi, where can I change this text?

burnt dragon
#

you can't - velocity does not support removing attribution

cerulean charm
#

I just have a few proxies and I need to know which one the player is on

#

I was thinking of writing a number there

waxen mirage
#

Hello, is there any way to execute the command via console on velocity? Like dispatchCommand on bukkit

merry seal
#

is there a way to get players ip via PostLoginEvent?

fossil sundial
fossil sundial
merry seal
#

thanks

royal pulsar
#

The payload is a single UTF-8 string

royal pulsar
# cerulean charm Thanks
GitHub

The modern, next-generation Minecraft server proxy. - Velocity/PluginMessageUtil.java at 2586210ca67f2510eb4f91bf7567643f8a26ee7b Ā· PaperMC/Velocity

#

I think just adding the word "Velocity" to it

cerulean charm
#

Yes, I have already found this class

#

Now I'm trying to output this value to the config for convenience

nova knot
#

ive got a very simple problem and its kinda awkward that i have to ask that but i never worked with path objects and i want to create a config file for my plugin so..
how do i create my plugins directory using this datadirectory path?

nova knot
#

nvm got it

zealous epoch
opaque escarp
#

you could split it into several CommandNode and concatenate one with the other by using an addChild... but personally, I totally prefer the way I explained it

zealous epoch
#

Ok thank you!

zealous epoch
#

how does velocity handle configs?
How to get/set/save them?
someone has an example code?

bold wharf
#

basically, it doesn't

#

it does bundle configurate, however

zealous epoch
#

cant find any docs do you have a link=

#

?

bronze yoke
robust mural
#

The wiki is for v4 in Velocity is v3

zealous epoch
opaque escarp
zealous epoch
opaque escarp
#

I have no idea how to use Configurate 3, I tried to use it, but it never worked xd In my plugins I use Configurate 4 or Toml4j

zealous epoch
#

Ok then could you help me to get configurate 4 working?

opaque escarp
burnt dragon
#

sponge also has a discord

winged pike
bold wharf
#

did you shade configurate 4?

#

cos, I mean, whatever you're doing, you have a version mismatch

winged pike
#

Configurate?

#

im using simple yaml

#

yes, i'm shading both snakeyaml and simple yaml i've tried it doesn't work idk it can't find a method

oblique haven
#

are you sure it's getting shaded

#

check the contents of the uber

thick bramble
#

You need to relocate snakeyaml if you're using a different version

#

As velocity already includes it

winged pike
winged pike
#

im using 3.1.2-SNAPSHOT

thick bramble
#

Let me double check. I'm not very familiar with velocity at all but I swear it does

#

Not simple yaml, snakeyaml

winged pike
#

mh

thick bramble
#

Simpleyaml depends on snakeyaml and it looks like you've got a version mismatch

#

So you need to shade and relocate a matching version

#

Or downgrade/upgrade simpleyaml to match the version of snakeyaml in velocity

winged pike
#

ye

#

apparently is 1.26

#

btw what you mean by relocating a matching version, like i know how to relocate by i mean wdym by matching version

thick bramble
#

Ignore that part. It'd be a transitive dependency of simpleyaml so you don't need to care. What I meant was ensure your jar ships the version simpleyaml is expecting

winged pike
#

i mean i need some features of simpleyaml

#

i tried using the 1.7.2 which uses snakeyaml 1.26 but it doesn't contain some stuff that i need

#

so its best relocating

rich hawk
#

and shading

winged pike
#

I shaded already

#

I think I just need to relocate

ashen fiber
#

Piracy is not supported.

#

Go ask for help in /dev/null.

elfin snow
#

For some reason I can't run velocity plugins built with gradle if they have redis, I get the following error on startup and don't understand it
This line seems to cause it

implementation("redis.clients:jedis:4.2.1")
#

I'm guessing it's something to do with the slf4j shading but I can't seem to fix it

#

lol, found it finally, I was excluding the thing wrong, solution is to change the dependency to this

implementation("redis.clients:jedis:4.1.0") {
    exclude("org.slf4j")
}
fossil sundial
elfin snow
#

Yeah saw some old bug related to it but figured it was on my side, thanks!

gaunt hinge
#

So I am using protocolize, and its fine the only problem is that I do not know how packet classes are called

#

(for ex Bungee has a packet class named Chat, what would the equivalent be? Note: not doing stuff with chat just wanna know if there is a list of packets for velocity)

oblique haven
#

I think it's like StateRegistry or something

gaunt hinge
#

don't see it

nova sparrow
#

i need to figure this out too

#

was planning on making a scoreboard api/plugin

rich hawk
#

velocity doesn’t have a scoreboard api yet iirc

nova sparrow
#

id just have to make like

#

everything myself

winged pike
#

is there a way i can change the max player count?

fleet sailBOT
thick bramble
#

show-max-players

winged pike
#

i mean like in plugin

#

coding

thick bramble
#

Oh, missed the channel

#

The proxy ping event. You can set any custom response

winged pike
#

cool

river shoal
#

hi, is there a way I can make a spigot plugin that connects with velocity?

#

so like, from the spigot plugin i should be able to get the server id

#

and also redirect players to other servers

winged pike
#

channels

river shoal
#

can I get the server ID from channels?

merry trellis
bold wharf
#

it uses the custom payload packet last I knew

merry trellis
#

I'm fairly new at custom packets. Are they accessible through the API or is there a guide I can read up on?

bold wharf
#

it's not a custom packet

#

it's literally part of the mojang protocol

#

Oh, wait, it's now its very own packet

nova sparrow
fossil sundial
#

I plan on maybe rolling out support for book Interfaces alongside plugin intents
My opinion is that proxy doesn’t have to load or keep features open that aren’t being used and specially these tend to create strain even if not required

#

But scoreboards are still the first ones with that limitations

pallid otter
#

your pom.xml will need the velocity-proxy (I use system scope & a local file)

#
    public void playDing(float volume, float pitch) {
        player.getConnection().write(new DingSoundEffectPacket(position.x, position.y, position.z, volume, pitch));
    }
merry trellis
#

Say I want to convert a legacy string to json is the best way really

Component component = LegacyComponentSerializer.legacyAmpersand().deserialize("&6Hello &b&lworld&c!");
String json = GsonComponentSerializer.gson().serialize(component );

Just feels a bit to component from component situation

burnt dragon
#

yes that basically is the best way

#

the component structure is the middle ground, you need to go from legacy -> component if you've got any hope of getting it back out again into json

merry trellis
#

Ah that's fine by me. I just didn't want to be doing it a wasteful way!

merry trellis
#

Ok, hopefully my final question. I've made a plugin on Velocity which puts a fake written book into a players inventory, opens it and removes the book. Basically to create a pop up notification.

Obviously, the problem is that velocity has no way of knowing what original items was in the players inventory, so at the moments it replaced with air.. not helpful!

I assume.. I'd need to send a packet to the paper server to say initiate an inventory update, basically to resend the players inventory back to them... is this possible? Or am I look at this the wrong way

bronze yoke
#

I don't remember having to put a book into a player's inventory to open a book?

burnt dragon
#

you do now at least, give them the book and then tell them to open what's in their hand basically

bronze yoke
#

ah okay

jolly sandal
#

Hi do you guys know why PlayerAvailableCommandsEvent is marked at Beta is there still some bugs? And will the next version fix the problem?

#

and could you give me an example of how use it?

#

to remove some available commands from the list

craggy pecan
#

Iirc it was marked @Beta due to the integration with Brigadier, I think it's safe to use by now. You get the root node and modify it as you please (see Mojang's docs for more details)

rigid vine
#

How are you guys writing the velocity.toml ? I want to make a config file for my plugin, but I don't know, how I can write my config like you wrote yours šŸ˜…

burnt dragon
#

configurate!

fleet sailBOT
opaque escarp
#

||toml4j||

oblique haven
uneven trench
#

is there a way to communicate from server to velocity without a player present on the server? the simplest way I can think of to do that is just add a plugin to velocity with a custom server running to listen for requests but is there a more idiomatic way to do it?

oblique haven
#

You’d need to have a plug-in or something

rigid vine
#

if that's the way to communicate, that you mean

bold wharf
#

no

uneven trench
ashen pawn
uneven trench
#

yeah I'm aware of ways to communicate between servers not using a proxy, just didnt know if there was a way built into velocity

#

we're using redis

ashen pawn
#

tl;dr: the answer is no, other solutions do a fine job of providing this

uneven trench
#

cool cool

maiden hawk
gray hedge
#

Is there way to hold an event till a completable future joins? for LoginEvent

#

Or do I just block the thread

bold wharf
#

think that events had a continuation thing?

gray hedge
#

Oh yea found that

jolly sandal
#

Hi guys do you know if there is an event PlayerChangeServerEvent or a way to get when a player change server

rigid vine
#

Is there a way to use something like ChatColor.translateAlternateColorCodes in velocity?

bold wharf
#

I mean, ideally, don't use legacy text.

#

otherwise, if you must, use the legacy serialiser

rigid vine
bold wharf
#

yes

restive idol
#

how i'm supposed to work on yaml file with velocity?

burnt dragon
#

you can use configurate, which velocity ships with (although i dont think it includes yaml stuff)

fleet sailBOT
nova sparrow
restive idol
#

yeah the thing is, i need to have comments

nova sparrow
#

?

#

yeah just use simpleyaml it’s basically what bukkit uses

restive idol
#

sort of

#

i don't want to use addDefault for saving files

nova sparrow
#

You don’t need to

restive idol
#

how i'm supposed to save directly the config then?

nova sparrow
#

config.save(directory)

#

take a look at that

#

i use it there

boreal shore
#

Can I create fakeplayers global tablist using velocity api, or should I create global tab using that api, and add fakeplayers using e.g paper api

agile ore
#

how can I get a ip address

#

like I know InboundConnection#getRemoteAddress

#

but the problem is how do i continue to get a plain xyz.abc.def.ghi version

fossil sundial
#

the inetsocketaddr is an unresolved object in this case so getHostName is the correct way to go

#

and its optional because the client may omit (empty) the field in any type of situation. Protocol doesnt require it to be filled

bold wharf
#

no

fossil sundial
#

Not sure what you’re trying to do

bold wharf
#

the API does not cover sending that stuff

#

ofc, you can do it, it's just not something that the API supports afaik

agile parrot
#

Can a velocity permissions plugin's permissions (such as luckperms) be read by player.getEffectivePermissions() in paper?

fossil sundial
#

No. You can only ask the provider for certain permissions but not get a list because depending on context it may be different

bold wharf
#

they're two entirely different processes with two entirely seperate chunks of RAM, state, etc, etc

#

the only way to get that info between the two of them would be if you had a plugin to send that info over, or if your perm plugin lets you get that another way

#

ofc, LP won't expose "effective perms" for the proxy in the server if they don't apply, which, depends on how you setup perms

fossil sundial
#

LP is also no stranger to conditional permissions so an ā€žeffectiveā€œ permission is effectively worthless

agile parrot
#

Is there any news on velocity getting scoreboard api?

fossil sundial
#

There is but it’s a bit more complicated
Scoreboard will be the first api part to be a privileged api component
And the framework for that is nearly done
Ideally velocity should only inject in scoreboard communication if a plugin requires it and by requiring plugins to declare intentions so the feature can be deactivated while it’s unused will save CPU and resources

#

Ideally by the next release everything except commands will require declaration
For now this is going to be the first step

boreal shore
#

should I use gradle kotlin build script for velocity or not? (iirc for paperweight userdev I used gradle kts)

bold wharf
#

I mean, use whatever build script format you want

#

just note that kts tends to be more supported in these parts

fossil sundial
#

That’s just a fancy way of saying you need to tell the proxy that you need it.

agile ore
#

@fossil sundial thanks

boreal shore
nova knot
#

is there a way to display ä,ö and ü properly in a textcomponent?

bold wharf
#

works just fine

#

check your encodings

nova knot
#

i just use utf8?

#

or can i change it in a config?

bold wharf
#

You use utf8

#

make sure that your compiler is configured to use utf8 and that your source files are in utf8

nova knot
#

alright

bold wharf
#

Take a look at other projects using kts, etc

boreal shore
#

umm, any examples?

bold wharf
#

no

opaque escarp
boreal shore
#

should it be enough?

thick bramble
#

add annotationProcessor("com.velocitypowered:velocity-api:3.1.1") under dependencies as well

#

otherwise looks fine. you can also replace the velocity repo with the paper repo as the velocity one is deprecated, https://papermc.io/repo/repository/maven-public/

boreal shore
#

with old repo i cant use 3.1.2 version, with actual repo it should works?

bold wharf
#

3.1.2 is a snapshot still

oblique haven
fossil sundial
boreal shore
#

what are differences between that?

rich hawk
#

one is asynchronous one is not

opaque escarp
gray glacier
#

hey, im trying to build the proxy module, but it is not showing up in my maven repository, is there something special i need to do? api and native show up in my repository

#

i did build it the way the readme tells you

fossil sundial
gray glacier
#

yeah i realize that now

#

is there a way to get my plugin instance?

#

would i just implement the plugin or plugincontainer class?

oblique bay
gray glacier
#

this is kind of confusing, is my main class my plugin instance?

oblique bay
#

The one you use the @ Plugin annotation on is (sorry random person named sub, I'm dumb)

#

It's the entry point

gray glacier
#

okay

#

is there something i can implement/extend?

#

cuz i have a non-platform specific command api and the way it works is checking instance of proxyplugin, javaplugin, etc

#

so i need an equivalent for velocity

oblique haven
gray glacier
#

well originally i was registering commands using the proxyserver instance which i have no issue retrieving

#

but i dont know if thats proper

#

as in spigot and bungee you register commands through the plugin interface

oblique haven
#

well you're supposed to use the proxyserver's command manager

gray glacier
#

ah okay i guess that makes sense

oblique haven
#
    private void setupCommands() {
        CommandManager commandManager = this.server.getCommandManager();
        for (String command : new String[]{"glist", "server", "shutdown", "velocity"}) {
            commandManager.unregister(command);
        }
    ...``` as such
#

the command manager is a global thing

#

commands aren't tied to plugins

jolly sandal
#

Hi, is there a Component that allows backline? One that basically does \n

burnt dragon
#

Component.newline()?

jolly sandal
#

Thanks bro

#

You dont know how much time i searched

#

to find this

burnt dragon
#

you can also just use a newline character in most cases

jolly sandal
#

and you know why colors with § dont work when going to a newline

burnt dragon
#

becuase legacy section sign colouring is not supported at all inside components

#

don't use them

jolly sandal
#

okay

#

because Ive created a system to send messages to players between my velocity instances

#

but I cant really send any other color sign that §

#

So ig imma create a parser for this

burnt dragon
#

yes you can - you can use the format minecraft uses to transfer components over the wire

#

adventure's gson serializer handles this

#

or, if you wanted to use the legacy format for whatever reason, you can just use the legacy component serializer

jolly sandal
#

im not using json, im using bytes lol thats why

burnt dragon
#

what

#

you can put anything in bytes

jolly sandal
#

with rabbitmq

#

but wont

#

that be weird?

burnt dragon
#

what do you think bytes are?

jolly sandal
#

010101

#

8 bit

burnt dragon
#

yes, and that's everything

jolly sandal
#

ik

burnt dragon
#

these messages are bytes

jolly sandal
#

yh

burnt dragon
#

so ofc you can turn a json string into bytes

jolly sandal
#

thats why I actually do

#

but the thing

#

is that I prefer not using json bc of performances

#

Do you know Charal?

burnt dragon
#

have you genuinely noticed a performance issue

#

or are you just preemptively optimising for no reason

jolly sandal
#

and the developer used json but that was pretty risked and finally their server crashed

burnt dragon
#

there is no way that transferring json caused a crash lmao

jolly sandal
burnt dragon
#

look, minecraft uses json in every component related packet

jolly sandal
burnt dragon
jolly sandal
#

and thats why a simple game consumes a lo

#

bc to send the packets with rabbitmq to others servers

#

they used json

#

and it took so many time

#

I really dont want to change my system after bc it will be a lost of time

burnt dragon
#

i mean that sounds completely unrelated to sending json encoded chat packets between servers

jolly sandal
#

bc it sends a lot of messages

burnt dragon
#

chat messages are going to be infinitely less intensive than players

#

don't waste time, use json and just change it later if you notice an issue (you wont)

boreal shore
#

How can I connect a player to the server and automatically set his location? For example, if the player uses /test, he will teleport him to the given server and coordinates 0 0, but if he reconnect, it is in the place where he was

half vine
boreal shore
#

Oh, ok, thx!

#

And one more question. Can I somehow send console message to the plsyer's current server?

half vine
#

plugin on the server and proxy and send a plugin message

fossil sundial
bold wharf
#

it's kinda been on my todo list but I didn't figure out the best way to really expose it nicely given the existing API

fossil sundial
#

I’m all for doing it like it’s done on velocity- with a callback

tawdry sky
#

How to show title using velocity?

tawdry sky
#

also another question, why does the /server command not work

#

?

robust mural
#

I think you dont have the permission

woeful granite
#

Hey all, I’ve been developing a velocity plugin and would like to get some basic communication back and forth between the velocity plugin and the bukkit/spigot plugin (in production there are 6 servers in the network). I’ve been reading all the docs I can find.
To communicate between plug-ins on the various servers in the velocity network (including the velocity server itself). Can I just create a custom PluginChannel, register it on both servers and send information that way? Does this require a player to be online or is it possible to send the message as the server? I figure if this is possible I would just setup an event listener when the servers receive messages on that channel.
Am I understanding this right?

wild quest
#

@woeful granite I wrote some code that uses PluginChannel a little while ago and I think you're on the right track. If u want I can send you some code later but I'm about to sleep rn šŸ˜›

woeful granite
bold wharf
#

Yes, you''d just register the channel on the proxy and it'll let you send stuff back over

#

it needs a player online as it just hijacks the players connection for it

#

if you require reliable/without a player, you'd be better off using some form of message broker

final lynx
#

e.setResult(PreLoginEvent.PreLoginComponentResult.denied(create(configuration.getNode(webMsg).getString())));

I'm just stuck in "Connecting" until it timed out on the client

#

not sure if this is a bug or am I doing something wrong?

ruby spear
wild quest
#

@woeful granite I guess I was mistaken. I remembered looking into cross-server messaging with velocity but that notion I think was misguided. You might look into using something else in addition to velocity. So yeah pretty much what electroniccat said.

#

Redis is a popular solution I believe.

tawdry sky
#

The command straight up doesn't exist

#

All other default commands do

tawdry sky
#

latest snapshot

robust mural
#

If you don't have permission, it doesn't exist for you

opaque escarp
# tawdry sky The command straight up doesn't exist

In Velocity, if a user (or the console) does not have permission to execute a command, the command will be hidden and when the command is executed, it will be sent to the server where the user is connected (in case the executor is a player) ||and to think that in bungeecord it shows you an error message, how antiquated||

opaque escarp
#

then use /lpv verbose command (username or "me") "command" https://luckperms.net/wiki/Verbose

exotic frigate
#

Hello! How can I dispatch command with velocity API, when I'm using spigot API, it's method Bukkit.dispatchCommand(consoleSender, command). Is it possible to do that with velocity?

fossil sundial
#

Command source is either a player or the proxy with proxyServer.getConsoleCommandSource()

exotic frigate
#

thank you!

fossil sundial
# exotic frigate thank you!

Side-note if you don’t want this to fire a CommandExecuteEvent you could also use .executeImmediatelyAsync(…)

exotic frigate
#

okey, thanks for note about it Blush

south garnet
#

hey, i've got a problem with my velocity proxy or with a the plugin api. i wanted to code a warp all players to a server but proxy.getServer(...) returns an optional datatype. this is why i cant warp any players to a different server because it wont accept a optional data type
any ideas?

burnt dragon
#

unwrap the optional - plenty of guides online

south garnet
#

thx ā¤ļø

#

i forgot

south garnet
#

how can i send players to a different server with my plugin

#

?

boreal shore
#

Can I get luckperms prefixes / sufixes from database or should I do it with their api?

bold wharf
#

you should do it with their API

sacred musk
#

Is there a way to move player from one server to another using API without firing ServerPreConnectEvent?

oblique haven
south garnet
#

player#createConnectionRequest does not work but without any exception throwing

#

did anybody got an idea

sour current
ebon cradle
#

Is there a way to dynamically register/unregister servers in velocity?

ebon cradle
#

Thank you šŸ™‚

plain ledge
#

hey, does anyone know what's going on here?

boreal shore
#

Doing fakeplayers tablist using velocity api is a good idea or doing it with paper api is better way?

fossil sundial
#

Paper, purely based on the fact that the api is very limited on velocity

boreal shore
#

Ok, and what about global chat and direct messages between the servers? Better way is doing it with paper or velocity is ok for it?

ashen pawn
inner willow
fossil sundial
exotic frigate
#

hello, I have problem with executing command in velocity api

#
server.getCommandManager().executeImmediatelyAsync(server.getConsoleCommandSource(), "/adminchat example");
#

/adminchat is command from my other velocity plugin

#

It doesn't work, also in console there aren't any errors

bold wharf
#

I guess, remove the /

exotic frigate
#

I will try

#

doesn't work

bold wharf
#

define "doesn't work"

#

tried using a debugger and stepping through it?

#

is the command registered properly in the proxy?

#

etc

exotic frigate
#

it doens't execute command

exotic frigate
#

this is my code, message is sending, but command doesn't execute

craggy pecan
#

What does the command do? Do you see any output/errors in the console?

#

You're executing the command for the console, not the player

#

So the player will get no feedback about the command execution

exotic frigate
#

it send message to all players with permission

craggy pecan
#

Can we see the command implementation?

exotic frigate
bold wharf
#

first thing I see is a blind cast

exotic frigate
#

where?

bold wharf
#

literal first line of your execute methods

exotic frigate
#

it is nessesery

bold wharf
#

You're running the command as the console

#

the console is not a Player

exotic frigate
#

oo

fossil sundial
#

Audience is the superclass to send messages

#

Both also inherit PermissionSubject

fossil sundial
elfin gorge
#

Hello.

port = ((VelocityConfiguration) server.getConfiguration()).getBind().getPort();

I have this thing in my velocity plugin
using maven to compile, error:

fleet sailBOT
fossil sundial
#

Your JDK is mismatched

#

Also are you trying to create a plugin here?

elfin gorge
#
port = ((VelocityConfiguration) server.getConfiguration()).getBind().getPort();

If I remove this line, the plugin can successfully made.

elfin gorge
fossil sundial
#

Yes and this makes sense
You also don’t need to use proxy internals to get the proxy port

#

There’s the ListenerBoundEvent

#

You can get the port form that

elfin gorge
fossil sundial
#

The config isn’t exposed for the reason that the data there may not be accurate. What you’re reading in the config maybe transformed by the system so the port or address may not match
This is the sole reason it isn’t exposed
But to get rid of that error you need to compile against the same java JDK version as velocity

elfin gorge
#

instead, I can build using this clean install in the intellij

fossil sundial
#

Velocity builds against JDK 17

elfin gorge
#

alright, it's working

elfin gorge
#

i thought it's 11

fossil sundial
#

3.1.2 does

#

3.1.0 and earlier did 11

#

You should upstream update your fork

elfin gorge
#

so.. should I build the plugin with java 17
it should be better... ?

#

----------Another question--------
In waterfall, I can set the player's uuid in PreLoginEvent
Is it possible to do it in the velocity ?

inner willow
#

How to check if a server is joinable?

bold wharf
#

Literally all you can do is try

inner willow
#

Like how do you check if a server is joinable

#

Whitelist etc

bold wharf
#

You literally can't

#

Velocity doesn't know if you're whitelisted or not

#

velocity doesn't know if the server is full or not

#

Unless you're storing that data somewhere that velocity can access it, the only way to know if X player can actually join a server is to join the server and see if it allows you in or not

fossil sundial
fossil sundial
#

Note for that event: whatever you set will be ignored if you have forwarding disabled (to not break the client)

bold wharf
#

depends

fossil sundial
# boreal shore ^

Works on velocity well enough imo
Unless you need data from the server

bold wharf
#

many people preach for offloading stuff on the proxy, but, bearing in mind that the proxy doesn't have the info that the server does if you're wanting to deal with stuff like prefixes, etc

fossil sundial
#

Well if you run LP globally that isn’t an issue

#

But I digress

inner willow
#

If so what method of ServerPing tells if it's online or not

bold wharf
#

yes

fossil sundial
#

You’ll get an exception instead if the server isn’t online

inner willow
#

I can't seem to find a method under ping isOnline or whatever

fossil sundial
#

You won’t get a ping response is what I’m saying

inner willow
#

So a simple if (serverping) {} is fine?

#

In the thenAccept*

fossil sundial
#

Or a separate .exceptionally(…

inner willow
#

That's even better.

#

Thanks.

fossil sundial
#

Someone correct me if I’m wrong here but I’m pretty sure that’s how it works with futures

bold wharf
#

Yea, you'd either have an exceptionally or whenComplete, iirc

fossil sundial
#

Ah whenComplete was the one I was thinking of for both thanks cat

inner willow
#

Just to confirm

#

ifPresent/isPresent is regarding to

[servers]```
#

Not toml try = ["shard_1", "shard_2", "shard_3", "shard_4", "shard_5", "shard_6", "shard_7", "shard_8"]?

fossil sundial
#

I’m a bit confused to as what you’re asking but I’ll assume you’re asking about proxyServer.getServer(name)

fossil sundial
#

The is/if present there is only about whether the proxy has a registered server by that name or not

#

Nothing else

inner willow
#

How does the proxy register a server?

#

Via this list?

#
[servers]
    # Configure your servers here. Each key represents the server's name, and the value
    # represents the IP address of the server to connect to.
    shard_1 = "172.18.0.1:3001"
    shard_2 = "172.18.0.1:3002"
    shard_3 = "172.18.0.1:3003"
    shard_4 = "172.18.0.1:3004"
    shard_5 = "172.18.0.1:3005"
    shard_6 = "172.18.0.1:3006"
    shard_7 = "172.18.0.1:3007"
    shard_8 = "172.18.0.1:3008"```
fossil sundial
#

Either through the config like that or using the api

#

proxyServer.registerServer(…)

inner willow
#

Oh hold on

#

getAllServers()

#

Lovely

fossil sundial
#

proxyServer.getAllServers()

#

Yea

#

Judging from this you’ll probably also want to check out the ChooseInitialServerEvent and the KickedFromServerEvent.RedirectPlayer

inner willow
#

So a good way to get a list of online servers would be to iterate through .getAllServers(), pinging them all, .thenAccept'ing them into the list

#

Or there is a better way you'd recommend?

fossil sundial
#

That works but be sure to make that list access thread-safe

inner willow
#

What does this mean, first and foremost

fossil sundial
# inner willow What does this mean, first and foremost

Thread safety in this case is about data integrity.
Make sure you’re not writing to or reading from the same data from more than one angle at the same time or this stuff blows up basically
The SynchronizedSet or one of the dynamically mutable sets from google guava may work for this

#

You’re concentrating multiple threads/tasks into one end. Chances are you’re doing two things to it at the same time, and to prevent this from blowing up you need to ensure whatever you’re writing to is equipped to handle those scenarios

inner willow
#

Thanks.

#

Does .getPlayersConnected() update on or after ServerConnectedEvent

elfin gorge
crystal heath
#

so I'm guessing building on an m1 mac isnt supported right now? My first time cloning the velocity repo and I get a missing dep error when I try to build for netty-transport-native-epoll-4.1.75.Final-linux-x86_64.jar

#

or am I just totally missing smth

bold wharf
#

I mean, it's just a dep, it should pull it just fine?

crystal heath
#

well idk, it says it only looked for a file in my local m2 repo

#
* What went wrong:
Could not determine the dependencies of task ':velocity-proxy:shadowJar'.
> Could not resolve all files for configuration ':velocity-proxy:runtimeClasspath'.
   > Could not find netty-transport-native-epoll-4.1.75.Final-linux-x86_64.jar (io.netty:netty-transport-native-epoll:4.1.75.Final).
     Searched in the following locations:
         file:/Users/jake/.m2/repository/io/netty/netty-transport-native-epoll/4.1.75.Final/netty-transport-native-epoll-4.1.75.Final-linux-x86_64.jar
   > Could not find netty-transport-native-epoll-4.1.75.Final-linux-aarch_64.jar (io.netty:netty-transport-native-epoll:4.1.75.Final).
     Searched in the following locations:
         file:/Users/jake/.m2/repository/io/netty/netty-transport-native-epoll/4.1.75.Final/netty-transport-native-epoll-4.1.75.Final-linux-aarch_64.jar
#

actually, pretty sure that file exists

#

on no, only one of them exists

bold wharf
#

It only looked in maven local doe?

crystal heath
#

apparently, thats what the error says

#

I literally just cloned, and ran ./gradlew build

bold wharf
#

I mean, it failed to find the native for x86 and aarch from there, so, er

#

maybe relevant that our repo is shitting the bed, but, surely that woulda shown up in the list as a place it looked? o.O

crystal heath
#

err well I just deleted the 4.1.75.Final folder from my local repo and then it works

#

so who knows what was happening

bold wharf
#

well, the thing likes to cache where it pulled something from and stick to fetching from there, so, something went sideways

final lynx
#

how do I determine if a player is connecting through a forcedhost?

worn pond
#

hello, does anyone know how can I sync permissions from database to velocity’s permissions ?

#

I guess it’s related to PermissionsSetupEvent but I don’t know how can I do that

bold wharf
#

that event is where you register your permission provider

#

the provider can recalculate its perms whenever it wants to, i.e. you can pull them on setting the provider, periodically, etc, velocity doesn't care about that

jovial timber
#

This is likely a noob thing but im getting this error, how do I make intelij shade a velocity plugin (maven)
java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser

jovial timber
#

I have it added like this

        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
            <scope>compile</scope>

        </dependency>```
bold wharf
#

you need to make sure that you setup the maven shade plugin

jovial timber
bold wharf
#

it's a maven plugin

raven rock
jovial timber
#

this?

                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.2.0</version>
                        <configuration>
                            <!-- put your configurations here -->
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>```
bold wharf
#

yes

jovial timber
#

then i do package?

bold wharf
#

yes

jovial timber
#

it does not seem to be working

#

do i have to reload it or something

bold wharf
#

check the build log

bold wharf
#

shade didn't run

jovial timber
#

do i use this package

bold wharf
#

yes

jovial timber
#

the default scope is what i want right?

bold wharf
#

default scope was compile iirc

jovial timber
#

ig my problem is shade not running as u siad

#

anyone have suggestions

#

can gradle shade

simple epoch
#

yes

jovial timber
#

is it easy

#

or like should i just try to get this working

simple epoch
#

i would say, on maven it's easier

jovial timber
#

ok

#

im using the minecraft dev intelij plugin would that mess with it maybe

simple epoch
#

basically not

jovial timber
#

ok

#

well

#

um

nova sparrow
#

why would that be wrong

#

if you’re having trouble with maven

nova sparrow
#

also @jovial timber let me join on vpns on your server!

plain ledge
#

How to connect server in 1.18?

rich hawk
#

import it

#

and register the channel

#

on both sides

plain ledge
#

ByteArrayDataOutput don’t exist in 1.18.2

#

This code is paper 1.8

rich hawk
#

should exists

#

its in guava

boreal shore
#

is it possible to get player gamemode in velocity?

rich hawk
#

with api no

#

idk about internals

boreal shore
#

Can I somehow sort players on tablist with velocity api or can I somehow create globaltablist with paper api where sorting is easier imo?

#

(if it is possible to create the global tab with paper)

oblique haven
#

@boreal shore not at the moment

boreal shore
#

so can I somehow sort tab with velocity

oblique haven
jovial timber
#

how do I shade it!

nova sparrow
#

if you’re using that mc plug-in for intellij it does it for u

#

try updating that plugin @jovial timber

opaque escarp
#

Would it be a good idea to start annotating new methods or classes implemented in the API with the @since annotation? Since Velocity is the only PaperMC project that uses semantic versioning, I think it could be applied

jovial timber
nova sparrow
#

good luck noah!

jovial timber
#

?

elfin gorge
#

How can I set a player's permission ?
I remember there's a ProxiedPlayer#setPermission
in waterfall

#

but I don't know how do achieve that in velocity

oblique haven
craggy pecan
#

Setup

oblique haven
#

^

minor glacier
#

Is there a services manager (like in Bukkit) in Velocity?

#

I just want a simple way to register a service provider and grab it in another plugin

fossil sundial
#

A what now? Sorry you’ll have to explain what you mean

fossil sundial
#

There’s no such concept on velocity

minor glacier
#

šŸ‘ thanks

jovial timber
#

does it put a shaded jar in another directory or something

jovial timber
#

it seems to shade automatically if i make a spigot plugin

#

but not velocity

#

nvm got it

jovial timber
#

how do i do run things async in velocity or is it just async in nature

rich hawk
#

scheduler, also there’s no main thread

jovial timber
#

how do i get server

carmine trout
#

the Audience returned by ProxyServer#getConsoleCommandSource seems to drop all messages, is this expected?

burnt dragon
#

(sorry to push you somewhere just to reply there, i got curious :p )

carmine trout
#

oh hi

#

nice find

burnt dragon
#

easy PR if you want it, just change that to override the right one

carmine trout
#

yeah it needs to override the one with identity, component, messagetype?

#

I guess a nice opportunity to clone velocity and make a PR

burnt dragon
#

yup i think so!

carmine trout
#

not sure what the difference is between "system" message type and "chat"

#

seems ok to just ignore

#

yeah that fixed it

#

amazing

burnt dragon
#

system is "the system", so the messages are always displayed (can be death messages, etc) and chat is player chat messages (which are ran through the social filter client side, and probably the text filter eventually)

carmine trout
#

yeah so it probably doesn't matter for console messages

#

funny how velocity uses the legacy component serializer

burnt dragon
#

yeah the tca thingy does legacy to ANSI so there's no real other way to do it

#

until adventure writes an ansi serialiser :')

carmine trout
#

sounds like hell

#

it could support RGB colors which would be nice

burnt dragon
#

I think it does already

carmine trout
#

and it would be nice if the named text colors were translated into the proper ansi escape sequences so it worked with light terminal themes

burnt dragon
#

or that might be a paper only addition

carmine trout
#

currently it results in white-on-white text

#

but very few people use light themes in terminals anyway

burnt dragon
#

you accidentally added a new line in the imports btw :p

burnt dragon
carmine trout
burnt dragon
#

gotta love them

carmine trout
#

only moved from eclipse this year lol

outer flower
#

How does ConnectionRequestBuilder#connect() work? I tried using it, but it didn't do anything. Do I have to disconnect the user from their current server before running this?

craggy pecan
#

You should check the result of the returned CompletableFuture. Alternatively, just call fireAndForget and Velocity will deal with that for you

outer flower
#

Thanks! I’ll try that tomorrow

latent zodiac
#

How does the forced-hosts config option work? I'd like to make a plugin that replicates this.

Where can I find the code that's in charge of that?

For context, I'd like to run different code on the player depending on the subdomain entered. Each subdomain still points to the same subserver tho but just has a diff function

latent zodiac
#

Figured it out. I needed the following code

        String virtualHostStr = event.getConnection().getVirtualHost().map(InetSocketAddress::getHostString)
                .orElse("")
                .toLowerCase(Locale.ROOT);
        System.out.println("connected from the subdomain: " + virtualHostStr);```
maiden hawk
#

Hi, is it possible to write (images) on maps in Velocity?

#

I guess there's no official api for it, but is there anything unofficial?

rich hawk
#

need to do that on backend

maiden hawk
#

It's just all packets

#

I'm just looking whether anyone has experience with it

vernal compass
#

Don't really see the benefit of doing that on the proxy tbh. Imo all content-related things should usually stay on the backend

maiden hawk
burnt dragon
#

probably easier to do it in chat

vernal compass
#

yeah, at least a version 1 QR code should fit nicely in chat.

If really want to do maps, you will need something to convert the image to map data. there are libraries out there for that, but im not sure if any of them would work on velocity. The rest is just three packets, that should be easy, but the map data is a bit complicated

maiden hawk
vernal compass
#

does it really need to be that big? thats quite a lot of data

maiden hawk
#

I think it can't get smaller than that

#

yup

#

It can't

vernal compass
#

yeah then you will need to figure out the map data stuff.
Or just do it on the backend and put them in a void world or black room or something until they have authenticated, then you can just use the Bukkit API and MapCanvas#drawImage

maiden hawk
#

Do you (at least) have any libraries which do similar map stuff for bungeecord?

#

I can port it to Velocity easily (I believe)

vernal compass
#

Not aware of any, and a quick search also found nothing.

https://github.com/cerus/maps this is for bukkit, but it is completely packet-based. that might be helpful

maiden hawk
#

Thanks šŸ‘

latent zodiac
#

Is the velocity forums the only place to advertise / publish a velocity plugin?

Is there something like ore on Sponge or Spigots plugin repo?

vernal compass
#

not yet. Hangar will have a place for that when its finished eventually as far as I know

latent zodiac
#

Sounds good, thanks!

#

I'll probably write something up later today or tomorrow. Need to do like one or two more features before I release

merry trellis
#

Just want to check im understanding this correctly. if i had 100 players on my velocity server and ran this...

AtomicInteger currentPlayers = new AtomicInteger(VelocityMain.getServer().getPlayerCount());
  VelocityMain.getServer().getAllPlayers().forEach(player -> {
    currentPlayers.set(VelocityMain.getServer().getPlayerCount());
    player.disconnect();
    getLogger().info(currentPlayers.get());
});
#

I am assuming the getLogger().info(currentPlayers.get()); would output from 100 to 0? I unfrotunately dont have a lot of players to test with

#

My ultimate goal is to kick any "alts" from the server and if the alt leave room allow a player to join...

rich hawk
#

should probably kick first then set or decrement

craggy pecan
#

I don't see the need for that atomic variable, you're already calling getPlayerCount on each disconnect, save that to a variable inside the lambda and then log it

#

The solution to non-effectively final type usage inside a lambda isn't prefixing everything with "Atomic"

latent zodiac
#

Is there any examples code wise I can look at for storing data?

Specifically, I just want to store a specific hashset

craggy pecan
#

There's multiple approaches, but it's out of scope for Velocity. For example, you could use a database, a text file, etc. depending on its purpose

frosty hemlock
#

Hey, where are the Recipes stored in paper/spigot/bukkit? wrong channel

bold wharf
#
  1. Wrong channel
  2. provide context towards what you're doing
frosty hemlock
#

Oh sorry

lunar quail
#

is there any way to use ${project.version} from pom.xml in @Plugin annotation?

#

or a corresponding gradle version property, I don't care which build system to use yet as I've just created a project

bold wharf
#

cleanly? no

#

I know it's doable, 2 second google points towards stuff like the maven templating plugin, I'd imagine gradle has a similar thing, but, it's generally not ideal

lunar quail
covert zealot
#

Hello
I was trying to make a caching system.
The idea is to cache data about the player on PostLoginEvent then send it to all Paper servers using plugin messaging.
I realised this might not work, then I tried to send it to the server on ServerPostConnectEvent.
It is working but is there any way to send the cached data to all the Paper servers via plugin messaging on PostLoginEvent?
This is what I originally tried.

@Subscribe
public void onPostLoginEvent(PostLoginEvent event) {
    for (RegisteredServer server : proxyServer.getAllServers()) {
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        ...
        server.sendPluginMessage(CACHE_CHANNEL, out.toByteArray()));
    }
}
bold wharf
#

well, that will send the cached data towards all servers in which there is a player connected in a state where it can send such data

covert zealot
#

When I tried to join and the event fired the sendPluginMessage returned false

#

Maybe I'm trying it in a wrong way, but I really want to send the data to all the servers even if there is no player on it

bold wharf
#

plugin messaging uses the players connection

#

if theres no player connected to that server, theres no player to send that data over through

covert zealot
#

Oh

bold wharf
#

if you want reliable message sending you really need to look into stuff like message brokers, etc

covert zealot
#

I might just try to use redis for caching my data, anyway thanks for the explanation.

maiden hawk
river wing
#

how can i change 'Not authenticated with minecraft.net' message to something else

uncut storm
#

Hello, can i use velocity with paper in 1.8.8 ?

#

Because velocity is using java 11 and paper java 8

rich hawk
#

install both java versions

uncut storm
#

i did

rich hawk
#

and run each jar with the /path/to/java for it version

uncut storm
rich hawk
#

yes

uncut storm
#

ahhh okay thanks you so much !

boreal shore
#

how can I send plugin message from velocity to paper plugin?

#

i try to send the message when the pluginmessageevent is fired with:

            ByteArrayDataOutput output = ByteStreams.newDataOutput();
            output.writeUTF("Test");
            output.writeUTF("Heyo!");
            event.getTarget().sendPluginMessage(event.getIdentifier(), output.toByteArray());``` but plugin message listener in paper plugin doesn't catch this
bold wharf
#

make sure that you registered the channel

#

also noting that a player needs to be online on that server in order to be able to be sent a plugin message

boreal shore
#

i registered the channels on velocity and paper, and the player is online

#

i send test message from paper to velocity, and it works

#

and i want to send it back to paper, when pluginmessageevent is fired

#

on paper i registered the channel as outgoing and incoming (with listener)

nova knot
bold wharf
#

probably building against outdated API

nova knot
#

i am using velocity 3.1.1 and velocity-api 3.1.0?

bold wharf
#

that looks like old adventure though

nova knot
#

its v4.10.1 tho

nova knot
#

so what should i do? i can tell that in the velocity.jar this class does not exist even though i am using v3.1.1-98

#

i could try using a dev build but i cant think of another fix

bold wharf
#

you should use a dev build

#

maybe that's it

nova knot
#

ill try it thank you

bold wharf
#

doing a "stable" release is something I've been asking about doing, just, er, brain, ouch, facedesks

boreal shore
#

Ok, fixed! I have to send plugin message with server connection, not ChannelMessageSink (event.getTarget())

#

but then how can I catch the message sent with event.getTarget().sendPluginMessage(//)?

fossil sundial
boreal shore
bold wharf
#

event only fires if the channel is registered I think

#

and the player sending the message is actually in the world

boreal shore
#

Paperjava getServer().getMessenger().registerOutgoingPluginChannel(this, "x:essentials"); getServer().getMessenger().registerIncomingPluginChannel(this, "x:essentials", new Test());Velocityjava proxyServer.getChannelRegistrar().register(new LegacyChannelIdentifier("x:essentials"));

bold wharf
#

oh, doesn't care about the channel being registered, just cares about the state and the listener being registere

#

LegacyChannelIdentifier

#

that sounds wrong

#

Legacy is pre 1.13, i.e. not namespaced

boreal shore
#

ok, i changed it to MinecraftChannelIdentifier.create("x", "essentials") and target works good

#

thx!

buoyant kayak
#

is ProxyPingEvent async?

fossil sundial
lunar quail
#

is there anything like bukkit's PluginDisableEvent on velocity?

rich hawk
#

no

fossil sundial
lunar quail
fossil sundial
#

That will be done during restarts of the proxy

lunar quail
#

not sure if I should support such cases to be honest

fossil sundial
#

We’ve learned from the mess that is runtime dynamic loading and the horrible issues that come with it.
If at all Velocity may support soft restarts in the future

#

But we won’t support things such as this

lunar quail
fossil sundial
#

If you want you can look at how that plugin did it. However be warned it will cause issues and it may break at some point because of internal changes

lunar quail
#

ok, thanks. one more question: where can I see the full list of fields that I can have with@Inject? and I'd also like to read about how this injection thing works, because there doesn't seem to be much information about it at docs.papermc.io/velocity

digital rock
#

Why has velocity Not implemented MiniMessage By default?

bold wharf
#

afaik it's part of the API now

digital rock
bold wharf
#

afaik

#

it's part of the core of adventure

digital rock
#

No

bold wharf
#

make sure that you're targeting the latest snapshot

digital rock
#

3.1.1?

#

Isnt That the latest version?

bold wharf
#

3.1.2-SNAPSHOT

digital rock
#

Oh ok, Iā€˜ll try out.

#

Thx

wide tide
#

and if you really want to detect ServerUtils' disable action specifically, you can listen for the VelocityPluginDisableEvent (PRE stage) from the SU api

burnt dragon
#

minimessage isn't part of the core adventure API, it is a separate module

#

however it is included in velocity as of the latest snapshot version

opaque escarp
#

Is there any reason why the ProxyServer interface extends the Audience interface instead of ForwardingAudience when the VelocityServer class that implements it does implement ForwardingAudience?

burnt dragon
#

sounds like an implementation detail to me

restive idol
#

Hello, how i'm supposed to ping a server to see if is online?

restive idol
#

There is any code example?

fossil sundial
#

Wdym, that code would be highly situational

#

So tell us what you’re trying to do

restive idol
#

I need to ping a list of subservers

#

To see if they are online

fossil sundial
#

Do you need the result right away

restive idol
#

What do you mean?

fossil sundial
#

you need to wait till the ping completes to get a result

#

That’s why I’m asking and that’s why the code is highly situational

restive idol
#

Yeah i know that

#

I needed some example just to understand how it works

maiden hawk
#

It returns a future

restive idol
#

On bungeecord is pretty easy, on velocity is a pain

maiden hawk
#

Why pain?

#

You can find many guides on how to use futures in Java

fossil sundial
#

ping().get() is how you wait for it to complete while blocking your current execution

#

That’ll throw an exception if no data is there

maiden hawk
restive idol
fossil sundial
#

Yes.

maiden hawk
#

Usually

restive idol
#

K seems easy then

fossil sundial
#

You’re in reality supposed to use .thenAccept(…) and .exceptionally(…) or .whenComplete(…,…)

maiden hawk
#

^

restive idol
#

Yeah i saw, thanks

restive idol
#

boolean isActive returns if player is connected to the server?

lethal canyon
#

How can I make a command for the plugin so that it reloads after the execution of the command, like:
/velobby reload
?

frail spindle
#

Hi, how can I create a shorter version of /server lobby, best would be if I could make it "/l"

buoyant kayak
#
GitHub

This effectively closes #68. In the absence of work on a native Velocity plugin communication API, I think we should strongly consider integrating BungeeQuack directly into the Velocity core. The m...

sour current
#

yes

buoyant kayak
#

alright thanks

vapid prawn
#

Hi I'm getting this error and idk why, it should work fine.
The code:

@Inject
    public VMain( ProxyServer proxy, Logger logger, @DataDirectory Path dataDirectory ){
        this.proxy = proxy;
        this.logger = logger;
        this.dataDirectory = dataDirectory;
    }
rich hawk
#

you need to exclude signed files

#

from your jar

vapid prawn
vapid prawn
rich hawk
#

exclude the signed stuff

proven temple
#

Thinking about switching from Waterfall -> Velocity. Can anyone give me a rundown of the major differences?

proven temple
#

Thanks, does Velocity support plugin messaging out of the box, or would I have to make a custom plugin for this? I'm trying to move a player from one server to another within a bukkit plugin.

bold wharf
#

it implements bungees messaging channel

proven temple
#

Awesome

turbid jay
#

Hey. I'm starting with writing a plugin for velocity as my first java project. Now, there's the first choice: Maven or Gradle?

I've looked at a few other plugins for velocity, and it seems Gradle is a bit more common, which would of course help with me getting questions answered.

Another question is of course, is there a decent boilerplate project I could use?

fossil sundial
turbid jay
#

Thanks! Got that going luckily šŸ™‚ Doing development without a Jetbrains IDE would feel weird to me.

boreal shore
#

How can I check on proxy if message was send from player or server?

bold wharf
#

check the source of the message and instanceof it?

boreal shore
#

this doesn't work event.getSource() instanceof Player player

#

and I send plugin message like player.sendPluginMessage(...)

bold wharf
#

and you sent that from where?

#

cos, if you ran that code on the server, the source will be the server

boreal shore
#

from paper to velocity

bold wharf
#

also, see what that getSource() thing returns as I don't recall it being a Player instance directly that was returned but some other object

#

ah, yea, either Player or ServerConnection

#

but, if you sent if from paper, that's the server

boreal shore
#

oh, ok, so If I want to get player in the proxy I have to send their uuid/username via messages?

bold wharf
#

what?

boreal shore
#

I mean that player which I tried to get from source šŸ˜„

bold wharf
#

get it from the ServerConnection I'd guess

rigid vine
#

are there any velocity plugins, which are made with maven and use bstats?

ashen fiber
#

Maven is bad

rigid vine
#

yet still the only thing that works on my pc c:

bold wharf
#

you add the repo, and add a relocation pattern to the shade plugin

#

well, add the dep, idr if they use a custom repo

#

but, last I knew they documented how to do that

rigid vine
#
    <dependencies>
        <!-- https://mvnrepository.com/artifact/com.velocitypowered/velocity-api -->
        <dependency>
            <groupId>com.velocitypowered</groupId>
            <artifactId>velocity-api</artifactId>
            <version>3.1.1</version>
            <scope>provided</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.moandjiezana.toml/toml4j -->
        <dependency>
            <groupId>com.moandjiezana.toml</groupId>
            <artifactId>toml4j</artifactId>
            <version>0.7.2</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/net.kyori/adventure-api -->
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-api</artifactId>
            <version>4.10.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage -->
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-text-minimessage</artifactId>
            <version>4.10.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.bstats/bstats-velocity -->
        <dependency>
            <groupId>org.bstats</groupId>
            <artifactId>bstats-velocity</artifactId>
            <version>3.0.0</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>org.bstats</pattern>
                            <shadedPattern>eu.prellberg.nick.velocityplus</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

that's the content of my pom.xml

#

it should be working

#

as far as I know

#

but the error I get is: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project velocityplus: Error creating shaded jar: null

bold wharf
#

update shade plugin

rigid vine
bold wharf
#

run a build

#

that's 100% a valid version, your IDE is being dumb