#dev-general
1 messages · Page 175 of 1
?solid
What is SOLID?
S - Single-responsiblity principle
O - Open-closed principle
L - Liskov substitution principle
I - Interface segregation principle
D - Dependency Inversion Principle
If you wish to read up more on it, you can check here:
https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
no idea
i think it says something about liskov in that link
i have no idea what ya talking
List<> instead of ArrayList<>
its about using the most abstract version of an object possible unless needed
if thats the correct explanation
but yeah gaby ^
Liskov, basically your contract should be with the interface
If you guys will suggest something at least explain why
could it be kotlin and/or PDM screwing my hotswapping over?
now hold on just a minute
Matt, assuming he did the right thing a line above, was expecting he already knew that
let's not jump to conclusions
Definitely PDM i can see that being a problem with hot swapping
🤣
Hotswapping with kotlin is a little bit janky sometimes
there's a dcevm plugin for it
hold on a minute
that you have to manually install
lets not jump to conclusions bm
hm?
im not
i mean that List<> doesn't fix my issue.
i am speaking from experience
then dont say its kotlin 
whats the plugin
So this is my current project structure, however IJ is not letting me create packages as you normally would in a dir
(Am I being dumb or?)
aj do u mean shadowjar?
@dusky drum Check Nicole's gradient code
yep totally
So this is my current project structure, however IJ is not letting me create packages as you normally would in a dir
(Am I being dumb or?)
@hot hull You need to mark the directory as a source directory
@ocean quartz is it public?
how about pay $1 urself and get nitro for 3 months using xbox game pass
@dusky drum Yeah
wat from when?
Oh damn thanks Blocky
RoseGarden
Oh damn thanks Blocky
@hot hull
@obtuse gale DEN GIMMEEEEEEEEEE
i mean i use yours hexutil matt, but for some reason text doesnt work i did debugging and i get all the text in console just when it gets on hologram theres like cutoff
lemme guess you want that as well?
a wild comedian appeared
@prisma wave This is all I could find when looking that up
idk if thats even relevant
oh nvm
If anyone wants to say some kek's https://posili.me/i/2020-08-28_15-22-34.png
maybe it's not necessary anymore
unlikely
@dusky drum Oh on hologram, yeah i know why, we had that problem on Holovid
Spigot has a limit of 36 characters for entity names, you'll need NMS to bypass it
ill try without
are you compiling the classes with IJ?
Gasper, ves od koga je to ss? :p
premlez?
22
??
the weeb boi krusic
the weeb
eh
are you compiling the classes with IJ?
Can you not ping me? Thanks.
oo external emojis work now i forgot
eg ctrl + f9 or whatever it is @obtuse gale
@obtuse gale please move to #off-topic and also no pinging please
matt im not sure about the limit:
http://images.virtusdevelops.eu/shareX/j1r8r9n4.png
Does build tools have an API where I could, from within kotlin, find out what the latest version of mc is?
im changing shit, running gradle jar, pressing my keybind to reload classes i think lol
and i tried pressing the hammer button
which did nothing
I'm pretty sure it's still limited, it's quite buggy with the api
ugh
i mean i make placeholder
so
i dont see a problem there
will do more debugging
The problem is that colors on spigot looks like §x§0§0§0§0§0§0H§x§0§0§0§0§0§0i 2 letters and 18 characters
ye but how does the rainbow work then
Oh it does? o.O
just my gradient doesnt want to work
like it just cuts off.
and even if i check for when placeholder gets updated:
http://images.virtusdevelops.eu/shareX/4lpelplw.png
text is there
@hot hull can u link me to ur hex color extension function pls k thx
how do I change the shadowjars output location? With regular gradle jar i did this jar.destinationDir(file("$rootDir/server/plugins")) i just dk how to do it for shadowJAr
Kaliber HexUtils from Matt are op :3
and eso has good ones to
Oh okay not sure then
Though i use a modified version of Nicole's HexUtils, idk where you find that class but it shouldn't exist anymore xD
thanks for the copy and paste frosty 
I need to change the hex pattern
huh?
Could not find method compileOnly() for arguments [net.md-5:bungeecord-api:1.16-R0.2-SNAPSHOT] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
repositories {
maven { url = "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compileOnly "net.md-5:bungeecord-api:1.16-R0.2-SNAPSHOT"
}
update gradle hehe
Using 6.5.1 so that shouldn't be an issue
hmm
@quiet depot suggestions?
okay so found an issue apparently HD cant handle hex....
if you use default colors not the hex text size is infinity but as soon as you use hex it just breaks
HD doodoo
tested rainbow from nicoles hex util:
http://images.virtusdevelops.eu/shareX/ef74f9g6.png
still cuts off.
Blame it all on spigot when ever shit doesn't work and you don't understand
try 1.16-R0.4-SNAPSHOT @hot hull
Same thing
and use this
https://oss.sonatype.org/content/repositories/public
public repo instead of snapshots
Still nada
@heady birch can you show me what the createAnimation (or whatever it's called, the method that needs implementation in every animation) is in MarqueeAnimation? I wanna know if this code that I'm looking at right now is just poor decompilation or the actual code you wrote lol
Lemme see if I have any other bungee plugins
try using paper's repo
they might mirror it
on that note, just see if any dependencies are working
paste your entire build.gradle also
ok
Instead of sonatype do mavenCentral() maybe? ;o
nah snapshots aren't on central
Oh okay
yes it does
oh
it uses both
yeah matt that's why md uses sonatype
cuz snapshots
although I don't know why he doesn't just use his own repo
or ya know, make proper releases on central
Okay ye this doesn't work either
I know right, he already pushes spigot to his own, why not bungee
what doesn't work frosty?
So I use this in another bungee plugin, and it works
repositories {
mavenCentral()
maven {
name = 'sonatype-oss-repo'
url = 'https://oss.sonatype.org/content/groups/public/'
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'net.md-5:bungeecord-api:1.16-R0.3'
}
Tried the same on this one, but it doesn't, guessing it's due to the modules?
@quiet depot usually you just use maven-public and it gives you both, but bungee and spigot are still using a really old version of Nexus
bruh how tf do i change shadowjars output directory lol
cant find it on google anywhere
Is there a way to find out which version this json points to? https://hub.spigotmc.org/versions/latest.json
I'd need a String like "1.16.2" or something
@jovial warren erm you realise bungee is literally hosted on sonatype
the people who develop nexus
I find it hard to believe that their public instance of their own software, is outdated
oh yeah it's on central
o bungee is on central too?
yeah ofc it is lol
go to https://mvnrepository.com and you can find where everything is
@obtuse gale
shadowJar {
destinationDirectory = file("$rootDir/server/plugins")
}```
just like the jar task
i see
only has latest though, but only specials uses old versions of the bungee API
apparently https://mvnrepository.com/artifact/org.spigotmc/spigot-api clip posted the spigot-api to his own repo a while back as well, no idea why
Okay so there's a few thing funky, firstly this is my build.gradle for the entire project
https://paste.helpch.at/ivuzupedif.bash (kotlin not being recognized in any of the modules so I'm assuming I'm missing something)
why are you still using 1.3.72 smh
Exactly the thing I said earlier, I cba checking for updates
well not fully
Doesn't matter right now
some stuff has been deprecated / removed
yeah but nobody used the old stuff, am I right lol
omg pdm works?
i never said anything 🌚
did 1.4 actually break PDM lol
you had to go and blame me
REEE so whats my problem lol
kind of
I remove what i said and deeply apologize to PDM
updating to 1.4 meant that every plugin using pdm shaded the kotlin stdlib
but that's fixed now
so
ez
So, am I missing anything?
Also another thing, my source roots keep getting "unregistered"
😳
oh god I just saw what I've got to port over next in my KiteBoard deobfuscation project lol
package Piggy
good
That's the group id not the package
smh frosty
lol
i've told you off for this before
bruh since when, I could've swore it legit relocated it properly -.-
me.mattstudios.mf is the package
Yeah the packages will have mf something
matt use consistent groupids/packages smh
Can y'all stop pointing out the useless shit right now
no
denied
thats what we do best 🌝
Only reason why it has utils in the group id is because of the dude that accepted my maven central application .-.
ree hotswap no work 
most of this shit needs to be wrapped in the subprojects block
the reason it's not working rn is because the kotlin plugin isn't available to ur subprojects
because it aint being applied to them
^
and the kotlin plugin is what provides compileOnly
I had it as mf i think and the guy was like "i made it utils so it allows more things to be posted"
plugins {
kotlin("jvm") version "1.4.0"
}
```in your parent, ```kotlin
plugins {
kotlin("jvm")
}
```in your children (that sounds so wrong I know but in this context it makes sense lol)
(also that's superior Kotlin DSL xD, for Groovy replace kotlin("jvm") with id 'org.jetbrains.kotlin.jvm')
it's a function for shorthand
im still on 1.3.72 🙃
Do you guys know how to use the apache commons repos in kotlin?
what do you need from commons?
I am getting a java.lang.NoClassDefFoundError: org/apache/commons/cli/Options
okay @heady birch I'm starting to become seriously concerned: https://bin.bardy.me/xt48qPwu.cs (some of it is poorly decompiled I know, but decompilers aren't that bad, and that's PulseAnimation btw if you're wondering, for reference)
Okay fixed all this shit, seems to work now, lemme try the bungee shit now
compileOnly 'commons-cli:commons-cli:1.4'
you sure that's the right dependency?
yes
Okay that works now, but it still keeps unregistering my root directories??
unregistering?
I mark a directory as a root source, but it keeps removing that
if it's removing it, then it's not meant to be a source
^
I didn't think you're even supposed to have to mark directories as root sources manually
I mark a directory as a root source, but it keeps removing that
@hot hull are you marking "main" as a source root? You need a subdirectory like src/main/java or src/main/kotlin
sometimes you have to
generated sources for example
they just never work by default 😦
src/main/kotlin should be your sources directory
Figured everything out now
how do I package the jar file such that the main function is a top level function and not inside a class?
The global multiplier has ran out and has been reset!
I am having problems with the manifest
So how do I package apache commons cli library into my jar with gradle?
shadowJar
oh
Looks like I haven't figured everything out yet 
Hm I've seen the Class::method notation a couple of times but I don't understand when it can be used.
I thought it was a replacement for lambda expressions
that's a method reference
but this doesn't seem to work matchResult -> matchResult.value -> MatchResult::value
How do they work?
also
valueisn't a method
@jovial warren it's derived from getValue() afaik
you need to reference a method that takes a parameter of the type that of the lambda thingy
like this: java myLambdaThingy -> myMethod(myLambdaThingy) becomes ```java
MyClass::myMethod
@empty flint I swear matchResult is redundant there and can just be replaced with it
(it is the default name for a lambda argument when there is only a single argument)
sorry for the dumb questions
nah it's good
you'll get used to it
also I hope you're not calling map from Stream<> there
val matches = regex.findAll(IOUtils.toString(URL("https://hub.spigotmc.org/versions/"), StandardCharsets.UTF_8))
.map { it.value }
.toSet()
phew lol
also I hope you're not calling
mapfromStream<>there
@jovial warren why not tho?
because you don't need to use stream like that in Kotlin
right
anything Stream has, Iterable also has as an extension function
and in fact, without stream(), you can do more thingys
like what?
like chunked, which will chunk a list in to chunks
Documented enough? https://paste.helpch.at/namutuhati.m
or fold, which will fold a list in to a single element
@hot hull sorry?
setCancelled?
frcsty ur missing out on those one liner methods :((
why tf do you have getters and setters there smh
Bardy, in an event context for cancel shit it's cleaner imo
lemme clean it up for you
No
smh, keeping the ones for cancelled, I'll yeet the message one -.-
also yeet the handler list one
It's needed lol
private val handlerList = HandlerList()
override fun getHandlers() = this.handlerList
fun getHandlerList() = this.handlerList``` sx reckoned that was harder to read but i like it lol
getHandlerList is also needed
then why's it not override
well then why's it needed?
It just requires it for some fockin reason
you realise you're wrong right
declaration: package: org.bukkit.event, class: Event
no abstract getHandlerList there
Bardy, make a new project, extend an event, don't include the getHandlerList method, and run the plugin
And you'll see
@hot hull disgusting
but also you're right
you need a static getHandlerList function
This is it right now KM https://paste.helpch.at/majagimihi.m
class FrozenJoinEvent(
var default: String?,
var player: Player
) : Event(), Cancellable {
var isCancelled = false
private val handlers = HandlerList()
override fun getHandlers() = handlers
companion object {
private val handlers = HandlerList()
@JvmStatic
fun getHandlerList() = handlers
}
}
```that should do
you don't need the cancelled getters and setters
and yeah the handlerlist should be static
which means it needs to be in the companion object, meaning handlers also has to be in the companion object because objects can't reference instance fields
@hot hull you should implement Cancellable too
yeah just copy mine lol
mine:
- Implements
Cancellable? ✅ - Has all the required methods for
Event? ✅ - Doesn't have any non-required useless disgusting getters and setters? ✅
bruh Cancellable requires setCancelled -.-
Spigot is so annoying lol
because you don't need to use stream like that in Kotlin
@jovial warren But you should use sequences, Kotlin's equivalent to streams for effeciency
or fold, which will fold a list in to a single element
same as Stream reduce
ah okay
Also, how would one document shit in kotlin? or is documentation non existant 
Kdocs
documentation uses KDocs
which uses Markdown rather than HTML
so all the shit you're used to like writing <p>, <h1>, etc.? gone
{@code Class} and {@link Class}? replaced with [Class]
sequences should only be used for chained operations that don't require random access
not really worth it otherwise
Kotlin is already rapid fast as it is anyway, isn't it?
¯_(ツ)_/¯
sequences should only be used for chained operations that don't require random access
@prisma wave when do you ever need random access in sequence transformation
Another slightly related question, so I have an event (the above one) which I fire normally when a player joins, then have a seperate listener which listens to my event, should I now have another event called a MessageResponse or some shit, which gives info on what format/motd/all the excess shit was applied to the user?
well exactly
not an event I'd say
Suggestions bardy?
also most Iterable extensions just return Iterables as well so you don't get random access there either
🤔
my brain ain't large enough for this 
neither is mine
List.filter and things return Lists
still it is absolutely worth it to use sequences when you do multiple transformations
is it though
yeah it is
reduces both memory and time complexity from O(xn) to O(n) where x is the amount of transformations
nice
So anyone big brain enough to give me suggestions on this?
Wouldnt x be a constant in most cases unless you for some reason loop the function or something?
yeah it is a constant
so in terms of complexity it wouldn't matter, but it would still be a speed diff
nvm
So that would mean both are O(n)
@old wyvern still significant
Mhm
and whether it is a constant or not depends on how you look at it
one scales with the amount of transformations, the other does not
That doesnt affect time complexity
It depends on whether the amount of instructions change depending on input
which can be the case
Even tho sequences do lesser amount than streams, in case of time complexity both represent the same
even disregarding complexity theory the practical overhead you have in one situation gives you no benefit whatsoever
Yea
Does WorldGuard have an api?
I think so
Ah okay found it, doesn't seem to be mentioned on it's page
Yurr
also btw @hot hull , looks like if you just put the handlerList value in the event's companion object and annotate that with @JvmStatic, that seems to do the trick
instead of having to make an ugly getter for it, which is done internally by Kotlin
cool
I found that out by looking at events in VoteParty
class FrozenJoinEvent(
var default: String?,
var player: Player
) : Event(), Cancellable {
private var isCancelled = false
override fun isCancelled() = isCancelled
override fun setCancelled(cancelled: Boolean) {
isCancelled = cancelled;
}
override fun getHandlers() = handlerList
companion object {
@JvmStatic
val handlerList = HanderList()
}
}
```should do the trick
This bish just ruined all my dreams :(( https://worldguard.enginehub.org/en/latest/developer/regions/events/
Not sure if it's worth making my own event
making your own WG event?
Region switch event
how are you gonna call it?
Isnt there a worldguard extension for that?
for events?
I assume it includes the events too?
can someone help me with luckperms?
I'll check
Can someone help me with luckperms the prefixses dont show lol
Sheesh
but then that means you need an extra dependency
Yea, still gonna make my own
wouldn't be surprised if you needed to do some funky reflection shit to make it work lol
Not gonna bother with lower versions for the extra shit
The base plugin will work 1.7-1.16, just the extra shit might not, and I honestly don't care :p
if you don't use NMS for the extra stuff then it'll work because of Spigot's compatibility layer
onCrossBoundary
also @hot hull wtf is that README lol
from the commits it looks like that's @quiet depot 's doing
Shut up, it's beautiful
^
it's awful
its great 😍
funny, but awful
Which read me?
FrozenJoin README
It's beautiful 🥺
How do you print to System.err stream without usind System.err?
printErr or something similar?
Someone go judge ||cough @jovial warren cough||
(spigot module) https://github.com/Frcsty/FrozenJoinGlobal
(I still need to comment the RegionListener shit)
What's that for? Freezing players when they join?
What a comedian
cough no code in common yet cough
also if you're making a multi-module project then check out Koin
(it's a Kotlin DI library, it'll make your life 10x easier, trust me)
Yea I've got a quick question how do I actually access shit through the modules?
I'd suggest using dependency injection for that, like I said
when I get Punishments 1.0-SNAPSHOT rolled out (working on it now so shouldn't be too long lol), you can use that as an example 🙂
accessing a class in my spigot module from the common module, cause normally I can't
Make both the other modules depend on the common mobile
Think of each module as a different gradle dependency, you add it as a dependency and get stuff from it
implementation project(':common')
I see
1 class in common now Bardy, I hope you're satisfied 
lol
this is java code:
var bytes = ByteArray(1024)
while((bytes = inputStream.read(bytes, 0, bytes.size) != -1) {
}
How do I kotlin-ify the assignment in the while?
You don't
assignment isn't an expression but also that's not idiomatic usage
InputStream.readAllBytes() exists
KM, opinions, ktnxbye
https://paste.helpch.at/pebohidebu.rb
I know but it halts the execution too long. I want to make a progress bar in the console while it's downloading the file
Can I cast an input stream to a byte array input stream?
@hot hull I'd make a Listener interface in your common (or something similar), make all listeners implement it, then wrap the bukkit/bungee listeners in their respective implementations and use reflection to register them
if that makes any sense lol
reflection tho 
@hot hull vague function names, mutability that could be avoided
Yea already fixed the mutability
Unnecessary type specification
vague function names tho, wut?
registerWorldGuard()
better?
^
Only PlayerListener can be for now, the rest aren't done and won't be able to be
Also doesn't WorldGuard.getInstance return the plugin?
Indeed it does
So you could just use the worldGuard variable
However, would that not lead to an npe if it were not installed?
in the first null check?
mhm
Ss?
Okay yea ignore my dumbass
For that I blame IJ
I don't
var sum = 0
var byteLength = stream.read(it)
while(byteLength != -1) {
sum += byteLength
println("$sum of $totalBytes bytes downloaded...")
outputStream.write(it, 0, byteLength)
byteLength = stream.read(it)
}
How about this, Mitten?
can I simplify such a while loop?
:/
imperative code in kotlin is pretty messy imo
also
weird variable names
in fact
what's even going on here?
byteLength = stream.read(it)
sum += byteLength
that's also going to extremely spam the console
:bruh:
clean as shit
hot damn
that's also going to extremely spam the console
@prisma wave That was just temporary before I set up the progress bar. I wanted to make sure it worked
byteLength = stream.read(it)
sum += byteLength
@prisma wave I got rid of the sum, that was just for testing. the byteLength is the number of bytes read from the stream into 'it' (the buffer)
imperative code in kotlin is pretty messy imo
@prisma wave I know but idk how to make it declarative
url.openStream().use {stream ->
var pBar = ProgressBar("Progress:", totalBytes)
ByteArray(1024).also {
do {
val bytesReadCount = stream.read(it)
pBar.stepBy(bytesReadCount.toLong())
outputStream.write(it, 0, bytesReadCount)
} while(bytesReadCount != -1)
}
}
wdy think?
hey guys, those who use kotlin, is it me or do i always get a strange feeling whenever i write kotlin code? i feel like it's so high-level that i can't control everything (unlike java for example, more verbose but satisfies my control-freak feelings)?
like i'm obsessed with kotlin's coroutines but i still feel like that knot in my stomach
@faint bobcat I guess that's the point of declarative coding like kotlin tries to encourage. You give up control for readability.
I don't think i ever felt like i could control more code in Java than in Kotlin, it's more the other way around imo
For example internal access modifier and things like that, that Kotlin provides
Kotlin is no higher level than Java
Hm I can't use Kotlin's use { } with AutoCloseable...
It just has more support for declarative code
Code & error?
It might be because you've imported the one for Closable instead
Ah right, I need both
crap
How do I import both?
Or can't I?
And the import doesn't show in the imports section at the top of the file
@ocean quartz Any way to make command permissions customizable?
Import alias doesn't help either
(Using the annotations, otherwise imma just handle it myself)
What do you mean by customizable? ;o
Well I mean customizable by the end user, as in being able to be assigned from a file
Oh, hmm i don't think so
Can't think of any way to make that possible
@ocean quartz same thing you do for messages and completion maybe?
getCommand("...").setPermission()?
With like ids?
Is it worth it though?
I am currently rewriting it
So any suggestions i am up for it
nah
there's a very few cases where you would like the permission to be edited by the end user
Yea, not worth it 
Damn allmann looks ugly in some cases...
oh no
Hey I'm still using it tho
There is some fanatic lovers of it here
Did you say crusade time?
I have a problem with allman on a few cases, where i think it's quite ugly
Everytime*
I think it's always ugly and I find it funny that so many people here use it
^
Like
async()
{
}
Over
async {
}
Like where did you get this from? Have you all been doing c# before?
Idk i'm assuming most got it from Sx
^
Like in K&R you are reading from left to right you find a bracket and you know it starts a block
In allman the block starts in the line under, it's odd
if were starting a circlejerk friendly debate for which is better, can we have a multi spin first 🌝
na
I have two pending as well
ig we gotta wait for glare
in K&R it's not clear where a block starts and ends
in allman it is
therefore good
Personally think it's the other way around
^
the braces aren't aligned
so you have to read up manually to find where the block starts
when ur reading left to right, then u gotta look on the next line to find where the block starts
but i find it easier to find where the block ends in allman tbh
because of the alignment
in k&r you have to read the entire line to find where the block starts
in allman it's explicit
if were starting a
circlejerkfriendly debate for which is better, can we have a multi spin first 🌝
@onyx loom 🌝
Yeah i wanna wait for multi to start debating as well xD
@prisma wave apparently you mentioned a while back that getOfflinePlayer will query the Mojang API to find the player if they've never logged in before, however, I've looked through CraftBukkit code and can't find where it does this
any ideas where the code that does this is?
I think it queries as soon as you access the name or something, not when you call that method
Iirc
wat
I mean if it actually does that, it'll be really handy for my project since it means that I don't have to query the mojang API myself
but it says in the docs that it will
Doesnt it say that it just wont be null?
it says something about a blocking web request iirc
Oh
that's deprecated though
because apparently "names aren't unique past a single session any more"
how do I create a gif like Matt did for his gradient progress updates here
output.also {
ProgressBar.wrap(
url.openStream(),
ProgressBarBuilder()
.setTaskName("Progress: ")
.setInitialMax(totalBytes)
.setUpdateIntervalMillis(50)
.showSpeed()
.setUnit("KB", 1024)
.setStyle(ProgressBarStyle.COLORFUL_UNICODE_BLOCK)
.setConsumer(CustomProgressBarConsumer())
).use {
output.writeBytes(it.readAllBytes())
}
}
clean...
I used sharex yeah
I gotta use sharex
Temviewer
wat


you're mental lol
Yep I do follow that Indian guy on yt as well
wat
Also I like Eclipse
yep, crazy
eclipse do be 🔥
lol
@heady birch I hope you see my previous message about PulseAnimation and the message before that before I go to bed lol
because I really don't think this code is right
switch(variable.hashCode()) {
case 104256825:
// do thingys
}
```basically what the code that I'm looking at right now looks like just a lot worse
this has to be poor decompilation
afaik that's what string literals in switches compile to
string literals?
yea they do bm
what do you mean by string literals?
"blah"
in a switch it can only be "gfkdoj"
ah okay
or enums etc
so just strings then
lol
yeah I know what a switch is, I just didn't recognise the term "string literal"
case 104256825: {
if (lowerCase.equals("multi")) {
n = 0;
break;
}
break;
}
```yeah you two are right
to elaborate switch statements can only use compile time constants
which literals are
ah okay
whereas when statements can use anything 😎
why are switches so trash btw?
because java 🌚
I've got more code for you to examine btw
but it's a bit bigger than last time so bin it is
first of all, what is Label_2081?
I mean, I can figure out what the rest of it is pretty easily because I have context, but it's still very messy
labels
the same as it is in kotlin
are they something that the compiler writes in or what?
why?
wow
I use them in Octo because I have a foreach inside of a foreach and I need to distinguish which one to return to lol
messy
I mean, that's not even the worst part of it lol
it's just overally horrible
look at that function
@prisma wave okay this is bad decompilation right: ```java
list.add(normalColor + text.substring(0, max) + startColor + text.substring(Math.min(Math.max(max, 0), max), Math.min(n, text.length())) + middleColor + text.substring(n, Math.min(Math.max(i - 1, 0), text.length())) + endColor + text.substring(Math.max(Math.min(i - 1, text.length()), 0), Math.min(i, text.length())) + normalColor + text.substring(Math.min(i, text.length())));
I hope so lol
(that's a single line, also the named variables you see in there are the result of me deobfuscating them lol)
is it just me or does BuildTools require Java8 specifically and won't build with Java11?
it requires Java 7 or Java 8
it will not build on any version before or after that
Bummer
yeah I know
but hey, that's md_5 laziness for ya
instead of making BuildTools compatible with Java 11, he just makes it not work with Java 11
So now I gotta figure out how to find a Java8 executable on a system
shit
And this is where Java becomes OS dependent
lol
Java isn't OS-dependent...?
actually yeah ik what you mean
e.g. my Java 8 executable is located in /usr/lib/jvm/java-8-openjdk/bin/java
but even different JDKs may be located in different places
like OpenJDK, Oracle JDK (normal JDK), etc.
@empty flint simple fact is: you don't
you either migrate your project to Java 8, or modify BuildTools to work with Java 11
also why do you want to automate the BuildTools process?
no the thing is I have to start a new java process to execute the BuildTools jar, right?
I can essentially only do that reliably using the command line.
If JAVA_HOME is set to another JDK, then java -jar will not execute as Java8...
I would have to call the process using the full path to the java executable
but I think I'll just say fuck it
but I want this to work on Mac and Linux as well and at least the first one I can't test for sure becaue I have no Mac
The second one would be a hassle for me, I'd have to set up a complete linux dist just to test this
I'm using a Linux system so if you give it to me I can try and run it on here
so I think I'll just say fuck it, if the java process isn't J8 then I'll have the user set the path to their java executable in the parameters
(I use Linux because Windows sucks for development lol)
(I use Linux because Windows sucks for development lol)
@jovial warren I mean I've been doing fine with it
yeah but you haven't needed to use command-line yet
And I grew up on Windows. The difference is minimal if you don't want to really dive deep into the OS
yeah but you haven't needed to use command-line yet
@jovial warren I use it regularly
I grew up on Windows as well, but I learnt how to use Arch Linux
And I grew up on Windows. The difference is minimal if you don't want to really dive deep into the OS
second point is debatable
The new windows PowerShell is quite alright
Well in terms of usability. As a standard user you can do pretty much everything except Windows has tons more support and online help because it's just more widely distributed and an actual company's revenue depends on their customer service
you haven't tried installing Gradle yet either
@jovial warren Installed it multiple times actually
Not a problem
manually?
well yeah
so you have to:
- Download the ZIP
- Make the directory
- Put the files in the directory
- Add it to path
I have to: run the command sudo pacman -S gradle, put in my password, press enter, and done
a package manager is something that all operating systems have, and for Windows, it's still in development
also does Windows have the versatility of a Linux system? e.g. can you change literally anything in Windows? no you can't
e.g. you can't install whatever file manager you want, you're stuck with File Explorer, you can't install whatever DE/WM you want, you're stuck with Explorer, you're forced to use all the Windows built-in proprietary stuff
and sometimes it's pretty trash
Linux being better than Windows for developers is just a fact
I'm not denying it is
you just want evidence, or are curious about why
or are just saying why you use Windows
I'm just saying the difference is minimal if you don't dive deep into the OS itself. For Java/Kotlin Development in IntelliJ it makes 0 difference essentailly
yeah true
Doesn't matter why I use windows, it's just convenience
yeah fair enough
Too lazy to learn the intricacies of linux and what to do when things go awry
just stuff I learnt about windows through years of breaking it and repairing it
I'm using a Linux system so if you give it to me I can try and run it on here
@jovial warren I will take you up on that offer, let me just finish it up and I'll let you test it on linux 🙂
alright 👍
what are you using buildtools for btw?
it should be NMS and only NMS (depending on spigot or craftbukkit)
you can find spigot-api in the Spigot Maven repo
where would you get the spigot jar to run your own server locally?
How do you test the code?
oh I just download it from getbukkit lol
eh well
a website that's somehow still going
I used to, but guys, I don't recommend it
it should be NMS and only NMS (depending on
spigotorcraftbukkit)
@jovial warren Also, I am using all NMS versions since 1.12.2 in one of my plugins
I used to, but guys, I don't recommend it
@errant geyser recommend what?
I'm friends with a mod on their discord, they have a lot of shady stuff going on, at one point they tampered with the jars.
GetBukkit
lol
tampered with the jars?
In what way?
I mean that's why you always check the checksum
The hashes and file sizes were different
I never bothered to check what it actually was
hmmm
Not saying they still do that, cos last I checked they don't, but at one point it was happening
Doesn't matter to me anyhow
never used it
BuildTools ftw
@jovial warren The real reason I'm doing this is so I can set up an environment in IntelliJ where I want to test a plugin and it automates the whole thing. If a server exists, I use it, if it doesn't, I download and create it and THEN I use it.
Testing for different versions is a pain...
I kinda wanna write an IJ plugin to automate that, ngl
Wanna work together on that?
You ever made one before?
I got half the server download and build down
You ever made one before?
@errant geyser I never made something before I eventually made it
Damn, thats pretty cool. Ive set up a plugin project before but never actually made it into something.
Sure, if u wanna work together, why not. Its midnight for me, so ima get some sleep for now
👋
Sure
just tested, buildtools downloaded, spigot downloaded and built. now just need to run spigot
This'll be fun 😄
Good Night guys!
good night
also, @ocean quartz , surprise
really not sure if this one's gonna get PR'd because there's potentially breaking changes with my new exceptions but eh, I think it's a good idea
Small commits > 1 big commit
Yeah won't accept since doing a rewrite
Also i had a reason to not have multiple exceptions, makes it smaller and basically one exception with explanatory text did the same job
^ this is the exact reason why I discourage prs on wip projects, or even close source them (e.g. papi 3)
it sucks to put effort into a pr, and have it ignored because the dev is doing a rewrite
¯\_(ツ)_/¯
Eh, doesn't bother me all that much, was a bit rushed tbh
I am curious on how you plan to abstract with JDA in the rewrite though
Actually, I am curious on how you plan to abstract at all, since the user will want access to every method in each thingy
Magic
Nah I'm just curious so I can steal it cough sorry what
xD
@quiet depot in my case, I didn't put much effort in to it and I wasn't all that bothered about it either, but your point is still a good one
Hi, it's my first time using an extension called "JavaScript" from placeholderapi, and I was wondering if you can do something like this
var count = PlaceholderAPI.static.setPlaceholders(bungeecord, "%bungee_Survival%");
var count2 = PlaceholderAPI.static.setPlaceholders(bungeecord, "%bungee_Lobby_001%");
function globalCount(){
return count + count2;
}
globalCount();
I received this error, I guess I need to add or add some kind of "dependency" or something to the script.
[PAPI] [Javascript-Expansion] An error occurred while executing the script 'example':
I clarify, that I do not know much about JavaScript.
What I would like to do is that I have 3 BedWars Lobby's and I am making a menu, and in that menu I am showing the players connected in that mode, and I would like JavaScript to add the players of the 3 lobby's
You can just use the math expansion for that, and that won't work
oh
var survival = "%bungee_Survival%";
var lobby = "%bungee_Lobby_001%";
function globalCount()
{
return survival + lobby
}
globalCount();
Good thing noone asked 
I usually do it like this lol
var survival = "%bungee_Survival%"
var lobby = "%bungee_Lobby_001%"
survival + lobby```
Still works, but meh
Doubt he's using your js expansion
21 lol xd https://prnt.sc/u7v9ax
Okay, I fixed it, but now it comes out like a double or long
https://prnt.sc/u7vcez
xd
Just use
%math_{bungee_survival}+{bungee_Lobby001}[precision:0]%
var bedwars001 = "%bungee_BedWars_001%";
var bedwars002 = "%bungee_BedWars_002%";
function globalCount() {
var total = parseInt(bedwars001) + parseInt(bedwars002);
return parseInt(bedwars001) + parseInt(bedwars002);
}
globalCount();
I had to do this, because as you told me before it concatenated me instead of "add"
You could just remove the total variable line 🤷
Or you could just use math expansion like Frcsty said many times earlier
the variable, is because I'm looking for a way to add what he told me frosty
?
there edit my message, excuse my english.
finish
thx 😄
in DeluxeMenu, can I still add js in command execution parameters?**
Yes
I love you @ocean quartz
component.sendMessage(player);
component.sendActionBar(player, fadeIn, stay, fadeOut);
component.sendSubTitle(player, fadeIn, stay, fadeOut);
component.sendTitle(player, fadeIn, stay, fadeOut);
We all love Matt

@quiet depot I could use a hand cause I'm lost, when I try to build the project I get this:
Cannot resolve external dependency org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.72 because no repositories are defined.
Required by:
project :
I've no idea what in the bejesus it means by that tho, here's my main build.gradle
https://github.com/Frcsty/FrozenJoinGlobal/blob/master/build.gradle
nooo
Yea it don't work, anyhow any clue on my issue?
i found an issue
I copied it from papi, not sure if I missed anything tho
archiveFileName is a Property<String> right?
you appear to be using gradle (assume that was a mistake)
should this be in the root gradle?
cuz then it'd be applied on bungee too
and that don't make much sense
It shouldn't no
btw if your subproject doesn't have any manual configuration to do in build.gradle
simply don't include the file
it's not needed
(talking about common)
It doesn't right now, just have it there when I need it
ah
kotlin plugin seems to be incompatible with this setup
add the kotlin dependencies manually
so like instead of this
do the normal notation for each kotlin dep
seems the kotlin plugin registers it's own implementation configuration, which isn't accessible when in the subprojects block
dependencies {
val implementation by configurations
implementation(kotlin("stdlib-jdk8"))
}```
seems you can make it accessible like that
but that's kotlin dsl, not groovy
idk what the corresponding code would be
Yea I've no idea
@prisma wave Can you gimme a hand .-.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':compileKotlin'.
> Could not resolve all files for configuration ':kotlinCompilerClasspath'.
> Cannot resolve external dependency org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.72 because no repositories are defined.
Required by:
project :
did you try what I suggested (manual deps)?
Yes
show me
why's it even depending on the compiler?
I honestly don't know what I'm doing anymore, I found this, but either it doesn't work, or my brain is just too small to figure out what they mean by it https://github.com/gradle/gradle/issues/10020
https://paste.helpch.at/uperanaliq.bash my build.gradle,
I've also tried something in regards to the buildscript block but that didn't work either
Ok now it's time for me to test graaljs for my js eval
Still got this hotswapping problem 
did you actually use graalvm, or are you just using graaljs over openjdk?
Just the maven repo
So in Kotlin
is the idea that top level functions are bad like in Java or should I use them wherever I can and it wouldn't make sense to create a class just to make a single method wrapper class?
they are by no means bad
And they're not a thing in java?
you should use them as a rough equivalent to util functions
But not exclusively
but yes, creating a single method wrapper class is dumb
Especially considering extension functions exist
Just the maven repo
@regal gale so I'll take that as graaljs over openjdk, fyi performance is trash on the openjdk. Use graalvm if you care
@quiet depot https://paste.helpch.at/uperanaliq.bash
@quiet depot wait OpenJDK performance is trash? I just use it because I use Linux and it's kinda standard lol
no
no it's not
ah okay
i love how spigot doesnt like my webserver and it just doesnt load images..
what's your web server?
ssl
so spigot hates ssl?
^ that'll be it
well
works with other server
works with this
http://167.86.85.157/images/SimpleCrops High-01.png
that doesn't have SSL
ye
🤷♂️
but works?
Spigot probably has a very strict policy
or my webserver is blacklisted on spigot or wia versa
why don't you have sl?
idk its some webhosting stuff i ordered pretty cheap
i didnt enable ssl on that domain
ew web hosting
here thisone has ssl
https://images.sloempire.eu/SimpleCrops/body/SimpleCrops High-01.png
disgusting
but it still doesnt work
gonna stick with contabo host for spigot then
hehe it works
oh and btw i have ssl on other domain to it just doesnt auto redirect
If that has a dependency for holograms, ew
?
it almost certainly depends on HD, no one does that themselves lol
I do :((
i dont want to deal with nms for more than 32 chars?
^
i dont update holograms i delete them after 5 secs?
and then recreate them?
well
its like if player shift clicks on crop it shows crops info
after 5 secs hologram gets removed
so
Ah I see
I'd just do the NMS myself, it's actually really easy if you do it right
you just get packets, update fields using reflection, and put them back in
It'll probably also be more efficient
i have that just for looks
@heady birch does this really well in KiteBoard (he's probably not sharing though lol)
he has holos in kiteboard?
no, but he has scoreboard NMS
oh
still NMS
i think tab also has nms
he basically has an Adapter interface with loads of methods in it, and makes an adapter for each version which he supports where he implements and makes the NMS for those methods
and then you can just call methods from the interface and it does the rest itself
the TAB (a.k.a Tab Reborn)
TAB?




