#dev-general
1 messages ยท Page 192 of 1
@hot hull using u as an example for this question, how does one get unlimited config options? like in FJ unlimited formats. idk how else to explain it
ImmutableMap.builder() or ImmutableMap.copyOf() iirc
@onyx loom iteration over configurationsection provbly
:bruh:
I'm flattered
lmfao
but yea, you legit just loop over your config section
Does Configuration implements Iterable?
uh
ConfogurationSection I mean
entryset does
Yeah
wtf

Lol
no u
this photo was uploaded to sars
Package by feature vs layer
no need to worry about "organisation"
package by feature better
The service layer is coming back
rip to your services but lemmo is different
Can you just delete a commit
git push --force
Whats difference between revert commit and undo commit
Anyone else gets irritated with how common wondering trader is? Testing plugins and every few minutes a new one spawns to make noises
Yes ikr
I was in a vanilla world and it spawned surprisingly common
Jesus autocorrect
It's way too common, had to make my trusty knife
its common if you're the only one on the server.
Matt, /gamerule doMobSpawning false 
I want mobs though
/yeet wandering trader
So trying to add a PAPI expansion to the e-cloud
And it says the dependency URL is too long
So what am I supposed to do
Lol
wait wdym
@heady birch fix this
My premium resource got released earlier than I thought it would be released and I did not submit the PAPI expansion yet
And I can't submit it because of that ugh
is this for ur resource?
Yes it is
just put the expansion inside the plugin 
I'd rather have it be a downloadable expansion
Lol
This is so stressful, I am flying the United Kingdom in 3 days to start university and I have no time where I am sitting at my computer where I can work on this
University of Sussex
Cool
I don't want to disappoint those who were looking forward to the premium resource but I don't have the time to fix what should be fixed (The PAPI expansion)
Yeah
oS tHe BiSh
It's already OS
Ugh I need to upload the PAPI expansion, but I can't cause that stupid url character limit
Lol. If ecloud team stuck with thymeleaf it would have been out like 2 months ago
What should I do then? I have to go soon as I am meeting up with family, should I use some link shortening service?
@heady birch difference between reverting a commit and undoing a commit is that when you revert a commit, you basically make a new commit that undoes the changes of the reverted commit, whereas when you undo a commit, you basically force the history to erase any trace that the commit you undid was ever there
Welp submitted it i guess
will ECloud 2 be released at around the same time as PAPI 3?
Papi 3 is waiting on ecloud I believe
ah okay
why tf isn't it in Thymeleaf/Spring any more btw?
or is it still in that
Spring = good
it is Spring+Crnk + Vue
Crnk?
what dis
I am continuing thymeleaf anyways
seems like a Java library, nice and overly verbose
I have old pictures of ecloud 2
I wish I could see ECloud 2's development, but I'm not one of the trusted souls
looks good
it doesnt exist anymore
why not?
Vue ๐
what did you originally use?
Thymeleaf ๐
wait... you can avoid having to write any shitty JS with a template engine????
raditional web
I'd do anything to not have to use JS lol
also who gives a fuck about the whole "single page no loading" bull shit?
in fact, I find the single page worse, because then it means I can't move backwards and forwards by pressing the arrows
That is actually a good point
They are the single cause of that stupid back button taking you back to google
And not back to the last "page"
yeah
it's annoying as hell
like I don't get the point of not having to load a new page
I mean so fucking what if you have to load a new page? if you actually have a decent browser, that won't even take long
and like 99% of websites don't do the single page thingy anyway
these people who like the single page thingy really baffle me
I guess
Guys can someone help me a second I think my paypal link does not work
yeah separating frontend and backend is a good idea
but not if it means you have to use ๐คฎ JS ๐คฎ
The one where they will send money in
that's an oof
What link should I put?
I have no idea god
https://paypal.me/<name>?
That allows for anyone to put whatever amount they want though
What should I put instead?
does Spigot not allow you to set up payment methods?
It asks for the paypal account
like what I mean is Spigot should just take you to a page to pay to your e-mail
sign in with your PayPal account then
Someone clicking on my buy button just says this error
that's an oof
Yes okay but what should I do
I have to go soon and I really need to fix it otherwise if anyone is interested it's a yikes
I'd contact Spigot about it, since I doubt anyone here knows anything
if you want a fast response, DM one of the mods via Discord
I mean anyone else who has uploaded a premium resource would know
It's my paypal email address
That's what it is ugh
there's quite a few people here who'll know that then, definitely not me though
@jovial warren how on earth is that verbose
how on earth isn't it?
@JsonApiId
@JsonApiResource
@JsonApiRelation
idk what's wrong with @Resource, @Id and @Relation but eh
Ambiguous with other frameworks
^
You'd import the wrong thing all the time
It's also more clear as to what's actually happening
Kotlin could've used @Default, @Overloads, etc but they prefixed with Jvm for clarity
At the same time, clojure could've added annotations but they chose not to because they make no sense
Actually at least 3 people do
I'm not a weirdo :'(
annotations are a bit of a double edged sword
they can save a lot of time but if you base everything off annotations it becomes messy and difficult to learn
Join the Kotlin 1.4 Online Event and meet the team! ๐
Four days of diving deep into the technologies behind Kotlinโs latest release, with plenty of opportunities for discussion with the team in Q&A sessions and 1-to-1 booths.
More details: https://t.co/8moPOlmsXI https://t....
217
Noice
@old wyvern make it happen pls
why dont u
๐
it pays quite well but not much free time you know?
Host the event on BM's living room
I might be brainfarting here, but is there a way to have interfaces with non-static variables?
java?
Kotlin
bbq?
they're not static in kotlin?
wait they aren't?
no
interface Ageable {
val age: Int //very much not static
}```
btw have you heard about clojure
it doesn't have static either
Pls dont
๐
Doesnt kt have that companion thing?
Can you have static methods as well?
technically isn't static at all because there is no static in Kotlin
but companion objects behave similar
to the point where for 99% of cases you can call it 'java static equivalent'
they function identically to static but they aren't static
they function identically to static but they aren't static
@prisma wave well almost
class A {
companion object {
fun blah() {
println("A")
}
}
}
A.blah()
``` compiles down to roughly ```java
public final class A {
public static final class Companion {
public final void blah() {
System.out.println("A");
}
}
}```
and then any calls just compile to `A.Companion.blah()`
ez
give xp
wait
haha I typed the same kind of example and then thought "nobody gives a fuck" and just stopped and deleted it
Didn't think of the xp
Barry cares
do companion functions convert to static methods?
neither do java's
hm should I make the interface an abstract class then?
I'm so confused, ever since switching to Kotlin I seem to have forgotten all about Software Architecture ๐ฆ
interface Toggleable
{
var state: Boolean
fun toggle() { state = !state }
fun turnOn() { state = true }
fun turnOff() { state = false }
}
This should, conceptually, be an interface. It describes behavior and shouldn't be a class.
That should probably be an abstract class
^
How so?
Interfaces usually don't implement their own behavior
^^ an interface arguably shouldn't have any functionality
That's true
Just because it can doesn't mean it should
except functional interfaces I guess
the interface itself doesn't carry any functionality
hold on, does kotlin also have the restriction of having only one parent class?
c++ master race
๐
haha
I give it a c+ at best
c--
No ur right, I hate c++, never understood the 1-parent-class restriction necessity though
Rust is better
leads to messy code
I think it was a good decision
it also raises a lot of questions about implementation
how would you call 2 superclass constructors?
@distant sun if you actually care this is what it compiles to https://imgur.com/a/GgXMguJ
so static but not really
how would you call 2 superclass constructors?
@prisma wave Well the same way you would with just one constructor, I don't see the problem.
The only thing that would be messy off the top of my head would be if both parent classes defined a method with the same name
how would you define which is which?
@prisma wave new syntax, duh?
A.super()
B.super()
ez
If you need 2 superclasses, you're almost always violating the single responsibility principle
If you need 2 superclasses, you're almost always violating the single responsibility principle
@prisma wave Well no but yes but also no not really
name me a situation where you would actually need 2 superclasses
I think you are generalizing a bit
Well take for instance my case
from before
I made it an abstract class Toggleable
which gives any subclass the toggle functionality without having to declare it a gazillion times
Toggleable sounds more like an interface
now think about another such general behavior a class might need to have where each subclass would need the same behavior implemented
Toggleable sounds more like an interface
@heady birch Bruh...
So it's not just about responsibility
it's also about functionality
without boilerplate or repeated code
ToggleButton extends Button implements Toggleable ๐
Personally I would have the interface define a toggled property, and a toggle function (probably without implementation) and that's it
ToggleButton extends Button implements Toggleable ๐
@heady birch I know, this isn't the point anymore. The ToggleButton needs its own Toggleable state and shit, I need one single implementation
Personally I would have the interface define a toggled property, and a toggle function (probably without implementation) and that's it
@prisma wave Yeah and that would make sense if every subclass would need its own implementation
But do you get my point?
to answer your question of needing to call super methods/constructors while extending two classes you could just do ClassName.super.method()
Sometimes, in order to give a class a single responsibility, it needs tools that more than one super class should provide
coding bad
skript doesn't have these problems
impl Togglable for TheType {
}
So I do think there are good usecases for multiple superclasses, but it certainly has the potential to be abused and we all know no other language feature is ever abused and made into bad code
After 10 minutes ecloud 2 is up and running
good
Anyway back to beefing up my wakatime statistics
Coding or playing minecraft?
clojure
Someone forgot a !
my life
Lol looks like rust syntax
Why is this so bad?
it says "leaking this... bla bla"
isn't the init block here for exactly that kind of call?
because the class hasn't been initialised yet
so registerEvents might try and access some property, and the compiler won't be able to tell that it's nullable
so runtime error
When you don't know what it is, blame it on spigot
simply speaking you can't
simply speaking you can't
@prisma wave Motherf****
the constructor is always called pre-field initialisation
the convention is probably some sort of initialize() function
the constructor is always called pre-field initialisation
@prisma wave So why is this never a problem in java?
it is
It just doesn't tell me it is?
It can lead to the same issues, but Java doesn't have compile time nullability so it's just assumed you know what you're doing
cool
the warning isn't because it's a kotlin exclusive problem, but because you can't use kotlin's problem solving for it
yeah I got it
why isn't there a way to just tell it to do that first thing after initialization though, if they are aware of it happening and can detect it..
seems like such an easy thing to fix
JVM limitation probably
oh wait so if I put the init block after all other initializers (property, constructor, etc) then it effectively is done after all else has been inited
effectively is good enough
well not exactly
wait no
the problem is with abstract classes in particular
iirc the initialisation order is undefined
@empty flint this is when it can become a problem
the kotlin compiler has no way of telling that it's nullable, so will accept it and runtime error instead
yeah that makes perfect sense, it's a problem with subclasses I get that
I guess that would be true for my abstract event listener too then
The only thing I can imagine being a problem would be if there's reflection to determine the @EventListener method
or some other way
It would be so clean though if it worked like that
damn
it's kind of a bad practice anyway
@prisma wave Why is it bad practice?
Because it can lead to the problems I just described lol
and they're pretty much unavoidable
it is kinda weird how the init blocks are called after the field initialisation is done
actually no, everything is initialised in the order that exists, except for functions, which don't need to be initialised
yeah it's in order
does Java do the same?
I believe so
yeah but the way Java's conventions designed means you don't run in to that
How bad is lombok actually? 1-10
if it wasn't a compiler hack it would be good
I rate it a 7/10 (features)
I hate to write thousands of setters and getters
3
this god damn ModelRendering class
11/10 on features, -1/10 on it being hackery
so like whats the catch about it being a compiler hack?
it basically uses ASM to literally change the bytecode
no getters and setters in clojure
true ๐
Well, fk I'm gonna use it for now, will save me some time. Well, I can add //Fix Me and hope someone is pring
:))
low quality but accurate
0
oh
every primitive has a default value of 0
yes
(in Java)
Null.MAX_VALUE
lol
YaNan.MAX_VALUE
void class is useless ?
no
init?
^
then Void.class ?
pdm uses a CompletableFuture<Void>
Future<Void> yeah
Yeah so a wrapper of that class exist?
yes
I mean, in Kotlin, we don't have void
then why use void.class
we have Unit
yeah thats why kotlin is superior
if you think Kotlin is superior then why tf does your name still have Java-style generics? lol
cuz forge?
void.class is for consistency i imagine
wait void.class is a thing?
yep
yes
wtf
But from my pov it doesn't fill any functionality else than its cool to have ig
also, BM, you got a job to do
code me a car
the Spigot Discord seem to like attacking anyone who mentions the word "Kotlin" with pitch forks in hand
these idiots think Java better
Ikr
btw is kotlin like faster than java when running in jvm?
@steel heart void.class is as useful as int.class, but they probably introduced it for consistency
neglible
ye
in very small cases it might be slightly slower
but most of the time it makes no practical difference
i mean
actually I think certain things are actually significantly slower on low end devices (eg some android phones)
it's probably been improved a bit
kotlin virgin
big brain

someone tell me what that reference is
kaliber daily stroke
seems legit
Elara idiot more like
elera be kinda scary though
already like -1 ppl using it
OOP > functional programming
literally no
actually, Kotlin has a good mix of both
๐
yo
hello Glare
hello good sir
would you like to hear the word of Elara?
good evening
The Waffle King of King Waffle
interesting
elara would beat them both ofc
but still interesting
intriguing
So you're saying it has hidden overhead?
Elara will likely be very, very slow at first (in comparison)
That's it, changing everything back to Java.
I mean
I mean consider it has very good features for me Idm
often kotlin seems to win in the benchmarks
In most general things there's probably a neglible difference
Honestly I made the decision too soon to move my biggest project from Java to Kotlin cause half a year later it's still sitting at half and half, which, isn't the end of the world.
That's it, changing everything back to Java.
https://tenor.com/bgQ7T.gif
be hopeful! these testings were done on kotlin 1.1.3 !!!
im sure performance has improved since !!!
I know performance has improved since then
unless you're targetting a 1gb single core android phone from 2011 it probably won't make a noticable difference
I feel like you have to do something pretty wrong to have performance issues from a plugin standpoint in Minecraft, no?
Cause like
Most plugins aren't particularly optimised but yeah unless you're comparing 3000 inventory titles every tick it's probably fine
I mean I know some plugins have performance problems but I used YourKit on my projects and noticed they barely had any performance impact on a server
yeah
If you're remotely clever you shouldn't have any significant performance issues
And I don't think I'm the best developer out there, I do things wrong all the time, but I still don't have my plugins showing up on timings.
speak for yourself

All of my projects are totally bug free
flashbacks to pdm
A lot of my job is just taking old plugins on a server and rewriting them to remove bloat and stuff and I swear some of the code I sit and look at from the plugins are just insanely wack.
No bugs that I know of
ah yes, my bad, theyre all features
there is no such thing as "bug free"
(if you close the issue without doing anything it counts as fixing the bug)
There is
It's called pdm
Can't have bugs if you don't implement any features your users ask for.

precisely
So far I haven't had anyone complaining hey
Can't have bugs if you don't implement any features your users ask for.
true
Ywt
I can't type
I did have one show up in VP the other day because I didn't relocate it. Just waiting for the day it happens in Guilds and then I'm SOL until bm finishes relocations.
have you learnt Kotlin btw?
like enough that you can actually do the writing on your own
"finishes relocations"
starts*
orrrrr just pr pdm
bm why dont u just start saying shutup or pr when people ask for relocations 
its OS 
tempting
But I'd rather waste everyone's time by saying I'm going to do it when in fact I've got multiple commissions and no motivation to work on a mess of a side project
lmfao
I mean yeah I know Kotlin, I just don't use it much. I do have a project that basically creates mcmmo throughout custom items on a server. Have about 98 items on that server right now. That plugin is currently written in Kotlin but I mainly do Java.
I just learned Kotlin so I could understand it and write it if needed.
I mean if it doesn't have speed currently. It will probably gain in the future
Hmm?
Oh one thing I was proud of is that all the items do have a custom durability system on it and I did some timings on it and even with the constant changes it does, the plugin is only taking average of 0.01% of a tick.
Pretty speedy
https://hastebin.com/peregakele.sm is this link empty for u guys too?
didnt know you could have init blocks within a constructor 
frickin spigot ๐
or within any method
tryna see the ezblocks config so i can see what needs to be done lol
how convenient, there isnt an ezblocks section on the helpchat wiki ๐
lol
After doing some profiling on plugins it's amazing how much space is actually used is memory by objects. What I thought was going to be a lot was little to almost none.
Yeah I think there's some room for optimising too
Since the JVM pads objects
Although there's probably a pretty complicated reason for that
But at what point do you start to call it microptimizations?
Like, unless a plugin is just straight up hogging the main thread with problems, then it might not be too bad.
Yeah memory usage is the least of your worries
So then do you just rely on timings / spark to tell you where problems might be?
Outside of MC I'd probably just run a profiler if there were any actual problems, or timings
Never used spark
But I've also rarely had to deal with performance problems
That's fair.
A lot of what I do is I get contacted by server owners that have problems and I just try and fix them
Spark is great because it only shows main thread performance.
So you can see where plugins are running on that thread and figure out what can be moved off of it.
just as a general rule, what should be and shouldnt be async?
I think the general rule of thumb is if it modifies the world (including entities) it should definitely be synchronous
It's weird that commands are sync when chat is async
Well don't forget that chat can also be sync.
Anyone having issues with PlayerDropItemEvent and minecraft:give command?
Hi, is there a way to ignore Armour on EntityDamageByEntityEvent ?
Anyone having issues with PlayerDropItemEvent and minecraft:give command?
@mental trench what kind of issues?
If the event isnt fired that's probably because the item is being spawned on the world and not dropped by the player
i mean, when you cancel PlayerDropItemEvent and use give command
you receive the double
oh we can't send images here
Are you sure the event is your problem?
yes, removed the part where i cancel the event
and works fine
add it back and problem again
couldnt find a way to fix it
@foggy pond wont be better to use "create table x if not exist" instead of this? https://github.com/Klyser8/Karma-Overload/blob/master/src/main/java/com/github/klyser8/karmaoverload/Karma.java#L116
That'll throw an exception if the table doesn't exist right?
Java truly will run everywhere
I doubt they'd rewrite it in Java.
Probably not
But imagine being a senior language designer for Java and getting assigned to a kotlin app
And then you realise...
What does oracle even do apart from Java and VirtualBox?
Idk
Kotlin review anyone?
Lmao @prisma wave
Who wants to do a kotlin review for me?
@quiet depot Are you meant to put a @NonNull whereever something is not null?
Or should you just put a @Nullable if it is nullable?
As in for getters?
@heady birch @NotNull for when it shouldn't / will not be null, @Nullable for when it could / can be
@heady birch null should never be returned in the ecloud
What I mean is
@NonNull for return types or not?
Because if theres no @Nullable then Id assume its non null
don't have ratings lol
What kind of response do you want
Lol
the query is a bit different on the new ecloud but you can do all that
@heady birch but yeah niall just copy that shit
no need for ratings
you can grab the object off gh if you want
no
they're part of the api, but they've never been implemented, and never will be
so remove them
also now that I think of it
I rekon only bother implementing the v3 api
cuz v2 is probs gon be switched off anyway after a while
probably cant do it with crnk anyway
can't do what
why not?
it would be our own implementation i mean
you can do anything you want even if you have crnk
thymeeaf
@frigid badge i may have reverted your last commit yesterday
you may revert the revert
but could do with bringing back the service layer
did you read what i said about that
i absolutley detest that package layout
the service layer is only necessary for the non-crnk stuff
certain things will need a service layer
POST /user/
{
username: "niall",
password: "myrawpassword:)"
}
Uh so
I have changes in some other branch how do I keep them when I checkout the feature one?
ok
๐
o
Do it
ecloud.com/hash
Sorry, this password is used by clip, please choose another to hash
Error 401
LOL
lmao
@frigid badge So what custom endpoints would we have?
/v1/version/publishVersion
/v1/user/registerUser
can you do authentication first plzz
how
ok
/v* is reserved
but it won't run on extendedclip.com? // why?
/v* is used by the plugin
Authentication
doesn't matter what domain it's on (api.placeholderapi.com btw)
I only know form based login
hold up
@frigid badge is the plugin api provided by the frontend or backend of the ecloud?
I was assuming the backend, but if it's the frontend, nvm ig
o
why would you make 2 different apis
the frontend does basically the same as the plugin
We are basically giving all the work of the backend to the users web browser
@frigid badge shall I revert the revert?
if you can that would be helpful
Nah
if not i'll do it once i work on it again
lol
announcements
@EventHandler
public void thunderOnHitBlock(ProjectileHitEvent e) {
Projectile projectile = e.getEntity();
if (projectile.hasMetadata("aoe") && projectile.hasMetadata("aoeRadius")) {
projectile.removeMetadata("aoe", plugin);
int radius = projectile.getMetadata("aoeRadius").get(0).asInt();
for (Entity collateral : projectile.getNearbyEntities(radius, radius, radius)) {
if (collateral instanceof LivingEntity) {
EntityDamageByEntityEvent aoeDamageEvent = new EntityDamageByEntityEvent(projectile, collateral, EntityDamageEvent.DamageCause.PROJECTILE, 10);
Bukkit.getServer().getPluginManager().callEvent(aoeDamageEvent);
}
}
}
if (e.getHitBlock() != null && projectile.hasMetadata("thunder")) {
e.getHitBlock().getWorld().strikeLightningEffect(e.getHitBlock().getLocation());
}
}
That's weird. The aoeDamageEvent is triggered well, but the entities doesn't seems to take damages from it '-'
(I've check the getDamage on the EntityDamageByEntityEvent, it shows me good values and it is not cancelled at the end)
dont you also have to damage them?
declaration: package: org.bukkit.entity, interface: Damageable
EntityDamageByEntityEvent aoeDamageEvent = new EntityDamageByEntityEvent(projectile, collateral, EntityDamageEvent.DamageCause.PROJECTILE, 10);
The 10 is the damages. Plus, the projectile have some datas that changes the damages at the end and it works well in the getDamage(), but the damages doesn't occurs
And if I directly shot something with the projectile, the damages are applyed well.
I assume that's because you actually hit the entity
Yes, and I use the projectile same which hit the entity to make the AOE damages
The 10 is the damages. Plus, the projectile have some datas that changes the damages at the end and it works well in the getDamage(), but the damages doesn't occurs
@reef maple the value is correct because you call the event manually
Yep, but the 10 doesn't apply
probably because the event have to be called by the server, when the entity is hit?
or when the block is hit. and the event is called
Bukkit.getServer().getPluginManager().callEvent(aoeDamageEvent);
I doubt that calling the event manually will make the entity take damage, as you can see.
Hm. So it's my way of calling the event that is problematic
Why don't you just handle the damage yourself, or am I missing anything here
Because I don't want only the damages. My projectile has accuracy, magic damages, physical damages and some other datas
I want be able to make a AOE heal (the AOE heal seems to work btw)
I want be able to make a AOE heal
(the AOE heal seems to work btw)
so where's the issue then?
If I shoot an entity, the damages are applied (the entity is hurt, becomes red, as usual)
If the entity is taken in the area, she is healed, but the damages (even after some modifiers) doesn't occurs, so the entity just doesn't take any damage
Ooh, you can put an entity into entity.damage(damages, projectile) ^^ Didn't know
Can you code a mod that take data from the server, ex the player balance and display it on discord (rich presence)?
Thats possible
Gaby, yus
You can even interact with your players through discord
Even if the server is running spigot and not sponge or smth?
An event doesn't do anything by its own...
Calling an event doesn't do anything besides literally sending it to all listeners
Doing what's supposed to happen if the event continues is up to you
you could get the final damage and apply it to the entity if the event wasnt cancelled
exactly
Experties
decode(&message)
but
loads of fields are decoded by different message types
so it seems silly to have enum for every different type
just one big struct
yes @distant sun , just use a plugin
PluginMessaging?
make your own ^^
No, I mean, do I use PluginMessaging to send the data between server and client (mod) or?
i never used that plugin
For myself i code the plugin in java, and connect to discord using Sockets
But i can check if PluginMessaging will work
i really have no idea what it is, but i use Sockets
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
saw some threads on forge forums and they were using that
dunno how sockets work though
If you want to show it on discord, you need to connect to it
Sockets can help or the discordbot plugin for java
library*
@distant sun i can help with the beginning if you want
I wanted to show the data to each player rich presence if they use our mod
like Playing on x.y.z | Username: %username% | Balance: $%balance%
Ah my fault, i thought you wanted a plugin
forge or fabric ig
Wait so like what do you actually want to do?
He wants to add rich presence to his shit
Can you code a mod that take data from the server, ex the player balance and display it on discord (rich presence)?
@distant sun
yes conclure
you know how for other games you can see the round and such
I was wondering if the same can be done for minecraft using a mod
It's forge..
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
ew docs
I just reviewed the code for first time before I'm gonna maintain something on Statistic-Expansion and.. nice hardcoded
because isItem doesn't exist on legacy versions
Gaby I think there exist some public discord forge mods which could help you Ig.
I mean, it's 1.16.2 code?
if (isLegacy)
thien..
@distant sun if ya dont mind using a plugin (instead of a mod) for it i can help
@old wyvern my concern is more about how to collect the data from the server xd
how long does helpchat bin last?
1mo or for ever I guess
Like to see if the player is on a specific server?
What I was saying is about the class CraftMagicNumbers already provides methods to check if item is legacy the same as that ^
So if they are on the lobby it won't show much info, maybe just the server name. If they are on survival it would show the balance, on skyblock the balance and team size etc
the balance is stored somewhere
all these stuff are on the server, I just need to know how to access the data
yes
Vault probably
?
you wanted to show the player position in discord?
no, their balance but on rich presence
only their balance ok, which plugin do you use for the balance?
I dont think we are on the same line thien
That method is used to check if a material is an item, mainly for legacy versions where Material#isItem doesn't exist
So if they are on the lobby it won't show much info, maybe just the server name. If they are on survival it would show the balance, on skyblock the balance and team size etc
@distant sun
https://github.com/Attano/Spigot-1.8/blob/master/net/minecraft/server/v1_8_R3/PacketPlayOutCustomPayload.java
https://github.com/Attano/Spigot-1.8/blob/master/net/minecraft/server/v1_8_R3/PacketPlayInCustomPayload.java
Oh, got ya
@errant anchor
an*
Maybe like send a custom payload to server when player joins with your client, and the server sends a packet with the required info about the server or keeps them updated
@hot hull Oh shit thank you x)
entity.damage(aoeEvent.getDamage(), projectile);
It works perfectly and damage / kill the mobs, but they don't drop EXP because they are killed by magic. Can I specify an entity for it (LivingEntity / projectile)
to enable the exp drop ?
EntityDeathEvent?
EntityDeathEvent think that entity.damage(value, entity2); is a Magic (custom) damage
even if you specify the entity2 is the projectile you used before
`
[17:13:42] [Server thread/INFO]: OLD DAMAGE CAUSE PROJECTILE //ON HIT BEFORE THE KILL
[17:13:42] [Server thread/INFO]: instance of Player ? false //AFTER THE KILL
[17:13:42] [Server thread/INFO]: killer entity null
[17:13:42] [Server thread/INFO]: Cause CUSTOM
[17:13:42] [Server thread/INFO]: NEW DAMAGE CAUSE CUSTOM
`
Is there a way to specify generics as varargs?
like List<String, Int, Boolean> or something
Object?
List<dynamic> in dart
bruh, ain't nobody ask about dart
Well no not Object, I need to specify multiple specific classes for an interface
and idk what the best way to do that would be
what
Just use your Interface then?
Maybe I'm overthinking it again
or am I misunderstanding
Let me explain
The idea is to create an interface for uniquely identifying instances of classes
But I do not want them to be unique per class
I want them to be unique per any number of dynamically defined classes
:what:
so class A and class B implement the interface and I want both to have elements that are uniquely identifiable (via some arbitrary property) amongst class A and class B instances
so say the unique property is a name
A("Bob"), B("Charlie)
A("Charlie") should fail just the same as another A("Bob") would because Bob and Charlie uniquely identify two existing instances already
And I'd like the Interface to be dynamic :S
So it would be easy to just do that for classes A and B
but I need this to be unique for any collection of classes I want
wtf is happening here :(=?
http://images.virtusdevelops.eu/shareX/rdauyntt.png
Graph
@ocean quartz are you super good in java regex?
What's the point of https://docs.oracle.com/javase/7/docs/api/java/util/UUID.html#nameUUIDFromBytes(byte[]) ? Can't you just use the name as a String to identify something uniquely?
you can
I'm alright
How would I find something in paranthesis but only replace the content inside?
Or is that possible?
\((?<content>\w+)\)?
consider the content to be an array of chars commas decimal numbers and numbers
[a-zA-Z0-9,.]+ maybe
@empty flint I assume working with bytes might be slightly more efficient performance wise but I have really no clue tbf
\w matches a-zA-Z0-9 right?
and _ iirc
just use .?
and use non matching groups btw
since you are only going to use one group from that I'm assuming
o
Yeah for now, well actually its for replacing large repetetive code blocks
Something like \\((.*)\\) could work too
interface Interfaceable() {}
val map = Map<Any-type-that-implements-Interfaceable, List<Type-instances>>()
I don't know how to define the map. Can somebody help me figure this out?
I want to map the class that implements the interface to a list of instances of Interfaceable
Generics
So something like a map mapping String.javaClass to a list of Strings, Int.javaClass to a list of Integers etc, with the requirement that they all implement that interface
Generics
@prisma wave I can't get that to work in Kotlin and I don't know how to specify the class itself as a key
Interfaceable<T: Interfaceable<T>>
Map<T>
How does Interfaceable<T: Interfaceable<T>> work?!
why would you do it like that
those are 2 seperate classes I imagine
so it's gonna be Map<? : Interfaceable>
Hmmm
@empty flint Interfaceable has to have a type argument of itself basically
eg kotlin class IntInterfaceable: Interfaceable<IntInterfaceable>
So MyClass : Interfaceable<MyClass> cannot extend any Interfaceable<...> other than Interfaceable<MyClass> ?
afaik yes
How do I make the companion object know what that <T> is?
is that even possible?
oh wait I don't need a companion object for an interface, right?
no I kinda do since I can't initialize the map
fml
interface Interfaceable<T : Interfaceable<T>>
{
val map: Map<T.class, List<T>> = emptyMap()
}
ugh
Map<T, List<T>> ?
No but that would be something like Map<String, List<String>>
and I want Map<String.class, List<String>>
but generified
and "static"
at least as static as Kotlin allows
or actually string could work too now that I think of it
ok first off String.class isn't even correct kotlin syntax
I can turn the class name into a string
ok first off String.class isn't even correct kotlin syntax
@prisma wave I know
why not just use Class<T>?
val map: Map<Class<T>, List<T>> = emptyMap()
that works
except it's not static
and so I can't initialise it ๐ฆ
pretty sure that's gonna be a default value
what you're doing here is incredibly gross and anti-oop
you can't have static generic interfaces
it's like an oxymoron
But I really really wanna :(((
not possible
ur an oxymoron ๐ก
I mean
thanks for your help, I'll have to figure out how to do what I want the proper way ^^
you can't there is no proper way :)
I love how I keep coming up with the grossest ideas of software design and you keep bringing me down to earth ๐
i aim to please
๐
yo
haters gonna hate
How'd the interview go Glare 
@prisma wave Is there a way for the interface to force a static method to be implemented in the implementing class' companion object?
It was okay. I have pretty bad ADHD and it hardcore flared up when I had to live-code in front of someone. Can't do much about it. Everything else went pretty good I think.
:))
Ah yea that's the worst, having to actually code infront of other people
Felt like someone was just watching over my shoulder, haha.
Luckily you don't really have to do that in the real workplace.
Yea
Also had an exam last night, that went okay. I have a paper due tomorrow, lab due tonight, project due Friday, exam due Thursday.
last night?
Busiest week I've had in a long time.
Damn
"Hey, Glare, wake up! I know it's 3AM but you have an exam"
Exactly.
๐คฃ
"Daily bugfixing"? Aren't you just rewriting it?
Is relocations being held for the rewrite?
Darn. I haven't had the problem show up yet in Guilds but I know it will sooner or later where they have another plugin on the server that uses an older version of Kotlin and it fucks everything up.
Yeah there is a bit of a workaround but it's effort
I believe Souza is using it at the moment - you relocate the jar yourself and upload to your own repo
then use that
definitely will implement it eventually though

You can do this ๐

So when people build bots to get notified when a new build is pushed on Jenkins without actually having perms on the Jenkins server, are they just doing something with the rss Feed and then checking for changes?
Yeah probably either RSS or webhooks if they're a thing
Yeah I would assume the RSS would connect with the webhooks.
I always have to check multiple sites to see when a new build is pushed so I kinda just want to make a bot that sends a webhook to a discord channel whenever a build is pushed from any of the locations I check.
I've never used RSS so maybe I don't understand what I'm talking about. You'd have to ping the RSS feed every so often to check for changes and then you execute a webhook to send a message to the discord channel, right?
It's all good, so I have my mind in the right place, right?
yes, there's probably libraries out there that do all the checking for you and just call an event/callback whenever a new feed has been published
Yeah, I'll be looking around on GitHub.
Am I doing this right, @prisma wave?
fun toClass(): Class<in Unique>
should return a Class of a type that implements the Unique interface, right?

