#dev-general

1 messages · Page 170 of 1

pastel imp
#

isn't sqlite good for that too?

surreal quarry
#

yea i think so

pastel imp
#

you think so?

#

.-.

surreal quarry
#

i've never used it, but i know like CMI does, and I used them for a while

pastel imp
#

hmm thx

#

welp some things I could use placeholders api nha?

#

like get unique joins

#

from the server

#

also first time joined

#

etc

#

last login

ebon widget
#

Anyone know how to add custom JSON msgs to deluxechat

surreal quarry
#

im setting up a repo on my website, and when i access it at http://ip:port/ it works fine, but when i access it from the domain which i have setup, it looks like this screenshot

#

any ideas why this isn't working

steel heart
#

I think I falled in love with python

#

It’s so nice

old wyvern
#

Die

#

🤮

steel heart
#

It’s like Java but better

obtuse gale
#

thats kotlin

steel heart
#

No py is superior of kotlin

old wyvern
#

No py is superior of kotlin
@steel heart
thonking . Lets agree to disagree

obtuse gale
#

lets not

#

crusade?

old wyvern
#

yes

lunar cypress
#

I love how everything has to be relativised to Java and/or Kotlin here

hot hull
#

@lunar cypress Not at all, it's just, python sucks

lunar cypress
#

Name a language other than Kotlin that doesn't suck

old wyvern
#

C, C++, C#, Scala, Go

lunar cypress
#

Ok now I wanna know why you think Python sucks lmfao

empty flint
#

How do I declare this in Kotlin:

catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e)

obtuse gale
#

I dont think kotlin has multi catches

empty flint
#

catch (e: NoSuchFieldException | IllegalArgumentException | IllegalAccessException ) doesn't work

obtuse gale
#

I think you gotta use multiple catch things

empty flint
#

ugh

obtuse gale
#

pro gamers catch Exception then throw it if its not the right one

old wyvern
#

Ok now I wanna know why you think Python sucks lmfao
Mostly personal preference tbh. Off-side rule. Slow. GIL. 🤷‍♂️ . Its good for researchers for whom its easier to use when they really don't want to take the time to learn something more time consuming but I feel like its not so useful for people familiar with other languages.

lunar cypress
#

Off-side rule? GIL?

#

And you really think python is just an elaborate playground for academics?

#

I'm afraid you couldn't be more wrong about that

old wyvern
#

More of just personally dont like it

#

I'm afraid you couldn't be more wrong about that
Do reason

#

Im not an expert about this but from what I know of it, dont like it much

lunar cypress
#

Python is one of the most widely used languages in the entire industry

#

And things like tensorflow aren't a joke

old wyvern
#

Did not deny any of that.

lunar cypress
#

Or data science stuff

#

Well you said it's not so useful for people familiar with other languages

old wyvern
#

refferring to general purposes mostly

#

Should have made that clear

lunar cypress
#

That's vague

#

And idk what you think is wrong with "general purpose" python

old wyvern
#

Already stated those

#

It does have a lot of libraries for data science

#

Great. But* not everyone has use for that

lunar cypress
#

Great that it's by far not the only thing python is used for in the real world

#

Btw I asked about two of your three points because I literally do not know what you mean

old wyvern
#

Oh indentations and the lock

lunar cypress
#

Oh that GIL

#

Ok, that's fair

old wyvern
#

Yea as I said, Dont know that much about it

lunar cypress
#

Indentation, honestly... that's honestly 100% personal

old wyvern
#

Just dont like a few of the "features" of the language very much

#

Indentation, honestly... that's honestly 100% personal
mhm 🤷‍♂️

lunar cypress
#

What new features

old wyvern
#

new?

lunar cypress
#

Didn't that just say new

old wyvern
#

No?

#

I had plural for language written

#

just corrected that

lunar cypress
#

But you do like the mess of language features that is C++? Interesting

old wyvern
#

I dont feel of it as a mess

quiet depot
#

oo we shitting on python

#

that's one of my favourite pastimes

lunar cypress
#

It just doesn't get in my head that people complain about python's language features but defend C++

quiet depot
#

do you know why people hate skript?

lunar cypress
#

I like C but I certainly do not like C++

quiet depot
#

because it's the exact same reason why most people hate python

lunar cypress
#

I doubt that

#

But go ahead

quiet depot
#

you get these beginners, people that go to a code camp or whatever, who learn how to make a calculator in python

distant sun
#

py indendation remind me of yaml xd

quiet depot
#

and suddenly, they're experts

#

and they go around flaunting their newly attained python knowledge

viscid charm
#

I am an expert what u mean?

lunar cypress
#

That's not why most people hate python. That's why a minority of programmers with a big ego hate python

distant sun
#

is py considered a scripting language or smth?

lunar cypress
#

Yes

distant sun
#

is it worth to learn it?

quiet depot
#

why do you think most people hate python?

#

yes gaby

distant sun
#

who doesn't love some 'elif' on their life

quiet depot
#

python is used everywhere, shooting yourself in the foot by not knowing it

viscid charm
#

Lol never heard people hate on python. What d ou mean most people tho lol

lunar cypress
#

Most people who already hate python

#

Not in general

viscid charm
#

I dont hate python :P

distant sun
#

I hate xml 🤷

viscid charm
#

But then again I am an expert, not many people are

distant sun
#

I really wish java wasn't using xml for mobile apps design 😦

#

because it's disgusting - imo

quiet depot
#

fresh are you being ironic, or do you actually consider yourself an expert?

distant sun
#

yes

viscid charm
#

Grandmaster. expert would be undermining my skills

#

LOL jk i am dogshit

distant sun
#

I once was gold nova 🤷

viscid charm
#

Bro i barely know loops xD

quiet depot
#

personally I absolutely hate the language

lunar cypress
#

why do you think most people hate python?
Bad OOP, Aesthetics, failure at big scales

quiet depot
#

definitely my least favourite language

viscid charm
#

I have trouble with loops I almost gave up learning JAVA again

lunar cypress
#

That's a statement

distant sun
#

loops are easy 🤷

#

you just .. loop

viscid charm
#

Nested loops*

#

To create patterns :/

distant sun
#

wdym?

viscid charm
#

Like

#

for example

#

1
1 2
1 2 3
1 2 3 4

#

Took me days

#

to figure and understand it

#

and I probalby cant do ita gain

#

well i can but thats cus i am memorized a bit

obtuse gale
#

its quicker to just like print that normally isnt it lol

viscid charm
#

I cant even do:


  •  *
    
  •  *
    

obtuse gale
#

i wouldnt be able to do that either tbh

quiet depot
#

i've literally never needed to do something like that in real life, you encounter that shit on sites like hackerrank

viscid charm
#

Yes but the point is to understand loops

obtuse gale
#

i mean

viscid charm
#

thoroughly

obtuse gale
#

You never really need to do that tbh

viscid charm
#

Deep understanidng

#

u sure?

distant sun
#

String.format has some shit for tables

#

which I find interesting

obtuse gale
#

I mean maybe in some circumstances but eh

quiet depot
#

string.format has so much shit gaby

#

I wonder what the performance is

distant sun
#

idk

#

I dont use it too often

viscid charm
#

I also am bad with Arrays, Collections and generics. Manipulating Strings and stuff.

lunar cypress
#

It's worse than concatenation obviously

obtuse gale
#

ive never made an array in my life, collections are easy, i dont fully understnad generics yet either, idk what manipulating strings means tho

distant sun
#

but I once found on google smth like | %s-5 | %s-15 | who would generate a table with 5 and 15 spaces between and fit the given string inside

viscid charm
#

ALSO i am bad at math :/

lunar cypress
#

Yes

#

Formatters have a lot of useful flags

#

And you can see what happens if you try that without formatting

distant sun
#

but why people suggest not to use them

lunar cypress
#

Who does?

distant sun
#

everyone say String#format it's bad

quiet depot
#

I've never seen anyone say that

distant sun
#

😦

quiet depot
#

I often actually suggest people to use it

viscid charm
#

But yea i dont like moving on to Spigot. I was told by many people to learn Java first as I dont really know it. (i DONT WAnna be spigot dev X_X aka laggy buggy code)

quiet depot
#

you'll be told that in any support group

#

some people just can't recognise that spigot is a perfectly valid way to learn java

viscid charm
#

Well Splodgebox told me that when I used his API poorly

#

he only had 1 week of java before he moved onto spigot lol

#

I had 2 days but still

#

He also said to use HashMaps instead of SetMeta or FixedMetaValue

quiet depot
#

not sure what the latter 2 are

viscid charm
#

setMeta or like MetaData

#

for like cooldowns

#

like

#

here

quiet depot
#

yeah doesn't ring a bell

#

I usually use expiring maps for cooldowns

viscid charm
#

if (p.hasMetadata("lastSoulAnvilUse") &&
System.currentTimeMillis() - p.getMetadata("lastSoulAnvilUse").get(0).asLong() < 30000L)

#

somehting like that

quiet depot
#

well

#

might be worth looking into

lunar cypress
#

Or, you know

viscid charm
#

But i feel like

#

I am just bad at Alogirthmic, LIKE actual coding typa shit. Not syntax or watever if you get wat I mean

lunar cypress
#

Just a set that you remove the player from after some time

viscid charm
#

Like forexample

#

sort thorugh even and odd numbeers

#

^ This is just a simplified example

#

BUT given a problem sorta like that but complex, I cant seem to do it

distant sun
#

Will give py a chance but atm I want to learn some web design

quiet depot
#

wym give it a chance?

#

learn it?

distant sun
#

ye

quiet depot
#

web design is hard :/

distant sun
#

ik 😢

hot hull
#

You're just bad Piggy

quiet depot
#

bruh

hot hull
#

Very bad

steel heart
#

Does python have the ternary operator?

quiet depot
#

it doesn't

steel heart
#

Frick

quiet depot
#

i mean it has single line if's

steel heart
#

Yh

quiet depot
#

like kotlin

steel heart
#

Yeye but like ternary can be little handy sometimes

#

Although it’s negligible difference

quiet depot
#

if/else is a perfect replacement for ternary

#

just a bit wordy

steel heart
#

Or when I think of it, it can be very handy

#

Well anyways thanks for the answer

obtuse gale
#

@lunar cypress any updates on that map lib?

heady birch
#

Xml is nice

#

Json is bad

obtuse gale
#

you right there niall?"

heady birch
#

Fine thank you AJ

obtuse gale
#

xml bad

heady birch
#

Your statement is objectivley wrong

obtuse gale
#

*objectively

#

yo johnny

#

I just fixed your lib with 7 letters lol

heady birch
#

delete?

#

wait thats 6 letters

obtuse gale
#

idk if that breaks other things but it fixed my thing lol

distant sun
#

it wont work with versions that doesn't have filled_map

obtuse gale
#

probably 1.8 🤮

distant sun
#

legacy versions actually

lunar cypress
#

Ah yeah then the issue might be that I used spigot's legacy system and you didn't

#

Not sure how to work around that

obtuse gale
#

I mean its still cast to the same thing so why not just do like

ItemStack itemStack;
if(Compatibility.isLegacy()) itemStack = new ItemStack(Material.MAP);
else itemStack = new ItemStack(Material.FILLED_MAP)``` or is there more to it
lunar cypress
#

I guess I could do that

#

Although I can't access the constants directly

obtuse gale
#

wdym

lunar cypress
#

Yeah I think I'll implement that

#

I mean that I don't have both enum constants when compiling against one particular version

#

But I'll just use valueOf

obtuse gale
#

ah

dusky drum
#

does hologrpahicdisplays have like repo so i dont need to have jar on my pc for dependenci?

obtuse gale
#

I mean shouldnt you compiule with 1.16 anyway?

hot hull
#

It has a repo Gasper

obtuse gale
#

then that does have both enums

dusky drum
#

and how do i get it frosty*?

lunar cypress
#

Well does it?

hot hull
#

It's on the bukkit page Gasper

obtuse gale
#

I think so

dusky drum
#

i got it.

obtuse gale
#

I think 1.16 has both FILLED_MAP and MAP

dusky drum
#

how can i add some variable to list like
.addStuff(
blabla
blabla2
if(somevariable = true) adds blabla3
)
? Kotlin

lunar cypress
#

see that's a good example for cond-> in clojure @prisma wave

(cond-> [blabla blabla2]
  somevariable (conj blabla3))
dusky drum
#

:ČP?=???

lunar cypress
#

sorry

#

What you can use is lists that ignore null values

#

bit hacky but

#

listOfNotNull(blabla, blabla2, if (somevariable) blabla3 else null)

dusky drum
#

aha oke.

lunar cypress
#

@obtuse gale version 2.1.1 should be live now

obtuse gale
#

epic

lunar cypress
#

should fix this

dusky drum
#

Johnny what if i canta dd nulls?

lunar cypress
#

wdym

dusky drum
#

my list doesnt support nulls

lunar cypress
#

I thought you wanted to create a list

dusky drum
#

i already have list

#

i just need to add stuff to it

lunar cypress
#

Well, then... use an if statement?

dusky drum
#

how like if i remove that else null

#

it just doesnt work

#

eh did it the other way

heady birch
#

some one make a kiteboard extension

hot hull
#

For?

heady birch
#

anything

#

world guard regions

hot hull
#

What would be the point of that?

heady birch
#

assign scoreboards based on what region they are in

signal tinsel
#

@heady birch sure, gimme access to the plugin

obtuse gale
#

If ive got a game that has like multiple "steps" should i use something like this?

interface GameStep {
    fun run()
    fun nextStep():GameStep
}``` Then implement that for each step? Or is that a weird way to do things?
#

Actually some of the steps would involve waiting for the player interact event so idk how that would work

#

Im just tryna think of the best way to do this without it becoming a mess

empty flint
hot hull
#

Nah, 666 is best

lunar cypress
#

Just copy my connect four code aj fingerguns

prisma wave
#

@lunar cypress conj-> sounds useful

obtuse gale
#

isnt ur connect for in clojure lol

lunar cypress
#

Well, you know. Just mentioned it because it works similar to my own macro I explained earlier

#

Yeah it is but I have a mechanic for waiting for input fingerguns

prisma wave
#

Fancy

#

Anyone having the pdm Intrinsics issue available to test something real quick?

obtuse gale
#

riggght

#

so whats the best way to do it in like kotlin

lunar cypress
#

Coroutines

obtuse gale
#

sounds complicated

lunar cypress
#

Yeah

#

But it's really useful

obtuse gale
#

how would I use it for this?

lunar cypress
#

Kotlin also has channels

#

You could write a listener that puts events on a channel

#

And use suspending take to get them

#

That's sort of what I do in clojure

#

Kotlin also has stuff like Flow, whatever meets your needs

obtuse gale
#

I mean basically what im gonna need to do is

Send player message
Wait for player to run command
Build arena (5*5 box)
Teleport players
Listen to interact at entity event a bit
Reverse steps

#

so what should i look into lol

lunar cypress
#

Well I would separate the setup and the actual in game state

#

Good reminder that I should continue working on spiglin and add event waiting

obtuse gale
#

mm

#

Should I look into Kotlin also has channels?

#

and coroutines

lunar cypress
#

coroutines first

obtuse gale
#
GlobalScore.launch{
  delay(1000L)
  println("!")
}
println("hi")
Thread.sleep(2000L)``` im basically a pro now
hot hull
#

Thread.sleep(2000L)

#

bruh

obtuse gale
#

its to keep the jvm alive frcsty smh

#

this totally isnt copy + pasted off the kotlin website

prisma wave
#

GlobalScore

obtuse gale
#

shutup

prisma wave
#

Didn't even copy paste it properly

#

Smh

hot hull
#

kek

empty flint
#

Why does this Collectors.toMap call not work in Java?:

String constant = "const";
List<String> list = getListFromWhereever();
Map<String, String> map = list.stream().collect(Collectors.toMap(k -> k, constant));
#

It doesn't let me use k as the element of the list and as the key of the map.

prisma wave
#

because you're missing a .

#

lol

steel heart
empty flint
#

because you're missing a .
@prisma wave That's just a typo

old wyvern
#

You didnt provide a argument for second function

empty flint
#

You didnt provide a argument for second function
@old wyvern Yes! That's it! Ty

old wyvern
#

🍉

steel heart
#
private final Multimap<Class<?>, Consumer<?>> map;

void t() {
  map.asMap().forEach((clazz, collection) -> collection.forEach(consumer -> consumer.accept(clazz.cast(obj))));
}
``` for some reason `clazz.cast(obj)` gives me this https://discordapp.com/channels/164280494874165248/695431668944732270/747424959147671624
old wyvern
#

Yes because the Consumer in the map is not restricted to take in a element of that type

#

The Class could be a Class<Integer> and its corresponding value could be Consumer<String>. and so on...

steel heart
#

I mean yeah makes more sense ig

#

although I cant really make that

#

man I forgot ? super E exist

lunar cypress
#

You can never pass anything to something that accepts a wildcard with an upper bound

#

It's not type safe anyway, in those situation I often end up using raw types because generics simply aren't expressive enough

steel heart
#

because generics simply aren't expressive enough
That's very true

dusky drum
#

whats better to use NMS for NBT or just use default bukkit stuff: PersistentDataContainer

hot hull
#

persistentdatacontainer is 1.15+

dusky drum
#

i know

#

CustomItemTagContainer is for older stuff right

hot hull
#

Use nbt then yea

dusky drum
#

i mean i could search for some nbt util online but thats extra code eh.

hot hull
#

Check Matt's GUI lib, it has an nbt class which has everything you need

dusky drum
#

since if i want to use 1.13 - 1.16 i would have to use nms for each ver

#

where?

#

oh

#

there

lunar cypress
#

since if i want to use 1.13 - 1.16 i would have to use nms for each ver
@dusky drum what do you want to do

dusky drum
#

i just save some numbers/text to items

#

usualy 1-3 values max

lunar cypress
#

You may be interested in this as well then, this is one possible (and very fast) solution to version issues https://github.com/johnnyjayjay/compatre

hot hull
#

If it's java, without any boilerplate this is a lie fingerguns

lunar cypress
#

The others would be some library that has an implementation for every version or reflection

dusky drum
#

i mean i just use:

hot hull
#

Matt's NBTUtil class is nice af

lunar cypress
#

That does not work before 1.15.2

dusky drum
#

why wouldn't it?

lunar cypress
#

If it's java, without any boilerplate this is a lie fingerguns
@hot hull it's literally true in this case lol

hot hull
#

liar liar chicken frier

#

(I'll see when chrome decides to stop being a whore and actually opens)

lunar cypress
#

@dusky drum frosty already told you that this api did not exist before

dusky drum
#

did he?

lunar cypress
#

Yes? That's the whole reason you asked about nbt in the first place?

dusky drum
#

no?

#

i asked whats better

#

using built in stuff or nms

lunar cypress
lunar cypress
#

You got an answer to this

hot hull
#

"i know" GWsetmyxPeepoSad

lunar cypress
#

And you said you want it to work on older versions

#

So the question becomes obsolete

dusky drum
#

omg i firking asked whats better nms or friking built in stuff i didnt ask for verison support.

lunar cypress
#

Nms is built in

#

Idk what you're talking about

dusky drum
#

eh

lunar cypress
#

And yes you did mention versions lol

dusky drum
#

no?

steel heart
#

this is getting controversial

lunar cypress
#

What is your memory

dusky drum
#

so hard to get so simple anwser.

#

great

lunar cypress
#

This literally only leaves one answer

dusky drum
#

bye

#

i fucking asked whats better to use nms or default stuff since with fucking nms you have to do wierd stuff.

#

is it so hard to anwser that?

lunar cypress
#

Bro

#

Whatever

hot hull
#

Gasper..

dusky drum
#

what its true.

#

i know i can be rude but i asked for simple anwser

hot hull
#

You were given an answer to everything, just read....

#

IF you're only worrying about 1.15+ then use PersistentDataContainers

dusky drum
#

with i know i anwsered that i know persistentDataContainer is 1.15.

hot hull
#

Otherwise use NBT

dusky drum
#

i mean
customTagContainer = persistentDataContainer*

steel heart
#

spigots nbt api has changed like 2 or 3 times iirc

lunar cypress
#

"I want to store data on 1.13-1.16. What's better, PersistentDataContainer or NBT?"

"You can only use NBT then"

"That wasn't my question!"

#

Spigot doesn't even have an NBT api

#

Or was that added recently

hot hull
dusky drum
#

frosty sej bi to uporablo sam k pol morem string dat v int

hot hull
#

Vse je k string stored

steel heart
#

stroke language

heady birch
#

bruno mars

steel heart
#

srma orunb

errant geyser
#

Conclure these doggo pics keep getting better

empty flint
#

There has to be a way to make this more concise:
fun formatUuid(uuid: String) = if(uuid.length == 32) "${uuid.substring(0..8)}-${uuid.substring(8..12)}-${uuid.substring(12..16)}-${uuid.substring(16..20)}-${uuid.substring(20)}" else null

#

(inserting dashes at certain indices)

empty flint
#

oh rofl

sour spade
empty flint
#

rofl

#

tell me you got paid for that, puhlease!

obtuse gale
#

zero two

sour spade
obtuse gale
#

we dont do that here

sour spade
#

Skript? I find it useful for simple things

obtuse gale
#

we dont use the S word here

sour spade
#

Skript you you skripting skripter

obtuse gale
#

dont call me a sk---- pls

#

rude

hot hull
#

Leave.

obtuse gale
empty flint
#

Sometimes I make it a challenge to package a block of Java code with a couple of lines into a one-liner in Kotlin as I am converting my lib to Kotlin. This is the best one yet 😄

obtuse gale
#

you can make that better cant you

empty flint
#

Get fucked, future Blocky, trying to debug this

obtuse gale
#

remove the return and remove the { }

ocean quartz
#

Still waiting for multi catches in Kotlin 🥺

obtuse gale
#

its been like 5 years since someone requested it

#

its not happening any time soon.....

#

Also matt is MF-MSG ready for use yet or na?

empty flint
#

remove the return and remove the { }
@obtuse gale true, I could

#

Hm What's the difference between fun and inline fun? Like when should I make something an inline fun instead of a fun?

prisma wave
#

@empty flint why not just use OfflinePlayer.uniqueId ?

empty flint
#

@empty flint why not just use OfflinePlayer.uniqueId ?
@prisma wave Is that a thing? What does it do?

#

And how do I get the OfflinePlayer from the name?

old wyvern
#

getOfflinePlayer by name is deprecated

empty flint
#

exactly

old wyvern
#

but thats possibly what you are looking for

empty flint
#

No that's exactly what I wanna avoid

old wyvern
#

I mean you are already fetching by name

empty flint
#

true, but via the mojang api

#

not bukkit or spigot

old wyvern
#

Same issue

#

If someone changes their name

empty flint
#

but it's not deprecated afaik

old wyvern
#

are you using the timestamp?

#

UUID at time one?

empty flint
#

no

#

is there a sort of transformation function like map {} where it takes a string and outputs a string?

old wyvern
#

Then I don't see why not just use getOfflinePlayer by Name. With spigots history of using deprecated annotations, they probably just meant to ask people to not map thigns by username

#

Not completely sure tho

#

Do you by any chance need UUID of players who have not yet visited the server?

empty flint
#

Then I don't see why not just use getOfflinePlayer by Name. With spigots history of using deprecated annotations, they probably just meant to ask people to not map thigns by username
@old wyvern Because I don't want to have to re-write this if they do decide to delete it and it's not like I am using that method so often

#

Do you by any chance need UUID of players who have not yet visited the server?
@old wyvern Yes

#

Because, bungee

final trellis
#

I've learnt some basics of the spigot API - (sending messages, event listeners/handlers, config) - can anyone suggest what I should learn next?

old wyvern
#

Ah then you cant possibly use OfflinePlayer

steel heart
#

databases perhaps

#

or maybe your own command handler for sub commands

old wyvern
#

It only resolves UUIDs of players who have joined the server prior afaik

final trellis
#

alright - for the database, should I just go with an SQL-based one or something else like MongoDB

empty flint
#

It only resolves UUIDs of players who have joined the server prior afaik
@old wyvern tbh I wrote this like two years ago or so so I don't remember the details of OfflinePlayer but I do remember having tried everything else before resolving to this hideous mojang api and json fuckery

#

I would scrap it if there was a better alternative

old wyvern
#

I see

steel heart
#

@final trellis mysql

#

learning sql is very good

final trellis
#

I already know some, but not really very much
my experience is limited to typing in " OR 1=1 in search boxes and hoping that the page is vulnerable to SQLi lol

#

its tutorial crunch time then

empty flint
#

(JSONValue.parseWithException(IOUtils.toString(URL(getNameUrl(uuid)), StandardCharsets.UTF_8)) as JSONArray).map { it }

Why does it have type Any? when I call the map function from a JSONArray?

#

oh wait

#

it is the contents of the array, right?

#

nvm

prisma wave
#

@empty flint getOfflinePlayer queries mojangs API if the player isn't in the server cache

dusky drum
#

so if like player never joined server its gonna query the mojang?

old wyvern
#

getOfflinePlayer queries mojangs API if the player isn't in the server cache
It does?

distant sun
#

iirc getOfflinePlayer it's never null

    /**
     * Gets the player by the given UUID, regardless if they are offline or
     * online.
     * <p>
     * This will return an object even if the player does not exist. To this
     * method, all players will exist.
     *
     * @param id the UUID of the player to retrieve
     * @return an offline player
     */
    @NotNull
    public static OfflinePlayer getOfflinePlayer(@NotNull UUID id) {
        return server.getOfflinePlayer(id);
    }```
old wyvern
#

yea but last I tested it failed to fetch the right UUID when hasPlayedBefore was false

empty flint
#

is daisychaining and nesting methods better than to declare variables?

old wyvern
#

for readability, declaring variables is better

empty flint
#

@empty flint getOfflinePlayer queries mojangs API if the player isn't in the server cache
@prisma wave Are you sure?

errant geyser
#

I believe that is correct

empty flint
#

Still, I don't like accessing the deprecated method of getting an offline player via the name

errant geyser
#

The only way to get around that would be making an API request with the name, or somehow getting the uuid a different way

empty flint
#

apirequest is exactly what im doing

prisma wave
#

There's no caching that way

#

And yeah I'm about 90% sure

empty flint
#

do objects have to be encapsulated by some top level declaration?

heady birch
#

I have no idea what that means

empty flint
#
object PluginManager: PluginManager by Bukkit.getPluginManager()

object Server: Server by Bukkit.getServer()

IntelliJ doesn't like this

#

It's stuck in the code analysis

#

lol

heady birch
#

Isn't it just

#

val pluginManager = Bukkit.getPluginManager()

prisma wave
#

Probably failing because they have the same name

#

It's like class PluginManager extends PluginManager

ocean quartz
#

Browsing stack overflow is great, every once in a while you find a question without negative votes lmao

surreal quarry
#

i don't think i have ever just browsed stack overflow lol

ocean quartz
#

What, how do you code then?

distant sun
#

Lol

surreal quarry
#

i go on stack overflow

#

i just don't browse it

#

i search for questions i need to know answers to

empty flint
#

Under what circumstances does an ItemStack not have an ItemMeta?

hot hull
#

When it doesn't have an itemmeta fingerguns

empty flint
#

when would that be the case?

#

Like can it actually return null?

prisma wave
#

AIR doesn't have one

empty flint
#

oh interesting

hot hull
#

KM, u nub, my air has lore

empty flint
#

Does renaming the item on an anvil affect the localized or the display name?

old wyvern
#

display name

hot hull
#

Tf is localized name even used for?

ocean quartz
#

It's for different languages i think but i have never seen it used

empty flint
#

But

#

It doesn't ever work

#
ItemStack goldSwordStack = new ItemStack(Material.GOLDEN_SWORD);
        ItemMeta goldSwordMeta = goldSwordStack.getItemMeta();
        assert goldSwordMeta != null;
        goldSwordMeta.setLocalizedName(ChatHelper.colorize("&6GOLD SWORD"));
        goldSwordStack.setItemMeta(goldSwordMeta);
ocean quartz
#

I wonder, would I be allowed to publish to maven central a modified fork of a "BSD 2-Clause "Simplified" License" project?

empty flint
#

LocalizedName is never shown to anything or anyone...

ocean quartz
#

Localized name is only internal iirc

empty flint
#

but what for?

#

help

#

I can't unset the Pirate Speak language

shadow wasp
#

is there an equivalent of BroadcastMessageEvent on 1.8?

empty flint
#

jesus christ

#

I can't unset it

#

i'm stuck

old wyvern
#

yarr

hot hull
#

You trynna tell me you don't use it all the time? @empty flint

empty flint
#

Aye

hot hull
#

(the yarr language)

onyx loom
#

yarr

empty flint
#

unicode font ftw

#

so much cleaner

pastel imp
#

wth is localizedname?

ocean quartz
#

Gonna ask again xD
Would I be allowed to publish to maven central a modified fork of a "BSD 2-Clause "Simplified" License" project?

#

I guess as long as i don't change the license it should be fine?

lunar cypress
#

Redistributions in binary form must reproduce the above copyright notice,

this list of conditions and the following disclaimer in the documentation

and/or other materials provided with the distribution.

#

So, the contents of the license and a copyright notice whereever you can

ocean quartz
#

Gotcha, basically just need to modify it because for MC there is a few things that aren't great, so would need to have it somewhere for easy access

#

An example is that it instantly strips any tag like <g>

lunar cypress
#

Isn't there an option to disable html sanitisation?

#

There should be

ocean quartz
#

There is in the html parsing, but the way I do it there isn't, basically instead of letting it parse to html then handle it, i have to use it's node visitor to check for each node, and the parser doesn't have any options as far as i know

#

And another one that i'll really need to modify is that t__est__ this is not an allowed syntax in commonmark

lunar cypress
#

Why are you messing with commonmark again?

ocean quartz
#

You mean why i am using it? It's the base of the markdown lib
Or you mean why i need to modify it?

empty flint
#

prepend means place in front. append means place in back.
is there a word like "inpend" or something (other than insert, ending in -pend)?

#

(something like prefix, suffix and infix)

lunar cypress
#

insert

#

@ocean quartz i thought you'd written your own parser?

ocean quartz
#

No, i use commonmark to handle that xD

#

I was trying to make my own, but was getting too complicated
So Sx showed me that i can use their visitor to get the parsing stuff without much work
It's pretty small and fast so i think it's better than anything i could write

lunar cypress
#

Fair enough

#

But I mean you kinda have an own markdown flavour

#

So I guess that makes for a lot of complications

ocean quartz
#

Yeah, there is a few complications, I managed to solve most of them
Only 2 that requires me to modify the parser, and only one that has been pretty complicated to do which is the underscore rules

onyx loom
prisma wave
#

piss of barry

#

Off

ocean quartz
#

TOO_MANY_CAPS [100.00%] - 3 B I L L I O N D E V I C E S

#

Lmao

old wyvern
#

Is it really 2 progress bars? lmfao

prisma wave
#

Idk

#

Seems like it might be

old wyvern
#

rip 😂

steel heart
#

I think I hate python again

prisma wave
#

Nah

ocean quartz
#

Removed the if and it works just like discord t__est__

empty flint
#
var ItemStack.damage: Int?
    get() = when {
        !hasItemMeta() || itemMeta !is Damageable -> null
        else -> (itemMeta as Damageable).damage
    }
    set(value) {
        if(hasItemMeta() && itemMeta !is Damageable) (itemMeta as Damageable).damage = value ?: return
    }

How do I improve this?

lunar cypress
#

(itemMeta as? Damageable)?.damage

empty flint
#

instead of the when you mean?

#

what does as? do?

prisma wave
#

Safe cast

#

If it's not an instance, it will be null

#

Instead of throwing CCE

empty flint
#

shouldn't it be (itemMeta? as? Damageable)?.damage then? Or does the safecast already take the nullability of the object into account?

prisma wave
#

That's not right

lunar cypress
#

Well it's redundant because null as Anything will still be null

prisma wave
#

Pretty sure it won't compile

#

null as Type? will ofc

empty flint
#
var ItemStack.damage: Int?
    get() = (itemMeta as? Damageable)?.damage
    set(value) { (itemMeta as? Damageable)?.damage = value ?: return }

much cleaner

#

ty

hot hull
#

Disgusting

empty flint
#

Disgusting
@hot hull 😦

#

Don't look too long in the mirror then

hot hull
#

Oh sorry, I didn't mean that, I looked in the mirror

empty flint
#

😛

lunar cypress
#

Why the ?: return?

prisma wave
#

I would use 0 instead of nullable Int

hot hull
#

Bruh you reading my fucking mind lmao

empty flint
#

Why the ?: return?
@lunar cypress right I forgot to take that out, ty

#

Bruh you reading my fucking mind lmao
@hot hull Nah man, not your mind. The future.

#

I would use 0 instead of nullable Int
@prisma wave That would be ambiguous with actual 0 dmg value

prisma wave
#

True

#

But does the ambiguity matter?

empty flint
#

hm

#

0 dmg means it has a full bar still, right?

#

like dmg is subtracted, right?

hot hull
#

Damage is stupid

prisma wave
#

I think so

hot hull
#

You add to reduce damage

prisma wave
#

Bruh

hot hull
#

Like what fucking idiot decided that

prisma wave
#

I get so confused between damage and durability

empty flint
#

wait

hot hull
#

Yea talking about dura rn

empty flint
#

maybe I fucked up

prisma wave
#

Isn't damage the old way of doing wool colours and stuff

hot hull
#

Yes KM

empty flint
#

Damageable are entities, right?

#

I meant Durable

#

or whatever

hot hull
#

Bruh what

prisma wave
#

¯\_(ツ)_/¯

empty flint
#

idk anymore

#

lemme google it

#

No no its fine

#

Mitten confused me

lunar cypress
#

durability is the same as damage

#

Damage only exists in newer versions

#

Big brain spigot again

empty flint
#

Hm

#

Do ItemStacks extend Damageable or ItemMetas?

hot hull
#

Meta

empty flint
#

=haste

compact perchBOT
#
HelpChat Paste

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

empty flint
#

Meta
@hot hull Are you sure?

#

oh yeah ur right

#

So then this is the final result:

var ItemStack.damage: Int
    get() = (itemMeta as? Damageable)?.damage ?: 0
    set(value) { (itemMeta as? Damageable)?.damage = value }
#

maybe the set won't work though

#

because I might have to re-assign the meta?

#

set(value) { itemMeta = itemMeta.also { (it as? Damageable)?.damage = value }} this would be the workaround I guess

prisma wave
#

kinda hideous

empty flint
#

idk I like it tbh. Especially since I can then just do itemStack.damage = 1000 and the code will be so much cleaner with that

#

no more assigning and re-assigning the meta

dusky drum
#

hmmmmm
[18:51:14 WARN]: Can't keep up! Is the server overloaded? Running 5455438ms or 109108 ticks behind

#

thats quite a lot

empty flint
#

Hm

#

Next one:

fun tryCreateHead(headDescriptor: String): ItemStack? {
    val descriptorElements = headDescriptor.split("\\(|\\)")
    if(descriptorElements.size != 2 || ItemMaterial[descriptorElements.first()] != Material.PLAYER_HEAD) return null

    val headElements = descriptorElements[1].split(":")
    if(headElements.size != 2) return null
    
    val valueType = headElements[0]
    val value = headElements[1]

    return when(valueType.toLowerCase()) {
        "texture" -> createTexturedHead(value)
        "player" -> ItemStack(Material.PLAYER_HEAD).also { (it.itemMeta as SkullMeta?)?.owningPlayer = getOfflinePlayer(value) }
        else -> null
    }
}

Any ideas how to clean that up? I don't like the array split methods but they are necessary unfortunately. Any way to make them prettier?

hot hull
runic flume
#

But it does?

#

ffs

prisma wave
#

me when clojure 😎 pleadingUWU

runic flume
prisma wave
#

You using runtimeOnly or something

#

Oh

#

Ew

runic flume
#

maven

#

not gradel

prisma wave
#

This does not conform with the circlejerk

#

Unacceptable

lunar cypress
#

that's only half your pom.xml

main grotto
#

GRADEL

runic flume
#

that's only half your pom.xml
@lunar cypress

lunar cypress
runic flume
#

its temp

#

lol

lunar cypress
#

when you run mvn clean compile does that error happen as well

runic flume
#

nope

#

lets see

#

doesnt create a jar tho

lunar cypress
#

yeah ok wasn't supposed to

#

it's intellij's fault

#

invalidate caches and restart

hot hull
#

@runic flume Gradle or crusade

runic flume
#

or

lunar cypress
#

or you know run mvn package to get a jar

#

just don't build with intellij

runic flume
#

okay, cheers

ocean quartz
prisma wave
#

that purple is kinda hot

#

looks like the tier 5 color

#

but nicer

hot hull
#

Matt, when do you think the lib will be ready?

#

Ping me cause I'm going to sleep fingerguns

ocean quartz
#

@hot hull It's technically ready
Just need to do some documentation and i really want to DRY this code a bit, this part is bothering me

tranquil crane
#

smells like rainbows in here

ocean quartz
#

Oh yes
You're a genius with this classes for colors

tranquil crane
#

my tag parsing logic was absolute trash so I hope you've at least improved that much of it

ocean quartz
#

I had to change a bit yeah, it's not great either but for how i handle the colors it was a bit easier to work with
<(?<r>r|rainbow)(?<sat>:\d*\.\d*)?(?<lig>:\d*\.\d*)?>

tranquil crane
#

My regex writing capabilities are pretty bad lol

#

I was at one point going to write my own token parsing system for tags and hex colors but just said screw it and hacked together some parsing that worked instead, much less work

ocean quartz
tranquil crane
#

you might as well simplify it by removing that if statement entirely

#

I should look into how the regex groups work because that looks a lot nicer than mine

ocean quartz
#

that's a good point

#

Also another change i made to yours is that I allow 3 hex characters too for example: <g:#000:#fff>

tranquil crane
#

I was going to do that but decided it was too much work at the time lmao

#

People don't really use the 3 digit versions that much so I just shrugged it off, it's good to support though

ocean quartz
#

Yeah, i think i copied a bit of it from Niall and the rest was on my own xD

empty flint
#

@ocean quartz chat format framework when?

ocean quartz
#

soon™️

jovial warren
#

lol

ocean quartz
#

God i hate writing javadocs in java, shit's so repetitive

jovial warren
#

yeah KDocs are so much better because they use markdown

empty flint
#

God i hate writing javadocs in java, shit's so repetitive
@ocean quartz Aren't you supposed to write them in plain text? *ba dum tss*

jovial warren
#

markdown vs HTML isn't even a competition lol

empty flint
#

@ocean quartz Can I send you some Dollaridoos to support your framework

ocean quartz
#

Sure ;o

jovial warren
#

lol

#

you be out here getting paid for your open-source work lol

empty flint
#

Gonna need some paypal info or something...

#

you be out here getting paid for your open-source work lol
@jovial warren Have you heard of Wikipedia?

jovial warren
#

yeah

#

anyone who's anyone's heard of Wikipedia lol

empty flint
#

It's important to support the things you are excited by. Wikipedia, The human genome project, ESA, Matt's color framework...

jovial warren
#

I'd set up a Patreon or a Buy Me A Coffee but I know I wouldn't get any donations since nobody uses my shit lol

old wyvern
#

Wikipedia recently asks for donations on every few visits now with a weird banner or something

jovial warren
#

yeah

old wyvern
#

I guess fair enough

jovial warren
#

I'd set up a Patreon or a Buy Me A Coffee but I know I wouldn't get any donations since nobody uses my shit lol
actually, not strictly true

#

my bot seems to be used more and more these days

old wyvern
#

I can buy you a coffee if you want

jovial warren
old wyvern
#

nice

prisma wave
#

anyone fancy supporting pdm?

#

and by pdm I mean me

old wyvern
#

km I did it

jovial warren
#

I'd support PDM if you'd get your ass in gear and fix it lol

old wyvern
#

I dont know how

#

But a log worked

prisma wave
#

@jovial warren it's not broken

#

@old wyvern log?

old wyvern
#

wtf did I write

jovial warren
#

I'm messing with you anyway

old wyvern
#

log with base 2

prisma wave
#

oh

#

lol

#

nice?

old wyvern
#

That was so random

prisma wave
#

idk what you're talking about rly

old wyvern
prisma wave
#

ah yes

jovial warren
#

log base 2? why base 2? lol

old wyvern
prisma wave
#

huge

old wyvern
#

log base 2? why base 2? lol
God knows at this point

onyx loom
#

@jovial warren it's not broken
@prisma wave YES it is

#

🌝

old wyvern
#

My guy just told us about a simple minimax implementation and then went on to make us write a "minimax heuristic function"

prisma wave
#

@onyx loom lies

onyx loom
#

unless its a feature

prisma wave
#

everything is a feature

old wyvern
#

Anyway, gn bois

jovial warren
#

you've got the standard common logarithm (at least that's what I think it's called, or log10), and you've got the natural logarithm, denoted loge

#

then you've got every other logarithm

old wyvern
#

I used log with base 2

jovial warren
#

you don't even wanna know how long it took me to fully understand logarithms lol

prisma wave
#

gn

jovial warren
#

I spent a few days of non-stop research on that

old wyvern
#

wait why xD

prisma wave
#

natural logarithm is usually ln

jovial warren
#

because I wanted to know about it @old wyvern

old wyvern
#

I mean what more is there to know?

jovial warren
#

@prisma wave yeah ik, but denoting it loge makes it easier to see that it's using the mathematical constant e

prisma wave
#

yeah

#

but that's not what it's called lol

old wyvern
#

I think it meant e as base notation

#

Its not ussually written bard

#

its implied

#

when you dont specify a base and use ln

prisma wave
#

yeah

#

except in cs when log usually relates to base 2

old wyvern
#

oh it does?

prisma wave
#

I think so

old wyvern
#

I ussually specify the base so havent noticed

prisma wave
#

O(log n) means log base 2 iirc

old wyvern
#

oh you meant that

jovial warren
#

"the logarithm is the inverse function to exponentiation, meaning the logarithm of a given number x is the exponent to which another fixed number, the base b, must be raised to produce that number x" (source: Wikipedia)

basically, if logb(x) = y, b^y=x

prisma wave
#

lol

jovial warren
#

don't ask me why I explained that lol

prisma wave
#

we know

old wyvern
#

I was talking about the function

prisma wave
#

oh right

#

idk

jovial warren
#

anyone who didn't know what a logarithm is, now ya do I guess

empty flint
#

I'd set up a Patreon or a Buy Me A Coffee but I know I wouldn't get any donations since nobody uses my shit lol
@jovial warren Idk how much you think I just paid Matt but I'm not using any of his stuff either. I just really like that idea and wanted to show my support.

prisma wave
#

I really like the idea of a clean library for runtime dependency downloading

#

it would be really cool if somebody donated to this hypothetical library

old wyvern
#

xD

jovial warren
#

@prisma wave see what ya did there

prisma wave
#

:)

#

Now give me money pls

lunar cypress
#

Base doesn't really matter in landau notation for exponential / logarithmic complexity if that's what you meant earlier

prisma wave
#

Good point actually

lunar cypress
#

It's just about the growth behaviour, not about concrete values

#

Which is why you discard constant factors etc too

#

(Typically)

#

Sometimes it makes sense to mention them, e.g. for clojure vectors

#

Their random access is technically O(log n), but in reality the base is 32 because of the branching factor, which essentially makes this near constant time for most use cases

prisma wave
#

Oh because they're persistent data structures?

lunar cypress
#

Yeah

prisma wave
#

Makes sense

lunar cypress
#

They are implemented as a tree like structure

#

Which makes it possible to share a lot of structure but obv increases the complexity for reads over regular arrays

prisma wave
#

probably neglible though

#

right?

#

for most normal things anyway

lunar cypress
#

Yeah

#

It's measurably slower but again the most important part is the scaling with the number of elements

#

Which is near constant

#

But even if you need high performance (esp memory wise) (because you insert like a million elements sequentially or sth) there are transitives which are basically write only mutable data structures that can be turned into persistent ones in O(1)

prisma wave
#

clever

ocean quartz
#

50 Minutes writing javadocs comments, holy shit

split talon
#

😮

surreal quarry
#

yea i love that feature

jovial warren
#

@ocean quartz noice

empty flint
#

@prisma wave Do you know if gradle has some way of auto.versioning your builds?

prisma wave
#

how do you mean?

empty flint
#

Well generating an incremented version of your build

prisma wave
#

So like 0.0.1 -> 0.0.2?

empty flint
#

like the version number itself

#

yeah

prisma wave
#

Uh not that I know of

#

Might a plugin for it

empty flint
#

right, gonna see if I can find something regarding that 😄

steel heart
#

@empty flint I have a repo for that

#

Pushed today

empty flint
#

@empty flint I have a repo for that
@steel heart You mean you created a plugin that does that?

steel heart
#

Though code behind it is ugly it works good

#

Kinda a single file

#

Going to make it a plugin

empty flint
#

Could you share it with me? 🙂

#

ty

steel heart
#

(:

#

Code is poop so pls no bully

empty flint
#

So you increment the versions by running the appropriate task?

steel heart
#

Yep

#

And it finalizes by the shadowJar task

#

Well edit it how you want

#

Just a template anyways

#

Tryna learn groovy little

prisma wave
#

Quite clever

#

You should make it into a plugin

empty flint
#

what does the shadowJar task do?

prisma wave
#

Builds a shaded jar

steel heart
#

Yeah alex but that would be full groovy and no Java?

#

Well I have no clue what the restrictions would be

prisma wave
#

You can write plugins in pretty much any JVM language

steel heart
#

Ah

#

@empty flint assume you might want to replace it with build or jar otherwise

#

(Task names)

empty flint
#

Maybe I have the wrong idea of what finalize means.

steel heart
#

task1.finalizedBy task2 means whenever task1 has run, task2 will try to run after

#

Sequentially

empty flint
#

so after shading a jar, the tasks are triggered?

steel heart
#

First the task majorJar, minorJar or patchJar runs then the shadowJar task

empty flint
#

Ah the other way around, yeah

#

my bad

#

it's late ^^

steel heart
#

(:

#

In that way shadowJar isn’t dependent on the other tasks 😉

#

Well need to sleep gn

empty flint
#

gn8

empty flint
#

But I can't get it to work for kotlin dsl

#

the buildscript seems to work but as soon as I add id("eu.davidea.grabver") to plugin {...} it just breaks

#

what kind of construct is this in groovy:

versioning {
    // Required (number)
    major 1
    minor 0
    // Optional, force custom patch (number)
    patch 7
    // Optional (any string)
    preRelease "RC1"
    // Optional, custom task name to trigger the increase of the version
    incrementOn "<task-name>"
    // Optional, custom task name for which you want to save the versioning file
    saveOn "<task-name>"
}
half harness
#

I have been convinced to use IntelliJ instead of Eclipse (and now will be using it 75% of the time) 😄

onyx loom
#

why 75

half harness
#

because of the workspace

#

but when I don't need it I'll use IJ

#

or should I use notepad

onyx loom
#

biggest pain when coding is when ur stuck on why something isnt executing but then u realise u misspelled something 😔

winter iron
#

Logical errors do be the worst 😦

obtuse gale
#

but when I don't need it I'll use IJ
why would you ever needs eclipses one

oak raft
#

just use notepad

obtuse gale
#

or ms paint

steel heart
#

@empty flint seem that one but didn’t work for me

hot hull
obtuse gale
#

what a deal!

steel heart
#

Gg

ocean quartz
#

Frosty, couldn't release the lib yet cuz of a bug with subtitle, but I'll do that first thing in the "morning"

hot hull
#

Yea no rush

obtuse gale
#

Where should I like construct my GUI's? Like what should the class where I do that be called? Just so I can open it onCommand and I dont want the gui making to be in the command method cos itl get messy

hot hull
#

MenuFactory

obtuse gale
#

and in what package lol

#

its just a thing that I can use to like hold my menus

empty flint
#

Where should I like construct my GUI's? Like what should the class where I do that be called? Just so I can open it onCommand and I dont want the gui making to be in the command method cos itl get messy
@obtuse gale I have a GuiHandler that constructs all my guis on load and the command calls GuiHandler.populate(...) with only the parameters that are user specific

obtuse gale
#

is this open source?

empty flint
#

no

#

lol

#

but it's really simple

steel heart
#

I have a GuiFactoryProvider<Inventory> which creates, manages, deletes, stores and map guis

obtuse gale
#

is that open source lol?

steel heart
#

Can maybe share that one when arriving at home

empty flint
#

I have an abstract Handler class with an init method. Each implementation calls it in the constructor and checks if it worked or not and throws an error if not (wrongconfig and what not)

obtuse gale
#

Cos im using matts lib for the actual guis, i just need an easy way to get them in my cmd

empty flint
#

Yeah just create them on startup, store them in a map, call the get in the command

obtuse gale
#
    private val invs = mutableMapOf<String, Gui>()
    init{
        invs["invOne"] = createInvOne()
    }```
#

something like that?

empty flint
#

well mine's a bit more complicated but yes

obtuse gale
#

I mean does it need to be more complicated?

#

Like what does urs do that this wont

empty flint
#

not in your case aparently

hot hull
#

Aj, would be best if you make a non gui specific factory, then you just pass in what gui to construct, cause you know, futureproofing fingerguns

obtuse gale
#

actually I will need a way to change the GUI stuff based off user input

#

wdym frcsty

hot hull
#

Are these guis going to be customisable from config?

obtuse gale
#

naa

steel heart
#

Well Idk but the class I have is in java and is maybe around 700 lines

hot hull
#

Aj, you disgust me

obtuse gale
#

f

#

i mean i could make it configurable

#

but na i cba

hot hull
#

Amh

#

Smh*

#

Honestly just do it how you think it should be done

#

So we can judge :))

obtuse gale
#

._.

#

my way will be terrible tho lol

hot hull
#

Doesn't matter, you'll learn

obtuse gale
#

ree

#

I mean my original plan was to just make private methods in the command class that made them

steel heart
#

Srp fingerguns

obtuse gale
#

yeaaa

steel heart
#

The thing is that I always make so much redundant stuff

#

Like having 10 constructors KEKW

hot hull
#

Conclure

#

The more the merrier

steel heart
#

Yup

obtuse gale
#

so

#

what should I do lol

hot hull
#

Aj, do what you think is best, it's the best way to learn

obtuse gale
#

bruh

hot hull
#

Don't bruh me bruh

steel heart
#

Have a class that is responsible of storing guí, have a class that can manage the storing etc

#

At the end exactly how you didn’t shouldn’t matter too much

#

It should be maintainable for you or anyone else who reads it less or more

obtuse gale
#

Aj, do what you think is best, it's the best way to learn

class MenuHandler {
    private val gameMenu = Gui("Game menu")
    init{
        setupGameMenu()
    }
    
    fun getGameMenu(challengedName:String):Gui{
        gameMenu.updateTitle("Challenge $challengedName")
        return gameMenu
    }

    private fun setupGameMenu(){
        gameMenu.addItem()// Just add in all the items here
    }
}``` Thats what id do but I know theres probably better ways lol
hot hull
#

Handler shouldn't contain any gui code, it should only handle it

obtuse gale
#

so is this a problem with the name of the class or like it being a bed way to do it

hot hull
#

As dogoo boi said, have a Handler or something class which stores your guis, and manages the calling of them, then have a seperate class for each gui which you load on enable

prisma wave
#

The SRP strikes again

hot hull
#

Kind of a dumb principle

prisma wave
#

You're a dumb principle

hot hull
#

:(

prisma wave
#

:)

hot hull
prisma wave
#

Also is it just me or is maintaining a big Java codebase really difficult? It constantly feels like it's become a huge mess and needs rewriting

quiet depot
#

happens in every language imo

prisma wave
#

I guess

quiet depot
#

cuz u write shit, then leave it for a while, and when you come back you’ve learnt so much more

prisma wave
#

It seems to happen more with Java in my experience though

quiet depot
#

well I’ve noticed that too

prisma wave
#

Like it starts off really clean and then after you add a few things it's turned into a stateful mess

quiet depot
#

simply because java is my primary language

prisma wave
#

true lol

quiet depot
#

the clean stuff is the stuff you’ve written thousands of times before

#

the ugly is the actual functionality

prisma wave
#

That makes sense

obtuse gale
#

As dogoo boi said, have a Handler or something class which stores your guis, and manages the calling of them, then have a seperate class for each gui which you load on enable
o, like a class per gui that just has a method that makes it or something?

empty flint
#

Not per gui unfortunately. Per command. One command has 2 guis and the other has a variable number, depending on the config

hot hull
#

If that's java, finals GWsetmyxPeepoCry

empty flint
obtuse gale
#

static fingerguns

empty flint
#

And the RanksGuiHandler gets created once in the loading phase:

  public RanksGuiHandler() throws InitializationException {
    this.lw = BlockyRanks.getLogWriter();

    initialize();
    checkInitialization("Failed to initialize the ranks gui.");
  }

The initialize() method creates all the guis

#

basically

hot hull
#

Static angry_fingerguns

prisma wave
#

I want a new keyword

#

Something interesting

#

Static is getting boring

#

strictfp abuse

#

Now that would be fun

empty flint
#

I want a new keyword
@prisma wave what would that keyword do?

#

If that's java, finals :GWsetmyxPeepoCry:
@hot hull wdy mean?

hot hull
#

I mean if it's java everything should be final

empty flint
#

nah man, who cares, it's getting deleted anyway

#

re-writing everything in Kotlin

hot hull
#

As it should

prisma wave
#

@prisma wave what would that keyword do?
@empty flint idk

#

Something cool

empty flint
#

Something cool
@prisma wave it's a raffle for the presidency of the united states. Whenever that keyword gets processed, somebody else gets the nuke codes.

#

I propose something like
potus static final gimme(...)

prisma wave
#

That definitely is cool

hot hull
#

Waiting for Kali to drop the nukes

empty flint
#

Does anybody know the correct maven repo for McMMO?

prisma wave
#

A question as old as time itself

#

Iirc it doesn't have one

steel heart
#

Lol

hot hull
#

Blocky

#

There isn't one, maven local is your friend