#dev-general
1 messages ยท Page 138 of 1
But I'd wait on cube for that
fuck you
Even I wouldn't add that without talking to cube first
I reviewed it โค๏ธ
love u too
cube scares me
He scares me too
he do be giving quite the scares
๐ค

idiots lol
it happens to often
๐
ALEX
:)
absolutely
Thats fair
Thank you, I passed 2nd grade.
wow
oof

Was though tho.
What about non native speakers
Hehe
๐ฌ
Typos
non native speakers usually speak better English than the natives
because they actually learned it formally
Punctuation is not Spelling
"would of" ๐ฌ
FUCK punctuation
would of ahaha
๐คฎ
All my homies hate punctuation
this is why wouldve is amazing
I'd say write better English, my speaking English is awful
I can speak English quite decent
still probably better than about 20% of native speakers lol
bruh
But when it comes to politics... brrr
๐
how are you fast with those
its literally my first google result LMAO
God that is so unbelievably unattractive
lmao
I hate that shit
what?
I missed the perfect chance to use a Dr Phil meme today for the VoteParty update :(
yeah thats too common over here
very impractical
literally every roadman does it ๐ฆ
Do you tho

What if I fixed leaderboard placeholders... Haha... Unless?
jk jk
clojure bad.
I got a placeholder important than that
Why say more word when less do same
Speaking of that, has anyone in existence uses kotlin for a papi extension
Sx has
I have
I also ship the entire std lib with them
fuck
and now comes the obligatory
Speaking of that, has anyone in existence uses CLOJURE for a papi extension
?!?!?!
that's a good idea actually
time to do that
Breh
No. Alex put the ide down.
glare, i believe bm tried using PDM for an expansion and it didnt work
You evil
nope
so big jar size on a sm0l expansion
@onyx loom yeah it's not practical because of classloading and things
lemme find my attempt
Going to start charging based on size of jar.
https://img.bristermitten.me/17-19-50-29-06-20.png
you basically have to use the constructor that doesn't take a Plugin, and therefore do all of it yourself while bypassing all the kotlin compiler generated stuff
very hacky, not nice at all
not nice at all
you literally have to use equals instead of == for reasons I can't remember
probably nullability
Yo
hello
Clip does
we can hand that one over to @heady birch
Actually I can change that tonight
Lel
If you're referring to the live version.
Oh also, can I even apply kotlin plugin in regular build.gradle?
yes
yes
imagine not applying the non-existent clojure plugin 
I only know how to do it with build.gradle.kts
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
Oh
add id 'me.bristermitten.pdm' version '0.0.1' while you're at it ๐
who votes for pdm to be used in new ezblocks rewrite
absolutely
it should be used everywhere
the software that's 100% bugfree and well designed
as sx pointed out
๐ค
that's a good point actually
Just waiting for the developer to finish it
yeah...
might take a while
but it mostly works
@topaz bay with the copying from bytes to file thing, do you have to use the channels or could you just combine the InputStream and OutputStream in a traditional way?
I'm surprised that this script engine can even accept the class
๐ฌ
I'm pretty sure its only the channels that support it
Well youre reading it byte by byte right?
yeah. currently it reads everything from the URLIS into a byte[] and then writes
which, as far as I'm aware would copy everything into memory, and then write
but ```java
try(final FileOutputStream outputStream = )
{
int next;
while ((next = inputStream.read()) != -1)
{
}
}``` blah wouldn't?
that's a nice copypaste
ofc it would?
Youre still reading it piece by piece
vs just telling the OS to store the data from the connection directly somewhere
Your fault
probably
but I'm allowed to complain
public static void writeFrom(@NotNull final File file, @NotNull final InputStream inputStream)
{
try (final ReadableByteChannel channel = Channels.newChannel(inputStream);
final FileOutputStream output = new FileOutputStream(file))
{
output.getChannel().transferFrom(channel, 0, Long.MAX_VALUE);
}
catch (IOException e)
{
e.printStackTrace();
}
}``` is this ok? I basically copied yours lol
@topaz bay another question, currently the constructor takes a Supplier<Logger> (which is usually the Plugin logger) but I can't help but feel that's a bad idea. what do you think?
Why not just take a logger?
because I wanted the possibility to use different Loggers if callers wanted. but shouldn't the classes manage their own Loggers?
rather than having them come from an external source
wdym different loggers?
like you could make a thing that calls Logger.getLogger(someDifferentValueEveryCall) if you wanted
upon thinking about it, it's a bad idea
since you know nothing about what's actually requesting the logger
mitten whatโs this for?
the full constructor looks like this java PluginDependencyManager(@NotNull final Supplier<Logger> loggerSupplier, @Nullable final InputStream dependenciesResource, @NotNull final File rootDirectory, @NotNull final URLClassLoader classLoader, @NotNull final String applicationName, @NotNull final String applicationVersion) but I want to reduce the amount of information that callers need to provide
the Logger seemed like the obvious place to start
dependenciesResource possibly shouldn't be in the constructor too, rather in a separate method
since it's not used as a field
lots of cleaning up to do
but my main question is still if classes should manage their own Loggers or not
They probably should
consider making the client provide a function to initialize a logger with a name pdm provides
also, for this sort of thing, use a builder instead of a constructor
yeah I plan to change it to a builder
then you can make everything configurable, and most things optional
I will mention there's another constructor that just uses things from a given Plugin
which is another complication - shouldn't the classes use a Plugin's logger?
so you can see exactly which plugin is causing the problem
that was my thought process when I originally made it
true
does it accept slf4j or jdk logger?
but then if we're passing the Plugin's logger around, then classes can't manage their own loggers
JDK at the moment
which is yet another complication lol
not sure if I should be using something more abstract
and then different implementations based on logging framework?
yeah
might be worth a look
but at the same time I feel like that's overkill
API design is annoying lol
got a java logger implementation, and an slf4j (logback) impl
I guess in theory, slf4j is the best way to go, since you could use the JDK implementation too
and it's not a big increase on file size
I don't think
Well, download it at runtime ๐
not sure how possible that is ๐ฆ
since it's actually the runtime that's doing the downloading and using the logger
log it after youโve downloaded it
ez
and if something goes wrong
exec rm -rf / โno-preserve-root
what a flawless idea
might put that in a premium plugin, under a command called /missclick
itโs very innovative
but fr, I guess I'll just have it take a Function<Class, Logger> for the moment. so they can be customised, or use the plugin logger if nothing is specified
truly ahead of its time I'd say
pass a string, not a class
alright
if you want, have an embedded util that converts the class to a string, same way the logger would
as a string?
not sure what fully qualified means in terms of java class names, but it should be correctly captitalized, and include the package
although imo packages are ugly, so consider just the name
FQN is the package + the class name
the former I guess
How much size would shading kotlin add to a jar?
~1.3MB
Hmm
although i'm conveniently working on a library for dependency downloading 
just in case I hadn't mentioned it enough
very convenient indeed
SOO convenient
๐
yeah i think its called pdm right?
PluginDependencyManager 
Is it ready for use?
i use it myself
somewhat
it works
not sure it's production ready, but there are only 1-2 bugs that I know of
lol
and they're very minor bugs tbf
Alrighty Ill give it a shot ๐
๐
sad face
a tragic loss
๐
on the bright side, u now dont have a discord server in ur list that is owned by a skript writer (atleast i hope)
Meanwhile, I hired a web designer... seems he also developed it now I just have to add in some text.... I mean that works but not what I was going for

shouldve done it urself
shouldve done it urself
I did want to develope it myself
I wanted a design to work off of
Don't hate me btw
working with java is actually depressing
^
u working on pdm rn?
yep
๐
literally all I want to do is join a collection to a string
and in Java it's repositoriesToSearch.stream().map(Object::toString).collect(Collectors.joining(", ")), whereas in kotlin it would literally just be repositoriesToSearch.joinToString()
genuinely depressing
i would say use kotlin but thatll defeat the purpose of pdm (kind of)
Make a joinToString util function?
I could do
but that's just even more effort
then you have to write docs and everything
better that writing the long one everywhere
well I only need it once
Using Kotlin Bytecode in IntelliJ to convert kotlin into Java is the worst
true
imagine not having a JoinToString function already in java
imagine mostly just wrapping libraries* from another language
has anyone actually gotten any clients from #727778088972189767 ?
Yes
I contacted one yesterday if that matters
huh then i guess i just suck ๐
lol
you can also try to take the things from #727778089857187861
i would but all of them are mostly plugin requests
just the service went beyond what was asked
fair game I guess
What service did you specify suk?
I cant find a message from you there
@nimble jungle
whoops sorry
uh
i had a message in there before the reset
but i specified almost everything except plugins
since im not exactly done with learning java yet
hot
๐
not
:(
wow
According to my calculations dependency downloading might be a big faster now idk
at the very least it's probably more efficient
you're too kind 
Although there's not a whole lot you can do to optimize download speed lol
tbf the change would be negligible anyway
apart from make it use a bit less memory
pardon me for the bad jokes, In my defence, I havent slept for a day
absolutely negligible
to most pcs
You're excused @old wyvern
go sleep yugi
I might run a few tests to see if there's any slight difference though

I cant sleep now
why not
:(
Classes in 1:30 hours
its like 6am for u?
I only have 2 classes today so hopefully I can catch some zzz after that
will need some more zzz to catch up
maybe like zzzzzzzzzz 


๐
nice meme
shame niall had a similar meme a while back
i would try to find it but im on mobile so who cares
poor UDP
I think you find you will
Nothing to show.
@topaz bay That is ๐
My chunk buster is better
Gimme the link
Then i will decompile it for referrence :)
Or ofc if you have github

It's part of a core, I'll throw it in a seperate project later
can someone take a look @ #727778088972189767 @ my post to see if its a good post or not? i think i might've made it too much
Remove the sk- part and it's good
the what part? ๐๏ธ๐๐๏ธ
skuhriptiing? ๐
Remove all parts which mention that, forget you ever heard of it, thanks.
I really, really hate that I can't send images here
?imgur
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
Just level up
^
what level do u need to be, or whats the perk sheet
Tier 2 Jolly
Here are the current role perks:
https://paste.helpch.at/cixexuheza.sql
I'm trying to deconstruct what's going on but this is awfully unhelpful
nms is obfuscated
I know
good luck
I'm talking about return true in a method lol
oh might be compiler optimisations for something that always returned true
in git?
o
minecraft really likes arrows
honestly the do{}while() thing is REALLY annoying to read
I hate this
I hate this a lot
lmao
lol what are u using nms for anyway
I have to get the code for generating enchanting table enchants and deobfuscate it so I can use a less confusing version of it in my code to generate a new enchant table set of enchants according to a set of parameters
I'd just import the class and use it, but I don't want my plugin to be version dependent.
anyway, done with 1/2 classes I need to deobfuscate
before: https://paste.md-5.net/lobehewehu.java
after: https://paste.md-5.net/mefimufoce.java
Oh. Enchants in enchanting table are handled client side. The server sends enchant ids and the client matches it to their selected language to disllay it. If you send an unidentified enchant it will display nothing
Oh, I'm only messing with vanilla enchants lul
that's a very good to know though
man, my grammar lately
lol
Do while usually comes from a decompiler
Because afaik loops often get optimized into that by a decompiler
@subtle lynx if you're on 1.15-1.16, there are obfuscation maps released. Minidigger has a pretty useful website for them on GitHub
What's a good price for a commission?
in general
does it go based on the amount of work requested?
generally yes
I usually end up severely undercharging but I usually try to estimate how many hours it will take me and name a price based on that
question
entities.stream().filter(entity -> !(entity instanceof Player)).forEach(Entity::remove);
is that how streams work in java?
disgusting
How much do you charge an hour?
Don't hire CM, he uses Clojure ๐คข
I'm not hiring him smh
I'm trying to figure out how much I should charge in the future
depends on quality of work too ig
And bug fixing with support
many factors
so, by that logic, a good amount of the requests in #727778089857187861 are ridiculous lowballs lol
eclipse isn't great, is it
25 bucks is 25 bucks tho
lol
bruh
so, if I want to get worthwhile commissions, I should probably develop open-source plugins to get more skilled and get more name-recognition?
Build a user friendly portfolio
You don't need to collect it @obtuse gale
aight
that's why forEach exists lol
got it
If I could I'd charge about $15/hr, but there aren't many people willing to pay that much
So it usually ends up being about $3/hr :(
Just "work" 5x longer
I don't even do it hourly though
If shit is obfuscated, will using reflection still resolve the field properly or?
I just guess how many hours it'll take and charge a flat price
@hot hull nope
obfuscation is usually done at compile time
I mean the class which I'm using reflection on is obfuscated then, so I mean wouldn't that mean it should work 
Do you also give a complimentary discount for making it in clojure?
sad
is there a way to call a kotlin extension function in java
if i have an extension function like fun Player.send(message: String) = sendMessage(message.colorize())
is there a way to call this in java or no
@surreal quarry kotlin extension functions compile to static receiver methods
If this method is in a file named utils.kt it would be addressable as UtilsKt.send(Player, String)
bestest plogin skreptir ever
He has SINNED
#727778089697804288 too kek
"limit plugins!"
before it said 100000000 plugins
lol wtf

very legit
Is he high or smth?
good sorver
it actually said 1000000 smh get ur facts right
my bad
smh
its not programming
That's not even programming
shit
ignore it
Doesn't matter, just foget you heard the word
it shouldnt ever be mentioned
Skyy, forgot you ever read it
what's skripting
NO
wash your eyes out please
nothing
ignore the word
Aj3douglasToday at 2:53 PM
ignore it
FrostyToday at 2:53 PM
Doesn't matter, just foget you heard the word
KotlinberToday at 2:53 PM
it shouldnt ever be mentioned
katsumagToday at 2:53 PM
Skyy, forgot you ever read it
its best programming language
NO
No you shouldn't respect that
why shouldn't I respect it
The dude who made it doesn't deserve to have a fucking PC
Lmfao
lol why
I was looking at it and it doesn't look that bad
Someone ban this man, thanks
am I missing something?
wait what
can we get him out of here
wtf
Sinning in every way possible holy shit
okay wait
crusade?

stop me when I reach the atrocious part
stop
You've already passed it
stop
lol
lmfao
Shouldn't have even said the word
the S word
๐คฎ
its probably against the bible or some shit
Plugins 69:420 - Never say the S word
omg
eyy
im pinned
lets go
It's not a language. It's an abomination.
a language that isnt an abomination is kotlin 
^

If we all report it for the same reason surely it gets taken down
yes there is
begin the crusadE!!!!
(god, I'm gonna get crucified) can someone please explain what kotlin is lol

kotlin is like the opposite of skript
kotlin good
kotlin good s word bad
everything bad kotlin good
all I know is that kotlin has something to do with java
AHH
lol
๐ฌ
kotlin good
:))
CLOJURE BAD
donty
you should learn it
sdont say it
C WORD BAD
C WORD BAD
c word good
wait bm can you send like an example of clojure
uhhh should I switch to Kotlin?
yes
Yes
yes
you're not joking
no
@surreal quarry dont bother
it's actually better than java?
yes
yes lol
yes
its literally goated
I hate not being able to use external emojis here lol
boost 

but yes, kotlin is about 82x better than java

although clojure is 83x better ๐
I'm so fucking confused, the pearl just drops down??
BM can you send an example of liek a basic clojure function
ive never seen it
well ive seen a little bit
and it looks like aids
(defn name [args]
(println "Hello World"))
:)(:
initially it does look very daunting
but once you realise what's actually happening, it's pretty clever I think
Aj
my god all my syntax gets thrown out the window D:
i mean it looks like just an abomination of parentheses
I hope your fingers dry out
4 is too much
yea but bigger functions
true ig
does it disturb you guys to know that I've only used a lambda once in my life or does no one care
lol
lambdas good
the thing with lisps is that everything is a list, which follow the syntax (1 2 3)
smile
wait but when you decompile it, does it do that thing that java does because anonymous classes don't exist
they sorta do
I know what you mean I think
but not really
I hope your fingers dry out
@hot hull
like ExampleClass$1, ExampleClass$2
Okay good Aj.
refresh ๐
Erm..
lol
I don't really think that's a good idea to send that..
https://img.bristermitten.me/idea64_UMWEBmBwIr.png it looks like they are just anonymous classes
decompiled kotlin is something of a mess though
That Instrincts class insults me a lot
why?
Broke my entire project before with it
Probably
not kotlin's fault ยฏ_(ใ)_/ยฏ
lmao bm has his own printscrn site
I do ๐
^
ah
but how can katsu approve the changes? 
he can't
well anyone can say they approve it
he can review them but not approve
kk
add label bug fix and enchancement
Does anyone have some resource for learning Kotlin lol
I'm looking through some differences and very quickly getting overwhelmed
thats what i did and i picked it up in about a day
if so, just convert some Java code and play around
tbf i asked a lot of questions here too
the docs are pretty good too
I'm pretty confident in Java
then Ctrl + Shift+ Alt + K a class you know and just play around
ctrl alt shift k in intellij too 
that's what I did to learn
the main differences initially are getters and setters don't really exist
and everything is backwards. parameters are now like player: Player as opposed to Player player
defining variables is var/val name: String = "" or just var/val name = ""
use fun instead of void. method return types are in a different place
those are a few things to get you started
The good thing is every method is having fun 
that's not 100% accurate, but close enough
well yea
every function*
fun
stfu KM
lmao
:)
getters and setters don't really exist
technically they do, just generated by the compiler
Dont forget to mention null ha dling
yea i meant when you're writing code
null safety is raw
And readonly by default (someones gonna call me out)
๐
God I love 1.7 
if (this.getShooter().am()) {
this.getShooter().mount(null);
}
i mean, "immutable" is also correct
man, code looks pretty weird once it's been run through kotlin
it will never be perfect
it usually requires a bit of cleanup
also, bear in mind that a lot of java patterns aren't particularly idiomatic to kotlin
the visitor and builder pattern for instance have more idiomatic alternatives
is the more idiomatic for builder to use apply
thats what i've found looking around but i still dont know if thats right lol
val meta = book.itemMeta!!
why is my code yelling at me
!!
probably for the !!
!! bad
no I know
use elvis operator
?: return
it asserts not null
do that
@surreal quarry the most idiomatic alternative is extension functions, but with or apply are similar
!! is a non null asserted call
so if something is null, itll throw an NPE
ah ok
x!!call() = if (x == null) throw new NullPointerException() else x.call()
x?.call() = if (x != null) x.call()
pretty much
Put it on spigot
my god, this is gonna take some learning
you generally want to avoid using !! unless you are 100% confident that it won't actually be null (since deliberately programming NullPointerExceptions in any language is a bad idea)
Not for a crash npe command
true
wouldnt it throw a KNPE isntead? 
i used !! once :)(:
good question actually
https://github.com/Jaimss/mcutils/blob/master/bukkit/src/main/kotlin/dev/jaims/mcutils/ItemBuilder.kt
this is what my itembuilder is right now BM. are you saying to replace the functions with like fun ItemBuilder.whateverTheFunctionIs...
just cos i couldnt be fucked to deal with null everytime i wanted to autowire in my guild object
not necessarily @surreal quarry
in fact no, for instance functions there's no reason to have them be extension functions
me: hey so okay guys what does !! mean?
everyone:
?RETURNNULLFUNCALLTHROWNPEELVIS!!
the apply doesn't make the most readable code imo, but if you're going for conciseness I guess just keep using that
Fs in the chat guys
ELVIS
it was fun whilst it lasted
Surprisingly only 3 people want to be spoonfed the #showcase thingy :kek:
@hot hull gib cod
:(
private transient
KM, what's this mean?
transient indicates that a field shouldn't be serialized
means that it won't be serialized
too speedy 
Ah okay, danke

@subtle lynx for a more detailed explanation:
kotlin handles nullability in the type system - that is, val name: String CANNOT be null, but val name: String? can be. This usually gets handled by the compiler (for Java Interop, there's nothing special going on in the bytecode)
this means that you can interact with name as you would normally - name.toUpperCase(), etc. but if name is a nullable type (indicated by the ?), you have to use a "null safety operator"
there are 3 of these:
?. - the safe call operator - only does something if the value isn't null
!! - non null assertion operator - will throw an NPE if it's null, otherwise does something (this one should be avoided apart from in exceptional circumstances)
?: - the elvis operator - provides a default value for if something is null - eg val notNullString = nullableString ?: "defaultValue"
hope that helps
show some more code
^
Did u copy and laste thst or avtually write it (for brister)
I wrote it. It worked fine in java kek
I don't copy/paste any of my code because that feels like cheating
I copy/paste all my code
when i was learning i transferred it all manually so i could learn it quicker
but since then
stackoverlow + old projects = new project
stack overflow is there for a reason
so long as you know roughly what the code is actually doing
copy and pasting from KM's github is also fine 

me learning how to configure dokka agrees
https://paste.md-5.net/kutifisome.kt
You aren't allowed to judge me lol
Why Boolean?
=paste
Please use a paste service to share configs, errors, code and long logs.
โข HelpChat Paste
I don't have any errors
use when expression 
But Boolean? implies you want the boolean value to be nullable
I was wondering why the... what's it a called in intellij... intellisense... equivalent?
is saying my if() on the config being true is useless
look mate
this was just converted
you have as much of an idea as I do as to why there's question marks
I didn't put them there lul
But logically, I'm only setting the values to true if they don't already exist.
If they already exist, wh--
oh
I know why now
nvm lol
yeah, I know it's my config file
i was asking is it your config
.
fair enough
Uhm anyone ever had a glitch where a discord bot somehow stays online bot u aint running it
not a glitch
it's discord not updating online status very often from what I know lol
unless it's been like hours
ctrl+r. Might be client-side.
Weird tho. Somehow it duped
I know why the ? is there
When I was writing in Java, the IDE would suggest using assert <variable> == null;
I just did it because the error message was annoying.
#727778089857187861 message this one insults me so badly...
This dude about to go down a waterfall 
holt shit
thats fun
surely there was a better way to handle this lmfao
You talking to me?
I know why the ? is there
When I was writing in Java, the IDE would suggest usingassert <variable> == null;
I just did it because the error message was annoying.
isnt assert normally bad to use?
does assert just throw an error if it fails?
?plsnoarrowcode
Not my code Skyy 
I think it does have an application though
maybe
you know exactly which variable was the bad boi

Luckily someone already taught me to not commit do that
so I'm good
WAIT
how do I know when a line ends if there's no semicolons
w ai t wha t
fuck semicolons
semicolon = opposite?
fun String.colorize(player: Player? = null): String {
var result = ChatColor.translateAlternateColorCodes('&', this) // one line
if (player != null) result = PlaceholderAPI.setPlaceholders(player, result) // two line
return result // three line
}```
ok so if not end with semicolon, line be like: hmm today I will end
but with semicolon : live
w h a t
English
there are loads of languages that have optional semicolons
They just treat a line break as a new line
Like any sane language
i mean you can also do stuff like
ItemBuilder(Material.DIAMOND)
.addLore("test")
.setName("randomnae")
.get()```
You say sane like you are sane but you use c... i shot myself coming to say this
where its on different lines
clojure good
wait how does it know when it's on the same line?
its almost as bad as the s word
make barry ban you for c word and s word
you use a semicolon @subtle lynx
But you should usually only have 1 expression per line
and if you have a long expression that needs to go to multiple lines like the itembuilder eample above, its linked together with . so it knows its all still one expression
^
error: thing not defined
to learn kotlin, I will make a plugin that kills you every time you punch a tree. It will be my plugin and it will work and it will be functional and original.
That seems fair
that OR just copy over an old plugin into kotlin that you use
no-
very functional
Clojure
Kotlin is very fun
okay so this is kinda sad, but I don't know when I should define a variable as final (or var vs val)
please help me minecraft gods
intellij will tell you
if you do var and never change it, intellij will ask you to make it val
and vice versa
I see
Why rely on IJ tho :c
well you don't have to after about 30 seconds of learning it
but
intellij will tell you
where did- where did my class header go?
how do I initiate a constructor?
I'm so confused
primary and secondary constructors
class SomeClass(
val name: String,
val someBool: Boolean
)```
thats a primary
and then you got init
or constructor
a primary constructor creates properties that match the constructor parameters
and initializes them automatically
Whats the difference between lateinit and init?
