#dev-general

1 messages · Page 193 of 1

prisma wave
#

You probably want out Unique

empty flint
#

but isn't out the "producer"?

prisma wave
#

not an expert on generics but I believe out is the same as ? extends Unique

#

Make a copy of the variable

#

or use ?.let

astral quiver
#

something like this: val myZombie = zombie

#

and then, use it on the if

empty flint
#

@prisma wave another weird dead end I found myself in:

interface Identifier<T : Unique>
{
  ... 

  fun get(id: UUID): T? = IdentityLookupTable.get(id)?.let {
    if(it is T) return it else null
  }

  ...
}

doesn't compile because I cannot check (it is T) but I cannot use <reified T> because it's an interface method. Any ideas?

prisma wave
#

Impossible to check

#

However I think you can do as? T

#

Which will do the same thing

#

Ish

empty flint
#

I can but it gives me a compiler warning

#

why is it impossible to check?

prisma wave
#

Type erasure

empty flint
#

ah that damned thing again

#

I forgot xD

empty flint
#

Generics are shit

#

Or I don't understand enough

#

or both

ocean quartz
#

Generics can be pretty awesome
Just depends on what you're doing

empty flint
#
  val map1: Map<Class<T>, List<T>> = emptyMap()
  
  companion object {
    val map2: Map<Class<T>, List<T>> = emptyMap()
  }
#

map1 compiles fine, map2 doesn't

#

I need map2

#

All I want is tell the compiler that the List each key points to contains elements of that key type

ocean quartz
#

You sure you want to expose the map like that?

empty flint
#

no it's gonna be private

#

doesn't matter

steel heart
#

Generics are awesome but little poor sometimes

empty flint
#

Well do you have an idea of how to tell the piece of shit kotlin compiler that the map contains classes as keys and the lists they map to contain elements of that class?

steel heart
#

First of all

empty flint
#

Or I guess the compiler probably doesn't care, really

steel heart
#

Use a Multimap

empty flint
#

Why?

steel heart
#

Instead of List<>

#

the Multimap will handle that for you

#

Also you will probably have to make an unchecked cast btw

#

Depends on what you’re doing but still

prisma wave
#

@empty flint dude

#

The companion object literally can't be aware of generics

#

Think about it

#

It makes no sense

#

Blah<Int>() has the same companion object as Blah<String>()

#

which is my point

#

What you're doing makes no sense at all

empty flint
#

Blah<Int>() has the same companion object as Blah<String>()
@prisma wave No I get that and I don't want the T to be defined by the class the companion object is a companion to. Completely different scenario

#

I just want a static map that has the property where the keys are classes and the values are a collection of instances of those classes

#

completely generic though

#

like nothing specific whatsoever

prisma wave
#

then just have a Map<Class<*>, Any>

steel heart
jovial warren
#
  • ?

prisma wave
#

meh

steel heart
#

Like wth java why ?

prisma wave
#

why not?

steel heart
#
  • feels more natural
#

As a symbol for wildcard

prisma wave
#
  • isn't a wildcard technically
jovial warren
#

@steel heart then why tf is your name still ? super ?????????

prisma wave
#

my face when generics

#

:) :( :|

steel heart
#

Because java?

#

I don’t do much kotlin rn

#

Although I do some research about it

prisma wave
#

just generics

steel heart
#

my face when generics
Nested generics wesmart

prisma wave
#

ngl the clojure joke is getting pretty old

#

but

#

no generics in clojure

steel heart
#

Oh

prisma wave
#

@lunar cypress you ever used luminus before?

prisma wave
#

oh god

#

what have i got myself into

#

ive done it

#

clojure website

#

localhost/test

#

wow

#

-> function is cool

#

make clojure go left to right

steel heart
#

wow amazing

prisma wave
#

it is

#

it's like

#

great

#

turns clojure into kotlin

steel heart
#

clojtlin

prisma wave
#
(map blah (filter condition list))
(-> list
  (filter condition)
  (map blah))
steel heart
#

ay

#

aye just started using guice like heavily @prisma wave

#

its so nice, but little slower

prisma wave
#

Neglible at runtime

#

Well not exactly

#

But like

#

It's a minecraft plugin

#

Even if it takes 20ms to initialise something on startup that's not really a problem

steel heart
#

its a forge mod

obtuse gale
#

has anyone else's intellij been slow/crashing since updating to kotlin 1.4.10?

heady birch
#

keyword: kotlin

obtuse gale
#

no u

distant sun
#

what do I use for -XX:HeapDumpPath to create the dump on the server root folder?

#

or will be created there by default?

empty flint
#

What do you call those utf-8 characters that are used for decorating text? Like the arrows and the table elements and shit.

#

I don't know what to google to find them lol

prisma wave
#

Dividers?

distant sun
#

"copy paste symbols"

astral quiver
steel heart
#

Nope but that’s nice

#

If anyone wants to do something collaborative I’m in

distant sun
steel heart
#

What is even that

distant sun
#

eclipse memory analyzer

#

15% of 500mb, assuming that's how much memory my server was using 🤷

#

why all issues are related to hashmaps smh

ocean quartz
#

Time to try this

remote goblet
#

sounds oddly sexual

#

you wanna plead code with me? shy

onyx loom
#

never say that again pls

oak coyote
#

I’ll fondle with your code anyway 😊

onyx loom
#

cursed

ocean quartz
#

This shit is actually awesome ;o

remote goblet
#

Lemme just like shy help you put in the exclamation mark shy

ocean quartz
#

I'm fighting with gaby over a semicolon

distant sun
#

his name is coli

remote goblet
#

smh imagine using semicolons

#

laughs in kotlin

ocean quartz
#

It's not needed!

distant sun
#

just because he's not here doesn't mean you can trash talk him

remote goblet
#

how about we PU_PeepoBlushyTips insert a semicolon 🥺

#

okay ima stop

onyx loom
#

coli is bad

#

dont trust him

#

evil man!

oak coyote
#

When devs lose their minds things always work out

#

But that is pretty neat so it’s real time updates?

ocean quartz
#

Yeah, even shows which class someone is working on, and you can even follow them

oak coyote
#

That is neat I may want to try that at some point is it just a plugin for IJ?

#

Case sensitive? %PLAYER%

ocean quartz
oak coyote
#

Ohh yeah this is dev general

distant sun
#

it is but you have to finish a survey first

oak coyote
#

How long did the survey take?

ocean quartz
#

A few seconds, can just bullshit it xD

oak coyote
#

🤦‍♂️😂

#

Yeah I’ll definitely give it a try cause let’s be honest merging, pushing and pulling is just a pain

distant sun
#

tell me about it

oak coyote
#

Now I can fight the other devs real time 👌🏻

#

Did coli get to live?

distant sun
#

no ..

onyx loom
#

🙂

distant sun
#

🥦

#

coli's brother

#

:))

compact light
#

does array or vector take more memory in general

#

im assuming vectors right?

hot hull
#

@distant sun Remove that semicolon.

distant sun
#

Hater

old wyvern
#

New intellij feature? or plugin?

ocean quartz
#

Right now it's a plugin but i think it'll be q feature

prisma wave
#

Interesting

#

Nashorn is no more

hot heron
#

Can anyone tell me what the use for Function.identity() is?

#

There has to be a reason for it existing, I just don't understand why you'd use that over t->t

#

I saw an argument that might make sense that Function.identity() doesn't return a new instance, but idk, that doesn't seem like reason enough

prisma wave
#

Yeah it's a singleton so saves a bit of memory

hot heron
#

I've spent most of today learning about functional interfaces

prisma wave
#

they're quite handy

hot heron
#

I started the day learning more about Stream and ended up hitting the interfaces instead lol

#

I was confused about Supplier until I realized that it'd be useful for Asynchronous I imagine

lunar cypress
#

@lunar cypress you ever used luminus before?
@prisma wave nop, what's that?

prisma wave
#

Clojure web framework

#

Apparently it's pretty good

#

Seems quite simple

lunar cypress
#

Oh, never heard of it

#

So far I've only used ring

empty flint
#

Do you guys know where the spigot language files are stored at?

#

like the translations...?

#

Or are those client side?

lunar cypress
#

Client side

empty flint
#

Do you happen to know where those language files are located at?

#

Ah found em

#

Could I get into trouble if I put those lang files in my plugin?

#

I just need to get the real item name if it has no display name. It used to work like this:
CraftItemStack.asNMSCopy(item).name and then later using CraftItemStack.asNMSCopy(item).name.text
But those do not work anymore.

#

All I get from CraftItemStack.asNMSCopy(item).name
is 'TranslatableComponent{key='item.minecraft.diamond_sword', args=[], siblings=[], style=Style{ color=null, bold=null, italic=null, underlined=null, strikethrough=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null, font=minecraft:default}}'

The information is there, I just don't know how to translate a TranslatableComponent. Are there any packets for that or something? Does anybody know?

distant sun
#

PikaMug (Quests author) has a lib for that iirc

empty flint
#

Found it

#

CraftItemStack.asNMSCopy(item).name.string returns the translated name

lunar cypress
#

Isn't there getLocalizedName() for that

tired pumice
#

@lunar cypress help please

sour valley
#

Hello I need help

#

I'm using DeluxeMenu, and I'm making a plugin that uses the DeluxeMenu command when the user presses F.

#

For example, in the DeluxeMenu, chests.yml is set to open with the /chest command.

distant sun
#

Player#chat("/chest")

sour valley
#

And in my plug-in, I tried execution with the following syntax.

#

dispatchCommand() and performCommand

#

Unknown command is displayed.

distant sun
#

That's for registered commands

sour valley
#

yeah i think it's because the command is not registered

distant sun
#

Player#chat("/chest")
@distant sun use this

sour valley
#

Is there only way?

#

I know that if you try that method you will succeed.

#

But I'm reluctant to use it...

#

What do you think... It will be a little bit bad.

#

If there is any other way, I want to choose another way.

frigid badge
#

you can use /menu open or smth

#

since that is a registered command afaik

sour valley
#

run console

#

Yes, that's good too.

#

Why didn't I think about it? 😩

frigid badge
#

just do /dm open <menu> <player>

sour valley
#

Thank you

empty flint
#

Isn't there getLocalizedName() for that
@lunar cypress I have never seen any value being stored in the localized name. Not once.

#

Does anybody have an idea of how to get the NMS CraftBlock to a corresponding bukkit Block in a world?

lunar cypress
#

@lunar cypress help please
@tired pumice what

distant sun
#

Whats wrong with chat()? It just makes the player run that command

obtuse gale
#

ooh

#

ij code with me seems cool

remote goblet
#

ive not tried it yet

obtuse gale
#

im trying it now

#

anyone wanna try it with me?

#

otherwise imma just be testing it between my laptop and my pc lol

oak coyote
#

If I wasn’t about to go out I’d say hell yeah to that

steel heart
#

Sure when I get home

old wyvern
#

I wanna try it out

#

One sec

frigid badge
#

wait what is that

#

some collab thing?

quiet depot
#

ay

#

@frigid badge i'd assume so, it was on the roadmap for this year

frigid badge
#

cool

heady birch
#

How do you get it

#

Im on 2015.01

obtuse gale
#

you gotta download a fancy ij i think

#

Do that survey then it gives you a google drive link

heady birch
#

Scala

distant sun
#

pretty cool

empty flint
#

@ocean quartz Does your command framework support mutually exclusive parameter groups?

something like
/cmd location x y z
/cmd location player

both get the location but one uses the specified player location and the other uses coordinates...

distant sun
#

I dont think so

#

You can probably use String[] args

remote goblet
#

other times

#

i wanna die

#

@quiet depot you know gradle, halp

heady birch
#

🤦‍♂️

remote goblet
#

niall shut up

heady birch
#

Oml

#

Educate yourself

remote goblet
#

Suck a dick

heady birch
#

Also just a suggestion

#

This likely wouldn't happen in a compiled language (e.g Rust or C)

remote goblet
#

i dont care about the shitty languages this server is circle jerking now mmSitStareMocha

heady birch
#

No brainer

remote goblet
quiet depot
#

@remote goblet paste ur build.gradle

remote goblet
quiet depot
#

you need the shadowjar plugin

remote goblet
#

ah

#

that'd make sense

#

well this'll be fun

#

Sometimes i hate how chonky the kotlin lib is

quiet depot
#

then don't use kotlin 4head

remote goblet
#

but like

#

emojiplead string interpolation

heady birch
#

piggy I could do with your opinion on something

#

I'm building a decoding library that has so many possible fields

#

theres over 20 different message types

#

alot of those types share certain fields

#

To the point where most existing libraries that do the same thing use a single struct

#

There is a java version that uses proper inheritance and all

#

Although im using rust theres no inheritance

quiet depot
#

are shared fields just coincidence, or are these message types somewhat related?

heady birch
#

There are rustic enums

#

I don't know how to explain it

#

Did you want an example:

#

Decoding is here

#

The struct is here

quiet depot
#

jesus

#

this code is

#

just

#

highly questionable

heady birch
#

a java implementation

#

i think the idea is performance wise that big struct would work well?

#

considering its not copied throughout the program (as far as im aware)

quiet depot
#

I'd assume the very opposite

heady birch
#

How does object allocation compare between C and Java?

#

I thought java was better at it but read that C was

quiet depot
#

well they're not comparable afaik

#

precursor, I don't know c

#

but c's memory management is entirely manual

heady birch
quiet depot
#

java's memory management is automatic, unless you delve into the unsafe api

heady birch
#

Heres part of what I've written

#

Consider each number/downlink format = a individual message type

#

So you could imagine

#

Alot of nested structs/enums

#

Or fields being shared in different structs/enums

#

If your aware how rust enums work

#

And I want to think how the user would use it

#

With a single struct the user kind of has to know the insides of which types contain which data

#

With separate structs you can tell that quite well

quiet depot
#

look honestly, I've already given you my recommendation in the past

#

separate structs

empty flint
#

Do commands have to be unregistered when the plugin gets disabled?

onyx loom
#

Im on 2015.01
@heady birch might wanna upgrade buddy

static zealot
#

xD

#

At this point he's not even going to be able to. It will just think he uses a cracked version of IIJ

onyx loom
prisma wave
#

me when my cracked eclipse neon gets deactivated by the eclipse "foundation"

#

me

#

Me when

onyx loom
#

🤔

obtuse gale
#

tf is eclipse neon

prisma wave
#

🅾️ 😊

#

eclipse

heady birch
#

Why is it cracked

#

Eclipse is free???

#

Also neon is what I used back in the day

#

After like oxygen

#

Or the other way round

prisma wave
#

r/wooosh bro :))

obtuse gale
#

hey

#

could you help me with one of my bots on my server?

#

the dyno bot wont work with auto roles

regal gale
#

Neon is before Oxygen

prisma wave
#

eclipse professional

regal gale
#

I remembered i used oxygen for 2 years then I moved to IJ

old wyvern
#

I used eclipse from Mars to Oxy I think

regal gale
#

Same

#

Short question

#

Does anyone here still uses MS Access?

onyx loom
#

ew

regal gale
#

I mean.. yeah 🤷

heady birch
#

Did a while ago

regal gale
#

In this school semester, we have to learn it...

heady birch
#

Many companies most likely still use it

#
  • Its useful for learning SQL concepts
#

Think you can query access with ms sql

prisma wave
#

youthful

#

liskov

#

potentially

onyx loom
prisma wave
#

coincidence??

#

i think not

onyx loom
#

what are u implying here

onyx loom
#

🤣

heady birch
#

Sxtanna

onyx loom
#

😭

heady birch
#

Anooying frosty

hot hull
#

You should buy a pair of glasses

prisma wave
#

wow

empty flint
#

How often should I access a property of a property of an object before it makes sense to store the property of the object as its own variable instead?

hot hull
#

twice

empty flint
#

so if I access it more than once?

hot hull
#

mhm

empty flint
#

Can you explain why or is that just some gut feeling?

prisma wave
#

3

#

only 3

onyx loom
#

event.getPlayer
event.getPlayer
event.getPlayer

prisma wave
#

or 8 if you're dealing with standardised buffered accessing

empty flint
#

or 8 if you're dealing with standardised buffered accessing
@prisma wave How would I know if I am or not? 😦

onyx loom
#

event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer

empty flint
#

event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
event.getPlayer
@onyx loom Very insightful.

prisma wave
#

@prisma wave How would I know if I am or not? 😦
@empty flint you're not

#

there is no answer to this question

#

it's just whatever you think is good

#

more than 5 is probably a problem though

empty flint
#

But surely one has to be better/quicker/more efficient than the other

onyx loom
#

doubt it

prisma wave
#

if it's just a getter it's gonna be neglible

empty flint
onyx loom
#

imo its just more clean if ur using it more than once

steel heart
#

Negligible != none

empty flint
#

imo its just more clean if ur using it more than twice
@onyx loom I agree, if it's more than twice I almost always already use a variable. Intuitively. But what about exactly twice?

old wyvern
onyx loom
#

edited

empty flint
#

So what I'm interested in weighing out is the cost of storing a value as a variable at runtime vs the cost of calling a member of an already known variable.

hot hull
#

Ew enough or?

toggles:
  announcement:
    setting:
      type: CHAT_MESSAGE
      check-type: CONTAINS
      check-input: "Daily Announcement: "
    permission: toggle.chat.announcement
  autosellNotify:
    setting:
      type: CHAT_MESSAGE
      check-type: CONTAINS
      check-input: "You have sold all"
    permission: toggle.chat.autosell
  advancements:
    setting:
      type: ADVANCEMENT_DISPLAY
      check-type: ALL
    permission: toggle.advancement.all
steel heart
#

Yeah blocky do some testing

prisma wave
#

@empty flint try it

empty flint
#

I think logically the difference should be however many cycles it takes to store an address in a cpu register.

#

so really negligible

steel heart
#

I personally always create a variable if the method is a getter and is used twice within a specific context.

#

twice or more

prisma wave
#

I highly doubt it will make a difference

#

invoking a getter is going to be practically neglible

empty flint
#

For me it's always been 3 times or more. Never if it's once of course and if it's twice I always weigh out if getting the value is a costly operation or not

steel heart
#

Well I think it’s good for readability partly as well.

empty flint
#

Well I think it’s good for readability partly as well.
@steel heart See this is why I asked actually. I just found a case where it looks cleaner if I don't store the value in a variable even though I am using it 3 times.

steel heart
#

How does not creating a variable make it more readable. You will end up with very long code lines

empty flint
#

And the question is am I willing to sacrifice 1 or 2 Hz of CPU time for more readable code lol

hot hull
#

Yes.

steel heart
#

That doesn’t matter ?

onyx loom
#

lol

#

1 or 2 Hz

empty flint
#

Not in this particular case but it's a matter of principle

onyx loom
#

on like a 3GHz modern cpu LUL

steel heart
#

If you really look for speed or something, don’t do java.

hot hull
#

Wise words

empty flint
#

If you really look for speed or something, don’t do java.
@steel heart That's why I'm doing Kotlin fingerguns

onyx loom
#

lmao

empty flint
#

😄

hot hull
#

kek

steel heart
#

Kotlin is slightly slower than java in some scenarios init?

onyx loom
#

and slightly faster

#

its a mixed bag

steel heart
#

At runtime?

hot hull
#

Faster in writting, and slower at execution right?

#

(as in making the code)

empty flint
#

on like a 3GHz modern cpu :LUL:
@onyx loom I mean I pulled those 1 or 2 Hz out of my ass. It's probably more because it has to swap out values from the registry and potentially load new pages from the cache and so on

steel heart
#

I think but I don’t know, Alex knows better

ocean quartz
#

it's not slower at runtime

empty flint
#

Why would it be slower at runtime if it runs on the same runtime that java runs on, which is the Java runtime?

steel heart
#

@prisma wave Didn't you do some research about that?

empty flint
#

hehe kotlin makes jre go brrrrrrrr

prisma wave
#

Indeed

steel heart
#

Lets hear it out

prisma wave
#

afaik kotlin can be faster due to certain optimisations, but it can also be slower at times

empty flint
#

Do elaraborate (see what I did there?)

prisma wave
#

Elara is the fastest language known to mankind

empty flint
#

shit who is it running away from?

#

Did it steal something?

prisma wave
#

me

onyx loom
#

stinky java users

prisma wave
#

I am an intimidating force

steel heart
#

Yeah that makes sense. Well there is like tons of bad code in used frameworks like "".equals(str) for instyance which slows down the speed a little

empty flint
#

I'm so punny I'm gonna go excuse myself to find a gun I can shoot myself with 🙂

steel heart
#

iirc str != null && str.isEmpty() is faster

hot hull
#

Sheesh

old wyvern
#

You probably wont have to worry about storing the returned value, do also consider the load of indirect addressing in case of repeated calling

prisma wave
#

pointers

hot hull
#

Y'all worrying about so miniscule speed differences it hurts my head

onyx loom
#

lol

prisma wave
#

This is why Go best language

steel heart
#

Micro optimisation is everything

old wyvern
#

Honestly no point in optimizing to this level

empty flint
#

Y'all worrying about so miniscule speed differences it hurts my head
@hot hull Bruh have a user trigger a million TNTs and you'll see why worrying about miniscule speeds can become vital

old wyvern
#

Thats the whole reasons programming languages are abstracted to this level

steel heart
#

thats true

hot hull
#

Blocky, MC itself won't handle that, so why you worried :kek:

onyx loom
#

or just dont let users trigger a million tnt

hot hull
#

The server will shit itself way before your miniscule speed non optimizations make a difference

onyx loom
#

if u want performance, go use those electrical pulses fingerguns

empty flint
#

How about I actually do my job as a developer and optimize to the best of my ability instead of saying fuck it, you can't do that because I am a lazy fuck who can't be bothered to care about the callstack

hot hull
#

If you want speed, go try out coke fingerguns (For legal reasons this is ofc a joke)

steel heart
#

If you're google or something, micros might be worth paying attention to

old wyvern
#

There is no optimization at this point borz

hot hull
#

You should probably look at other parts of your code which can be optimized to some reasonable extent, instead of worrying about such small things

steel heart
#

maybe like a pico second but that doesnt matter

empty flint
#

tbh afaik the compiler optimizes for multiple calls of the same getter anyway

old wyvern
#

It does not

steel heart
#

the compiler?

old wyvern
#

Atleast not afaik

empty flint
#

I remember learning about the gcc that does that for C and it's not a particularly hard thing to detect so I would be really surprised if it didn't do that, with all the other stuff it does

prisma wave
#

It would only be reliable for final values

#

otherwise it could potentially break functionality

empty flint
#

otherwise it could potentially break functionality
@prisma wave The compiler knows if the value changes between calls though.

old wyvern
#

gcc doesnt do that for function calls

#

It cant account for side effects

prisma wave
#

@prisma wave The compiler knows if the value changes between calls though.
@empty flint no it doesn't

old wyvern
#

The optimizations are in cases like loop unfolding and stuff

empty flint
#

Yes it does

#

like 99% sure it does.

#

I remember doing an assignment in uni

#

where we decompiled shit and also had to analize the optimizations of the compiler

#

and we found out it does that

old wyvern
#

Im pretty sure gcc does not do that

prisma wave
#
player.hp.blah()
player.hp.blah()
player.hp.blah()
player.hp.blah()

the hp could change at any point in this example

#

it can't tell

onyx loom
#

lol i was thinking the same

old wyvern
#

Also blah could return something and be doing something else

onyx loom
#

how is the compiler meant to tell that

prisma wave
#

magic

onyx loom
#

🤔

prisma wave
#

the elara compiler will be able to

empty flint
onyx loom
old wyvern
#

god xD

#

infixes

empty flint
#

it can't tell
@prisma wave It can because it knows what blah() does

prisma wave
#

you're forgetting that hp is not synchronized

#

any other plugin could change the value at any point on another thread

#

therefore the compiler can't tell for sure that repeated calls to getXP will always return the same value, unless xp is final

empty flint
#

Like you can't be sure with race conditions and shit but there are definitely cases where it can be certain that nothing changes

prisma wave
#

yes

#

in pure functions

old wyvern
#

^

empty flint
#

It might not work for all examples, sure, but it can know when it definitely doesn't change

prisma wave
#

therefore

#

haskell and clojure are the best languages

#

as they can be optimized infinitely

onyx loom
#

excuse me

#

ur forgetting about Dylan

prisma wave
#

no i'm not

onyx loom
#

😠

empty flint
#

How about the one and only true god of programming languages: asm

prisma wave
#

new commit: 'Docker'

#

push to master? (Y/N) Y

#

error push failed

#

git push --force

#

force push complete

#

wow

#

i am unbelievably smart

frigid badge
#

nice

#

i am proud

#

did you make the pipeline already

prisma wave
#

no idea but probably not

frigid badge
#

look at eCloud-API for example

#

in .docker & in .github

ocean quartz
#

@empty flint It doesn't by default, you can always make it possible with String[] though

prisma wave
#

hate docker

#

doesnt work

#

@frigid badge how does one expose ports?

#

i've got this

#

neither work though

frigid badge
#

EXPOSE

prisma wave
#

I've got that

#

EXPOSE 3000

#

😦

distant sun
#

EXPOSED

frigid badge
#

if using docker compose use the ports directive

#

if using docker run use —ports

#

or -p iirc

#

you need to tell it to use a host port

prisma wave
#

I was using IJ integration and just selected publish all ports or whatever it was

frigid badge
#

never used ij’s integration

prisma wave
#

o

#

weird

#

it works with docker run

#

must be IJ messing things up

onyx loom
#

dont blame software

#

its ALWAYS user error 🌝

prisma wave
#

absolutely typical

#

this "professional IDE" ruins my life yet again

#

andrey pays most of these programmers' wages so i suppose it's to be expected

onyx loom
#

🙄

hot hull
#

Just be smarter BM. It's always user error

onyx loom
#

yup

hot hull
#

Just like the customer is always right (unless that customers name is Karen, then they can fuck off)

prisma wave
#

"user error" yeah more like Andrey error

#

I've said it before and I'll say it again

#

Andrey is biased against me

#

He is scared of me

#

He knows I can expose him for the fraud he is

ocean quartz
onyx loom
#

😍

prisma wave
#

+"message"

ocean quartz
#

+"message"?

obtuse gale
#

+"message"!

prisma wave
#

+"message"
@prisma wave

ocean quartz
#

What do you mean? xD

onyx loom
#

😐

ocean quartz
onyx loom
#

next he gonna be asking for (component (buildComponent (append "Hello")))

ocean quartz
#

Ew

onyx loom
#

IKR

ocean quartz
#

We don't do Lisp here

empty flint
#

Hm looks like I gotta make my own command framework

#

One that is highly optimized to not waste a single Hz of CPU time

#

I really like your Framework Matt, but I despise annotations 😦

onyx loom
steel heart
#

I mean I don't prefer annotations but its good. You tried brigadier?

empty flint
#

I have not, how is it?

steel heart
#

Its good

ocean quartz
empty flint
#

I don't know, I think I prefer to write my own if I'm honest.

steel heart
#

I mean, generally when you want a framework, its main entry is high functionality which means optimisations might not be prio 1.

ocean quartz
#

Do it, it's fun

empty flint
#

Because I doubt Brigadier has mutually exclusive options and stuff

#

Do it, it's fun
@ocean quartz I've been meaning to ask: Is it necessary to unregister commands when a plugin is disabled?

steel heart
#

its good

ocean quartz
#

Normally no, but people use Plugman and other stuff like that so kinda yeah

steel heart
#

else you will end up with some other fatal issues kind of

#

plugman isn't good

#

nor is /reload

#

iirc it messes with the plugin class loaders

ocean quartz
#

Plugman is horrible

steel heart
#

Very

empty flint
#

One more reason to not support it by unregistering commands

#

so fuck'em

steel heart
#

You should though

#

if you really want to dive into optimisations, hard code stuff and dont use designs like implicit else

#

but its not a good idea

ocean quartz
#

Yeah it can also mess with hotswapping iirc, yugi had the problem

empty flint
#

hmm

#

alright then maybe I should, huh

hot hull
#

Brigadier
Kek

steel heart
#

its superior

hot hull
#

Was hoping it'd append an image link

empty flint
#

its superior
@steel heart To what exactly?

steel heart
#

I mean the cons is that they're kind of overusing generics unnecessarily

#

It's superior in command frameworks I'm aware of

#

Maybe one more superior exist

empty flint
#

I will put Brigadier into the ground with my command framework 😎

#

... and other bedtime stories I tell myself to not curl up in a puddle of misery

distant sun
#

BrigadierX

#

... and other bedtime stories I tell myself to not curl up in a puddle of misery
@empty flint :)) I feel ya

empty flint
#

stop touching me

ocean quartz
distant sun
#

looks hot, we have to admit

empty flint
#

why would brigadier be the only way?

distant sun
#

because is made by mojang

ocean quartz
#

Because brigadier is made by mojang and it's the command system of minecraft

distant sun
#

and also a pain in the ass

empty flint
#

am I stupid or what are you refering to?

ocean quartz
empty flint
#

I thought you meant that only brigadier could parse that command you pasted

#

what's so special about the screenshot that you can't do any other way?

ocean quartz
#

No, only Brigadier lets you have colors and placeholders

empty flint
#

oh

#

hm

steel heart
#

Doubt it, just because Brigadier is the only way to do this
@ocean quartz isnt that commodore?

ocean quartz
#

Yeah

onyx loom
#

brb switching to brigadier so i can make the commads rgb too kek

ocean quartz
#

Commodore is a wrapper for brigadier though

#

i hope to add brigadier support to my framework one day once i stop being lazy

empty flint
#

you know what this means

#

scrap all the framework progress I got done these past 15 minutes and start over

#

Thanks, notch Dinnerbone

ocean quartz
#

I mean just make your new framework wrap brigadier's shitty logic

empty flint
#

I don't wanna 😦

#

How do you even set colors in brigadier?

steel heart
#

Like anything else I would assume

empty flint
#

Also, isn't the source code of Brigadier open source?

#

Which means you should be able to set the colors and all that shit yourself as well?

steel heart
#

It is?

empty flint
#

oh already been posted

prisma wave
#

We don't do Lisp here
@ocean quartz yes we do

#

Also

#

You can override the unaryPlus operator

#

Which is what I meant by +"message"

#

Incidentally probably the most idiomatic clojure way of doing it is just a map

ocean quartz
#

Ugly

prisma wave
#

smh

empty flint
#

@ocean quartz
Matt's colored gui command brigadier wrapper when?

obtuse gale
#

How do you even set colors in brigadier?
@empty flint if you're taking about the colors displayed in the chat box, you don't

#

It's client sided

empty flint
#

Well damn

obtuse gale
#

The literals are gray and the required arguments are colored

empty flint
#

why does every cool feature have to be client side

obtuse gale
#

Blue yellow green pink gold, repeat

ocean quartz
#

one day

obtuse gale
#

But you'd need to inject your literal node into the nms dispatcher

#

Which is what commodore does

ocean quartz
#

You can kinda add color to tab complete and stuff, but it's actually really dumb the way it works

empty flint
#

So basically for code completion, I should use lucko's commodore and for the commands themselves I should use brigadier?

ocean quartz
#

Commodore is just a wrapper for brigadier, it does both already

empty flint
#

Interesting, it only mentions the completion on the github

#

why would he wrap brigadier tho?

obtuse gale
#

Not really a wrapper, it just lets you inject the literal node into the dispatcher

#

If you want to build it at runtime, you still have to use the same brig classes and methods

empty flint
#

Is there a good brigadier guide except that small README part of their github page?

obtuse gale
#

Not really, there is only one class fully documented and it's a bit.. poor

#

I believe someone made a fork and added documentation to everything

#

Should be one of the many open pull requests

remote goblet
#

oh lord

#

Dinnerbone does rust

onyx loom
#

@ Niall

remote goblet
#

no

#

hes annoying

onyx loom
#

wow thats rude

remote goblet
#

well yes

empty flint
#

Brigadier is a mess

#

holy crap

#

idk if it's worth it to use just to get fancy colors

frigid pond
#

it's all good but when i go back to the plugin and try place the sand it doesn't stack on the soul sand

pseudo owl
#

hello, i'm checking a data from mysql database

playerJoinEvent()

if player pass:
     can join to server 
else:
    kick the player

can player join to server because lag, mysql delay or something else?

#

or is there a better way to do that?

distant sun
pseudo owl
#

is there can be any exception

#

because lag, delay or whatever

obtuse gale
#

idk if it's worth it to use just to get fancy colors
@empty flint I mean if really all you want is the colors and don't care about brigadier as a command library, use the file thingy (the .commodore)

#

@pseudo owl the AsyncPlayerPreLoginEvent runs asynchronously ("in parallel"), so it won't lag the server if there is high latency between the server and the database

heady birch
#

@remote goblet got some thing to say ? dont disrespect rust. that is what i inferred from your tone

remote goblet
#

I don't know much about rust so i dont really care honestly

#

I can say i don't like you however

heady birch
#

i got the point

#

i'm sorry

obtuse gale
#

Are you?

heady birch
#

Doubt it, just because Brigadier is the only way to do this
surely with packets?

#

just no existing bukkit/spigot command api

#

I don't know much about rust so i dont really care honestly
A powerful language

#

Out does C in my opinion

obtuse gale
#

just no existing bukkit/spigot command api
Paper has a draft API on command registration/sending that allows you to modify the nodes

#

But as I just said.. it's a draft API, it will probably change, a lot

astral quiver
#

Hi folks, you are use the CodeWithMe plugin from IntelliJ? is still EAP

#

but is pretty cool

hot hull
#

@pseudo owl You should be caching your data

obtuse gale
#

codwithme plugin seems pretty cool

#

idk how good it will be with like libs and stuff tho, since the intellij autocomplete doesnt work with classes from libs from my testing

errant anchor
#

What is codewithme ?

pseudo owl
#

oh i got it

prisma wave
#

Oracle has declared war on circlejerking

old wyvern
#

lol

analog crater
#

Lol wheres the full article

prisma wave
#

Java 15 looks pretty good ngl

empty flint
#

Is an array of pairs in Kotlin basically the same as a Map without any lookup functions? Like datastructurally I mean. The map has different methods of course but they do contain the same data, right?

#

@prisma wave is this an error due to the old and trusty type erasure?

#

because String.replace(Char, Char) and String.replace(String, String) do not clash

#

But if I use them in the Pair<> it doesn't like it

old wyvern
#

Yup fingerguns

empty flint
#

How do I pass a vararg parameter on as the vararg parameter of another function?

old wyvern
#

spread operator

empty flint
#

Does not work for some reason

old wyvern
#

Can you show me the snippet you are trying?

empty flint
#
fun String.toCamelCase(
    vararg wordDelimiters: Char = charArrayOf('_'),
    delimiterMapping: Map<Char, String> = emptyMap()
): String = WordUtils.capitalizeFully(this, *wordDelimiters).modifyIf(delimiterMapping.isNotEmpty()) {
  it.replace(*delimiterMapping.entries.map { (k, v) -> k.toString() to v }.toTypedArray())
}

fun String.toCamelCase(
    vararg wordDelimiters: Char = charArrayOf('_'),
    newDelimiter: String = ""
): String = toCamelCase(*wordDelimiters, mapOf(*wordDelimiters.map { it to newDelimiter }.toTypedArray()))

#

The second method tries to call the first

#

but the compiler says the signature doesn't match

#

but it recognizes the *wordDelimiters to be a CharArray

#

And I'm confused

prisma wave
#

Is an array of pairs in Kotlin basically the same as a Map without any lookup functions? Like datastructurally I mean. The mapv has different methods of course but they do contain the same data, right?
@empty flint it's functionally equivalent to the entry set of a map (most operations are linear time)

old wyvern
#

@empty flint Your problem is that your first argument is a vararg

#

In that case you need to use named parameters

#

Otherwise reorder parameters to have vararg param as the last one

empty flint
#

I never would have guessed that in a million years. Thank you!

#

toCamelCase(wordDelimiters = wordDelimiters, mapOf(*wordDelimiters.map { it to newDelimiter }.toTypedArray())) works

#

I don't wanna swap the parameters because then I'd have to specify the map or string parameters every time when the wordDelimiters parameter is used way more frequently

old wyvern
#

overloading maybe useful in this case

empty flint
#

True, but unnecessary if I can get away with named parameters

prisma wave
#

@empty flint use toMap instead of mapOf(*)

empty flint
#

Is there a difference?

prisma wave
#

probably

#

Spread operator is slow

empty flint
#

oh right and I can lose the "toTypedArray()" method as well

#

smart

obtuse gale
#

if I wanna have a vararg constructor param do I need to like put val before it or something? That doesnt seem to work but like it doesnt let me access the vararg

#

or is that not how varargs work lol

distant sun
#

isnt it "vararg x"?

obtuse gale
#

I had vararg lore:String in the constructor but it doesnt let me access it in the methods in the class

distant sun
#

*lore?

empty flint
#

show the class snippet pls

distant sun
empty flint
#

that's mine lol

obtuse gale
empty flint
#

and not a class

distant sun
#

( ik )

obtuse gale
#

its as if it doesnt even existe

empty flint
#

the x isn't part of the class if you don't specify val or var

obtuse gale
empty flint
#

vararg val

obtuse gale
#

ah
]

empty flint
distant sun
#

Why are constructors so ugly :(

empty flint
#

I really like them

#

in Kotlin

#

99% of the time you only need the primary constructor

obtuse gale
#

Why are constructors so ugly :(
theyre not :>

distant sun
#

ye but is annoying to have everything in one line

obtuse gale
#

you dont have to

empty flint
#

then put it in the next line lol

obtuse gale
#
class Test(
val x:String,
val y:Int
){

}```
distant sun
#

🤷‍♂️

empty flint
#

clean af

obtuse gale
#

hey its better than

public class Test{
  private final String x;
  private final Integer y;
  public Test(@NotNull String x, @NotNull Integer y){
    this.x = x;
    this.y = y;
  }
distant sun
#

Facts

#

you did not specify var or val for first 3 params because is some kind of super constructor @empty flint ?

empty flint
#

yeah the super constructor adds them to the class which means if I did specify val or var, it would hide the super properties

distant sun
#

Weird

empty flint
#

makes sense actually

distant sun
#

How

empty flint
#

but also I don't have to specify them if I did not want them added as properties. I could modify them in the init block or just directly as vals that aren't specified via the constructor

#

for example

#

this way, aliases isn't a part of the class directly (if it weren't for the Command() super) but firstAlias is

distant sun
#

So you cant access name from inside BlockyCommand?

empty flint
#

I can becase it's a property of Command

distant sun
#

I see

empty flint
#

I mean it's no different in java

#

you pass parameters and they aren't automatically part of the class

distant sun
#

Yeah

empty flint
#

only in Java you have to explicitly set them as member variables

#

in Kotlin you can do that via val and var

#

in the constructor signature

distant sun
distant sun
#

let's say I have a list of regex expressions, should I combine them all in one or create a Pattern object for each

frigid badge
#

need more context

foggy pond
#

What's the best GitHub license which does not allow for users to redistribute my software?

frigid badge
#

'GitHub license'

#

such thing does not exist

foggy pond
#

Wdym lol

frigid badge
#

like I say there's no such thing as a 'GitHub license'

foggy pond
#

You know what I mean though..

frigid badge
#

just compare a few like, MIT, Apache, GPL

#

and look which you like the most

foggy pond
#

if I already created my repository, how to I create a license file?

frigid badge
#

just make a file in your repo..?

foggy pond
#

Yes, but I need the contents of the file

frigid badge
#

look at the link

#

and learn to google

foggy pond
#

You are so nice you know

#

Very helpful

frigid badge
#

lol

foggy pond
#

This is great, my premium resource got leaked after two days of release

frigid badge
#

that sucks

foggy pond
#

yeah lol open source

distant sun
#

need more context
@frigid badge a filter for console messages

frigid badge
#

just use one regex pattern

empty flint
#

Does anybody know how to register a command alias in Brigadier?

obtuse gale
#

You want to look at the CommandNode#redirect(CommandNode), tbh I never got it to work and I never really cared, just tested it one time so lol

quiet depot
#

@foggy pond did you expect open sourcing it to lessen the chance of leaks?

#

surely you understand how backwards that logic is

#

What's the best GitHub license which does not allow for users to redistribute my software?
also there’s no such license I’m aware of that does this, what you’re looking for is an nda.

frigid badge
#

When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation.

empty flint
#

When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation.
@frigid badge That highly depends on the jurisdiction. There is no international standard for this. Each country has its own laws regarding copyright.

frigid badge
#

that's correct

#

interesting list

distant sun
#

"Who steal or redistribute my work his mother is a .."

#

that's my copyright

prisma wave
#

his mother is an elara user

#

:)

distant sun
#

not that bad

prisma wave
#

kotlin "user" then

empty flint
#

What's the best way to create a singleton in Kotlin that takes a constructor argument? I'd use an object normally, but those can't have constructors

prisma wave
#

just do it the Java way then

hot hull
#

What fucker ghost pinged me

static zealot
#

not me

empty flint
#

Should "static" constants in Kotlin also be ALL_UPPERCASE by convention?

hot hull
#

Yes

empty flint
#

Why does org.bukkit.permission have parents and children?

hot hull
#

I think it works like groups, but I'm not too sure cause I've never actually used it

empty flint
#

is creating a "my.permission" the same as creating a "my" permission and a "permission" permission and adding "my" as a parent to "permission"?

obtuse gale
#

No, it's like grouping permissions

empty flint
#

what are grouping permissions?

obtuse gale
#

like this, I have all the normal perms, and the moderator one has all the others as children perms (to override their default values)

#

it literally just groups perms lol

empty flint
#

oh so if you set a perm to true, all its children will be true by default as well unless overwritten?

#

Is that it?

obtuse gale
#

no, it provides a different set of defaults for its children perms

#

see how the moderator perm has some values for the children ones that differ from their defaults

empty flint
#

that's just what I said

#

or did I misunderstand?

#

So a permission has a permission value (t/f), a default value (t/f) and a parent value (t/f)?

#

I don't understand the need for children here.

#

Why do you declare children if you're gonna set them individually anyhow

#

oh hold on

obtuse gale
#

that's the plugin.yml, so if you're using a perms plugin you can just use the moderator perm instead of redefining all the others one by one

empty flint
#

no I still don't understand xD

#

So the betterjails.moderator permission overrules the permissions of its children for the holder of the betterjails.moderator?

obtuse gale
#

yeah p much

steel heart
ocean quartz
dusky drum
#

Java 15 kinda interesting 🙂

ocean quartz
prisma wave
#

you see

#

james is scared of us

static zealot
#

keep away in what sense?

prisma wave
#

in james' america kotlin would not exist

ocean quartz
#

Probably like "features so good people won't want to use something else" but kinda failed on that lol

onyx loom
#

MILLIONS

#

altho they forgot to include javas biggest competitor - elara

#

clearly these news reporters dont know what theyre talking about 🙄

prisma wave
#

They were scared to mention it

#

they know what elara could do to their "business"

ocean quartz
#

Yugi is always silently watching

old wyvern
#

😂

empty flint
#

What the fuck is this fucking shit ass unprofessional variable naming convention, Dinnerbone?!

old wyvern
#

Im pretty dead to do much more

prisma wave
#

Decompiled?

heady birch
#

Who gonna tell him

prisma wave
#

Lol

heady birch
#

Decompiler generated that probably

#

He probably used a normal for loop

prisma wave
#

congratulations 👏🥳🎉

empty flint
#

Oh shit I should maybe be more careful when flaming Dinnerbone

#

You're right 😄

prisma wave
#

Dinnerbone more like

heady birch
#

more like Dinnerbone, not Dinnerbone

old wyvern
#

ǝuoqɹǝuuᴉp

onyx loom
#

lol

prisma wave
#

GH Codespaces is pretty cool

#

pdm time

ocean quartz
#

Use Code With Me on IJ ;p

prisma wave
#

no thank you

#

had enough of andrey's "software"

old wyvern
#

😂

ocean quartz
prisma wave
#

breslavism has gone too far

#

it needs to be stopped

#

it is the IDEology of satan

old wyvern
prisma wave
#

tier 2

ocean quartz
#

Level 10

empty flint
#

Lmfaoooo

#
You start the development sprint full of energy, but the ancient curse of Java bogs you down and you realize you are in for a marathon.

“Is it safe?” the massive code base keeps asking you.

“Is it safe?” forcing you to check whether your variables are null.

“Is it safe?” the sadistic voice is relentless.

“It’s so safe you won’t believe it!” you utter, but you are not sure anymore.
prisma wave
#

i just corrupted my school ID card

#

yay

onyx loom
#

how u manage that

empty flint
#

can an abstract JavaPlugin guarantee that its onEnable will be called?

#

I don't think so but maybe there's a trick to do that

prisma wave
#

how u manage that
@onyx loom basically i wanted to see what was on it, so i got an nfc reader
it didnt read properly so like a dumbass i tried writing the text "k" to it

#

ofc that worked...

onyx loom
#

😂

prisma wave
#

massive brain

onyx loom
#

might try the same 🤔

prisma wave
#

be careful

onyx loom
#

nah if i corrupt it thats good fingerguns

prisma wave
#

is it

onyx loom
#

yes

prisma wave
#

are you sure

onyx loom
#

positive

prisma wave
#

what bot

onyx loom
#

nothing

#

barry is almighty

#

he do what he likes

#

yes.

empty flint
#

So the frickin lib gets added as a dependency correctly, but the methods don't wanna get imported in the actual project

#

because fuck me that's why

obtuse gale
#

the hell are you talking bout

empty flint
#

the dependency is there

#

but the package name isn't resolving

#

and idk why or how to fix it

#

How do I clean a project and completely rebuild it?

obtuse gale
#

Intellij?

#

File -> Invalidate Caches / Restart

#

cache gets stupid at times

errant geyser
#

Fefo continuing to move up in the world

#

T2 now

obtuse gale
#

aye

#

I can upload files now 👀

#

and add reactions

empty flint
#

@obtuse gale unfortunately didn't solve the problem

#

The jar is in my local maven repo

#

the implementation dependency declaration works

obtuse gale
#

oh well

empty flint
#

But I can't fucking use it

#

that is so frustrating

empty flint
#

I have no clue what I did but it works again

#

screw gradle is my takeaway

patent lark
#
            Block b = e.getClickedBlock();
            TrapDoor trapDoor = (TrapDoor) b.getBlockData();
            trapDoor.setPowered(!trapDoor.isPowered());
            b.setBlockData(trapDoor);```
#

... its not powering the trapdoor

ocean quartz
#

You need to get the block state and update it

obtuse gale
#

@patent lark setBlockData(data, false)

#

The boolean is to apply or not physics (send block updates)

#

If you don't send any updates, it'll stay powdered because "it won't notice" it isn't really being powered

#

Why is it in a scheduled task in an event? Which event exactly?

remote goblet
#

Sometimes i build stuff twice because i have trust issues that intellij actually built the jar

ocean quartz
#

Sameee

obtuse gale
#

Hey guys, I was going to make an addon to SaberFactions by using their API and I was wondering what I should use as a dependency? I tried doing

 name: MagicFacs
main: denzity.magicFactions.Main
author: Denzity
version: 0.01
depend: [SaberFactions]
commands:
   test:
      usage: /test
      decription: Runs the test command.

And it didn't work, I also noticed that /help SaberFactions isn't a thing either, since its just /Factions. Should I change the dependency to just Factions?

#

Make a addon for placeholder API for plotsquared...

old wyvern
obtuse gale
#

Yeah I tried that and it worked lmao

#

Thanks

remote goblet
obtuse gale
#

[PlaceholderAPI] plotsquared is attempting to register placeholders via a PlaceholderHook class which is no longer supported!

#

@remote goblet

#

thats what server console says

remote goblet
empty flint
#

@prisma wave Could pdm be used to extract the core lib of my plugins into the plugin folder at runtime and use it as a dependency, or if it already exists, swap it with the latest version if necessary and use it if not necessary?

#

The thing is that I have a library that creates some singletons and I'd like all my plugins to use the same singleton instance. I shade my lib so every plugin has its own as needed but I just got the idea to not shade the lib and instead extract the latest lib version of all my plugins mutually and use that as the lib for all of them

astral quiver
#

I found a issue in PDM that IS complex to fix 😩

#

I was trying to fix for like 6hrs

#

I could get something, but, not enough

ocean quartz
#

Oh PDM 😫

onyx loom
#

😭

ocean quartz
#

In October I'll contribute to it

#

Gotta get my shirt

distant sun
#

🤣

prisma wave
#

mfw it's been like 3 months and relocation still hasn't been added 😐

onyx loom
#

😐

heady birch
#

ecloud

#

ecloud 2 would be out if vuejs didnt exist

old wyvern
#

isnt lemmo working on ecloud 3?

#

or is that 2?

ocean quartz
heady birch
#

@old wyvern lemmo is wokring on 2 with us

ocean quartz
#

Vue is great