#dev-general

1 messages · Page 168 of 1

jovial warren
#

both are mutable

#

I should just scrap JS and use Kotlin/JS instead

#

whether I could actually use Vue with Kotlin/JS is another story though lol

old wyvern
#

Learning js might be useful

#

is*

prisma wave
#

js arrays are basically ArrayLists or HashMaps based on the runtime

jovial warren
#

I'm 3 exercises in and I'm already regretting it

empty flint
#

Right, nvm both are mutable

prisma wave
#

sparse arrays are implemented via hash table

#

dense arrays are normal memory arrays

empty flint
#

I remember there was immutable arrays as well tho

#

w/e JS is not as strict as you might be used to from Java and Kotlin and it's the most popular programming language in the world at the moment so it's definitely worth learning

#

and learning it well. the curve is very steep

jovial warren
#

yeah that's what confuses me the most about JS

prisma wave
#

I'd say js is one of the easiest languages to learn

empty flint
#

I'd say js is one of the easiest languages to learn
@prisma wave I'd say it's one of the harder ones to master though

jovial warren
#

how tf people from the same species as me actually chose this language over all the other options

empty flint
#

but maybe that's just me

old wyvern
#

how tf people from the same species as me actually chose this language over all the other options
Web development my guy

onyx loom
#

how tf people from the same species as me actually chose this language over all the other options
@jovial warren @ funnycube 🌝

jovial warren
#

yeah but originally, somebody must've actually reviewed the language and said "yeah, that's a good idea to use as the standard for all web development"

empty flint
#

how tf people from the same species as me actually chose this language over all the other options
@jovial warren It's supported by all most web browsers and the internet is the center of commerce in this day and age.

#

So yeah, money is the driving force in this case.

jovial warren
#

as I said, the nowaday reasons aren't my concern

empty flint
#

it's funny actually, do you guys know the story of why JS got the prefix "Java"?

jovial warren
#

it's the fact that somebody actually decided that making JS the standard was even remotely a good idea

#

nope, but I'm sure you're gonna tell us

prisma wave
#

to popularise of the java hypetrain iirc

#

also I don't think anyone officially made it the standard

#

it just became it

jovial warren
#

Java™️ HypeTrain™️? what™️?

prisma wave
#

after all Java applets and VBScript were also pretty popular back in the day

#

when java came out it got extremely popular really quickly

jovial warren
#

probably because it was the first attempt at a universal language that was actually successful

old wyvern
#

Mocha -> LiveScript -> JavaScript

empty flint
#

Back in the early 2000s, Sun spent $500 mil on marketing just for the Java programming language because they wanted C++ developers to switch and make them more popular.

old wyvern
#

probably because it was the first attempt at a universal language that was actually successful
@jovial warren
Excuse me?

#

Java was and still is pretty big

prisma wave
#

fun fact

jovial warren
#

and? I'm saying that was probably the original reason for it's growth

prisma wave
#

the first attempt at a universal language was actually clojure

empty flint
#

The guy that got the task to develop a script language for the browser then got told by his boss he has to put java in the name to utilize the java hypetrain and just associate with the language that got 500 mil shoved down its marketing budget throat. The guy said fuck it, idc, I'll name it JavaScript then

prisma wave
#

rich hickey single handedly revolutionized the programming market

empty flint
#

the first attempt at a universal language was actually clojure
@prisma wave I would actually say it was arabic, back when civilisations began forming

jovial warren
#

I'd say WORA is what made Java popular any day

prisma wave
#

by making a single language that would run on any machine

empty flint
#

or persian

prisma wave
#

@empty flint yeah but does arabic have parentheses

#

i don't think so

#

case closed

jovial warren
#

@prisma wave that title belongs to James Gosling and his team of programmers at Sun

prisma wave
#

uh no?

#

clojure came first

jovial warren
#

you mad?

empty flint
#

@empty flint yeah but does arabic have parentheses
@prisma wave No, but it has s̷͒͐o̷͜͝m̵̐̚é̴̈ ̸̒̉ẅ̸́̇e̸͒͋ḯ̶̉r̵̎̄d̸̐̃ ̶̈́͛a̷͌͗ś̶͆s̸̚͠ ̷̓̏c̶͋̚ḧ̷́̌ȁ̴́r̷̉͘a̴͇͗ċ̸̽t̴́̍e̷̍̾r̵̈́́s̴̈́̏ ̶̀̚t̴̉̇h̴͗͊à̵̾ẗ̶͒ ̶́͌s̵̾͠ư̶̇m̶͌̔m̴̉͌o̶̒̌n̵͌̃ ̶̛́C̵̍̚t̶̉̓ḣ̵̎ư̵̌l̵͒̕ù̸̿ ̴̓́w̶̏̏h̵͂͒ể̸n̵̎͛ ̵̀spoken...

prisma wave
#

clojure was the first programming language

jovial warren
#

Clojure was made in 2007

normal talon
#

I was made in 2001

prisma wave
#

the first programming language

jovial warren
#

Java came out in 1995

prisma wave
#

I'd like to see a source for that

jovial warren
#

Wikipedia

normal talon
#

1995 Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle) and released in 1995 as a core component of Sun Microsystems' Java platform.

empty flint
#

I mean...

jovial warren
#

boom

prisma wave
#

you can't trust anything on wikipedia

jovial warren
#

@prisma wave I knew that was the BS you'd come out with

prisma wave
#

am i wrong tho

jovial warren
#

yes, you are

prisma wave
#

anyone can write anything

#

james gosling (evil man) probably wrote that himself

jovial warren
#

they have bots constantly monitoring it

empty flint
#

you can't trust anything on wikipedia
@prisma wave Yeah, the biggest collection of all human knowledge does not have one single shred of credibility as far as Clojure is concerned.

prisma wave
#

Quite.

onyx loom
#

where is ur clojure source from

jovial warren
#

anything that is even a little bit stupid gets reverted

onyx loom
#

wikipedia too?

prisma wave
#

rich hickey

#

trustworthy guy

#

he told me

onyx loom
#

dont trust anything from rich

prisma wave
#

i would trust anything from rich

jovial warren
#

you don't know Rich Hickey personally

onyx loom
#

😐

prisma wave
#

I do

old wyvern
#

What if....

jovial warren
#

he told me
I call bull shit

prisma wave
#

😮

#

no

#

I wouldn't lie to you guys

jovial warren
#

@old wyvern if...

#

xD

old wyvern
#

@old wyvern if...
@jovial warren if....

normal talon
prisma wave
#

🤔

#

that

jovial warren
prisma wave
#

is fake

empty flint
jovial warren
#

probably is tbh

prisma wave
#

yeah that's untrustworthy

jovial warren
#

most advanced doesn't mean best though

prisma wave
#

that's where you're wrong

#

clojure can do anything

#

everybody just can't accept the truth 🙄

empty flint
#

clojure can do anything
@prisma wave Except beat JS as the most popular programming language today fingerguns

prisma wave
#

well Java/Kotlin can't do that either

onyx loom
#

js isnt the most popular?

jovial warren
#

yes it is

onyx loom
#

since when

jovial warren
#

no idea

normal talon
#

today

jovial warren
#

it's been the most popular for some time now

normal talon
#

what the hell is Clojure

jovial warren
#

though some sources used to say Python was the most popular

onyx loom
#

yeah thats what i thought was most popular

empty flint
#

js isnt the most popular?
@onyx loom It is, dunno since when tho

prisma wave
#

what the hell ISN'T clojure?

onyx loom
#

cozy, its nothing. get it out of ur head

jovial warren
#

Clojure is a lisp-based JVM language @normal talon

prisma wave
#

clojure was the first programming language

jovial warren
#

from what I've heard and seen

prisma wave
#

and the most advanced

#

and the most powerful

#

and the most dynamic

normal talon
#

oh and isnt this language he same as java/kotlin

prisma wave
#

and the most powerful at parallelism

normal talon
#

cozy, its nothing. get it out of ur head
sad

prisma wave
#

people try to conceal the truth

#

they are afraid

#

the media is afraid

#

jeff bezos himself is scared of clojure

normal talon
#

im not afraid of anything expect the sandels of my father

prisma wave
#

good

#

you will make a fine clojure user

empty flint
#

tfw SQL beat python 🙃

normal talon
#

I cant do java or kotlin how im supposed to do clojure

prisma wave
#

clojure is easy to learn

#

syntax is very simple

onyx loom
#

thats just a straight up lie

prisma wave
#

it literally isn't though

#

the syntax is simple

onyx loom
normal talon
#

can u code a mc plugin with it and in intelij

onyx loom
#

yeah.....

prisma wave
#

there are only a few symbols

#

@normal talon with a few hacks yes

empty flint
#

The thing is that most people using Java, Kotlin, Python or whatever usually know JavaScript as well so naturally JS would beat them all

normal talon
#

I love hacks

prisma wave
#

let's think about it:
java / kotlin have lots of different symbols for different tasks - for, val, fun, =, (), {}, [], ,, extends, !!, ?:, etc
clojure has like 6 symbols in the entire language - [], (), ', and :

#

therefore clojure is easier to learn

#

case closed

#

have a nice day

onyx loom
normal talon
#

how do I use clojure with intelij

onyx loom
#

u dont

prisma wave
#

cursive plugin

static zealot
#

that doesn't actually make sense because if you have just 6 you have to learn where you sue which which is harder

normal talon
#

but didnt u like suck kotlin all the time Clojure

prisma wave
#

people change

#

@static zealot it makes sense

#

fewer symbols = easier to learn

normal talon
#

but with fewer symbols you can do less than more symbols

static zealot
#

Cozy don't mind him. His personalities keep getting crazier every day. I recommend you go Java first then others

prisma wave
#

that is false

#

you can do just as much

normal talon
#

oke mistr

prisma wave
#

usually with less syntax

static zealot
#

because with java you actually have lots and lots of tutorials and examples

#

especially when it comes to spigot and bukkit api

prisma wave
#

🙄

normal talon
#

well I turned 19 and learning is something i cant do anymore

static zealot
#

right ....

#

welp Cozy I'm almost there

#

just 1 hour

#

xD

normal talon
#

Ongeveer 496.000 resultaten (0,46 seconden)

empty flint
#

there are only a few symbols
@prisma wave Bruh. In JavaScript you can write any code using only the symbols []()!+.

normal talon
#

Blitz im 1 day older than u xd

empty flint
#

Can't beat that

prisma wave
#

yes you can

onyx loom
normal talon
#

or you can download plugins from bukkit or spigot

#

cant beat that

jovial warren
#

@empty flint how are HTML and CSS on that list? they're not even programming languages

prisma wave
#

in clojure you can write any code using only the symbols []():'

old wyvern
#

but didnt u like suck kotlin all the time Clojure
Its just a meme 🤷‍♂️

prisma wave
#

don't disrespect my passions

normal talon
#

hes 16 guys

empty flint
#

@empty flint how is HTML/CSS on that list? they're not even programming languages
@jovial warren Idk I just googled

normal talon
#

passions

static zealot
#

Yugi I start thinking he actually has multiple personalities

old wyvern
#

Yea possibly, every month a new one is released

static zealot
#

like if it was a meme/joke this went very very far

onyx loom
#

whats next?

old wyvern
#

Next month we get js mitten

prisma wave
#

there is no next

#

clojure forever

normal talon
#

I will use html for plugin coding

static zealot
#

yeah

#

it was the same with Kotlin

#

xD

old wyvern
#

xD

prisma wave
#

no

#

i never said that

#

do not

#

no

old wyvern
#

yes

jovial warren
#

HTML is a markup language, suggested by the name, and CSS is a style sheet language (according to Wikipedia), also suggested by its name

old wyvern
#

HOLY

normal talon
#

angry mitten

old wyvern
#

2 AM

#

IM OFF

#

CIAO BOIS

prisma wave
#

:clojurewave:

normal talon
#

lol

static zealot
#

gn

normal talon
#

its 10 pm gn

onyx loom
#

ciao

static zealot
#

I've been spending my last 3 hours grouping minecraft materials on categories :((( I think I grouped over 100 materials

empty flint
normal talon
#

sad

prisma wave
#

bro

#

how do you make a module in intellij

#

but with more modules

#

i don't get it

#

doesn't work

static zealot
#

is there a way in IIJ to see how long lits are? Like a console or soemthing I don't want to build the plugin launch the server etc. to see the length

prisma wave
#

idiot ide

normal talon
#

i cant copy it

prisma wave
#

want it dead

jovial warren
#

@static zealot lits?

static zealot
#

lists*

#

my bad

prisma wave
#

no

#

it can't be asserted until runtime

#

without some fancy fancy hacks

static zealot
#

oh that's sad

prisma wave
#

¯_(ツ)_/¯

normal talon
#

@empty flint nothing happens

static zealot
#

huh?

normal talon
#

yea idk

prisma wave
#

zip bomb

#

No

#

Other one.

#

What's it called

#

Unix bomb

#

Boom

#

RM -rf

#

you know what i mean

#

fork bomb

#

that's it

static zealot
#

question player.isFlying checks to see if the player is actually flying when the check is made. What is the check to see if a player has his flight activated only?

#

oh could it be allowFlight

#

hmm time to check spigot

empty flint
#

@empty flint nothing happens
@normal talon Weird, works for me

#

try scrolling to the bottom

static zealot
#

I mean he did not skroll

normal talon
#

ooh wew

prisma wave
#

ok sure kotlin good but have you guys ever tried scala

#

i've been setting up sbt for the past 30 minutes

#

it's great

onyx loom
#

i swear u said scala is shit urself

prisma wave
#

nah

#

it's not shit

#

it's just got a steep learning curve

onyx loom
#

its powerful

prisma wave
#

wow

#

a notable person using clojure

ocean quartz
#

That's one of the paper's devs

prisma wave
#

they have good taste

#

scala on the other hand

jovial warren
#

ok sure kotlin good but have you guys ever tried scala
here we go again...

prisma wave
#

it is a cry for help

#

i have been trying to make a plugin in scala for hours now

onyx loom
#

Scala Mitten

jovial warren
#

damn it

#

was just about to say I'm waiting for the name change lol

winter iron
#

Jar sizes are not really an issue are they?

#

only when uploading to sites

prisma wave
#

not really

onyx loom
#

ALTHOUGH

#

pdm fingerguns

winter iron
#

doesnt work

#

with kotlin

#

or somehting

onyx loom
#

it works for me

#

¯_(ツ)_/¯

winter iron
#

When I ran the plugin fresh, it worked

#

but on server reload/restart

#

it wouldnt load classes

#

so didnt work

#

😦

onyx loom
#

i shall test this theory

#

altho i think i already have

winter iron
#

I tried it with BM and it just

#

yeh

#

😦

onyx loom
#

oh shit

#

wtf

#

pdm bad

prisma wave
#

🙄

#

people nowadays

#

actually expecting things to work

#

smh

winter iron
#

Im guessing it works fine with Java right?

prisma wave
#

¯_(ツ)_/¯

#

never tested

winter iron
#

Xd

prisma wave
#

on the bright side I got scala working

#

so

#

yay

winter iron
#

"working"

prisma wave
#

scala is pretty similar to kotlin

onyx loom
#

now get pdm working pls 😦

distant sun
#

Someone make an iij plugin for maven local repo install with an UI, thanks.

obtuse gale
#

I really don't find any language better. If I need to code in one I just do

prisma wave
#

sorry to hear that

obtuse gale
#

Obviously each language has its own category of work and some perform better in some circumstances but like I don't mind switching I just need to learn the basic syntax and that's it

#

Although I will always have hate towards assembly haha I mean I had a year in school where we did just that with one professor, never again please

winter iron
#

Is Holographic Displays API persistant?

#

i dont think it is

prisma wave
#

nope

winter iron
#

hmm

#

might make an api based on it

#

tryna think of some ideas

#

😦

#

got fuck all

onyx loom
#

u dont

#

u create ur own holograms plugin reversed_fingerguns

winter iron
#

maybe

#

not sure how it rly works

#

armor stands i think

prisma wave
#

pretty much

heady birch
#

@heady birch Do you have one?
@ocean quartz Yeah

#

Well no

#

Its not really a serializer

#

Just a IChatBaseComponent factory generating thing

ocean quartz
#

Can you show me?

heady birch
#

You may unlock it for $59.99

ocean quartz
#

Oof sounds complicated to use reflection to do that

heady birch
#

Wouldn't using reflection slow it down?

#

I guess you dont wanna make seperate updates just for new nms versions though

steel heart
#

That $60 is kinda obnoxious 😅

#

Well abstraction is little faster afaik

ocean quartz
#

I guess it wouldn't be too hard to do that just a bit annoying
But yeah reflection is much slower

prisma wave
#

yo

#

don't wanna interrupt

#

but uhhhh

#

scala works

#

😄

steel heart
prisma wave
steel heart
#

I mean yeah and we don’t want an angry review section complaining about silly errors like new nms versions

prisma wave
steel heart
#

Lol

onyx loom
#

do i see

#

an extension function?

prisma wave
#

yes

#

pretty much

#

scala does them in a weird way

onyx loom
#

what i wanna know is how u got it working

#

and how u can pick up a language so fast

prisma wave
#

had to use local repository for spigot api

#

"pick up" is a bit of an exaggeration

onyx loom
#

i mean its basic

prisma wave
#

it took 10 minutes of googling to make a simple command

#

lol

onyx loom
#

but like

#

how u get it working

jovial warren
#

okay what the actual fuck is that generic type

#

[] for generics?

onyx loom
#

oh yeah and that

prisma wave
#

ye

onyx loom
#

big ew

prisma wave
#

how u get it working

had to use local repository for spigot api

#

the build tool was the problem

#

anyway

#

clojure time

steel heart
jovial warren
#

more like Kotlin time

prisma wave
#

nah

#

kotlin and java can go last

#

they're the boring ones

jovial warren
#

shut your mouth little kid (that's a reference you won't understand)

onyx loom
#

i understand 🌚

#

u forgot the f word tho

prisma wave
#

@lunar cypress with your spigot lein template, am I being really dumb or does it not register the command at all?

lunar cypress
#

Doesn't it work?

prisma wave
#

idk haven't tested

#

but it doesn't seem to register the command at all

#

not sure if that's a problem or not

lunar cypress
#

The default executor for commands is the plugin instance

prisma wave
#

oh

#

huh

#

TIL

prisma wave
#

@lunar cypress ```clojure
(ns clojure-plugin.command
(:gen-class
:name clojure_plugin.ClojureCommand
:implements [org.bukkit.command.CommandExecutor])
(:import (org.bukkit.command CommandSender)
(org.bukkit.entity Player)
(org.bukkit ChatColor)))

(defn color [s]
(ChatColor/translateAlternateColorCodes & s))

(defn -onCommand [this ^CommandSender sender _ _ _]
(if (instance? Player sender)
(.kickPlayer sender (color "&cClojure is just too strong, sorry.")))
(if (not (instance? Player sender))
(.sendMessage sender "Only players can experience Clojure...")))

you got any idea why this might npe? it's probably also super messy. Can't tell which line is causing the NPE unfortunately
onyx loom
#

that is just so disgusting

prisma wave
#

Lol

onyx loom
#

also

#

NPE

#

LOL

#

kotlin dont have that 🙃

prisma wave
#

Java interop is not particularly idiomatic

#

we out here trying to use OOP in a Functional language

onyx loom
#

(defn color [s] i quite like this ngl

#

however

#

everything else is disgusting

prisma wave
#

it's no extension functions

#

But it's pretty clean yeah

#

Idk

#

It's probably really awful since I couldn't figure out a better alternative for instanceof

onyx loom
#

is fingerguns

prisma wave
#

😔

lunar cypress
#

Hmm

gusty fulcrum
#

whats the best way to make a explode/throw effect on a group of players that are in the same location? each player would get thrown in a different direction but the same amount of distance?

lunar cypress
#

Could you send the exact error @prisma wave

#

And for the if not... thing you could just use the else branch of the first if

shut swan
#

is there any tutorial on how to configure voteparty and nuvotifier for bungeecord?

prisma wave
#

Oh does else exist?

#

I couldn't find it

lunar cypress
#

Yes

#

Lol

#

(if test then else)

prisma wave
#

Also, turned pc off now but it was just something like ClojureCommand(Unknown Line)

#

Ah

#

Sorry that's not much information to go on lol

lunar cypress
#

No right now I don't see a possible cause

surreal quarry
prisma wave
#

yeah me neither

#

It might have even been a problem with the compilation process, when I looked it resolved some nullable Var

lunar cypress
#

Oh

#

I might have an idea

#

Is the message sent/are you kicked?

prisma wave
#

Yes

lunar cypress
#

Yeah ok i think i know why

#

This function returns nil

prisma wave
#

You definitely get kicked, can't confirm if the message is sent since I didn't check

#

ohh

#

And it should return true/false instead

#

Ofc

#

I'll test in the morning

#

ty

lunar cypress
#

Yeah, nil to primitive results in npe

prisma wave
#

Makes sense

ocean quartz
static zealot
#

ohhh

#

nice

#

it went from 0.6 to 3 and back to 0.6

#

that's some real parkour

split talon
#

Lmao

tacit cave
#

Hello

#

Can someone help me to fix intellij?

#

I've tried to search it to google

#

And tried to fix it..

#

Why my intellij idea 2020.2

#

Stucking at check url?

#

Like literally I added a new Remote/Git

#

It will stuck forever

#

Feel free to tag me

obtuse gale
#

Anyone got an example of using SRP in a plugin? Like I get the base idea, but should I seperate loading comamnds and listeners into multiple classes, then just call that onEnable or what?

onyx loom
#

if uve got many listeners and commands then yeah seperate them

obtuse gale
#

yeah but should i be seperating like actually registering the commands into a seperate class?

#

Like a CommandManager or CommandHandler class or something

onyx loom
#

if uve got many listeners and commands then yeah seperate them
@onyx loom

obtuse gale
#

o

#

alright thx

tacit cave
#

Pls answer my question

ocean quartz
#

Interesting, my parser is faster and slower than mini's (more slower than faster) xD
Also different gradient handling

surreal quarry
#

i think the grdaient that goes across all the words is better

#

cause if you want it on each word, you can just set it for each word

lunar cypress
#

If you want to optimise a lot of reflection with the same methods, consider using MethodHandles instead @ocean quartz

empty flint
#

@ocean quartz what James said

tacit cave
#

hello

#

how do i add ItemStack in Shaped Recipe ingredient?

#

is it possible or not?

old wyvern
tacit cave
#

uh

#

i think i can do it on craft listener

#

maybe

empty flint
distant sun
#

I think he's on holiday

heady birch
#

@steel heart

#

Which one did you mean

hot hull
#

Niall, 2nd

heady birch
#

@steel heart

#

@steel heart

#

I will stick with 1st I think

#

That is current api

steel heart
#

Yeah sure (:

heady birch
#

🙂

#

(:

#

Is bstats case sensitive?

distant sun
#

As in?

heady birch
#

nvm

#

how does the AdvancedPie work?

distant sun
#

Isnt it disabled?

#

Iirc some charts are

heady birch
#

String, int so i guess its just count of each item

prisma wave
#

huge

#

clojure plugin working

#

2 down

#

3 to go

old wyvern
#

O.o

heady birch
#

Nice

hot hull
#

Well what does the plugin do Km

prisma wave
#

not a whole lot

#

it has a command that kicks you

obtuse gale
prisma wave
#

Yeah Johnny made an issue

obtuse gale
#

ah alright

prisma wave
#

pretty sure I know what the problem is

#

also does anyone have one of those fancy gradient classes I can use

distant sun
#

Matt has one on his messages lib

prisma wave
#

link?

#

ok

distant sun
#

Any way I can turn the hex from item names to the format I use on config? I cant seem to be able to match §x§r§r§g§g§b§b using regex

hot hull
#

§

heady birch
#
final List<Group> groupList = new ArrayList<>(groupManager.getRegisteredGroups());
        groupList.sort(Comparator.comparing(Group::getName));
#

Is this bad

#

Cos API returns Collection

#

I could change it to list but do I want to?

distant sun
#

Dont return collection reversed_fingerguns

heady birch
#

Meh well this is really the only place I need it sorted

#

Please specify a valid page number between 1 and 1

#

Hmmmmm

#

English experts whats a better way of putting this

distant sun
#

page index?

prisma wave
#

there's nothing wrong with that?

heady birch
#

Whats between 1 and 1

#

Nothing

prisma wave
#

1

onyx loom
#

big brain

obtuse gale
#

Please specify 1 as the page number

onyx loom
#

ew dont do that

hot hull
#

Please fuck off, we don't want you here, there's only 1 page bitch

prisma wave
#

You specified 3 as the page number, which doesn't exist, so we'll use 1 instead. Idiot.

old wyvern
prisma wave
#

lmao

heady birch
#

Lol

steel heart
#

@static zealot if its ur birthday then huge congratulationsfingergunsclojuremoonepic2

static zealot
#

ty ty

meager cairn
#

So I need to cancel a task, but I don't want to store it in a variable and cancel it, because it will not working. I'm currently using BukkitRunnable and happy with the result. I'm just curious, can I cancel the task with method cancel() like this when use Bukkit.getScheduler().runTimerTask?

new BukkitRunnable() {
  @Override
  public void run() {
    //...
    cancel();
  }
}
steel heart
#

well here's the deal. the first long parameter schedules a delayed task and after that the task itself will scheduler a new task with a delay of the second long parameter but it will have the same id and some other data shared between all those tasks. Ideally once #cancel() is called no more repeating tasks should be called after the one that #cancel() was called in albeit the code will still run fully so #cancel() doesn't have a functionality like return;.

#

if I got that right

empty flint
#

Is it possible to tell Kotlin that a certain class has a finite, known set of instances so that when I use the when(...) condition, it counts as exhaustive?

#

I can't declare them as enums

prisma wave
#

set of instances?

#

or set of subclasses

empty flint
#

instances

#

like an enum, but not an enum

prisma wave
#

I don't believe so

#

best option is a sealed class

empty flint
#

I am using a sealed class, that's exhaustive in terms of the classes they can be, not the instances

#

and enums can't inherit from a sealed class

#

can you tell the when clause that the list IS exhausted instead of adding an unnecessary else?

prisma wave
#

I don't think so

empty flint
#

what's an English word for something that has an attribute? Attribute holder? Attribute owner? what do I call this thing?

prisma wave
#

I'd say AttributeHolder

#

or Attributable

heady birch
#

AttributeMe

ocean quartz
#

@lunar cypress Yeah i heard about MethodHandles before, i might use it
Though i cache a good amount of reflection steps
Only thing i can't cache right now is the constructor because nms keeps changing

final Object packet;
if (ServerVersion.CURRENT_VERSION == ServerVersion.V1_8_R3) {
    packet = CHAT_PACKET.getConstructor(CHAT_COMPONENT).newInstance(CHAT_SERIALIZER_METHOD.invoke(null, message));
} else if (ServerVersion.CURRENT_VERSION.isColorLegacy()) {
    packet = CHAT_PACKET.getConstructor(CHAT_COMPONENT, CHAT_TYPE).newInstance(CHAT_SERIALIZER_METHOD.invoke(null, message), Enum.valueOf(CHAT_TYPE, "CHAT"));
} else {
    packet = CHAT_PACKET.getConstructor(CHAT_COMPONENT, CHAT_TYPE, UUID.class).newInstance(CHAT_SERIALIZER_METHOD.invoke(null, message), Enum.valueOf(CHAT_TYPE, "CHAT"), player.getUniqueId());
}

Could probably still cache it but i'd need to change a few things

hot hull
#

Shitty ass NMS

ocean quartz
#

Could definitely be done better but for now it's not terrible

lunar cypress
#

well no matter what you cache the access stays reflective

#

every invocation does

ocean quartz
#

Trying with MethodHandles now, let's see how it goes

lunar cypress
#

MethodHandles should bring you benefits with hot code

hot hull
#

@heady birch Can you not..

old wyvern
#

Lmao

hot hull
#

:kek:

prisma wave
#

Over 2 billion tiktokers use Java

old wyvern
#

😂

empty flint
#

Another 500mil marketing campaign to make Java the most popular language in the world

#

Actually I think tiktok might be worth more than 500mil. Does anybody know?

prisma wave
#

it's probably worth a lot more than that

old wyvern
#

Dont think it has anything to do with Java

empty flint
#

It will when Oracle gets their hands on it

#

Rebranding to JavaTok

old wyvern
hot hull
#

Over 2 billion tiktokers use Java
Over 2 billion tiktokers use Kotlin GWsetmyxPeepoSad

empty flint
#

How do I do something like when(integer) { (< 0) -> "smaller than 0" else ... }

prisma wave
#

2 options

#
when {
  integer < 0 -> blah
}
when(integer) {
  compareTo(0) == -1 -> blah
}```
#

both should work I think

empty flint
#

Right

#

ty

prisma wave
empty flint
#

but... why?!

prisma wave
#

Why not

hot hull
#

He asked the question wether he could, but forgot to ask the question, wether he should

prisma wave
#

😔

#

It was a huge waste of time

hot hull
#

disgusting, GradientHandler is in java

prisma wave
#

soz

#

I just stole off Matt's github and tweaked it a bit

#

Converting was effort

ocean quartz
#

Well, technically you're stealing from Nicole xD

prisma wave
#

She probably stole it from someone else

#

The wonders of open source stealing

empty flint
#

If it's open source it's called appropriating charity

#

not stealing

#

Also, it's interesting that you could even steal something virtual since stealing implies that the victim you stole from doesn't have the thing you took anymore

prisma wave
#

Good point

#

borrowing

empty flint
#

same implication though

#

copying with a hard maybe

prisma wave
#

¯\_(ツ)_/¯

hot hull
#

Also, it's interesting that you could even steal something virtual since stealing implies that the victim you stole from doesn't have the thing you took anymore
big br0in moves

empty flint
#

Another Kotlin question because I'm not used to this kind of programming style and would do it in the Java way:
How do I pop a stack n times and put all elements in an array using a oneliner?

#

I know I can use for loop to pop n times, I can use repeat {} etc

#

but idk how to collect those elements in an array

prisma wave
#

take(Int)

#

Will return a List

#

Iirc it will pop

empty flint
#

doesn't pop

#

already tried that

#

I could take and remove but that seems messy

old wyvern
#

Would you already have an array of size n?

#

Or would you want to create one?

empty flint
#

create one

#

that's the problem

#

create and populate in the same line

#

with n elements

#

essentially getting n elements as a vararg from a for loop or whatever

old wyvern
#
Array<YourType>(n) { stack.pop() }
#

You should probably make sure the stack has the n elements tho

#

@empty flint

empty flint
#

❤️

#

ty

prisma wave
#

impressive

hot hull
#

Sheesh

static zealot
#

huh whats that?

prisma wave
#

my latest project

hot hull
#

gh stats

prisma wave
onyx loom
#

this is clear evidence that kotlin > clojure

#

totally not because u have to do some fuckeries with clojure

prisma wave
#

damn ur right

#

my mistake

#

kotlin good clojure bad

lunar cypress
#

Still making a connect four plugin in clojure

#

It's getting quite interesting

#

Wanted to add clojure some time ago but somehow didn't manage it

prisma wave
#

Interesting

empty flint
#

IllegalArgumentException pertains to user input arguments and IllegalStateException is relevant when I fuck up, correct?

prisma wave
#

pretty much

lunar cypress
#

not necessarily

#

IllegalStateException isn't really when you screw up, it's still the user's fault

prisma wave
#

yeah true

#

usually if something hasn't been initialized when it should

lunar cypress
#

or like when something has already been closed and you still try to use it

hot hull
#

Imagine if github had folders 😮

onyx loom
#

imagine

lunar cypress
#

🎵

prisma wave
steel heart
errant geyser
old wyvern
#

ayy

onyx loom
#

when does this challenge end

#

for elara

ocean quartz
#

;p

prisma wave
#

31st

onyx loom
#

august?

old wyvern
#

yes

ocean quartz
old wyvern
#

Pro move: add spigot lib wrappers to elara stdlib fingerguns

#

replace.... skript

frigid badge
#

disgusting

old wyvern
#

😂

hot hull
#

@old wyvern You make me cry

old wyvern
#

I mean if something replaces skript, thats a win-win 🤷‍♂️

#

probably wont

#

but yea

empty flint
#

@ocean quartz 😍
@errant geyser What does that mean?

old wyvern
#

Matt stared the repo

empty flint
#

Is there a way to use NMS reliably without depending on all those shitty versioned classpaths?

old wyvern
#

Reflection

errant geyser
#

Indeed not, unless you wanna use reflection, or the X series has some stuff to help with that

empty flint
#

What's the X series?

old wyvern
errant geyser
#

XMaterial, Xwhateverthefuckelse

#

That ^^

ocean quartz
#

I mean xseries won't do nms

old wyvern
#

mhm

errant geyser
#

Its useful for handling some differences across versions though

#

Also why does the embed have the Kali Linux logo Thonk

empty flint
#

Guess I'm gonna have to have an NMS lib then 🙃

#

Or actually, is there a way to get an item from a JSON string without using NMS?

ocean quartz
#

You could easily make a method for that with gson

empty flint
#

that would mean I'd have to parse it myself which I want to not do under almost any circumstance

ocean quartz
#

Or you could use yaml instead of json and use spigot's yaml serializer

empty flint
#

Can you point me to the spigot api that does that?

ocean quartz
#

before anyone asks, this is old class i don't use anymore, no utils in kt

prisma wave
#

🤮

empty flint
#

@ocean quartz
This is the nms-serialization:
{id:"minecraft:diamond_sword",Count:1b,tag:{PublicBukkitValues:{"blockydebug:custom-sword-key":3.141592653589793d},Damage:1000,display:{Name:'{"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gold","text":"SWORD!!!"}],"text":""}'}}}
This is from the spigot yml serialisation:
ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=§6SWORD!!!, Damage=1000, PublicBukkitValues={blockydebug:custom-sword-key=3.141592653589793d}}}

#

any idea how to get the nms one without nms?

#

(and reverse it)

ocean quartz
#

Hmm i don't really know, sorry

#

Hmmm java.lang.NoSuchMethodException: no such constructor: net.minecraft.server.v1_16_R2.PacketPlayOutChat.<init>(IChatBaseComponent,ChatMessageType,UUID)PacketPlayOutChat/newInvokeSpecial
I love this

#

Oh

#

So apparently the "return type" of a constructor is void .-.

distant sun
#

Tf

ocean quartz
#

Yup

#
LOOKUP.findConstructor(CHAT_PACKET, MethodType.methodType(void.class, CHAT_COMPONENT, CHAT_TYPE, UUID.class)).invoke(CHAT_SERIALIZER.invoke(message), Enum.valueOf(CHAT_TYPE, "CHAT"), player.getUniqueId());
empty flint
#

hm

#

Gson().toJson(itemStack) results in a stack overflow error. lmao

#

Has anybody else successfully serialized stuff with Gson?

steel heart
#

send the stacktrace?

foggy pond
onyx loom
#

lmao

empty flint
#

send the stacktrace?
@steel heart I mean there's not much of a stacktrace since it's a stackoverflow.

#

=haste

compact perchBOT
#
HelpChat Paste

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

empty flint
#

there u go @steel heart

#

It seems as though this might be an issue with jdk though

#

Can somebody else try this code?

Gson gson = new Gson();
String json = gson.toJson(itemInHand.serialize());
System.out.println(json);

And let me know if it works?

#

Any itemstack will do

split talon
#

@ocean quartz I thought constructors return value was in machine code

jovial warren
#

@split talon constructors don't have a return value wdym

split talon
#

Not to the user but they technically do

steel heart
#

Its basically a void method which is invoked when creating a new object

jovial warren
#

oh yeah ofc it is

steel heart
#

Although it returns its type when invoking it

jovial warren
#

yeah

#

I think you can see that present in Kotlin with the generated invoke method, though don't quote me on that

ocean quartz
#

I thought the return would be itself (the class) at least made more sense

jovial warren
#

I think (internally at least), it's calling a generated invoke method or something

#

nvm me I'm just talking out of my ass lol

#

and I swear if a single one of you says something along the lines of "don't worry, we're used to that by now" or "isn't that what you do all the time?"

distant sun
#

How would "return new Object" work with a void method?

#

Nothing new bardy, np

empty flint
#

@distant sun have you tried calling return in a constructor? 😉

distant sun
#

mkay

jovial warren
#

@empty flint you can't return within a constructor scope because it's not a scope of which has a return value

distant sun
#

Cant return a value*

jovial warren
#

you can't return whatsoever afaik

prisma wave
#

you can

distant sun
#

^

prisma wave
#
public ClassName() {
  this.x = 3;
  return;
}```
jovial warren
#

@prisma wave what tf is that username

prisma wave
#

it's Java Kotlin Clojure Scala Groovy

#

Mitten

#

but I couldn't fit the Mitten

#

😦

jovial warren
#

We found him lads! Look! It's Captain Obvious!

prisma wave
#

😎

#

I mean

#

ask a silly question

jovial warren
#

get a silly answer

frigid badge
#

basically his name is saying Java is number 1

prisma wave
#

yeah

distant sun
#

Mitten and kotlin have the same length btw

prisma wave
#

wait

#

no

steel heart
#

Alex what order is the languages?

jovial warren
#

@frigid badge get outta here

prisma wave
#

uh

distant sun
#

Ikr lemmo

prisma wave
#

worst to best

#

groovy best jvm language

hot hull
#

Blasphemy KM

jovial warren
#

@distant sun you too

distant sun
#

Ladies first

frigid badge
distant sun
#

^

prisma wave
#

wow

steel heart
#

lmaoo

prisma wave
#

fake news

#

taking my words out of context

#

unacceptable

hot hull
#

You trully fucked yourself there KM..

steel heart
#

Factitious

prisma wave
#

the media is trying to vilify me

#

they are scared of me

jovial warren
#

you literally walked straight in to that one @prisma wave

prisma wave
#

no

#

i did not

#

YES

#

new name

#

java has gone

steel heart
#

Epic

prisma wave
#

no real loss there

distant sun
#

Ew

prisma wave
#

😦

#

haters around every corner

#

nowhere is safe

hot hull
#

Such terrifying times KM

distant sun
#

¯\_(ツ)_/¯

hot hull
jovial warren
#

@hot hull which one?

hot hull
#

Boi

jovial warren
#

lol

#

you walked right in to that one lol

hot hull
#

Shut up weeb

#

Before I smack you

#

Such hostile world this has become

prisma wave
#

life was better in 1664

#

java didn't exist

#

simpler times

#

😔

distant sun
#

2008*

hot hull
#

Life was better 4billion BC

prisma wave
#

this generation is truly lost

distant sun
#

Or when the fuck k 🤢 tlin was invented

prisma wave
#

all "java" this and "@NotNull" that

#

i weep

onyx loom
#

Or when the fuck k 🤢 tlin was invented
@distant sun how dare u

#

take that back

hot hull
#

Bruh Gaby

distant sun
#

Nty

onyx loom
#

:crusade:

#

shit no nitro 😔

prisma wave
#

:crusade:

#

shit nitro 😔

hot hull
#

Tough talk for a fella within crusading distance @distant sun

jovial warren
#

Or when the fuck k 🤢 tlin was invented
@distant sun you on crack or some shit?

#

idk what kinda rock you been living under lol

distant sun
#

Kinda hungry but no

prisma wave
#

try a wholesome meal of clojure on toast

distant sun
#

Sounds gross

prisma wave
#

it's wholesome

distant sun
#

And ive seen kotlin

old wyvern
jovial warren
#

pretty much every popular JVM language is better than Java because they all have Java as an example of what not to do

prisma wave
#

does that include clojure?

jovial warren
#

idk

prisma wave
#

I'll take that

jovial warren
#

probably

prisma wave
#

if java is so good then why isnt there a java 2

hot hull
#

Cause, 3 billion devices run Java GWempOof

prisma wave
#

well they should run java 2

#

it would be faster

#

i think

jovial warren
#

@prisma wave Java is on like version 14 or something

#

no idea what kinda rock you been living under

hot hull
#

It's slowly turning into kotlin

prisma wave
#

ok but thats not java 2

#

is it

hot hull
#

Like 200 years away, but slowly

jovial warren
#

It's slowly turning into kotlin
@hot hull that is true

prisma wave
#

ok tbf pattern matching > when expressions

hot hull
#

Just delete java and use kotlin

prisma wave
#

you dont get that with kotlin

jovial warren
#

the additions of type inference, records, project loom, and many other things are slowly pushing Java towards Kotlin

#

I mean, Java does have Kotlin as an example of what is good

prisma wave
#

loom isn't coroutines

#

they're something substantially fancier

old wyvern
#

Are you sure Java didnt do some of those before kotlin

jovial warren
#

@prisma wave they're fibers, but fundamentally they operate the same way don't they?

hot hull
#

Are you sure Java didnt do some of those before kotlin
@old wyvern Yes, Java Bad.

old wyvern
#

No bard

prisma wave
#

not exactly

#

afaik project loom doesn't add any language level features

old wyvern
#

Coroutines arent same as that

#

Current coroutines in kotlin arent really a thing during runtime in a sense

#

Compiler magic

jovial warren
#

Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops...

old wyvern
#

Kotlin Coroutines != Coroutines from other languages

prisma wave
#

yeah

#

it does implement Continuations though afaik

jovial warren
#

I thought Kotlin coroutines were still actual coroutines

old wyvern
#

They cant

#

JVM doesnt have that till project loom

#

Kotlin only has anything that would be available to Java or the other JVM lamguages

#

Once project loom is out

prisma wave
#

loom would probably be faster since it's lower level

old wyvern
#

We may get a better coroutine implementation in kotlin as well

#

Mhm

prisma wave
#

also sealed interfaces in java are cool

jovial warren
#

sealed interfaces?

prisma wave
#

and pattern matching with instanceof

#

sealed classes but with interfaces

#

and probably with a bytecode impl

#

compared to only a compiler impl with kotlin

jovial warren
#

does Kotlin not support sealed interfaces?

old wyvern
#

Kotlin is basically Java with some syntax sugar

prisma wave
#

nope

old wyvern
#

@jovial warren doesnt exists as sealed classes after compile

#

A lot of background changes happen

#

Like internal modifier changing names

jovial warren
#

also how do sealed classes in Kotlin actually work btw? I mean ik they have a known amount of subclasses or whatever, but in Java you have this permits keyword apparently, something I've never seen in Kotlin

prisma wave
#

just compiler checks

#

they can't be anything fancier than that bc it's not supported in the bytecode

#

they compile to completely normal classes

old wyvern
#

Mhm

jovial warren
#

isn't the whole point of sealed classes to make the subclasses a class has known to the parent?

prisma wave
#

not exactly

old wyvern
#

No

prisma wave
#

it's to restrict the amount of subclasses to a known set

old wyvern
#

^

#

In a sense

#

A type of Enum

jovial warren
#

ah okay

prisma wave
#

value types should be cool too

#

lots of fancy new jvm stuff

old wyvern
#

Ooo project valhalla

#

So objects with contain the values instead of references to the contained data?

prisma wave
#

I think so

old wyvern
#

From what I read its supposed to act like c structs

prisma wave
#

kinda confusing stuff

#

Yeah

old wyvern
#

I mean cool but is it really useful?

#

I probably dont understand it I guess

prisma wave
#

idk I guess they would be faster

#

Maybe you could get the speed of a primitive but with higher level access or something

#

Not sure tbh

old wyvern
#

Hmm true

prisma wave
#

I guess they might be like kotlin's inline classes

old wyvern
#

But you wont be able to have a Object in a ValueType then right?

prisma wave
#

¯_(ツ)_/¯

old wyvern
#

Ah I guess compositions of primitives

#

Rip String

#

Wait C structs allow arrays

#

Ok maybe they do allow objects

lunar cypress
#

They do

old wyvern
#

ValueTypes?

lunar cypress
#

Yes

old wyvern
#

Oh, do you know what improvements it bring over classes?

prisma wave
#

yeah I think they are basically kotlin inline classes

#

Codes like a class works like an int.

old wyvern
#

Yea thats why I assumed it was to act like primitves

prisma wave
#

yeah looks like it

#

totally immutable

old wyvern
#

But should primitive like structures hold a reference tho?

lunar cypress
#

They are stored in consecutive memory iirc

old wyvern
#

Imma probably go read a bit more on this

prisma wave
#

yeah looks like it

old wyvern
#

Ah

prisma wave
#

they're stored directly in memory like primitives

#

rather than via references

lunar cypress
#

And i actually don't know whether objects are allowed, misspoke there

old wyvern
#

But what if it holds a reference type?

#

Ah

lunar cypress
#

But other value types a re allowed

old wyvern
#

I see

ocean quartz
#

Johnny, changed to use MethodHandles now, it's pretty speedy

lunar cypress
#

👍

prisma wave
#

speaking of speedy

lunar cypress
#

What's the encoded thingy

prisma wave
#

I think they encoded a String into long

jovial warren
#

does inlining even work in Java?

old wyvern
#

The project isnt out bard

#

Its a early access release

jovial warren
#

well, I mean, Kotlin has it, so it's possible

prisma wave
#

ofc it's possible

old wyvern
#

Compiler magic

jovial warren
#

JVM magic

prisma wave
#

inlining is the compiler

jovial warren
#

yeah true

old wyvern
#

Mhm

jovial warren
#

I class JVM magic as anything where you can use regular code to modify bytecode at runtime (obviously not including things like changing a var's value lol)

old wyvern
#

What does this have to do with runtime bytecode manip?

jovial warren
#

¯_(ツ)_/¯

static zealot
#

yo I have a random question. How do you make those configs where you can add lists or something and you can take the entire list? I'm using ConfigMe

#

everyone does them but I never figured out how to do it

#

xD

prisma wave
#

can't you just make a property of type List<Blah>?

static zealot
#

I have no idea believe me that's why I'm asking

#

but I guess that make sense

#

xD

prisma wave
#

well iirc it's like ```java
@Config("path.here")
public static List<Blah> list;

distant sun
#

ListProperty

empty flint
#

Is there a way to get the actual itemstack name, not the display name or the localized name?

prisma wave
#

wdym actual name?

steel heart
#

Material ?

empty flint
#

@steel heart material is not the same as the name. Especially with items whose name depends on the meta.

steel heart
#

yeah but then what is actual name for you?

#

default name is the localized one

#

else you have the material name

oak coyote
#

Material#getName()

empty flint
#

@oak coyote That returns the name of the material enum which isn't the name of the item

#

@steel heart when I print the localized name, I get an empty string

steel heart
#

thats weird

empty flint
#

Have you tried it?

steel heart
#

although I have no idea how the localized one behaves

#

not really

prisma wave
#

based on the language of the server

#

afaik there's no way to get Iron Sword from Material.IRON_SWORD if that's what you mean

old wyvern
#

Replace _ by space and Capitalize?

#

if in kotlin, add in a extension func

#

or possibly