#dev-general
1 messages · Page 168 of 1
I should just scrap JS and use Kotlin/JS instead
whether I could actually use Vue with Kotlin/JS is another story though lol
js arrays are basically ArrayLists or HashMaps based on the runtime
I'm 3 exercises in and I'm already regretting it
Right, nvm both are mutable
I remember there was immutable arrays as well tho
w/e JS is not as strict as you might be used to from Java and Kotlin and it's the most popular programming language in the world at the moment so it's definitely worth learning
and learning it well. the curve is very steep
yeah that's what confuses me the most about JS
I'd say js is one of the easiest languages to learn
I'd say js is one of the easiest languages to learn
@prisma wave I'd say it's one of the harder ones to master though
how tf people from the same species as me actually chose this language over all the other options
but maybe that's just me
how tf people from the same species as me actually chose this language over all the other options
Web development my guy
how tf people from the same species as me actually chose this language over all the other options
@jovial warren @ funnycube 🌝
yeah but originally, somebody must've actually reviewed the language and said "yeah, that's a good idea to use as the standard for all web development"
how tf people from the same species as me actually chose this language over all the other options
@jovial warren It's supported byallmost web browsers and the internet is the center of commerce in this day and age.
So yeah, money is the driving force in this case.
as I said, the nowaday reasons aren't my concern
it's funny actually, do you guys know the story of why JS got the prefix "Java"?
it's the fact that somebody actually decided that making JS the standard was even remotely a good idea
nope, but I'm sure you're gonna tell us
to popularise of the java hypetrain iirc
also I don't think anyone officially made it the standard
it just became it
Java™️ HypeTrain™️? what™️?
after all Java applets and VBScript were also pretty popular back in the day
when java came out it got extremely popular really quickly
probably because it was the first attempt at a universal language that was actually successful
Mocha -> LiveScript -> JavaScript
Back in the early 2000s, Sun spent $500 mil on marketing just for the Java programming language because they wanted C++ developers to switch and make them more popular.
probably because it was the first attempt at a universal language that was actually successful
@jovial warren
Excuse me?
Java was and still is pretty big
fun fact
and? I'm saying that was probably the original reason for it's growth
the first attempt at a universal language was actually clojure
The guy that got the task to develop a script language for the browser then got told by his boss he has to put java in the name to utilize the java hypetrain and just associate with the language that got 500 mil shoved down its marketing budget throat. The guy said fuck it, idc, I'll name it JavaScript then
rich hickey single handedly revolutionized the programming market
the first attempt at a universal language was actually clojure
@prisma wave I would actually say it was arabic, back when civilisations began forming
I'd say WORA is what made Java popular any day
by making a single language that would run on any machine
or persian
@prisma wave that title belongs to James Gosling and his team of programmers at Sun
you mad?
@empty flint yeah but does arabic have parentheses
@prisma wave No, but it has s̷͒͐o̷͜͝m̵̐̚é̴̈ ̸̒̉ẅ̸́̇e̸͒͋ḯ̶̉r̵̎̄d̸̐̃ ̶̈́͛a̷͌͗ś̶͆s̸̚͠ ̷̓̏c̶͋̚ḧ̷́̌ȁ̴́r̷̉͘a̴͇͗ċ̸̽t̴́̍e̷̍̾r̵̈́́s̴̈́̏ ̶̀̚t̴̉̇h̴͗͊à̵̾ẗ̶͒ ̶́͌s̵̾͠ư̶̇m̶͌̔m̴̉͌o̶̒̌n̵͌̃ ̶̛́C̵̍̚t̶̉̓ḣ̵̎ư̵̌l̵͒̕ù̸̿ ̴̓́w̶̏̏h̵͂͒ể̸n̵̎͛ ̵̀spoken...
clojure was the first programming language
Clojure was made in 2007
I was made in 2001
the first programming language
Java came out in 1995
I'd like to see a source for that
Wikipedia
1995 Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle) and released in 1995 as a core component of Sun Microsystems' Java platform.
boom
you can't trust anything on wikipedia
@prisma wave I knew that was the BS you'd come out with
am i wrong tho
yes, you are
they have bots constantly monitoring it
you can't trust anything on wikipedia
@prisma wave Yeah, the biggest collection of all human knowledge does not have one single shred of credibility as far as Clojure is concerned.
Quite.
where is ur clojure source from
anything that is even a little bit stupid gets reverted
wikipedia too?
dont trust anything from rich
i would trust anything from rich
you don't know Rich Hickey personally
😐
I do
What if....
he told me
I call bull shit
@old wyvern if...
@jovial warren if....
I wouldn't lie to you guys
https://tenor.com/bgQ7T.gif
is fake
@prisma wave Can't trust shit on Wikipedia, I agree...
probably is tbh
yeah that's untrustworthy
most advanced doesn't mean best though
that's where you're wrong
clojure can do anything
everybody just can't accept the truth 🙄
clojure can do anything
@prisma wave Except beat JS as the most popular programming language today
well Java/Kotlin can't do that either
js isnt the most popular?
yes it is
since when
no idea
today
it's been the most popular for some time now
what the hell is Clojure
though some sources used to say Python was the most popular
yeah thats what i thought was most popular
js isnt the most popular?
@onyx loom It is, dunno since when tho
what the hell ISN'T clojure?
cozy, its nothing. get it out of ur head
Clojure is a lisp-based JVM language @normal talon
clojure was the first programming language
from what I've heard and seen
oh and isnt this language he same as java/kotlin
and the most powerful at parallelism
cozy, its nothing. get it out of ur head
sad
people try to conceal the truth
they are afraid
the media is afraid
jeff bezos himself is scared of clojure
im not afraid of anything expect the sandels of my father
I cant do java or kotlin how im supposed to do clojure
thats just a straight up lie

can u code a mc plugin with it and in intelij
yeah.....
The thing is that most people using Java, Kotlin, Python or whatever usually know JavaScript as well so naturally JS would beat them all
I love hacks
let's think about it:
java / kotlin have lots of different symbols for different tasks - for, val, fun, =, (), {}, [], ,, extends, !!, ?:, etc
clojure has like 6 symbols in the entire language - [], (), ', and :
therefore clojure is easier to learn
case closed
have a nice day

how do I use clojure with intelij
u dont
cursive plugin
that doesn't actually make sense because if you have just 6 you have to learn where you sue which which is harder
but didnt u like suck kotlin all the time Clojure
but with fewer symbols you can do less than more symbols
Cozy don't mind him. His personalities keep getting crazier every day. I recommend you go Java first then others
oke mistr
usually with less syntax
because with java you actually have lots and lots of tutorials and examples
especially when it comes to spigot and bukkit api
well I turned 19 and learning is something i cant do anymore
Ongeveer 496.000 resultaten (0,46 seconden)
there are only a few symbols
@prisma wave Bruh. In JavaScript you can write any code using only the symbols[]()!+.
Blitz im 1 day older than u xd
Can't beat that
yes you can
🙄
@empty flint how are HTML and CSS on that list? they're not even programming languages
in clojure you can write any code using only the symbols []():'
but didnt u like suck kotlin all the time Clojure
Its just a meme 🤷♂️
don't disrespect my passions
hes 16 guys
@empty flint how is HTML/CSS on that list? they're not even programming languages
@jovial warren Idk I just googled
passions
Yugi I start thinking he actually has multiple personalities
Yea possibly, every month a new one is released
like if it was a meme/joke this went very very far
whats next?
Next month we get js mitten
I will use html for plugin coding
xD
yes
HTML is a markup language, suggested by the name, and CSS is a style sheet language (according to Wikipedia), also suggested by its name
HOLY
angry mitten
:clojurewave:
lol
gn
its 10 pm gn
ciao
I've been spending my last 3 hours grouping minecraft materials on categories :((( I think I grouped over 100 materials
https://hastebin.com/ufiqucekuc.md
Copy that JS code into the console of your browser (CTRL+SHIFT+i in Chrome) to see the magic happen
sad
bro
how do you make a module in intellij
but with more modules
i don't get it
doesn't work
is there a way in IIJ to see how long lits are? Like a console or soemthing I don't want to build the plugin launch the server etc. to see the length
i cant copy it
want it dead
@static zealot lits?
oh that's sad
¯_(ツ)_/¯
huh?
yea idk
zip bomb
No
Other one.
What's it called
Unix bomb
Boom
RM -rf
you know what i mean
fork bomb
that's it
question player.isFlying checks to see if the player is actually flying when the check is made. What is the check to see if a player has his flight activated only?
oh could it be allowFlight
hmm time to check spigot
@empty flint nothing happens
@normal talon Weird, works for me
try scrolling to the bottom
I mean he did not skroll
ooh wew
ok sure kotlin good but have you guys ever tried scala
i've been setting up sbt for the past 30 minutes
it's great
i swear u said scala is shit urself
its powerful
That's one of the paper's devs
ok sure kotlin good but have you guys ever tried scala
here we go again...
Scala Mitten
not really
When I ran the plugin fresh, it worked
but on server reload/restart
it wouldnt load classes
so didnt work
😦
Im guessing it works fine with Java right?
Xd
"working"
scala is pretty similar to kotlin
now get pdm working pls 😦
Someone make an iij plugin for maven local repo install with an UI, thanks.
I really don't find any language better. If I need to code in one I just do
sorry to hear that
Obviously each language has its own category of work and some perform better in some circumstances but like I don't mind switching I just need to learn the basic syntax and that's it
Although I will always have hate towards assembly haha I mean I had a year in school where we did just that with one professor, never again please
nope
pretty much
@heady birch Do you have one?
@ocean quartz Yeah
Well no
Its not really a serializer
Just a IChatBaseComponent factory generating thing
Can you show me?
Oof sounds complicated to use reflection to do that
Wouldn't using reflection slow it down?
I guess you dont wanna make seperate updates just for new nms versions though
I guess it wouldn't be too hard to do that just a bit annoying
But yeah reflection is much slower

I mean yeah and we don’t want an angry review section complaining about silly errors like new nms versions
Lol
i mean its basic
oh yeah and that
ye
big ew
how u get it working
had to use local repository for spigot api
the build tool was the problem
anyway
clojure time

more like Kotlin time
shut your mouth little kid (that's a reference you won't understand)
@lunar cypress with your spigot lein template, am I being really dumb or does it not register the command at all?
Doesn't it work?
idk haven't tested
but it doesn't seem to register the command at all
not sure if that's a problem or not
The default executor for commands is the plugin instance
@lunar cypress ```clojure
(ns clojure-plugin.command
(:gen-class
:name clojure_plugin.ClojureCommand
:implements [org.bukkit.command.CommandExecutor])
(:import (org.bukkit.command CommandSender)
(org.bukkit.entity Player)
(org.bukkit ChatColor)))
(defn color [s]
(ChatColor/translateAlternateColorCodes & s))
(defn -onCommand [this ^CommandSender sender _ _ _]
(if (instance? Player sender)
(.kickPlayer sender (color "&cClojure is just too strong, sorry.")))
(if (not (instance? Player sender))
(.sendMessage sender "Only players can experience Clojure...")))
you got any idea why this might npe? it's probably also super messy. Can't tell which line is causing the NPE unfortunately
that is just so disgusting
Lol
Java interop is not particularly idiomatic
we out here trying to use OOP in a Functional language
it's no extension functions
But it's pretty clean yeah
Idk
It's probably really awful since I couldn't figure out a better alternative for instanceof
is 
😔
Hmm
whats the best way to make a explode/throw effect on a group of players that are in the same location? each player would get thrown in a different direction but the same amount of distance?
Could you send the exact error @prisma wave
And for the if not... thing you could just use the else branch of the first if
is there any tutorial on how to configure voteparty and nuvotifier for bungeecord?
Also, turned pc off now but it was just something like ClojureCommand(Unknown Line)
Ah
Sorry that's not much information to go on lol
No right now I don't see a possible cause
@shut swan #general-plugins #general-plugins-2
yeah me neither
It might have even been a problem with the compilation process, when I looked it resolved some nullable Var
Yes
You definitely get kicked, can't confirm if the message is sent since I didn't check
ohh
And it should return true/false instead
Ofc
I'll test in the morning
ty
Yeah, nil to primitive results in npe
Makes sense
A lot of caching and reflection is speedy now
Lmao
Hello
Can someone help me to fix intellij?
I've tried to search it to google
And tried to fix it..
Why my intellij idea 2020.2
Stucking at check url?
Like literally I added a new Remote/Git
It will stuck forever
Feel free to tag me
Anyone got an example of using SRP in a plugin? Like I get the base idea, but should I seperate loading comamnds and listeners into multiple classes, then just call that onEnable or what?
if uve got many listeners and commands then yeah seperate them
yeah but should i be seperating like actually registering the commands into a seperate class?
Like a CommandManager or CommandHandler class or something
if uve got many listeners and commands then yeah seperate them
@onyx loom
Pls answer my question
Interesting, my parser is faster and slower than mini's (more slower than faster) xD
Also different gradient handling
i think the grdaient that goes across all the words is better
cause if you want it on each word, you can just set it for each word
If you want to optimise a lot of reflection with the same methods, consider using MethodHandles instead @ocean quartz
@ocean quartz what James said
declaration: package: org.bukkit.inventory, class: ShapedRecipe
Does anybody know a good illustrator that does something in this style:
The original illustrator of those images went offline for the past couple of weeks and stopped responding :/
I think he's on holiday
Niall, 2nd
Yeah sure (:
As in?
String, int so i guess its just count of each item
O.o
Nice
Well what does the plugin do Km
bm help pdm broken :(( https://discordapp.com/channels/164280494874165248/165129131770511360/746660080296001587
Yeah Johnny made an issue
ah alright
pretty sure I know what the problem is
also does anyone have one of those fancy gradient classes I can use
Matt has one on his messages lib
Any way I can turn the hex from item names to the format I use on config? I cant seem to be able to match §x§r§r§g§g§b§b using regex
§
final List<Group> groupList = new ArrayList<>(groupManager.getRegisteredGroups());
groupList.sort(Comparator.comparing(Group::getName));
Is this bad
Cos API returns Collection
I could change it to list but do I want to?
Dont return collection 
Meh well this is really the only place I need it sorted
Please specify a valid page number between 1 and 1
Hmmmmm
English experts whats a better way of putting this
page index?
there's nothing wrong with that?
1
big brain
Please specify 1 as the page number
ew dont do that
Please fuck off, we don't want you here, there's only 1 page bitch
You specified 3 as the page number, which doesn't exist, so we'll use 1 instead. Idiot.
lmao
Lol
@static zealot if its ur birthday then huge congratulations
ty ty
So I need to cancel a task, but I don't want to store it in a variable and cancel it, because it will not working. I'm currently using BukkitRunnable and happy with the result. I'm just curious, can I cancel the task with method cancel() like this when use Bukkit.getScheduler().runTimerTask?
new BukkitRunnable() {
@Override
public void run() {
//...
cancel();
}
}
well here's the deal. the first long parameter schedules a delayed task and after that the task itself will scheduler a new task with a delay of the second long parameter but it will have the same id and some other data shared between all those tasks. Ideally once #cancel() is called no more repeating tasks should be called after the one that #cancel() was called in albeit the code will still run fully so #cancel() doesn't have a functionality like return;.
if I got that right
Is it possible to tell Kotlin that a certain class has a finite, known set of instances so that when I use the when(...) condition, it counts as exhaustive?
I can't declare them as enums
I am using a sealed class, that's exhaustive in terms of the classes they can be, not the instances
and enums can't inherit from a sealed class
can you tell the when clause that the list IS exhausted instead of adding an unnecessary else?
I don't think so
what's an English word for something that has an attribute? Attribute holder? Attribute owner? what do I call this thing?
AttributeMe
@lunar cypress Yeah i heard about MethodHandles before, i might use it
Though i cache a good amount of reflection steps
Only thing i can't cache right now is the constructor because nms keeps changing
final Object packet;
if (ServerVersion.CURRENT_VERSION == ServerVersion.V1_8_R3) {
packet = CHAT_PACKET.getConstructor(CHAT_COMPONENT).newInstance(CHAT_SERIALIZER_METHOD.invoke(null, message));
} else if (ServerVersion.CURRENT_VERSION.isColorLegacy()) {
packet = CHAT_PACKET.getConstructor(CHAT_COMPONENT, CHAT_TYPE).newInstance(CHAT_SERIALIZER_METHOD.invoke(null, message), Enum.valueOf(CHAT_TYPE, "CHAT"));
} else {
packet = CHAT_PACKET.getConstructor(CHAT_COMPONENT, CHAT_TYPE, UUID.class).newInstance(CHAT_SERIALIZER_METHOD.invoke(null, message), Enum.valueOf(CHAT_TYPE, "CHAT"), player.getUniqueId());
}
Could probably still cache it but i'd need to change a few things
Shitty ass NMS
Could definitely be done better but for now it's not terrible
Trying with MethodHandles now, let's see how it goes
MethodHandles should bring you benefits with hot code
@heady birch Can you not..
Lmao
:kek:
Over 2 billion tiktokers use Java
😂
Another 500mil marketing campaign to make Java the most popular language in the world
Actually I think tiktok might be worth more than 500mil. Does anybody know?
it's probably worth a lot more than that
Dont think it has anything to do with Java

Over 2 billion tiktokers use Java
Over 2 billion tiktokers use Kotlin
How do I do something like when(integer) { (< 0) -> "smaller than 0" else ... }
2 options
when {
integer < 0 -> blah
}
when(integer) {
compareTo(0) == -1 -> blah
}```
both should work I think
but... why?!
Why not
He asked the question wether he could, but forgot to ask the question, wether he should
disgusting, GradientHandler is in java
Well, technically you're stealing from Nicole xD
If it's open source it's called appropriating charity
not stealing
Also, it's interesting that you could even steal something virtual since stealing implies that the victim you stole from doesn't have the thing you took anymore
¯\_(ツ)_/¯
Also, it's interesting that you could even steal something virtual since stealing implies that the victim you stole from doesn't have the thing you took anymore
big br0in moves
Another Kotlin question because I'm not used to this kind of programming style and would do it in the Java way:
How do I pop a stack n times and put all elements in an array using a oneliner?
I know I can use for loop to pop n times, I can use repeat {} etc
but idk how to collect those elements in an array
create one
that's the problem
create and populate in the same line
with n elements
essentially getting n elements as a vararg from a for loop or whatever
Array<YourType>(n) { stack.pop() }
You should probably make sure the stack has the n elements tho
@empty flint
Sheesh
huh whats that?
my latest project
gh stats
this is clear evidence that kotlin > clojure
totally not because u have to do some fuckeries with clojure
Still making a connect four plugin in clojure
It's getting quite interesting
Also, I just remembered this
https://github.com/duncte123/AllJVMLangs
Wanted to add clojure some time ago but somehow didn't manage it
Interesting
IllegalArgumentException pertains to user input arguments and IllegalStateException is relevant when I fuck up, correct?
pretty much
not necessarily
IllegalStateException isn't really when you screw up, it's still the user's fault
or like when something has already been closed and you still try to use it
Imagine if github had folders 😮
imagine
🎵


@ocean quartz 😍
ayy
;p
31st
august?
yes
I don't see Elara there
disgusting
😂
@old wyvern You make me cry
@ocean quartz 😍
@errant geyser What does that mean?
Matt stared the repo
Is there a way to use NMS reliably without depending on all those shitty versioned classpaths?
Reflection
Indeed not, unless you wanna use reflection, or the X series has some stuff to help with that
What's the X series?
I mean xseries won't do nms
mhm
Its useful for handling some differences across versions though
Also why does the embed have the Kali Linux logo 
Guess I'm gonna have to have an NMS lib then 🙃
Or actually, is there a way to get an item from a JSON string without using NMS?
You could easily make a method for that with gson
that would mean I'd have to parse it myself which I want to not do under almost any circumstance
Or you could use yaml instead of json and use spigot's yaml serializer
Can you point me to the spigot api that does that?
The encode and decode item functions
https://github.com/ipsk/TriumphPets/blob/development/common/src/main/kotlin/me/mattstudios/triumphpets/util/Utils.kt#L61
Remove the base64 and you have a yaml like structure
before anyone asks, this is old class i don't use anymore, no utils in kt
🤮
@ocean quartz
This is the nms-serialization:
{id:"minecraft:diamond_sword",Count:1b,tag:{PublicBukkitValues:{"blockydebug:custom-sword-key":3.141592653589793d},Damage:1000,display:{Name:'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gold","text":"SWORD!!!"}],"text":""}'}}}
This is from the spigot yml serialisation:
ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=§6SWORD!!!, Damage=1000, PublicBukkitValues={blockydebug:custom-sword-key=3.141592653589793d}}}
any idea how to get the nms one without nms?
(and reverse it)
Hmm i don't really know, sorry
Hmmm java.lang.NoSuchMethodException: no such constructor: net.minecraft.server.v1_16_R2.PacketPlayOutChat.<init>(IChatBaseComponent,ChatMessageType,UUID)PacketPlayOutChat/newInvokeSpecial
I love this
Oh
So apparently the "return type" of a constructor is void .-.
Tf
Yup
LOOKUP.findConstructor(CHAT_PACKET, MethodType.methodType(void.class, CHAT_COMPONENT, CHAT_TYPE, UUID.class)).invoke(CHAT_SERIALIZER.invoke(message), Enum.valueOf(CHAT_TYPE, "CHAT"), player.getUniqueId());
hm
Gson().toJson(itemStack) results in a stack overflow error. lmao
Has anybody else successfully serialized stuff with Gson?
send the stacktrace?
lmao
send the stacktrace?
@steel heart I mean there's not much of a stacktrace since it's a stackoverflow.
=haste
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
there u go @steel heart
It seems as though this might be an issue with jdk though
Can somebody else try this code?
Gson gson = new Gson();
String json = gson.toJson(itemInHand.serialize());
System.out.println(json);
And let me know if it works?
Any itemstack will do
@ocean quartz I thought constructors return value was in machine code
@split talon constructors don't have a return value wdym
Not to the user but they technically do
Its basically a void method which is invoked when creating a new object
oh yeah ofc it is
Although it returns its type when invoking it
yeah
I think you can see that present in Kotlin with the generated invoke method, though don't quote me on that
I thought the return would be itself (the class) at least made more sense
I think (internally at least), it's calling a generated invoke method or something
nvm me I'm just talking out of my ass lol
and I swear if a single one of you says something along the lines of "don't worry, we're used to that by now" or "isn't that what you do all the time?"
@distant sun have you tried calling return in a constructor? 😉
mkay
@empty flint you can't return within a constructor scope because it's not a scope of which has a return value
Cant return a value*
you can't return whatsoever afaik
you can
^
public ClassName() {
this.x = 3;
return;
}```
@prisma wave what tf is that username
We found him lads! Look! It's Captain Obvious!
get a silly answer
basically his name is saying Java is number 1
yeah
Mitten and kotlin have the same length btw
Alex what order is the languages?
@frigid badge get outta here
uh
Ikr lemmo
Blasphemy KM
@distant sun you too
Ladies first
^
wow
lmaoo
You trully fucked yourself there KM..
Factitious
you literally walked straight in to that one @prisma wave
Epic
no real loss there
Ew
Such terrifying times KM
¯\_(ツ)_/¯
Can't wait to tell the kid in #general-plugins to leave 
Boi
2008*
Life was better 4billion BC
this generation is truly lost
Or when the fuck k 🤢 tlin was invented
Bruh Gaby
Nty
Tough talk for a fella within crusading distance @distant sun
Or when the fuck k 🤢 tlin was invented
@distant sun you on crack or some shit?
idk what kinda rock you been living under lol
Kinda hungry but no
try a wholesome meal of clojure on toast
Sounds gross
it's wholesome
And ive seen kotlin

pretty much every popular JVM language is better than Java because they all have Java as an example of what not to do
does that include clojure?
idk
I'll take that
probably
if java is so good then why isnt there a java 2
Cause, 3 billion devices run Java 
@prisma wave Java is on like version 14 or something
no idea what kinda rock you been living under
It's slowly turning into kotlin
Like 200 years away, but slowly
It's slowly turning into kotlin
@hot hull that is true
ok tbf pattern matching > when expressions
Just delete java and use kotlin
you dont get that with kotlin
the additions of type inference, records, project loom, and many other things are slowly pushing Java towards Kotlin
I mean, Java does have Kotlin as an example of what is good
Are you sure Java didnt do some of those before kotlin
@prisma wave they're fibers, but fundamentally they operate the same way don't they?
Are you sure Java didnt do some of those before kotlin
@old wyvern Yes, Java Bad.
No bard
Coroutines arent same as that
Current coroutines in kotlin arent really a thing during runtime in a sense
Compiler magic
Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops...
Kotlin Coroutines != Coroutines from other languages
I thought Kotlin coroutines were still actual coroutines
They cant
JVM doesnt have that till project loom
Kotlin only has anything that would be available to Java or the other JVM lamguages
Once project loom is out
loom would probably be faster since it's lower level
also sealed interfaces in java are cool
sealed interfaces?
and pattern matching with instanceof
sealed classes but with interfaces
and probably with a bytecode impl
compared to only a compiler impl with kotlin
does Kotlin not support sealed interfaces?
Kotlin is basically Java with some syntax sugar
nope
@jovial warren doesnt exists as sealed classes after compile
A lot of background changes happen
Like internal modifier changing names
also how do sealed classes in Kotlin actually work btw? I mean ik they have a known amount of subclasses or whatever, but in Java you have this permits keyword apparently, something I've never seen in Kotlin
just compiler checks
they can't be anything fancier than that bc it's not supported in the bytecode
they compile to completely normal classes
Mhm
isn't the whole point of sealed classes to make the subclasses a class has known to the parent?
not exactly
No
it's to restrict the amount of subclasses to a known set
ah okay
Ooo project valhalla
So objects with contain the values instead of references to the contained data?
I think so
From what I read its supposed to act like c structs
idk I guess they would be faster
Maybe you could get the speed of a primitive but with higher level access or something
Not sure tbh
Hmm true
I guess they might be like kotlin's inline classes
But you wont be able to have a Object in a ValueType then right?
¯_(ツ)_/¯
Ah I guess compositions of primitives
Rip String
Wait C structs allow arrays
Ok maybe they do allow objects
They do
ValueTypes?
Yes
Oh, do you know what improvements it bring over classes?
yeah I think they are basically kotlin inline classes
Codes like a class works like an int.
Yea thats why I assumed it was to act like primitves
But should primitive like structures hold a reference tho?
They are stored in consecutive memory iirc
Imma probably go read a bit more on this
yeah looks like it
Ah
And i actually don't know whether objects are allowed, misspoke there
But other value types a re allowed
I see
Johnny, changed to use MethodHandles now, it's pretty speedy
👍
What's the encoded thingy
I think they encoded a String into long
does inlining even work in Java?
well, I mean, Kotlin has it, so it's possible
ofc it's possible
Compiler magic
JVM magic
inlining is the compiler
yeah true
Mhm
I class JVM magic as anything where you can use regular code to modify bytecode at runtime (obviously not including things like changing a var's value lol)
What does this have to do with runtime bytecode manip?
¯_(ツ)_/¯
yo I have a random question. How do you make those configs where you can add lists or something and you can take the entire list? I'm using ConfigMe
everyone does them but I never figured out how to do it
xD
can't you just make a property of type List<Blah>?
well iirc it's like ```java
@Config("path.here")
public static List<Blah> list;
ListProperty
Is there a way to get the actual itemstack name, not the display name or the localized name?
wdym actual name?
Material ?
@steel heart material is not the same as the name. Especially with items whose name depends on the meta.
yeah but then what is actual name for you?
default name is the localized one
else you have the material name
Material#getName()
@oak coyote That returns the name of the material enum which isn't the name of the item
@steel heart when I print the localized name, I get an empty string
thats weird
Have you tried it?
