#dev-general
1 messages · Page 214 of 1
Very fast
wpm?
I just make loads of typos when I type fast...
Between 75 and 80wpm
Inclined towards the lower bound :peeposad:
I think I get similar....
Just anytime theres an apostrophe or quotation marks is where I get messed up
Can I @Autowire a bean into a kotlin extension method parameter?
how would one make a predicate kinda thing in kotlin
is it just like a ()->(Boolean) kinda thing?
Can I @Autowire a bean into a kotlin extension method parameter?
@obtuse gale Not really as I think extension methods get compiled to a static method and that wont be spring-managed
I'd put the method in a service/factory class and autowire the dependency there, what does the method do?
it just sends a message in discord and then uses my event waiter, which is a bean
in b4 frosty makes a bean joke btw

thx
@distant sun Did you have any luck with Moodle? I'm thinking of finding out if it has an API so I can track added assignments, cause it's a bitch and I don't get sent any notifications
I havent used that shit since year 7 bruh
@hot hull kinda, I have used their sandbox to access the docs
Got any usefull links?
uh
search for moodle sandbox
that's for plugins
you have to use the mobile app api or smth
@obtuse gale 94 wpm if i'm tryharding
yeah that's kinda annoying
Not the right channel

god my college use moodle as a portal page 😂
:what:
No it can't be null
Why static
public static Map<UUID, Integer> stMap;
How about you don't ping
Why are you saving on getting?
a good ide should tell you
a hash map with weak keys
Which means what exactly
that the keys don't count as a reference for the garbage collector
I see
weak hash map also mean its a map which is old which is falling apart so when u go camping it will be useless
yes precisely
ty
how to add ternary operator to kotlin:
fun <T> ternary(bool: Boolean, a: T, b: T): T {
return if (bool) a else b
}```
close enough
xd


🥲 🥲

lol
It works btw xD
what about |
|
That's a | but italic |
o
extend Boolean {
let ? = (Any a) => Q(this, a)
}
struct Q {
Boolean condition
Any a
}
extend Q {
let : = (Any b) => if condition => a else => B
}```
borked font
A masterpiece
hey im trying to get this to work but for some reason
ShapedRecipe woodRecipe = new ShapedRecipe(new NamespacedKey(this,
plankMaterial.name().toLowerCase(Locale.ROOT) + "_grappling_hook_recipe"),
HookAPI.createGrapplingHook(woodUses)
)
.shape(" **", " &*", " ")
.setIngredient('*', plankMaterial)
.setIngredient('&', Material.FISHING_ROD);
getServer().addRecipe(woodRecipe);
}```
plankMaterial.name() prints the following
```[19:17:53 INFO]: grapplinghook:nks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:k_planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:_planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:lanks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe```
[22:20:25 INFO]: _PLANKS
[22:20:25 INFO]: PLANKS
[22:20:25 INFO]: K_PLANKS
[22:20:25 INFO]: PLANKS
[22:20:25 INFO]: PLANKS
[22:20:25 INFO]: LANKS
[22:20:25 INFO]: PLANKS```
@hot hull do I still have access to your advancement API?
nevermind, I'm blind
Which repo did you have a mental breakdown in the commit messages?
On mf-gui 
I'm trying to find it
I see his pr that got denied, but there's only like 3 commits there now
There were like 15 AMAZING commits
Fefo, dont stand in the way of me and Frosty's amazing commits!
I prohibit you
Does DeluxeChat check if a ChatEvent is cancelled before executing its chat modification stuff
probably
it seems that when i cancel the AsyncPlayerChatEvent, the msg doesnt display in console but does in player chat
Yeah that's normal
Oh
Is there a way to completely cancel it
Without hooking into api and setting the recipients
The non async event is fully cancellable, not the async one assume it’s fired async
wouldnt event handing using the sync one make it laggy though?
Less laggy
Is it a big difference?
Well kinda, it can, async means it's not in the main thread, meaning you can do all sorts of things without affecting the main part of the server, which results in no lag (or less)
If I’m just checking if a list contains a value (and if it does, send a message to the player from config.yml and cancel the event) would it produce lag?
Nah, not even if it was in the main thread, that's just small things
Oh ok
I've tried the PlayerChatEvent (nonasync) but it still displays the message in chat (i dont think globally though)
Pretty sure that event is deprecated
Always has been
is there a nondeprecated nonasync event
no
because it shouldn't be used
so i just have to hook into dc?
Why do you want it to be sync? It's just worse
uh, Conclure said that the sync event is fully cancellable
So is the async
Always has been
and that's actually true
https://jd.andross.fr/1.5/org/bukkit/event/player/PlayerChatEvent.html Bukkit 1.5 javadocs
that's as far back as I could find lmao
@errant geyser It's OS now
fun StringBuilder.build() = toString()```
y tho
Okay mr fancy pants
IT makes sense!!!
It does but still
the AsyncPlayerChatEvent is not always async though
that's literally just a guess
there's a method to check if it is though
Will this work or will it throw a concurrent modify exception or whatever thats called
things.forEach{ thing->
// Do stuff with thing
things.remove(thing)
}```
Indeed it will
so how should i do this
As in it'll throw an exception
Have another list/set for removal, iterate through that set remove from the first thing, clear the removal
Well yeah but it's nested to it can just get a bit confusing using it
You could use removeAll with a predicate
depends on what you actually wanted to perform in the forEach
thing.otherThings.forEach{
channel.retrieveMessageById(it).queue{msg->
msg.delete().queue()
}
}
then I want it to be removed from thing.otherThings
val remove = mutableSetOf<String>()
request.otherEmbedIds.forEach {
requestsChannel.retrieveMessageById(it).queue { msg ->
msg.delete().queue()
}
remove.add(it)
}
request.otherEmbedIds.removeAll(remove)``` That what ive gotta do?
probably
or just do removeIf as yugi said
Just a heads up elara doesn't have this problem 🙂
What NMS version does 1.16.4 run on?
I can't find it :/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
this isn't updated yet
1_16_R3
Thanks!
How is it possible, that my request for the developer role is denied when my profile is linked and I sent screenshots of the the repositories because I can't publish them for legal reasons?
Screenshots kinda don't mean it's yours
Hey folks, my friend needs a simple database. He has structured data, but without many relations (maybe a table with products and the usual fields ID, name, description etc. and another for categories, that's pretty much it)
However he's gonna have plenty of rows in it. (100k+)
Does it make sense to go with a NoSQL database like mongo or couchbase in this case?
I suppose it doesn't make a noticeable difference in his case, but what would be the * proper * way to do it?
fun StringBuilder.build() = toString()```
@obtuse gale
I'm about to blow your mind
val text = buildString {
append("something")
append("something else")
}
No build, no toString needed
@quaint isle That'd be just preference, with 100k values it wouldn't be that much of a difference between them
There isn't a proper way to do it
a sql database is perfectly fine
@ocean quartz Thanks for answering. Let's say the table was expected to get much much bigger over time, would I go with a NoSQL database then?
depends entirely on what type of queries you are going to make
and what is much bigger
and in what timespan
how frequently will it be used
and how often will different queries be used
Still would be preference, SQL would be fine with even much more than that
there's a lot to be considered for a database.
depends entirely on what type of queries you are going to make
@frigid badge Yeah I know it's hard to answer with the limited information I gave. Pretty much just selecting single products or a handful of products with their category and category description and being able to handle as many queries / second with given ressources.
with such a simple database you can easily hold tens of millions of rows
and handling as many queries a second also ties a lot into your code and using other extra tools such as redis
Sure, but theoretically, would a NoSQL db like couch be able to handle more in an ideal world?
I feel like you want to use NoSql but need someone to tell you to
if you want to use it go ahead, even if it's just for learning or whatever
personally I'd just go for a simple sql database
I'm actually a huge fan of MySQL, just tryna find out if there are good reasons to use NoSQL instead. I really feel like I don't really know what to use unless it's crystal clear from the data I want to store.
and I'm thinking you are estimating this too big
Why would you go with a simple sql db? Just because you know it better?
because it's just products and a category
with no complex queries
if you set that up correctly you can easily hold tens of millions of rows
which I doubt you'll hit anyway
It'd be a micro optimization difference with that size
what will this database even be used for?
But wouldn't eg. MongoDB be easier to set up and come with similar performance? I mean, you could just throw all the data in there and wouldnt really have to think about schema etc.?
honestly, I'd never used mongodb for any project lol
what will this database even be used for?
@frigid badge Probably just simple querying from a Unity Android App if I got my friend correctly
yeah Mongo kinda is a mess 😄
I stick with sql databases unless my rows compared to query complexity gets huge I use graph databases
Never use mongo either but I can't see it being much easier to set up than mysql
Alright, big thanks to you both 🥰
Lol
Am I stupid or why doesn't annotating an abstract class with EventHandler work when I register the implementing subclass?
Like, I have an abstract listener class and it implements the onEvent method, but it doesn't seem to work
Because
Yes:
helpful as ever I see ^^
he gave u the answer?
is my discord bugged then?
guess my discord is bugged
hm try that
updating good
hm i see other people on reddit have had this problem too lmao. they fixed it by:
try that
lol
.
can u see this? i just copy and pasted the tips in a new message.....
works for me ..
yall got some buggy discords
?
Yo I think you guys need to downgrade bcz last version of discord broke this. I'm not on latest
Lemme go assualt talk to bug hunters discord lol
lol imagine ឵឵
What are you trying to send? Is it a link?
but its a funny joke
killing the train 🙂
welp unfortunately this train ain't a cat therefor it doesn't have 9 lives therefor its ded forever.
🙂
How to set up in DeluxeTags so that players can buy tags?
I can't get the discord thingy to work
could somebody take a screenshot and paste it here who can read the messages?
?
Because
@static zealot
Oh no.
alright
I'm sorry for that Blocky. Didn't expect the joke to hold that much.
ask your question again bcz it probably got lost.
it didn't, I literally just spent 3 minutes on this
I mean you got me so 11/10 buddy
🙂
Is it possible to extend an annotation class and add the @Inherited annotation for it?
sorry not extend
You shouldn’t be working with inheritance when it comes to annotations
what is that thingy called again
What are you trying to do?
You shouldn’t be working with inheritance when it comes to annotations
@steel heart I want to
Why?
I have an abstract event listener class
and I want to annotate the method with @EventHandler
the abstract method that is
Ok do it?
But if you’re rather handling them than listening them, consider implementing an EventExecutor or something instead
Doesn't work. When I register the subclass that implements the abstract listener, it doesn't get registered
I'm just listening to them
for logging purposes
because they have a bunch of common methods
don't worry about it making sense
I have a listener class that does almost exactly the same thing for each event I am listening to
So?
I don't want to define the onEvent method in every subclass
Use an EventExecutor instead
I want to define it once, have it call an abstract method that is implemented by each subclass
The annotations are used for directly notate a method for being able to handle events
exactly
but I can't register it via a subclass
which is why I want the method annotation, which is @EventHandler, to be inherited
It’s not made that way
and for that I would like to define an extension function type of thingy
which is why I asked the question in the first place
Dude annotations isn’t made for inheritance, polymorphism or anything
It’s stupid also
Use an EventExecutor
Don’t make it an xy problem
Java annotations are not inherited unless the annotation type has the @Inherited meta-annotation on it: https://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html.
there's no reason not to use it if it exists

Anyways EventHandler doesn’t have inheritance
So please listen instead of ignoring what I’m saying
You didn't read my question dude, I know it doesn't work, I know it doesn't have it, that's not the question
I don't wanna use an alternative, I wanna know if there is any way to add an annotation to an annotation using a kotlin extension function or some similar construct.
No annotations doesn’t work with inheritance (extending)
well it does if it has the @Inherited annotation
so that's what I am trying to modify
You can’t do that, use an EventExecutor if you want to achieve polymorphism or inheritance
No you cannot extend an annotation by an annotation
Jesus
Yes you can use Inherited to add inheritance of it but not extend an annotation
this is dumb
in Java you can extend an annotation
don't understand why they did not allow that in Kotlin
Why are you extending an annotation?
👏
So I can declare it as inherited xD
so I don't have to repeat code
but Kotlin stoopid
I guess i can just write a java annotation for it then
whatever
Use an EventExecutor, it’s literally the same thing but gives you more control so you don’t have to use annotations

Achieve inheritance/ polymorphism with event handling
Achieve inheritance/ polymorphism with event handling
@steel heart Right, but it's not the same thing. This isn't about the events per se, I wanted to see if it was possible another way, one that can be generalized in case I need this again. I understand you want me to use the EventExecutor but this isn't what the problem is about
I wanna learn to solve such a problem, not circumvent it entirely
The solution isn’t by trying to do stuff that shouldn’t be done and isn’t possible
Generally if something isn't possible in a well-defined language such as java, it's probably for a reason
You can use @Inherited to inherit the annotation for a method and it’s potential overrides
What is not possible in Kotlin? got the conversation mid way and too lazy to read
Annotations
Extend an annotation
You can use @Inherited to inherit the annotation for a method and it’s potential overrides
@steel heart The JavaDocs for @Inherited say the annotation has to apply to the other annotation you want to be inherited. So I'd have to either modify the @EventHandler annotation or extend it
extending it is possible in Java
but not in Kotlin
Or did I miss something in the JavaDocs?
I fail to see the issue in using the EventExecuter class or whatever it is though
Huh apparently that was reported to Kotlin but yeah it's not a thing yet
yyep
Okay let me go on pc and see if I can extend an annotation by another one
This is gonna be interesting
I fail to see the issue in using the EventExecuter class or whatever it is though
@umbral mica Never used it, dunno how to use it yet and too lazy to look it up because it's a specific solution that exists for this specific problem. I wanted a general solution for extending the annotation. That's all there is to this unnecessarily long discussion, really
Okay let me go on pc and see if I can extend an annotation by another one
@steel heart https://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html
@empty flint https://i.imgur.com/y4w1uK6.png
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyInheritedAnnotation {
}
Oh nvm
this is valid java code
That is not extending
That means it will be automatically inherited when added on a method iirc
No that's just an example of the Inherited annotation
yes
that's what I want
Right?
If you want to do it use mixins or something
I want the @EventHandler annotation to be inherited when I add it on a method in an abstract class
why is it stupid?
If you want to do it use mixins or something
@steel heart How would that work using mixins?
Because annotations isn’t made for that sort of stuff originally
idk how to inject the annotation
So this doesn't work?
Or not even that perhaps
Because annotations isn’t made for that sort of stuff originally
@steel heart I don't care if it's made for making strawberry cake. if there is a legit way to use it that way you bet your sweet ass I will use it that way
It’s not
So this doesn't work?
@ocean quartz This works perfectly fine, I would just need the "MyAnnotation" class to extend the @EventHandler annotation
That would never work
and that doesn't seem to work in pure Kotlin
Since how annotations are readed
@DoggoEqualsGoodI don't care if it's made for making strawberry cake. if there is a legit way to use it that way you bet your sweet ass I will use it that way
😐
Annotations isn’t compiled down to how other stuff is such as objects etc iirc
Why does it matter if it's intended that way or not?!
Oh okay, yeah i guess gotta wait for it to be implemented
Well, Blocky if you want to be able to extend annotations by annotations you’re basically inventing multidimensional oop
Using Inherited is very rare
But I assume it might be beneficial with annotationProcessing maybe?
Well, Blocky if you want to be able to extend annotations by annotations you’re basically inventing multidimensional oop
@steel heart I am not inventing anything. It's possible in pure Java without any tricks. I don't know why you are accusing me of being the antichrist in terms of annotation abuse.
Java allows you to extend annotations
with other annotations
You can’t extend annotations by them, you can apply inheritance. It’s not possible to extend annotation as I’ve mentioned
No I legit showed you that I got a compiler error from that
Here again
hold on let me find the so post I had found earlier
You can inherit them but not extend for the 101th time
alright fuck it
EventExecutor it is
stoopid ass Kotlin
it's too late to be freaky with experimental shit
Oh yeah Java doesn't support it either
Yeah I can't find the post again that said it was possible
idk
maybe it was wrong as well
Mart: See my above ss lol
Also one reason not to use Inherited is because it messes up the inheritance of the Type declaration
Oh yeah mb xD
Well you can implement them weirdly enough
dafuq lol
Implement how?
I could annotate the annotation?
Yeah
Oh hmm, would that work?
I mean changing to extends will get back to the other error
class X implement Annot
hmmm
Oh that's so weird, though you can't use it as Annotation
Yeah it’s used for stuff like configuration with files and I assume guice maybe spring as well
Fuck it, I'm too tired to figure this out
So EventExecutor is just an interface like Listener, right?
Yeah I have an example if you need
And I can register it the same way I would a listener? With the registry?
Sure I'd love examples
You either check the event type with classes or by instanceof
oof that's dirty though
I don't like that at all
Because my abstract listener class is basically listening to every single event type
of which there are ~240
so no instanceof
There is another way
With generics
So what do you have currently?
But basically check the type with using Classes
If you use generics right, type erasure shouldn’t affect you
abstract class ToggleableEventListener<in E : Event>(
...
) : Toggleable, Listener, EventExecutor, Nameable
{
override fun execute(listener: Listener, event: E) {
// this does not work :/
}
}
Is that the class that is going to listen to all events?
well no, it's the superclass of each individual event's listener
what I need to do is basically this:
override fun execute(listener: Listener, event: E) {
doSomethingSpecificWithE(event)
doSomethingGenericWithEvent(event)
}
where doSomethingSpecificWithE(event : E) is an abstract fun that is implemented by each subclass
the rest is all in the abstract class
JDA?
Ok nvm
Well to begin with it will be hacky if you would do it simply by method overriding
As mitten can tell you, hacky is my middle name
He complains all the time that I want to do hacky shit
Basically what I mean is you might have to make a method for every event with on<Event>(Event e) or smtng
then in the execute method make it better
Or like
Checking
I mean yeah, that's not a problem
that's what I am doing anyhow already
I just want to avoid having to declare the annotation in every subclass
that is all
Alternatively make a single method and let each impeachment check what event
Or you can reinvent the annotation thing with inherited
Or have a functional interface for a single method and take advantage of generics
Alternatively make a single method and let each impeachment check what event
@steel heart I think that's a bad idea because then the executor gets called to check if the event is the right one, which is really bad with so many events and one executor per event
Ye
Or have a functional interface for a single method and take advantage of generics
@steel heart That's what I am trying to do basically
The problem with EventExecutor is that I can't use generics in the execute... method
I don't think that will work
Hmm I mean that is one way or maybe have an interface defining all methods for each event, then use reflection to determine which methods are overriden and then only execute those
That works fine
But you have to include a way to get the Class<Event> as well
I'd rather use reflection to change the target of EventHandler and implement it for my own inherited annotation tbh
easier than to fuck around with generics
Yeah you’d maybe have to come up with your own annotation
I mean that's easy enough, right?
yeah no idea how reflection to change the Target works
Target?
That’s the rules of where the annotation should be applicable
No we skip the @EventHandler totally
Create your own @EventListener or smtng
I think I need to sleep on this a bit
Yeah need to sleep as well, but tag me tmrw if you need anything ig
gn
im having a lot of fun
only 507
Delete the project ez fix
Frosty had a typo 
poor frosty
Changed it back
how does spring handle something like this
data class A(
@OneToMany
val things = mutableSetOf<B>()
)
data class B(
@ManyToOne
val b:A
)
// At some point in code add an instance of B to `things`
//Delete instance of b from db```
My brain
mine too
Can somebody help me with gradle/groovy?
Can't get IntelliJ to import shit properly
For no fucking reason all of a sudden
@empty flint in intellij you can go to file > settings (alt + f, t) then in plugins there's a 'minecraft development' plugin, and that does everything for you hehe - if thats easier
thats what i do at least
I don't like that plugin though
why
I don't remember what it was exactly but it started making problems
the thing is, if I open the module as a project, it works
but if I open its parent project it won't build the gradle script
throwback to good ol' days
🤢
You cant tell me you didnt use it back in the day lol
He wasn't alive back in the day

data class A(
@OneToMany
val things = mutableSetOf<B>()
)
data class B(
@ManyToOne
val b:A
)
// At some point in code add an instance of B to `things`
//Delete instance of b from db```
@obtuse gale No, you don't really add to the "things" instead you would create an instance of "B" and "setA" to the instance and save it.
Not:
B.getCollection().add(new A());
Yes:
A a = new A();
a.setB(b);
aRepository.save(a);
is there a way one could reduce the speed of which fire charges are launched from dispensers?
Check if there's an event which get's fired when that happens
Is IntelliJ ultimate better than community edition
I have the chance to use ultimate because I'm a student at university (for free)
If you're dealing with DBs yes
I am lol
Community is all you really need
But yeah ultimate has a bunch other great features that community doesn't have, like for example the databases, duplication detection, and a few other things that i can't remember from the top of my head
I will have a whole module related to DBs in university
I mean it should be free for me anyway so 😂
*kek, I know this is JS and JS is bad... but, might someone know what is going on here:
message = "blah @mack asdasd @mack"
newMSG = message.split("@mack").join("mack")
console.log(newMSG)
For some reason, String#Split isn't removing the separator from the created array.
wait your output is blah mack @mack mack asdasd mack @mack mack ?
The output of that message in Java at least would be blah mack asdasd mack
ye that's what it should be in javascript as well
are you sure you get @mack back and not mack? bcz what you do is basically remove @s
Is that repl
nope
Good
xD
but why .split().join() when you can just do .replace("@mack", "macl")
replaceAll
oh ye.
NoT a FuNcTiOn
eh
oh welp i thought a function and a method was the same
not even replace() ?
what enjine Mackenzie? bcz I think with js it matters what enjine you use or something. idk that much js xD
use regex with global flag then
huh works for me
@ is no special char in regex tho
I know...
How would you substitute a string type variable in that replace function?
construct a RegExp with your string variable?
That is what I did when I tried
and?
Didn't work
do you just want to remove the preceding @ ?
Correct
message.replace(/@(?=\S)/g, '')
I assume this would be fine?
The code you sent previously (white background) didn't work for me, which is odd
The console log is:
Mentioned user's nickname/username
final message
can I see the exact snippet from your code?
It's a mess 😛
Well it's JS it's always a mess xD
xD
xD
shoulda used clojurescript
Anyone else that used mixins before?
I kinda did, just changing some default models
This fucking shit drives me crazy
.replace("@", "")
implements MyCoolMixin1, MyCoolMixin2, MyCoolMixin3, MixinsRFun
Fuk u
Map.class.isAssignableFrom(type) == true
type.isAssignableFrom(Map.class) == false

Shows how i am dumb 
That method is really confusing and always been
Anyone wants to be my brain? I have been hitting my head for almost a week now
ugh. no.

you'll be hitting your head even more.
suffering from success. when u dont know the answer and everyone else is too dumb to know 🙂
Basically this is my problem:
I have to give in a class or an object (still don't know if i can do it just with class)
And with that i have to map the entire class
For example:
The issue is, i need to keep the data for when reading because the key sometimes won't be the same as the field name later
But if one of the values is null, it'll kinda break .-.
Maybe i need to do it with just the class type 
ye sure. go for it. :))))
K, V
or maybe: ||KW|| ?
elara will feature NO type erasure
Fuck it's not possible i guess cuz of stupid type erasure
yeah good luck getting past that
I remember getting the type of a list before though, i just don't remember how
@hot hull I did it and its optimised. (no more task creation every time you mine the block)
Ooo this is what i did
😬
😕
Kotlin can keep types right?
Sad
Type Erasure Sucks (TM)
using this code how would i make it so it only outputs/runs every second? https://pastebin.com/aPjW9Psj
Which channel do I use to post and get help with a command I've written that is not working as I hoped?
Thank you
tfw BlockExplodeEvent doesn't work 
Rip
You're just a 4head
What u exploding?
Cause you probably want EntityExplodeEvent or whatever it's called
Yes, it's EntityExplodeEvent lol
ah yes
What u trynna do?
you make the assumption i know what radians are
util package
It supports all versions cause no reason it shouldn't, and I'm gonna be using it on 1.8 so suck a phat one 
because we shouldn't encourage 1.8 usage 
yeye I know
Why varargs for Animation constructor?
Because you can have multiple poses within that animation, ie:
new Animation(
"RIGHT_ARM", 0, 0, 0,
"LEFT_ARM", 0, 0, 0
)
why not var args of whatever these 4 args are?
wut
like
new Animation(new Position("RIGHT_ARM", 0, 0, 0), new Position("LEFT_ARM", 0, 0, 0));
(AnimationFrame frames...)
All animations will be internal so why not use the AnimationSomething enum instead of a string and integers instead of objects
Nah you are dumb as usual
tnks bb
Btw dont exclude gradle wrapper, you need it to build the project
https://i.gyazo.com/27e04fbeb8074bf0c05a8abe0aa5ddc7.gif i keep getting bored
weak
shut up
agreed, slot numbers need more prettiness
do it
When my isp decides to not having our internet shutdown

Sorry sir but we really cannot have you streaming "Buss Down" by "Aitch" 24/7, you are using all the bandwidth
What's the easiest way to get a player object from UUID?
Bukkit.getPlayer(uuid)
fun Player.of(uuid: UUID): Player {
return Bukkit.getPlayer(uuid);
}```
..add um, how can I get the UUID from a string type UUID?
UUID.fromString
What if the player is offline?
Bukkit.getOfflinePlayer
use OfflinePlayer instead
Gotcha
When you call it on the main thread 
fun Player.of(uuid: UUID): Player {
return Bukkit.getPlayer(uuid);
}```
@heady birch that won't work
@prisma wave im working on my own coding language that's better than elara
impossible
😬
lmao
believe me
can someone make a language where
that was cancer to type
you can really translate something like
only
player.fly
and thats it
without if else switch
Kotlin
fly!(player)
kek
Poor data entry guy "Huh wierd company name... meh... hey my system stopped working... must call IT"
🥶
stock images of code
If chat is handled async, is sending messages async?
Idk. I think packets are "queued"
Hmmm
Player placer = Bukkit.getPlayer(UUID.fromString(hopperOwner));
if(placer == null) {
OfflinePlayer placer2 = Bukkit.getOfflinePlayer(UUID.fromString(hopperOwner));
placer = placer2.getPlayer();
}
Am I doing something wrong, placer is returning null for some reason.
Why get the player twice, use offline player and then check if he's online, if he is, cast to online player
ok
Wait no don't cast, use getPlayer
Is it worth caching a load of Color objects?
Please don’t do it on the main thread
Me? 🤨 Only inserting into a hashmap to cache. Then a quick hashmap check. Custom hashCode() implementation
OfflinePlayer placer = Bukkit.getOfflinePlayer(UUID.fromString(hopperOwner));
if(placer.isOnline()) {
placer = Bukkit.getPlayer(UUID.fromString(hopperOwner));
}
like so @hot hull?
Before I answer that, what's the point of this
A crop hopper plugin, needing to get the player from a UUID string type to then check their permissions
Is the player going to be online or offline
Use offline player then, and hook into lp to check the perms, since I don't believe you can check perms for an offline player
D:
probably a better idea yea
With vault it'll work with all perm plugins
Permissions#playerHas(Bukkit.getWorld("world").getName(), player, permission);
Oh, I thought yous were talking about the offline player part
CompletableFuture.supplyAsync(() -> {
return Bukkit.getOfflinePlayer("Notch");
}).thenAccept(player -> {
Bukkit.getScheduler().runTask(plugin, () -> {
player.doSomething();
{
} or smtng like that
ew
I mean completable futures is eww
Just execute on main thread, ez claps
Uh well I mean Doggo is equal to good right?
Doggo equal to good only if it's Conclure's doggo
Facts
fax
Fefo pog
This the pog gang or what
Running in the 90s
So for some reason I have /** created by <user> at <date>**/ annotations on like 15% of my classes do I just remove them
I use those sometimes
if ur not doing it consistently i dont see the point
yeah majority of classes were made before i enabled it
It's a good identifier so you know which date you made stupid decisions on
Kite board isnt so enterprise to be honest. Unless your definition of enterprise is "RAM eating" 🙂
OS it.
GIVE ME kiteBoArD
What do you use for these annotations @heady birch
Bruh I can’t edit my message my phone legit autocorrected fkn shit
Bro let me comment on there
Ye
Give me profile link
I was in a call with him 2 weeks a ago
Oof
Idk what to say tbh
It really does suck to have someone who was very active in the community to pass away
Tru
yea
It’s all really sad but that’s for every person who dies.
Mhmm
🙃
What would be the best way to have an Event map to a Function that does not cost too many resources to resolve? Is there a way to have like an inline when or something?
Basically, I want a method that parses the type of event and depending on the event class, different things are supposed to happen, but I don't want the parsing to take too long and I want to avoid a when() with 240 is ... -> statements
returns - returns
@empty flint hash table?
Is there a difference between if(whatever.equals(null) {....} and if(whatever == null) {...}?
equals would be an object check iirc, which would always be false right? It'd also throw an NPE if you tried to invoke .equals on a null object
Someone correct me if I'm wrong ^
I always use ==
Aight
Same
@lavish notch if a class doesn’t override the #equals it’s by default going to be a == comparison which means you could just use == directly. .equals is often used for stuff like locations, vectors where the values of 2 different instances may be the same
k
Conclure, wouldn't it throw an NPE since you try to invoke a method on a null object tho?
Or am I getting this wrong
¯_(ツ)_/¯
Ye that’s correct
So.... I'm making a commit where I changed a .equals(null) to == null. What should I put for the commit message/note?
Meaning it'd be unsafe to use that
It’s literally
public boolean equals(Object obj) {
return obj == this;
}
Yes, but still invoking a method 🤷♂️
exactly
yeah you can't* do equals null
So.... I'm making a commit where I changed a
.equals(null)to== null. What should I put for the commit message/note?
@lavish notch "Changed null check to prevent potential NPE"

Cheers
why do people spend the time
to write commit messages
lol
I just feel the need that im too lazy to say what i coded because I don't want to overexplain it xD
just summarize
it's very important if you need to go back and see what change caused a bug or something
or with any public project
Lol
Want to format RGB integer... into §x§F§F§F§F§F§F
Yeah just make it base thing and then convert
Or there is probably a method for it otherwise
ChatColor.of("#rrggbb")?
String.format("something", 16777215) -> "§x§F§F§F§F§F§F"
oic
to char array -> format?
&#(.)(.)(.)(.)(.)(.)
&#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])
How much slower would the bottom pattern be?
Ah cool, any way to shorten that? Whislt keeping the capture groups?
I mean for that second Regex you could just \\w wouldn't you?
Regex be like:
{<}%}€}||0939—9384018-82847:kr>#7)>]&0€7<^}}}}}}}}}}}}}}}$+{*{$}}
Are tests meant to go in a package lol? At the moment mine are at the root
/test/java/<here>
That’s fine
Regex be like german bruh
Lol true
hehe
I think the tests should usually match the package of the class they're testing
Don't suppose theres a faster/shorter way of doing this:
final String text = String text = Integer.toHexString(awtColor.getRGB());
return "§x" +
"§" + text.charAt(0) +
"§" + text.charAt(1) +
"§" + text.charAt(2) +
"§" + text.charAt(3) +
"§" + text.charAt(4) +
"§" + text.charAt(5);```
You could cache the char array but and also StringBuilder is much cleaner in my opinion
Might even cache the string altogether
isn't presizing a stringbuilder faster?
also idk if this is applicable to java, but when I was working on elara it was a lot faster to use char arrays (rune slices in go terms) rather than strings wherever possible and then convert on-demand
im sure rust has a zero cost abstraction for strings 🙂
Using this "§x" internally instead of my old format will use like twice the ram
§x§F§F§F§F§F§F
vs
&#FFFFFF
neglible?
Most likely
Not sure if you got lists/gradients of a 100 frames animated or whatever
Enterprised software, not neglible!!
Only doing it because using my format it didn't parse the colours coming from papi placeholders e.g
- This might be marginally faster
if text[0] == '§' {
use long format
}
else {
use short format
}
``` 🙂
ew is that an else
absolutely not
bring back the else thanks
how dare you
😎
[kotlin:master] 1 new commit
merge from remote https://github.com/clojure/clojure
final float a = (100f / b) * c;
return (a / 100f);
Is that 100f redundent somehow if I rearrage it or whatever
yes
because a = 100fc / b and you divide by 100f
although the compiler is probably smart enough to optimize that
FINE we will see, we will let the unit TESTS determine the RESULTS.
kotlin 1.0
I am pleased to share that the function passed all the Junit tests.
i am definitely talking about it !
You know, ask people at JUnit.. they know, they are all talking about it. I have a very good friend at JUnit, an experienced professional, he will tell you, you know
so proud 😊
Very
Hm aparently you can't listen to all events, you have to specify which events you want to listen to specifically
which is dumb
why would you listen to all events the first place though
No cuz HandlerList makes it only possible through events that has one with Listener and the @EventHandler
I’ve told you several times to use EventExecutor if you want to do something which isn’t only listening such as handling etc
I heard java 16/17 will have a memory api or smtng
Discount pointers, will be very interesting

