#dev-general
1 messages ยท Page 339 of 1
I was thinking in change dependencies.json to:
- list of repositories
- list of dependencies, their excludes, their relocation
no transitive
Maven Aether will do the resolution of the repository all in runtime
transitive is included to reduce lookup times at runtime
but maybe aether will make that unnecessary
well this is not a issue for Maven Aether if I recall, it does resolution in parallel
currently PDM does not and this is kinda really slow
some project of mine take 15m to complete download all dependencies
in gradle, with no cache it is faster
is there a way for me to remove !! (ij is complaining) im having small brain moment, but this shouldnt be null right?
I'm talking about runtime
temporary variable for entity.killer
^
oh
still kinda yucky
meh
I think it is in Bukkript, because it have big libraries, like Maven Aether and Kotlin Compiler
ty ๐
so maybe your download implementation is not so fast?
stackexchange "Hot Network Questions" be like
that is incredibly specific lmao
i think he got it in him ๐
fuck
cancelled
please dont ๐ฉ
no mercy
oh no!
Did she just assume her own gender!!
no way ๐ฎ
sigh
based
HelpChat is getting better at comedy and it intimidates the 0xers
lmaoo
opposite of 10xers
um.. whats a 10xer?
A particularly talented and productive engineer, thought to be capable of doing the work of ten typical engineers.
in other words
a haskell programmer
who also knows go and rust and blockchain
lol
this is not very webscale of you to say
oh also, thinking about PDM, BM
ok ๐
couldn't you just use jar in jar like LP does?
maybe
I mean, nobody would really notice a difference, since it'd just be like a normal jar
just that jar would contain the actual jar and some other stuff
i will admit i know basically nothing about how lp does it
LP has a bootstrap that, well, bootstraps the plugin
so I think Bukkit loads the bootstrap and the bootstrap loads the plugin
or something like that
oh so you can use your own classloader?
yep
sounds simple enough
actually strong encapsulation on JDK internals only applies to runtime access
and Kotlin/JVM doesn't have its own runtime, since the runtime is the JVM
also, on the command thingys, would events be the only way to ensure thread safety on command handling?
I mean, I'm really not sure about event-driven commands tbh
obviously the events will use coroutines and flows to better make use of concurrency, but commands will just be called internally
You can have functions to wrap the event and filter it through to make it work similar to "registered" commands
yeah
wat
example pls
oh also, btw, how should I actually implement event handling btw?
just listen<CommandEvent> {}?
or onEvent?
or just on<CommandEvent>?
ah right, so a Flow is basically an asynchronous List
Use SharedFlow
but not really like either
To publish events
it does have a caveat tho
the LP API is not part of the jar-in-jar, it's part of the bootstrap plugin jar, so other plugins can access it
so maybe with a gradle plugin you can make things like an @Api annotation for classes that wouldn't be bootstrapped
idk
just a thought
perhaps yeah
fun onCommand(name: String, handler: (args: Array<String>) -> Boolean) = listen<CommandEvent>() { ... } // call handler at some point
onCommand("test") { args ->
}
reactive tho
that's not bad
also, what would I actually do for the event function? ```kotlin
inline fun <reified T : Event> on(consumer: T.() -> Unit) {
}
or listen
or whatever lol
also, T.() -> Unit should work right?
eww flow pls
on can be that but have listen<T> that returns a Flow<T>
or maybe just ```kotlin
inline fun <reified T : Event> listen(consumer: T.() -> Unit): Flow<T>
you dont need a consumer and a flow
is that what you're on about?
that doesnt make sense
yes
YUGI
r u there
I kinda wanna call this like ```kotlin
listen<CommandEvent> {
sender.sendMessage(Component.text("Hello there!"))
}
?
ur awake
Yugi are you okay, are you okay Yugi
or one better, for commands, ```kotlin
onCommand("hello") {
sender.sendMessage(Component.text("Hello there!"))
}
UH
Maybe im not
uhm
listen<CommandEvent>().collect {
print(event)
}
That's a lot of time to last, most men don't last that long
use on as a syntax sugar for collect maybe
plz
u wot m8
tf is syntax sugar
๐ฎ
?
How many seconds matt xD
A convenience function
Gotta speed run it, any%
xD
what is any%
anyway, so you mean ```kotlin
inline fun <reified T : Event> on(): SomeCollectionFlowOrWhatever<T>
A category in speedrunning which pertains to the goal of a game's mere completion, i.e. getting to the main concluding goal as quickly as possible, regardless of how much is unlocked.
whats ur pb
Not sure, need to check
on <T> consumer = listen<T>.collect(consumer)
wait you can do that?
actually nvm, I dum dum
right, ```kotlin
inline fun <reified T : Event> listen(): Flow<T>
inline fun <reified T : Event> on(consumer: T.() -> Unit) = listen<T>().collect(consumer)
yeah should work
probably wont
๐ฆ
unless they changed inline semantics
also, how am I even going to do that?
what about them?
like what do I put in the {} thingys?
huh?
how should I do event handling?
event bus i guess
inline fun <reified T : Event> on(consumer: T.() -> Unit) = listen<T>().collect { it.consumer() }
how dis work
maybe SharedFlow
oh yeah right
unless you just use a normal function instead of a receiver
just a question of style but as a side note I would probably pass events as the first param rather than the receiver
even then
why?
I stand corrected
reified good
huh?
also, teach me the event bus ways pls senpai @prisma wave
idk
because of consistency with other apis and because I think the receiver should be reserved for things that are immediately connected to the function
oh right
event.executeListener() just doesn't make sense to me
so ```kotlin
on(CommandEvent) {
sender.sendMessage(Component.text("Hello there!"))
}
right @lunar cypress?
still receiver
so what should it be then?
(T) -> Unit
sure it can still be reified
right
trying to resist the urge to make a hillarious comment rn
๐คฃ๐คฃ๐คฃ๐คฃ๐คฃ
you guys truly are unique
I wonder where everyone will be at in 10 years
dead
lmao
or just severely burnt out in some underpaid office job
"remember when we all said kotlin was good and java was bad? those were the good old days"
"and when we OWNED the mods by posting funnies in #816184744797929522"
-_-
what?
anyway, teach me the event bus ways pls senpai
event bus?
someone pls teach me the event bus ways
ughhh ffs now bm is changing von neumann
google ๐
obviously
we need a new architecture
that only supports functions
no data
lol
maybe I should use Guava as a reference for my event bus
delete data bus
copies guava
only control and adress
still too impure
we need something that will guarantee 0 state
lol
assembly would just be the lambda calculus
That would be delicious
right you are
i HATE people that want configuration help
Haskell Curry 
Big sad, so much for 100% interop!
Yeah parameter names get erased in java, they become arg1, arg2, etc, unless you add a compiler flag to keep it
i guess thats why then
what should i name the class?
Which class?
the class that code is in
okay
what should i name the file
before it was ConfigUtils
but i think thats a bad name for it
lol
We told you this so many times you don't put it on a class
Name it something that describes the functions inside
For example Strings.kt or Numbers.kt
ye i know, but idk what to name this
Lists.kt seems strange
so im asking for ur opinions
For example I have one called Adventure.kt where I have many adventure related extensions
and is extension a good package name?
If you want a generic one to throw everything in it maybe call it Declarations or Functions
ok
๐
FileContainingGetMapFromIpAndPorts.kt
๐ฎ
lol
Where?
In particular, when defining extension functions for a class which are relevant for all clients of this class, put them in the same file with the class itself. When defining extension functions that make sense only for a specific client, put them next to the code of that client. Avoid creating files just to hold all extensions of some class.
although as I said earlier, that might only apply to classes that you can actually control
Well I'd say that is only if that function only applies to a specific class, since those are supposed to be global i don't think it'd be like that
yeah im not sure what you'd do there
i guess you might make the file a bit more generic
Formatting.kt instead of Strings.kt to hold functions related to formatting and printing or something
lol
classic
ignoring their own conventions
Yup xD
oh actually i guess that's slightly different
fun sendMessageToMinecraft(plugin: SomePlugin, message: String, tag: String) { should I do
SomePlugin#sendMessageToMinecraft or
String#sendMessageToMinecraft?
it's not all extensions of Path
i would extend SomePlugin
Definitely plugin yeah
lmao
wait
curious question
could I access private fields with extension functions?
or public only?
nope
i have like 8 classes that have to be changed from utils to extension functions
oh hey, was just having a talk about this, and it made me think: if commands are event-based using a pub/sub event bus, how would I handle precedence if two plugins have the same command with the same name?
Also, didn't like doing unit tests before, but damn it's actually so nice to do it, you create the supposed occurrence once and if you need to test later you already have it
I used to have to rewrite the test class all the time to try different things to find issues
Now it's all organized ๐ฅบ
unit testing is amazing
whichever is registered first
whichever plugin
or have you moved away from registering plugins entirely
actually that wouldn't work, at least not easily
probably just let them both do their thing 
commands are events
oh that is a good point actually
event priority
you need the stupid tab complete packet
?
an even better point
maybe we should just go back to the old method
object MyCommand : Command(name, permission, aliases) {
override fun execute(sender: Sender, args: List<String>) {
// do some whack
}
}
class MyPlugin(context: PluginContext) : Plugin(context) {
init {
registerCommand(MyCommand)
}
}
yea event based commands might not be the best
oof i already changed 21 files while refactoring
good
this is tiring
dkim that's normal lol
i have like a billion errors
if you didn't change that many files while refactoring then I would be a bit concerned
๐ญ

stop complaining lol
looks cool
๐ฅฒ
loll
if you want something to complain about then convert to clojure
why not
oh btw, how should I actually do the command registration?
should it be handled centrally?
a.k.a by the server
why you blanking shit smh
show
lol
liskov
show name anyway
liskov?
substitution principle
yes
yeah ik, what is that again?
use most abstract type that still keeps needed contracts
is this bad?
Yes
fuck
lol
u dont need in a class
pog
i dont want it to be like PUBLIC_KEY i want it to be Something.PUBLIC_KEY
that raises so many questions
send me
this is hideous
name it SOMETHING_PUBLIC_KEY
it's called a private key for a reason GOD DAMN IT DKIM
object Constants {}```
oh
ok
LOL
bruh
OMFG
-_-
did you just say Y???????????
private key
bro i swear, im gonna kick my fucking monitor, everytime i shift enter it closes discord
PRIVATE key
jesus christ
-_-
storing that in plain text IN the plugin is also probably an extremely bad idea
smh
environment variables ๐ฅฒ
config file ๐ฅฒ
but
then where do i store it
config file
but I'll need that key
^
not in the plugin
so its not distributed to everyone
but the plugin needs the key
for it to work
u have licensing?
what are you doing?
@prisma wave how should I store commands? map in the server like Bukkit does?
passing data between servers
plugin messaging...
eh i guess so
Map<String, Command>
that requires a player on each server
what data are you passing when players aren't on the server lol
console
what
that all happens when a player is on the server
anyways
anyways what
anyways, i'm gonna keep storing my private key in plain text inside the plugin
it's not a security vulnerability as long as nobody decompiles the plugin
sounds like a good chance to take
yeah pretty much 0 risk
unless you run into the same guy this morning who found out u can decompile jars for resources
then u have an issue
but until then
O.o
what else could i do
because I need the key
Make it a config option
but then how will they get it?
"they"?
since theres only 1 key
put it in a pem file
pem?
yes, but they can still get the decoded key
what is it that you're trying to do?
nvm
why do i get the suspicion that means you're just gonna ignore the issue
lol
why am I getting a billion build.gradle warnings ๐ญ
even after invaliding & restarting
everything is yellow
anyone able to determine why my server randomly stops and restarts every hour or so?
ive checked through logs and theres no error as to why the restart would be executed
checked through shockbyte and theres no restart timer
used a region fixer for any corrupt chunks, and nothing found
tfw severe security vulnerability isn't worth your time
Doesn't matter
it does
it won't ever be public afaik
but
why is my whole build.gradle
in YELLOW
Still doesn't matter
...
why does it not matter?
If that key is leaked you have no way of changing it
i do
Anyone can just read it in plain text
no
hit configure to the right
karma for avoiding security ๐
;-;
L
I had to delete .idea and invalidate and restart when mine suddenly kermitted sewerslide
alright what the hell does this error mean
Class 'kotlin.jvm.JvmStatic' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
Which Kotlin version are you using?
Thanks Kotlin 5
lmao
Exact number please
Don't use that one, it's unstable
it was conversion
with(plugin.config) {
getString("blah")
getString("blah")
}
or
config.getString("blah")
config.getString("blah")```
๐ค, i kinda like with()
First
cause i can just define the function directly without the header
i originally had object
i didnt need it
Yeah you don't need it, just fun main() {}
yea i believe thats the latest
thank you intellij
very useful
now i understand why you get these types of shit
lol
oh i fixed it
its the null things with the question marks
um
what do i do
if mc is stuck on the page
where its like joining the server
but its empty
no text
no buttons
Alt + F4
every day ur complaining about ur pc
and everyday i will reply saying get a better pc ๐
ok my mc is back up
Anyone used Open Policy Agent (OPA) / rego before?
I wish it was that simple lol
but theres this thing in the world called Money
never heard of it
/s
search up this thing called "My Bank Account" and find your user and pass, and uh DM it to me
:D
who can help me to install MySQL?
in my Host Dedicate ubuntu 16.04
what is my best choice as far as maintaining an SQL connection when i'm not making a lot of requests
Connection pooling
alright fair enough
is there a lower limit to how few requests being made that would justify not using connection pooling?
or would i just always use it
and then which package should i use 0.0 there's a million of them out there, does it matter which i pick?
I'd say always use it
And wdym which package?
I know this place is English speaking
But is there a DEV that can speak Spanish?
I pay
i guess i mean which software to use for pooling
like BoneCP, c3po, HikariCP etc.
HikariCP is my choice
on a separate note, does anybody know of a decent solution to running some potentially long events on onDisable()
i'd like to do some nonspecific network stuff just before a server goes down
Just run it, sync ofc
it doesnt want to work for me ๐ฆ i may be an idiot i AM an idiot, thank you frosty โค๏ธ
What would be a good location builder from a string, would something like
x:<coord> y:<coord> z:<coord> be good or anyone got any better suggestions?
looks fine
{"x": 1, "y": 1, "z": 1} xD
oh god
This is what the current arena config looks like https://paste.helpch.at/obokocuwig.http
Pretty nice if I do say so myself
Or you could store coordinates how the protocol does, in a long with the X packed into the most significant 26 bits, the Y in the middle 12 bits and the Z in the least significant 26 bits lol
It's user configuration, I will legit shoot you Bardy
Lol
{:x 10 :y 64 :z 15}
^
10:x
Try me https://tenor.com/4IMq.gif

Also, thinking about event handling btw, I kinda want a way that events can be handled outside of the init block of the plugin
How are they currently handled?
class MyPlugin(context: PluginContext) : Plugin(context) {
init {
on<Event> {
// do some whack
}
}
}
ew
Thanks for the input
whatโs so ew Frosty
np
not a fan of that init block
If I was going to make it a function, it would be initialize, not onEnable
And shutting down will be an event
enable, disable
and perhaps reload if you were to introduce some default shit for reloading
plugins wonโt be reloadable very easily
well, you can reload confรญes, but thatโs your lot
also, the startup states are different from Bukkit
thatโs why the function would be initialise, not enable
things like plugman would require depending on the server and reflectively calling functions from the internal plugin manager
I want to very strongly discourage plugins being able to enable and disable other plugins
plugman should never exist.
why won't plugins be reloadable easily?
reloading is a key component on any production system, you should be making it as easy as possible
well actually I know fuck all about production and that sentence is probably wrong
but it's still useful
reloading would be nice, but certainly not how plugman does it
Have an in-built accessible plugin manager
maybe even something like a "package manager"
does sponge handle the actual jar change or is it completely up to plugins?
concept I had in mind would be to have plugins in their own classloader. That classloader has the krypton classloader as a parent, along with the classloaders of any of its dependencies (although you'd have to create some sort of shallow classloader implementation here, as we don't want the krypton classloader from dependency x, although considering there is only one krypton classloader, perhaps it wouldn't be an issue). On plugin reload, you tell the plugin to unregister itself from its dependencies (i.e. through such an event that lemmo mentioned). Upon its success, you unregister it from krypton itself then close the classloader and initialize a new one with the updated jar.
open the url classloader ๐
True
wym?
/reload won't exist btw because of how whacky it is
you know for pdm
and the url classloader thing
that doesn't work for java 16
Having each plugin have it's own class loader might get a bit whack though
how?
Does anyone know what you usually do when you have a premium resource that you don't want to maintain anymore? Like how do I find someone to take over for example
Idk, just annoying to keep track of I guess
open source it
Open sauce
It's already open source
Yea but then I'll still have to maintain it / fix people's errors etc? Like I keep getting feature requests that I just can't be arsed to do
Nah just ignore
disable purchases
Post in #816184747024711693 or #816184744797929522 ?
Didn't know you could disable purchases tbh. Okay, think I'm going to put it in request paid and then if noone picks it up I'll do what you said frosty and just ignore everything lol
lol
but make it free ofc
link to plugin har
Like I structured the code like an idiot and databases etc so it takes way longer than it should to fix or add things. I just cba to work on it and I don't really have time
lazy man
aha pretty much
iwanio it takes no skill to make premium plugins
well to make good ones
90% of them are a fucking disaster code wise
Yea i mean look at the code of that one i just posted lmfao
It's just the idea and features that count
man i gotta set up clojars
aight barry doesn't like my "budget"
what language is it in?
brainfuck
Java
๐คข
What is your budget?
Dammit keyboard
a premium plugin thats open source?
Well, it's not a numerical value really. It's whatever the person makes from sales technically
60 pesos
i am confusion
Freemium iwanio
cooolio
It just gets leaked anyway iwanio
yeah exactly, I usually just keep it a version or two behind latest
mm fair
All popular plugins get leaked in days anyway
yeah
lol
and i'm having thousands of downloads from leak sites
To be fair, I was getting like 5+ sales a day at one point and then it got leaked and it slowed to 1 every few days
If people go to those sites they weren't going to buy the plugin anyways
they were never a potential customer so why bother yourself with that
lol thats a point
People that get their plugins from leak websites wouldn't buy your plugin anyways
Frosty that was already on the board i sent you even before you opened the issue xD
I didn't look at the board
Smh
mf-cmd 2 when?
mf cmd 2 electric boogaloo
Is annotating a param with @obtuse galeable gonna make it be able to be null, or will the manager yell at me
mf-2: The Brigadier
wow frosty
Working on it, figuring abstraction is pretty rough
rude
Your fault for having such a shit name, not sorry for the ping
haha
Which manager?
oh wait nvm
got it
Yea
Wait how do I disable purchases?
๐คทโโ๏ธ
bloody spigot
I can't see an option anywhere .-.
hopefully paper's hangar gets popular
hopefully
then md_5 can go sadge in a corner
open sauce everything, would be nice
Dont think md would really care
Unfortunately don't think it'll because of the decision to not have premium plugins
meh
^
I mean they could still setup some kind of donations
donations are a lot less used tho
Like people donate
Well yea, but still
:kek:
Hell yeah
Just throw your OF link on the plugin page
+1
That's a very very very very very very very very very very very very good thing, but yeah, some developers might not like that
Bardy
we don't give two fucks about the devs who are in it for the money
Their plugins are shit anyways, cough vk
lol
If Piggy makes PAPI 3 in a way that I can create an implementation with no issues then yes Kaliber
when ur docs are worse than nms
Wait a minute, dont you do a lot of commisions
Eh
You made almost $1k last year right?
Yea
Then there's your answer kali
Seems you got paid enough
pog
thats like
Well not really lol
How many did you do?
Complaining about $1000 in a year smh
I wish I tracked how many hours I spent
when people admire making less than minimum wage
just make a steam game
ffs
easy money
Actually I make ยฃ20 a week in pocket money for doing fuck all so I can't say shit
smh
From what comes in #816184744797929522 , thats a fair amount
i made a grand total of $2 last year ๐ฎ
Most of them wasn't from request paid Yugi, but people reaching out
lol do your parents give you money for getting good grades
Ah
man imagine good grades
sucks to suck
I have 170$ scholarship, but I'm a nice person so I don't get any of it 
can't relate, I'm in the top of my cohort for maths
monthly
Why dont you get it?
I give it to my mom
Ah
Nope, my grandmother (who gets a government pension and lives in a council house I may add) gives it to me
y'all americans with ur shite student finance
:kek:
whos american
๐https://www.studentfinancewales.co.uk/ easy money
providing information and guidance on the financial help available to higher education students, living in Wales.
cute
Do you mean /reload or hotswapping?
hotswapping is satan
Gotta love grandparents
neither bm
you can't reliably unload classes from a classloader
trust me I've tried
He wants /reload for Krypton plugins BM
why would you need to unload them tho
Didnt chestly post something about being able to unload classes in #developer-chat
pulse's solution was to just have everything in the one urlclassloader, and for a reload to function, you'd need to unload classes and load in new ones
but you can't unload classes
spot the impostor
lol
Wait so how does Bukkit shut down reliably then? Does the JVM just fire the shutdown hook and then the plugins are left to shut themselves down properly and the class loaders just die?
lol
mmm
Oh
Not saying it's a bad thing, just saying it's a reason why they won't be as popular
bukkit isn't reliable
bukkit literally has a message saying "this is a bad idea" when you reload
haha
Yeah
lmao
I thought you were saying having an open classloader was a bad idea
Exactly what puts me off adding reloading into Krypton
Stfu
Lol
Imagine needing to reload because your spaghetti code is so tightly coupled to an impure framework you can't test in a repl
just gonna bring up osgi again because I think it has a functional reload impl
You could provide ways for plugins to interact with each other w.r.t their lifecycle
Jump off a cliff
Like make it deregister the hook as soon as the calling plugin dies
OSGI?
yes
Wat dis
man
basically a plugin framework
They hated jesus because he told them the truth
controversial statement there bm
Lol
it allows u to load jars
bm comparing himself to jesus?
and unload jars
bm is jesus
Oh right
Might just have to jump off a cliff myself after that statement that BM is jesus
lmao
cliffs are too short for that

bm be like
btw osgi doesn't fix your spaghetti code, osgi advertises itself as a way to "modularise your tightly coupled code into modules that are still tightly coupled"
but it fixes the reload issue
somehow
bm be like
https://www.youtube.com/watch?v=elizAugXVcI
https://billwurtz.com
spotify: https://play.spotify.com/artist/78cT0dM5Ivm722EP2sgfDh
patreon: https://patreon.com/billwurtz
itunes: https://itunes.apple.com/us/artist/bill-wurtz/id1019208137
twitch: https://twitch.tv/billwurtz
soundcloud: https://soundcloud.com/billwurtz
twitter: https://twitter.com/billwurtz
instagram: https://instagr...
Dis why reloading bad
is that a new vid?
yeah
Simon and Rich
indeed
very strange
Layers are sort of the secret sauce of the Java platform module system (JPMS):
by providing fine-grained control over how individual JPMS modules and their classes are loaded by the JVM,
they enable advanced usages like loading multiple versions of a given module, or dynamically adding and removing modules at application runtime.
The Layrry A...
tl;dr
"a class or interface may be unloaded if and only if its defining class loader may be reclaimed by the garbage collector" (JLS,
that's what I said to do earlier
this just validates my claim
you can't unload classes from a classloader
only the classloader itself
which is why pulse's solution is not viable
I see
Wait so the secret to unloading is making the class loader useless and letting the GC yeet it?
How does one accomplish such a feat?
yeah good luck reliably getting the GC to actually destroy it
you need to first eliminate ALL references to the class
that's why a method in the plugin which unregisters itself from its dependencies is essential
and then you also need to eliminate the references in krypton itself
then, you can close the classloader
and if you're lucky, gc will take it away
I'm sure you can do some https://tenor.com/uyuI.gif to force the GC into a corner reliably
yeah no
Yeah it's not exactly reliable lol
yeah, I struggled immensely with it
Probably not worth the effort tbh
My thought entirely
If nothing holds a reference to a class from that classloder, it would be eligible for gc right?
If I need to do some whack to try and force the GC into a corner, it's very debatable whether it's worth it or not
only if the classloader is closed yugi
