#dev-general

1 messages ยท Page 464 of 1

prisma wave
obtuse gale
#

lol

prisma wave
lunar cypress
#

notch was like "hurr durr gmtk is just politics nowadays" and gmtk said they wouldn't do politics anymore if he deleted his account

prisma wave
#

Will have a read when I get home

lunar cypress
#

or, i guess, disabled it

#

was gone for a good month or so though I think

prisma wave
#

How is it even political

#

I've not watched in a while but like

#

Does that just mean they reviewed a game with a black person in or something

lunar cypress
#

talking about accessibility maybe?

prisma wave
#

oh yeah that was probably it

#

Wait until he hears about the new ore textures ๐Ÿฅฒ

ocean quartz
#

Gradle is less arrowy than Maven, they said

obtuse gale
#

minor details

#

just one exception here and there

vagrant bobcat
steel heart
ocean quartz
#

Just a joke, it's actually not that much

onyx loom
#

the issue is kotlin dsl

steel heart
#

yeah well I mean you can generally do stuff like

shadowJar {
  classifier 'blah'
}

//to
shadowJar.classifier 'blah'
``` if u didnt know but I take it u alr know
ocean quartz
onyx loom
#

๐Ÿฅฒ

#

HEY

#

sounds like a YOU problem

#

i NEVER have "warnings" with groovy!

obtuse gale
#

only yellow decorations

onyx loom
#

except like 1 or 2 times ๐Ÿฅฒ

ocean quartz
#

Lmao

onyx loom
#

3 or 4 times

#

10+ times

onyx loom
#

colours good

unkempt tangle
#

how do I install conda?

old wyvern
#

Anaconda?

unkempt tangle
#

think so

old wyvern
humble silo
#

Since IJ is being a pain i have to convert my project to kotlin mostly by hand, I know i have to convert the gradle stuff over(change the file type etc.) but then are there alot of internal project configuration things i have to do or no? I dont really want to brute force it and have issues later

frail glade
#

You don't have to change the Gradle to the Kotlin DSL.

#

But yeah, I wouldn't trust IJ to convert my project over to Kotlin directly.

humble silo
# frail glade You don't *have* to change the Gradle to the Kotlin DSL.

Is there a good way to do it? I switch it over and then a bunch of IJ things/warnings/flags pop up at the top like script configuration wasnt received It seems like its getting confused by some internal configuration of the project but i have literally no idea what i need to change around

#

Ive already restarted and invalidated my caches

frail glade
#

I'm not entirely sure what you're talking about. Got some screenshots?

humble silo
#

Huh, it seems to have sorted itself out after changing the single quotes to double ill see if it runs though

half harness
#

in kotlin single quotes = a character wheras in groovy it's a string

humble silo
#

Any reason why kotlin needs a different file type for gradle? It seems like it shouldnt matter too much

#

gradle.build.kts for example

#

build.gradle*

#

wow it actually compiled and ran

prisma wave
#

It doesn't need a different one

#

They're 2 distinct things that just happen to use the same language

humble silo
prisma wave
#

It's personal preference

humble silo
#

Well its working fine when did so i guess ill just stick with it like that

prisma wave
#

If you wanna change for the sake of consistency, sure. If you don't care, it's fine to leave it

half harness
#

i use groovy bc its more common = better support but i also code in kotlin

humble silo
frail glade
#

Yeah I typically just use Kotlin in projects but the regular Groovy build system. Works fine.

prisma wave
#

Learn Haskell instead

humble silo
#

Reporting you to the TOS rn

#

lol

prisma wave
#

NO

humble silo
#

Functionality aside ๐Ÿ˜…

prisma wave
#

well

#

the bits written by me are well written, yes

#

Would be a whole lot nicer in Haskell though

humble silo
#

Well alr thanks for the help

ocean quartz
half harness
#

wat

prisma wave
onyx loom
#

no

prisma wave
#

yes

ocean quartz
humble silo
#

God IJ is weird, I created a small test project in Java then tried to convert it to kotlin and had SO many issues, then i did it with my real one and it went just fine

onyx loom
#

๐Ÿฅฒ

oak raft
#

True

#

Eclipse better

humble silo
prisma wave
humble silo
#

How does this compile as a KTS??

#

oh, simple answer it doesnt

#

im so smart

half harness
#

๐Ÿฅฒ

ocean quartz
humble silo
#

im trying to

#

Honestly the only reason i am though is being Id get hated on later for not

half harness
#

good luck - gradle kts in general is nice, but if you're trying to use a plugin that only has documentation for groovy, it can get annoying :p

humble silo
#

imagine using spigot

#

or plugins

#

ew

half harness
#

by plugin i meant a gradle plugin

humble silo
#

ah i see

prisma wave
#

no i still agree

#

plugins ๐Ÿคข

half harness
#

which is the reason why i went from groovy -> kts -> groovy -> kts -> groovy

ocean quartz
#
plugins {
    java
}

group = "net.yakclient"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies() {
    testimplementation("...")
    implementation("...")
}

tasks {
  test {
    useJUnitPlatform()
  }
}
prisma wave
#

some people prefer kts

#

some dont

#

im on the fence atm

ocean quartz
#

I prefer kts

humble silo
#

IJ will automatically create it as a kts though, is there a way to tell it not to?

ocean quartz
#

IJ normally defaults to groovy

half harness
#

if you select kotlin option, it defaults to kts

#

although you can select groovy

humble silo
#

In a kotlin project this is what it generated

humble silo
#

god this is opinionated

ocean quartz
half harness
humble silo
obtuse gale
prisma wave
humble silo
ocean quartz
#

Personally i prefer this way of creating

half harness
heady saddle
#

hey guys
where is the list of all thing you can put on yoru scoreboard

#

your*

ocean quartz
onyx loom
prisma wave
frail glade
#

I love the MC Dev thingy ๐Ÿ˜„

onyx loom
#

support in training

prisma wave
#

helpful

#

oh tbf

ocean quartz
prisma wave
#

how's that

onyx loom
#

lol

humble silo
#

Im assuming this is pretty bad kotlin? Its auto generated

#

idk why it put the run blocks in ๐Ÿ‘€

prisma wave
#

could be worse...

#

kinda cursed though

#

the run blocks can go

#

apart from that it's pretty much fine-ish

humble silo
#

Alr

#

idk why i would do it as a companion object though

#

one second

ocean quartz
#

You wouldn't, normally it'd be a top level function

#

And not jvmstatic

#

And wouldn't even need args

onyx loom
#

val `class` ๐Ÿ™‚

humble silo
#

so much better

#

Are regex's different in kotlin? Its complaining about those

#

Doesnt seem to like the "_" here

ocean quartz
#

Depends, what is it saying?

humble silo
#

unresolved reference

half harness
#

put a \ maybe

humble silo
#

I dont even remember what this is suppose to do

#

oooh

half harness
#

you can do this: @humble silo kt val variable = "a" val other = "b" val string = "first variable: $variable, second variable: $other, combined: ${variable.plus(other)}" println(string) this will print first variable: a, second variable: b, combined: ab

humble silo
#

i actually dont even need that

half harness
#

and so it errors because _ isn't a variable

humble silo
#

im just gonna take that part out cause it was deprecated anyways... I totally forgot what that regex was for

oak raft
#

How do I send something from github -> intellij

#

Looks like I'm getting GitHub Desktop

lunar cypress
oak raft
#

I forked something right

#

And now I wanna make edits

#

Inside of IntelliJ

#

So how do I send those files over to my IDE

#

Do I need GitHub Desktop for that?

half harness
#

ew no

hot hull
#

No

#

just use IJ's integration?

half harness
oak raft
#

Oh

#

Thanks ๐Ÿ˜„

prisma wave
#

anyone know what scope i should be using in coroutines if GlobalScope is bad

#

obviously Dispatchers.IO for IO, but what about for more general stuff?

jovial warren
#

\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} \[\w+\] \w+ \w+ - .* I am the regex master lol

#

somehow that matches a line in Krypton's log format lol

#

trying to configure Ideolog

prisma wave
#

isn't Default blocking

old wyvern
#

No

prisma wave
#

huh

#

i saw some article that said Thread.sleep will block it, but i guess i'll be using delay() so that's fine

#

okay

old wyvern
#

Default uses the fjp common pool I think, but that might be implementation details

prisma wave
#

ah cool

jovial warren
#

you know the IO dispatcher is backed by the default dispatcher right?

prisma wave
#

doesn't seem much point making my own pool when there's at least 2 existing ones

jovial warren
#

the IO and default dispatchers use the same pool lol

old wyvern
prisma wave
jovial warren
#
* This dispatcher shares threads with a [Default][Dispatchers.Default] dispatcher, so using
* `withContext(Dispatchers.IO) { ... }` does not lead to an actual switching to another thread —
* typically execution continues in the same thread.
* As a result of thread sharing, more than 64 (default parallelism) threads can be created (but not used)
* during operations over IO dispatcher.
```from the documentation of `Dispatchers.IO`
old wyvern
prisma wave
#

ok?

jovial warren
old wyvern
#

They simply share some threads

prisma wave
#

i dont see how that's relevant lol

old wyvern
#

They arent equivilent

#

IO dispatcher creates separate threads when needed

jovial warren
#

I think they're still managed by the same scheduler, just not the same dispatcher, which would make sense

#

actually schedulers = dispatchers

#

and ready?

old wyvern
#

What?

jovial warren
#

they're dispatched by the same dispatcher, and they use the same executor

prisma wave
#

wait so

old wyvern
prisma wave
#

CoroutineScope(Dispatchers.Default).launch {}?

old wyvern
#

Yes?

prisma wave
#

ok

old wyvern
#

Oh btw

prisma wave
#

just making sure

old wyvern
#

Sx said you should keep that instance cached

prisma wave
#

ah yeah

old wyvern
prisma wave
#

Kotlin too confusing

#

I miss simple languages like Haskell

old wyvern
#

๐Ÿ˜Œ

prisma wave
#

I'm sure haskell's coroutines are EASY

old wyvern
#

parallel was pretty nice

#

havent tried the coroutines package yet

prisma wave
#

Low-key wanna try a haskell Minecraft server

#

Sounds fun

onyx loom
#

Hrypton is a minecraft server implementation written from scratch in Haskell

prisma wave
#

๐Ÿ˜ฎ ๐Ÿ˜ฎ

ocean quartz
#

Written from scratch in Haskell++

half harness
#

competing against krypton?

#

๐Ÿ‘€

#

aren't you the founder of krypton?

#

or is it bardy

onyx loom
#

MineKraft

jovial warren
#

and he's going to get removed from the dev team if he doesn't start pulling his weight soon

old wyvern
#

Um, What???

#

What kind of black magic is this

jovial warren
#

lol

jovial warren
#

looks like Android to me

old wyvern
#

Yes

jovial warren
#

might explain it

#

I don't know what's causing it though, which is annoying

#

I could be reading data wrong, but I find that unlikely as I basically read Anvil with the same mechanism that vanilla does

#

it seems to be happening at index 2061 in the buffer

steel heart
#

Maybe itโ€™s an nms thing

jovial warren
#

iirc minecarts always face north

#

just a game mechanic

#

actually not true

#

maybe they always spawn north

#

or maybe it's just Bukkit being shit as always

steel heart
#

Worst case scenario youโ€™d have to use reflection and shit

jovial warren
#

perhaps this is just yet another thing that Bukkit won't let you do

#

dis why Bukkit bad

steel heart
#

Imagine using Bukkit when Krypton exists KEKW

jovial warren
#

@tranquil crane add that to the list of things that Krypton needs to do better than Bukkit please (you're the one working on entities, and read up if you don't know what I'm referencing when you read this later ๐Ÿ™‚)

jovial warren
#

Krypton has chunk streaming now as well

#

a.k.a you move between chunks = new chunks load and old chunks unload

steel heart
#

thats pog^pog

jovial warren
#

ikr

#

and I wanna fix broken sections next, which will be pog^pog^pog^pog^pog^pog^pog^pog^pog

obtuse gale
#

wasn't there an arrow notation to "accumulate" consecutive exponentiation?

jovial warren
#

what's this?

obtuse gale
#

madness

obtuse gale
#

unimaginably large numbers

prisma wave
#

comically large

obtuse gale
#

beyond astronomically large

prisma wave
#

im sure haskell could process them with ease

old wyvern
#

๐Ÿ˜Œ

#

Imagine not being lazy

jovial warren
#

ffs

#

lol

#

lol

#

ew Windows xD

#

sounds like Minecraft to me

old wyvern
#

sentient minecarts

ocean quartz
#

Try changing the rotation on the spawn method's consumer

jovial warren
onyx loom
#

what am i looking at here bardy

jovial warren
#

look at the text on the screen

half harness
onyx loom
#

its just a bunch of numbers

#

meaningless

jovial warren
#

left is data sent by Krypton, right is data sent by the Notchian server

#

it's chunk data

onyx loom
#

ok and is this good or bad

half harness
#

uhh

jovial warren
#

and every red line is a difference

half harness
#

aren't they supposed to be the same

jovial warren
#

that's the point dkim, yes

onyx loom
#

๐Ÿ™‚

jovial warren
#

idk why the client's not rendering these still though

prisma wave
#

oh god compression

#

but still

#

wat

#

oh it doesnt like synchronized

#

good

jovial warren
prisma wave
#

mhm

#

var xp: AtomicBigInteger = AtomicBigInteger(BigInteger.ZERO), god i hate this

jovial warren
#

imagine not using kotlinx.atomicfu

ocean quartz
#

Try changing the rotation on the spawn method's consumer

obtuse gale
#

I think that's some vanilla client bullshit lol

jovial warren
#

as I said, sounds like Minecraft to me

inner umbra
#

But I can move them and they will still change their yaw at the same time

distant sun
#

would be possible to create a python app and make it usable without having to install python on your computer?

old wyvern
#

with cython maybe

prisma wave
#

not doing it

#

gross

onyx loom
#

download python at runtime ๐Ÿ˜Ž

prisma wave
#

p

ocean quartz
#

kotlinx.atomicfu Atomic fuck you

old wyvern
#

or pyinstaller

#

Who needs kungfu when you have atomicfu

prisma wave
#

kotlin devs lazy af istg

jovial warren
jovial warren
prisma wave
#

the atomicfu one...

jovial warren
#

lol

ocean quartz
#

That Elizarov dude is actually a pretty cool guy

prisma wave
#

i am not using buildscript

#

no

#

if he was cool he wouldve stopped using deprecated gradle apis in 2 years

#

lazy sod

#

release 8 days ago and they cant figure out how to publish a gradle plugin

#

GROW UP

#

im actually embarassed to be using this language

#

absolutely useless

onyx loom
#

dont use it then ๐ŸŒš

prisma wave
#

I WONT

#

selfish developers

onyx loom
#

i think its time u need some groovy in ur life

prisma wave
#

god i would love some

onyx loom
#

๐Ÿคจ

#

please do enjoy it ๐Ÿ™‚

prisma wave
#

how can u circlejerk a language whose libraries arent even usable ๐Ÿคฃ

onyx loom
#

ikr kotlin SO bad ๐Ÿ™„

half harness
#

kotlin > haskell

prisma wave
#

well then explain why this plugin doesnt work

#

if kotlin is so good

onyx loom
#

idk ask bardy

#

hes the one preaching of such a shit plugin

prisma wave
#

you know

#

in haskell i would have this done already

#

in kotlin i have to WORK AROUND the language

onyx loom
#

disgusting

#

this is why i say to use groovy

prisma wave
#

yeah ur right

onyx loom
#

its by far the best jvm language ๐Ÿ™‚

prisma wave
#

so true

#

god

#

and now because of USELESS kotlin i have to REDEFINE 300 operators just because i want an ATOMIC

inner umbra
#

I figured it out @jovial warren delay the teleport method.

prisma wave
#

bro this is a JOKE

onyx loom
#

have u tried not usign atomic

prisma wave
#

i need atomic

#

or something like that

#

atomic is easy

#

or it WOULD BE

jovial warren
prisma wave
#

GOD

#

just give me instance Atomic Integer where ๐Ÿ˜ฉ

onyx loom
#

daily semigroup mitten mental breakdown

#

๐Ÿคฃ

prisma wave
#

"kotlin avoids boilerplate"

half harness
#

B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.4

onyx loom
#

it does

prisma wave
#

WHATS THIS

half harness
#

B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.4

prisma wave
#

THEN

onyx loom
#

in comparison to java ๐Ÿ™‚

half harness
#

smh

prisma wave
#

๐Ÿ˜ก

#

SHUT IT

tranquil crane
#

could you don't

prisma wave
#

okay

#

sorry

#

๐Ÿ™‚

jovial warren
half harness
#

bad staff

prisma wave
prisma wave
tranquil crane
prisma wave
#

IF UR BORED

#

MAKE A GOOD

#

KOTLIN LIB

#

FOR ATOMICS

jovial warren
#

yeah I'm not even actually gonna bother to fix that lol

onyx loom
#

could you dont

prisma wave
#

WITH

#

๐Ÿ™‚

half harness
#

B.A.A.S - Too many caps!
No need to shout.
Barry's Anti Abuse System | v1.4.5

prisma wave
#

Please make a good Kotlin library for atomic variables which features a functioning Gradle plugin thank you ๐Ÿฅฐ

tranquil crane
#

is there a way for you to print out the data in binary notation to see if there's a pattern to it or something?

jovial warren
#

I can print out the raw binary data, can even write it out, for Krypton that is

#

for vanilla I'm on my own unless I inject an agent

onyx loom
#

why do u even need a gradle plugin for a lib

#

like :what:

jovial warren
prisma wave
#

stupod kotlin

#

how do i define inc operator function

onyx loom
#

no stupid atomicfu or whatever its called

tranquil crane
#

could you send me both those data files

prisma wave
#

getAndIncrement or incrementAndGet

#

who knows

jovial warren
tranquil crane
#

aight

prisma wave
#

i got it ๐Ÿ˜„

onyx loom
#

im confused

#

is it not inc?

prisma wave
#

It is

#

But I was unsure about the behaviour

#

given there's ++x and x++

#

nono nonononnon on no non

#

how do i atomic CircularFifoQueue

jovial warren
#

atomic<CircularFifoQueue>()?

prisma wave
#

yes but

#

that will copy every time

#

what i mean is

jovial warren
#

or just use AtomicReference lol

prisma wave
#

how to make CircularFifoQueue thread safe

jovial warren
#

ik

prisma wave
jovial warren
#

with

prisma wave
#

NOT helpful

#

consider yourself BLOCKED ๐Ÿ˜ก

jovial warren
#

yeah right

prisma wave
jovial warren
#

the amount of times I've asked for help and you've given me Haskell circlejerk BS and I've put up with it

prisma wave
#

what is the point of these "convenience libraries" if you have to do everything yourself

jovial warren
#

also why are you using commons?

prisma wave
#

why not

jovial warren
#

because I've found it to be mostly unnecessary, especially when you've got Kotlin

prisma wave
#

yeah give me kotlin CircularFifoQueue then

#

and dont say write your own implementation

#

dont

obtuse gale
#

fifo bad

prisma wave
#

oh

obtuse gale
#

imily good

prisma wave
#

i thought you were going to say something funny

obtuse gale
#

I would never

#

๐Ÿ™‚

obtuse gale
#

bo

#

m

#

p

half harness
#

bomp?

prisma wave
#

๐Ÿฅฒ

#

I forgot about that gem

obtuse gale
#

loll

jovial warren
#

also, Circular? what is that meant to even mean?

prisma wave
#

not helpful

#

CircularFifoQueue is a first-in first-out queue with a fixed size that replaces its oldest element if full.

#

fixed size

jovial warren
#

ah okay

obtuse gale
#

cyclical

prisma wave
#

so the helpful people of helping chat have so far said "use broken library" and "bomp"

#

i love you guys

onyx loom
#

BOMP

obtuse gale
#

๐Ÿฅฒ

#

the ptsd

#

lol why is that red

half harness
#

:)

prisma wave
#

"better" discord

onyx loom
#

do i smell

#

betterdiscord

half harness
#

my gradle builds are taking 3+ minutes, is this normal ๐Ÿฅถ

onyx loom
#

for ur pc yes

obtuse gale
#

say it

#

kali say it

prisma wave
#

it's what you deserve

#

pc bad

onyx loom
#

infact, that is excellent pace

half harness
#

._.

#

but

prisma wave
#

classic

half harness
#

is there nothing i can do about it

obtuse gale
#

kali

onyx loom
obtuse gale
#

say it

#

YES

half harness
#

._.

prisma wave
#

return 1 + (level / 10) can someone calculate this if level is 20

#

ty

#

thanks

#

i got it

onyx loom
#

yes

half harness
#

what is this? it takes like 2 minutes

onyx loom
#

Create Jar: Download maven-metadata.xml...

obtuse gale
half harness
#

......

#

what is maven-metadata.xml

prisma wave
#

idk, i think it's downloading maven-metadata.xml

obtuse gale
#

it holds metadata for maven

#

in xml format

half harness
#

why is it taking so long?

prisma wave
#

it's downloading it

obtuse gale
#

eXtremely Malicious Language

onyx loom
#

theres a lot of metadata ๐Ÿ˜ƒ

obtuse gale
#

in xml format

onyx loom
#

and ur internet slow ๐Ÿ˜ƒ

half harness
#

i have good internet

#

i think

obtuse gale
#

you think?

onyx loom
#

doubt

#

with a bad pc

half harness
#

...

#

but seriously

#

why does it take so long

#

and it's only my bedwars plugin

onyx loom
#

idk have u tried downloading it faster

half harness
#

.

obtuse gale
#

lol

#

do you often invalidate caches & restart?

#

of course you do

#

consider not

half harness
#

yes i do

distant sun
onyx loom
#

gaby i used to say that to u all the time ๐Ÿ˜ฉ

distant sun
#

:)

jovial warren
#

org.benf.cfr.reader.util.ConfusedCFRException: Started 2 blocks at once what an exception

#

ConfusedCFRException

onyx loom
#

๐Ÿ˜Œ

#

pex using adventure tho, lol

#

they growing up

half harness
#

minecraft eula ๐Ÿ‘€

oblique heath
#

seems sketchy

half harness
#

wait do they accept paypal

#

or any form of money

oblique heath
#

doesn't look like it

half harness
oblique heath
#

bitcoin is not anonymous enough for them, so of course they took the logical next step

#

minecraft accounts

onyx loom
#

๐Ÿ˜Ž

half harness
#

isn't crypto untraceable?

oblique heath
#

well actually bitcoin is

#

other coins like monero though are basically untraceable

half harness
#

oh

prisma wave
#

suspend fun flow() = mutex.withLock { queue.iterator().asFlow() } anyone know if this will be "safe"

#

assuming queue is a non-thread-safe type

oblique heath
#

there's a 50/50 chance it's perfectly safe

prisma wave
#

๐Ÿฅฒ

half harness
#

mc accounts = against eula though

onyx loom
#

?tryandsee

compact perchBOT
prisma wave
#

i hate you

oblique heath
onyx loom
prisma wave
#

welp

#

actually

#

i guess it's probably safe to just take a copy and return that

#

no suspending locks needed

prisma wave
#

i despise all of you

onyx loom
#

love u too

half harness
#

i got clojure

#

i would've been surprised if i got haskell for the 3rd time in a row

prisma wave
obtuse gale
#

๐Ÿฅฒ

steel heart
#

or am I wrong?

prisma wave
#

all access uses the lock yes

#

idk enough about how locks and flows work to be able to say with confidence that will be safe

#

actually it probably will be fine

#

it's just ```kt
flow {
forEach { value ->
emit(value)
}
}

#

so nothing "continuous"

#

oh well, don't need it now anyway

#

also flows don't have any{} which is what i actually needed

onyx loom
steel heart
#

@prisma wave I mean usually when I want to use non thread safe data structures in a multi threaded environment I just wrap it with Collections.synchronized

onyx loom
prisma wave
sweet cipher
#

Does it break daily routines?

half harness
#

ha

#

ha

#

hahaha

forest pecan
#

VLC has dark theme coming soon

#

๐Ÿ˜

#

And a completely new interface

ocean quartz
#

Pics or didn't happen ๐Ÿ‘€

lost forge
forest pecan
#

aight

#

wait let me get the post

ocean quartz
#

Hmm actually don't really like the bar down there, I prefer the current one

forest pecan
#

reminds me of the windows player kinda tho

#

๐Ÿคก

old wyvern
#

What....???

#

Aight

#

Time to find out what today is in kilocalories

obtuse gale
#

24 karat seconds ๐ŸŒ

#

As pure as they can get

forest pecan
#

lol

old wyvern
humble silo
#

In kotlin What is the best way to do final static fields like you would do in Java? Should you use a object and declare a const val, should you define it outside a class as a const var or should you do it as a companion object inside

ocean quartz
#

Top level constant

humble silo
#

const val METHOD_SELF: String = "";

#

outside the class?

#

More specifically in annotation classes?

ocean quartz
#

Like for example:

private const val CONSTANT = ""

class YourClass {
}

Or if you want if you want public constants, remove the private or create a Constants.kt and place it there

humble silo
#

Huh alr thanks

humble silo
distant sun
#

Top level constants are available to other classes

ocean quartz
#

If it's private then every class, function, etc, in the file is able to access it
If it's public it can be accessed everywhere (will ask you to import for example)
if it's internal it can only be accessed inside the same module

#

Also, was wondering what the difference between val and const val and it's just that const doesn't create a getter, it's direct access
Which makes me wonder why they only allow it for primitives thonking

ocean quartz
#

Forgot to add "in the file"

humble silo
distant sun
#

Right, makes much more sense xd

ocean quartz
humble silo
#

huh alr

#

thanks

distant sun
#

Today I wrote my first py script that is actually useful :D

oak raft
#

Which was?

ocean quartz
#

What do you think about it? I never really liked py

distant sun
#

Cool and weird at the same time

forest pecan
#

indent language

#

executable yml

#

/s

humble silo
#

Oh Matt sorry, If im doing a interface that just has constants(like you might do in java) The constants still go toplevel and i dont provide anything in the interface correct?

distant sun
# oak raft Which was?

Create a prefix with gradient from a given set of colors and output the format for Essentials, TAB, or Vanilla (&R&R&G&G&B&B)

ocean quartz
distant sun
forest pecan
#

yea

ocean quartz
#

Yeah

humble silo
#

great!

distant sun
#

What I find amazing is the collection comprehension thing or however is called

old wyvern
ocean quartz
#

Yeah, single line on bytecode vs 4 lines for non const

old wyvern
#

Java inlines static final primitive stuff as well, so it probably exists for the same optimization

old wyvern
ocean quartz
#

Imagine if they added Sx's suggestion of something like
companion const val instead of needing the companion object block

humble silo
#

omg this is gonna be a pain... time to turn about a hundred java files into kotlin

#

letting IJ do the hard work i guess

old wyvern
old wyvern
#

No point in converting what you already have

half harness
old wyvern
#

Just write new parts in kotlin

half harness
#

at least thats what i think the intellij error told me

humble silo
# old wyvern Why?

Cause i started writing it in Java and then dumb star convinced me to write in Kotlin

#

ily star

#

lol

old wyvern
#

Kotlin is built with slowly adding it to projects in mind

humble silo
#

so

humble silo
#

and it will only take an hour or two

half harness
#

oh wait

#

not replaced

#

wrong word

old wyvern
#

Theres really no point chest

half harness
#

ok u win matt

humble silo
ocean quartz
humble silo
#

and just be easier to maintain

distant sun
#

Probably because primitives can just be wrote as they are, while other objects needs to be initialized
"Gaby" vs Gaby()

humble silo
#

If i dont have to worry about what file type it is

old wyvern
#

lol

ocean quartz
#

It's because of inlining like Yugi mentioned

old wyvern
#

As I said, you can develope in kotlin side by side

distant sun
#

Idk what inlining means

old wyvern
#

But sure

#

If you want to rewrite, go ahead

humble silo
#

Is there a reason not too if it wont take that long?

old wyvern
#

Youll probably end up with something worse if you rush it

old wyvern
humble silo
#

Ya thats a good point, ok ill just do like 5 files for now and see where that takes me

old wyvern
#

So theres no real variable

old wyvern
humble silo
#

sure

old wyvern
#

Unless this is a small project ig

ocean quartz
#

Chestly, IJ's converter is not really good, it's better to slowly convert as you go
If you convert everything it could break

old wyvern
#

^

ocean quartz
#

For example, you'll have tons of !!

old wyvern
#

Also matt ill setup the artifact on* the repo today, hopefully gradle approves today ๐Ÿฅฒ

humble silo
old wyvern
#

Also actually forgot to hook up the relocator to the configuration class I think ๐Ÿ˜‚

#

Need to do that as well

ocean quartz
#

Nice
I hope so too
Adding the lib automatically should be pretty easy once they do
Just need to figure if it's publishing the shadow jar or not, which I don't think it is, i forgot to disable the jar task ๐Ÿ˜ฉ

old wyvern
#

๐Ÿ˜ฌ

#

Will it be an issue later on if we dont have shadowjar rn?

#

Because otherwise we can publish that after approval right?

forest pecan
#

jitpack is down right now

#

lol

old wyvern
#

lol

forest pecan
#

people building using jitpack be like

humble silo
#

Wow kotlin is very nice, this class was just made alot shorter

ocean quartz
ocean quartz
humble silo
#

Cant wait!

old wyvern
#

Its an anti pattern in kotlin

humble silo
#

Whats the alternative?

half harness
#

arrays ๐Ÿคข

old wyvern
#

named arguments

humble silo
#

example?

obtuse gale
old wyvern
#
MixingDestination(
     method = "someThing",
    sources = arrayOf(...),
)
half harness
#

method: String = "something"

old wyvern
#

Forgive the formatting, im on phone, not sure how it looks on pc

old wyvern
half harness
#

o

#

oop

humble silo
forest pecan
#

whats the organization that provides free repo hosting for mc projects?

hallow crane
#

codemc

forest pecan
#

ty

hallow crane
#

np

ocean quartz
#

Could also create a builder function

buildMaxin {
  method = "something"
  sources = arraysOf(...)
}
hallow crane
#

"

half harness
#

"

humble silo
humble silo
#

Why is a builder a anti pattern while in java its extremely common?

ocean quartz
#

Depends, there are still some usage for builders in Kotlin
Like the buildString (mirrors StringBuilder) or buildList

old wyvern
humble silo
#

which are?

humble silo
#

oh that, ok i just didnt know what they were called

old wyvern
#

Builders are used in java to make construction more meaningful when a class has a large amounts of dependencies

ocean quartz
#

For example:

class Test(private val name: String, private val age: Int)
Test(age = 5, name = "Hello")
Test(name = "Hello", age = 5)

In java it's not possible

old wyvern
#

Here you get the same, without the extra work

humble silo
# old wyvern Builders are used in java to make construction more meaningful when a class has ...

A builder is really meant to provide a way to concisely create an object that might have alot of optional values, in effective java he provides an example of a nutrition label where there are 2 required parts of it and the rest are optional. In my case i require the user to provide a method but they can optionally provide as many sources as they want. I feel like that applies by the same rule but you could defintely just pass in a array

old wyvern
obtuse gale
#

default parameter values are great

humble silo
ocean quartz
old wyvern
#
class Human(
     val name: String = "Joe",
     val age:Int,
)

val alonso = Human(name = "Alonso Church" , age = 60)
alonso.name // "Alonso Church"

val joe = Human(age= 20)
joe.name // "Joe"
humble silo
old wyvern
#

That array should be built before the construction of the class

humble silo
#

why is the builder pattern wrong then?

obtuse gale
#

is it just me or did jetbrains tone down the hsv/hsb of the splash screen in IJ/WS/CL/etc?

#

they feel much less aggressive lol

ocean quartz
#

Splash screen? ;o

obtuse gale
ocean quartz
#

Lmao

obtuse gale
ocean quartz
#

Ah yeah, i noticed is a lot more pastel as well

half harness
obtuse gale
#

I HAD this HAPPENING

#

it was SUPER ANNOYING

half harness
humble silo
ocean quartz
#

Is there a new IJ version?

ocean quartz
#

I had this

obtuse gale
#

๐Ÿฅฒ

#

oh

#

yes

#

I know that one, yes

ocean quartz
#

I've been using early releases for some time so it's constantly updating, so never know when a full release is out
Had a lot of issues that were all fixed in the early releases

empty pasture
#

can someone help me change the permissions in a smp server im in cause im confused on how to change the perms

#

help please

obtuse gale
empty pasture
#

sorry i didnt know LMAO

obtuse gale
#

wtf is a MethodHandle

hot hull
#

It's a handle for a method

#

Any sm0rt fellas around? Need some suggestions

cinder flare
#

not really but what's up

hot hull
#

I mean don't really need someone really smart, just need some suggestions regarding what would be best for performance

#

So I need to call a method whenever a player is near a specific player, (within 20 blocks), how and in what way would be the most optimal for this, do I just listen to move event and loopty loop constantly, or would it make more sense to have a runnable and lose on some accuracy because of it

cinder flare
#

hmm yeah I'd go with runnable like every 10 ticks or something

#

plus that bad boy can be async

ocean quartz
#

Runnable would be better, move event triggers more often

hot hull
#

Yea fair enough

jovial warren
#

Since you're only reading, not writing

#

Also, when you wake up this morning and realise the CI is offline, only to find out that you have last month's and this month's bill unpaid ๐Ÿฅฒ

old wyvern
#

Holy shit lmao, man didnt even check the assignment xD

#

I didnt write anything, submitted jsut for attendence

#

ez marks

hot hull
#

lol

cinder flare
#

ah yeah in class activities are usually just participation points

old wyvern
#

They arent for us

lunar cypress
#

Meanwhile my algorithms tutor detracts points from my score because in his mind addition is O(0) Pepega

old wyvern
#

lmao

cinder flare
#

I mean, addition is certainly O(1)

#

it takes like, one clock cycle always

lunar cypress
#

according to him, this:

def f(n):
  if n < 2:
    return n
  ...
#

is O(0) for n = 0 and O(1) for n = 1

#

the mad man is defying the laws of mathematics

prisma wave
#

what

lunar cypress
#

oh no

#

weeb mitten?

prisma wave
#

sorry

hot hull
#

I'm fucking dissapointed

prisma wave
#

Im not a weeb

#

Inside joke with some irl friends

onyx loom
#

oh god please no

#

this is unforgivable

prisma wave
#

๐Ÿ™„ ๐Ÿ™„

jovial warren
#

BomBardyGamer authored and BomBardyGamer committed lol

#

this is why you donโ€™t use Git and repl.it lol

steel heart
#

@prisma wave nice pfp

jovial warren
#

no

steel heart
#

Yes

jovial warren
prisma wave
hot hull
#

I support this Bardy

steel heart
#

Maybe wanna use some lock mechanism assuming you load and save world files async

#

I just scrolled through it so yeah might have missed smtng

prisma wave
#

Future<*> ๐Ÿคฃ

jovial warren
#

world files are loaded async, yeah

prisma wave
#

๐Ÿคฃ ๐Ÿคฃ ๐Ÿคฃ

jovial warren
old wyvern
#
// also means I don't declare extra unnecessary integers on the stack

OpTiMizAtIoN: ๐Ÿ’ฏ

#

xD

jovial warren
#

yeah ignore that BS lol

#

thereโ€™s literally a comment there saying itโ€™s likely BS, especially if thatโ€™s const val ONE

old wyvern
#

I dont think that actually saves space btw

#

lol

jovial warren
#

yeah ik, not why I made it

jovial warren
old wyvern
#

Why is it a wildcard btw?

jovial warren
#

idk, ask Java

old wyvern
#

huh?

#

override fun save(world: World): Future<*>

old wyvern
#

What type is saveAll?

jovial warren
#

no clue

old wyvern
#

You didnt write it?

jovial warren
#

I did, I just canโ€™t remember it that well

#

probably Unit

old wyvern
#

ah

jovial warren
#

though I might be able to make that async when itโ€™s auto saving

old wyvern
#

I think you can specify the generic as Unit there and let it act like a callable tbh

jovial warren
#

maybe

#

the world managerโ€™s load returns Future<out World> so I can have it return Future<KryptonWorld> in the implementation, and I moved the save into the World interface itself so you can define custom behaviour to save custom world formats

#

because the API is obviously implementation agnostic, even though itโ€™ll likely only be implemented by Krypton

#

oh also, you know how in Bukkit, chunk objects can load themselves? do you think thatโ€™s a good idea or should I leave the ability to load chunks to the world object that contains and manages them?

#

or I guess I could create a new chunk manager interface that every world has

old wyvern
#

Probably just let the world manage it

jovial warren
#

since on the backend, the chunk manager is the one managing chunks, not the world

#

and chunks only exist as chunk objects once theyโ€™ve been loaded anyway, so making chunk objects load themselves is impossible

#

oh btw, going back to the world executor, is it worth making it fixed size or should I leave it to potentially grow infinitely? (currently a cached thread pool)

#

or maybe I could create a DynamicResizableCachedThreadPoolExecutor that can be resized based on how many worlds there are

old wyvern
#

Id say fixed size

jovial warren
#

since I kinda want a cached thread pool with an upper limit on how many threads there can be

old wyvern
#

Ok, IJ has now started completly breaking down

#

nice

jovial warren
#

lol

old wyvern
#

This has been going on for a while now

steel heart
old wyvern
#

deleting the statement and repasting it fixes it

#

But its so fuckin annoying

onyx loom
#

kotlin... bad?

old wyvern
#

Ofc!

#

Never had such issues with haskell!!

jovial warren
#

yeah right

#

the problem is the IDE not reindexing, not the language lol

old wyvern
#

Ofc not, Kotlin just bad

jovial warren
#

lol

old wyvern
#

I mean tbh I've never gotten this bug with Java, but have gotten this same thing multiple times with kotlin

#

Might be worth reporting

#

idk

jovial warren
#

yeah Iโ€™ve had issues with IJ just not highlighting files with broken code at all until I either fix the broken code or restart

old wyvern
#

Maybe I havent updated the kotlin plugin

#

lemme actually check that

steel heart
#

Aye

#

Pog

#

Yayyayaya

jovial warren
#

Kotlin is harder to highlight anyway because of how vastly superior it is in terms of features to Java

old wyvern
#

Just 1 patch behind it seems

jovial warren
#

and Kotlin being superior in features is just a fact btw

old wyvern
#

There is no big ass "superior" feature thats hard to parse in here

steel heart
#

I can agree java < kotlin

#

But still java is fine

jovial warren
#

the whole confusion with blocks and having to determine where the end of the line is, etc. sounds like it could cause problems

steel heart
#

And it gets better

jovial warren
#

like where everything starts and ends

old wyvern
#

Line end is not anything hard to detect, parser just checks for newline if an expression is complete

jovial warren
#

gotta check the expression though and determine if it is in fact complete

old wyvern
#

These are things many languages have infact

old wyvern
#

its part of building the syntax tree

jovial warren
#

hmm, idk then

old wyvern
#

Probably just some minor bug in the plugin

jovial warren
#

probably a small bug where IJ just gets confused when an error is thrown and freaks the fuck out

onyx loom
steel heart
#

This will be used against dkim

prisma wave
jovial warren
jovial warren
#

Lol

prisma wave
#

Good old quill Robinson

jovial warren
#

Lol

obtuse gale
#

pfp ๐Ÿ‘€

cinder flare
#

ik BM's looking kinda cute now ๐Ÿ‘€

forest pecan
#

@prisma wave wheres that from

#

ur pfp

obtuse gale
#

are you fucking kidding me

#

you can't Player#chat in another thread

#

that's next level stupid

lost forge
#

Lol

hot hull
#

lol

old wyvern
#

lol

quiet depot
#

@prisma wave i don't condone the new pfp

#

bring back soldier

old wyvern
#

weeb mitten bad?

obtuse gale
#

soldier ๐Ÿฅบ

quiet depot
#

weeb mitten bad

hot hull
#

Says a literal pig

cinder flare
#

i mean soldier kinda slaps, he has a point

#

though this new pfp is kinda cute and reminds me of Pulse's

#

though a bit brighter

obtuse gale
#

but i like the new one

cinder flare
#

new Emily pfp coming soon???

obtuse gale
#

mmmm

#

maybe maybe

#

we'll see we'll see

lost forge
obtuse gale
#

yo all of this MethodHandles thing is very poggers

#

Reflection: Reborn

frail glade
#

No relationship advice this morning? Unfortunate.

old wyvern
#

Its also currently the only thing that can load a class into current classloader without an exposed addURL or that classloader being a custom classloader

#

๐Ÿฅฒ

obtuse gale
#

o?

old wyvern
#

Yea, theres a limitation tho

#

You must have a class in the same package as the class to be defined in your application's module

cinder flare
prisma wave
#

One of my irl friends changed to it so I copied it to mock them

#

Because anime profile pictures deserve bullying

cinder flare
#

good thing mine's not from an anime ๐Ÿ˜‰

onyx loom
#

pulse crying inside rn

cinder flare
#

well pulse's is from LoL

#

so also not an anime

onyx loom
#

is that even from anime actually pulse

#

eh close enough

#

both are terrible

forest pecan
#

its not even an anime...

cinder flare
#

close enough? smiling_face_with_3_tears

forest pecan
#

anime girls are way worse than this

prisma wave
#

Although

#

Soldier is getting a bit old

quiet depot
#

spy time?

forest pecan
#

if you bully me for my pfp Kaliber i will bully you for having no developer role

#

/s

onyx loom
#

ok time to apply

forest pecan
#

ur gonna have to wait for a month or 2

#

lol

onyx loom
#

ok time to get bullied for a month or 2

prisma wave
forest pecan
#

lmao

onyx loom
#

or 3 or 4... when i get denied :kekw:

oak raft
#

now who tf is that

prisma wave
#

Idfk

#

I'm not a weeb