#waterfall-dev

1 messages · Page 12 of 1

outer cosmos
#

Line 11 in bungeelistener. Please use dependency injection.

vivid bronze
#

thanks for helping :D
its working now ^^

sturdy nymph
#

@wide maple were you ever able to get your switching rework tests to work? I've been trying to send a custom login and respawn packet to the client, but I think my dimension is invalid, as the client displays this error.

#

I listened in to normal packets sent by the server to get an example of what a valid login/respawn packet looked like, but I was still unable to get it working properly.

low moon
#

I can't seem to import waterfall as a maven dependency.
This is what I have configured

// Repos
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>destroystokyo-repo</id>
            <url>https://repo.destroystokyo.com/repository/maven-public/</url>
        </repository>
// Dependency
        <dependency>
            <groupId>io.github.waterfallmc</groupId>
            <artifactId>waterfall-api</artifactId>
            <version>1.16-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

oh. Ignore me

#

my version ID was incorrect

wide maple
#

@sturdy nymph you’re better off referring to what we do in velocity- I didn’t update my switching rework to 1.16.2 (which is where the registry changed) ie https://github.com/VelocityPowered/Velocity/blob/master/proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionData.java

However if you’re planning to go through with it- you’ll also have to implement the biome registry part in 1.16.2- good luck on that one

GitHub

A Minecraft server proxy with unparalleled server support, scalability, and flexibility. - VelocityPowered/Velocity

sturdy nymph
#

@wide maple I see, thank you. Do you know what the absolute minimum requirements are for the dimension? I'm just sending my own login packet, so I'm defining my own, single, empty dimension, so I don't have to keep track of everything else, as I'm pretty sure that would make it more likely that my plugin would break with updates, especially given that I don't have a huge amount of time to work on updating it.

Also, sorry if I missed it, where is this biome registry? Or is that what the dimension defining info is called (all the ambient_life, piglin_safe, infiniburn data)? Or is that something else on top of it? I can't see any clear example of it on wiki.vg

bleak current
#

How do i build travertine with 1.16.2 support

trail plume
#

it supports 1.16.2?

molten jackal
#

I am having an odd issue. Sometimes PlayerDisconnectEvent is not called when a player disconnects. I believe the reason is because they timed out. The way they time out, I think, is because they connect to a server right as it is shutting down. So they connect and get immediately disconnected but waterfall/bungee (not sure whos fault it is) never calls the event. I noticed this because I have a log database that tracks all the times players join/leave (and with this, I calculate full play time with ease), and sometimes there is a row left with 0 (the default, which means they are online still) as the disconnect time. So over time it gives players insanely high play times. I have a temporary solution, but I'm confused on why this would be happening.

#

I've changed my thoughts on what's causing it. I just tested what I explained and that's not what the cause is.

#

I'm kind of clueless now

lapis glade
#

could you make waterful pull its config from a mysql database on startup?

#

or better yet. just completely use a mysql database table for its config

#

is that possible?

wide maple
#

Without patching it or without a custom launcher that’s not possible. However- it’s possible to modify all values the config did. set after startup

lapis glade
#

So a plugin that after it starts up. It modifies the config.yml from the database

#

Then next restart it would have the config you want

lean gobletBOT
#

zero reason to do that as a plugin/fork imo, you can simply pull the updated file from your database via yourt startup script

#

(or just use NFS)

bleak current
#

you can easily implement your own configuration adapter

#

set it in onLoad and call it a day

#

however when you really insist on using *sql then you must do your own configuration remapping - bungeecord expects kind of key-value storage

lean gobletBOT
#

ProxyPlayer#getListenerInfo or something like that

cyan garnet
#

Ended up finding it plugin.getProxy().getConfig().getListeners()

slender grotto
#

excuse my ignorance but what is the correct way to build a test waterfall version without having to create a patch?

trail plume
#

mvn package

slender grotto
#

thank you

wide maple
#

You should always mvn clean package imo

paper maple
#

How to send JSON message to player directly (Not use BaseComponent etc) via Bungeecord?

#

I found ComponentSerializer::parse. So, it was resolved thx.

wide maple
#

that was gonna be the first thing I'd suggest. Alternatively you can always send raw packers

#

¯_(ツ)_/¯

slate tendon
#

so like im confusion

#

at first i thought plugin messaging was easy

#

but

#

how would i send something down a custom channel which has a subchannel and an argument such as an integer

#

so it can indicate its either removing or adding an integer from something

#

should i just send something like subchannelname;data;moredata

#

and then recognise that

#

or

#

ping me if anyone answers

chilly coral
#

The data goes to the byte array

#

The channel is to define the type of message you are sending

#

The exemple is perfect and this is how you should do

slate tendon
#

yea but i want to send extra data

#

like the channel, sub channel, multiple uuids, and an integer

#
        ByteArrayDataInput in = ByteStreams.newDataInput( event.getData() );
        String subChannel = in.readUTF();

like i see this on the tutorial

#

does that in.readutf thing return the whole string of data sent

lean gobletBOT
#

it depends on how you send it

#

just read in the same order as you send

#

e.g. first readUTF, then readInt and then readUTF again

#

if you want multiple UUIDs then I suggest using an int to indicate the count then write the UUIDs as longs (most and least singificant bytes)

#

then you can read the amount and read the longs

#

(of course you can also just write them as UTF but afaik that is more data

slate tendon
#

Yea that makes more sense I didn't know that's how it worked thank you

grizzled thistle
#

getting a null on line 29 some times

#

I assume the response is null some times, is that normal?

trail plume
#

If there was no response, yes

bleak current
#

everything can be null in bungee

potent lichen
#

^ pretty much. a quick look at some beans tells me there are no preconditions as to what can be passed in

trail plume
#

major thing is pass through, if the server doesn't respond, it'll be null

bleak current
#

but I don't figured out how to send the data to the player

slate tendon
#

see if i have a Configuration, is there a way to loop through sections in that config?

#

nvm i dont need it anymore i found a better solution

potent lichen
#

config.getKeys

lean gobletBOT
#

probable due to your config file's encoding

#

make sure to use UTF8 for that

#

also, uh, wrong channel I guess. I see that you asked in paper too lmao

hexed fractal
#

since 1.16 i cant use ComponentSerializer.parse(json); because they is something new like contents can someone help.

com.google.gson.JsonParseException: Could not parse JSON: missing 'text' property

[{"text":"[Suratix] player has voted!","clickEvent":{"action":"OPEN_URL","value":"minecraft-server.eu"},"hoverEvent":{"action":"SHOW_TEXT","contents":[{"value":"Click for Vote"}],"legacy":false}}]

lean gobletBOT
#

are you using the latest version?

#

if so then this might be the first time for this happening on the server side instead of client? Oo

hexed fractal
#

yeah i used now the newest version same error

trail plume
#

Mojang changed something with the components

hexed fractal
#

yeah :c

trail plume
#

iirc, value is now "text", as it's complaining about

lean gobletBOT
#

oh, right, that isn't even valid components

#

only 1.5x the size but yeahfor the current specification if you really must use raw json input for whatever reason

hexed fractal
#

I don't know what to do now.

trail plume
#

replace "value" with "text"

hexed fractal
#

i replaced contents with text its work now without error, message is displaying but clickEvents & hoverEvents dont work.

hexed fractal
#

ok thanks i fix it now complety without replacing stuff.

ComponentSerializer.toString(baseComponent); //All Components to String.
ComponentSerializer.parse(object.get("baseComponents").getAsString()); //All Components from String to Components

grizzled thistle
#

What should I do to prevent hitting the mojang rate limit on waterfall?

trail plume
#

load balancing of some form

grizzled thistle
#

not sure what to do

trail plume
#

You either mitigate it by running multiple waterfall proxies across different IPs, or by using proxies or something somehow, waterfall lets you configure the auth URL for this purpose

grizzled thistle
#

how many players do you think is a good amount for a single proxy?

#

I run everything on 1 big dedicated server

trail plume
#

more about join velocity than anything

#

Everything on a single box ain't going to do you much good here

#

Unless you're doing something to contain stuff in a way that you can configure it to use different public IPs somehow

grizzled thistle
#

Does velocity have a way to configure the auth url

trail plume
#

No idea

#

By "join velocity", I mean the rate at which players are logging in

grizzled thistle
#

oh

weary grove
#

Does velocity have a way to configure the auth url
@grizzled thistle I’m pretty “eh” on that one, I can see the benefits but it seems too much like an official piracy hatch for me. We’ll see.

trail plume
#

I felt the same which is why I kinda delayed on it

grizzled thistle
#

what are people supposed to do then about the rate limit Tux

trail plume
#

Eventually I got to the "people already use plugins for this stuff, and not like replacing a line in the server is that hard"

grizzled thistle
#

am I really gonna have to fork velocity?

#

what plugins do this cat?

weary grove
#

I mean, it’s an one line patch, I could do it easily

#

But it’s late now, so I won’t do it yet

trail plume
#

Don't know of any off the top of my head, stuff like "online/offline" join stuff are capable of doing it, etc

grizzled thistle
#

isn't that like cracked servers

weary grove
#

Do consider that you need to find a way to bypass the limit

#

You could throttle logins before any authentication is done

grizzled thistle
#

yea is there a config option for that

#

and what should I set it to you think?

trail plume
#

You'd need to setup a proxy which can distribute the requests

#

There is no magical way of doing this

weary grove
#

That’s per IP, not very effective since a real attack would use open proxies or similar

trail plume
#

the easiest option for smaller networks is to just RR proxy instances

grizzled thistle
#

whats that

trail plume
#

(across a few VPSes, etc)

#

round robin, DNS load balancing, basically

grizzled thistle
#

not sure how to do that

weary grove
#

Are you really running into rate limit issues?

grizzled thistle
#

I'm afraid I'm going to be, getting 200+ players concurrently

weary grove
#

You aren’t running into them now. Best to wait and see

grizzled thistle
#

I want to prepare

#

because it literally grows every day

boreal crown
#

Is there a class or method path I can look for to see, if the current proxy implementation is Waterfall?

bleak current
#

waterfall configuration class

boreal crown
#

Which is located where exactly?

#

The javadocs don't give any info on this

bleak current
#

because it's not part of the api

#

lemme c

#

io.github.waterfallmc.waterfall.conf.WaterfallConfiguration

boreal crown
#

ok thanks

#

Can I just cast the getLogger to a SLF4J logger when I want to have a more generic Logger (For multi-platform support)?

potent lichen
#

no

#

the plugin logger doesn't implement the slf4j logger

#

you need to use LoggerFactory or getSLF4JLogger

boreal crown
#

I don't quite understand the LoggerFactory one...
And since my plugin wouldn't just run on Waterfall is there no guarantee that their SLF4JLogger implementation is there...

potent lichen
#

LoggerFactory is the standard approach slf4j exposes for getting a logger

#

And since my plugin wouldn't just run on Waterfall is there no guarantee that their SLF4JLogger implementation is there...

#

Then you neither have a guarantee slf4j is even on the classpath

boreal crown
potent lichen
#

yes, that will work

#

you can use getClass() if your logger is an instance variable

#

but assuming you just want a global logger for your entire plugin, this is fine

boreal crown
#

Okay.... Now I just need to find a way to make a platform-independand YAML config handler... Will be sooooo fun ablobunamused

potent lichen
#

it's not too hard; use snakeyaml to load a Map<String, Object>

boreal crown
#

Sounds easy for you, but I'm quite a beginner on this part

potent lichen
#

the Map you get will be a hierarchical Map of nested maps. Each subsection is a map within the top level map

#

and so on

boreal crown
#

.....Thanks for making it even more complicated sounding

potent lichen
#

no, that's the truth.

#

Your map won't have keys such as "section.subsection.subkey"

#

rather you'll get "section" in the top-level Map which points to a smaller Map corresponding to the subsection.

boreal crown
#

But how would I load a file tho?

potent lichen
#

yaml.load(Reader)

boreal crown
#

like a config.yml inside the resources folder...

potent lichen
#

Files.newBufferedReader(Path, Charset)

#

or use InputStream with clazz.getResourceAsStream

bleak current
#

PluginClass.class.getResourceAsStream("/config.yml")

boreal crown
#

Isn't there JUST a simple lib to load and handle files with simple "getString", "getInt", etc? It gets really annoying by now...

lean gobletBOT
#

(and yes, it works independently from the BungeePlugin class

boreal crown
#

If it does then why are there things like the ConfigurationProvider from Bungee thonk
And also constructors for the Bungee plugin?
Like which parts of it are important to look at?

lean gobletBOT
#

the class that I pasted

#

either copy it or use the maven artifact

#

and it does not depend on the BungeePlugin class in the same repo, I didn't say that it doesn't depend on Bungee's Plugin class

boreal crown
#

The class you pasted does use BungeeCord stuff which I can't because my plugin should also support Velocity and not just BungeeCord/Waterfall

lean gobletBOT
#

it's a configuration wrapper for Bungee

#

then shade the configuration library of your choice in your plugin if you don't want to use Bungee's configuration library

boreal crown
#

Many said I should use SnakeYAML, but I never did use it.... So if you have a starter guide would I appreciate it

lean gobletBOT
#

both bungee and bukkit use snakeyaml so just do what they do I guess

#

I personally would just use a platform-specific configuration adapter

#

(at least that's what I do in my cross platform plugins. use Bungee's configuration api for bungee and Velocity's Configurate in Velocity

boreal crown
#

Would Configurate from SpongePowered be an option to use?

lean gobletBOT
#

yes, its what Velocity uses internally

boreal crown
#

okay. Just need to find out how I can set two separate paths for source and target location, since it seems Configurate only has a way to set one...?

wide maple
#

.3 is out

#

Is md already awake

#

I think it’s too petty to make a dedicated patch for this, it’s literally just a protocol bump

#

I’ll rebuild patches and PR it once it’s ready

full glacier
#

is 1.16.3 out yet

#

for waterfall

civic valve
#

no twitchsmile

wide maple
#

@trail plume wanna merge that pr? its really petty

lean gobletBOT
rigid bridge
#

yeah I deleted the message after looking at the readme 😂

#

ty

plucky hearth
#

I love seeing people report issues to BungeeCord GitHub when using Waterfall

wide maple
#

Yea inb4 md likes to see those people

trail plume
#

I mean, that report is literally a bungee issue anyways

wide maple
#

Don’t tell him that

#

Next he is gonna need to start considering taking paper issues seriously like they affect spigot too
... and not just paper
... but nobody reports them on spigot
... because barely anyone uses spigot on its own anymore
... but he doesn’t care either way

plucky hearth
#

When Spigot is gone... that'll be a great day.

#

Maybe gone isn't the right word

#

But more so that Paper becomes mainstream as Spigot is (kinda? not as much as it used to be). Maybe even if Paper was not a Spigot fork, but a Bukkit fork

#

(that'd be great)

weary grove
#

it'll be a great day when Velocity is dominant

zinc falcon
#

Having an issue running a plugin through Waterfall. Wondering if anyone's got some insight on the matter. Basically struggling to use hex colours in text. Tried with raw use of java.awt.Color#Any_Color but the ChatColor fails to parse it. Parses fine with raw net.md_5.bungee.api.ChatColor#Any_Color.

I've managed to get our tab list running using the same method of creating a color by decoding hex and using ChatColor.of(), but it seems to fail in a standalone plugin and not placeholders. I'm not entirely sure on possible reasons for it at this point. Using Waterfall 372 and previously Waterfall 371.

https://i.imgur.com/EBfziue.png

trail plume
#

Well, it won't work because of how toString works

#
public String toString() {
        return getClass().getName() + "[r=" + getRed() + ",g=" + getGreen() + ",b=" + getBlue() + "]"

is how it dumps out the string

#

the way that API works also won't change between where it's called, that more just sounds like something is potentially mishandling it elsewhere in your plugins

#

rgb support is a hack in bukkit

zinc falcon
#

the bungee ChatColor.of() uses the java.awt.Color input though, afaik

#

And Color.decode(#FFFFFF) and Color.decode(0xFFFFFF) work outside of the ChatColor usage from all testing/usage I've done.

trail plume
#

Oh, it does support AWT

#

I'm not sure what your issue is, tbqh

zinc falcon
#

gdi bungee api catree

trail plume
#

You mean, it fails in tab but not in chat, etc?

zinc falcon
#

It fails in chat, like in the screenshot above, but my tab list prints out fine using that method to create a string for a placeholder

#

Hmm- I wonder if it's textcomponent actually

#

Not the colour creation but the representation of it when put into chat

#

Lemme play with it, sec

trail plume
#

You mean like how event and build are the same color?

#

Are you sure that you have nothing else on the server which might be toying with it?

zinc falcon
#

Nothing, running this through a blank waterfall instance to be sure.

#

And it's that none of the hex colours are pulling up proper

#

(Mod, Tech, Build, Reception for those colours, using the exact same hex values)

#

Okay yeah it is TextComponent

#

For each entry the first line is just raw ProxiedPlayer.sendMessage(message), and the second is ProxiedPlayer.sendMessage(new TextComponent(message))

#

The first of course being deprecated

trail plume
#

you can't do the latter

#

You need to actually set the color of the component using the color method on the component

zinc falcon
#

What of messages with multiple colours then?

#

(like the above)

trail plume
#

Multiple components

#

Use the component builder API

zinc falcon
#

Alright, I'll take a look into that then. A bit annoying, but hey, at least it'll work.

trail plume
#

There is also the adventure library if you want a nicer API to work with

zinc falcon
#

Noted, thanks zz! Your help is very much appreciated

trail plume
#

Well, yea, but that's basically just how chat components works, and it makes sense with how they're represented, better than magic strings like we had/have

zinc falcon
#

Fair enough, I suppose it's just my magic string user being frustrated that I need to go back and redo every textcomponent call haha

trail plume
#

TextComponent i think it was has a fromLegacy method, and also has the legacy RGB code hack in it

#

(which is why sendMessage works)

#
    public void sendMessage(String message)
    {
        sendMessage( TextComponent.fromLegacyText( message ) );
    }
zinc falcon
#

Mhm, I just try to avoid deprecated like the plague.

#

Don't wanna have to go through a global restructure in the event of it being removed

boreal crown
#

How would I go about adding a SLF4J logger to BungeeCord (Not Waterfall)?
It does work on Waterfall as it implements its own Logger instance of SLF4J, but since I also want to support BungeeCord is this an issue for me....

potent lichen
#

it is an issue for you

#

you need to get slf4j onto your classpath somehow

boreal crown
#

Yeah, but how is the question

wary inlet
#

classloader abuse?

potent lichen
#

there are a lot of plugins which shade slf4j

#

either because they use it or because they use hikaricp

#

if you do decide to do that, do remember to relocate it as well

#

and remember that plugin.getSLF4JLogger is not what you want

trail plume
#

iirc, slf4j already deals with the magic needed, but, god knows; You'd need to look over other plugins maybe

#

LP miiight use it iirc

potent lichen
#

mixing multiple slf4j bindings is not supported

#

conflicting slf4j versions will not work out. you have to relocate both the api and binding if you shade them

sly crown
#

you can't relocate slf4j bridge, it uses a service locator or something

bleak current
#

yeah

oak briar
#

how do i build my fork of travertine

#

nvm im blind

bleak current
#

yes

potent lichen
#

therefore you don't relocate slf4j bridge

#

you only relocate slf4j-api and slf4j-jdk14. it works

oak briar
#

alright so when im building waterfall i put bungee cord in the Waterfall-Proxy folder correct?

trail plume
#

No, you literally just run the script to build

#

Nothing more, nothing less

oak briar
#

When I run the script it says no pom.xml in waterfall-proxy server

coral lichen
#

Is there any public alternative to reconnect_yaml with redis support?

bleak current
#

@trail plume http://i.insanemc.net/idea64_u6RlFo23LR.png i am trying to update my custom travertine fork with my own patches and i try to add 1.16.2+ support. But when i do that this error occurs.

[ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project io.github.waterfallmc:waterfall-parent:1.16-R0.2-SNAPSHOT (C:\Users\joelb\OneDrive\Bureaublad\gay\Travertine\Travertine-Proxy\pom.xml) has 1 error [ERROR] Non-resolvable parent POM for io.github.waterfallmc:waterfall-parent:1.16-R0.2-SNAPSHOT: Could not find artifact io.github.waterfallmc:waterfall-super:pom:dev-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 13 -> [Help 2] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

what is the correct version?

wary inlet
#

please read the rules; pinging core, devs, mods, or triage without a valid (this is a channel for help, anyone could help with this) reason ain't allowed

bleak current
#

Then help ?

trail plume
#

Nobody owes you support in any capacity

#

The error is also spelt out in english

#

: Could not find artifact io.github.waterfallmc:waterfall-super:pom:dev-SNAPSHOT and 'parent.relativePath' points at wrong local POM

#

The parent pom is incorrect

#

Or, at least, does not line up with that pom there

hard fox
#

What's the repo for waterfall sadcat

#

The Minecraft plugin is doing something wrong and I don't know where to start to fix it

potent lichen
#

it may also be that you omitted the R0 number

lusty sphinx
#

what dejay you are here too

stone rover
#

Does Waterfall Support fast server switch?

trail plume
#

.try

lean gobletBOT
trail plume
#

We don't know, nor do we support it, but, it might work 🤷‍♂️

stone rover
#

Mhm. Fine. Thanks

wide maple
#

*fast server switch: The hacky completely bad solution that uses fake dim switches

#

... which doesnt work in 1.16 and newer anyway

#

... and is not even as fast as a properly implemented normal switch

lean gobletBOT
#

the normal server switch already uses fake dimension switches afaik. the fast one tried to not even do that but simply resend all the chunk stuff iirc

wide maple
#

Well that’s out the window now

#

Also @trail plume the jank on that GitHub issue with invisible players is caused by that horrible half-assed tablist uuid rewriting Bungeecord does. Shiver would you accept an option to disable that in WF as a PR?

stone rover
#

@wide maple the goal is switching without "black-screen" / "dim-switch-screen"

wide maple
#

That won’t fly in 1.16 anymore at all

stone rover
#

mhm. okay - thanks for your help 😛

wide maple
#

The problem is that since 1.16.2+ the indexes of the biome registry that is now also sent have to match

stone rover
#

I see

#

thats not the problem, the world is equal

wide maple
#

If you want to modify the source to allow it- go for it

#

But I have to warn you

#

What I said about indexes still applies

#

You also have to modify the server most likely

stone rover
#

mhm. not sure - maybe it will work in my case, but you are right - its not safe^^

trail plume
#

Three

#

entity metadata rewriting is back

wide maple
#

You gotta be kidding me

#

Aww come on god damnit why the heck

ornate jasper
#

what's tablist rewriting?

trail plume
#

It's what it says it is

#

bungee rewrites tab list entries

bleak current
#

daaamnit cat

#

now i have to figure out configuration migration :(

#

i have tablist rewrite disabling in firefly as well

trail plume
#

if get() != null, set, set to null, move on be happy

bleak current
#

thank am happ now

tall canyon
#

what

bleak current
#

move on, nothing to see here

weary grove
#

the jank on that GitHub issue with invisible players is caused by that horrible half-assed tablist uuid rewriting Bungeecord does.
Yet more evidence proving that the decisions made in Velocity were the correct ones in the long run

wide maple
#

We both know Tux

#

We both know

cyan garnet
#

Would it be ok to run a chat filter and chat logging on the proxy instead of each game server? since all messages go through that anyways, can't really see any disadvantage to it except it might cause more load on the proxy

tall canyon
#

you shouldnt put a lot of stress on the proxy imo

lean gobletBOT
#

really depends on what kind of calculations you do

#

I personally do all chat stuff on the proxy, lol

trail plume
#

all your checks happen on the network threads unless you take steps to pull off it, iirc

wide maple
#

Can confirm

#

If you’re interrupting the packet queue especially

#

^ cancellable Events do that in that context

cyan garnet
#

Ah right, so maybe better to handle logging on the proxy but any filters on each server

#

was thinking to have like regex chat filters

bleak current
#

Trying to get MOTD to show hex colours but it always shows as red. I've confirmed that i'm getting the hex String and replacing correctly with ChatColor.of(hexval with #) but when i use it via new TextComponent(convertedText), When i use #6600cc it turns it into &c which i've noticed is probably because it changes to this when not a textcomponent: https://gyazo.com/253c28ac5cad5a561148fe44e311b536 Does anyone have any ideas how i should go about this?

trail plume
#

Use components properly

#

or use the fromLegacy method on TextComponent, vanilla doesn't understand spigots hex horror show

bleak current
#

ah ok

#

Cheers i'll give it a go

thin latch
#

Hello, i'm writing a Sponge plugin, and I have a number of sponge servers all running under a waterfall proxy. How can I redirect a player from one server to another programatically?

trail plume
#

No idea of sponges API, but you'd send a plugin message

thin latch
#

the waterfall proxy has to do the actual redirecting, right?

trail plume
#

Yes

thin latch
#

basically my sponge plugin would somehow have to inform the proxy to redirect

trail plume
#

waterfall has bungees plugin message channel

#

.g bungeecord plugin messaging channel

lean gobletBOT
trail plume
#

ofc, you'd need to adopt for sponges API, but shouldn't be much different

#

bungeecord:main is the modern compat one iirc

#

(So, from whatever version they made that a namespace thing, use ^, otherwise, use the bungee one it says on there)

thin latch
#

ok, that's useful

#

What about adding a new server to the proxy programatically? is that even possible?

trail plume
#

You'd need a plugin on the proxy for that

thin latch
#

so i'd somehow communicate to the plugin on the proxy to register the new server

#

and it would do that via the waterfall API?

trail plume
#

yup

thin latch
#

cool, thanks

thin latch
#

is there a waterfall plugin build.gradle somewhere i could peek at? I see the artifact is pinned in here, but that's not all i'll need i'm assuming

potent lichen
#

you'll need the repo

#

it's just the papermc repo i'm pretty sure

thin latch
#
public class AtherysProxyPlugin extends Plugin implements Listener {

    @Override
    public void onEnable() {
        getProxy().registerChannel("atherysproxyplugin:main");
    }

    @EventHandler
    public void onPluginMessage(PluginMessageEvent pluginMessageEvent) {
        if ("atherysproxyplugin:main".equals(pluginMessageEvent.getTag())) {
            // received message on the atherysproxyplugin:main channel
        }
    }

}

Is this the correct way to consume a plugin message on some channel? The one guide on spigot's website uses the PluginMessageListener interface, but that's not present in Bungee or Waterfall's API, only the Spigot API.

thin latch
#
        InetSocketAddress inetSocketAddress = new InetSocketAddress("1.1.1.1", 8080);
        ServerInfo serverInfo = getProxy().constructServerInfo("test server", inetSocketAddress, "test", false);
        getProxy().getServers().put("test-server", serverInfo);
#

and is this the intended way to dynamically register a new server with the proxy?

trail plume
#

afaik, yes and yes

maiden orchid
#

Would someone know why I have the graphics after leaving a modality to the lobby?

weary grove
#

"the graphics"?

#

do you mean the boss bar?

slate tendon
#

what is the url to the repository i need to add to my maven configuration to use the waterfall plugin api

trail plume
#

same one as paper

slate tendon
trail plume
#

wrong artifact

slate tendon
#

oh

#

it was the one generated by the mc development idea plugin

#

also there isnt any autocomplete for the group or artifact so something else is wrong

slate tendon
#

oh

#

thank you

maiden orchid
#

Is it possible to know what is consuming ram in waterfall?

trail plume
#

typical heap dumps for checking the heap, native memory is generally "good luck"

maiden orchid
#

I have this problem

trail plume
#

.paste

lean gobletBOT
maiden orchid
#

then start kicking users out and not letting them in

trail plume
#

I mean, it basically says what the issue is

#

as for how you managed to run out of direct memory

#

Each netty thread uses like 16MB iirc for direct memory, so, either you just have too many netty threads configured, or, something else is eating memory

maiden orchid
#

How can I find out?

trail plume
#

🤷‍♂️

#

netty has a leak detector flag, but, really, i got no idea how you'd debug that stuff

#

native memory stuff is basically ass to deal with

maiden orchid
#

:S

#

It has to be from some plugin that I put in waterfall, right?

trail plume
#

could be

thin latch
#
public class AtherysProxyPlugin extends Plugin implements Listener {

    @Override
    public void onEnable() {
        getProxy().registerChannel("atherysproxy:main");
    }

    @EventHandler
    public void onPluginMessage(PluginMessageEvent pluginMessageEvent) {
        getSLF4JLogger().info(pluginMessageEvent.getTag() + ": " + new String (pluginMessageEvent.getData()));

        if ("atherysproxy:main".equals(pluginMessageEvent.getTag())) {
            ProxyCommand command = ProxyCommandService.getInstance().resolve(pluginMessageEvent.getData());
            command.run();
        }
    }
}

Hi, i just want to make sure i'm intercepting plugin messages correctly, because using this code, I can't get anything on the proxy

#

not even the logger outputs anything in this case

#

Is the tag in the PluginMessageEvent the channel name or something else?

wary inlet
#

you need to register it

thin latch
#

Am I not doing that in onEnable?

wary inlet
#

no, youre just registering a channel

#

you need to register the listener

thin latch
#

Aren't event handlers in the plugin main file automatically registered?

trail plume
#

proxy doesn't care about registration

#

You need to make sure that it's registered on players, otherwise it's not gonna send it

thin latch
#

how would i do that?

#

i mean, is this something i do on the proxy side, or on the plugin sending the messages?

trail plume
#

Well, that's what registerChannel is supposed to do is send the registration for that over

thin latch
#

So wait, registerChannel registers the channel not only on the proxy, but also on all of the server connected on the proxy? am I understanding this right?

trail plume
#

yes

#

The server will only let you send messages for known channels

#

Wait, I misread

#

It's too... erm... idk, am braindead

#

You need to register the event listeners, as proxi said, nothing to do with the channels

#

Proxi, come babysit me thx

thin latch
#

how do i register an event with the waterfall api though? 😄 this is getting to pretty noob-level questions I know, but the last time I wrote Spigot/Bukkit plugins was 4 years ago

#

I only have the waterfall api and nothing else in my proxy plugin project. Can I also add the bukkit/spigot api?

trail plume
#

Yes, but, you'd not be able to use bungee stuff in spigot code and vice versa, given that they won't exist in those environments

#

So, you'd need some form of logical seperation between the two, which is where people go for multi-module setups

thin latch
#

right, but this brings me back to my question, how do i register my event listener? 😄

trail plume
#

same as on bukkit, through the method on the plugin manager

thin latch
#

aha, right. Thank you very much, I didn't realize I even had to register mylistener 😄

thin latch
#

and is the 1st byte ( at index 0 ) reserved or something? I keep getting a seemingly junk value in the first byte, with my actual message after that in the array

true jay
#

Beginner question (sorry in advance)
What is the easiest way to retrieve a list of all users connected to the proxy?

I am trying to update an old plugin (~2016) that used these two things:

BungeeCord.getInstance().getPlayers().size()
BungeeCord.getInstance().getPlayers())

Besides not working in current versions, I haven't even figured out how that originally worked.
I have extracted the API javadocs from bungee build 1188, but couldn't find any mention of it.

potent lichen
#

use Proxy.getInstance()

true jay
#

Thanks!

potent lichen
#

For some weird reason, this plugin was using BungeeCord.getInstance() for something which is completely doable via the API

#

(The BungeeCord class is internal implementation and could change unexpectedly)

true jay
#

What do I need to import for that to work?

potent lichen
#

oh sorry, I think it's ProxyServer

true jay
#

I think it might still need an import (sorry; I am quite new to a lot of this stuff)

potent lichen
#

usually your IDE will suggest imports

true jay
potent lichen
#

so remove that import

true jay
#

ah, thanks, found it

potent lichen
#

to begin with

#

ok, good

true jay
#

net.md_5.bungee.api.ProxyServer

true jay
#

How would one go about having multiple authors in bungee.yml?

#

I attempted the bukkit authors: [1, 2, 3] in that screenshot

trail plume
#

You'd just need to put all the names

#

It's just a string, basically

true jay
#

ah

#

oh yeah... yaml

#

Wait... [1, 2, 3,] is valid in yml

trail plume
#

It's nothing to do with yaml

true jay
#

authors: [1, 2, 3] fails to load bungee.yml
author: [1, 2, 3] produces null

trail plume
#

Bungee wants a string there

true jay
#

ah

#

figured it out; thanks

tulip otter
#

Is there a reason bungeecord, and subsequently waterfall ignore events handlers in superclasses?

#

This is not the same registration behaviour from bukkit

trail plume
#

That's just how bungees event API is implemented

#

It follows the "norm" of event systems, but, somewhat bleh considering how it's all subclassed, etc

tulip otter
#

Thats like... pretty shitty though?

trail plume
#

Well, yes, but, bungee

wide maple
#

Bukkit/Spigot/Paper do the same

trail plume
#

no they don't

#

Bukkit lets you determine how that works

#

bungee, the event you listen to is the class that was fired

wide maple
#

I read the question wrong my bad

tulip otter
#

Wait I think you both misunderstood.....

#
abstract class Super implements Listener {
  protected abstract void handle(SomeEvent event)

  @EventHandler
  public void onSomeEvent(SomeEvent event) {
    handle(event)
  }
}

final class SomeImplementation extends Super {
  @Override
  protected void handle(SomeEvent event) {
    // code here
  }
}

// somewhere else
proxy.pluginManager.registerEvents(somePlugin, new SomeImplementation())
#

This will not work on bungee

#

But it does work on spigot/paper

#

Bungee searches for event handlers with Class#getDeclaredMethods only
but spigot/paper uses both Class#getMethods and Class#getDeclaredMethods

trail plume
#

oh

bleak current
#

hmmmm

#

could try opening an issue for bungee

#

but i bet this won't get very far

tulip otter
#

Issue already exists

#

And he said its a wontfix because

The only approach then is to implement logic to climb the class hierarchy which imo is overkill.
Which is just... not true...

#

bukkit does this... which is... honestly some really weird code

#

all done

bleak current
#

lmao

#

so someone tried 4 years ago already and that's exactly how i guessed it'd go

#

md just doesn't want to do shit

#

it's his ball, but he doesn't want to play nor let anyone else to

tulip otter
#

He could quite literally just copy paste the code, and it would cause 0 issues

lean gobletBOT
#

suggesting violating open source licenses 👀

tulip otter
#

?

lean gobletBOT
#

you can't just copy Bukkit code into Bungee xD Bukkit is under GPLv3

tulip otter
#

What about GPLv3 prohibits copying a specific piece of code from one project to another?

lean gobletBOT
#

that the pirce of code is copyrighted and the GPLv3 doesn't allow using it in incompatible projects?

#

*piece

tulip otter
#

Define incompatible

#

The copyright prohibits you from including the code in proprietary work that does not allow the release of the source itself alongside it

#

Both of which are conditions bungeecord does not fall under

lean gobletBOT
#

Bungee isn't under an open source license, GPLv3 requires that the license is GPLv3 compatible and that the combined work (the download) needs to be distributed under the GPLv3 or an even stricter copyleft license

#

and bungee can't be distributed under the GPLv3 without a re-licensing of it

potent lichen
#

bungeecord's license looks like MIT

#

or am I getting it wrong?

lean gobletBOT
#

it's BSD 3-Claus with an extra non-commercial clause which makes it non-free

#

*3-Clause

potent lichen
#

oh, i see

tulip otter
#

Where is the actual line drawn here though?

lean gobletBOT
#

wherever a court would decide

tulip otter
#

The implication of the license is that it must be redistributed with a modified version of the program

#

4 lines of code is not the program

lean gobletBOT
#

4 lines might be an extreme complex calculation, I assume it would depend on the overall impact and whether or not it could be easily written differently or not

potent lichen
#

remember, you can fit a lot into 4 lines of code

tulip otter
#

How is that complex?

potent lichen
#

(assuming your code style is bad)

lean gobletBOT
#

how is what complex? I am talking purely theoretically, no code was ever linked ;)

tulip otter
#

I posted a screenshot of the code

lean gobletBOT
#

(nor was a PR opened)

#

screenshots 👀

tulip otter
#

4 lines was a hyperbole

#

I'm referring to the way the bukkit code unions the two method arrays

#

Technically, it could be one line

#

but whatever

lean gobletBOT
#

I would say "don't do the hashset size specification and you would probably be good"

#

also I personally would just use putall, lol

tulip otter
#

Streams

lean gobletBOT
#

so yeah, if you copy that 1:1 it would be greater risk of copyright violation seeing as there are lots of alternatives

twilit pewter
#

PaperMC Discord, where professional lawyers discuss implications of theoretically incompatible licences that realistically aren't enforced and their implicate

lean gobletBOT
#

whether or not it would actually have any impact beyond "yeah, it's stolen but dude, it has zero impact" is for a judge to decide

#

I mean, the GPLv3 was "enforced" on CraftBukkit so...

#

or well, I guess technically it was the LGPLv3

potent lichen
#

i thought CB was lgpl?

#

yes

lean gobletBOT
#

granted one could argue that CraftBukkit inherits Bukkit's license if APIs are really copyrightable but ¯_(ツ)_/¯

#

I personally don't believe in the "copyrightable API specifications" argument and act accordingly lol

tulip otter
#

inheritance... stupid oo devs

#

🤢

bleak current
#

wat

tulip otter
#

LMFAO

bleak current
#

tulip otter
#

It was a joke..

#

Ya know... about how OOP breeds an obsession with deep inheritance based applications

bleak current
#

jokes about oop in basically a java community

tulip otter
#

Well yeah... thats why its funny

#

Cause were all oo devs

#

???

bleak current
#

damn your life must be really miserable when you can make jokes what only you'd laugh over

#

:/

tulip otter
#

Does it make you feel better to say things like that?

lean gobletBOT
#

tbh that whole argument is moot: everything should be GPLv3 anyways, otherwise why even bother with open source?

tulip otter
#

To put other people down?

lean gobletBOT
#

runs

shell lagoon
#

I prefer a good MIT or Apache License 2.0 personally

bleak current
#

yes sxtanna

lean gobletBOT
#

sounds like somethign someone who doesn't hate proprietary software would say

tulip otter
#

Not to mention my original comment wasn't even suggesting he actually copy paste it

#

It was just to show that what he said in the issue was completely incorrect

lean gobletBOT
#

"<S​xt​an​na​> He could quite literally just copy paste the code, and it would cause 0 issues"

tulip otter
#

Yeah, he could...

lean gobletBOT
#

I replied to the "0 issues" part

shell lagoon
#

I prefer open source software, but don't care if proprietary stuff uses my code.

tulip otter
#

I was referring to the issues he raised in the github issue though

lean gobletBOT
#

well you didn't say that ¯_(ツ)_/¯

tulip otter
#

Context though

#

I didn't have to say that xD

lean gobletBOT
#

nah

#

apparently you did :P

tulip otter
#

@bleak current You don't think that is a little more indicative of your life being miserable?

lean gobletBOT
#

you can't expect people to read everything you ever said :P

tulip otter
#

Nah, you're just a 4head phoenix

#

But thats ok, we still love you

lean gobletBOT
#

( ͡° ͜ʖ ͡°)

bleak current
#

i'm ok with my life being miserable

#

lol

tulip otter
#

@potent lichen What did you mean in your comment?

bleak current
#

smh my head

potent lichen
#

which one?

tulip otter
#

@potent lichen on github

#

As much as I would support this idea, it is unfortunately an API break for anyone defining and using their own hierarchy of events, such as in a plugin API.

potent lichen
#

I meant exactly what I said. I don't know how to say it otherwise

bleak current
#

at this point it's true

tulip otter
#

What does a hierarchy of events have to do with the issue?

lean gobletBOT
#

yeah, everyone working around this behaviour would have their events run twice then

potent lichen
#

That's the whole subject of the issue

tulip otter
#

No its not???

#

It has nothing to do with the event class

#

It has to do with implementers of the Listener interface

#

The event bus doesn't register listeners in super classes

lean gobletBOT
#

out of the context its clear that he means "event listeners"

#

runs

potent lichen
#

I didn't say anything about Listener implementations

tulip otter
#

But thats what the issue is about?

lean gobletBOT
#

accidentally making a valid point 👀

potent lichen
#

Maybe I misinterpreted this issue

tulip otter
#

You quoting like that is throwing me off so hard xD

#

Like before with the license thing, I thought you were hinting at a rule I broke or something

lean gobletBOT
#

wat

#

that's normal greentext, mate

tulip otter
#

greentext???

#

Its a discord quote

potent lichen
#

No, sxtanna is right

lean gobletBOT
#

no? lmao

tulip otter
lean gobletBOT
shell lagoon
#

Not for phoenix

lean gobletBOT
#

fix your damn clients lmao

tulip otter
#

I know, but you're quoting

#

WHAT

#

Its the fucking normal discord client xD

#

4head

lean gobletBOT
#

you realise that "greentext" is just 4chan-quotes, right?

tulip otter
#

But youre... quoting

lean gobletBOT
#

not my problem if discord didn't decide to display the >

tulip otter
#

type it with a leading \

#

I wanna see what happens

lean gobletBOT
#

(or properly format quotes green)

#

> this will be the only time I'm doing that though :P

tulip otter
#

Yup

#

You should fix YOUR client

#

To have better interop

#

:)

shell lagoon
#

I mean, that's the bot's issue then

lean gobletBOT
#

I don't operate the bridge

#

or your brain

#

runs

tulip otter
#

How would you even introduce convenient interop for that

shell lagoon
#

Put a backslash in front of the greater than sign.

#

Should be an easy change.

lean gobletBOT
#

it's easy: you realise that greentext is a well-established internet meme so you take the context in consideration when reading any quote on platforms other than 4chan

tulip otter
#

No, I know how to fix it

#

I'm just saying it would kinda suck to completely remove the ability to do it

#

Yeah, but it doesn't look like that for us phoenix

#

It just looks like youre literally quoting someone else

lean gobletBOT
#

it looks exactly like a quote what are you talking about?

tulip otter
#

@potent lichen Thank you for correcting your comment

#

You look like a quote phoenix

lean gobletBOT
tulip otter
#

As it so happens, what you are referring to was also addressed in another issue

lean gobletBOT
#

also I mean my comment literally was a "quote", not a literal one but one of the "action taken"

weary grove
#

@tulip otter There's always Velocity if you don't want to deal with BungeeCord's... strange approach to things

tulip otter
#

@weary grove Velocity uses kyori event library

#

Which looks like it literally just does the exact same thing

#

Only calls getDeclaredMethods

#

That doesn't even scan methods

#

It filters and classifies them

#

Both have "strange" approaches

wary inlet
#

@sage cradle ^

weary grove
#

Actually Bukkit is the weird one

#

For example, here is an event bus library that is very popular on Android. It uses getDeclaredMethods (with a fallback for some Android-specific quirks): https://github.com/greenrobot/EventBus/blob/34a1537af7364cec9444a24431c566d434d4d0b8/EventBus/src/org/greenrobot/eventbus/SubscriberMethodFinder.java#L150

tulip otter
#

If you scroll up a bit, you will see that they look in super classes

weary grove
#

yeah I scrolled too far down

#

Well maybe we can think about scooting up the superclass hierarchy.

tulip otter
#

It legit just doesnt make sense to not look in super classes

#

You arent registering this specific class, youre registering this instance of this object

#

Imagine if you only had access to call methods of the class you have a reference to

#

Completely defeats the purpose of inheritance

weary grove
#

Well, if you're me, you prefer composition over inheritance anyway.

tulip otter
#

LOL

#

You know its funny that you bring that up

lean gobletBOT
#

does anybody know what could make SnakeYaml not find a certain class for loading an object from a config?

#

(and yes, I can access the class before trying to laod the config xD)

tulip otter
#

Exception?

trail plume
#

Snake won't be in the context of the classloader of stuff

#

well, of plugins, don't think that there is anything for that

lean gobletBOT
#

hm

#

yeah, seems to be the case. meh

#

now to figure out how to change that 👀

#

I guess that's where paper's way of loading plugin-classes before existing ones would come in handy thonk

#

can one like hide classes of a different class loader? xD

lean gobletBOT
#

ok apparently one can just use a custom class loader for yaml constructors

sage cradle
#

Actually Bukkit is the weird one
@weary grove blame me, scanning superclasses was sth I specifically added when I did bukkit

#

I think it seemed like it could be useful

trail plume
#

literally the worse

#

0/10 design

#

practically unusable

civic valve
#

git blame exists for this very reason!

trail plume
#

and then CB came along

civic valve
#

find bad apis, check the blame, ping them with your complaints!

tulip otter
#

Bukkit isn't even the weird one

#

Even the guava event bus gets methods from super classes

potent lichen
#

it does make more sense to recognise inherited methods

#

Sxtanna put it best - you're registering an object instance as a listener, not a class. Its methods are not only those declared.

weary grove
#

@tulip otter well, I'm planning a total redo of the Velocity event system and yes, we'll iterate superclasses when the time comes

tulip otter
#

Well isn't that just lovely

bleak current
#

bungeecord api support for velocity when??!???

#

runs

tulip otter
#

What are you going to actually do? @weary grove

civic valve
#

bungeecord api support for velocity when??!???
didn't someone already write a compat layer?

#

if not that seems really easy to write

weary grove
#

@tulip otter mainly improvements around async handling of events

#

planning to prototype it outside of Velocity and it will be called PALEO (mainly as a joke)

#

but the premise is very serious

tulip otter
#

Interesting

weary grove
#

basic idea: every event listener is part of a linked list, and an event listener is free to "interrupt" the execution of the event listeners, do some async thing, then modify the result and continue as if nothing had happened

#

with no interference in the event or race conditions

#

it will also be amenable to concurrent (de)registration of listeners, such that listener state remains consistent

tulip otter
#

and an event listener is free to "interrupt" the execution of the event listeners, do some async thing, then modify the result and continue as if nothing had happened
What does this do to the call site though?

trail plume
#

See, in part that doesn't make sense to me, you're still blocking the executor, so you're going to want to be in an async context there already

#

best I can see is maybe you can free up the event thread earlier for some form of "post it back to there once you're done"

potent lichen
#

it would probably make sense to define two kinds of listeners: 1.) simple ones, which are similar to those in the current system 2.) forwarding ones, which are able to asynchronously continue event execution, such as through some controller object

weary grove
#

It’s not going to allow blocking at all.

#

And we are making all events “forwarding” event listeners

#

There is method behind this madness, you’ll have to see for yourself

tulip otter
#

How is it possible that its non blocking and forwarding?

#

Do you have to supply a callback to the eventbus or something?

weary grove
#

No callbacks.

tulip otter
#

Ok, how?

trail plume
#

I mean, I'll have to wait to see your impl to see what you mean

#

But, this sounds like DFU territory

weary grove
#

I’m not going to go full Mojang pepega

tulip otter
#

Are you going to explain?

weary grove
#

I think I can explain more once this isn’t literally a sketch out in my head

#

Perhaps it will be best if you wait for the end product

tulip otter
#

meh, I don't think I care that much

#

I will never use velocity, so it doesnt really apply to me

weary grove
#

I will never use velocity, so it doesnt really apply to me
But why?

#

It’s what Waterfall should’ve been but couldn’t be.

tulip otter
#

I have 0 reason to

weary grove
#

I am the founder of the Waterfall project.

wary inlet
#

velocity's api is great and its implementation very much the same ^^

#

each to their own tho i suppose

tulip otter
#

Don't get me wrong, I am definitely not a purveyor of superiority in any direction

#

I don't really care for either API xD

wary inlet
#

i wouldnt be recommending it this much if bungee managed at least to nullability annotate its api tbh

tulip otter
#

I mean...

#

Theres a very simple and easy solution to that problem

wary inlet
#

switching to velocity! :D

tulip otter
#

Using Kotlin.

#

But go off..

wary inlet
#

not really

#

forced nullability doesnt help when theres no nullability hinting

tulip otter
#

What?

#

Just to let you know, the code generated by kotlin automatically inserts nullability annotations

#

When youre using it from kotlin, kotlin knows the nullability because its kotlin, and Java knows the nullability because of the annotations

#

You dont have to use kotlin yourself to benefit from it

weary grove
#

Serious question

#

Is Bungeecord written in Kotlin?

tulip otter
#

Thats not a serious question?

weary grove
#

Yes it is

#

Using Kotlin in your own plugin doesn’t fix the issue.

tulip otter
#

Thats... not what I said

trail plume
#

i mean, bungee uses lombok in the API...

tulip otter
#

The implication was that bungee would be written in Kotlin

#

Thats the simple solution to nullability ambiguity

potent lichen
#

how does kotlin tooling know whether a Java method returns null? Only a nullability annotation makes that possible

#

Otherwise, kotlin has no idea of knowing what is nonnull

#

hence its 'platform types'

tulip otter
#

The implication was that bungee would be written in Kotlin

potent lichen
#

rewriting bungee from scratch... sounds like velocity

weary grove
#

sure we'll rewrite Velocity in Kotlin PepeLaugh

tulip otter
#

I never presented what I said as an actual suggestion

#

@weary grove Yeah, you really should though

#

For multiple reasons

lean gobletBOT
#

J​Ro​y 👀

sage cradle
#

you know, as much as it pains me to say it, in this case nokotlin

civic valve
#

you shouldn't shit into your ide in public

#

please kotlin in the privacy in your own home

sage cradle
#

joke's on you i don't go out!

tulip otter
#

@sage cradle why do you say that?

civic valve
#

kotlin is literally lombok

#

but worse

#

don't use it in public

tulip otter
#

Are you joking?

real cave
#

No we aren't. Kotlin really allows you to fuck up code readability really bad. Without IDE seaching for where the hell those bunch of extensions methods were defined is a pain.

tulip otter
#

Kotlin really allows you to fuck up code readbility really bad.
👀

civic valve
#

k so

#

we get it

tulip otter
#

Tell me, how do you resolve static members without IDE searching?

civic valve
#

you're probably young

tulip otter
#

What??

civic valve
#

you praise the kotlin god

#

you've been staring at the kotlin sun for too long that its burnt your retinas

#

you don't understand common sense anymore

#

and think kotlin is the best programming language ever

real cave
#

You don't search statics, because nobody in braindead enough to use static imports.

tulip otter
#

Who said anything about static imports?

real cave
#

Kotlin is great tho, just not a replacement for java.

tulip otter
#

Kotlin is 100% a replacement for Java

civic valve
#

technically yes, effectively no

tulip otter
#

@civic valve I don't understand why you're so angry about this...

#

Both technically and effectively

#

It does everything Java does, but better in every way

civic valve
#

because you say shit like that

real cave
#

No, it doos poor at making code readable.

#

Some other things, like built-in nullability is great.

tulip otter
#

because you say shit like that
What does it not do better?

#

Its not "built in nullability"

#

Its an unambiguous nullability type system

wide maple
#

I’ve seen Kotlin produce bytecode that does a lot of unnecessary stuff and is slower ultimately than the java counterpart. I am not on Kotlins side either. If kotlin were also able to run natively then we could talk about it

tulip otter
#

The type system is WAY better too

#

@wide maple It does

#

It compiles to JS, the JVM, and Native code

#

And you can disable the compiler intrinsics

real cave
#

Nah, the performance isn't usually a problem, since we are talking about GC based languages anyway.

tulip otter
#

People often do so when targeting platforms that are bitchy about it, like android

civic valve
#

What does it not do better?
Syntax sucks, very bad readability, the bytecode gen is just bad, decompiling is a nightmare, forced nullability is meh but you should be writing proper code that has nullability checks in the first place

tulip otter
#

@civic valve Ok, so you're just ignorant...

civic valve
#

that's just the surface

#

IM IGNORANT

wide maple
#

New idea- rewrite your anticheat in kotlin and nobody will ever be able to decompile it ever again

tulip otter
#

Thats fine, we can work on that

wide maple
civic valve
#

Sorry do you have any job in the programming field in the real world

real cave
#

The thing is that, the readability is why are we writing java. If i wanted to type in shit faster i could just have used python, which i do.

tulip otter
#

Kotlin is perfectly decompilable?

civic valve
#

holy shit

tulip otter
#

It literally compiles to the same JVM bytecode as Java???

civic valve
wide maple
#

I disagree. Name one decompiler that doesn’t crap itself after 3 sec of kotlin decompiling

real cave
#

Many doesn't, but high level code result is crap anyway.

tulip otter
#

IntelliJ's

civic valve
#

barely

wide maple
#

^

tulip otter
#

I'm also certain JD-GUI has 0 problems as well

wide maple
#

no.

#

I tried.

tulip otter
#

Syntax sucks, very bad readability
Please do elaborate on this

#

I find this topic extremely interesting

civic valve
#

var

real cave
#

The thing is, as long you aren't a single person in the team, you will suddenly find out that readability of the code is what it matter, and not the writing speed.

tulip otter
#

@wide maple Why are we even considering decompilability as a metric for a front end language

#

@civic valve What about var?

civic valve
#

because decompiling is a big part of JVM culture?

tulip otter
#

@real cave How is kotlin less readable?

#

@civic valve Its a front end language dude

civic valve
#

holy shit

real cave
#

Here is an example val withdrawPlan = player.inventory.createWithdrawPlan(...)

wide maple
#

Can we arrive at the truth already that- while maybe nice- Kotlin will never find the space in this community it’s so desperately trying to get and that for a good few reasons

real cave
#

Now find what's where using only notepad

tulip otter
#

@wide maple Because youre gatekeeping it

wide maple
#

Java libraries is the crux

tulip otter
#

@real cave ?

wide maple
#

Also a lot of people don’t want to re-learn how to code things in java

tulip otter
#

That single line alone would not be an entire file

#

You would have imports

#

@wide maple why would you need to relearn Java?

#

And what about Java libraries is the crux?

wide maple
#

Widely different syntax for one, lots of crashes with libraries using native callbacks for two (yes that’s why the android people complain and I do too)

tulip otter
#

perfectly decompilable by JD-GUI

wide maple
#

How is that readable-
When projects get complex it just isn’t usable and does fail a lot

tulip otter
#

What do you mean how is it readable??

civic valve
#

anyways to explain why the syntax is shit;

  • var you take more time to figure out what the variable actually is when you use var and can get to a point where it's impossible without an IDE
  • instance-creation expression isn't clear and very confusing
  • they literally sprinkle single characters all over the place to live their null-free dream
  • variable assignments aren't expressions
  • no ternary operator
  • no automatic type casting
  • Generics is hell
  • no sane structure syntax
tulip otter
#

Its java code with annotations???

#
  • var you take more time to figure out what the variable actually is when you use var and can get to a point where it's impossible without an IDE
    var in kotlin is not type inference
#

var for type inference is a Java 10 thing

civic valve
#

kotlin uses var more

tulip otter
#

Kotlin uses var and val to indicate mutability and immutability

civic valve
#

nobody uses var in java

tulip otter
#

var = mutable
val = immutable

civic valve
#

you're missing the point

tulip otter
#
var thisCanChange: Int = 10
val thisCannotChange: Int = 20
#

No, you're wrong....

#

I'm not missing anything

civic valve
#

shit syntax still

tulip otter
#

How...

#

Post type declaration does a lot for readability

civic valve
#

int varName = 10;
var varName: Int = 10;

tulip otter
#
  • instance-creation expression isn't clear and very confusing
    Its the exact same as Java, but without new
civic valve
#

and that's the confusing part

tulip otter
#

Kotlin doesnt require semicolons

wide maple
#

Also bad

civic valve
#

^

wide maple
#

Call me old fashioned but I am used to have two instructions in one line if it helps cement my logic

tulip otter
#

So what I've learned is that you guys dont actually hate kotlin for a reason, you just dont understand it

civic valve
#

or reduces patch size!

#

@tulip otter no

#

You didn't learn shit

#

because you don't want to

tulip otter
#
* variable assignments aren't expressions
* no ternary operator 

These are two things that most people who come from Java appreciate the most

civic valve
#

you think kotlin is perfect

tulip otter
#

Kotlin already has a ternary syntax for something else

#

Multiple ternaries doesn't make sense

#

And the kotlin if else is an expression

civic valve
#

that's worse syntax

tulip otter
#

val number: Int = if (true) 10 else 20

#
  • no automatic type casting
#

This is wrong

civic valve
#

it's correct

tulip otter
#

Kotlin has BETTER auto casting than Java

real cave
#

Kotlin syntax is a mix of python syntax and something else.

civic valve
#

unless changed recently

real cave
#

So if you have used python you would be very familiar with the syntax

tulip otter
#
val object: Any = "Hello"

if (object is String) {
  println(object.length)
}
civic valve
#

Kotlin syntax is a mix of python syntax and something else.
takes the bad parts of java, php, js, and python and shits on them

tulip otter
#

Kotlin has always had better auto casting

#

Its baked into the kotlin type system and program flow

civic valve
#

that's not auto casting

tulip otter
#

IT IS

#

What

civic valve
#

n o

tulip otter
#

Its automatically casting object to String after you confirm its a string

civic valve
#

not the kind I'm talking about

wide maple
#

You won’t find turf in the minecraft community with Kotlin. It’s a niche here if anything
The one thing I know that Kotlin has and java doesn’t (which isn’t necessarily good) is KotlinExposed

tulip otter
#

Are you talking about type coercion??

#

Like for numbers?

#

Because thats not casting

#

Not even in Java

civic valve
#

dude i can't even

#

you're not gonna see past your bubble

#

why do i waste my time

tulip otter
#

WDYM

#

LOL

#

Dude, you've been wrong about legit everything

civic valve
#

yeah

#

sure

tulip otter
#

And youve just been attacking me for no reason

civic valve
#

yeah

#

ur right

#

you win

#

am switching to kotlin right now

tulip otter
#
  • Generics is hell
  • no sane structure syntax
#

This just doesnt make sense

#

Kotlin has WAY better generic projection syntax

civic valve
tulip otter
#

And the structure of almost everything is way more concise and simple

#

Like what do you mean generics are hell?

real cave
#

reified generics are great tho, just sometimes they get in the way.

tulip otter
#

They dont get in the way dude, they have a specific purpose, and if you arent using them within the bounds of that purpose, they dont work

#

Thats like.. everything

#

And reified generics arent even a part of the generic system

#

Its syntax sugar

#

Lord have mercy on my soul

wide maple
#

Here is my issue with Kotlin in the minecraft community.
Java is why modding is popular
The java syntax is fine because it’s easy and simple and doesn’t have many complicated functions (I’ll regret that phrase later).
A lot of people know java code
We have a vivid modding or modifying community as a result
Were you to convert the backend of that to Kotlin not only would you alienate yourself from the community-
You’d also make it harder for yourself to get people interested in your project aside form a small niche group

tulip otter
#

@wide maple It is a very different statement to make that Kotlin is a bad language and Kotlin does not fit into the community

#

(which are both just objectively incorrect things to say)

#

And this should not be your "issue with Kotlin"

#

Kotlin exists whether you like it or not

wide maple
#

But that’s sadly true for anything Kotlin I’ve seen so far

tulip otter
#

It should be your issue with the rigidity of people

#

Uhhh what???

#

Android dude!!!

civic valve
tulip otter
#

Android has literal CENTURIES of being Java everything

wide maple
#

Did I mention natives along the way with that regard? Marketing is a lot of what drives this too

civic valve
#

the biggest apps on android don't use kotlin

#

they use java/react

tulip otter
#

But its adoption and transition to being mostly kotlin has been huge

real cave
#

If you give people way too much tools to make things go wrong, they will do it. So you have to not give people the tools to shoot the foot.
The more different syntax sugar you have, the harder it to read the code, but the easier it is to write the code.
Kotlin has more syntax sugar than java, and way more tools to do shit wrong.
That's why you can't directly compare it to java.
Literally the only language you can compare and exchange java with is Go

tulip otter
#

@civic valve bruh... WHAT

civic valve
#

name big apps written in kotlin?

#

facebooks entire app suite is java/react

#

netflix is java/react

tulip otter
#

Pinterest, Postmates, Evernote, Uber, Square

wide maple
#

Just for the record I’d buy it if you said TikTok

tulip otter
#

The google apps

#

Slack

civic valve
#

not all google apps

tulip otter
#

Tinder

#

Airbnb

civic valve
#

most google apps are still java

#

and those aren't that big

tulip otter
#

BRUH

civic valve
#

uber being the biggest

wary inlet
tulip otter
#

You're in so much denial

real cave
#

Android forcing kotlin is a political thing, not preference btw.

tulip otter
#

It pains me

civic valve
#

yeah switch to general

tulip otter
#

Android does not force Kotlin

#

People just fucking like Kotlin

#

Its a good language xD

wary inlet
warm shell
#

hello, how can i connect a player when i have deleted the "default server"

#

i tested with a "connect" on post login but it doesn't work

weary grove
#

Velocity 1.1.0 handles this case a lot better

bleak current
#

Hey guys!

#

I'm trying to write a plugin that'll check the server uptime of a proxy server, how's this possible?

#

Right now I have the code to checking if the server is online / offline, but how can I get the uptime? Could I send like a command to the server and get the output back?

lean gobletBOT
#

you don't without running a plugin on that server

bleak current
#

dang

#

phoenix616 what would I need to do in that plugin?

lean gobletBOT
#

either get the data manually or use your own custom command sender to get the feedback of some command that you run

bleak current
#

hmm

#

what do you do with minequery?

#

maybe i can apply it to my use case

lean gobletBOT
#

sed commands and read some server data via a socket

#

*send

bleak current
#

ahh ok

#

would this be ideal for my case then?

lean gobletBOT
#

it would be one solution

bleak current
#

i want to write a plugin that can tell me the uptime of all my servers on my proxy

#

also how do i do proxy commands in game? i just wrote a sample plugin and a simple command but cant do the command