#dev-general
1 messages · Page 189 of 1
Yeah figured I can't ugh
Damn. @quiet depot that Preview features are not enabled just started appearing again out of nowhere. I tried reverting my changes, recreating launch.json, etc. but nothing is fixing it. Any clue why it came back?
Ayy I like how my new parameter system is coming along
generic "java.lang bad" joke
generic "i wish i could make it in Kotlin" response
MF wrapper for Elara 

Yee
Man, i am stupid
The first if is not needed lol
If it doesn't have # it won't be in the registered list anyways
This is also now possible, not sure why anyone would use it, but it's possible
i miss data classes 
come back to us matt 
testing here @prisma wave
Hey Matt, lets build a multiplatform KT command library focus on DSL?
in brigadier?
I never use it but I have a good idea for it
KotlinBukkitAPI currently have the best command dsl library for Kotlin
Brigadier is a nightmare, my lib will be multiplatform and hopefully will have brigadier too
But it's java unfortunately 
boys im sleeping well tonight
just fixed a bug thats been aggravating me 🙂
goodnight.
Was it PDM relocations?
@foggy pond Could just do the old switchero where you make the wiko a new repo
I fix the Kotlin stuff in PDM 0.27.0 @onyx loom
I open a pull request
And I'm opening now PR for the Gradle transitive dendencies exclusion
@onyx loom @prisma wave https://github.com/knightzmc/pdm/pull/22

Currently, my projects excludes Kotlin from dependencies to prevent wrong versions
so I got a OH MOMENT with PDM
But, I already made a PR to supports this 😄
Looks great 👍
wait is java 14s records just a kotlin data class?
pretty much
Did Kotlin do it first?
Doesnt mean java cant
Or is Kotlin's data class just a Java 14 record?
The closer java gets to kotlin the better right?
records are immutable
Doesnt mean java cant
@obtuse gale No no of course not
data classes arent assured to be
And they don't have a copy method
im looking @ this rn https://www.journaldev.com/37273/java-14-features
mhm
Some of the new Java stuff looks pretty cool
"""
"""
Thats cool but the amount of people still on 8 tho xD
Yeah I feel like people might just skip J11 and go to J14 with such a fast dev cycle now
hopefully
or everyone can move to EVM
There's the new GC in 14 too right?
¯\_(ツ)_/¯
If I make a public repisitory private when it has a wiki, will the wiki be lost?
How would i make a plugin for my server that communicates with my store?
Idk how to do that
what software is your store running?
HTTP most likely
Cursed
It's so ominous
showcase
e
showcas🇪
We have an anti clojuer somewhere
I am not happy
tfw you re-install all java jdk versions so you can test shit for all of them...
bruh I definitely blindly copy + pasted this
} catch (ex: IOException) {
throw ex```
Oh godness I can't fix it
anyone please know?
local stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
local xp = Instance.new("IntValue", stats)
xp.Name = "Exp"
xp.Value = 0
local maxexp = Instance.new("IntValue", stats)
maxexp.Name = "MaxExp"
maxexp.Value = 100
local level = Instance.new("IntValue", stats)
level.Name = "Level"
level.Value = 1
game.Workspace.Leaderstats.Changed:Connect(function()
if xp >= maxexp then
player["leaderstats"]["Exp"].Value = 0
player["leaderstats"]["Level"].Value = level.Value + 1
player["leaderstats"]["MaxExp"].Value = maxexp * 1.25
end
end)
end)```
whats broken? Also what language is that btw
Nope
There is no error in the output ._.
that's why I'm confused
The leaderstats working great
The problem is with the level system
if xp >= maxexp then
player["leaderstats"]["Exp"].Value = 0
player["leaderstats"]["Level"].Value = level.Value + 1
player["leaderstats"]["MaxExp"].Value = maxexp * 1.25
end
end)
end)```
The problem is that you did not define "player" anywhere
So I just gotta do player = game.players.localplayer?
Ik Ik
I can also make local variable inside the function
but I will make it firstline outside
If you want to, I guess
I started to learn 1 week ago so kinda new xD
And I didn't even know how to make a leaderboard on roblox...
I'm fine reading docs instead
Also, the documentation in Roblox studio may be lacking infos
For example, the full tuple doesn't actually describe on the object whose name I forgot
Oh okay gotcha
also I changed the code a bit and got output message to my issue
wait
That's the current code
player = game.Players.LocalPlayer
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
local xp = Instance.new("IntValue", stats)
xp.Name = "Exp"
xp.Value = 0
repeat wait() until player.Character
local maxexp = Instance.new("IntValue", stats)
maxexp.Name = "MaxExp"
maxexp.Value = 100
local level = Instance.new("IntValue", stats)
level.Name = "Level"
level.Value = 1
xp.Changed:connect(function(player)
if xp >= maxexp then
player["leaderstats"]["Exp"].Value = 1
end
end)
end)
```
Which line is 24?
if xp >= maxexp then
Always the same error
...
oh GOD
xp.Value >= maxexp.Value
I'm so stupid hell god
Thanks man!
And I forgot a Parameter but thanks to you i fixed it❤️
Np
How strict are Spigot devs when going through premium plugins? I mean if there is one noob mistake which I may have done by mistake will they reject it cause it's bad quality
Like idk let's say that I have not followed the DRY principle, I repeated the same 4 lines of code twice or something
Okay thank god, I spent most of the time writing the plugin just making sure it all basic principles and it did not have any newbie mistakes
If this is the case and they decompile, Dry will be a problem because of the Kotlin inline operator
meh
There are some premium plugins out there that are so incredibly bad
I can't imagine what it takes to be denied
They are so lax I saw one which broke every single convention their was and had 99% of the code in the main class for a main class size of around 10k lines but it was still allowed 😂
How come mcVersionRange can be null here?
The getHighestBelow method returns a key of the map or null, but if it's null the fail(...) method throws an exception
So compatibilityVersion has to be a valid key of the map which means the value can't be null, right?
compatibilityVersion is correctly recognised as not nullable
Is it safe to use !! here?
Yes
fail returns nothing
fun fail(message: String): Nothing = throw UsageError(message, option)
Ah so even though compatibilityVersion can't be null, it can't know whether the key is present in the map?
Is that the gist of it?
Oof maintaining the BuildTools versioning will be a pain in the butt...
Maybe I should just let BT handle that part
Has anybody had any luck running BuildTools with Java 12 or newer? The latest version I could get to work was Java 11
GOD what do I do if I have submit my premium resource for review
And I found out now I forgot one important thing
post an update
It's not plugin breaking important, but it is very important
it wont be reviewed anytime soon so you got time
In my plugin there is 9 default alignments created from YAML files for server owners to use and play around with... To create all of them I copy pasted one of them 9 times and was supposed to change the values for each manually
And I forgot to change the values
So now there is 9 yaml files which have exactly the same contents but different names
Yeah but what should I do? God

After the plugin gets approved?
before
have you tried?
There is no Post Resource Update button
welp
It's just the YAML files I need to change
ask in spigot server
Is there a way to get the Java Major version from the Java Runtime Environment version or vice versa without hardcoding it?
What I mean is this mapping:
Java SE 14 = 58 (0x3A hex),
Java SE 13 = 57 (0x39 hex),
Java SE 12 = 56 (0x38 hex),
Java SE 11 = 55 (0x37 hex),
Java SE 10 = 54 (0x36 hex),[3]
Java SE 9 = 53 (0x35 hex),[4]
Java SE 8 = 52 (0x34 hex),
Java SE 7 = 51 (0x33 hex),
Java SE 6.0 = 50 (0x32 hex),
Java SE 5.0 = 49 (0x31 hex),
JDK 1.4 = 48 (0x30 hex),
JDK 1.3 = 47 (0x2F hex),
JDK 1.2 = 46 (0x2E hex),
JDK 1.1 = 45 (0x2D hex).
How do you mean xy problem?
what's your end goal?
@quiet depot Trying to prevent users from starting buildtools with an invalid java version
I can get the Runtime version using environment variables, that's not a problem
but the only info on which Java version BuildTools requires to build a specific MC version I could find was here: https://hub.spigotmc.org/versions/1.16.2.json
So for example --rev 1.16.2 would check this json file and find the "javaVersions": [52, 58] value
so 52 is the min java version, 58 the max
I just need a mapping from my java env (say 1.8) to this number (52 or 58 or whatever and theck check if the mapped number is between 52 and 58
I see
I'm not aware of such a mapping which already exists in the jdk, I recommend you just make your own
Yeah I want to avoid having to maintain the software as much as possible
I could make my own but that's just lazy now and means I have to do some work every time a new spigot version or a new java version is released
and I just can't be bothered, honestly
well, since 1.2, every major java update has had a class file version increment of 1 unit, so I'd say it's fairly safe to assume this will continue to be the case
you could base your logic off that
I noticed that as well, I don't know if that's actually the case though
I could read the version from the class file, but I would need a class file to compile in order to do that
and idk how to do that
two straightforward ways I can think of
you can either generate a dummy class via the instrumentation api
or, execute a compile command
I'd hope there's a better way than either of those, I'm just not aware of one sorry
instrumentation api seems appropriate. lemme google that real quick
I believe asm is what you want
if you want to go with the instrumentation route
or bytebuddy
uh
yes
but I've got no clue what that repo is
is it an example of using asm?
that's the official site
again, also might be worth looking into bytebuddy
I'm not sure which tool is better suited towards your needs
I've got limited experience with instrumentation
Oh I found something:
public class Demo {
public static void main(String[] args) throws IOException {
ClassLoader loader = Demo.class.getClassLoader();
try (InputStream in = loader.getResourceAsStream("Demo.class");
DataInputStream data = new DataInputStream(in)) {
if (0xCAFEBABE != data.readInt()) {
throw new IOException("invalid header");
}
int minor = data.readUnsignedShort();
int major = data.readUnsignedShort();
System.out.println(major + "." + minor);
}
}
}
Demo.class still has to be compiled on the user's jdk
so yeah, you'll need that code eventually
but it doesn't solve the problem
StackOverflow and Piggy be praised. Would have never found that if you had not brought up what to google...
Yeah but he's calling the class loader inside the class. when the code gets executed the class has to be compiled already by definition
otherwise it won't execute
so this is perfect
it's not?
hm? how so?
it'll return the version of whatever jdk Demo.class was compiled on
not the user's jdk version
Will something thats compiled on the latest Java version work on an older java version(11) (Discord bot) if its in kotlin?
Unlikely
ive just got the latest jdk selected in project settings, idk if that effects stuff
Doesn't the kotlin compiler target Java 8 by default
But supports 6
I guess try it and see
yes
Although it has potential to be a bit messy
I just made a task that executed the curl command
But it's super hacky
cant u do that shit through github now?
Pretty sure there is a plugin for it
hm?
can't you make a gh action to do that aj?
Gh actions kinda suck
I mean I dont really currently use gh for this project
What's wrong with self hosted
I was gonna self host a gitlab instance for commissions
I used to use it so I could work on one project on multiple pc's, now i use dropbox for that
I think I found something to make it work nice and clean
well, the main issue is that it doesn't get backed up to a frozen mine a few streets away from the seed vault
first world problems
dropbox good bm
I have a self hosted git too
got gitea on my home server
which I definitely recommend btw
but it syncs to github
yea github seems the most reliable
Somebody actually made a runtime compiler library
Hmm
light (made in go), and looks just like github https://gitea.io/en-us/
based on gogs
if you ever used of heard of that
@prisma wave have u uploaded / tested the new pr?
The pdm one?
ye
😕
Wanna have a proper look through when I get home
yo @ocean quartz you said you made chat plugin using your message library?
Haven't made it yet, but will
nice any ETA?
Hmm not really sorry
Shouldn't take long though since i'll use it on a server i'm making
nice nice.
@prisma wave Yo PDM boy, how do you test your gradle plugin?
Trying to play around with it but can't seem to get my test to work on a different module
Like one for the plugin and one for testing
Shouldn't take long though since i'll use it on a server i'm making
@ocean quartz 👀
ahgjaw im brain lagged, how can i like i have list of objects and i want to change this to get like list of objects.getname or something

@ocean quartz with immense pain
What I usually do is deploy it to maven local and just go from there with some sort of test project
Suffering right now
Can't seem to be able to get it to local
Was doing publishToMavenLocal, don't think this will do it though kek
that should do it
it might be that you need to change the version
or the one on gradle will be resolved instead
I get this
Unable to load class 'me.mattstudios.gradle.MfGradle'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
interesting
Oh Caused by: java.lang.ClassNotFoundException
Doesn't seem to be creating a jar
send your buildscript
I believe you need this plugin
id 'java-gradle-plugin'
if you haven't got it already
I think i found the problem
fyi matt I modified my gradient code to fix a bug and added gradient looping 👀
in case you wanted that
Oh? What was the bug?
And gradient looping? 
The last two characters of a gradient usually had the same color
imagine having bugs
I need to learn how tf regex pattern matchers and groups work in java for string replacements because what I'm doing is so horrible
Oh! I think i had that fixed on mine since i remade your regex
The character bug was with the gradient generation and not the regex
I just completely rewrote the gradient class because it was kind of.. not great
Oh interesting, okay I'll definitely take a look then 
My color regex is pretty small
(?<!\\\\)[<&](?<hex>#[A-Fa-f0-9]{3,6})[>]?|(?<!\\\\)&(?<char>[a-fA-F0-9rR])|<(?:g|gradient):(?<gradient>.+?)>|<(?<r>r|rainbow)(?<sat>:\\d*\\.\\d*)?(?<lig>:\\d*\\.\\d*)?>
Yeah
does that just mark everything else in the () with that group name?
Yeah everything in the same parenthesis have the name
It matches [#000](/guild/164280494874165248/channel/000/) [#000000](/guild/164280494874165248/channel/000000/) � � &a-r/0-9 <g:#000:#000000> <r> <r:0.5> <r:0.5:0.5>
oo ok
I added a :loop parameter to the end of <g> and <r>
which can be :loop :l or :L
What does it do to the text?
After 30 characters it restarts the gradient in the reverse direction
nice
:what: :the: :fuck: https://paste.helpch.at/raxugazena.xml

WHERE `build_type` in (?)
imagine this
how can i make ? multiple values
depending on a diffferent number of arguments each time
so sometimes
i want to select where build_type is 3 different things
other times i wanna do where build_type is 5 different things
uhh
i would have to just add it into the string right
and not use query.setString(1, stuff)
you could do some clever string joining tricks
repeat ?, n times where n is the size of the collection
true
and then use a for loop + setString
alrighty ty
wow I'm dissapointed @ocean quartz
[16:18:18 WARN]: io.alerium.supportercodes.libs.mf-utils.exceptions.MfException: Method onCommand in class io.alerium.supportercodes.command.SupportHandle contains unregistered parameter types!
public void onCommand(final CommandSender sender, final OfflinePlayer target) {
Why is OfflinePlayer not a valid one :((
Just register it
ugly
ur ugly
I know
you know what isn't ugly?
eLaRa
Why is IJ wanting me to select android sdk, it isn't even an android project
eclipse... good?
yes

java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.
make the connection available
hard to believe that people in this day and age are really living with not available connections
fun fact
elara does not have semicolons
but semicolons are a valid identifier
let ; => print "Hello"
;()
:)
:bruh:
What
It's good
It means you can replicate the Elvis operator without it being a language feature
Ez
Elara good kotlin bad
i hate the ;()
;(
Hey BM do you know how to create custom tasks?
Something like
task {
name = "test"
hello {
// do more here
}
}
Can't find any decent guide
I mean the example i have is valid too
oh do you mean with the API?
Yeah, i think xD
Actually gonna copy fabric's plugin
https://www.github.com/knightzmc/pdm/tree/master/pdm-gradle%2Fsrc%2Fmain%2Fkotlin%2Fme%2Fbristermitten%2Fpdm%2FPDM.kt check line 62
am i doing this wrong:
return hologramRegistry.getTemplates().filter { it.name.contains(arg) }.map { it.name }.toMutableList()
Why mutable?
kotlin
List better
idk it just requests me to do mutable
Mutability bad
gotta check my java core
ew mutable
You return a name list, why would you make that mutable 
^
?
Don't use mutable unless you know you need it
Ew
Passing mutable lists around
Very bad
^^
Probably because java's list is always mutable
aha
Cause java doodoo
:what:
Bruh
TIL external is a keyword in kotlin
So I need someone to judge this, and tell me a better way of doing it, since I doubt this is the best
https://paste.helpch.at/taxoracefo.java
Now you're gonna say setString and shit smh
Well I mean I could make a util class which takes a resultset and returns the wrappers, but since I only use them there, kind of a meh
yeah there are times where it's impractical to refactor
Gotta think of something clean for the String.format replacement
String.prepare 
Not kotlin tho 
Do you guys maybe know why the System class in Kotlin does not have a System.javaClass property?
because javaClass is for variables not types
use System::class.java for a bounded class reference
string.class is final in java so basicly you can't add your own functions to it sadly.
i mean there is: http://nice.sf.net
Nice is an advanced programming language that extends Java with
parametric types, functional programming and more!
that does something like:
private String someMethod(String s)
{
return s.substring(0,1);
}
void main(String[] args)
{
String s1 = "hello";
String s2 = s1.someMethod();
System.out.println(s2);
}
@hot hull
if that interests you
kotlin 👀
@prisma wave any chance u looked at the pr 
what could go wrong 
the rate of failure is quite low
clearly
i shall try it out
Damn making a gradle plugin is giving me a good beating
it's painful
Can't figure how to make it look the way i want
I don't understand the properties stuff
properties stuff?
pdm good
Like
task {
name = "test"
}
Name apparently is a property
Yeah but i want a plugin that'll create something like that in the gradle though
did you see what I sent you?
project.tasks("name").doLast {
blah
}``` will add a task called name
Basically what I want is to make a plugin for plugin.yml (i know there is already one but i wanna try my own)
bukkit {
name = "Name"
main = "main.class.Here"
// etc
}
Not yet ended up forgetting xD
Gotcha
Actually I think these are called "extensions"
Yeah the extensions is where i got lost
val extension = project.extensions.create("pdm", PDMExtension::class.java) is how pdm does it
And then the PDMExtension is just an open class with all of the fields
And the buildscript just changes the value of those fields
Which you then read on-build or whatever
Cannot set the value of read-only property 'name' for task ':testing:bukkit' Even though it's a var 😫
Aight imma look what you have
Ok ima head to bed so @ me if you have any questions
Sure thing
test
I did it!
The BuildTools build encountered a problem: Spigot version 1.12.1 is incompatible with the current Java version (Java 11). It requires Java versions between 1.8 and 9.0.
The BuildTools build encountered a problem: Spigot version 1.14.1 is incompatible with the current Java version (Java 14). It requires Java versions between 1.8 and 12.0.
1 step closer to the mc plugin testing IntelliJ plugin 😄
omg it works 😄
@onyx loom excluding kotling
also, now, exclude rules in pdm() works
I'm using it because I have library that have Kotlin with differents versions
to prevent bugs, I'm excluding
plugin-yml is a great Gradle plugin, I use it also
Gradle plugins is awesome, pdm is the best

What should I learn for backend if I want to be able to use most hosting?
Since with spring it pretty much has to be a vps since most hosts dont support java
I guess .. php
ew
I guess I could use that framework thingo for it
but still ew
node.js is commonly supported isnt it? Is it worth learning js for that? Or could I use kotlin js
Is kotlin JS a viable option for website stuff?
Also how do you get good at something like html/css? Ive tried watching tutorials and all I can find is stuff thats like 'And you can open a tag by typing <p>',, which i already know the basics, its just i always somehow end up making shit really messy, espsecially with css
I'm not exactly great, but I just played around and looked on W3. I can make decent sites now, but still nothing too fancy
mm yeah, ive heard of bootstrap, its just my css always ends up getting really messy, should i start looking into bootstrap?
Yes
I'm not exactly great, but I just played around and looked on W3. I can make decent sites now, but still nothing too fancy
I used to make some nice websites (only html, css and js) but they looked pretty good. I'd probably need to go thru w3schools again to learn how to do it bcz I forgot xD
How would the following work in Kotlin?
when(file)
{
!exists() -> ...
parentFile... -> ...
else ->
}
The problem is that file.!exists() is not a valid construct
so how do I negate a boolean method call with an object as the receiver?
I actually don't think I can even use the when(file) call like that... Can't check if a file exists using a when as far as I can tell
Yeah you can't use file inside the when expression
Just use it in each individual branch
match file {
Some => {
},
None => {
}
}
That's not Kotlin though, is it?
No its rust
Hello
can someone help me with an ubuntu problem? I want to upload programs but it says I don't have permission
please
get permission
get permission
@prisma wave but how do i do it?
You haven't specified anything
From where you want to upload, what exactly you want to upload, where you want to upload to
The means you use to upload
From where you want to upload, what exactly you want to upload, where you want to upload to
@lunar cypress I try to upload a folder with my server from my pc. through the Bitvise program to a VPS that you rent.
I have commands that I used previously with other servers. but now it turns out that I can't upload files because I need permission
ubuntu@vps-7beb1ef1:~$ cd /home
ubuntu@vps-7beb1ef1:/home$ mkdir prison
mkdir: cannot create directory ‘prison’: Permission denied
ubuntu@vps-7beb1ef1:/home$
why are you making a folder in /home anyway
make a user for that or put it in your user's home folder
make a user for that or put it in your user's home folder
@frigid badge how can i upload files? when uploading them tells me that I failed
Hm I don't understand this Kotlin syntax. Could somebody explain what construct this is?
typealias CallsTransformer<EachT, AllT> = OptionTransformContext.(List<EachT>) -> AllT
Specifically the OptionTransformContext.(List<EachT>) is confusing. Is that a constructor reference? There's no method name in front of (List<EachT>) is anything...
What am I looking at here? (not my code, reading a library to try and understand what it does)
It's extension function syntax
@prisma wave Issue with Hibernate, it's xml 🤢
Quick Question:
If my plugin creates a custom Item and I don't want players using said item to craft with. (i.e crafting table etc..) would I just use the CraftItemEvent and check for the item and cancel the event? Never really looked into this specific event before
Yes
Okay thanks, just wanted to double check
There's also a precraft one iirc
It's extension function syntax
@prisma wave I thought so as well but what does it mean? Like how would you describe what that code does? What does it extend? A constructor?
The PrepareItemCraftEvent does not have a setCancelled method. So the CraftItemEvent might be the one to use.
You get the matrix and set the result to null/air
@prisma wave I thought so as well but what does it mean? Like how would you describe what that code does? What does it extend? A constructor?
@empty flint is a extension function type, simple, you have a "lambda" with the context of a class, like you have with simple extension function
fun Player.hey(message: String) {
sendMessage("Hey $name, $message")
}
typealias HeyFunction = Player.(String) -> Unit
val myFunction: HeyFucntion = {
sendMessage("Hey $name, $it")
}
this two is the same thing
i need winter in my life, can someone please turn of the sun?
Figured it out, I'm big dumbo
Do you guys know if there is a way to get the size of a unicode?
@astral quiver it would be $this instead of $it no?
@prisma wave Issue with Hibernate, it's xml 🤢
@hot hull not necessarily
I've used it before without any XML
Oh yeah
This photo was uploaded to SARS
PDM 1.16.3 when
¯\_(ツ)_/¯
here we go i boosted server 2 times 🙂
1.0 will probably be after a rewrite
owo xpbar on command =xp isnt centered! 
Currently, I do not have any issues with PDM
it supports all things that I want
The only thing is relocation, but its okay
relocations
Yeah relocation isn't a problem until other plugins get their dirty hands on things
i need coroutines
So, I was reading 1.4.10 release, and I guess I found the issue with the Bukkript
that was not working
kotlin being evil again probably
Happens much too often for my liking
I got you
interesting
Better talk now, 6x multi xp
indeed
just write really long messages like this and you should get an adequate amount of experience with ease
GG
You should be able to get 2lvls pretty fast
i kinda wish java had like options to extend classes like kotlin so you could have String#format like Frosty did in his plugin for coloritizn or something
So I need to write a really long message like this one here to get more XPs because it is 6x xp now? I guess it will work
F
"native to mc", for me, this is bullshit that people says to not use a language
i still use kotlin lel
It doesn't mean anything
Good that mc is native java, this will allow more languages to be use
but i want something like that in java to.
Yehhhh tier 2
Probably not gonna happen for a while
true
Almost there
where=
I like things built on Java, if you will be done with the full pontetion of Kotlin, should be write in Java
Like, a minecraft server writin in Kotlin without using Coroutines
is bullshit
I know a project that writes a new server IMPL but the goals is to have Interop com Java
No sense
Just write in Java, will have more developer to help with the project
MineKraft would never do such a thing
This project: https://github.com/Elytra-Server/Elytra 🤢
Their all my friends but they do not listen to me
packet based holograms muahaha
works
^^
MineKraft will always sound weird af
All my projects are fully operational and working so you should use them
Me and my friend was writing a minecraft server for Kotlin MPP
In JVM runs with Netty, in JS, Nodejs
Make a cross platform minecraft server in kotlin 
make
Wouldn't be that hard
server in c#
But JVM is easier
Yeah
make it in c++ or c#
Or lets wait for Sx's GO server
Is something that is possible
That one will be speedy
and is very cool to see this be possible
Go is a great language
Go Lang
We start but never continue it
Starting to love GO
One of the greatest I would say, many fine people use Go
We use kt-mc-packet, this is why is multiplatform
I never got time to learn Go
But Go is really a very nice language which I think is cool and good and cool
kt-mc-packet i made my own packet handler hehe
give me xp
But I don't know the key points of Go
Fast
Comparing like to Rust
Clean
High level but still the speed of native
And manual control when necessary
Also good multithreading features
i mean snytax is realy clean if you ask me.
Rust doesn't have a very mature concurrency model afaik
And it's nowhere near as simple as Goroutines
🙂
Also generics are fairly unnecessary
Goroutines is the same model as Coroutines?
how does even xp work here is like per message with random number?
There is two types of concurrency stuff that I know
I guess the coroutines aproach is called "red functions"
something liek that
yeah Goroutines avoid that
gotta make actions for my plugin, any idea how i would listen to packets?
Protocollib ?
i dont want to use protocollib
Why not
I mean, if you have a BIG API, based all in coroutines
you could have the same aproach as Go, right?
cause i already handle sending the packets myself
Yeah I suppose so
so its basicly useless that i made packet sender myself then
Goroutines don't handle returning though or suspending
Different from JS, Dart or C#
They are just for running functions
goroutines
Ok
I guess like, Ktor you will mostly have suspend scope everywhere
because everything is suspend on it
Yes, but Go is a closed ecosystem, Kotlin is not
How do you like my lovely startup message for the plugin i am making?
lovely
And if you look at the aproach from Kotlin, is like Goroutines, but, with the support for the JVM Ecosystem
so anyone has any idea how to listen for packets or no?
EntityPlayer has something to do with that iirc
You'd need a ChannelDuplexHandler
@ocean quartz Console messages = cancer, atleast if you can't turn them off
When you do async
why Duplex
That non paper message is butiful tho
@hot hull Why lol?
oh niall im sure you can help me
I should write a blog post about Jetpack Compose vs Flutter, and Kotlin vs Dart
Last thing anyone wants is more console spam Matt
how would i listen to packets?
but in portuguese
It gets annoying real quick
I want to get GDE here on brazil
or Jetbrains Advocate here too
It's not that bad, plus is just on startup
Yehhhh i'm tier 2
ufff matt already started working on chat plugin 🙂
Yeah ;p
@dusky drum Protocol lib
would tinyprotocol work?=
Insert it somewhere in the pipeline
something like this
http://images.virtusdevelops.eu/shareX/w0n6e8ms.png
Ehh
Thanks i just went blind
Synchronized?
I dont think you make your own ChannelInitializer do you?
No idea
well i'll play around with it
to get stuff
cause like i made all nms for packet senind
sending*
so idk
reinventing the wheel is an essential part of programming
?
i mean := protocollib was slow
:=
so i made my own nms handler
Go moment
?
i dont want like
walrus
sounds like a you problem
my nms does 0 ms
Protocollib is fine
Although GotocolLib is better
And don't get me started on ElaracolLib
i mean most users that use my plugin complain that it doesnt work guess what NOONE has procoollib installed.
?
like
Doesn't literally everyone have protocollib
I thought protocollib and vault were something literally everyone has
?
:= go moment
and i dont understand why change "a,b,c,d" to "0,1,2,3=
how da frik do you know which number to use
which docs??
They exist
:=
let mut
i dont like java docs they damage my brainž
match
=> {}
Kotlin# when
ug..
if i wanted to use protocollib i still kinda need nms since their chatcomponent is slow as frik
what?
i mean Chatserializer but yes same stuff its slow in protocollib
and all i need to do is check for place hit packet
so
Yo I'm almost level 60
kinda looking into tinyprotocol
The purple name is almost over :(
Anyway I'm gonna monologue about Elara's type system for a bit to grind xp
So the type system is primarily contract based, meaning type B can be used in place of type A if B has the same contract as A
you really want to beat top 2?
Absolutely
In practice this refers to properties in a struct: a struct is considered to share a contract if it has all the properties with the same name and type
What this allows is inheritance that isn't truly inheritance. If the Person struct has a String name and mut Int age, any other struct can be used that defines those properties too
As such "inheritance" just copies the properties into a different struct
However elara also has the concept of "composite types", popularised in purely functional academic languages
These are types made up of unions / intersections of other types
For example:
type Result<T> => Some<T> | None defines a type Result<T> that will accept either Some<T> OR None
.,.
Since there are 2 "possibilities" in this example, Elara will also provide implicit Boolean conversion, with Some being truthy and None being falsey
bom
This lets us do super clean stuff like ```
let result = blah()
if result => {
result.value.blah-blah()
} else => {
print "No value!"
}
Result can implicitly be cast to Some via the Boolean conversion
These composite types also support intersections instead of unions:
type NamedEntity => Named & Entity
This will accept any type that is assignable to both Named and Entity
It's like inheritance but not really
Very powerful I think
Bruh only 600xp from that
Scam
ew, an else
shut up you
ahaha
you're slow
I'm so confused, why does it keep timing out the connection
[16:03:39 WARN]: [SupporterCodes] Tried saving data, but database connection was unreachable!
[16:03:39 WARN]: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.
then show yours if you blame them all Niall we wouldn't mind 🙂
okay so i found PacketPlayInUseEntity but cant find anything like that on wiki.bg
vg*
i still use the serializer
?
=?
:=
what do you do then niAll?
New Kotlin update out 👀
O
1.4.1?
yup
1.4.10
Pretty cool
Starting with 1.4, a property can delegate its getter and setter to another property. To rename a property in a backward-compatible way, introduce a new property, annotate the old one with a
@Deprecated
annotation, and delegate its implementation.
I learn a lot of things from Kotlin's twitter actually xD
That's cool
Hmm
Looks like "Andrey" is finally making the right decisions at last
Although not a moment too soon I must say
anyone has idea why i get
Caused by: java.lang.IllegalStateException: Unable to find method null ([class net.minecraft.server.v1_16_R2.ServerConnection]).
protocol = object : TinyProtocol(plugin)
at this line
which one?
null
and hbow can i fix this?
I am not sure but I can recommend a workaround
Use a language that doesn't have null such as clojure
That way your error will say nil instead of null
which might be nicer
ffs
:clojuremoon:
Ah actually I know this
If a methods name is null it's a constructor I think
So it's a TinyProtocol issue probably
Not supporting 1.16.2?
.,.
Anyone know the Java version of apply in Kotlin off the top of their head?
found the issue, serverconnection is initialized after all plugins load.
wait
how can i run some task when server is fully started?
Gasper, delay 
how big should the delay be?
couple of seconds
10?
Sure
Well what are you running
Just run it on a task, tasks only run once the server is fully enabled
Interesting

in
