#dev-general

1 messages ยท Page 341 of 1

half harness
#

for example, one class for afk, another for other stuff with the same event

distant sun
#

not necessarily

half harness
#

okay

jovial warren
#

also, @prisma wave, with listen returning a Flow<T>, what would I actually call there?

#

like how do I produce a flow?

#

also, do I even need a Flow here for event listening?

static zealot
#

I have 2 classes for 2 listeners for example when I have user data to load and save on join and quit and I have another class doing some other stuff

#

its easier to keep track of what does what and what's where

prisma wave
jovial warren
#

inline fun <reified T : Event> on(noinline consumer: (T) -> Unit) = context.server.eventBus.subscribe(consumer) that should just be fine

#

since there won't be multiple values to return anyway

#

there'll just be one: Event

prisma wave
#

Eww

jovial warren
#

what

prisma wave
#

What is eventBus

jovial warren
#

an... event bus...?

prisma wave
#

Obviously

jovial warren
#
interface EventBus {

    fun <T : Event> call(event: T)

    fun <T : Event> subscribe(subscription: (T) -> Unit): EventSubscription<T>
}
prisma wave
#

๐Ÿ˜ญ

jovial warren
#

what

prisma wave
#

y no reactive

jovial warren
#

ffs teach me the ways senpai

#

pls

#

I ask for help, you say no, then you complain when I do it wrong

#

what do you expect?

prisma wave
#

what

#

I've been saying to use a Flow this whole time

jovial warren
#

yeah but HOW

prisma wave
#

I have no idea how you actually implement that

#

But it can't be that hard

onyx loom
#

๐Ÿ˜‚

jovial warren
#

why would I even use a flow here?

prisma wave
#

For reactive sexiness

jovial warren
#

a flow is for returning multiple results

#

I want one

prisma wave
#

Exactly

#

No

jovial warren
#

just Event

#

that's the only thing I need to return

#

or, allow consumption of

prisma wave
#

You return a Flow<Event> that's published to every time there's a new event

#

Like d4j* does

jovial warren
#

wat

prisma wave
#

reactive model

errant geyser
#

Basically, you pour a bottle of water on your pc and watch it react happily ๐Ÿ™‚

jovial warren
#

googles discord4j for answers

prisma wave
#

JDA does it too with the kotlin extensions

lunar cypress
#

google reactive streams and kotlin flow instead

prisma wave
#

Yeah

lunar cypress
#

flow in kotlin has the advantage that it's compatible with coroutines and you're free to use it in different fashion

prisma wave
#

I think Souza mentioned SharedFlow

#

Which seems to be what you can use in the bus implementation

jovial warren
#

or you talking about jda-reactor

prisma wave
#

oh yeah reactor

prisma wave
#

Yes

#

But Flow instead of Flux

#

Flux is from reactor but Flow is nicer in kotlin

#

Since you can use suspending functions

ocean quartz
#

jda-ktx jda k thanks

hot hull
#

@ocean quartz Can you send me a gif for the scrolling gui

static zealot
#

there's one on the wiki tho isn't there?

hot hull
#

found it

jovial warren
#

wait so what would be the Kotlin equivalent of a FluxSink?

#

also, this makes about 0 sense to me lol

#

how this all works that is

#

oh right, so I just have a sink that emits events

#

and then subscribers that listen to those emitted events

#

oh right

prisma wave
#

Why do you need a FluxSink

#

SharedFlow is what you'd use for emitting I think

jovial warren
#

ah right

#

so what? I have subscribe return a Flow right?

prisma wave
#

Or maybe channelFlow

prisma wave
#

Maybe change the name to listen or something

jovial warren
#

so fun <T : Event> listen(subscription: (T) -> Unit): Flow<T> right?

prisma wave
#

no

#

You don't need the consumer

#

It doesn't make sense to have that

jovial warren
#

oh right

#

so what do I need then?

prisma wave
#

Nothing

#

No parameters necessary

jovial warren
#

oh

#

so then how is it used?

prisma wave
#

flow.blah

jovial warren
#
listen<SomeEvent>.collect {}
```?
prisma wave
#

Yeah

#

You wouldn't normally just do .collect

#

But you might wanna make a helper function for the cases where you do

jovial warren
#

no but for example

prisma wave
#

Mhm

#

It would usually be .filter, .map etc

jovial warren
#

and yeah, on, like you said before

prisma wave
#

usual sorta stuff

jovial warren
#

wait so how does collect work?

#

do I take a consumer for that?

prisma wave
#

yes

#

collect is like forEach

#

Except suspending

#

and takes a suspending function iirc

jovial warren
#

so suspend inline fun <reified T : Event> on(crossinline consumer: suspend (T) -> Unit) = listen<T>().collect(consumer) then lol

#

now that is what you call a mess

#

I mean a beauty

#

totally didn't just copy that parameter from what collect actually takes

prisma wave
#

๐Ÿฅฒ

jovial warren
#

also genius, if that's suspending, how tf am I gonna call it in init?

prisma wave
#

what

#

on isn't suspending

#

It just takes a suspending function

jovial warren
#

it is

prisma wave
#

oh

#

Make it not suspending then

#

Probably

jovial warren
#

it has to be suspending because collect is suspending lol

prisma wave
#

๐Ÿฅฒ

#

then make an init function that's suspending I guess

jovial warren
#

well then, I guess it is time for initialize

prisma wave
#

stupid dumb kotlin

#

Makes this "amazing' concurrency pattern that's awesome to use until you actually have to do anything

jovial warren
#

lol

#

u Triggered

prisma wave
#

Jokes aside it would be nice to have a concurrency pattern that didn't require breaking changes & coloured functions

jovial warren
#

also, suspend fun initialize() good wdym

#

I'm still looking forward to implementing this lol

prisma wave
#

futures and callbacks change the signature of your functions, async / await makes coloured functions, coroutines require suspend everywhere

#

Not sure how you'd do it

#

But there must be a way

#

Maybe erlang / elixir has a solution for this

jovial warren
#

I doubt it

#

if there was a solution to this, someone would've already invented it

prisma wave
#

maybe

#

theres a language that automatically multithreads your code iirc

#

it might be a gimmick but sounded cool on paper

jovial warren
#

actually pretty cool ngl

#

also, if I'm emitting events and handling them async, you reckon there's a way to cancel them?

prisma wave
#

yeah in theory

jovial warren
#

right, trying to think of where I should steal the event class names from lol

#

Bukkit

#

oh also, any pointers of how I should actually structure my concurrency on the backend btw?

#

since atm, I just kinda spin up a few coroutines here and there and bam

#

e.g. chunk and lighting data is sent by using GlobalScope.launch(Dispatchers.IO) from a function to avoid it taking ages and preventing other packets

#

yeah ban plugins are gonna be annoying as fuck lol

#

actually maybe not

#

maybe I should just call an event on a coroutine and then that coroutine gets blocked whilst the plugin does its handling

onyx loom
#

hello @prisma wave

#

is it time for that code review? ๐Ÿฅบ

jovial warren
#

BM pls help ๐Ÿ™‚

heady birch
#

Come on Joe biden, trump would have fixed the bugs himself by now

heady birch
#

Either<A, B> looks kind of cool

#

But it is not zero cost

jovial warren
#

love how you just completely ignored the line I highlighted

#

and the line below and above

jovial warren
#

also, when are you gonna respond to my DMs btw Niall

jovial warren
old wyvern
#

Your "isCancelled" property

jovial warren
#

wat dis do again?

#

what does volatile do?

old wyvern
#

Makes threads not cache that value, it reads and writes directly to memory without the caches

heady birch
jovial warren
#

also, I can't make it volatile in the interface

old wyvern
#

Make the implemented field volatile

jovial warren
#

yeah will do

#

actually hold on what

#

okay so custom events won't have that volatile

#

unless I say it's a good idea in all the docs and everything

old wyvern
#

eh why not convert the Event to be an abstract class instead then?

jovial warren
#

you know Event doesn't implement Cancellable right?

#

because not all events are cancellable

old wyvern
heady birch
old wyvern
jovial warren
#

nah I wrote a reactive event bus @heady birch

jovial warren
#

so ```kotlin
abstract class CancellableEvent : Event, Cancellable {

@Volatile
override var isCancelled = false

}

old wyvern
#

I guess so

#

Do you need the separate Cancellable interface?

jovial warren
#

I mean, not all events can be cancelled

#

actually, I guess they can

#

why the fuck not

old wyvern
#

Because if someone uses Cancellable, then they cant be sure of volatile behaviour in this case

#

No bard

#

I meant the interface

jovial warren
#

ah right

#

so just yeet the interface and boom

old wyvern
#

ig

jovial warren
#

also, wonder if I should have call return some sort of Result

#

or something like that

#

trying to think of how I can actually get this to work in practice

old wyvern
#

eh, return the final state of the event, but that would also mean it would be required to be blocking

jovial warren
#

yeah but the way mine will work is that it'll only block the coroutine handling that player

#

or something like that

#

unless you have a better option

#

also, how would I even do that in practice?

#

I would have to call each one of the listeners and then wait for them to return their results

#

I'm actually not sure how to do this

#

someone help pls

errant geyser
#

callback maybe? idk

jovial warren
#

ewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

#

you know what language this is?

errant geyser
#

mhm

jovial warren
#

callbacks in Kotlin are solved through coroutines

errant geyser
#

do that then

jovial warren
#

yeah but how is that gonna solve my issue?

#

picture this

#

a player logs in

#

you're listening for the PlayerLoginEvent, so you handle it

#

but it's handled through callbacks, so by the time you cancel it, the player is already logged in

heady birch
#

I think events will pretty much have to be sync right?

jovial warren
#

yeah they will

#

I might just spin up a coroutine per player

#

since you can get away with that

heady birch
#

Unless you had two ways to listen, like one to handle mutable event one to handle immutable

hot hull
#

How is that gonna affect the server if you've got hundreds of players?

jovial warren
#

these aren't threads

#

you can spin up a million coroutines at once on like 1 GB RAM lol

hot hull
#

Coroutine per mob then ๐Ÿฅบ

dawn hinge
#

Spawns 10 million armorstands

jovial warren
heady birch
#

block listener api

#

Block.addListener

jovial warren
#

when I say coroutine per player I mean coroutine per connection btw

heady birch
#

data api

#

to add data

hot hull
#

Instructions unclear, built a shelf

jovial warren
heady birch
#

lol

jovial warren
#

anything that won't work with the vanilla client won't be implemented

heady birch
#

How are you thinking about storing worlds? Using your own format

jovial warren
#

nope

#

Anvil

#

it already reads Anvil and sends data from it

heady birch
#

hm

jovial warren
#

oh also, wanna see scoreboards btw?

#

that might be something that interests you

#

very similar to Bukkit's scoreboards, but this one won't be slow and dated like Bukkit's is

heady birch
#

Looks good, how come its 'team' and not like 'getTeam'? Too java like?

jovial warren
#

and if you want to do you and depend on the server and send packets yourself, ```kotlin
val session = SessionManager.sessions.single { it.player == (player as KryptonPlayer) }
session.sendPacket(PacketOutDisplayScoreboard())

jovial warren
#

I just can't really live with the word "get" in Kotlin

heady birch
#

I like that session api

#

Can you store data in that? Like it could replace people making their own Map<UUID, TheirObject>

jovial warren
#

wdym can you store data in it?

#

in what?

heady birch
#

In a session

jovial warren
#

a session is a data holder

heady birch
#

Okay cool

jovial warren
#
class Session(val id: Int, internal val channel: Channel) {

    internal val teleportId = Random.nextInt(1000)

    lateinit var profile: GameProfile
    lateinit var settings: ClientSettings

    lateinit var player: Player

    var lastKeepAliveId = 0L

    @Volatile
    internal var currentState: PacketState = PacketState.HANDSHAKE

    fun sendPacket(packet: Packet) {
        channel.writeAndFlush(packet)
    }

    fun disconnect() {
        if (channel.isOpen) channel.close().awaitUninterruptibly()
    }
}
#

that's it atm

heady birch
#

Channel a netty channel?

#

Netty ๐Ÿฅฐ

jovial warren
#

yeah

#

it uses Netty

#

Netty + Coroutines = ๐Ÿ˜

#

a.k.a async IO + lightweight async subroutines

#

oh btw, it'll support Adventure natively as well, meaning you can use Adventure's components for sending tablist header and footer

errant geyser
#

What's this Adventure everyone's talking about

jovial warren
#

objectively

errant geyser
#

looks cool

jovial warren
#

review time

#

still a W.I.P ofc

errant geyser
#

I didn't write it so it seems ok

jovial warren
#

lol

#

someone with actual knowledge please do a proper review ๐Ÿ™‚

static zealot
#

10/10

#

5 stars

#

and 1 Kg of cheese

frigid badge
#

Added repository to queue, estimated waiting time: 1 year, 2 months and 3 days.

jovial warren
#

wat

prisma wave
#

Instead of another repo

onyx loom
#

lemmo will do a proper review in 1 year, 2 months and 3 days

frigid badge
#

^

jovial warren
#

right, I'll do that at some point

frigid badge
jovial warren
#

a.k.a right fuckin' now

frigid badge
#

duh

prisma wave
#

oh my bad

#

looks like the org is bigger if more repos

onyx loom
#

sir brister mitten. please check your notifications for a ping ๐Ÿ˜Š

frigid badge
#

I finally got a haircut

onyx loom
#

pic or it didnt happen

frigid badge
#

haven't had one in more than a year

heady birch
#

I think it looks good to be honest

distant sun
jovial warren
#

oh ffs why do allprojects and subprojects show up as method call is ambiguous

ocean quartz
#

Because groovy gradle

lunar cypress
#

still don't understand how you lot can prefer groovy dsl

onyx loom
#

uh hello hello

ocean quartz
#

I swapped to kotlin dsl and tbh i'm starting to like it more

onyx loom
#

wow

ocean quartz
#

No weird warnings or errors like groovy

onyx loom
#

lol

#

the warnings are worth it

lunar cypress
#

have you ever written custom tasks, extensions and the likes?

old wyvern
#

Havent faced any issue worth switching for now

lunar cypress
#

genuinely curious

ocean quartz
#

Not yet, though I really like that you can do this for the tasks

lunar cypress
#

because if you just do the same thing over and over and don't use many gradle features I can see how it doesn't make a difference or aesthetics matter more

lunar cypress
spring canyon
digital mortar
ocean quartz
#

I mean switching isn't hard at all, they work the same way, just small syntax differences

ocean quartz
digital mortar
#

sorry ill post it in plugins ๐Ÿ˜„

half harness
digital mortar
#

ty

lunar cypress
#

It was only recently that I really started to dig deeper into Gradle, writing tasks, plugins and so on

forest pecan
#

@jovial warren
"This will cover the cost of my hosting, meaning I can stop relying on my grandmother to pay for this."

#

is this true that you rely on your grandmother for hosting fees

#

lol

lunar cypress
#

I'm convinced I would have failed with groovy because I simply do not know the language and its quirks

spring canyon
lunar cypress
#

I was just trying to see through the eyes of groovy apologists

spring canyon
#

Alright, I guess I was making an argument for you then

jovial warren
#

not true that it costs $10 a month though

#

my hosting costs more than that

#

it's $10.50/month for my 3 Tor exit nodes, then โ‚ฌ2.99/month x 4 for my Hetzner servers I think

forest pecan
#

o

#

i see

jovial warren
#

oh btw, @old wyvern, wanna know why Position wasn't world bound?

#

because if it is, I get a cyclic dependency

#

the world depends on its border, but then that has a location that depends on the world

#

got a solution for that one?

heady birch
#

Thats a tricky one

jovial warren
#

๐ŸŒ€

half harness
#

um so i have a class that extends PlayerEvent

#

and PlayerEvent has #getPlayer

#

and i know that getters are "bad" in kotlin...

prisma wave
#

you have to

half harness
#

rip

#

ok

onyx loom
#

thats fine

#

when ur calling it kotlin should convert it into a property anyway i think

prisma wave
#

lmao i love how i knew exactly what u were gonna ask

half harness
#

also

#

how do I do a static HandlerList variable

#

@JvmStatic? ๐Ÿ‘€

#

funny how the first question got answered right away by two people

#

but this question isn't getting answered

#

just crickets

#

...

obtuse gale
#

Lol

half harness
#

my question is just too hard to answer

#

anyways, since no ones answering, I'll use @JvmStatic, but since u guys hate that, feel free to ping me if you know what to do, since there might be a better alternative ๐Ÿคท

onyx loom
#

why do u need it static?

obtuse gale
#

87% People does't know about it..

half harness
#

also

#

how do i use JvmStatic

#

lol

jovial warren
#

^

onyx loom
#

o

#

its just an annotation

half harness
#

Only members in named objects and companion objects can be annotated with '@JvmStatic'

onyx loom
#

companion object

jovial warren
#
companion object {

    private val HANDLERS = HandlerList()

    @JvmStatic
    fun getHandlerList() = HANDLERS
}
#

ez

half harness
#

oh

#

wait do i put getHandlerList in the companion?

#

hmm

prisma wave
#

yes

half harness
#

u sure?

old wyvern
prisma wave
#

very sure

half harness
prisma wave
#

positive

half harness
prisma wave
#

bukkit

#

you have to do this for custom event classes

old wyvern
prisma wave
#

<url>

onyx loom
#

brister mitten!

prisma wave
#

SHUT UP

onyx loom
#

check ur pings โ˜น๏ธ

onyx loom
jovial warren
#

do you see the problem now Yugi?

old wyvern
#

Not really?

obtuse gale
#

I have a question... How in the world in #showcase made Pirate theme?

prisma wave
old wyvern
#

I dont see any world reference there

half harness
#

AHHHhhh

#

how od i fix this

#

<html>Platform declaration clash: The following declarations have the same JVM signature (setCancelled(Z)V):<br/>fun &lt;set-cancelled&gt;(&lt;set-?&gt;: Boolean): Unit defined in me.dkim19375.husterycraft.plugin.event.PlayerUpdateCoordinatesEvent<br/>fun setCancelled(cancel: Boolean): Unit defined in me.dkim19375.husterycraft.plugin.event.PlayerUpdateCoordinatesEvent1

#

AhhHH

prisma wave
#

i got about 300 @everyones from another server so cant see it very well

half harness
#

why is it so biG

old wyvern
#

It doesnt even seem to be Positon/Location

onyx loom
#

are u able to do the code review now? ๐Ÿฅฒ

old wyvern
jovial warren
prisma wave
#

maybe

old wyvern
#

It doesnt

half harness
#

how do i have cancelled variable while implementing Cancellable?

#

it gives error

onyx loom
#

do i take that as a yes? ๐Ÿ˜ฎ

obtuse gale
#

Guys... How long have you guys been a Developer of Minecraft?

onyx loom
#

2 days

prisma wave
#

5 years

onyx loom
#

atleast

obtuse gale
obtuse gale
old wyvern
#

Why do you have two classes with even very similar fq names

jovial warren
#

a month

half harness
#

im secretly Jeb

obtuse gale
half harness
#

oh

prisma wave
#

oh

half harness
#

0 days then

onyx loom
jovial warren
#

I've been a Java developer for like 2 years

prisma wave
#

about never

half harness
#

^

jovial warren
#

about a month

prisma wave
#

made a shit server when i was about 12

#

nothing else happened

half harness
#

i forgot

jovial warren
#

unless that's not what you mean by Minecraft server lol

obtuse gale
#

This year is my 9+ years being MC Developer... Start from 2016... Damn 1.6 nostalgia

#

Lol

#

Well this is Dev General where Developers can chat together

jovial warren
half harness
#

um

#

whos gonna say it

jovial warren
#

more like circlejerk general

#

and dkim being stupid general

obtuse gale
#

I saw what you chat @half harness

half harness
prisma wave
ocean quartz
#

I started in 2016 as well that's 5 years lol

half harness
jovial warren
#

yeah dkim often says dumb stuff in this chat @obtuse gale lol

obtuse gale
jovial warren
#

and we like to laugh at him

ocean quartz
jovial warren
#

1.6?

old wyvern
#

uh

obtuse gale
#

Wait... It's 5 am

jovial warren
#

jesus

obtuse gale
#

My IQ

jovial warren
#

I started playing Minecraft Java in 2016 haha

obtuse gale
#

I was about to sleep... Is that freaking sun?!

old wyvern
#

21-16 = 9 Warning

half harness
#

i started in 2018

old wyvern
#

xD

#

lol

half harness
ocean quartz
#

9! that's a big number

jovial warren
obtuse gale
#

???

#

Wait wait calculating

half harness
jovial warren
#

2021-2016 != 9

old wyvern
#

2021 and 2016 my guy

ocean quartz
#

Dkim brain is buffering

half harness
#

and where did 2016 come from

jovial warren
obtuse gale
#

Goddamit I am calculating this is hurt

jovial warren
#

what did he say in his message

#

omfg dkim

old wyvern
half harness
#

oh.

ocean quartz
#

Dude..

obtuse gale
#

Ouh damn it's 5 years

#

5 years exp

half harness
ocean quartz
#

You sure it's your pc that's slow?

half harness
#

-_-

jovial warren
obtuse gale
#

Wait f

jovial warren
onyx loom
#

close to 9 tho!

half harness
#

can someone

#

answer

#

my question

jovial warren
half harness
#

plz

obtuse gale
#

I mean 2021 - 2014 =

#

Answers

#

Please

#

My brain

half harness
#

thats 7 years

jovial warren
obtuse gale
jovial warren
half harness
jovial warren
#

I saw that

#

6 years

obtuse gale
#

I saw that man

old wyvern
ocean quartz
#

Make your life easier, 20-14+1

old wyvern
#

minutes? yes,
Years? no

obtuse gale
#

Well yeah 7 years

jovial warren
#

dkim thinks 2021-2014 is 6

#

add that one to the archives

half harness
obtuse gale
old wyvern
errant geyser
#

dkim you might want to sleep

obtuse gale
#

I am glad to chat with other Developers... This is my first time actually

half harness
forest pecan
#

yo dkim

#

whats 9 + 10

jovial warren
#

you're so lucky I haven't er... done some things with discord yet

obtuse gale
#

And this is fun

forest pecan
#

quick

#

you got 8 seconds

forest pecan
#

8

#

7

half harness
#

betterdiscord

#

=

forest pecan
#

6

half harness
#

again

forest pecan
#

5

half harness
#

discord

#

tos

forest pecan
#

4

obtuse gale
#

Lol

forest pecan
#

3

#

2

#

1

obtuse gale
#

So guys guys

jovial warren
#

pulse

forest pecan
#

dkim you didnt solve the problem in time

jovial warren
#

it's 21

#

xD

forest pecan
#

your mind is a tortise

ocean quartz
frigid badge
#

gonna have to ban you for not following discord tos @jovial warren

half harness
frigid badge
#

sorry mate

obtuse gale
#

What the fastest time you made a Server? About 1 day?

obtuse gale
#

Lmaoo

half harness
#

๐Ÿ‘€

frigid badge
#

you use betterdiscord

errant geyser
#

You said u were using a different client kek

forest pecan
#

quick

frigid badge
#

21

half harness
obtuse gale
#

I use Better Discord

jovial warren
#

uninstalls BetterDiscord

forest pecan
#

Good job

#

you get an S

errant geyser
obtuse gale
obtuse gale
#

Original

frigid badge
ocean quartz
obtuse gale
#

Lmao

half harness
obtuse gale
#

Lol

jovial warren
obtuse gale
jovial warren
obtuse gale
#

Lol

jovial warren
#

it's written in Kotlin

#

it's a big project ya know

obtuse gale
#

What Server is it

jovial warren
#

writing a Minecraft server from scratch is a big project

#

that's it

#

also, Matt, of all people, I think you were probably quite low on the list of people I'd expect to reference the rap battle meme

obtuse gale
#

Server jar?

prisma wave
#

i could make one in 20 minutes

jovial warren
obtuse gale
#

I could make 1 Minute

prisma wave
#

average haskeller

jovial warren
#

BS could you make what I've made in a minute

obtuse gale
#

Put Essentials, chat, spawn & griefprevention & wa la... Survival Server finished

forest pecan
#

lmao

prisma wave
#

lol

jovial warren
#

@old wyvern you got a solution to my problem yet btw?

ocean quartz
#

Essentials chat ew

obtuse gale
#

Xd

prisma wave
#

mitten chat >

jovial warren
#

that's not the point of this project

prisma wave
#

spigot*

obtuse gale
jovial warren
forest pecan
#

yea

jovial warren
#

for the uninitiated

forest pecan
#

just fancy way of saying it

prisma wave
#

pretentious

obtuse gale
#

Speak english don't use developer language jess

jovial warren
#

no, wiki.vg refers to it as the notchian client & server

old wyvern
#

One sec

heady birch
#

Well a Position sounds like it could be a general non world bound thing

I could suggest a WorldContextAwarePosition however

obtuse gale
#

@jovial warren Can I work with you please?

jovial warren
#

WorldContextAwarePosition wtf

old wyvern
#

bard

jovial warren
#

just submit a PR with what you want lol

old wyvern
#

The issue is serialization right?

jovial warren
obtuse gale
#

Now?

jovial warren
#

if you have something to contribute, it's open-source for a reason lol

old wyvern
#

Then whats wrong?

jovial warren
forest pecan
#

Wait im going to be the first dude to make a plugin

old wyvern
#

link

jovial warren
#
val worldBorder = KryptonWorldBorder(
            nbt.getDouble("BorderSize"),
            Location(
                world // here = the problem, since we don't have the world yet
            ),
            nbt.getDouble("BorderCenterX"),
            nbt.getDouble("BorderCenterZ"),
            nbt.getDouble("BorderDamagePerBlock"),
            nbt.getDouble("BorderSafeZone"),
            nbt.getDouble("BorderSizeLerpTarget"),
            nbt.getLong("BorderSizeLerpTime"),
            nbt.getDouble("BorderWarningBlocks"),
            nbt.getDouble("BorderWarningTime")
        )
#

we need a world border to initialise the world

#

and we need the world to initialise the location of the world border

obtuse gale
#

We ?

jovial warren
#

this is why I had Position

jovial warren
#

I

obtuse gale
#

Lol

old wyvern
#

Create the world border inside the world

jovial warren
obtuse gale
#

Is this 100 Plugins in single Plugin?!

forest pecan
jovial warren
#

since it's not instantiated yet, I don't have the reference

half harness
obtuse gale
half harness
#

what should i use

ocean quartz
half harness
#

what should i use

obtuse gale
#

Die dkim

jovial warren
#

it's not fully instantiated by the time I need it Yugi

half harness
obtuse gale
#

Use meow

half harness
#

what

ocean quartz
jovial warren
#

and this@KryptonWorld doesn't seem to work

obtuse gale
#

Can someone teach me how to make a Plugin?

old wyvern
heady birch
#

Why not make a location just a plain position, entities already have a World property already I guess?

ocean quartz
jovial warren
old wyvern
jovial warren
#

but Yugi said that Position was unnecessary

obtuse gale
#

I am making a MC Server who wanna hop on?

old wyvern
#

Again bard

#

Why can you not make the border inside the world

jovial warren
#

define?

old wyvern
#

define what?

jovial warren
#

I don't understand what you mean by "inside the world"

heady birch
#

World#createBorder() -> WorldBorder

jovial warren
obtuse gale
jovial warren
#

actually that's not a bad idea

heady birch
#

WorldBorderFactory.createWorldBorder(WorldContext.of(World))

jovial warren
#

for once

obtuse gale
old wyvern
#

Instead of passing the world border itself, give the world enough info to construct the border itself

jovial warren
jovial warren
#

how would I do that though?

old wyvern
#

Give me a minute, reading

jovial warren
#

for world border stuff

old wyvern
#

Why would I need that?

#

Anyway

#

What class implements your WorldBorder interface?

jovial warren
#

KryptonWorldBorder

#

a.k.a WorldBorder in the current publicly available server

old wyvern
#

Also, weird issue, but you have 2 classes with the same name and only 1 segment difference in package

#

Might wanna have a slight difference in there to not make mistakes later on

jovial warren
#

wdym?

old wyvern
#

The WorldBorder interface and WorldBorder data class

jovial warren
#

every class that has an interface in the API will be renamed to be prepended with Krypton

#

a bit like how CB does it

#

CraftServer, CraftWorld, etc.

jovial warren
#

yeah that'll be renamed

#

as I said, it's called KryptonWorldBorder in my local

old wyvern
#

WorldBorder is nto a implementation of the WorldBorder interface rn

jovial warren
#

no, because I haven't pushed the code that makes the server an implementation of the API yet

old wyvern
#

Alrighty

jovial warren
#

I'm currently in the process of implementing the API

#

also, the spawn location also needs a world

#

which then creates yet another cyclic dependency

#

this is why position exists

old wyvern
# jovial warren how would I do that though?

Ok from a quick look, if you dont wanna add the arguments of WorldBorder to world directly, you could have an intermediate "WorldBorderConfiguration" data class to be passed that the world will use to construct the actual worldborder

jovial warren
#

yeah that might work

old wyvern
#

@obtuse gale why fr?

ocean quartz
heady birch
#

KryptonWorldBorder, I guess thats better than WorldBorderImpl?

old wyvern
#

oh

#

Did he just add everyone

ocean quartz
#

Yup

old wyvern
#

lol

jovial warren
#

I'm really tempted to create a DSL now xD

#
worldBorder {
    centerX = 1
    centerY = 2
}
```ez
heady birch
#

Meh, I think I hate dsls Are those like these:

parentDslthing {
mediumDslThing {

}
}

Or:

it.apply {
}

jovial warren
#

DSLs >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> builders

#

at least, in Kotlin

#

builders in Kotlin are big ew

heady birch
#

Like how kotlin does its weird functions

ocean quartz
jovial warren
#

have you even tried Kotlin btw Niall?

#

just out of curiosity

errant geyser
heady birch
#

Yeah but not its fancy stuff

#

No co routines or anything

half harness
errant geyser
#

Remember the first rule of an OS project: PR or shut up.

prisma wave
#

to is nullable?

ocean quartz
#

I thought the first rule was to shame the code and do nothing to make it better

jovial warren
#

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

errant geyser
#

Well yes that

#

Second then

prisma wave
#

@Suppress("SpellCheckingInspection") questionable

old wyvern
#

Speaking of nullable

heady birch
#

Just fix the spelling!

half harness
old wyvern
#

Elvis op just screwed me over ๐Ÿ™‚

#

Wasted an hour because of a stupid default value

errant geyser
#

Imagine getting screwed by Elvis

old wyvern
#

๐Ÿ˜ฎ

surreal quarry
#

to ?: return alone should be enough right

prisma wave
#

yup

surreal quarry
#

no need for another variable

prisma wave
#

i mean

#

the code is fine

#

the logic is spaghetti tho

half harness
#

yea i know

#

idk how to clean it up tho

errant geyser
half harness
#

gives errors

#

lots

#

unless

#

i use !!

old wyvern
#

Its fine to use that if that value being null at that point would be considered a bad state in your use case

half harness
#

ok

surreal quarry
#

to is not nullable

old wyvern
#

What is to here?

half harness
#

d;spigot PlayerMoveEvent#getTo

ruby craterBOT
half harness
#

it is

ocean quartz
#

Don't trust spigot's docs

old wyvern
#

oh that

prisma wave
#

why the hell

surreal quarry
prisma wave
#

why would it ever be null

half harness
half harness
surreal quarry
#

its not nullable

heady birch
#

Java ๐Ÿ˜ฆ

old wyvern
surreal quarry
#

furthermore IJ literally tells you the elvis operator will never succeed

half harness
#

not for me

old wyvern
#

James

#

You using paper?

half harness
#

lol

surreal quarry
#

oh this project might be paper

#

imagine not using paper lol

old wyvern
#

Yea id assume so

half harness
#

d;paper PlayerMoveEvent#getTo

ruby craterBOT
half harness
#

lol

surreal quarry
#

paper >>

ocean quartz
#

Like i said, don't trust spigot's docs

half harness
old wyvern
#

ew

ocean quartz
#

Never use !!

surreal quarry
#

no god

half harness
surreal quarry
#

yes

old wyvern
half harness
#

u guys told me to use !!-

surreal quarry
#

i did not

errant geyser
#

Isnt distanceSquared better than distance?

prisma wave
#

d;MongoDatabase

ruby craterBOT
#
public class MethodHandles
extends Object```
MethodHandles has 1 extensions, and  38 methods.
Description:

This class consists exclusively of static methods that operate on or return method handles. They fall into several categories:

  • Lookup methods which help create method handles for methods and fields.
  • Combinator methods, which combine or transform pre-existing method handles into new ones.
  • Other factory methods to create method handles that emulate other common JVM operations or control flow patterns.
old wyvern
#

If I had used !! now I would have figured out this bug an hour ago

surreal quarry
#

i told you i thought to ?: return would be enough

prisma wave
surreal quarry
#

i never said use !!

heady birch
#

MethodHandles

half harness
#

gives a billion errors

#

:c

surreal quarry
#

i thought

old wyvern
#

Ah yes, hijra date

#

nah it hasnt indexed hibernate probably

half harness
prisma wave
#

hibernate docs.xml

errant geyser
#

I know

#

Thats my point

surreal quarry
#

damn

half harness
#

lol

ocean quartz
#

#bot-commands

prisma wave
#

distance squared is better

old wyvern
#

d;DocDex

ruby craterBOT
#
@@Deprecated(since="9", forRemoval=true)
public interface Doc
extends Comparable<Object>```
Doc has 2 super interfaces, 1 extensions, 23 methods, and  11 sub interfaces.
Deprecation Message:

The declarations in this package have been superseded by those in the package jdk.javadoc.doclet. For more information, see the Migration Guide in the documentation for that package.

Description:

Represents Java language constructs (package, class, constructor, method, field) which have comments and have been processed by this run of javadoc. All Doc objects are unique, that is, they are == comparable.

jovial warren
#

also, I swear, this commit is gonna be so big lol

old wyvern
jovial warren
#

it's gonna make my fucking contribution lines like 1 million

jovial warren
old wyvern
#

Why not?

jovial warren
#

I need to implement at least most of the API

prisma wave
#

big commits smoothbraingang
small commits: bigbrain

jovial warren
#

also, that's not what will make it huge

#

it's the fact that the modules mean I've moved a file with 171k+ lines again

heady birch
#

<brain size="medium"/>

jovial warren
old wyvern
#

When you make changes like that, make a commit

jovial warren
#

lol

prisma wave
#

sir, latest commit broke things!
oh, lets find out what that commit changed, it is a good thing we make small commits so we can see specifically what changed in a given commit!
300000000 lines changed

jovial warren
prisma wave
#

commit != push

old wyvern
#

^

errant geyser
#

Uh Bardy, why does one of your files have over 171k lines

jovial warren
#

blocks.json

#

it's generated by Minecraft's data generators

errant geyser
#

Oh god

floral vault
#

hi

old wyvern
#

Isnt there a library that handles all that?/

jovial warren
#

it's a registry for every single state of every single block in the game with it's associated global palette ID

jovial warren
errant geyser
old wyvern
#

There was a library that held and provided those things

jovial warren
#

it's a nightmare to deserialise as well

prisma wave
#

do not worry

#

elara json has you covered

errant geyser
#

I'm so glad I never attempted this

forest pecan
#

Elara JSON Insurance?

#

Poggers?

#

I always needed that

old wyvern
#

Yes!

heady birch
#

Can you do nested sections in toml?

prisma wave
#

elara puts the fun in function ! !

old wyvern
errant geyser
#

I'm down to try and write ELON if nobody else has yet

jovial warren
#

src/main/resources/registries/blocks.json | 171927 ------------------ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

errant geyser
#

Enjoy

jovial warren
#

351 files changed, 1633 insertions(+), 187280 deletions(-)

prisma wave
#

average elara user is always happy

jovial warren
#

-_-

prisma wave
#

average kotlin user goes through many depressive state

errant geyser
#

Elara can only bring joy

jovial warren
#

and yet another day passes where this still doesn't work

#

and I have to go to bed now

#

good night

#

ffs

old wyvern
#

What happens when you dont se eyour db updates

errant geyser
#

Imagine needing to sleep

old wyvern
#

And rewrite a lot of stuff

prisma wave
#

what

jovial warren
errant geyser
#

So do I

old wyvern
#

And realize your dumbass forgot to pass a arg and it provided a null which was handles with an elvis

prisma wave
#

classic

errant geyser
prisma wave
#

kotlin does not prevent mistakes like this!!

#

elara does

old wyvern
#

So the db opens in service is "myuser_chat" and in viewmodel its "user_chat"

errant geyser
#

We should sell Elara life insurance

old wyvern
#

๐Ÿฅฒ

jovial warren
#

Elara, the unfinished language that is overrated and over circlejerked

#

lol

prisma wave
#

not unfinished

errant geyser
#

How dare you

prisma wave
#

technically functional

jovial warren
#

Elara is so overrated

forest pecan
jovial warren
#

lol

forest pecan
#

Elara is so underrated

old wyvern
#

^

jovial warren
#

over*

prisma wave
#

elara use logcal flow analysis to determine the effect of every single line. then at compile time you must input y/n to confirm each line

#

for example

errant geyser
jovial warren
old wyvern
#

Repl it will pay dearly

heady birch
#

"Are you sure you would like to include line 251 in the final executable?"

old wyvern
errant geyser
#

If only they would have given us $10k to continue on a project written in Kotlin by what looked like 5 year olds

old wyvern
#

Elara Fun Lang

prisma wave
#

i will add ```rust
if condition => return error "aaah"
...

elara compiler: ```
newly added line 31394 will mean program fails if [condition] is true. Do you want to confirm the change?
jovial warren
jovial warren
#

anyway, gn you lot

old wyvern
errant geyser
#

Farewell gamer

old wyvern
#

"Terminating user! Enabling SkyNet... please wait..."

prisma wave
#
where could [condition] be true?
- If module/functionName returns an error
- If file "file.txt" does not contain "hello"
errant geyser
#

Seggc

old wyvern
#

indeed

errant geyser
#

Does anything need to be added to the stdlib for Elara? Like I said earlier I have a load of free time so I want to finally do something in the rewrite

prisma wave
#

a lot

#

but

#

we are debating on some big syntax changes

#

so maybe hold back

old wyvern
#

mhm

#

When are you free bm?

prisma wave
#

unless you dont care about any contributions becoming redundant

prisma wave
#

maybe like 5pm utc

old wyvern
#

Alrighty

errant geyser
#

I suppose I should probably learn Go at some point

prisma wave
#

yes

old wyvern
#

Its pretty easy katsu

prisma wave
#

go is just kotlin with weird syntax

#

or java

old wyvern
#

Except for the lack in the std lib

prisma wave
#

yeah

errant geyser
#

I'll reinstall GoLand then. Still don't know how I managed to fuck it over as badly as I did

old wyvern
#

lol

winter iron
#

can someone make an application that writes codes based on thoughts?

#

so i dont have to use keyboard

#

and i can just wrap a squid tentacle around my head

#

and just do stuff

dawn hinge
#

That would be cool but has some downsides

winter iron
#

like

dawn hinge
#

Humans mind isn't constantly, any action that happens could just ruin the whole code lol

winter iron
#

thats fine

#

just undo ur thinking

dawn hinge
#

That works I suppose but that could get tiring & it will probably be extremely hard to code even just a simple code

#

It'll definitely be fun though

forest pecan
winter iron
#

then they get google

forest pecan
#

are you talking about pseudocode?

#

or just literally

winter iron
#

nah just give them google

forest pecan
#

writing down thoughts

#

so remake Google

winter iron
#

so u have ur ide

#

then on second monitor

#

u have google

#

then u look at google

#

and it copys it

forest pecan
#

no like

#

Make Google

#

not take you to it

winter iron
#

ye

forest pecan
#

its too abstract

winter iron
#

it just recodes it all for u

forest pecan
#

not possible

#

lmao

winter iron
#

not yet

#

give it a few decades

forest pecan
#

i doubt