#dev-general

1 messages ยท Page 164 of 1

dusky drum
#

but

#

i hate packets

#

since you have to add support for every single version

#

and adding 1.8 to 1.16 support isnt fun

old wyvern
#

simplesimple

dusky drum
#

or whatever

#

is it

heady birch
#

Pr or shutup

#

How TF he put them all in one package

dusky drum
#

:?

#

dont friking ask me how he does it

#

its not all in 1

obtuse gale
#

Any ideas how to improve it?

hot hull
#

Damn that is sexy

obtuse gale
#

Took me whole yesterday to implement

quiet depot
#

you using bkcommonlib?

obtuse gale
#

Like 8 hours but I think it can be improved a bit

#

you using bkcommonlib?
@quiet depot me?

quiet depot
#

yes you

obtuse gale
#

nope

quiet depot
#

bkcommonlib has some phenomenal map apis, definitely worth checking out

obtuse gale
#

Will check it out then

#

Yeah the map api I just chose randomly the first working

quiet depot
obtuse gale
#

that makes me wanna do something with maps....

#

Does that work only with having it in the hotbar?

quiet depot
#

would work in offhand too

obtuse gale
#

Like not making the player update the hands?

#

I am struggling with that yeah

#

Will definitely check it out

quiet depot
#

I used it to make a server selector for a server I worked for back in 2018

#

it's a really good library feature wise

#

loads of cool shit

obtuse gale
#

Is the api documented for the maps?

quiet depot
#

When I messed around with it, no

#

but the author had only just added it to bkcommonlib when I used it

#

so that may have changed by now

obtuse gale
#

As on the spigot page there is no link on the map feature as on the other stuff

#

Is there maybe a project already using it?

quiet depot
#

the map apis are documented

#

javadoc site is down, you have to generate them yourself

#

regarding usage

#

I'd recommend just contacting the author (bergerkiller)

obtuse gale
#

Got it

#

Directly or on his discord?

quiet depot
#

didn't know he had a discord

#

when I used the library, I contacted him via spigot pm

obtuse gale
#

Yeah I thought he would have it as I was reading the reviews and it talked about the discord. But I can't find it

quiet depot
#

might be worth a search before contacting him directly actually, just to see if you can find any examples

#

it could have a wiki

obtuse gale
#

Looked at the github wiki and it doesn't really have anything

#
    /**
     * Loads a map texture from an image
     * 
     * @param image input image
     * @return loaded texture
     */
    public static MapTexture fromImage(Image image) {
        return new MapTexture(image.getWidth(null), image.getHeight(null), MapColorPalette.convertImage(image));
    }
#

So from what I am looking at in the code I could just use the fromImage and it would create a MapTexture without reworking any of my code, what is the map object?

topaz remnant
#

why paypal doesn't have dark theme

obtuse gale
#

Just use dark reader

topaz remnant
#

thanks

obtuse gale
#

no problem

static zealot
#

or just send all your money to my account so you won't have to join to check it anymore

obtuse gale
#

ok

regal gale
tacit cave
#

uh hello

#

can someone check

#

?

#
boolean isone8 = Package.getPackage("net.minecraft.server.v1_8_8") != null;```
empty flint
#

Should I write a parser to parse command syntax or parse it verbosely myself?

tacit cave
#

how do i check if player's server mc v is 1.8.8?

surreal quarry
empty flint
#

how do i check if player's server mc v is 1.8.8?
@tacit cave Bukkit.getBukkitVersion()

surreal quarry
#

i answered you

errant geyser
#

@empty flint up to you, though a parser would probably be faster

empty flint
#

@empty flint up to you, though a parser would probably be faster
@errant geyser I think it might increase the size of the jar though :/

#

/br -c -r rankA "Rank A" -s "sound effect" -p "particle effect" -ar -sr rankA -a worldA, worldB

is that an ugly command?

#

/blockyranks create rank rankA "Rank A" sound "sound effect" particle "particle effect" auto-rankup start-rank rankA available worldA, worldB

this would be the non-abbreviated version

errant geyser
#

I think you should allow both.

#

If someone wants to use the abbreviated version, expand it out into the full word, and then parse that

empty flint
#

I think you should allow both.
@errant geyser Yeah that's the plan of course. I'm asking more for a general opinion about the command format. is it legible, clear and concise...

#

in this case "Rank A" is the display name that's separate from the id of rankA

errant geyser
#

I think it might increase the size of the jar though :/
Elara's parser is 19KB all up.

I think the command is ok, there's not really much you can improve. Just make sure tab completion is on, and you document the syntax

empty flint
#

yeah

#

Elara's parser is 19KB all up.

I think the command is ok, there's not really much you can improve. Just make sure tab completion is on, and you document the syntax
@errant geyser What's elara's parser? I'm getting some Photobioreactors as search results on google

errant geyser
prisma wave
#

elara good

errant geyser
#

that ^

prisma wave
#

@empty flint antlr is pretty good for lightweight parsers

remote goblet
#

alright i gotta work on this skyblock plugin again

prisma wave
#

and there are loads of command parsing libraries out there too

#

@remote goblet use clojure

remote goblet
#

Absolutely fucking not

#

that language is garbage

errant geyser
#

Does that even have Java interop

remote goblet
#

the most pointless shit ive ever seen

prisma wave
#

yes

#

pointless?

#

what's pointless about it

remote goblet
#

why would you make a language

surreal quarry
#

uh oh ori

remote goblet
#

that requires you to use () excessively

surreal quarry
#

you're gonna make him mad

#

and hes gonna get xp

remote goblet
#

I hate it, i dont care if its the latest circlejerk

#

its dumb and pointless

surreal quarry
#

lmao

prisma wave
#

speaking objectively here

#

it's literally no different to having {} everwhere

surreal quarry
#

except {} looks nicer than () imo

errant geyser
#

I hate it, i dont care if its the latest circlejerk
Its not, Elara is fingerguns

prisma wave
#

lisps just have a single symbol instead of {}, (), ., ::, etc

#

the syntax is easier to learn that way

empty flint
#

@empty flint antlr is pretty good for lightweight parsers
@prisma wave I tried to make one in Java and it added a couple MBs worth when I included the necessary ANTLR libs

surreal quarry
#

i feel like its harder to read tho bm

remote goblet
#

logically speaking

prisma wave
#

eh

surreal quarry
#

unless you get rainbow parenthesees fingerguns

remote goblet
#

it just makes the code look messy and java/kotlin syntax isnt difficult

prisma wave
#

after the initial learning curve it's fine

remote goblet
#

clojure isnt a groundbreaking language, it's simply stupid

prisma wave
#

it's literally not though

remote goblet
#

it literally is though

prisma wave
#

it's really widely used in enterprise stuff

#

because it scales really well

#

it's fast, efficient to use

empty flint
#

Why would Clojure be better to write a Skyblock plugin in, instead of say Java or Kotlin? (except for the obvious Java bad tautology)

remote goblet
#

I seriously don't see the reason to use it

prisma wave
#

circlejerking aside it probably wouldn't be

surreal quarry
#

Kotlin

#

would be best

#

imo

remote goblet
#

You're just beating () into submission instead of null

old wyvern
#

Also, sometimes lisps can be more* clear on whats happening than normal languages

empty flint
#

So Elara or ANTLR4? First to comment wins

prisma wave
#

not the same thing

remote goblet
#

blocky

#

y u no pfp

old wyvern
#

Otherthan that idk ๐Ÿคทโ€โ™‚๏ธ

empty flint
#

y u no pfp
@remote goblet idk what pfp means

errant geyser
#

Elara is a language Borzan, not a parser

remote goblet
#

y u no profile picture

prisma wave
#

lisps are fine

old wyvern
#

xD

remote goblet
#

you guys spent a long time telling me to put the skyblock plugin in kotlin

#

and when its finally in kotlin you're telling me to put it into some dumb uncirclejerk worthy language

prisma wave
#

I wouldn't write a a plugin in clojure because spigot is way too OOP based

#

some enterprise application? sure

old wyvern
#

Elara or ANTLR4They have nothing in common but I go for Elara

#

xD

empty flint
#

y u no profile picture
@remote goblet Cuz I'm shy like that.

remote goblet
prisma wave
#

and yet

empty flint
#

yeah its a no for me sir
@remote goblet Oh my god what is that abomination

remote goblet
#

that is clojure

prisma wave
#

that would be at least double the code in kotlin or something

onyx loom
#

clojure bad

remote goblet
#

the current circlejerk language that brister is preaching to everyone

onyx loom
#

prove me wrong

prisma wave
#

I'm not even circlejerking here

empty flint
#

Elara or ANTLR4They have nothing in common but I go for Elara
@old wyvern Never used Elara, dunno what it actually does. Somebody said it's good for a small parser.

old wyvern
#

Wtf? xD

#

No

errant geyser
#

I didn't

surreal quarry
#

loL

old wyvern
#

Its a language a few of us are working on

#

lmao

prisma wave
#

the syntax is kinda ugly at first, but jokes aside, it's a very powerful language

errant geyser
#

I said it has a parser, and it might help you a bit when making your own

onyx loom
#

uve never used elara because it isnt even out yet Kappa

empty flint
#

I didn't
@errant geyser Oh did I misunderstand? My bad

hot hull
#

Elara ew

remote goblet
#

most if not all languages are powerful in their own way EmiShrug

surreal quarry
#

gonna make a huge elara pr. i expect it to be merged instantly

empty flint
#

Got it, ANTLR4 it is then

old wyvern
#

Elara ew
Frosty ew

errant geyser
#

Frosty you trying to start a crusade

hot hull
#

I know angry_fingerguns

old wyvern
empty flint
#

What's Elara for then?

hot hull
#

@errant geyser Me? No? Yes? Maybe?

prisma wave
#

@remote goblet that's true, but clojure is particularly good for big scalable apps

#

it's efficient and powerful while maintaining conciseness

errant geyser
#

@empty flint its just a language that a few of us are working on

old wyvern
#

What's Elara for then?
Its a general purpose functional programming language that isnt even complete yet

remote goblet
old wyvern
#

ea

#

yea

prisma wave
#

functional programming good

old wyvern
remote goblet
#

it actually functions

empty flint
#

Alright, ANTLR4 it is.

old wyvern
#

for what block?

remote goblet
#

but idk how much i enjoy it all being in a specific row

prisma wave
#

@old wyvern elara is kind of a unique paradigm

winter iron
#

my plugin too big for spigot, what file upload service shouldi use

prisma wave
#

extension functional programming

#

i guess

remote goblet
#

how big is your jar file

old wyvern
#

xD

remote goblet
#

lmao

surreal quarry
#

make jar smaller sensei

winter iron
#

3 gigs

surreal quarry
#

LMAO

#

what

winter iron
#

im capping

surreal quarry
#

how

winter iron
#

its 13mb

remote goblet
#

use pdm WeSmart

heady birch
#

Use rust

winter iron
#

i will later

remote goblet
#

also what did you do

surreal quarry
#

yea use pdm but how is it 3 gigs lmao

remote goblet
#

compile everything directly into your plugin

winter iron
#

what should i use for now

remote goblet
#

its 13mb, that was cappin

prisma wave
old wyvern
#

Imma add the diamond operator in a bit and probably split up the parser a bit

winter iron
#

MB

#

13MB

remote goblet
#

ye

#

whatever my brain no work

winter iron
#

D

#

XD

prisma wave
#

please

#

someone criticise clojure

#

i want xp

#

i beg of you

surreal quarry
#

clojure bad

heady birch
#

Wack

prisma wave
#

please back up your claim

heady birch
#

Whack

old wyvern
#

someone criticise clojure
Clojure shit

#

Shut up barry

surreal quarry
#

its a garbage language that when you come down to it and look at its roots from a bare minimum type of standpoint and a lower down lever where you can really see it from a more objective view, its shit cause () ugly

#

i need xp too fingerguns

prisma wave
#

that means literally nothing

#

lmao

onyx loom
#

clojure bad

surreal quarry
#

yea ik bm

prisma wave
#

when you come down to it and look at its roots from a bare minimum type of standpoint and a lower down lever
Thonk

heady birch
#

They literally copied the tweets... I found the originals:
Our Rust system just handled its first Walmart black Friday and came out without a scratch

When we needed to extract insights from hundreds of thousands of requests per second in realtime, we knew Rust was the answer. Rust is really awesome for general stream processing

old wyvern
heady birch
#

They are so corny

prisma wave
#

LMAO

#

@heady birch

#

shut up

heady birch
#

So corny

prisma wave
#

ok did I mention lisp has metaprogramming

#

which is cool

heady birch
#

Who the heck thinks " ok we need a super fast realtime language " "clojue"

onyx loom
#

experts say that 99% of users dislike clojure. the other 1% are delusional

prisma wave
#

๐Ÿ™„

#

nobody able to make a good point

#

nobody to argue with

#

smh

onyx loom
#

why cant u argue with the experts?

surreal quarry
#

lmaoo

heady birch
onyx loom
#

do u know its because the experts are correct?

old wyvern
#

sheesh we already on von neumann's ass now

prisma wave
#

that's not clojure

#

@heady birch

heady birch
#

I hate that so much

#

People literally go on facebook

#

Post

#

Some link to a CNN article

#

"Omg why is the media not covering this???"

onyx loom
#

facebook in a nutshell

old wyvern
#

how many messages for 3.5kxp? xD

onyx loom
#

its all the grannies saying it too

prisma wave
#

clojure paragraph

heady birch
#

Clojure developers about to sign up for life insurance

prisma wave
#

no

#

rich will protect me

heady birch
#

Born in 1950s or whatever

#

@prisma wave You know a good Tape storage library for clojure ๐Ÿฅบ

prisma wave
#

born to clojure, forced to java ๐Ÿ˜ญ

#

yes

heady birch
#

Floppy Lib

onyx loom
#

java > clojure

surreal quarry
#

born to java; guided to the light of kotlin

old wyvern
#

clojure, better known as cl-usterfuck, is a language known for its incompetency in a proper parsing algorithm requesting the user to code a tree-list format. I need a few more lines so read on bois idk, hows life, whats chu been up to. Fine? ok gn

#

not enough oof

onyx loom
#

๐Ÿ˜‚

old wyvern
#

that was about 150 xp

heady birch
#

Lol

onyx loom
#

clusterfuck

heady birch
#

Lol

prisma wave
#

clojure, better known as cl-usterfuck, is a language known for its incompetency in a proper parsing algorithm requesting the user to code a tree-list format. I need a few more lines so read on bois idk, hows life, whats chu been up to. Fine? ok gn
@old wyvern so wrong

#

so wrong

#

๐Ÿ˜ฆ

old wyvern
#

oh 9x multi going on

surreal quarry
#

yea lol

old wyvern
#

so wrong
@prisma wave
lets discuss why this is NOT wrong

onyx loom
#

kotlin, better known as the best language, is competent in every way, outperforming java itself in many scenarios in terms of performance while offering a large stdlib that java simply does not provide. furthermore, kotlin good.

old wyvern
#

Please describe your problems with considering the given language as inherently bad

#

Idk how make that longer

heady birch
#

(he (about (to (talk
))))

onyx loom
#

(l(o(l)))

prisma wave
#

๐Ÿ™„

old wyvern
#

(oh (god(what([a b c d e f g])))))()()()()00000)))))))

prisma wave
#

dynamic languages are objectively easier to write than static languages

hot hull
#

Y'all wack

old wyvern
#

Oh are we going to that then

#

JS boi

onyx loom
#

ur wack frosty

old wyvern
#

Have you learnt nothing from javascript xD

surreal quarry
#

frosty so wack

prisma wave
#

js isn't bad because it's dynamic

#

it's bad because of it's weak typing

old wyvern
#

Eh, python

prisma wave
#

duck typing

#

functional programming also reduces bugs a lot

old wyvern
surreal quarry
#

(w(h(a(t)))

prisma wave
#

that's js

#

clojure wouldn't do that

old wyvern
#

wouldnt do what?

remote goblet
#

i haste this plugin

prisma wave
#

hmm a is a string,

few minutes later....

a:
@old wyvern

old wyvern
#

Dynamic typing

prisma wave
#

dynamic typing != weak typing

old wyvern
#

oh nvm xD

steel heart
#

is it safe to clone a HashMap<HashMap<K, V>> ?

empty flint
#

Do you guys think generating a g4 file from a java class will be difficult to do?

#

or Kotlin class even

prisma wave
#

what

#

and what

#

what are these questions

steel heart
#

idk I remember something went wrong last time I cloned a nested hashmap if its called that

empty flint
#

is it safe to clone a HashMap<HashMap<K, V>> ?
@steel heart Safe with regards to what aspect?

steel heart
#

I just need a shallow copy

empty flint
#

I just need a shallow copy
@steel heart Why would that be unsafe?

steel heart
#

Well I want to clone a Map with its values and keys as well

empty flint
#

Well I want to clone a Map with its values and keys as well
@steel heart Doesn't map provide a clone() method? That should work, I think?

steel heart
#

Not just creating a new map with the same instances

#

of keys and values

#

not what I think of, afaik cloning a map will only clone the map object but it will still have the same key and value instances

#

well I think im out for a deep copy

ocean quartz
#

Interesting, just found that t__est__ is not a valid syntax in commonmark but it is in discord - t__est__ .-.

steel heart
#

oof

ocean quartz
#

might need to fork it yikes

hot hull
#

@steel heart That is disgusting.

steel heart
#

huh?

#

what is

hot hull
#

HashMap<HashMap<K, V>>

steel heart
#

thats the implementation

prisma wave
#

not even valid syntax

#

smh

steel heart
#

yah

hot hull
#

Doesn't matter, disgusting either way.

steel heart
#

how should I avoid it then frosty

#

Consider its a Map<EntityType, Map<ItemStack, Double>> and well I could obviously encapsulate the Map<ItemStack,Double> although that wouldn't take away the map

prisma wave
#

Table

steel heart
#

idk

empty flint
#

alright fuck it, does anybody have a great command framework they are happy with? I wanna see what's out there before I go writing my own...

#

Matt has one that I know of

steel heart
#

I dont like annotation command frameworks but matts is good, I mean if you like annotations, perhaps try aikars

#

or maybe Brigadier

#

not even valid syntax
@prisma wave it is now

#

also does HashBasedTable hash both R and C ?

prisma wave
#

what

steel heart
#

yeah?

#

Table<R, C, V>

#

does it has both R and C or only R or only C ?

prisma wave
#

I have no idea what that means

steel heart
#

well Table has 2 keys kind of right?

#

does it hash both keys?

prisma wave
#

Under the hood it's just a nested map afaik

#

So yes

steel heart
#

R C

#

aight thats pog then

old wyvern
#

Row Column and Value

#

R C V

#

@steel heart

steel heart
#

yeah

#

it was for alex

#

maybe I was unclear

old wyvern
#

What was for alex?

old wyvern
#
R C
aight thats pog then```
I assumed You wanted to know what R and C was
steel heart
#

no I tried to tell alex that but I was dumb enough not saying their actual meaning

old wyvern
#

Ah

jovial warren
#

@prisma wave You'll probably know this:

Basically, I have a command on my bot that gets the project version and specific other versions and formats it in to a string, I've got that working using a YAML file, but I'm struggling with the processResources task. Now I've got to where I can use ReplaceTokens to replace specific tokens in the version, replacing the project version is easy, but I can't figure out how to get dependency versions of already declared dependencies

prisma wave
#

project.dependencies is possible in gradle I believe

#

check how pdm does it

#

pdm-gradle/blah/PDM.kt iirc

jovial warren
#

alright

remote goblet
prisma wave
#

try clojure :)

remote goblet
#

suck my third dick brister

#

:D

winter iron
#

@prisma wave its time

#

pdm

#

incoming

prisma wave
#

pdm

#

pdm

jovial warren
#

@remote goblet you probably fucked something up when shading the JAR

old wyvern
#

pdm tsss

#

ok.. bad joke

remote goblet
#

shush yugi

prisma wave
#

ha

jovial warren
#

@prisma wave don't see anywhere where you do what I want to do in PDM.kt

prisma wave
#

might be in GenDependenciesTask

jovial warren
#

I need to get versions from already declared dependencies

prisma wave
#

can't remember

#

yeah

winter iron
#

so with pdm

#

i dont need shadowJar right?

prisma wave
#

nope

winter iron
#

so so so so

#

it returns completeableFutre

#

do I need to wiat for that before loading anything else right?

#

pdm.loadAllDependencies().thenAccept

prisma wave
#

you need to either use a callback

#

or block

#

so yeah

remote goblet
#

i hate this plugin and everything it fucking represents

steel heart
#

lol

prisma wave
#

doesn't represent clojure clojuremoon

steel heart
#

pure hatred

remote goblet
#

okay brister

#

you're like

#

somewhat intelligent

steel heart
#

thats a compliment

remote goblet
#

why the fuck is this being gay EmiAngry

jovial warren
#

show the error

#

wait hold on

winter iron
#

=aste

jovial warren
#

are you using Kotlin reflection?

winter iron
#

=paste

compact perchBOT
#
HelpChat Paste

Please use a paste service to share configs, errors, code and long logs.
โ€ข HelpChat Paste

remote goblet
#

YES

#

oof

#

caps lock

jovial warren
#

you realise you need a dependency for that right?

winter iron
#

elp

#

me

#

pls

#

idk whats going on

#

its not download dpendencies

#

I think

remote goblet
jovial warren
#

implementation 'org.jetbrains.kotlin:kotlin-reflect:1.4.0' @remote goblet

#

lol

remote goblet
#

use brain

#

please

old wyvern
#

You didnt shade kotlin @winter iron

winter iron
#

im using pdm

remote goblet
#

"lol"

#

its already there

winter iron
#

at least I think im using it

jovial warren
#

okay

prisma wave
#

@winter iron send code and buildscript

old wyvern
#

private val managers: MutableMap<KClass<out Manager>, Manager> = HashMap()Ori

prisma wave
#

ew

#

ew

old wyvern
#

You have that

#

It tries to create the instance before pdm runs

hot hull
#

big ew

prisma wave
#

^

#

wise

old wyvern
#

lazy that or something

remote goblet
winter iron
jovial warren
#

also just a side note, you know expression functions exist for a reason right btw?

prisma wave
#

@winter iron main class?

winter iron
#

sec

jovial warren
#

@prisma wave can a for declaration be a return value in an expression function? just curious lol

old wyvern
#

no

#

loops arent expressions bard

remote goblet
#

lazy that or something
@old wyvern CBUWot

jovial warren
#

@old wyvern true

old wyvern
#

yea that probably wont work since it needs the kotlin classes right. How about handling those in another class and loading it after pdm runs?

jovial warren
#

if you're using variable arguments can't you convert it to an Array<out T> by prefixing the variable name with * btw?

#

in which then you could use forEach on

prisma wave
#

@winter iron you can't use any things in the main class like that

#

because the classes won't be found at first

winter iron
#

wdym

#

what do i do

prisma wave
#

do everything in the onEnable

#

or not in the main class

#

or lazily

jovial warren
#

also just curious @remote goblet , why is the command the one that registers itself?

prisma wave
#

also

#

in kotlin

#

you have to do the entire pdm thing in 1 line

#

making the builder etc

winter iron
#

PDMBuilder(this).build().loadAllDependencies()

dusky drum
#

what if we use compile instead of pdm?

jovial warren
#

you don't lol

#

and don't use compile it's deprecated (Gradle 6+ or something idk)

old wyvern
#

bm you should probably have pdm shade kotlin. That way its probably less error prone

empty flint
#

@ocean quartz can I dm you regarding your MF command framework?

jovial warren
#

his DMs are open all the time

steel heart
#

he seem to be inactive atm

jovial warren
#

ยฏ_(ใƒ„)_/ยฏ

empty flint
#

Still I want his permission

jovial warren
#

hey who here thinks I should make Octo available for Spigot as well as JDA lol

#

99% of you have no idea what I'm on about

old wyvern
#

what the hell is octo?

jovial warren
prisma wave
#

@old wyvern dont really wanna add 2mb to the lib

old wyvern
#

oh nice

prisma wave
#

it could download kotlin

#

maybe

lunar cypress
#

It shouldn't download kotlin if it doesn't need it

jovial warren
#

it was only originally built because abstraction is impossible in MFJDA

winter iron
#

@prisma wave I still dont rly get what u mean :(

PDMBuilder(this).build().loadAllDependencies()

lang = LangFile(this)
refundGui = RefundGui(this)
purgeInventoryGui = PurgeInventoryGui(this)
#

i done this

#

but ik its incorrect

#

i just made it 1 line

prisma wave
#

join()

#

or callback

jovial warren
#

Octo 2.0 now has an abstract CommandManager allowing you to write your own way of handling commands

#

which was needed for BardyBot's new GuildCommandManager, which supports per-guild prefixes

old wyvern
#

Octo 2.0 now has an abstract CommandManager allowing you to write your own way of handling commands
Isnt that against what it is trying to do?

jovial warren
#

it still has a DefaultCommandManager built-in which contains the old functionality, meaning you don't have to write your own implementation if you don't want to/need to

ocean quartz
#

@empty flint Sure, though you can always ask here it'd be the same

steel heart
#

@prisma wave would HashBasedTable<>(HashBasedTable<>) or HashBasedTable#clone return a deep copy ?

prisma wave
#

probably

jovial warren
#

a deep copy?

steel heart
#

yeah

jovial warren
#

what is a "deep copy"?

prisma wave
#

actually

#

probably not

#

depends how you mean

#

it wouldn't copy each element

steel heart
#

I want do deep copy rows, columns and values

#

aw

prisma wave
#

clone() is way too unpredictable for that

steel heart
#

true

#

well maybe I have to use iteration then

jovial warren
#

clonewill literally clone the object, probably producing a new hash code and that's the only thing that's different

steel heart
#

no clone on a normal map will only return a shallow copy afaik

jovial warren
#

stop with these terms I've never heard of lol

winter iron
#

@prisma wave I still have no idea what to do, sorry for being big pain

steel heart
#

it will have same instances of keys and values as the original

#

deep copy is when you copy a map with it keys and values to manipulating the original one wont affect the copied one

jovial warren
#

ah okay

#

ImmutableMap.copyOf will do that

steel heart
#

maybe Im wrong

#

but something like that

old wyvern
#

You could recursively copy it your self witha fucntion?

steel heart
#

yeah

#

thats what I have to do

#

ImmutableMap.copyOf will do that
@jovial warren well its a Table this time

jovial warren
#

ah okay

#

is a table something from Java or a third-party library?

steel heart
#

guava

#

a map with 2 keys basically

jovial warren
#

ImmutableMap literally comes from Guava

#

there might be an equivalent for tables

steel heart
#

maybe ImmutableTable.copyOf

jovial warren
#

that'll be it

jovial warren
#

but ImmutableTable.copyOf will create an immutable table object

old wyvern
#

yea

#

No

#

The content is immutable

#

A Table whose contents will never change

jovial warren
#

still immutable

steel heart
#

so it would be a deep copy then ?

old wyvern
#

The table itself isnt immutable unless you declare it as final bard

jovial warren
#

if it's contents are immutable it's basically immutable since what else are you going to change

#

except for the object itself

old wyvern
#

You can change the reference

#

yes

steel heart
#

I wonder if I call ImmutableTable.of() would make the maps Immutable as well

old wyvern
#

No

steel heart
#

aww man

jovial warren
#

ImmutableTable.of() creates a new ImmutableTable object, a table with immutable values

old wyvern
#

Despite the method name, this method attempts to avoid actually copying the data when it is safe to do so. The exact circumstances under which a copy will or will not be performed are undocumented and subject to change.Hmmm

jovial warren
#

I'm glad all this is built-in to Kotlin lol

prisma wave
#

Tables aren't

old wyvern
#

ImmutableTable.of() creates a new ImmutableTable object, a table with immutable values
Yes, emphasis on immutable values

hot hull
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

loud gyroBOT
#

โ”ฌโ”€โ”ฌ๏ปฟ ใƒŽ( ใ‚œ-ใ‚œใƒŽ)

hot hull
#

Here's your table fingerguns

old wyvern
#

โ”ฌโ”€โ”ฌ๏ปฟ ใƒŽ( ใ‚œ-ใ‚œใƒŽ)

prisma wave
#

here's your clojure moon

steel heart
#

values only then?

old wyvern
#

What bad?

steel heart
#

ImmutableTable.of() creates a new ImmutableTable object, a table with immutable values

old wyvern
#

yea, ofc it cant handle the reference thats with you

#

actually nvm I might be just off my head

steel heart
#

okay well anyways thanks for the help I will try see whats actual immutable when calling the copyOf method

old wyvern
#

yea nvm it is immutable technically

steel heart
#

Consider it returns Immutable Collections for everything probably

jovial warren
#

@prisma wave no but collection mutability is

steel heart
jovial warren
#

like if you want a mutable list for example, you have to explicitly say "I want a mutable list" by using the mutableListOf() function to give you a MutableList<T>

#

listOf(), which gives you a List<T>, is immutable

prisma wave
#

bruh

#

i know

jovial warren
#

I wasn't explaining it to you (though I know it looks like that lol)

prisma wave
#

i was like the second person here to use kotlin

steel heart
#

flex

jovial warren
#

I have no idea where in that list I am lol

#

I got convinced by my mate kacgal that Kotlin is a good language

#

(though I had already got obliterated by sx, surprise surprise, but I kinda deserved it since I thought Java + Lombok was better than Kotlin lol)

steel heart
#

lombok

#

jesus

jovial warren
#

do you even remember that argument BM?

hot hull
#

"lombok"

#

Jesus

prisma wave
#

i do

#

it was

#

interesting

jovial warren
#

diabolical

prisma wave
#

the circlejerking was strong

steel heart
#

lol

jovial warren
#

I did get convinced though

steel heart
#

we need a sxt comeback

jovial warren
#

no way lol

#

I'm glad he's gone

steel heart
#

he is kinda cool ngl

#

and he did help out even though he did flame some of us here and there

jovial warren
#

he's an obnoxious little brat who doesn't like it when he doesn't get his own way

steel heart
#

thats one way of seeing it Ig

hot hull
#

Bardy, drop the convo, ktnxbye

jovial warren
#

I mean, I am a bit of a hypocrite by saying that

steel heart
#

we're all

#

except

#

this clojuremoon

lunar cypress
#

Omg where is this emote from

old wyvern
#

Elara land

jovial warren
#

lol

steel heart
#

it will soon be everywhere

lunar cypress
#

Sure hope so

prisma wave
#

sxtanna good

#

clojure moon good

ocean quartz
#

He's chaotic good

steel heart
#

aren't we all at some point ?

ocean quartz
steel heart
#

not too bad

ocean quartz
#

Only way i could think to get the follow up gradient to color it
Still not sure how i'll do this though

remote goblet
#

okay i give up with pdm

#

it only causes issues

prisma wave
#

๐Ÿ˜ก

remote goblet
#

ive been having a mental breakdown for the past

onyx loom
#

theyre not issues, theyre features

remote goblet
#

30m-1hr with it

#

causing NoClassDefException is a feature PanPolice

prisma wave
#

send main class

ocean quartz
#

Does if (color instanceof Gradient) throw npe if color is null?

prisma wave
#

no

ocean quartz
#

I don't think so right

#

Yeah

prisma wave
#

instanceof will never npe

steel heart
#

Class#isInstance does throw npe though iirc

ocean quartz
#

i guess it's similar to if (" ".equals(null))

ocean quartz
#

And i need the space to keep the colors from before to carry on in case needed >.<

hot hull
#

space.trim(false);
fingerguns

ocean quartz
#

It's trimmed by commonmark fingerguns

#

Since i need to fork it anyways i might just try removing the trimming thonking

ocean quartz
old wyvern
#

ayy damn gg matt

surreal quarry
#

damn that looks awesome

ocean quartz
#

Going super well ;p
Only a few things left, the trimming problem, need actions to also work not working yet since the changes and the damn commonmark problem of not validating characters next to __

surreal quarry
#

for gradients do you just have to loop through every character and set a color for it

ocean quartz
#

Yeah

#

Took the method from Nicole ๐Ÿ‘€

steel heart
#

ngl I'm excited to see the end result

ocean quartz
#

Same hopefully i can finish this soon, been on this for almost a month xD

turbid chasm
empty flint
#

@prisma wave I got a Kotlin question for you:

I have added a dependency on a library to my project.

Somewhere in there, there's a .kt file with the following regex declared:

#

internal val OPTION_NAME_RE = Regex("^(-$OPTION_CHAR_CLASS)|(--$OPTION_CHAR_CLASS+([-_\\.]$OPTION_CHAR_CLASS+)*)$")

#

Is it possible to change that internal val to something else?

#

Maybe via reflection or whatever?

#

make it a var and change its value?

prisma wave
#

there's reflection yeah

old wyvern
#

Isnt it going to very hard to modify a internal value tho?

prisma wave
#

it would be delightfully hacky though

#

no different than any other value afaik

#

although maybe

old wyvern
#

Isnt the name jumbled up after compilation?

prisma wave
#

not that I know of

#

it might be

#

idk

old wyvern
#

I remember something like that from the course

#

Let me check

prisma wave
#

oh yeah it does

#

it adds the module name and a $

empty flint
#

Can you help me out on how to do it?

prisma wave
#

using kotlin-reflect would probably be better

#

Although I'll just warn you that this will probably break something

empty flint
#

hm probably easier to clone the repo and compile the code myself then, right?

old wyvern
#

oh its just the module and $

#

?

prisma wave
#

According to my googling yeah

#

Something like that

old wyvern
#

oh yea true

empty flint
#

Hm can gradle import a dependency that is locally compiled? Like from another project and another folder?

old wyvern
#

yea

surreal quarry
#

mavenLocal() repository

dusky drum
#

@ocean quartz thats so op make like placeholders for PAPi so everyone can use gradients :3

jovial warren
#

anyone got any idea why Array isn't a subclass of Iterable?

old wyvern
#

Coz its not a Collection?

jovial warren
#

why isn't it?

#

isn't a collection literally just, well, a collection of elements?

#

and isn't an array also a collection of elements?

old wyvern
#

I mean internally Array is a bit different, it can hold primitives

jovial warren
#

that explains it for Java, but not Kotlin

#

since Kotlin doesn't have primitives

old wyvern
#

Kotlin is indeed compiled to JVM bytecode so

jovial warren
#

I bet it's got something to do with how arrays work in-memory compared with collections

old wyvern
#

Kotlin does internally, it just boxes and unboxes implicitly

jovial warren
#

ah okay

#

well that's annoying

#

so it's either listOf or [].toList() for me then I guess

old wyvern
#

What is the issue?

jovial warren
#

since Octo allows anything that inherits from Iterable for aliases

#

and I wanted to make the options look nicer by using [] instead of listOf

old wyvern
#

I see

jovial warren
#

oh well

prisma wave
#

you can only use [] in annotations anyway

empty flint
#

Can I return a class in Kotlin?

#

I only see the "javaClass" member

surreal quarry
#

fun someFunction() : MyClass

prisma wave
#

javaClass is equal to getClass()

old wyvern
#

KClass<Type>
To get it from your type you would have MyClass::class

prisma wave
#

or javaClass.kotlin

old wyvern
#

wdym?

prisma wave
#

that returns a KClass too

old wyvern
prisma wave
#

no

#

like

#

this.javaClass.kotlin

old wyvern
#

oh doesnt this::class work for that?

prisma wave
#

no

#

you have to use javaClass

obtuse gale
#

How do I make a botnet?

prisma wave
#

Class::class is like Class.class

obtuse gale
#

Is it legal to own a botnet if I own all of the computers attached?

#

Is it called a supercomputer at that point?

old wyvern
prisma wave
#

huh

#

oh yeah ofc that's possible

old wyvern
#

mhm

empty flint
#

Is it legal to own a botnet if I own all of the computers attached?
@obtuse gale Generally, yes botnets are legal (probably, could depend on where you live). The reason botnets are on the bad side of conversations is when they are being used illegally

hot hull
#

@prisma wave Any suggestions as to what kind of project I should try to make when it comes to Java/Kotlin outside of MC

#

Or anyone in that matter, pong me so I'll see fingerguns

prisma wave
#

when learning a new language i usually like to make some sort of webserver app

#

idk what exactly

#

but like a messaging app or something

#

it's reasonably simple, gives you a good understanding on the different api's and things of the language

#

but also doing maths problems and things i guess

#

ProjectEuler has a fair few of those

ocean quartz
hot hull
#

@prisma wave At first I was thinking of a music app, thoughts on that?

errant geyser
#

a music app should be cool

#

You can whip one up fairly quickly using JavaFx

prisma wave
#

yeah that could be cool

surreal quarry
#

any reason dokka would show samples like this as opposed to the actual code at that path

prisma wave
#

isn't there a thing you have to configure in the buildscript?

surreal quarry
#

not sure

#

but thats for the kotlin gradle thing not gradle

viscid charm
#

Yo guys do you know how to do this?

        String lore = main.getConfig().getString("custom-items.<customitem>.customdiamond.lore".replace("<customitem>", customitemname));

        ItemStack item = ItemUtils.buildItem(material, (short)data, itemname, lore);```
Basically that lore section is taking stuff from like:

customdiamond:
 lore:
 - "Hello"
 - "Hellotehre"

But I need it to be 100% a string in the parameter for the buildItem what do you suggest?
ocean quartz
#

There is a getStringList method

viscid charm
#

I tried that but problem is this is my thing for getting the item

#
    public static ItemStack buildItem(Material material, Short data, String name, String ... lore) {
#

so is there like any way around taht or?

steel heart
#

yeah

#

make a method that takes a List<String> instead of String...

viscid charm
#

no buti dont want that :/

steel heart
#

wth dude

viscid charm
#

there sno way to make it work without

#

Can I cahnge the lore though? In the config?

#

to make it work?

#

Lore style?

ocean quartz
#

What do you mean?

steel heart
#

stop making xyproblems

prisma wave
#

List#toArray

#

can be passed into varargs

viscid charm
#

ItemStack item = ItemUtils.buildItem(material, (short)data, itemname, lore, lore , lore , lore); <- I can do that with this. Add new line of lore.
So cant I make it so that in the config instead of having:
lore:

  • "Hello"
  • "Hello"
    I do something like:
#

o

#

so I wouldnt needa touch the buildItem?

steel heart
#

You should make an actual itembuilder

ocean quartz
#

Basically, but you'll be getting a list, turning it into array, then turning the array back to list to set the lore, sounds like a lot of conversion for no reason

steel heart
#

^

heady birch
#

Maybe a website or something frosty

#

I can recommend some good frameworks for web & database interaction

#

Some of the best frameworks

ocean quartz
#

@hot hull If you want something non minecraft you could help me out on an editor i was making

#

In Kotlin ofc

south parrot
#

there is a github showing holograms using packets at +1.13? i dont know about it and i want try learn a bit ๐Ÿค”

viscid charm
#

ok well I am thinking of makign it List<String> But, I dont understand foreach loops that well I am stuck on this.

        ArrayList<String> builditemLore = new ArrayList<>();

        for (String line : lore) {
            builditemLore.add(ConfigUtils.applyColor("line"));
        }

        builditemMeta.setLore(builditemLore);```
jovial warren
#

When they throw npe instead of using the @NotNull annotation ๐Ÿ˜”
@ocean quartz welcome to How to code in Java 101 xD

ocean quartz
#

I mean that's not Java, just dev's decision

jovial warren
#

I edited it lol

ocean quartz
#

Oh

heady birch
#

@NotNull getSomething() { return null; }

jovial warren
#

seems legit

ocean quartz
#

The compiler would scream at you

steel heart
#
List<String> list = new ArrayList<>();
for (String string : config.getStringList("lore.path")) {
  list.add(ConfigUtils.applyColor(string));
}
itemMeta.setLore(list);
prisma wave
#

(def something nil) :)

jovial warren
#

what is that lol

prisma wave
#

clojure

#

clojure moon

steel heart
#

^

#

superior emote

#
List<String> list = new ArrayList<>();
for (String string : config.getStringList("lore.path")) {
  list.add(ConfigUtils.applyColor(string));
}
itemMeta.setLore(list);

@viscid charm

jovial warren
#
val something = Something(whatever)

fun getSomething(): Something = null // fails because Kotlin is the superior
prisma wave
#

yuck

#

getters

jovial warren
#

yeah ik

#

I had to put that in there to demonstrate what I wanted though

steel heart
#

alr 2 peeps having the status

#

soon everyone will

prisma wave
#

we need more

onyx loom
#

never

jovial warren
#

I don't have access to that emote

#

I've got a better status though

steel heart
#

oldest trick in the book

prisma wave
#

is this some kind of joke

steel heart
#

get new

prisma wave
#

clojure moon is objectively better

onyx loom
jovial warren
prisma wave
jovial warren
#

ew ^

steel heart
#

kotlin is not even subjectively superior than clojure moon

prisma wave
#

well said

jovial warren
#

maybe Clojure moon is better than Kotlin logo

prisma wave
#

clojure moon is superior in every way

jovial warren
#

Kotlin > Clojure any day though

prisma wave
#

nah

#

misinformation

jovial warren
#

especially after I just saw (def something nil)

#

like wtf is that

steel heart
#

falsity

prisma wave
#

the same as val something = null

ocean quartz
jovial warren
#

yeah but that syntax is horrible

steel heart
#

aye

prisma wave
#

not

steel heart
#

nc1 matt

prisma wave
#

lisps good

ocean quartz
#

Fun

steel heart
#

all you say bard is falsifications

jovial warren
#

@ocean quartz does your regex cover that format of thingy? (zsh: brain: command not found)

prisma wave
#

imagine if clojure was mainstream

steel heart
#

holy

ocean quartz
#

Which regex? Which format of thingy? xD

prisma wave
#

too bad the biased media wont talk about it

steel heart
#

true

prisma wave
#

every single media company is biased against clojure

#

and it makes me sad

jovial warren
#

@ocean quartz the regex that finds hex colour codes, and normal colour codes

prisma wave
#

pff regex

steel heart
#

alex thats because they know what power clojure has and tries to hide it from the people

prisma wave
#

they do

#

they are scared of it

#

of what we can do

steel heart
#

exactly

prisma wave
#

clojure programmers could bring down the elite

ocean quartz
#

Yeah, the regex is not the problem, the message is parsed correctly, the problem is when colorizing, i found the issue

jovial warren
#

every single media company is biased against clojure
probably because it's trash

prisma wave
#

don't bash it until you try it

#

good advise that

steel heart
#

fictitios statement

jovial warren
#

fine I'll try it

prisma wave
#

so fictitious

jovial warren
#

does Clojure have a playground like Kotlin does?

steel heart
#

so unfounded

prisma wave
#

no idea

#

it has an intellij plugin

#

or repl

#

oooh

#

speaking of

empty flint
#

Can I make an enum class from bukkit implement an interface in Kotlin?

prisma wave
#

anyone wanna do some clash?

steel heart
#

no blocky i dont think

jovial warren
#

@prisma wave sure, been a while

prisma wave
#

@empty flint you can't edit existing classes

#

indeed

steel heart
#

that code thing

prisma wave
#

without hacky bytecode manipulation

steel heart
#

lol

empty flint
#

@empty flint you can't edit existing classes
@prisma wave Hm I thought it might be possible with extensions. I know it doesn't edit existing classes but whatever

prisma wave
#

nah not really

#

there might be a few workarounds

#

also

#

join clash

#

@everyone

loud gyroBOT
#

The 'everyone' mention is disabled so you can't annoy people.

prisma wave
#

dont care

#

they need to know

steel heart
#

lmao

prisma wave
#

just 3?

steel heart
#

@onyx loom join

#

@remote goblet u as well

prisma wave
#

@empty flint and you

onyx loom
#

watching netflix

steel heart
#

@surreal quarry u 2

prisma wave
#

don't care

#

no excuses

remote goblet
#

@remote goblet u as well
@steel heart Suck my dick

prisma wave
#

wow

steel heart
#

no thanks

prisma wave
#

i think you meant to say "clojure my clojure"

remote goblet
prisma wave
surreal quarry
#

whatโ€™s happening

prisma wave
#

clash

#

of

#

code

remote goblet
#

clojure my clojure

#

i hate it

surreal quarry
#

why was i pinged

prisma wave
#

lol

#

join

#

too late

remote goblet
#

I'm working on a discord bot

#

I have to dismantle my entire bot and rework it

surreal quarry
#

alright iโ€™m eating pizza tho

ocean quartz
prisma wave
#

speedy

ocean quartz
#

tbh i don't like half this method
And the speed is kinda weird, with sys nano then converting to ms i get pretty speedy results, with sys millis i get a bit slower like 0/1ms

steel heart
#

shit

#

I think I fucked up

prisma wave
#

looks like it lol

steel heart
#

oh now I understand how it works

#

ah

#

im dumb

prisma wave
#

share code

steel heart
#

pls no bully

#

lol

ocean quartz
#
// This is inside a for loop
if (color instanceof Gradient) {
    final List<MessagePart> gradientParts = new ArrayList<>();
    final Gradient gradient = (Gradient) color;

    // Loop here to detect followed up parts that are also gradient  
    for (;i < parts.size(); i++) {
        final MessagePart newPart = parts.get(i);
        final MessageColor newColor = newPart.getColor();
        if (!(newColor instanceof Gradient)) break;
        if (gradient != newColor) break;

        gradientParts.add(newPart);
    }

    GradientHandler.appendGradient(gradientParts, gradient, builder);
    // this was the hacky fix because of the hacky way, basically the for was breaking on the next iteration so had to go back here to get the stuff again
    i--;
    continue;
}

Any suggestions to make this beauty better?

jovial warren
#

nailed it

viscid charm
prisma wave
#

@steel heart wut

#

how

#

lmao

steel heart
#

which line

#

yes lol sry

jovial warren
#

not here @viscid charm

ocean quartz
#

Also those styles, allman and k&r are fighting each other in the class

jovial warren
#

also I could probably figure out which line is giving you an NPE just by looking at it lol

prisma wave
#

did someone say

#

allman

jovial warren
#

somehow yes

#

somehow people actually use that shit xD

prisma wave
#

pfft

#

clojure doesn't need allman

#

or k&r

ocean quartz
#

Haters

prisma wave
#

it's idiomatic to write arrow code clojuremoon

empty flint
#

idk what clash is

jovial warren
#

clash of code

empty flint
#

never heard of it

#

do I have to sign up?

jovial warren
#

yeah

prisma wave
#

it's fun

jovial warren
steel heart
#

yeah I feel they can belong to an instance some of them

jovial warren
#

(it's the paste that guy sent in saying he was getting an NPE lol)

#

yeah I feel they can belong to an instance some of them
@steel heart in Kotlin we don't even need them

steel heart
#

yeaaa

prisma wave
#

utility functions*

#

if we're being pedantic

jovial warren
#

they are utility methods when written in Java

steel heart
#

@Nonnull @Serializable @Inject final

prisma wave
#

no

#

they're functions

jovial warren
#

@Nonnull @Serializable @Inject final
๐Ÿคฎ

#

I wish we could use Spring in Spigot plugins lol

#

@heady birch has one found a way yet?