#dev-general
1 messages Ā· Page 342 of 1
elon musk long distant 2nd cousin will sort it out
Yea IntelliJ then contacts lawyers and stuff, sets up contracts and signs it for you, starts a company, hires people, make the hired workers create a nice search engine, work on making it one of the tech giants. You just need to think, IJ will make it happen

Nah man
u dont need people
Eclipse?
mainly im thinking more for web design since that would be more realistic
Sure

u could be like in your head, i want a black box in this corner about 100px
and it would just put the box
Then build the damn box on the side xD
iāll merge in a bit
Kk lol
Elara*
true
Is it possible to convert a java project to kotlin?
im going back to a java project rn....
and i wanna use kotlin xD
𤢠theres a billion errors when converting
You dont need to convert your entire project to kotlin
Just use kotlin for new classes
ew
eh?
convert it all to kotlin š
No point, You'll only end with something worse unless you go through and rewrite a lot of it
lol
The converter doesnt generate the best choice for something
but more of literal translation from java to kotlin
which is usually not what you want if you actually want any benefit from using kotlin
yeah it is what it is
Why is this the default indentation when nesting this, it's so ugly
Like xD
Does this sound like a good idea for unit testing? Instead of having different Throwable causes or different exceptions for small things, or even checking for exception text, to have a reason field in the exception that can be accessed on the test
Task 'shadowJar' not found in root project 'ProjectStuff'
how do I fix this?
wtf
i reloaded gradle
and it deleted my project files
;-;
....
š
and theres no way to recover
it's not in recycle bin since a program deleted, and it's not in the local history either
well i have the jar
ig i'll have to decompile it
luckily I didn't code it in kotlin
you donāt put your projects on github?
also thereās no way gradle deleted your project lol
at least not by just reloading
oop
lol
so thats where you guys get commissions š
i didn't know there are discords that did that š
Who ping me?
ĀÆ_(ć)_/ĀÆ
Also, dkim what you still doing here lol
Your career was ended xD
Oh also, Iām modulising the server btw to include the API
Finally moved my pc into my room 
Forgot that I based the world manager off of Sponge lol
And Sponge saves worlds by namespaced key for some reason
Weāre storing worlds by their string name
yikes
Well serves you right for using sponge š
Lol
I donāt want to see that API ever again
Parts of the API are based off of Bukkit
But the events are all reactive using flows and coroutines
so events will be emitted and then captured in flows
Oh btw, kinda got the go ahead for LuckPerms for Krypton the other day
elar g## curry hakslr ocml
lol
Oh also, how exactly will I filter values emitted from the shared flow? Call filter on it every time?
Because that sounds like it could impact performance a bit
So how would one clean this up now
private Predicate<Event> onPlayerQuit() {
return (event) -> {
};
}
This is the class that calls those methods https://paste.helpch.at/zomelilaje.cs

filter is O(n)
actually, that wonāt be an issue though, since values will be immediately emitted on receipt
so only a single value will have filter called on it, meaning it will always be O(1), right?
doesn't need to be a method
a field for that specific usage would suffice
or, an actual method
private boolean onPlayerQuit(Event event) {
blah
}```
looking at your usage you should really be using a consumer instead of a predicate
a predicate returns a boolean, yet you're not using its value anywhere
if you're trying to design an event system consider looking into the event bus pattern
I just used a predicate cause I didn't know what else to use kek
guava provides an event bus implementation you can use btw
or you could use LuckPerms as a reference, since that one is more adapted to your use case
oh also, @prisma wave , any idea what I should do about handler priorities?
I mean that's not really the issue, there's plenty of ways to make it, none are clean tho, should I just make it how bukkit does listeners?
or should I just do first come first serve
Doesn't matter
It's like a sequence or a stream
Each event is being processed sequentially
actually that wonāt work, since what if two plugins listen for the same event? theyāll both get the same event at different times from the same flow and each return different results
what
filter isnt O(n) in* flows 
then we have a race condition
n is constant here
yeah
O(1)
Exactly
xD
yeah thatās what I later said if you read below
ah alright
If they both listen to the event they both process the event
I would advise you don't make events mutable for this reason
yeah but wonāt they both do it at the same time?
Do what?
process the event
concurrent reading is fine afaik
return* what results?
Of course they don't
If you want concurrency pretty much everything needs to be immutable
Otherwise things will go bad
Quickly
it will be
If you want them to give you some thing back have some like an "EventResult" and make them provide you a version given by them
events will be fully immutable
You can them apply them based on the listener priorities
so are locations, vectors, etc.
itās all data classes
there is basically no such thing as a mutable object on the API
So therefore parallel reading isn't an issue
and anything that should be mutable, e.g. a worldās game mode, can just be volatile canāt it?
Dont make everything volatile
^
It does have a performance cost
did you actually look at event bus? I'd say it's clean
everything that should be seen immediately on update by all threads should be volatile though right?
You're only preventing invalid values being fetched by using volatile
Yes
what about things like a worldās game mode though?
constructing a new world object every time you make a small change like that is surely going to be costly
š„²
And having thousands of event objects every second isnt?
so should worlds be immutable then?
Ideally
immutable everything
I guess I could make game mode a var and make set call copy internally
would be easier than making my own copy methods for the interfaces
also might make the interfaces cloneable
so how will listen actually work again? just returns a flow that you can collect that has values emitted to it from the shared events flow, right?
still trying to fully understand reactivity
flows are continuous also right?
they just, well, flow
also, what will listen get returned? a filtered version of the shared event flow?
basically similar to how bukkit handles it no?
no
listen<T> is just listen + filter(it is T)
ah right
wdym no
you use a subscribe annotation, and you specify the event in the method params
Bukkitās isnāt pub/sub in the same way Guavaās is
also, Bukkitās is based off a library that hasnāt been updated since 2012
where listen just returns the shared flow?
(immutable version ofc)
:kek:
Lets not
huh?
Bukkit style listeners
yugi he was referring to an event bus
avoiding annotations at the base level is generally a good idea
I believe guava has two ways of listening to events
or that might just be luck's eventbus impl
I quite like annotations 
He doesnt need to have the subcription being annotation based tho
yeah but I believe guava's impl uses annotations
so he'd have to make his own event bus
Ah
yeah Guavaās is annotation-based
unless guava provides an alternative route of listening
but
I think helper has an eventbus impl too
and kyoripowered/event is also an event bus
oh maybe I'm thinking of that
Kryptonās uses a different method to that though, which is in some ways better
https://luckperms.net/wiki/Developer-API-Usage#events nope was thinking of neither, it's in luckperms itself
itās a reactive event bus, where events are emitted and listeners can collect them
Wait so I'd have an event bus per world, or what should I be doing now
The entire point of what I'm doing is to have per world listeners, if I add everything to a single event bus it'll be called no matter what world it's in
ah right
so yeah, treat each world as a separate server then with a separate event bus
Would having an event bus per world be optimal, or no
meh
You can have a single vent bus then a subcription function that filters w.r.t the world and calls the handler
This is how I do it right now https://paste.helpch.at/alopahuzof.java
I donāt like the idea of splitting worlds into their own separate servers in a way, itās like cheap manās bungeecord
Well it's for bedwars arenas, and having a server per arena is inefficient as fuck
itās the best way to do it
wdym, having an arena per server?
splitting worlds into their own kinda servers is generally very hacky and horrible
and slow
Just a Flow but yes
yeah, I mean the shared flow as a flow lol
Bardy, you're making me contemplate of just using a server per arena now ;C
good
No clue how I'd even go about handling that
Have a jedis instance and just handle data from that
You could just wrap the listeners with another lambda that filters
Redis, RabbitMQ, Kafka, etc.
I meant to quote this
lol
could work
Redis and Kafka are good for if you donāt care if your messages make it through to the other end
and when you donāt need complex routing
:kek:
if you need guarantees, TLS, complex routing, and you want to bang your head on the wall often when it makes no sense at all, use RabbitMQ xD
elara/messaging
I think I'm gonna stick with per world now, and once I'm refactoring everything, implement a system which dictates how it's handled and implement per server as well
^ 10^32/10
elara/*
If it ain't -10/10 I don't want it
-1/10
There we go
Bardy, elaborate
as I said, hacky, messy, slow, annoying
how are you planning on synchronising data between worlds?
if itās with databases, thereās your answer
each arena has it's own data which is updated when the game ends, so that's not an issue at all
There's really not a lot of strain if you look at all the components
statistics
That's all included on the game end, which can be updated async, the arenas itself don't need to have that info
fair
You can probably further extend the per world event hack š
Make actual bukkit listeners work with it
it wonāt scale all that well though
Yea that's why I'm thinking of adding per server shit later on, however a smarter thing would be to have an x amount of arenas per server, and then scale it
maybe
Would also allow for further scalling as in running the gamemode on multiple machines
yeah
youll just need to handle separating events by world there xD
Not quoting lol
Does the event bus give me access to the calling listeners?
Pretty sure you can just alter that part and make the dispatcher work like you want
Cause if so I can just skip the call if it doesn't match
is Guava actually in Minecraft?
What?
I mean does the server depend on it
Bukkit does afaik
actually I know the answer to that
the notchian server does because Iāve seen it use common collect a lot
also depends on fastutil lol
which is why itās pretty fat
because fastutil is about 23 MB
EventBus seems to not give me access to the actual registration, so reflection or do I use something else
Which do you mean?
Actually, let me have a look at that, one moment
Only provides me with these 4 methods
yeah Guavaās isnāt designed for extension
Not counting the toString ofc
lol
It aint final
bus
Oh, cute
oh come on, this is Frosty weāre talking about here lol
eh?
huh
Iām messing with you ofc
room temperature iq
Iām making a joke about you being lazy and generally saying things like that are effort lol
:kek:
is this is farenheit piggy :kappa:
celsius, I'm in the negatives
seems legit
surely if I eat the iq paper that's a negative
lol
lol
clearly
TrumPET
covfefe
Wait but how am I supposed to access these stuff if they aren't public
Never trully extended something before :kek:
what are they?
which?
š¤
if theyāre public or protected, you can access them
I'm aware of that, but they aren't
what you trying to override?
post
post isnāt public?
I need access to the subscribers
post is, subscribers isn't
and then dispatcher as well
how about just making your own subscribers field and overriding the methods to call yours
someone queue up we smart pls
Im confused
Still need dispatcher then
he doesnāt have access to the subscribers or the dispatcher
huh?
we looking at the same event bus lol?
actually, override and just call super when you want it to add a subscriber or call an event
super.method()
Check the one I just linked you the docs of
I mean yea but that still doesn't fix my issue lol, since post will call all the events, and I can't modify that, unless I'm sm0ll brain
override it
oof
public class EventBus
extends Object```
EventBus has 1 extensions, 6 methods, and 1 sub classes.
Dispatches events to listeners, and provides ways for listeners to register themselves.
The EventBus allows publish-subscribe-style communication between components without requiring the components to explicitly register with one another (and thus be aware of each other). It is designed exclusively to replace traditional Java in-process event distribution using explicit registration. It is not a general-purpose publish-subscribe system, nor is it intended for interprocess communication.
Receiving Events
To receive events, an object should:
- Expose a public method, known as the event subscriber, which accepts a single argument of the type of event desired;
- Mark it with a
Subscribeannotation; - Pass itself to an EventBus instance's
register(Object)method.
Posting Events
To post an event, simply...
This description has been shortened as it was too long.
docdex is guaranteed to have the latest
wait latest doesn't even matter
it's spigot
https://docs.docdex.helpch.at/guava/com/google/common/eventbus/EventBus.html
All of them still seem to be public and non-final
override it*
ok wait, that sounds wrong
public void post(Object event) {
Iterator<Subscriber> eventSubscribers = subscribers.getSubscribers(event);
if (eventSubscribers.hasNext()) {
dispatcher.dispatch(event, eventSubscribers);
} else if (!(event instanceof DeadEvent)) {
// the event had no subscribers and was not itself a DeadEvent
post(new DeadEvent(this, event));
}
}
I don't have access to the subscribers, and the dispatcher
so apparently ovh was using wood in their dc
I'm being really sm0ll brain rn aren't I
question mark
question mark question mark
lol
if I've learnt anything from playing minecraft
big brain is to not have a roof at all
it's that wood burns
Atleast you ain't gonna have a problem with fires
rain don't always put out the fire
Piggy, it's raining, you don't have a roof, fire or no fire you're fucked
I will slap you
do u not know how water cooling works
u get a hose
put it in ur case
and turn it on
Go jump in the puddles
I'll try later
ill have to try that out too, air cooling bad!
I'm still not sure what to do with this event bus now
š®
vodka cooling
vodka wouldn't be great for the fire
very great
plz š„ŗ
have you tried searching up the documentation for the eventbus lol
not the javadoc
the actual guava wiki
Not the issue, the issue is I have no access to the actual subscribers meaning I can't filter them
perhaps you're using it wrong
which is why you check the docs
what are you trying to do?
https://github.com/google/guava/wiki/EventBusExplained this explains it all pretty well
u don't need to extend eventboos
Got that opened yes, but that doesn't help me much
Let me explain what I'm trying to do here mister.
So I listen to some of the bukkit events, (player join, quit, move, etc),
then I have them call the listeners registered to a specific world, giving me per world listeners. You get what I'm trynna do or still no?
ah
So I need to have a way to filter which ones get called
just have a different eventbus per world
That's what I suggested at the start but apparently not optimal, smh
who said it's not optimal
there's 3 options
eventbus per world
different events for different worlds
super sketchy thread based hack that isn't really an option
second one isn't an option either
@ocean quartz What state is triumph chat in, I need a plugin for a beta server, wanna use this if it's in a functional ish state
I think it's usable, Gaby is using it on his server
Can I has jar, cba to compile myself
I'll send in a sec, just woke up
lol
It's actually 1pm for me
I'm not š
O i thought you were
Nvm then xD
I'll let you know if shit works kek
why would you use reflection in an motd plugin
AdvancedNMotd what
lol
Probably someone who doesn't even know they can use the ping event to change it lmao
also what do chat plugins have - besides custom format?
u guys say that esschat is bad
but y
channels n stuff
oh
also hovers
is possible to have a private method on an interface that subclasses ca overide?
configuring a server for the first time in like 2 years kek
oooooooooo
protected?
All methods in an interface are public though
abstract class 
^
You can have them private in Java 9+
nah java 8
why are abstract classes and regular classes separate?
is there a difference between them besides having abstract methods?
Kotlin also allows private functions
They can have no abstract methods but the classes themselves have to be extended, you can't instantiate an abstract class on its own
anonymous subclass š š
ty
if I rewrite a project, how can I push my changes without having github to yell at me?
make a new branch 
branch
ok
or the stupid option: force push
who knew, now none of my listeners work :sadge:
is there a way to have a github repo with code private but issues public š
no
have another repo for the issues
which will just delete all your commit history lol
why
open-source
um
but then I can't link commits and stuff
i can't be like "solved in commit blah"
afaik
thats why its hidden š
It should be public so people can help you improve lol
Original, 2019 code = https://paste.helpch.at/kugelamule.java
Rewrite = https://paste.helpch.at/zedalerijo.kt
Looks pretty good š
so that u wont see my bad code š
wait youāre rewriting DM gaby?
nah, my plugin, guihelper
ah right
how do u make logos like that
settings.gradle, ew
flaticons.com @half harness
ooo
Flat
gradle init ew
thats gotta be cap with flaticons
Not elara, ew
š
imagine not having IJ do that for you
shut up bbg
bbg
bbg
that's why I rewrite it
Bbg
pretty much spaghetti code
bbq
Bbc
bbb
love how Iāve only just noticed that your name includes the C function to allocate dynamic memory gaby
Blb
š¤¦
Someone deallocate gab
char[] gaby = "TM | š·š“";
System.gc() š
free(GabyTM | š·š“)
š
Nah man, just replace the L1 , L2 caches and change the ram stick
Aint nobody got time for free()
aye
donate to a poor man
no

Man I love custom textures, if only I knew a bit of design š
if only*
we should all turn into artists
omg @forest pecan š
the grammar police have entered the building
Why this not work, it's executing the right thing :sad:
I love JvmStatic
š»
PreAlpha 
š„
thatās just called a development build
lol all my plugins are always on version 1.0.0
lol imagine using a sensible version system
I used to do that dkim, but Krypton is 0.10
all my plugins are 0.0.x-SNAPSHOT
Hey who bullied deleted me message
try sending it again
it didn't delete mine
sudge
wot
š©“
lol
matt, frosty and lemmo enter the building
ping
and blitz
yo where did you find this? I lost this thong sandal a while ago
I am always here
I found it in my toilet
wtf
always here always watching
yo i may have accidently like shat on it earlier
found it in my toilet
looked like a turd
but here you g
š©“
take it
Because eggplant tastes disgusting
matt do u know why
^
??
egg.plant

It does
thanks
now I have both š©“ š©“ . I have 2 right legs instead of one left 1 right
np, JvmStatic life insurance has you covered
Probably, I've had it in a few ways, it always tasted pretty bad
dkimArchives += this
well I think I ate egg plant made only 1 way
but it is pretty good tho Matt idk
how do I disable Cortana btw? I think it wants to take over my computer. it activated itself last night during the updates I made to windows
lol
oh god
ah I see. I'm going to send you a private message then with a request
=ban SexBot
I pay a lot. I give you many many good things
Sounds Good BlitzZzZzZzZ. I will provide an order
SexBot is at your service
Starting fees (4 inches) -> $69
Every extra inch -> $3
uh
A girlfriend
Fefo, I have found your perfect match
your mom
this sexbot works guys. its not a scam https://i.imgur.com/BnNAL9d.png https://i.imgur.com/7A5l4Az.png https://i.imgur.com/0z7b0wr.png
well is dkim satisfied?
Let's find out @half harness
Sir
Sir, please leave
Would you like an order Frosty
imagine using discord in browser
I'd like to order a rope yes
Do cocks count as ropes sir
choke on it
š
What in the ever loving fuck
No comment
š„²
Uhhh
Dkim
@half harness
I was using eclipse and I want to switch to intellij and I get these errors that I did not have in eclipse
https://prnt.sc/10i2s5s
[IMG]
[IMG]
You said this
"Looks like you're using maven. Show us your build.gradle, and make sure you're not manually importing the jar.
When you're using maven, unless you're using NMS, you do not need to download the jar file."
lol

what on earth
š
add that to the archives
What the
im guessing u want me to delete the response ;-;
lol
man spigot
What the hell man
it exists
man really typed "maven" and "gradle" in the same sentence and didn't notice an issue
Lol
What
dkim
.
im gonna private that repo
DAMN
Main.java
Wait
What the FUCK
Spam-issue him š
public String returnValue;
public String returnValue2;
public String returnValue3;
public String returnValue4;
public String returnValue5;
public String returnValue6;
LMAO
@half harness you coward
show the mistakes into the public
...
Open it
@half harness coward
no
@ocean quartz Did you forget about me :sad:
u guys bullied me too much š
Bruh that was nothing yet
I did not, dw xD
There's still so much more that's wrong with that
That was only a fraction š
anything wrong with MainFactoryAbstract.java?
But that's why you open sauce your shit, so people can comment your code so you can improve
I gotta build the main class
You won't improve if you keep doing the same mistakes
lol
I found the part 2
Erm.. you're still chatting with us at present day š¤
we gotta invade and find out
wait what
Paradox
WTF
@half harness coward
LOL
embrace your bad code
QUICK
Look before he PRIVATES IT
Fuck
nooooooooo
he privated it
I did š
Gj
pussy
me too
coward
Coward
sucks to suck
lol
weakling
salad
@half harness Why are you privating things? You don't want to get better? Take some criticism
That was my first project
they bully me :c
Its so bad lol
i was 11 when I made it
i tried to refactor shit like a couple months ago
but still being worked on very hard
Too much replication
i didnt change that
Obviously
We bully everyone
And? This is my first plugin, it's really fucking horrible i'd bully myself
https://github.com/ipsk/CitizensCMD
fine
Your 13 now?
OOOO
š„²

I was 14 when I get to know coding extras
ppl can vouch for me
You guys were ahead š„²
Shows that you can write any horrible thing and people will still download it lmao
sadge
ok
;(
its unprivated
Looks at literally every outdated permission plugin
I remember now. I didn't have it as an Git repo until a power outage struck
then i lost a lot of my code
then i learned to post it on github
lmao
Look at grief prevention
lol
can I get group manager help here
I once used pex
in #chat-reaction yes
ok thx
I died on pex
PEX was good
Back in the good old days
Before permissions plugins needed coloured text
I mean like a year ago bm
The only thing going for pex is that it was easy to use
is it possible to spawn a firework and make the animation pause? Like in the middle of the explosion or something?
Nope
unless there is a fireworkboomevent
so I guess I have to just summon particles and make them look like a firework
aye
I wonder if there's a plugin or something already made. time to google xD
actually debating whether to use SLF4J or to just scrap SLF4J entirely and only support Apache's Log4j 2 API
No
Log4j 2 supports logging any char sequence for text, or any object for anything else, whereas SLF4J only supports strings
Speaking of animation... i need a good approach for an in-game "replay" system lol
right screw it, Krypton's using Log4j 2 and I'm removing SLF4J support entirely
(you can depend on SLF4J and Log4j 2's SLF4J impl if you really want SLF4J I guess, but SLF4J won't be in the server anymore)
#816184744797929522 Ah yes when it says broadcast when they mine an ore, but they have docs, sus
also, https://mvnrepository.com/artifact/com.mojang/authlib wait wtf
- Paper's repo shows up on mvnrepository
- Paper gets away with publishing authlib?
1 more hour!!
super plus advanced ore logger :))
It's also in https://libraries.minecraft.net/ but you can't navigate the repo
yeah ik
My first plugin was FrozenJoin, and it's amazing <o/
||before someone laughs, yes I am joking it's absolute dogshit||
@hot hull It's probably better if you build the development branch, mine is a little different and has more experimental stuff that probably won't work
meh
Will probably do Java 11 only when 1.18 comes out, i think one year is enough to let people upgrade
hopefully this'll work cause I'm running java 15 lol
It should
seems to work, forgot to throw papi on
@hot hull !!!
Thanks for the reminder
I have a feeling imma be fixing a lot of stuff just to be able to use it :p
Why do that reflectively lol
Assuming that's because of paper, since i am not relocating adventure
O
relocation should fix it or?
Yeah or update adventure
that works too, sec
This would be it I presume?
msgs version: "2.2.2-SNAPSHOT", type: "adventure", scope: "api"
Actually might be harder than that, since i'd need to update it on the lib as well
Just relocate xD
hopsin was a good feature
Yea
in the playlist š
The second there was an option
lol
posted it in another discord, someone ewed, told em to jump out the window, with 3 other people agreeing, smart people have taste.
Masive
ive always liked the song but its becoming one of my favourites
Cause you know, I hate myself 

I have all of nf added on my mobile playlist, still adding them to my yt one kek, slowly but surely
Did you listen to this btw? #off-topic message
the perm to give someone a lp group is group.<group> right?
/lp user <user> group add <group>
Yeah
good š
Is there no reload command
Did you build master instead of development?
oh ffs
I just found something kinda humorous in Adventure's legacy serialiser lol
very hungry
lol
@ocean quartz This reload doesn't seem to working be reliably

Something for you to look at
Wdym? Sometimes it works sometimes it doesn't?
Well don't think it works at all, seems to not overwrite some formats to the new ones
Huh, i remember it working for me
I'll take a look
okay it works, but it took a long time to actually change the format for some reason
What's the format perm
It's triumphchat.chatformat.<formatname>
Why is it not applying the format properly lol
We're both snowman group, mine works, his doesn't lol
Does he have any other format?
nope
I'll test later, but I presume a restart will fix it, if it does then you have some fixing to do, if it doesn't, you have some fixing to do :p
Oh yeah i'll definitely have to work on it a lot more
#general-plugins please š
I will slap your ass BM
what if he got no ass
Yea it legit only works for me for some reason lol
oh I swear, if Brigadier doesn't have a way to unregister commands
Nope
right then, no unregistering
fork it 
the way it works is what makes it impossible I think
write your own lib then 
Make your own minecraft duh
I wanted to let you know that it's a joke
what's a joke

katsu I will find where you live
Fefo
hey
I wanted to let you know that I got it idot