#dev-general

1 messages ยท Page 195 of 1

heady birch
#

but then it must be mutable

distant sun
#

the fuck

#

nil ??

heady birch
#

private static final Object nil = null;

#

Nil means more like 0 to me but

#

The football game is nil-nil

ocean quartz
#

It's like empty instead of non existent i think

heady birch
#

goroutines ๐Ÿ˜ฎ

prisma wave
#

semantics

#

null is more traditional for "empty" but the 2 are basically interchangable in programming

distant sun
#

please loop

steel heart
#

What is it with all the Optional<Supplier<Optional<T>>>

prisma wave
#

Optional supplier

distant sun
#

if x is nonpolite throw NonPoliteException()

heady birch
#

Arc<Mutex<Option<Box<dyn u32>>>>

ocean quartz
steel heart
#

feels like a dumb design

distant sun
#

Agree

#

Lets make the please language

heady birch
#

Or you have a language without null >>>> ๐Ÿ™‚

#

Rust ๐Ÿ˜„

distant sun
#

nil

#

Niall

#

there you go

prisma wave
#

None

distant sun
#

if x is niall

heady birch
#

Option::None >> None

prisma wave
#

same thing

distant sun
#

please turn off the electricity

heady birch
#

I thought you meant python None

distant sun
#

One thing I dont mind is OR and AND

heady birch
#

but yes you can use None instead of Option::None

#

return Some(3)

distant sun
#

return Nope()

#

this will be the null of my lang

#

if x dare to be nope: stop

heady birch
#

Everyone seems to be making languages

#

But I have no need. My perfect language already exists. Rust. People just dont understand yet

distant sun
#

Because normal people get ride of it asap

#

๐Ÿคท

prisma wave
#

(value string, err error)

#

if err != nil

distant sun
#

what

prisma wave
#

go

distant sun
#

please stop;

prisma wave
#

No()

#

pub fn

distant sun
#

pbl

heady birch
prisma wave
#

func main()

heady birch
#

fn main()

#

if rust didnt exist

#

there would be nothing

prisma wave
#

yes there would

heady birch
#

no

prisma wave
#

rust useless

heady birch
#

drop box using it

#

do you have a drop box account

distant sun
#

No

heady birch
#

ok

#

but 99.9% of people do

#

society relies on rust to function correctly

distant sun
#

No

prisma wave
heady birch
#

there would be outrage and disorder without it

prisma wave
#

go

heady birch
#

NOOO

distant sun
#

go is ugly

#

Period

prisma wave
#

checkmate liberals

#

no

distant sun
#

Why do people make ugly languages

prisma wave
#

not ugly

#

clean

distant sun
#

What are you on about bm lol

hot hull
#

Gaby, why you calling everything ugly

distant sun
#

sry mom told me to always say the truth :(

prisma wave
#

returning multiple values from a single function fingerguns

#

cant do that in kotlin / rust

distant sun
#

is called an o b j e c t

prisma wave
#

no

#

boilerplate

hot hull
#

Just return an object array

distant sun
#

Yup

hot hull
#

Ez claps

distant sun
#

No ??

heady birch
#

Actually rust can do this

prisma wave
#

no it can't

heady birch
#

Yes

hot hull
#

:kEk:

heady birch
#

Speical enum

prisma wave
#

it can't

heady birch
#

Yes

#

Just use an enum

prisma wave
#

func Read() (tok TokenType, text string)

#

go

#

2 returned values

heady birch
#

Yeah

#

Use c pointer thingy

prisma wave
#

Read()

#

public func

heady birch
#

fn read(token_type: &mut TokenType, text: &mut String) {
*token_type Changing its function
}

prisma wave
#

mutable pointer

#

gross

distant sun
#

How do you use the return lol

prisma wave
#

return NEWLINE, string(ch)

#

flexible

heady birch
#

Python can do that

prisma wave
#

ok

distant sun
#

I mean the value

heady birch
#

And yeah

prisma wave
#

oh

heady birch
#

Thats poorly designed

#

Rust would design this so much better

prisma wave
#
token, text := Read()
distant sun
#

What is rust used for though

prisma wave
#

nothing

#

absolutely nothing

#

useless language

distant sun
#

Fair enough

ocean quartz
#

To rust things

heady birch
#

enum CoolResult {
Success {obj_A: ?, obj_B: ? },
Error {why: String }
}

return CoolResult::Success(a, b);

#

๐Ÿ™‚

prisma wave
#

readability

heady birch
#

Rust will be the new C and C++

prisma wave
#

no

#

that will be Go

heady birch
#

ok

ocean quartz
#

Is obj_A: ? something like objA: Any?

heady birch
#

no

prisma wave
#

dumb language

heady birch
#

I just put question mark

prisma wave
#

too many symbols

#

makes no snese

heady birch
#

for i in 0..=1

#

inclusive range

prisma wave
#
`<&std::None+?{}>
#

real

distant sun
#

Tf is that

heady birch
#

dunno

prisma wave
#

rust in "production"

heady birch
#

what

distant sun
#

too many symbols
@prisma wave they had to make use of all symbols somehow

prisma wave
#

there are literally about 350 symbols

heady birch
#

option compile to pure null poiner check

distant sun
#

alt 21

heady birch
#

no stupid objects

prisma wave
#

dont care

heady birch
#

borrow checker

#

if a rust program compiles its gonna work

#

no runtime error

#

ever

prisma wave
#

elara only about 55 symbols

distant sun
#

Browny checker

prisma wave
#

better language

distant sun
#

๐ŸคŽ

heady birch
#

๐Ÿ˜ณ

prisma wave
#

let main => system exit 0

#

real

#

Download maven-metadata.xml

ocean quartz
errant geyser
#

Hey Matt, have you had time to work on that MF rewrite so I can do my stuff with it yet

distant sun
#

mf msg, yes

ocean quartz
#

Not yet sorry, it was super boring working on it so had to stop for a bit

prisma wave
#

super boring
me with the pdm rewrite

ocean quartz
#

I can see that yeah, for me a project needs to be kinda challenging to be cool to work with, the rewrite had a bunch of copy paste, review, etc

#

I'll still work on it though dw

steel heart
#

Html is nice

obtuse gale
#

High Tier Machine Learning

steel heart
surreal quarry
#

html is the best javascript library for machine learning

empty flint
#

How do I un-arrowify this piece of garbage?

  private fun bakeAsSubcommand(): List<CommandVariance> = listOf(name, *aliases).fold(mutableListOf(), { list, name ->
    list.apply {
      variances.forEach { existingVariance ->
        this.add(
          CommandVariance(
            linkedMapOf(
              name to LiteralArgument(name).with(
                permission,
                existingVariance.requirement,
                { _, _ -> arrayOf(name, *aliases) }),
              *existingVariance.arguments.entries.map { (key, value) -> key to value }.toTypedArray()
            ),
            existingVariance.requirement,
            existingVariance.executor
          )
        )
      }
    }
  })

I don't see how to refactor this to make it smaller :/

#

Oh I guess I maybe don't need to fold, I could just map the outermost list

#

but other than that...

#

oh no can't map because of the variances.forEach

prisma wave
#

first off

#

apply gross

empty flint
#

don't say it

#

wait

#

why?

#

what's wrong with apply?

prisma wave
#

nothing

#

but in this case you're just adding an extra tab

#

that's a lot of spread operators

#

kinda disturbing

empty flint
#

well yeah the one thing that bugs me is that I can't add new elements to the first place of a linked hash map

empty flint
#

java.lang.NoClassDefFoundError: kotlin/jvm/internal/SpreadBuilder

#

What in the...

#

The kotlin lib is in the jar

jovial warren
#

implementation(kotlin("stdlib"))?

#

(or implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.0' in Groovy, for those of you who for some peculiar reason think that's better)

empty flint
#

No, it was the shade plugin's "minimize"

#

for some reason, the spread operator inside a lazy {} block was not determined by shadeJar to be of importance lol

jovial warren
#

wait... minimize?

#

that sounds a bit counter-intuitive, as the whole point of shading is to produce fat JARs

empty flint
#

yeah but you don't need all the stuff inside the dependencies you add. Only the stuff you actually call gets added if you minimize.

jovial warren
#

ah okay

empty flint
#

No reason to include a bunch of methods and stuff you don't need in your application

jovial warren
#

yeah true

empty flint
#

but aparently the minimize doesn't work reliably :/

obtuse gale
#

Yo why tf did I write an NPE on my year 8 italian book

#

This was before I started java stuff...

#

๐Ÿคฃ what the fuck

obtuse gale
#

Can I override a getter from an interface or whatever? Like if I have to override

getPassword()``` can I do that within the getter or do I manually have to do that method
#

Basically can I simplify this

#
data class User(
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private val id:Long,
        private val name:String,
        private val email:String,
        private val password:String,
        private val locked:Boolean,
        private val role:UserRole = UserRole.UNVERIFIED

):UserDetails{
        override fun getPassword(): String {
                return this.password
        }

        override fun getUsername(): String {
                return this.username
        }

        override fun isAccountNonLocked(): Boolean {
                return !this.locked
        }```
#

since the getters have to override and if I juist do val password:String the getter wont override

#

That also means I need to manually make the setters :/

remote goblet
#

sad

#

scam

#

i'll figure it out

ocean quartz
#

@obtuse gale Try override val password: String

obtuse gale
#

Tells me it doesn't override

#

@ocean quartz

heady birch
#

Odd i'd just keep the methods

#

Did you find this on a tutorial?

#

I never saw a tutorial that approached it this way (extending the UserDetails class)

hot hull
#

Those spaces Aj, makes my eyes bleed

heady birch
#

But considered upgrading to it.

hot hull
#

Also, isAccountNonLocked wouldn't isAccountUnlocked be nicer :p

heady birch
#

or just isAccountLocked()

hot hull
#

Or that yea

heady birch
#

Usually what I would do is make a new instance of org.springframework.User

#

Then on each page load/controller method load the database model from the User

#

Else I expect you risk the model becoming unsynchronised from the persistance context

hot hull
obtuse gale
#

Also, isAccountNonLocked wouldn't isAccountUnlocked be nicer :p
@hot hull im not making the rules here.... tell that to spring

hot hull
#

Why tf does Ctrl + W close chrome kek?

onyx loom
#

imagine not doing that to people in the computing classes at school

heady birch
#

Why's my bulma burger not working

distant sun
#

ctrl alt arrow-left/arrow-right is my fav

quiet depot
#

Why tf does Ctrl + W close chrome kek?
@hot hull it closes an individual tab

#

not chrome in general

#

I don't believe it's functionality unique to chrome

#

for example, sublime also does it

hot hull
#

Kinda odd, but mk

#

Mind looking at my above link and giving me some suggestions on how I'd approach cleaning stuff like that up?

quiet depot
#

#getCreatorWrappers

return storage.getInformation().keySet().stream()
        .map(this::getWrapper)
        .filter(CreatorWrapper.class::isInstance)
        .collect(Collectors.toList());```
#

creatorWrapper.setSupporters(+1);

#

+1 lol?

#

idk mostly looks fine to me tbh

#

@hot hull

hot hull
#

Yea that's just bad method naming, it increments or decreases, should probably rename it (made it +1 so it's visible on what it does)

onyx loom
#

ctrl alt arrow-left/arrow-right is my fav
@distant sun yep :))

prisma wave
#

is it necessary to close input/output streams that are of bytearrays? and if not, should wrappers of those streams be closed too?

heady birch
#

just close wrapper i beleive

obtuse gale
#

niall what shit needs to go in my application.properties? atm ive got nothing and obviously it cant connect to a db

#

This project has been a rollercoaster of emotions

heady birch
#

spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

spring.session.jdbc.initialize-schema=always

spring.datasource.url=jdbc:mysql://IP/DB?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&rewriteBatchedStatements=true&serverTimezone=UTC
spring.datasource.username=USER
spring.datasource.password=PASS

logging.level.org.springframework.web=INFO
logging.level.org.springframework.security=INFO
logging.level.org.hibernate=ERROR
logging.file.name=server.log

logging.level.root=INFO

prisma wave
#

spring.disable=true

misty coral
#

I made resourcepack with custom data model and now few textures are mirrored idk why XD

#

anyone know how to fix this?

#

ok nvm i know

prisma wave
#

The kotlin fandom is dying

#

Good

pseudo owl
#

anyone knows uuid char range?

#

and is it increasing because registered minecraft user count

heady birch
#

a-f

#

no

#

uuid running out is not even worth thinking about

pseudo owl
#

๐Ÿ˜„ yeah you are correct

ocean quartz
#

It's from 0-9 and a-f, 32 Characters
About 3.26*10^16 possible combinations

heady birch
#

something like 17 sextillion

pseudo owl
#

thanks @ocean quartz

#

its really big number

prisma wave
#

minecraft 2 will use 64-bit uuids

obtuse gale
#

soonTM

hot hull
#

Minecraft 2 what?

prisma wave
#

minecraft 2

#

coming in 2014

#

same with the minecraft movie

hot hull
#

Ah I see

pseudo owl
#

wait what minecraft 1 is using 64-bit too ?

#

oh no

#

it is 128bit

prisma wave
#

256 bit*

ocean quartz
#

Minecraft 2 was released in 2013

pseudo owl
#

its so cool ๐Ÿ˜„

prisma wave
#

minecraft 2 2 then

pseudo owl
#

friendly wither xD

#

diamond chicken

heady birch
prisma wave
#

kotlinx really not adding a serializer for IntRange

#

smh

heady birch
#

Lol

#

IntRange

#

object

#

In rust that probably narrows down to pure machine code with no overhead

prisma wave
#

ok

#

it probably needs about 30 different types of punctuation to make though

fluid walrus
#

Mods

#

Funnycube

#

Someone ping him

#

Pls

ocean quartz
#

Ping who?

fluid walrus
#

Funny

#

Cube

ocean quartz
#

Why?

fluid walrus
#

Becuase

#

Bot broken again

ocean quartz
#

What is broken on it?

fluid walrus
#

=google

#

It says I dont have perms to do that

#

When I should

onyx loom
#

who says u should have perms

ocean quartz
#

Yeah i don't think you're supposed to have permissions for that

#

Not even support does

fluid walrus
#

But we've done it before

#

:0

#

Did they get rid

#

:(

onyx loom
#

iirc i believe he said u dont have it as u can only make so many requests to Google per day or smth

#

uve never had it lol?

fluid walrus
#

It was my 3rd fav command :(

heady birch
#

Add the perms

#

it probably needs about 30 different types of punctuation to make though
๐Ÿ˜

ocean quartz
fluid walrus
#

Wow

#

So fancy

heady birch
#

Poor design

ocean quartz
#

Wdym?

fluid walrus
#

Snip and Sketch but its Snip and Record

obtuse gale
#

Sometimes you gotta appreciate small but pretty cool features from IJ
Breh I use that all the time

ocean quartz
#

Sameee

heady birch
#

EnumSet

#

Or pure bit falgs

#

private byte modifierFlags;

modifierFlags |= MODIFIER_BOLD;

#

if (modifierFlags & MODIFIER_BOLD != 0) {

}

obtuse gale
#

Aa yes the ands and ors

heady birch
#

EnumSet<ModifierFlag>

ocean quartz
#

That is just overcomplicating it, and it doesn't even apply to my situation lol

heady birch
#

Absolutley not

ocean quartz
#

Each are required to be separate booleans because it'll visit each node and set and unset each time it does depending on the result

heady birch
#

Ok

fluid walrus
#

Er

#

Barry's =pl

#

Is it looking through all Spigot plugins or all Bukkit/Spigot plugins?

ocean quartz
#

Almost sure it's just Spigot

distant sun
#

Yes

fluid walrus
#

Oh ok

#

How did they do it:(

#

Its such a good command

heady birch
#

Javascript

#

It would probably work better in rust

#

Or spring

onyx loom
#

๐Ÿ˜

#

spiget API i believe

heady birch
ocean quartz
surreal quarry
#

are you making a markdown web editor type thing

hot hull
#

Ah &r only resets the color, interesting

ocean quartz
#

Nah, that's just showing it working without me needing to open it in game
Basically just showing because I remade literally everything, no longer using regex for like everything
And yeah &r to reset color, couldn't make it reset format because it'd break a lot of stuff (also &m, &l) won't work for now

heady birch
#

Wonder if I can make a builder in Rust

#

some_obj::builder()
.with_some_option(1)
.build()

ocean quartz
heady birch
onyx loom
#

๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚

heady birch
#

ugh I hate some emojis

#

Feels like 2010

prisma wave
#

feels like 1973

prisma wave
#

BristerBot

#

Idk wrong channel

gusty fulcrum
#

Sorry, wasnโ€™t too sure where to post

prisma wave
#

Fair enough

gusty fulcrum
#

Thank you

fluid walrus
#

Er

#

I want to make plugin

#

But

#

Idk what to make :(

hot hull
#

These are usually good projects theotherpig

prisma wave
#

inb4 "no rust"

onyx loom
#

wheres rust

#

wheres elara

#

wheres kotlin

heady birch
#

Spring is an absolutely essential skill to learn

onyx loom
#

wheres SPRING

distant sun
#

march

onyx loom
#

i said where not when ๐ŸŒ

fluid walrus
#

Imma make the best plugin ever

#

I get a custom mc texture

#

That looks like thingy

#

That shoots colored snowballs

#

So its Splatoon but MC

#

:D

misty coral
#

Hi, is there easier way to build structures by plugin than writing line by line which block to change? It's boring, weird to read and even hard to think about that

fluid walrus
#

World edit?

prisma wave
#

^

#

Schematics

fluid walrus
#

^

#

Or for 2d art

#

Draw pixel art in photoshop

#

Than use that one program

#

that puts it in MC

static zealot
#

mcedit I think its called. Might be wrong

misty coral
#

But they are one time use solution, i need to be able place this automatically by plugin

obtuse gale
#

But they are one time use solution
??????????????

misty coral
#

Eh nvm

fluid walrus
#

B r u h

obtuse gale
#

I mean using the WE API is probably your best bet tbh

fluid walrus
#

Er

#

Make Barry open source

ocean quartz
fluid walrus
#

Er

#

Rainbow

#

Not even like rainbow letters

#

But gradient letters

#

Pog

#

Make Barry open source

#

^

distant sun
#

no

ocean quartz
#

First run time before caching stuff, it used to take about 46ms to even 80ms
Now it's taking less than 10ms

remote goblet
#

speed

distant sun
#

@ocean quartz can you use kt extension functions on java? Are they like static methods or?

ocean quartz
#

I actually don't know how that would look like ;o

distant sun
#

I think bm said smth about a method that takes the object as param

ocean quartz
#

I don't think you can though

distant sun
ocean quartz
#

Looks weird

distant sun
#

@file:JvmName("DemoUtils") interesting

surreal quarry
#

imo its cleaner to use import static i don't remember the exact syntax but its osmething like

import static FooKt.bar;

public void baz() {
  bar("blah");
}```
fluid walrus
#

Guys

#

Funnycube is on

#

:0

obtuse gale
#

odd flex but ok

hot hull
#

Very interesting

unborn zodiac
#

IS it possible to disable enchanting/repairing a specific item in minecraft?

prisma wave
#

In vanilla?

#

Or for a plugin

unborn zodiac
#

Ideally I would want a plugin that would completely disable anvil interaction but the thing is I want it for a specific item i.e. a special pickaxe I'm selling in the store

#

and I don't know if minecraft has "unique" item identifiers

#

right now the only idea I have is setting the repair cost to an absurdly high level like 10,000

prisma wave
#

You can probably use an NBT tag and then set the repair cost if that item has that tag

hot hull
#

Yea you can use NBT tags for it

unborn zodiac
#

Yeah that's what I'm already doing I just wanted a cleaner way for lack of a better word

#

this approach seems hacky

#

wait, can I have like a "custom" nbt tag?

hot hull
#

Not really, NBT is usually cleanest when it comes to non user visible info storage

unborn zodiac
#

as in insert my own tags

#

ahh nvm, the way im using is basically the same idea

prisma wave
#

Yes that's possible

unborn zodiac
#

since all instances of the item will have that repair cost tag anyway

hot hull
#

This class is useful when it comes to easily assigning and getting NBT tags

prisma wave
#

@author Rich Hickey

hot hull
prisma wave
#

Yikes

#

I thought inventive talent was one of the "good ones"

hot hull
#

That's what I heard as well, but looking more into his plugins source codes I'm honestly just ewing, like some are "ok" but some are just sheesh

quiet depot
#

@hot hull her

#

no one ever said inventive was good at coding, she just makes useful stuff

hot hull
#

I see

steel heart
#

Isnโ€™t she hired at hypixel?

distant sun
#

I dont think so

#

She probably just made that mod / site for bosses

jovial warren
#

lol

#

what we talking about in here?

#

@hot hull what are all those config values doing in the main class lol

abstract ledge
#

i need help

compact perchBOT
#

There is no time to wait! Ask your question @abstract ledge!

jovial warren
#

and the horizontal alignment is just no

#

honestly, I expected better from Inventivetalent

hot hull
#

@abstract ledge Don't we all, woulf help if you explaini your issue

abstract ledge
hot hull
#

Then wait for someone to respond

abstract ledge
#

ok

hot hull
#

Not the right channel

prisma wave
#

Stupid site

jovial warren
#

I swear I just spent like half an hour converting existing code from Kotlin to Python (because I wanted to write an example for people in Python, donโ€™t ask, itโ€™s a school thing), and I swear, after that, I donโ€™t ever want to have to use that piece of shit language ever again in my life

#

@quiet depot I am now a proud member of the โ€œfuck that Python shitโ€ gang xD

#

like every time you want to use an instance function or variable from an instance context, you have to use self

#

instance methods in Python are also a mess

#

I donโ€™t understand why the fuck anyone would ever want to even remotely come anywhere near that shitty language

prisma wave
#

OOP in python is not nice

#

I usually stick to a procedural style

jovial warren
#

OOP in python is not nice
@prisma wave yeah... I found that out the hard way

#

Python doesnโ€™t even have immutability

#

and itโ€™s type system is literally worse than JS, like you canโ€™t declare variables with types, but you have to explicitly convert between types

#

I mean... wtf?

steel heart
#

It has sort of immutability

quiet depot
#

and itโ€™s type system is literally worse than JS, like you canโ€™t declare variables with types, but you have to explicitly convert between types
@jovial warren glad you agree that js > python

old wyvern
jovial warren
#

yeah, I do

#

but not by much

distant sun
#

py is ew

prisma wave
#

elara type system

#

T = T | T

distant sun
#
    fun getLevel(robotType: RobotType, level: Int): RobotLevel {
        return levelsTable[robotType, level] ?: levelsTable[robotType, 1]
    }```
Is this how you use the elvis operator thingo?
prisma wave
#

yeah although that will still be nullable

#

I think

distant sun
#

ye but there should always be level 1

prisma wave
#

Yeah

#

The compiler won't know that ofc

distant sun
#

ik

#

why is CTRL + Alt + L so weird on kt ๐Ÿ˜ฆ

prisma wave
#

what's weird about it?

jovial warren
#

^

#

also @prisma wave, you dual boot Windows and Manjaro right?

distant sun
#

puts every param in one line ๐Ÿ˜ฆ

prisma wave
#

Change your formatting settings

#

Doesn't for me

#

@jovial warren not at the moment but yeah

jovial warren
#

because I unfortunately need to install a Windows system to play Roblox (and also maybe some other games), so I've had to turn to dual booting

distant sun
#
    fun getRobotByUuid(uuid: UUID): Optional<Robot> {
        return Optional.of(this.loadedRobots.first { it.uuid == uuid })
    }```
It says that `first()` will throw a `[NoSuchElementException] if no such element is found.`, is there a way to just return an empty optional?
jovial warren
#

problem is: I have an existing Arch Linux system, that is using MBR, because I couldn't use UEFI as my old board (which I was using at the time) didn't support it

#

I imagine you use UEFI right?

#

what I'm asking is if there's another way for me to be able to either:

  1. Easily convert AL to UEFI without having to backup my data, format the drive with GPT, and then grab my data again
  2. Make both systems use GRUB as the boot loader so I can pick, rather than Windows using its own boot loader, changing the priority, and always booting itself
  3. Another method that I haven't thought of
prisma wave
#

Oof big paragraph

#

Iirc I was using Grub for both

#

And yeah UEFI

jovial warren
#

is it worth me migrating to UEFI?

prisma wave
#

@distant sun optionals in Kotlin are kinda unnecessary, but you can use firstOrNull

#

Potentially

distant sun
#

well what should I use instead of optional?

prisma wave
#

Just a nullable type

#

You can do everything that an Optional can do with that

jovial warren
#

wouldn't that mean uploading my over 100 GiB of data to a cloud service and then putting it back?

distant sun
#

so just Robot?

jovial warren
#

yes Gaby

#
fun getRobotByUUID(uuid: UUID) = loadedRobots.firstOrNull { it.uuid == uuid }
```should work
#

though that's an expression function, which will probably confuse you

distant sun
#

mhm

prisma wave
#

wouldn't that mean uploading my over 100 GiB of data to a cloud service and then putting it back?
@jovial warren if you think it's worth it. Ngl I don't know too much about bootloaders and things, but I'd say UEFI + GRUB is probably the best since it's always worked for me

jovial warren
#

can I dual boot with MBR?

#

since uploading 100 GiB of data on my internet connection will take hours

prisma wave
#

No idea

pseudo owl
#

When server stop, is there a reason to delete or clear maps lists..

remote goblet
#

I feel like when you write code and nut over it

#

you're officially sad

prisma wave
#

what

remote goblet
#

yes

old wyvern
#

I feel like when you write code and nut over it
uh

obtuse gale
#

Haha same bro...

#

๐Ÿ˜ณ

pseudo owl
#

OnDisable()
Remove hashmap, list

Is not maps, lists removing automaticly on disable. You need to remove?

ocean quartz
#

You shouldn't need to

pseudo owl
#

I'm soury four may bed england

#

You shouldn't need to
@ocean quartz i see in forums a lot i was confused thanks

distant sun
#

@prisma wave does apply { } have any drawbacks?

#

I kinda want to abuse it ๐Ÿคฃ

jovial warren
#

lol

#

I don't think so Gaby

prisma wave
#

What kind of drawbacks?

#

The only one I can think of is it getting very hard to read if you overuse it

distant sun
#

performances

prisma wave
#

it's inline

#

There's practically no performance impact

distant sun
#

why are isSmall and setGravity different though?

#

like one is a variable and the other one a method

old wyvern
#

variable?

distant sun
#

dunno how to call it

onyx loom
#

property?

distant sun
#

isSmall = true is different than setGravity(false)

old wyvern
#

Kotlin uses properties instead of getters and setters if thats what you mean

distant sun
#

yes, properties

#

but why isnt gravity also a property

old wyvern
#

It auto converts getters and setters to property syntax where it makes sense

jovial warren
#

^

distant sun
#

ah

#

makes sense

prisma wave
#

Usually it's if the setter / getter isn't a classic setter / getter or if it's from an interface iirc

prisma wave
surreal quarry
#

@prisma wave i've been messing arouynd with what we were talking about earlier. is there a way to make the orUntil param type be Class<Event> so it could technically be any event without an error
https://paste.jaims.dev/yusuhuqela.coffeescript

onyx loom
#

ClojureScript

#

lo

#

l

prisma wave
#

Class<out PlayerEvent>

surreal quarry
#

ah ok cool

distant sun
#

Maybe replace for with "during"?

#

during(duration, time unit)

surreal quarry
#

infix functions can't have more than 1 param

distant sun
#

F

prisma wave
#

they can in Elara

surreal quarry
#

intellij plugin for elara plz

prisma wave
#

soon

#

gotta figure out how to parse this shit first

surreal quarry
#

lol

dusky drum
#

what would be the best way to check if users UUID is premium or cracked?

ocean quartz
#

I think Piggy explained this here a few days ago let me see if i can find it

dusky drum
#

but wait, that doesnt help does it, if server is cracked it will always be cracked UUID... hmm

onyx loom
#

u look for a 4 in the uuid iirc

dusky drum
#

you still gotta have somesort of premium UUID or something

ocean quartz
#

Why do you want to know if they are premium or cracked? ;o

dusky drum
#

eh, i just want to test some stuff ๐Ÿ™‚

#

kinda want to do something for my private server.

#

i loved how FastLogin worked.

ocean quartz
distant sun
#

My commits are like "300 files changed - I forgot what I did here but hey, progress is progress"

ocean quartz
distant sun
#

xD

ocean quartz
#

I have no idea which bugs they were, i don't even know what changed on that commit xD

distant sun
#

For hacktober thing do you have to contribute to other's repos or to your own too?

ocean quartz
#

I think has to be others

hot hull
#

Others

distant sun
#

Mhm

hot hull
#

Matt, expect a lot of PRs to your stuff reversed_fingerguns

distant sun
#

What's their website @ocean quartz

ocean quartz
#

Sounds good to me blurryeyes

#

9 Days to go

distant sun
#

Will pr mf to add a comment saying "hacktoberfest"

hot hull
#

If anyone wants ez PR, contribute to FJ reversed_fingerguns

static zealot
#

do you mind if I break it?

hot hull
#

I've got a PR ready for Floodgate and Geyser already

ocean quartz
#

Anyone wanna help me redesign this message options stuff? ๐Ÿ˜ซ
Basically reworking the old FormatOptions cuz it sucked

hot hull
#

Matt, show the current stuff

#

@static zealot Not at all, it's a mess already

distant sun
#

sout hello, world!

hot hull
#

Does it matter how much you PR?

#

As in the actual contents of the PR, or can it be just random shit

distant sun
#

I guess it has to be merged though

ocean quartz
#

Currently it works like this:

Message.create(); // Defaults with everything
Message.create(FormatOptions.builder().without(Format.BOLD, Format.ITALIC)); // Removes BOLD and ITALIC

But currently this sucks

hot hull
#

Yea that's kinda ew

distant sun
#

FormatOptions.Builder maybe? (Inner class)

hot hull
#

How about something like this:

Message.create();
Message.create(FormatOptions.include(Format.ITALIC));
Message.create(FormatOptions.exlude(Format.ITALIC));
ocean quartz
#

Maybe

FormatOptions.builder().addFormat(Format.BOLD).removeFormat(Frmat.ITALIC).addExtension(Extention.create()).setDefaultColor(new FlatColor("blue")).build();
hot hull
#

Jesus

distant sun
#

I guess stuff cant always look pretty

#

Plus is better when is wrote on multiple lines

ocean quartz
#

Yeah, just don't like the builder() method

distant sun
#

Inner class

ocean quartz
#

On my item builder I have ItemBuilder.from() which looks good, but can't do that here

#

How Gaby? A full example pls xD

#

of how it'll look

distant sun
#

build() will return a FormatOptions object

#

just make Builder an inner class of FormatOptions and then add methods to it

ocean quartz
#

But like, FormatOptions.Builder.builder()?

#

That's what i meant

hot hull
#

What if create gives the format options, which you then use build with the get to final message

distant sun
#

Look at Request.Builder from okhttp3

ocean quartz
#

Because i'm trying to avoid needing to be like new FormatOptions.Builder()

distant sun
#

mhm

ocean quartz
#

Yup exactly what I said xD new Request.Builder()

onyx loom
#

I guess stuff cant always look pretty
๐Ÿ˜”

distant sun
#

Welp

#

Static doesnt help?

#

Keep in mind that it doesnt have to done in one line

#

Like, the builder can be defined before being used

ocean quartz
#

Yeah I might just go with that

distant sun
#

Whats an open fun btw

ocean quartz
#

A function that can be overriden

distant sun
#

Ah nice

ocean quartz
#

Kotlin is like the opposite of Java in that way, where everything is open and you have to mark them as final, while in Kotlin everything is closed and you need to mark them as open

onyx loom
#

it really do be like that ๐Ÿ˜”

prisma wave
#

Grimace

#

๐Ÿ˜ฌ

onyx loom
#

๐Ÿ˜ฌ

frigid badge
ocean quartz
#

Oooh that's pretty cool ;o

distant sun
#

Ty 4head @frigid badge

prisma wave
distant sun
#

No

prisma wave
#

Yes

old wyvern
#

Yes

ocean quartz
#

Tbh the only reason i do well with Git is because of GitKraken kek

distant sun
#

Www ew

old wyvern
#

Gang gang

distant sun
#

b*

old wyvern
#

o

distant sun
prisma wave
distant sun
#

Im ok with left side

prisma wave
#

๐Ÿคฃ ๐Ÿ™„

onyx loom
#

me too ๐Ÿ™‚

old wyvern
#

๐Ÿ˜‚

distant sun
#

And elara isnt even the problem lmao

prisma wave
#

what is

ocean quartz
#

Also dumb question, but and EnumSet's contract is with a Set right?
asking cuz it's an abstract class instead of a direct implementation

distant sun
#

the picture scares me

prisma wave
#

Alpha male

#

@ocean quartz I think so?

distant sun
#

female*

prisma wave
#

๐Ÿ™„

ocean quartz
#

I'm pretty confused too like, EnumSet<?> set = EnumSet.allOf(class); or Set<?> set = EnumSet.allOf(class);

prisma wave
#

Liskov

#

Set unless you need the contract of EnumSet

ocean quartz
#

Yeah it's what i was thinking too

frigid badge
#

I've only used git kraken like once

#

I just use ide integration or cli

prisma wave
#

Intellij good

#

Cli good

#

Electron wrapper bad

surreal quarry
#

github desktop good

obtuse gale
#

Hi

ocean quartz
#

Github desktop is pretty meh

#

And heyo

devout beacon
#

Hello
is it possible to create a challenge menu with deluxemenu resembling skyblock challenges
thank you

static zealot
devout beacon
#

ok

jovial warren
#

@ocean quartz Git isn't even that hard lol

prisma wave
#

git branch checkout rebase fetch stash --force -b master set-url --cached -rm a6b21f9 merge --vim

#

Ez

jovial warren
#

okay what

#

that's multiple commands in the same command, which isn't possible afaik

prisma wave
#

real

#

i used it the other day

jovial warren
#

first startups: ```
git create
git remote add origin git@whateverthefuck:WhateverTheFuck.git
git commit -m "Messages oof"
git push -u origin master

#

ez right?

prisma wave
#

you forgot the last one

jovial warren
#

which is?

prisma wave
#

git commit --force rebased <sh:84ac21d> --no-preserve-root -v -u .git@github

ocean quartz
#

@jovial warren I know lol

prisma wave
#

replacing sh:84ac21d with the latest shortened commit hash of your upstream ofc

#

also git init*

surreal quarry
#

you also need stuff for like forks and merging and shit which gets more complicated

#

which is why something like gitkraken or gh desktop is good

prisma wave
#

git fork merge origin/remote master/knightzmc -repo PDM -b rewrite --force --accept-upstream

#

not that hard really

surreal quarry
#

idk i think its easier to just use one of the git GUIs cause then i don't need to remember all that stuff

prisma wave
#

how can you not remember it

#

it's easy

#
Specific git-branch actions:
    -a, --all             list both remote-tracking and local branches
    -d, --delete          delete fully merged branch
    -D                    delete branch (even if not merged)
    -m, --move            move/rename a branch and its reflog
    -M                    move/rename a branch, even if target exists
    -c, --copy            copy a branch and its reflog
    -C                    copy a branch, even if target exists
    -l, --list            list branch names
    --show-current        show current branch name
    --create-reflog       create the branch's reflog
    --edit-description    edit the description for the branch
    -f, --force           force creation, move/rename, deletion
    --merged <commit>     print only branches that are merged
    --no-merged <commit>  print only branches that are not merged
    --column[=<style>]    list branches in columns
    --sort <key>          field name to sort on
    --points-at <object>  print only branches of the object
    -i, --ignore-case     sorting and filtering are case insensitive
    --format <format>     format to use for the output
surreal quarry
#

idk i probably could i just never took the time to learn it cause there was a gui available

#

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

jovial warren
#

yeah there isn't all that much to remember

#

just git remote and git push for IDEs such as IntelliJ, since the rest of the stuff can be done without commands (I know pushing can be done without commands but it's terrible lol)

prisma wave
#

damn you guys really aren't taking the bait

#

smh

surreal quarry
#

i was wondering if you were joking

#

but you also know a lot abt this stuff

#

so i figured you were serious

prisma wave
#

smh

#

suffering from success

empty flint
#

Are you guys playing with unicode font on or off?

prisma wave
#

off

#

i'm not a savage

steel heart
#

Gucci

obtuse gale
#

no

empty flint
ocean quartz
#

Warning, it's pretty funky with Kotlin

quiet depot
#

nearly 100% chance that it doesnโ€™t

empty flint
#

I have it working for my plugin but it has a dependency on a lib jar and when I change that lib jar and refresh the gradle dependencies to rebuild the project, it doesn't seem to work correctly

quiet depot
#

doesnโ€™t kotlin have itโ€™s own hotswap thing?

empty flint
#

and hotswapping says "nothing to swap" or something like that

quiet depot
#

yeah that wouldnโ€™t work blocky

ocean quartz
#

I think so, but even that one if i am not mistake is pretty funky

quiet depot
#

hotswapping doesnโ€™t rely on your build tool with your buildtool

empty flint
#

yeah that wouldnโ€™t work blocky
@quiet depot Why not though? Doesn't hotswapping rely on the plugin jar in the working directory?

#

I am not quite sure how that works actually

quiet depot
#

erm it does, but hotswapping doesnโ€™t actually update the jar file

#

it changes the bytecode at runtime

empty flint
#

or does it build the project and then hotswaps the classes with the same package names in the working server jre?

#

it changes the bytecode at runtime
@quiet depot Only the direct plugin bytecode though, not the dependency bytecode for some reason?

#

Like I don't quite get why or how tbh

quiet depot
#

I already told you why

empty flint
#

No I understand it doesn't rely on the build tool

#

but the lib is still in the jar and in the bytecode

quiet depot
#

no itโ€™s not

#

if you build the jar while the servers running, itโ€™s in the jar

empty flint
#

how so?

quiet depot
#

but thatโ€™s merely a file on the system

#

that doesnโ€™t affect whatโ€™s actually on the server, in memory

empty flint
#

but if the plugin uses the lib methods that means it has to be part of the jre classpath at runtime (not sure I used those words correctly but you get what I mean hopefully) no?

#

So the lib classes get added to the jar via gradle. the jar gets placed in the plugin folder. the server gets started in intellij. that server loads the plugin with the lib methods and stuff. so far so good?

quiet depot
#

yep

empty flint
#

what is it trying to swap when I trigger the swap action in intellij?

#

like which classes does it try to swap?

#

only the ones part of the current project?

quiet depot
#

Iโ€™m not exactly sure how certain classes are triggered for swapping, I assume the hotswapagent plugin simply monitors source files

#

but itโ€™s only swapping files you edit

#

that includes resources iirc, not just classes

#

however, things like dependencies are not part of your source set

empty flint
#

ah yeah I can't edit dependencies directly from within the project

quiet depot
#

theyโ€™re added during the compilation, by your build tool

empty flint
#

makes sense

quiet depot
#

and your build tool is only triggered for the initial compilation

#

any compilations after (i.e. hotswaps) are handled by intellij/dcevm

empty flint
#

any chance of telling intellij to compile the lib as well?

#

I guess I'd have to tell it to add the source as a dependency, not the compiled jar itself

#

so basically a module...

quiet depot
#

thatโ€™s a perfectly valid option

#

a module (gradle subproject)

empty flint
#

But does intellij know about gradle submodules though?

#

if it's a gradle submodule, that's again just the build tool

#

IntelliJ won't compile that after the initial compilation either

#

Maybe composite projects...

#

I'd have to look into that

quiet depot
#

nah

#

subprojects are fine

#

theyโ€™ll work

empty flint
#

I think I will go with composite builds. That way all the projects are independent and the lib can be shared freely between all plugins, without having to have all plugins within one single gradle project

#

It seems that they get added to IntelliJ all the same

ocean quartz
#

Piggy how would you abstract 2 classes that are basically the same except one uses a JsonArray and the other a StringBuilder? (to append components)

#

having a brain fart right now

empty flint
#

check if JsonArray implements Appendable

#

Then you could do something like
AbstractClass<T extends Appendable>

#

and then use
JsonClass extends AbstractClass<JsonArray>
and
BuilderClass extends AbstractClass<StringBuilder>

ocean quartz
#

It isn't Appendable, they are pretty different

empty flint
#

then make a JsonBuilder class that extends JsonArray and implements Appendable

#

and use that instead of JsonArray

ocean quartz
#

Interesting, i'll leave that for tomorrow me though, brain is frozen right now

empty flint
#

and ofc map all the appendable methods to the appropriate json array methods

hot hull
#

Anyone got any thoughts on how comprehensive and doable it would be to recreate ARK in MC? Cause like that'd be cool af

old wyvern
#

Whats ARK?

#

That dinosaur game thingy from 2-3 years ago?

#

ARK survival or whatever

#

?

hot hull
#

Ark survival evolved yea

lost forge
#

Would be really cool and somewhat unique. I don't think it would be an easy thing. But definitely doable

obtuse gale
#

sounds like a cool project....

lost forge
#

It does haha

steel heart
#

Someoneโ€™s gonna make ark in minecraft? Wth

hot hull
#

I mean most stuff is doable, just the different building stuff doubt it would be

steel heart
#

I mean pixark exist?

hot hull
#

Well yea but that's completely different

old wyvern
#

What does Ark consist of? Im not really familiar with the game

#

The only part I have seen is on youtube about taming dinosaurs I think

lost forge
#

I mean most stuff is doable, just the different building stuff doubt it would be
Depends who is doing the building I guess. But I don't have much skill with building so not sure.

hot hull
#

No I mean as in, ARK uses a "template" style building for components, it'd be pretty hard to make that in mc, especially trying to display and manage where the component will be placed

old wyvern
#

Oh have you checked out civs?

#

That might be similar to what you are looking for

hot hull
#

Civs?

old wyvern
#

It has the "building" templates afaik

hot hull
#

That uses entire buildings, which I guess could work, whereas ARK uses components (ie. foundations, walls, roofs, etc)

old wyvern
#

Ah I see

hot hull
#

There's still a few other major things which I doubt are doable, or easily done since mc gae

old wyvern
#

MC is going for a big overhaul from legacy code right?

#

With aether engine

hot hull
#

No clue

old wyvern
hot hull
#

I mean if they did that, performance would be a non existent issue

old wyvern
#

I guess so

hot hull
#

However there's still so much of the game which is "hardcoded" that really doesn't help when trying to do custom af shit

old wyvern
#

I mean that could come to a change

hot hull
#

Let's hope so

old wyvern
#

They seem to be switching up the game part by part on updates

#

1.13 being an example

hot hull
#

1.14 being a disaster

old wyvern
#

Wdym?

lost forge
#

No one even really talks about or uses 1.14 lol

heady birch
#

AbstractClass<T extends Appender<T>>

#

interface Appender<T> {
void append(T t) {
}
}

jovial warren
#

inner iface should have @FunctionalInterface smh

#

actually thatโ€™s not inner, itโ€™s just @heady birch โ€˜s bad formatting xD

hot hull
#

Quick question fellas, so I have an enum which indicates my "user" statistics (health, stamina, oxygen, weight, etc), and now I have an experience statistic, however I'm not sure if I want to have that in the same enum as it's completelly decoupled from the user stats (if that makes sense)

steel heart
#

Isnt the annotation just for reflection or something bardy?

#

Might be wrong

high violet
#

Quick question fellas, so I have an enum which indicates my "user" statistics (health, stamina, oxygen, weight, etc), and now I have an experience statistic, however I'm not sure if I want to have that in the same enum as it's completelly decoupled from the user stats (if that makes sense)
@hot hull Couldn't you make a enum for other stats like exp, exp level, achievements, etc?

#

Idk if exp actually fits that criteria

old wyvern
#

Isnt the annotation just for reflection or something bardy?
@steel heart
That annotation just tells the IDE that that interface is supposed to be a functional interface and thus should only contain exactly one function to be implemented

frigid badge
#

it's just there to be informative

#

@hot hull so to what belongs experience?

high violet
old wyvern
hot hull
#

Well the experience is a statistic, however is more "general" than the other ones, since it's used in everything, instead of just specific things like the weight and health

obtuse gale
#

idk what to make ๐Ÿ˜ฆ

#

I wanna make something cool but idk what

hot hull
#

Quick question, should I store a level for certain statistic as well, or would it be good enough if I already have the base value, and the level incrementation so I can just do math to get that level?

obtuse gale
#

Thoughts on the format of this? I dont love it.... Maybe too many colours? Or maybe the blues too bright? idk

high violet
#

Love it

#

Could i ask how you did the clicky thing in the chat?

obtuse gale
#

the click [here] thing? Im using Matts lib for that, https://mf.mattstudios.me/message/mf-msg
idk how youd do it without it, heres the code for that message...

        Message.create().parse("""
            ${ORANGE}$playerName ${AQUA}has challenged you to ${RED}**$gameName**\n
            ${AQUA}Click [${GREEN}**[here]**](hover: **/accept $playerName**|suggest: /accept $playerName)  ${AQUA}to accept, 
            ${AQUA}or click [${RED}**[here]**](hover: **/deny $playerName**|suggest: /deny $playerName)${AQUA} to deny.\n
            ${GREY}Please note this request will automatically close in 30 seconds!
        """.trimIndent()).sendMessage(player)```
high violet
#

Oh ait

#

thanks!

#

i thought it was supported on vanilla mc

obtuse gale
#

I mean it probably is

#

I just use that lib to make things easier for myself

#

you can probably do shit with /tellraw if you tried hard enough

high violet
#

so after some digging around

#

is it a ChatComponentBuilder right?

prisma wave
#

ComponentBuilder yes

#

Or just any JSON message API

obtuse gale
#

Should simple stuff be done async? Like putting a value into a map or whatever?

prisma wave
#

Probably not

#

In fact definitely not

obtuse gale
#

so in reality what should be done async, if you arent meant to interact with spigot for the most part on another thread

prisma wave
#

There's no performance increase and you increase the risk of things like race conditions

#

Intensive calculations

#

IO

#

Etc

#

Things that will take a long time to complete

obtuse gale
#

ah

high violet
#

Yeah race conditions are bad

obtuse gale
#

tf is a race condition

#
    fun removeAllRequests(requestor:Player){
        requests.filter { it.requestor == requestor }.forEach { requests.remove(it) }
    }```
#

Also is there a better way to do this? idk why but the way im doing it feels kinda weird

#

oh wait

prisma wave
#

requests.removeAll

obtuse gale
#

is that what removeAll does

#

ah

prisma wave
#

Yes

heady birch
#

Enum

#

Statistic<T>

prisma wave
#

๐Ÿ™„

obtuse gale
#

    fun getRequestByRequestor(requestor:Player):Request?{
        return requests.find { it.requestor == requestor }
    }``` is that what .find does? Just returns the first one it finds matching the predicate?
prisma wave
#

I believe so

#

It's functionally identical to firstOrNull

jovial warren
#

not true

obtuse gale
#

so why are there two

jovial warren
#

find will return an empty list if it finds nothing afaik, findOrNull returns null if it finds nothing

obtuse gale
#

find doesnt return a list?

jovial warren
#

then it must throw an error or something

#

weird

obtuse gale
#

or null if no such element was found

#

yeahhh

#

Literally the exact same documentation

#

almost

jovial warren
#

thatโ€™s really weird, since single for example throws a NSEE if itโ€™s empty

obtuse gale
#

NSEE?

jovial warren
#

NoSuchElementException

obtuse gale
#

ah

jovial warren
#

when youโ€™re in Physics giving development help over Discord whilst everyone else is going through homework you didnโ€™t bother to do lol

obtuse gale
#

hmm yes

#

At the top the class is underlined red but theres no errors thonking1

jovial warren
#

why can I see private there?

high violet
#

Hehe maven goes brrrr

obtuse gale
#

because list

#

maven bad

high violet
#

Why y'all talkin shit about private here

jovial warren
#

Maven goes โ€œIโ€™m so trash you should just use agrรกdeleโ€

obtuse gale
#

^

hot hull
#

@obtuse gale bruh that spacing after , bothers me so much..

jovial warren
#

Why y'all talkin shit about private here
Iโ€™m worried thatโ€™s a field

high violet
#

didn't he say it was a list?

obtuse gale
#

its a list

#

private val requests = mutableListOf<Request>()

jovial warren
#

oh lol fair enough

hot hull
#

Quick question, should I store a level for certain statistic as well, or would it be good enough if I already have the base value, and the level incrementation so I can just do math to get that level?
@hot hull

jovial warren
#

also, you should learn what an expression function is @obtuse gale

obtuse gale
#

I know what it is lol

#

I just havent been using them

#

Im inconsistent af for some reason

high violet
#

@hot hull
@hot hull mind explaing?

#

i don't quite understand

obtuse gale
#
    fun createRequest(requestor: Player, requested: Player, gameType: GameType) {
        val request = Request(requestor, requested, gameType)
        requests.add(request)
        Bukkit.getScheduler().runTaskLater(plugin, Runnable {
            requests.remove(Request(requestor, requested, gameType))
        }, 600)
    }``` this the best way to remove from a list after 30 secs?
jovial warren
#

also also, why set requests to private when you could allow users to use property syntax on that?

obtuse gale
#

wdym

prisma wave
#

Smh

obtuse gale
#

isnt it bad to expose the lists fields directly or whatever?

high violet
#

sleep(30)

#

heheh

jovial warren
#

not in your case aj3

#

youโ€™re thinking Java lol

hot hull
#

Let me give you an example

Let's say Weight is my current desired stat, which has a base value of 100.0 and an incremental value of 1.3.
The user can now level up that stat and it will increase by the incremental value each level.
Should I now also store the level that it is at, or would doing simple math be fine for getting the level?

prisma wave
#

Why you creating 2 identical Requests

jovial warren
#

property syntax means you can just call MyClass.requests[myindex] instead of getRequest or whatever

obtuse gale
#

Why you creating 2 identical Requests
because I no smart and forgot to change it

jovial warren
#

small brain logic xD

hot hull
#

Bruh don't be dissing my boi Aj like that

obtuse gale
#

property syntax means you can just call MyClass.requests[myindex] instead of getRequest or whatever
mmm, but I never need to call .get on the list so

jovial warren
#

what about inserting elements?

obtuse gale
#

I still thought it was bad to directly access it like that as well...

prisma wave
#

Just because a feature exists, doesn't mean you should use it everywhere

jovial warren
#

requests[myindex] = my new element

high violet
#

Let me give you an example

Let's say Weight is my current desired stat, which has a base value of 100.0 and an incremental value of 1.3.
The user can now level up that stat and it will increase by the incremental value each level.
Should I now also store the level that it is at, or would doing simple math be fine for getting the level?
@hot hull Do you actually need the base value? if don't, i'd say store the actual value

prisma wave
#

@hot hull I'd store the level too, you can't always guarantee that the algorithm would be easily / quickly reversible

#

Unless I misunderstood

hot hull
#

Well it's a consistant increment so it would always be the same speed

high violet
#

Yeah also that's calculations you may need to run every tick also

#

if you need it

prisma wave
#

Well division is pretty quick

frigid badge
#

I'd only store the level and the value is calculated

prisma wave
#

I'd store it purely for convenience

hot hull
#

Also, yes I need the base value

frigid badge
#

since it's 100 + 1.3*level

jovial warren
#

anything to do with maths is done natively using C, meaning itโ€™s super fast, probably some of the fastest operations on the JVM

high violet
#

No doubt, but a math function called 20 times per sec for x players is not really efficient

#

Couldn't you use a hasmap?

prisma wave
#

Simple division is neglible

high violet
#

Like, <basevalue,actualvalue>

jovial warren
#

Simple division is neglible
^

hot hull
#

Might be better to just store the level as Lemmo said yea

prisma wave
#

However I'd store it for convenience rather than for an optimisation

jovial warren
#

as I said, maths is computed natively

high violet
#

Sure

prisma wave
#

pretty sure most CPUs have an instruction specifically for multiplication / division

#

But that's besides the point

jovial warren
#

the ALU handles logic like maths

heady birch
#

MUL/IMUL in assembly

jovial warren
#

ALU = Arithmetic Logic Unit

frigid badge
#

the ALU handles everything lol

high violet
#

Funny thing is that i'm studying how cpu works rn

frigid badge
#

and all it does is maths anyway

high violet
#

Like, my degree is in software engineering

jovial warren
#

true lemmo

heady birch
#

It is all maths!

frigid badge
#

and registers