#dev-general
1 messages · Page 193 of 1
but isn't out the "producer"?
not an expert on generics but I believe out is the same as ? extends Unique
Make a copy of the variable
or use ?.let
@prisma wave another weird dead end I found myself in:
interface Identifier<T : Unique>
{
...
fun get(id: UUID): T? = IdentityLookupTable.get(id)?.let {
if(it is T) return it else null
}
...
}
doesn't compile because I cannot check (it is T) but I cannot use <reified T> because it's an interface method. Any ideas?
Impossible to check
However I think you can do as? T
Which will do the same thing
Ish
Type erasure
Generics can be pretty awesome
Just depends on what you're doing
val map1: Map<Class<T>, List<T>> = emptyMap()
companion object {
val map2: Map<Class<T>, List<T>> = emptyMap()
}
map1 compiles fine, map2 doesn't
I need map2
All I want is tell the compiler that the List each key points to contains elements of that key type
You sure you want to expose the map like that?
Generics are awesome but little poor sometimes
Well do you have an idea of how to tell the piece of shit kotlin compiler that the map contains classes as keys and the lists they map to contain elements of that class?
First of all
Or I guess the compiler probably doesn't care, really
Use a Multimap
Why?
Instead of List<>
the Multimap will handle that for you
Also you will probably have to make an unchecked cast btw
Depends on what you’re doing but still
@empty flint dude
The companion object literally can't be aware of generics
Think about it
It makes no sense
Blah<Int>() has the same companion object as Blah<String>()
which is my point
What you're doing makes no sense at all
Blah<Int>()has the same companion object asBlah<String>()
@prisma wave No I get that and I don't want the T to be defined by the class the companion object is a companion to. Completely different scenario
I just want a static map that has the property where the keys are classes and the values are a collection of instances of those classes
completely generic though
like nothing specific whatsoever
then just have a Map<Class<*>, Any>
-
?
meh
Like wth java why ?
why not?
- isn't a wildcard technically
@steel heart then why tf is your name still ? super ?????????
just generics
my face when generics
Nested generics
Oh
@lunar cypress you ever used luminus before?
oh god
what have i got myself into
ive done it
clojure website
localhost/test
wow
-> function is cool
make clojure go left to right
wow amazing
clojtlin
(map blah (filter condition list))
(-> list
(filter condition)
(map blah))
ay
aye just started using guice like heavily @prisma wave
its so nice, but little slower
Neglible at runtime
Well not exactly
But like
It's a minecraft plugin
Even if it takes 20ms to initialise something on startup that's not really a problem
its a forge mod
has anyone else's intellij been slow/crashing since updating to kotlin 1.4.10?
keyword: kotlin
no u
what do I use for -XX:HeapDumpPath to create the dump on the server root folder?
or will be created there by default?
What do you call those utf-8 characters that are used for decorating text? Like the arrows and the table elements and shit.
I don't know what to google to find them lol
Dividers?
"copy paste symbols"
You folks already check out the new feature from IntelliJ ? https://www.jetbrains.com/help/idea/code-with-me.html
the fuck does this mean? https://i.imgur.com/VS0zAyJ.png
What is even that
eclipse memory analyzer
15% of 500mb, assuming that's how much memory my server was using 🤷
why all issues are related to hashmaps smh
never say that again pls
I’ll fondle with your code anyway 😊
cursed
This shit is actually awesome ;o
Lemme just like
help you put in the exclamation mark 
I'm fighting with gaby over a semicolon
It's not needed!
just because he's not here doesn't mean you can trash talk him
When devs lose their minds things always work out
But that is pretty neat so it’s real time updates?
Yeah, even shows which class someone is working on, and you can even follow them
That is neat I may want to try that at some point is it just a plugin for IJ?
Case sensitive? %PLAYER%
Ohh yeah this is dev general
How long did the survey take?
A few seconds, can just bullshit it xD
🤦♂️😂
Yeah I’ll definitely give it a try cause let’s be honest merging, pushing and pulling is just a pain
tell me about it
no ..
🙂
@distant sun Remove that semicolon.
Hater
New intellij feature? or plugin?
Right now it's a plugin but i think it'll be q feature
Can anyone tell me what the use for Function.identity() is?
There has to be a reason for it existing, I just don't understand why you'd use that over t->t
I saw an argument that might make sense that Function.identity() doesn't return a new instance, but idk, that doesn't seem like reason enough
Yeah it's a singleton so saves a bit of memory
I've spent most of today learning about functional interfaces
they're quite handy
I started the day learning more about Stream and ended up hitting the interfaces instead lol
I was confused about Supplier until I realized that it'd be useful for Asynchronous I imagine
@lunar cypress you ever used luminus before?
@prisma wave nop, what's that?
Do you guys know where the spigot language files are stored at?
like the translations...?
Or are those client side?
Client side
Do you happen to know where those language files are located at?
Ah found em
Could I get into trouble if I put those lang files in my plugin?
I just need to get the real item name if it has no display name. It used to work like this:
CraftItemStack.asNMSCopy(item).name and then later using CraftItemStack.asNMSCopy(item).name.text
But those do not work anymore.
All I get from CraftItemStack.asNMSCopy(item).name
is 'TranslatableComponent{key='item.minecraft.diamond_sword', args=[], siblings=[], style=Style{ color=null, bold=null, italic=null, underlined=null, strikethrough=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null, font=minecraft:default}}'
The information is there, I just don't know how to translate a TranslatableComponent. Are there any packets for that or something? Does anybody know?
PikaMug (Quests author) has a lib for that iirc
Isn't there getLocalizedName() for that
@lunar cypress help please
Hello I need help
I'm using DeluxeMenu, and I'm making a plugin that uses the DeluxeMenu command when the user presses F.
For example, in the DeluxeMenu, chests.yml is set to open with the /chest command.
Player#chat("/chest")
And in my plug-in, I tried execution with the following syntax.
dispatchCommand() and performCommand
Unknown command is displayed.
That's for registered commands
yeah i think it's because the command is not registered
Player#chat("/chest")
@distant sun use this
Is there only way?
I know that if you try that method you will succeed.
But I'm reluctant to use it...
What do you think... It will be a little bit bad.
If there is any other way, I want to choose another way.
just do /dm open <menu> <player>
Thank you
Isn't there getLocalizedName() for that
@lunar cypress I have never seen any value being stored in the localized name. Not once.
Does anybody have an idea of how to get the NMS CraftBlock to a corresponding bukkit Block in a world?
@lunar cypress help please
@tired pumice what
Whats wrong with chat()? It just makes the player run that command
ive not tried it yet
im trying it now
anyone wanna try it with me?
otherwise imma just be testing it between my laptop and my pc lol
If I wasn’t about to go out I’d say hell yeah to that
Sure when I get home
cool
you gotta download a fancy ij i think
Code With Me Survey.
Do that survey then it gives you a google drive link
Scala
pretty cool
@ocean quartz Does your command framework support mutually exclusive parameter groups?
something like
/cmd location x y z
/cmd location player
both get the location but one uses the specified player location and the other uses coordinates...
sometimes i enjoy coding
other times
i wanna die
@quiet depot you know gradle, halp
🤦♂️
niall shut up
Suck a dick
Also just a suggestion
This likely wouldn't happen in a compiled language (e.g Rust or C)
i dont care about the shitty languages this server is circle jerking now 
No brainer
im kinda dumb but i swear this should generally work
@remote goblet paste ur build.gradle
you need the shadowjar plugin
ah
that'd make sense
well this'll be fun
Sometimes i hate how chonky the kotlin lib is
then don't use kotlin 4head
piggy I could do with your opinion on something
I'm building a decoding library that has so many possible fields
theres over 20 different message types
alot of those types share certain fields
To the point where most existing libraries that do the same thing use a single struct
There is a java version that uses proper inheritance and all
Although im using rust theres no inheritance
are shared fields just coincidence, or are these message types somewhat related?
There are rustic enums
I don't know how to explain it
Did you want an example:
Decoding is here
The struct is here
a java implementation
i think the idea is performance wise that big struct would work well?
considering its not copied throughout the program (as far as im aware)
I'd assume the very opposite
How does object allocation compare between C and Java?
I thought java was better at it but read that C was
well they're not comparable afaik
precursor, I don't know c
but c's memory management is entirely manual
java's memory management is automatic, unless you delve into the unsafe api
Heres part of what I've written
Consider each number/downlink format = a individual message type
So you could imagine
Alot of nested structs/enums
Or fields being shared in different structs/enums
If your aware how rust enums work
And I want to think how the user would use it
With a single struct the user kind of has to know the insides of which types contain which data
With separate structs you can tell that quite well
look honestly, I've already given you my recommendation in the past
separate structs
Do commands have to be unregistered when the plugin gets disabled?
Im on 2015.01
@heady birch might wanna upgrade buddy
xD
At this point he's not even going to be able to. It will just think he uses a cracked version of IIJ

me when my cracked eclipse neon gets deactivated by the eclipse "foundation"
me
Me when
🤔
tf is eclipse neon
Why is it cracked
Eclipse is free???
Also neon is what I used back in the day
After like oxygen
Or the other way round
r/wooosh bro :))
hey
could you help me with one of my bots on my server?
the dyno bot wont work with auto roles
Neon is before Oxygen
eclipse professional
I remembered i used oxygen for 2 years then I moved to IJ
I used eclipse from Mars to Oxy I think
ew
I mean.. yeah 🤷
Did a while ago
In this school semester, we have to learn it...
Many companies most likely still use it
- Its useful for learning SQL concepts
Think you can query access with ms sql
what is this sorcery
what are u implying here
🤣
Sxtanna
😭
You should buy a pair of glasses
wow
How often should I access a property of a property of an object before it makes sense to store the property of the object as its own variable instead?
twice
so if I access it more than once?
mhm
Can you explain why or is that just some gut feeling?
event.getPlayer
event.getPlayer
event.getPlayer
or 8 if you're dealing with standardised buffered accessing
or 8 if you're dealing with standardised buffered accessing
@prisma wave How would I know if I am or not? 😦
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
@onyx loom Very insightful.
@prisma wave How would I know if I am or not? 😦
@empty flint you're not
there is no answer to this question
it's just whatever you think is good
more than 5 is probably a problem though
But surely one has to be better/quicker/more efficient than the other
doubt it
if it's just a getter it's gonna be neglible
I can't imagine calling "event.player.name" 5 times to be the same as "val name = event.player.name" and then accessing the name 5 times.
imo its just more clean if ur using it more than once
Negligible != none
imo its just more clean if ur using it more than twice
@onyx loom I agree, if it's more than twice I almost always already use a variable. Intuitively. But what about exactly twice?
Heres what I mentioned earlier bm @prisma wave
edited
So what I'm interested in weighing out is the cost of storing a value as a variable at runtime vs the cost of calling a member of an already known variable.
Ew enough or?
toggles:
announcement:
setting:
type: CHAT_MESSAGE
check-type: CONTAINS
check-input: "Daily Announcement: "
permission: toggle.chat.announcement
autosellNotify:
setting:
type: CHAT_MESSAGE
check-type: CONTAINS
check-input: "You have sold all"
permission: toggle.chat.autosell
advancements:
setting:
type: ADVANCEMENT_DISPLAY
check-type: ALL
permission: toggle.advancement.all
Yeah blocky do some testing
@empty flint try it
I think logically the difference should be however many cycles it takes to store an address in a cpu register.
so really negligible
I personally always create a variable if the method is a getter and is used twice within a specific context.
twice or more
I highly doubt it will make a difference
invoking a getter is going to be practically neglible
For me it's always been 3 times or more. Never if it's once of course and if it's twice I always weigh out if getting the value is a costly operation or not
Well I think it’s good for readability partly as well.
Well I think it’s good for readability partly as well.
@steel heart See this is why I asked actually. I just found a case where it looks cleaner if I don't store the value in a variable even though I am using it 3 times.
How does not creating a variable make it more readable. You will end up with very long code lines
And the question is am I willing to sacrifice 1 or 2 Hz of CPU time for more readable code lol
Yes.
That doesn’t matter ?
Not in this particular case but it's a matter of principle
on like a 3GHz modern cpu 
If you really look for speed or something, don’t do java.
Wise words
If you really look for speed or something, don’t do java.
@steel heart That's why I'm doing Kotlin
lmao
😄
kek
Kotlin is slightly slower than java in some scenarios init?
At runtime?
on like a 3GHz modern cpu :LUL:
@onyx loom I mean I pulled those 1 or 2 Hz out of my ass. It's probably more because it has to swap out values from the registry and potentially load new pages from the cache and so on
I think but I don’t know, Alex knows better
it's not slower at runtime
Why would it be slower at runtime if it runs on the same runtime that java runs on, which is the Java runtime?
@prisma wave Didn't you do some research about that?
hehe kotlin makes jre go brrrrrrrr
Indeed
Lets hear it out
afaik kotlin can be faster due to certain optimisations, but it can also be slower at times
Do elaraborate (see what I did there?)
Elara is the fastest language known to mankind
me
stinky java users
I am an intimidating force
Yeah that makes sense. Well there is like tons of bad code in used frameworks like "".equals(str) for instyance which slows down the speed a little
I'm so punny I'm gonna go excuse myself to find a gun I can shoot myself with 🙂
iirc str != null && str.isEmpty() is faster
Sheesh
You probably wont have to worry about storing the returned value, do also consider the load of indirect addressing in case of repeated calling
pointers
Y'all worrying about so miniscule speed differences it hurts my head
lol
This is why Go best language
Micro optimisation is everything
Honestly no point in optimizing to this level
Y'all worrying about so miniscule speed differences it hurts my head
@hot hull Bruh have a user trigger a million TNTs and you'll see why worrying about miniscule speeds can become vital
Thats the whole reasons programming languages are abstracted to this level
thats true
Blocky, MC itself won't handle that, so why you worried :kek:
or just dont let users trigger a million tnt
The server will shit itself way before your miniscule speed non optimizations make a difference
if u want performance, go use those electrical pulses 
How about I actually do my job as a developer and optimize to the best of my ability instead of saying fuck it, you can't do that because I am a lazy fuck who can't be bothered to care about the callstack
If you want speed, go try out coke
(For legal reasons this is ofc a joke)
If you're google or something, micros might be worth paying attention to
There is no optimization at this point borz
You should probably look at other parts of your code which can be optimized to some reasonable extent, instead of worrying about such small things
maybe like a pico second but that doesnt matter
tbh afaik the compiler optimizes for multiple calls of the same getter anyway
It does not
the compiler?
Atleast not afaik
I remember learning about the gcc that does that for C and it's not a particularly hard thing to detect so I would be really surprised if it didn't do that, with all the other stuff it does
It would only be reliable for final values
otherwise it could potentially break functionality
otherwise it could potentially break functionality
@prisma wave The compiler knows if the value changes between calls though.
@prisma wave The compiler knows if the value changes between calls though.
@empty flint no it doesn't
The optimizations are in cases like loop unfolding and stuff
Yes it does
like 99% sure it does.
I remember doing an assignment in uni
where we decompiled shit and also had to analize the optimizations of the compiler
and we found out it does that
Im pretty sure gcc does not do that
player.hp.blah()
player.hp.blah()
player.hp.blah()
player.hp.blah()
the hp could change at any point in this example
it can't tell
lol i was thinking the same
Also blah could return something and be doing something else
how is the compiler meant to tell that
magic
🤔
the elara compiler will be able to

it can't tell
@prisma wave It can because it knows what blah() does
you're forgetting that hp is not synchronized
any other plugin could change the value at any point on another thread
therefore the compiler can't tell for sure that repeated calls to getXP will always return the same value, unless xp is final
Like you can't be sure with race conditions and shit but there are definitely cases where it can be certain that nothing changes
^
It might not work for all examples, sure, but it can know when it definitely doesn't change
therefore
haskell and clojure are the best languages
as they can be optimized infinitely
no i'm not
😠
How about the one and only true god of programming languages: asm
@frigid badge https://img.bristermitten.me/idea64_jJVMYYhfM8.png
😎
new commit: 'Docker'
push to master? (Y/N) Y
error push failed
git push --force
force push complete
wow
i am unbelievably smart
no idea but probably not
@empty flint It doesn't by default, you can always make it possible with String[] though
hate docker
doesnt work
@frigid badge how does one expose ports?
i've got this
neither work though
EXPOSE
EXPOSED
if using docker compose use the ports directive
if using docker run use —ports
or -p iirc
you need to tell it to use a host port
I was using IJ integration and just selected publish all ports or whatever it was
never used ij’s integration
absolutely typical
this "professional IDE" ruins my life yet again
andrey pays most of these programmers' wages so i suppose it's to be expected
🙄
Just be smarter BM. It's always user error
yup
Just like the customer is always right (unless that customers name is Karen, then they can fuck off)
"user error" yeah more like Andrey error
I've said it before and I'll say it again
Andrey is biased against me
He is scared of me
He knows I can expose him for the fraud he is
Beautiful
😍
+"message"
+"message"?
+"message"!
+"message"
@prisma wave
😐
@prisma wave There
next he gonna be asking for (component (buildComponent (append "Hello")))
Ew
IKR
We don't do Lisp here
Hm looks like I gotta make my own command framework
One that is highly optimized to not waste a single Hz of CPU time
I really like your Framework Matt, but I despise annotations 😦

I mean I don't prefer annotations but its good. You tried brigadier?
I have not, how is it?
Its good
I don't know, I think I prefer to write my own if I'm honest.
I mean, generally when you want a framework, its main entry is high functionality which means optimisations might not be prio 1.
Do it, it's fun
Because I doubt Brigadier has mutually exclusive options and stuff
Do it, it's fun
@ocean quartz I've been meaning to ask: Is it necessary to unregister commands when a plugin is disabled?
its good
Normally no, but people use Plugman and other stuff like that so kinda yeah
else you will end up with some other fatal issues kind of
plugman isn't good
nor is /reload
iirc it messes with the plugin class loaders
Plugman is horrible
Very
You should though
if you really want to dive into optimisations, hard code stuff and dont use designs like implicit else
but its not a good idea
Yeah it can also mess with hotswapping iirc, yugi had the problem
Brigadier
Kek
its superior
Was hoping it'd append an image link
its superior
@steel heart To what exactly?
I mean the cons is that they're kind of overusing generics unnecessarily
It's superior in command frameworks I'm aware of
Maybe one more superior exist
I will put Brigadier into the ground with my command framework 😎
... and other bedtime stories I tell myself to not curl up in a puddle of misery
BrigadierX
... and other bedtime stories I tell myself to not curl up in a puddle of misery
@empty flint :)) I feel ya
stop touching me
Doubt it, just because Brigadier is the only way to do this
looks hot, we have to admit
why would brigadier be the only way?
because is made by mojang
Because brigadier is made by mojang and it's the command system of minecraft
and also a pain in the ass
am I stupid or what are you refering to?
I thought you meant that only brigadier could parse that command you pasted
what's so special about the screenshot that you can't do any other way?
No, only Brigadier lets you have colors and placeholders
Doubt it, just because Brigadier is the only way to do this
@ocean quartz isnt that commodore?
Yeah
brb switching to brigadier so i can make the commads rgb too 
Commodore is a wrapper for brigadier though
i hope to add brigadier support to my framework one day once i stop being lazy
you know what this means
scrap all the framework progress I got done these past 15 minutes and start over
Thanks, notch Dinnerbone
I mean just make your new framework wrap brigadier's shitty logic
Like anything else I would assume
Also, isn't the source code of Brigadier open source?
Which means you should be able to set the colors and all that shit yourself as well?
It is?
It is?
@steel heart https://github.com/Mojang/brigadier
oh already been posted
We don't do Lisp here
@ocean quartz yes we do
Also
You can override the unaryPlus operator
Which is what I meant by +"message"
Incidentally probably the most idiomatic clojure way of doing it is just a map
Ugly
smh
@ocean quartz
Matt's colored gui command brigadier wrapper when?
How do you even set colors in brigadier?
@empty flint if you're taking about the colors displayed in the chat box, you don't
It's client sided
Well damn
The literals are gray and the required arguments are colored
why does every cool feature have to be client side
Blue yellow green pink gold, repeat
one day
But you'd need to inject your literal node into the nms dispatcher
Which is what commodore does
You can kinda add color to tab complete and stuff, but it's actually really dumb the way it works
So basically for code completion, I should use lucko's commodore and for the commands themselves I should use brigadier?
Commodore is just a wrapper for brigadier, it does both already
Interesting, it only mentions the completion on the github
why would he wrap brigadier tho?
Not really a wrapper, it just lets you inject the literal node into the dispatcher
If you want to build it at runtime, you still have to use the same brig classes and methods
Is there a good brigadier guide except that small README part of their github page?
Not really, there is only one class fully documented and it's a bit.. poor
I believe someone made a fork and added documentation to everything
Should be one of the many open pull requests
@ Niall
wow thats rude
well yes
Brigadier is a mess
holy crap
idk if it's worth it to use just to get fancy colors
it's all good but when i go back to the plugin and try place the sand it doesn't stack on the soul sand
hello, i'm checking a data from mysql database
playerJoinEvent()
if player pass:
can join to server
else:
kick the player
can player join to server because lag, mysql delay or something else?
or is there a better way to do that?
declaration: package: org.bukkit.event.player, class: AsyncPlayerPreLoginEvent
idk if it's worth it to use just to get fancy colors
@empty flint I mean if really all you want is the colors and don't care about brigadier as a command library, use the file thingy (the .commodore)
@pseudo owl the AsyncPlayerPreLoginEvent runs asynchronously ("in parallel"), so it won't lag the server if there is high latency between the server and the database
@remote goblet got some thing to say ? dont disrespect rust. that is what i inferred from your tone
I don't know much about rust so i dont really care honestly
I can say i don't like you however
Are you?
Doubt it, just because Brigadier is the only way to do this
surely with packets?
just no existing bukkit/spigot command api
I don't know much about rust so i dont really care honestly
A powerful language
Out does C in my opinion
just no existing bukkit/spigot command api
Paper has a draft API on command registration/sending that allows you to modify the nodes
But as I just said.. it's a draft API, it will probably change, a lot
Hi folks, you are use the CodeWithMe plugin from IntelliJ? is still EAP
but is pretty cool
@pseudo owl You should be caching your data
codwithme plugin seems pretty cool
idk how good it will be with like libs and stuff tho, since the intellij autocomplete doesnt work with classes from libs from my testing
What is codewithme ?
oh i got it
lol
Lol wheres the full article
Java 15 looks pretty good ngl
Is an array of pairs in Kotlin basically the same as a Map without any lookup functions? Like datastructurally I mean. The map has different methods of course but they do contain the same data, right?
@prisma wave is this an error due to the old and trusty type erasure?
because String.replace(Char, Char) and String.replace(String, String) do not clash
But if I use them in the Pair<> it doesn't like it
Yup 
How do I pass a vararg parameter on as the vararg parameter of another function?
spread operator
Does not work for some reason
Can you show me the snippet you are trying?
fun String.toCamelCase(
vararg wordDelimiters: Char = charArrayOf('_'),
delimiterMapping: Map<Char, String> = emptyMap()
): String = WordUtils.capitalizeFully(this, *wordDelimiters).modifyIf(delimiterMapping.isNotEmpty()) {
it.replace(*delimiterMapping.entries.map { (k, v) -> k.toString() to v }.toTypedArray())
}
fun String.toCamelCase(
vararg wordDelimiters: Char = charArrayOf('_'),
newDelimiter: String = ""
): String = toCamelCase(*wordDelimiters, mapOf(*wordDelimiters.map { it to newDelimiter }.toTypedArray()))
The second method tries to call the first
but the compiler says the signature doesn't match
but it recognizes the *wordDelimiters to be a CharArray
And I'm confused
Here's the error:
Is an array of pairs in Kotlin basically the same as a Map without any lookup functions? Like datastructurally I mean. The mapv has different methods of course but they do contain the same data, right?
@empty flint it's functionally equivalent to the entry set of a map (most operations are linear time)
@empty flint Your problem is that your first argument is a vararg
In that case you need to use named parameters
Otherwise reorder parameters to have vararg param as the last one
I never would have guessed that in a million years. Thank you!
toCamelCase(wordDelimiters = wordDelimiters, mapOf(*wordDelimiters.map { it to newDelimiter }.toTypedArray())) works
I don't wanna swap the parameters because then I'd have to specify the map or string parameters every time when the wordDelimiters parameter is used way more frequently
overloading maybe useful in this case
True, but unnecessary if I can get away with named parameters
@empty flint use toMap instead of mapOf(*)
Is there a difference?
if I wanna have a vararg constructor param do I need to like put val before it or something? That doesnt seem to work but like it doesnt let me access the vararg
or is that not how varargs work lol
isnt it "vararg x"?
I had vararg lore:String in the constructor but it doesnt let me access it in the methods in the class
*lore?
show the class snippet pls
that's mine lol
and not a class
( ik )
its as if it doesnt even existe
the x isn't part of the class if you don't specify val or var
vararg val
ah
]

Why are constructors so ugly :(
I really like them
in Kotlin
99% of the time you only need the primary constructor
Why are constructors so ugly :(
theyre not :>
ye but is annoying to have everything in one line
you dont have to
then put it in the next line lol
class Test(
val x:String,
val y:Int
){
}```
🤷♂️
hey its better than
public class Test{
private final String x;
private final Integer y;
public Test(@NotNull String x, @NotNull Integer y){
this.x = x;
this.y = y;
}
Facts
you did not specify var or val for first 3 params because is some kind of super constructor @empty flint ?
yeah the super constructor adds them to the class which means if I did specify val or var, it would hide the super properties
Weird
makes sense actually
How
but also I don't have to specify them if I did not want them added as properties. I could modify them in the init block or just directly as vals that aren't specified via the constructor
for example
this way, aliases isn't a part of the class directly (if it weren't for the Command() super) but firstAlias is
So you cant access name from inside BlockyCommand?
I can becase it's a property of Command
I see
I mean it's no different in java
you pass parameters and they aren't automatically part of the class
Yeah
only in Java you have to explicitly set them as member variables
in Kotlin you can do that via val and var
in the constructor signature
let's say I have a list of regex expressions, should I combine them all in one or create a Pattern object for each
need more context
What's the best GitHub license which does not allow for users to redistribute my software?
Wdym lol
like I say there's no such thing as a 'GitHub license'
You know what I mean though..
just compare a few like, MIT, Apache, GPL
and look which you like the most
Non-judgmental guidance on choosing a license for your open source project
if I already created my repository, how to I create a license file?
just make a file in your repo..?
Yes, but I need the contents of the file
lol
also github has a helper for it too https://github.com/ user/org / repo /community/license/new
This is great, my premium resource got leaked after two days of release
that sucks
yeah lol open source
need more context
@frigid badge a filter for console messages
just use one regex pattern
Does anybody know how to register a command alias in Brigadier?
You want to look at the CommandNode#redirect(CommandNode), tbh I never got it to work and I never really cared, just tested it one time so lol
@foggy pond did you expect open sourcing it to lessen the chance of leaks?
surely you understand how backwards that logic is
What's the best GitHub license which does not allow for users to redistribute my software?
also there’s no such license I’m aware of that does this, what you’re looking for is an nda.
When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation.
When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation.
@frigid badge That highly depends on the jurisdiction. There is no international standard for this. Each country has its own laws regarding copyright.
that's correct
The following list gives the current copyright situation in various countries, briefly describing which works are considered in the public domain in each country. This is useful for determining whether a work can be freely used in Wikipedia or not. Please see Wikipedia:Public ...
interesting list
not that bad
kotlin "user" then
What's the best way to create a singleton in Kotlin that takes a constructor argument? I'd use an object normally, but those can't have constructors
just do it the Java way then
What fucker ghost pinged me
not me
Should "static" constants in Kotlin also be ALL_UPPERCASE by convention?
Yes
Why does org.bukkit.permission have parents and children?
I think it works like groups, but I'm not too sure cause I've never actually used it
is creating a "my.permission" the same as creating a "my" permission and a "permission" permission and adding "my" as a parent to "permission"?
No, it's like grouping permissions
what are grouping permissions?
like this, I have all the normal perms, and the moderator one has all the others as children perms (to override their default values)
it literally just groups perms lol
oh so if you set a perm to true, all its children will be true by default as well unless overwritten?
Is that it?
no, it provides a different set of defaults for its children perms
see how the moderator perm has some values for the children ones that differ from their defaults
that's just what I said
or did I misunderstand?
So a permission has a permission value (t/f), a default value (t/f) and a parent value (t/f)?
I don't understand the need for children here.
Why do you declare children if you're gonna set them individually anyhow
oh hold on
that's the plugin.yml, so if you're using a perms plugin you can just use the moderator perm instead of redefining all the others one by one
no I still don't understand xD
So the betterjails.moderator permission overrules the permissions of its children for the holder of the betterjails.moderator?
yeah p much
my code was so good 3 years ago https://hasteb.in/ewovewus.js

Java 15 kinda interesting 🙂
keep away in what sense?
in james' america kotlin would not exist
Probably like "features so good people won't want to use something else" but kinda failed on that lol
MILLIONS
altho they forgot to include javas biggest competitor - elara
clearly these news reporters dont know what theyre talking about 🙄
Yugi is always silently watching
😂
What the fuck is this fucking shit ass unprofessional variable naming convention, Dinnerbone?!
Im pretty dead to do much more
Decompiled?
Who gonna tell him
Lol
congratulations 👏🥳🎉
Dinnerbone more like
more like Dinnerbone, not Dinnerbone
ǝuoqɹǝuuᴉp
lol
Use Code With Me on IJ ;p
😂
BM right now
tier 2
Level 10
Lmfaoooo
You start the development sprint full of energy, but the ancient curse of Java bogs you down and you realize you are in for a marathon.
“Is it safe?” the massive code base keeps asking you.
“Is it safe?” forcing you to check whether your variables are null.
“Is it safe?” the sadistic voice is relentless.
“It’s so safe you won’t believe it!” you utter, but you are not sure anymore.
how u manage that
can an abstract JavaPlugin guarantee that its onEnable will be called?
I don't think so but maybe there's a trick to do that
how u manage that
@onyx loom basically i wanted to see what was on it, so i got an nfc reader
it didnt read properly so like a dumbass i tried writing the text "k" to it
ofc that worked...
😂
massive brain
might try the same 🤔
be careful
nah if i corrupt it thats good 
is it
yes
are you sure
positive
what bot
So the frickin lib gets added as a dependency correctly, but the methods don't wanna get imported in the actual project
because fuck me that's why
the hell are you talking bout
the dependency is there
but the package name isn't resolving
and idk why or how to fix it
How do I clean a project and completely rebuild it?
@obtuse gale unfortunately didn't solve the problem
The jar is in my local maven repo
the implementation dependency declaration works
oh well
Block b = e.getClickedBlock();
TrapDoor trapDoor = (TrapDoor) b.getBlockData();
trapDoor.setPowered(!trapDoor.isPowered());
b.setBlockData(trapDoor);```
... its not powering the trapdoor
You need to get the block state and update it
@patent lark setBlockData(data, false)
The boolean is to apply or not physics (send block updates)
If you don't send any updates, it'll stay powdered because "it won't notice" it isn't really being powered
Why is it in a scheduled task in an event? Which event exactly?
Sometimes i build stuff twice because i have trust issues that intellij actually built the jar
Sameee
Hey guys, I was going to make an addon to SaberFactions by using their API and I was wondering what I should use as a dependency? I tried doing
name: MagicFacs
main: denzity.magicFactions.Main
author: Denzity
version: 0.01
depend: [SaberFactions]
commands:
test:
usage: /test
decription: Runs the test command.
And it didn't work, I also noticed that /help SaberFactions isn't a thing either, since its just /Factions. Should I change the dependency to just Factions?
Make a addon for placeholder API for plotsquared...
@obtuse gale
https://github.com/SavageLabs/SavageFactions/blob/2.0-Development/src/main/resources/plugin.yml
Plugin name is specified as Factions, use that
[PlaceholderAPI] plotsquared is attempting to register placeholders via a PlaceholderHook class which is no longer supported!
@remote goblet
thats what server console says
@prisma wave Could pdm be used to extract the core lib of my plugins into the plugin folder at runtime and use it as a dependency, or if it already exists, swap it with the latest version if necessary and use it if not necessary?
The thing is that I have a library that creates some singletons and I'd like all my plugins to use the same singleton instance. I shade my lib so every plugin has its own as needed but I just got the idea to not shade the lib and instead extract the latest lib version of all my plugins mutually and use that as the lib for all of them
I found a issue in PDM that IS complex to fix 😩
I was trying to fix for like 6hrs
I could get something, but, not enough
Oh PDM 😫
😭
🤣
mfw it's been like 3 months and relocation still hasn't been added 😐
😐
Well this is pretty sad 
https://www.youtube.com/watch?v=_73UBoDZDLo
Thanks for everything!
► Join Discord: https://discord.gg/brackeys
► Follow on Twitter: https://twitter.com/BrackeysTweet/
● Brackeys Forum: https://forum.brackeys.com/
● Dev Assets: https://devassets.com/
● Line of Code: https://lineofcode.io/
● Website: http://brackeys.com...
@old wyvern lemmo is wokring on 2 with us
Vue is great


code with me?
insert a semicolon 🥺
string interpolation
