#dev-general

1 messages · Page 155 of 1

prisma wave
#

Along with all the other cool things fingerguns

#

Lol

steel heart
#

Ya

prisma wave
#

You can even compile to Java 6

steel heart
#

Bro

prisma wave
steel heart
#

Does it exist a book equivalent to effective java but in kotlin

#

?

#

Would really need to read that one if so

prisma wave
#

There is effective kotlin

#

Not sure how good it is

steel heart
#

Aw man, you could write that one

prisma wave
#

I could try lol

#

Effective Kotlin 2, HelpChat edition

steel heart
#

Lmao

prisma wave
#

Chapter 1 - kotlin good java bad

steel heart
#

That would implicitly be the message of all chapters

onyx loom
#

no

#

explicitly

steel heart
prisma wave
#

very explicitly

#

Every page has to end with that

onyx loom
trim dagger
#

does anyone here have pathfinding experience?

ocean quartz
#

@trim dagger Better if you ask your question rather than asking if someone has experience
Also #development might be better too

surreal quarry
#

I have an abstract function abstract fun UserCommandExecuteEvent.onCommand()
is there a way I can make whatever code will be in here run every time i instantiate a new UserCommandExecuteEvent for a command lib type of thing

#

or just in general how would that logic work to make this event work

ocean quartz
#

You mean something like a functional interface?

surreal quarry
#

im not sure really
I have this (https://paste.helpch.at/odinuqewen.cs) method to handle a GuildMesssageRecievedEvent and check for if the message starts with a prefix then a command in a list of commands

when I make the UserCommandExecuteEvent instance, im looking for a way to call that abstract method that all Command classes will have

https://paste.helpch.at/midariviba.cs is the full command class so far

ocean quartz
#

Hmm, i'm not sure
Though i wouldn't recommend doing commands with the command event

surreal quarry
#

for example with your command framework what’s the logic from receiving user input to executing the stuff in your command/subcommands or would it not be similar at all

ocean quartz
#

It uses the bukkit command system, the framework works more like a wrapper for it

surreal quarry
#

ah ok

#

well i guess i’ll keep trying stuff

surreal quarry
#

ty

viscid charm
#

anyone here used CombatTagPlus? I want to make it so before this specific action I want it to check if the player is combat tagged or not

#
    public void onCommandProcess(PlayerCommandPreprocessEvent e) {
        if (!e.getMessage().equalsIgnoreCase("/pv")) {
            return;
        }
        Player player = e.getPlayer();
HERE i want it so that if they are tagged then cancel, if not continue to stuff below :P.
        player.openInventory(this.getVaultInventory(player));
        player.playSound(player.getLocation(), Sound.BAT_TAKEOFF, 1.0F, 0.5F);
        e.setCancelled(true);
    }```
viscid charm
#

nvm got it

hollow dragon
#

Is there a DeluxeChat API?

distant sun
#

Inside the jar

ocean quartz
#

As soon as I get a fun project I actually start doing work lmao

hollow dragon
#

Is there any way to send chat messages with TextComponent with DeluxeChat support

viscid charm
#

@ocean quartz whats that graph

ocean quartz
#

Amount of time spent coding per day, the highest peak is 7h

#

The colors represent different projects

viscid charm
#

Matt can you add me?

#

@ocean quartz

ocean quartz
#

Why?

viscid charm
#

Few questions I wanna pm

surreal quarry
#

bro really just ghost pinged BM lmao

#

._.

#

you left it for like 2 seconds lmao

#

in general just don't ghost ping lol

obtuse gale
#

Does anyone know of a "cloud system" I can use? I can only find ones that have bad documentation or it's all in german. I would prefer one that's open source so I can edit it to fit my needs.

#

okay?

#

umm

#

that's not what I mean

#

I'm looking for minecraft cloud system

surreal quarry
#

like server hosting?

obtuse gale
#

as in automatically starting and stopping servers

#

no

#

no no no

ocean quartz
#

Like a panel?

obtuse gale
#

no

#

It doesn't matter but I would prefer open source

#

since let's be honest if it's not I'm just going to decompile it

#

umm

#

yeah

#

that one has bad documentation

#

hmm... weird. maybe I have the wrong link or something?

#

^ It explains almost nothing about what it actually does or how it works. I haven't even been able to connect to the bungee instance.

#

?

#

🤦‍♂️ thats why I'm in "help chat"

#

Can someone help me I'm trying to make a chat filter, I don't know how to make an if statement like if player.chatMessage = "sh1t", event.setCancelled(true); but idk how to get that out of pseudocode

#

use regex

#

I think it's string.replaceAll("<regular expression>");

#

ok I'll try that thanks

#

and then yeah use what @obtuse gale said

#

okay well I'll go bother someone else to see what I can find

#

later

#

i was thanking ftc, I already read through that I couldn't find what i was looking for, but thanks for trying i guess...

surreal quarry
#

are you asking how to make an if statement

obtuse gale
#

no I just don't know how to make it like if chatmessage = "sh1t"

surreal quarry
#
    doSomething();
}```
#

or iguess .equals in java is better

distant sun
#

equalsIgnoreCase*

surreal quarry
#

yea

#

i know

#

thats what i just wrote out

#

lmao go easy

#

also its probably better to use contains coyote

#

as opposed to equals

verbal relic
#

hi is it possible for me to get a free subdomain for something for me to change url/ip with port to just domain. Like from serble.net:25561 to thing.subdomain.com. serble.net is a server btw pls join!

distant sun
verbal relic
#

thing

#

hi

hot hull
#

Noone cares

obtuse gale
#

@verbal relic you can setup dns records to have sub domain point to a host and port if that’s what you’re asking

empty flint
#

@empty flint declarative is telling the computer what to do (eg listOf(1, 2, 3).map { it + 1 }.sum()), imperative is telling the program how to do it (eg a for loop creating a new list manually
@prisma wave What's the difference between telling it to create a list using listOf(1, 2, 3) and using a loop to do it? I don't think I get it...

#

As soon as I get a fun project I actually start doing work lmao
@ocean quartz What software are you using to track that statistic? Where's that graph from?

prisma wave
#

technically making a list declaratively would be doing ArrayList() and then calling add() a few times

#

It was just convenience

quiet depot
#

@empty flint wakatime

lunar cypress
#

You mean imperatively

prisma wave
#

Yeah my bad

#

Imperatively*

#

Declaratively is telling the program what to do, imperatively is saying exactly how to it

lunar cypress
#

Functional programming is a type of declarative programming

#

As an example

empty flint
#

And why is declarative better than imperative?

old wyvern
#

When a declarative option is available it is more understandable than the imperative implementation

hot hull
#

@empty flint wakatime
waka waka e e e

lunar cypress
#

And why is declarative better than imperative?
@empty flint because it's more expressive and lets you focus on the actual problem

#

Otoh it's too high level to be suitable for everything

#

But in java that is rarely a concern

quiet depot
#

otoh?

prisma wave
#

Usually declarative is more concise but for complex problems it can be more difficult to express

lunar cypress
#

On the other hand

#

I don't think it's more difficult for complex problems

lavish notch
#

How can I get a user's details from bukkit.getOfflinePlayers() with a UUID?

hot hull
#

"users details", such as name?

lavish notch
#

mhm

hot hull
#

The uuid would be the player you want to check or what?

lavish notch
#

yeah

hot hull
#

Cause if yes, then just use Bukkit.getOfflinePlayer(UUID)

lavish notch
#

ehh

#

bad

hot hull
#

bruh

lavish notch
#

laggy and slow

hot hull
#

Are you calling it a thousand times a second?

lavish notch
#

yes, but no

#

I'm trying to make a leaderboard

#

and I'm storing UUIDs for the leaderboard data

hot hull
#

Just use Bukkit.getOfflinePlayer

#

You'll have other shit be more laggy/slow than this is

lavish notch
#

It legit kills me tps

#

goes down from 19.99 to 18.2

#

...and that only with 3 UUIDs

hot hull
#

And you're only calling that method?

lavish notch
#

String name = Bukkit.getOfflinePlayer(f.getKey()).getName() != null ? Bukkit.getOfflinePlayer(f.getKey()).getName() : "Unknown";

hot hull
#
final OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(f.getKey());
final String name = targetPlayer != null ? targetPlayer.getName() : "Unknown";
heady birch
#

getoffline player network requets 😦 😦 😦

#

to fix the delay you ne

lavish notch
#

I need what?

lunar cypress
#

Lmao

hot hull
#

I've got a strong feeling, that's not the thing that's causing you lag, and it's some other shit

lunar cypress
#

Died in the middle of that

lavish notch
#

I mean... I do only get 2MB down, and like 0.1MB up

hot hull
#

Died in the middle of that
@lunar cypress Should I call an ambulance ☹️

heady birch
#

No im fine

#

I was just about to tell him how he can fix the issue

#

But i have to go now

obtuse gale
#

how can i create a "simple date format"
%localtime_time_<SimpleDateFormat>%

heady birch
#

@lavish notch What are you doing with the data? Are you just showing it to a user or something?

lavish notch
#

I just want to get the username

heady birch
#

Do you need it instantly

obtuse gale
#

what ?

heady birch
#

What are you doing with the username

obtuse gale
#

me ?

lavish notch
#

Not really... but ideally, yes.

heady birch
#

I would put it in an async task or something

lavish notch
#

I'm simply pasting the name to chat

heady birch
#

Oh okay

#

Yeah just make it async and send the message

#

You would have a little delay

obtuse gale
#

anyone please help

how can i create a "simple date format"
`%localtime_time_<SimpleDateFormat>%

lavish notch
#

Mind spoon feeding me? - code

hot hull
#

No spon feed

lavish notch
#

D:

hot hull
obtuse gale
#

thanks 🙂

heady birch
#

new BukkitRunnable() {
    final OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(f.getKey());
    final String name = targetPlayer != null ? targetPlayer.getName() : "Unknown";

    ///send name to player
}.runTaskAsyncronously(plugin);
lavish notch
#

Class 'Anonymous class derived from BukkitRunnable' must either be declared abstract or implement abstract method 'run()' in 'Runnable'

obtuse gale
#

%localtime_time_hh:mm aaa% like so ?

hot hull
#

try and see

obtuse gale
#

hmm

#

can i make it 24h instead of 12h ?

#

the clock

hot hull
#

Mackenzie,
add

@Override
public void run() {
  
}
lavish notch
#

Cannot resolve method 'runTaskAsyncronously(ml.mackenziemolloy.Main)'

prisma wave
#

BukkitRunnable bad

#

You spelt it wrong

lavish notch
#

go figure

hot hull
#

Main

#

Why :((

lavish notch
#

bur

prisma wave
#

Main bad

obtuse gale
#

wtf

#

that is actually METTER how the caps are

prisma wave
#

?

obtuse gale
#

HH 24h
hh 12h

#

LOL

heady birch
#

yeah

hot hull
#

I mean yes, it's a time format..

prisma wave
#

12hr bad

obtuse gale
#

i never messed with that

#

yeah

#

ew

prisma wave
#

Imagine being American

obtuse gale
#

imagine

#

Imagine buying useless item

prisma wave
#

I am not an expert but too much bold imo

heady birch
#

make 0MS -> 0ms

lavish notch
heady birch
#

Oh must be a new method

#

Just use runTaskLaterAsyncrounously(main, 0L)

#

But I can specc asyncronous very well so check that

lavish notch
#

Cannot resolve method 'runTaskLaterAsyncrounously(ml.mackenziemolloy.Main, long)

errant geyser
#

You need to put your code in the run section boi

heady birch
#

Oh

#

Lol

#

Let it auto complete for you

#

I spelt it wrong

lavish notch
#

gg

#

k

errant geyser
lunar cypress
#

wth I just updated the intellij rust and toml plugin and now my font is all bold

lavish notch
#

name returns a UUID?

prisma wave
#

Send code

lavish notch
empty flint
#

@prisma wave Any advice on implementing serialization and deserialization methods in Kotlin?

#

@lavish notch I am just wondering: aren't you getting the OfflinePlayer by using the name in the getOfflinePlayer(...) method? Why are you trying to get the name back?

lavish notch
#

I'm trying to get the player's name with their UUID

empty flint
#

So f.getKey() returns the UUID? Why's the method call marked as deprecated though?

old wyvern
prisma wave
#

@empty flint serialization to what exactly?

empty flint
#

@empty flint serialization to what exactly?
@prisma wave To a stream or a string, I don't care really. Let's say stream.
I wanted to implement the Interface "Serializable" but doing
class Context private constructor(val id: String, val type: ContextType) : Comparable<Context>, Serializable results in this error: Cannot access 'Serializable': it is internal in 'kotlin.io'

prisma wave
#

That's for Java Serialization

#

You have the wrong import

#

If you wanna do it that way

#

There is also kotlinx.serialization which is a more idiomatic way of serializing to JSON and similar formats

#

Or just gson / Moshi / Jackson will work fine

empty flint
#

How do I tell it I want kotlinx.serialization instead of the java serialization=

old wyvern
#

How do I tell it I want kotlinx.serialization instead of the java serialization=
@empty flint
Change the import statement

heady birch
#

🙂

old wyvern
heady birch
#

Me and my team after exposing everyones passwords in the rest api

#
pub fn get_bits(message: &Vec<u8>, first_bit: u8, last_bit: u8) -> i32 {
    let fbi: u8 = first_bit - 1;
    let lbi: u8 = last_bit - 1;
    let nbi: u8 = last_bit - first_bit + 1;

    let fby: u8 = fbi >> 3;
    let lby: u8 = lbi >> 3;
    let nby: u8 = (lby - fby) + 1;

    let shift: u32 = (7 - (lbi & 7)) as u32;
    let top_mask: u32 = (0xFF >> (fbi & 7)) as u32;

    let i: usize = fby as usize;

    return match nby {
        5 => { ((message[i] as u32) & top_mask) << (32 - shift) |
            (message[i + 1] as u32) << (24 - shift) |
            (message[i + 2] as u32) << (16 - shift) |
            (message[i + 3] as u32) << (8 - shift) |
            (message[i + 4] as u32) >> shift },
        4 => { ((message[i] as u32) & top_mask) << (24 - shift) |
            (message[i + 1] as u32) << (16 - shift) |
            (message[i + 2] as u32) << (8 - shift) |
            (message[i + 3] as u32) >> shift },
        3 => { ((message[i] as u32) & top_mask) << (16 - shift) |
            (message[i + 1] as u32) << (8 - shift) |
            (message[i + 2] as u32) >> shift },
        2 => { ((message[i] as u32) & top_mask) << (8 - shift) |
            (message[i + 1] as u32) >> shift },
        1 => { ((message[i] as u32) & top_mask) >> shift }
        _ => {0}
    } as i32;
}
#

@lunar cypress I ported this C method to rust- any way I can neaten it up a little

#

gets a bit range in the byte array

hot hull
#

Looks decent

hot hull
#

This would work right? or nah?

    public void setMaterial(final Object material) {
        if (material instanceof Integer) {
            this.material = Material.getMaterial((int) material);
        } else {
            this.material = Material.matchMaterial((String) material);
        }
    }
heady birch
hot hull
#

?tryandsee

compact perchBOT
hot hull
#

It still exists niall

coral hazel
#

don't really know where to put this, since it doesn't feel like a thing for #738969312051593249 ,
anyways,
i'm looking for someone to just chill with and code together, maybe show each other what were working on, or work on something together, just all around coding buddies, you know?
(im pretty new at this minecraft plugin dev thing, just fyi)
anyways, dm me

empty flint
#

@coral hazel Have you heard of the Kotlin cult?

coral hazel
#

nope

heady birch
#

convert him

empty flint
#

Join us, we have null-safety and operator overloading.

old wyvern
#

🤦

empty flint
#

Jk, jk. I switched from Java to Kotlin like 2 weeks ago to learn the new language and code my plugins in. Found my coding buddies right here in this channel.

#

People share what they are working on and you can ask for help with almost anything as long as you don't mention Maven, Kotlin and Eclipse in the same sentence.

hot hull
#

Maven and Eclipse
Shouldn't ever mention these fingerguns

empty flint
#

Anyway, Kotlin good. every time

onyx loom
empty flint
#

How does gradle with kts work again?

obtuse gale
#

if its .kts its in kotlin not groovy

empty flint
#

this doesn't

obtuse gale
#

does

#

maven("repo") work?

#

idk if it will, i use something weird

#
    maven {
        url = uri("https://jitpack.io")
    }``` Thats what I use, but im like 90% certain theres a better way
empty flint
#

yep that works

#

and the dependency?

#

compileOnly "org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT"

obtuse gale
#

implementation("org.springframework.boot:spring-boot-starter-data-jpa") thats what ive used for a dependency

empty flint
#

huh I guess compileOnly("org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT") works

#

ty

steel heart
#

you know 1.16.2 is out :p

onyx loom
#

ya

#

is spigot out or nah?

obtuse gale
#

So, I need a good way to be able to work on the same project on both my laptop and my PC, is github the best way to do this or - Ill be needing to do this alot (Like twice a day ill need to move from my pc to laptop)?

prisma wave
#

seems like the best way

#

or store the project on some cloud storage

obtuse gale
#

In an ideal world Id just be able to open my pc and it would have automatically updated, and vice versa, but i dont think something like that exists?

old wyvern
#

I mean one drive would do that but not sure if it plays well with intellij projects

regal gale
#

No Clojure eval allowed on my eval set!

obtuse gale
#

Yeah... I mean if both computers are pointing intellij to the same files on a remote server that should work, but im guessing IJ might not like that and might cause me issues

regal gale
#

Yep, jAva iS bEtteR

hot hull
#

That is false information.

prisma wave
#

unfair comparison

#

too small to get reliable results

hot hull
#

Staged evidence.

prisma wave
#

kotlin good java bad

#

@quiet depot i'm gonna try rewriting the java guide, it felt a bit messy and overwhelming.
do you think that episode one should pick apart a Hello world program (and potentially confuse people), or should we just say "we'll cover how this works later"?

quiet depot
#

pick it apart

#

understanding the jvm and it's bytecode could be an interesting start

prisma wave
#

yeah

#

i'm just thinking if someone has never done any coding before, will find it overwhelming?

#

atm I feel like we should only focus on the practical stuff right now, and go deeper into how it actually works later

quiet depot
#

anyone who possesses the ability to think logically, and is committed to learning, will understand it

#

however, with that in mind

#

there's probably a reason why what you're describing, is never done in the real world

prisma wave
#

probably

quiet depot
#

so while your suggestion is as I said before, interesting

#

you should definitely not do that

prisma wave
#

but for example, how would you explain static without previously explaining OOP, classes, etc?

old wyvern
#

Start with the concepts first before the language maybe?

prisma wave
#

it seems like some things have to be skipped because the hello world carries so much information compared to something like python

#

i'm really conflicted - obviously it should be informative, but at the same time I don't want to have to spend ages explaining all the keywords before people even know what OOP is

quiet depot
#

then perhaps hello world, is simply not the best introduction to java

prisma wave
#

maybe not

#

it's traditional

#

do you have a better idea?

quiet depot
#

no

prisma wave
#

:/

#

welp

#

this is tricky lol

quiet depot
#

indeed

#

the simple fact is that java is not beginner friendly

prisma wave
#

no it's really not

quiet depot
#

so, with that in mind, you don't need to attempt to coddle the user

#

as I said before, they should already possess the ability to think logically if they're watching your guide

prisma wave
#

Very true

quiet depot
#

which is all they need to understand it's contents

#

and your full breakdown of the hello world

prisma wave
#

how about this - explain what the main method declaration and System.out.println does, but cover classes and static and things at a later date?

lunar cypress
prisma wave
#

It just feels wrong to be explaining the concept of a class before you've even covered basic syntax

#

@lunar cypress I saw that

#

very interesting

errant geyser
quiet depot
#

16 minutes

#

bruh

lunar cypress
#

found that channel when it still had 50 subscribers

#

happy to see it evolve

hollow dragon
#

is there any way to change the players messages so that they use ChatComponent

hot hull
#

Player.spigot().sendMessage

quiet depot
#

yuck

hollow dragon
#

if i used that I would have to add the features of deluxechat into the message

errant geyser
#

sorry what

hollow dragon
#

im trying to make a [item] plugin that supports DeluxeChat but I dont know how to use modify the message using ChatComponent instead of a string

quiet depot
#

It just feels wrong to be explaining the concept of a class before you've even covered basic syntax
@prisma wave the syntax you can cover is limited without explaining the concepts behind the syntax

prisma wave
#

exactly

#

I think for now I'll just move on to basic variables and stuff

#

and then revisit it later

quiet depot
#

honestly I always thought I was going to write a java guide

#

but seeing these problems come to light, might just skip that part, and get onto what really matters

#

the application of oop principles

prisma wave
#

that's probably wise

old wyvern
#

16 minutes
@quiet depot
Have you had a 1.5 hours lecture on Hello World program? xD

quiet depot
#

I can give you one if you'd like

#

hello world really is a perfect segway into the jvm in it's entirety

errant geyser
#

Please do

lunar cypress
#

well context free uses the time to show many different languages

hot hull
#

And I ooop

errant geyser
#

I won't be listening or watching Piggy but please do

#

Imagine the xp

quiet depot
#

no

#

i'm meant to be revising for a civics & citizenship test tomorrow

onyx loom
#

🙄

#

boring

#

i want a lecture!

quiet depot
#

it's actually incredibly interesting

#

well

#

@onyx loom what do you understand of the hello world?

#

let's lay it out, tell me exactly what you understand

prisma wave
#

that sounds very philisophical

quiet depot
#

what does clojure?

prisma wave
#

what do you understand of the hello world?

quiet depot
#

lol

onyx loom
#

println("Hello world") outputs me a message Kappa

hot hull
#

Or does it fingerguns

quiet depot
#
package me.piggypiglet.hello;

public final class HelloWorld {
    public static void main(final String[] args) {
        System.out.println("Hello World");
    }
}```
hot hull
#

ew java

quiet depot
#

dissect it for me kaliber

hot hull
#

Disgusting

errant geyser
#

I don't think he'll want to

lunar cypress
#

On which level

quiet depot
#

merely syntactical right now

hot hull
#

microscopical

onyx loom
#

do i have to dissect the package too

quiet depot
#

everything

onyx loom
#

😐

heady birch
#

Choose your side

#

Noooooo

prisma wave
#

which will it be

errant geyser
#

ok so in Java are procedures called procedures or methods? Or is a method a general way to describe a function/procedure?

prisma wave
#

hshahahaha

#

methods

errant geyser
#

ok

quiet depot
#

methods & functions are too different things

#

functions are stateless

errant geyser
#

I'm aware

quiet depot
#

methods are bound by their object's state

prisma wave
#

state bad

errant geyser
#

Its just I'm used to the python way of describing a function as a procedure that returns a value and a procedure as a function that doesn't return a value.
At least thats what my CS "professors" keep saying fingerguns

hot hull
#

CS professors
I think this explains everything katsu

prisma wave
#

i mean

#

that's kinda close i guess

quiet depot
#

wat the fak

#

I've never seen the word procedure used like that

hot hull
#

You're 117 and you've never seen it used like that, you should stop slacking Piggy

old wyvern
#

It seems to be used there

#

didnt know tbh

#

Not a fan of python

quiet depot
#

yeah well fuck python anyway it's not a respectable language

heady birch
#

yeh without python there would be nothing though

#

no windows

quiet depot
#

wat

heady birch
#

no linux

#

nothing

#

intel is built off of python

hot hull
#

Piggy, which languages would you say it would be nice to know for use in all around world applications

heady birch
#

no cpus 😦

quiet depot
#

everything python can do can be done by something else, better

#

@hot hull java

prisma wave
#

the linux kernel is actually written in python

#

fun fact

quiet depot
#

java is the best language to know

hot hull
#

Kotlin better fingerguns

quiet depot
#

maybe

heady birch
#

Rust

hot hull
#

But no seriously, would you say kotlin/java can be applied to any application with ease (lemme know if I'm making sense fingerguns)

quiet depot
#

absolutely

prisma wave
#

the people at Linux.com needed a fast language so they made a python interpreter in assembly

quiet depot
#

java is the most versatile language in existence

#

python 4 when

onyx loom
#

a package is just a location for where ur classes are going to be stored

the class is called Hello World. i dont really know the technicalities of a class tbf. but it separates ur code so please dont violate SRP Kappa it comes with the arguments of final. final means that the class cant be modified after its creation.

the method is named main which has parameters of a List<String>? might be an array (java bad). the static argument when declaring the method allows u to call and access this method everywhere in the code (theres more to static, but i cant remember what bm said, so ill leave it at that fingerguns static bad kotlin good it doesnt have static)
naming it main means that the method will be called upon executing the code straight away. which will then print me a hello world mesaage 🙂

how much of this am i wrong Kappa

quiet depot
#

maybe python 4 won't be FUCKING SHIT

prisma wave
#

Oh boy

#

@onyx loom it's an array

hot hull
#

Good thing you pointed it out

might be an array (java bad)

prisma wave
#

You had me worried at first

quiet depot
#

I don't think any language uses lists as a replacement for arrays

#

does go have arrays?

hot hull
#

Lists are cleaner imo tho :((

quiet depot
#

go might not have arrays

#

idk

#

should probs check

prisma wave
#

Lists are cleaner imo tho :((
Arrays are faster

hot hull
#

Who cares about speed, pfft

quiet depot
#

"moretypes"

#

you can't get more google than that naming

empty flint
#

Does anybody know how to take an arbitrary number of nullable objects and create a hash with all of them as seeds?

prisma wave
#

What

hot hull
#

^

quiet depot
#

erm

onyx loom
#

so like

prisma wave
#

arbitrary number
All 3

#

??

onyx loom
#

how much did i get wrong

quiet depot
#

don't use nullable objects to calculate your hash?

empty flint
#

uh

#

sory

heady birch
#

build your own Null object

prisma wave
#

don't

heady birch
#

then you can hash it

#

They hate my ideas

#

I am a stable genius

empty flint
#

idk how to explain what I mean xD

prisma wave
quiet depot
#

niall u aint a stable genius

#

remember N?

#

niall framework

prisma wave
#

N was good

hot hull
#

N.kt

prisma wave
#

ngl

heady birch
#

☠️

hot hull
#

❤️

errant geyser
#

N.kt

heady birch
#

Object theObject = object == null ? new Null() : object

empty flint
#

So say I have 3 objects and I want a unique identifier that results from only those 3 objects being fed into the algorithm

hot hull
#

bruh wtf is that emoji katsu lmao

empty flint
#

if one of the objects change, the hash changes

old wyvern
#

I can give you one if you'd like
@quiet depot
Oh already went through one. The prof took 2 days. ( total of 1.5 hours) but was in C++ tho

prisma wave
#

just let IJ generate a hashCode honestly

#

that will probably do the job

quiet depot
#

ij won't generate hash codes for nullable objects

prisma wave
#

😦

quiet depot
#

also autovalue > ide

prisma wave
#

kotlin > autovalue

quiet depot
#

k

prisma wave
#

:)

quiet depot
#

@quiet depot
Oh already went through one. The prof took 2 days. ( total of 1.5 hours) but was in C++ tho
@old wyvern lol i bet you only got through the syntax in that time

empty flint
#

just let IJ generate a hashCode honestly
@prisma wave Ye but I need one hashcode for the combination of 3 objects

onyx loom
#

i just wrote a long ass paragraph now no one even lecturing me 😭

empty flint
#

maybe I just have to write my own hashCode method then

quiet depot
#

don't

#

never a good idea

#

too prone to human error

prisma wave
#

final means that the class cant be modified after its creation.
final means that the class can't be extended*

might be an array
it's an array

static argument
keyword*

#

that's a start

onyx loom
#

thank

quiet depot
#

to expand on what clojure said kaliber

#

final means that the class can't be extended at compile time

old wyvern
#

Nah he went into the whole preprocessing, compilation stuff and how everything works out

heady birch
#

final means once you write the line you cannot ever change it again, only use final if your absolutley sure you will never change the statement again

quiet depot
#

which is an excellent segway into one of the more interesting java apis, the instrumentation api!

onyx loom
#

yea i wasnt really too sure on final classes

empty flint
#

don't
@quiet depot Do you have an idea how I could use 3 objects as unique identifiers for a class?

quiet depot
#

instrumentation allows you to manipulate bytecode at runtime

#

for example

#

making classes on the fly

#

or making a class non-final

empty flint
#

I could hash all 3 objects and then stringify them together actually...

#

idk if that's fast enough tho

onyx loom
#

so thats some big brain shit

quiet depot
#

borzan

#

so if I understand correctly

#

u've got a set, full of instantiated classes

#

which contain 3 objects, that are nullable

empty flint
#

correct

quiet depot
#

is it possible that all 3 objects could be null?

#

actually screw it

#

just write it out yourself

#

see if it works

empty flint
#

yes but I can filter those out, if all 3 are null, the resulting hash should always be the same so I can set it to 0 or something.

#

So let's just say for now that they are not all null

#

or rather none of them are nullable for a start

quiet depot
#

just get the hash codes of each non-null object and generate the hash from that

#

I believe this is a bad idea though

#

might be worth researching

empty flint
#

ye so im generating a hash code from 3 ints

#

how do I do that?

lunar cypress
#

Objects.hash(Object...)

prisma wave
#

the static argument when declaring the method allows u to call and access this method everywhere in the code
static makes the method part of a class, not an instance

quiet depot
#

Objects.hash?

empty flint
#

Objects.hash(Object...)
@lunar cypress I did not know that was a thing. Ty

quiet depot
#

out of curiosity

#

what is this for?

#

like what do these ints represent?

hot hull
#
[13:41:04 WARN]: [SpawnerMechanics] Could not save types.json to plugins/SpawnerMechanics/types.json because types.json already exists.
[13:41:04 WARN]: [SpawnerMechanics] Could not save blaze.json to plugins/SpawnerMechanics/attributes/blaze.json because blaze.json already exists.
[13:41:04 WARN]: [SpawnerMechanics] Could not save iron_golem.json to plugins/SpawnerMechanics/attributes/iron_golem.json because iron_golem.json already exists.
[13:41:04 WARN]: [SpawnerMechanics] Could not save pig.json to plugins/SpawnerMechanics/drops/pig.json because pig.json already exists.
``` Any way to suppress these ![fingerguns](https://cdn.discordapp.com/emojis/730681133200834592.webp?size=128 "fingerguns")
prisma wave
#

not with saveResource

#

it's a nice side effect

hot hull
#

Shame it doesn't have a boolean so you can disable that

prisma wave
#

Or just didn't do that

hot hull
#

You mean don't*

#

What else do you suggest then?

prisma wave
#

just don't log anything

#

And I think didn't is correct if you view it as a continuation of your sentence

hot hull
#

Would be best if saveResource was a boolean so you can send messages yoruself and shit

#

But hey it is what it is, any suggestions?

prisma wave
#

just copy from getResource yourself

#

Files.copy is a thing afaik

hot hull
#

Can I just make my own saveResource method fingerguns

quiet depot
#

yes that's what Files.copy is

#

important distinction

#

nio files.copy

#

not guava's

hot hull
#

What would the out be?

hot hull
#

bare with me, pc slow fingerguns

empty flint
#

like what do these ints represent?
@quiet depot If I hash an object in Kotlin I get an int. If I hash 3 objects i get 3 ints.... They represent nothing but a unique hash for this unique object...

onyx loom
#

static makes the method part of a class, not an instance
@prisma wave im taking a course now anyway reversed_fingerguns

hot hull
#

Kali, I bought an interesting java course, I can give you access if you want

quiet depot
#

what course?

hot hull
#

Tim Buchalka's Java Programming Masterclass

onyx loom
#

java

quiet depot
#

ah

hot hull
#

You said it was decent fingerguns

quiet depot
#

it's possible the only decent one

hot hull
#

Well atleast that the guy is pretty good

quiet depot
#

so I've heard

#

is that true so far?

#

although frankly I'm not sure what benefit you have of purchasing a course

#

as far as I could tell, your self study efforts had been successful

hot hull
#

I haven't watched it yet cause it's 70 hours, and I've not really had any time to watch it, plus it's mostly basics

#

Yea, he does have a databases section which I will check out

#

Cause ya know, I'm a newb fingerguns

prisma wave
#

kotlin masterclass? pleadingUWU

hot hull
#

If only

onyx loom
#

made by urself

hot hull
#

Also Piggy, it was 12$, so couldn't really pass on buying it :p (down from like 140)

old wyvern
#

Kotlin has a free course on stepik thats good I think tbh

#

It does assume you know java tho

hot hull
#

Sheesh assuming in 2020 😮

old wyvern
#

lol

errant geyser
#

BM your sites home page is quite

#

different

ocean quartz
#

Colors working nicely now ;p
Though still need to do a few more things like [#000000](/guild/164280494874165248/channel/000000/)**this** this won't work it'd need to be inside the ****, so gotta make it work even outside of it, also [#000000](/guild/164280494874165248/channel/000000/)Text **text** this will only color the first word there, same reason, and lastly actions are completely broken with colors xD

hot hull
#

Damn that's sexy

old wyvern
#

ayy nice

surreal quarry
#

thats so dope

prisma wave
#

@errant geyser ty

#

i think that's good

errant geyser
#

Its very

onyx loom
#

😆

errant geyser
#

Not plain, mine's plain, but like, very eye assaulting when it changes to brighter colours

prisma wave
#

i guess

surreal quarry
#

your thingy don't work

hot hull
#

Holy shit I'm so close to having these mechanics done :OOO

prisma wave
#

uh oh

surreal quarry
#

but up to you

#

i just like subdomains lmao

prisma wave
#

¯_(ツ)_/¯

#

it's only a temporary link

hot hull
surreal quarry
#

essentials should have like lowest priorty for commands im pretty sure

hot hull
#

Depends on how the plugin loads

#

Cause if ess loads before it'll use ess's

surreal quarry
#

add a loadbefore to yours

prisma wave
#

/discord link should work now

hot hull
#

smart fingerguns

old wyvern
#

bm speed up the background color change

surreal quarry
#

yea it does

hot hull
#

What y'all talking about 👀

surreal quarry
#

bms website

hot hull
#

link

surreal quarry
prisma wave
surreal quarry
#

its got like a wack color transition animation as the home page

prisma wave
#

wack???

hot hull
#

That's trippy af

prisma wave
#

😦

surreal quarry
#

i just mean different

#

im not sure how i feel about it yet lol

onyx loom
#

say its good angry

surreal quarry
#

you ideally don't spend too much time on the home page so i guess its pretty good

prisma wave
#

yeah

#

it was a cheap way of making a nice looking site

#

since i suck at web design

surreal quarry
#

retweet

obtuse gale
#

this is probably a really stupid question

prisma wave
#

it is

#

lol

obtuse gale
#

if i have a random number from 1-6, how can I make that a percent lol

prisma wave
#

?

surreal quarry
#

wot

#

like % out of 6?

obtuse gale
#

oh wait

#

im confusing myself

surreal quarry
#

or just add a % sign to the end

#

lmao

hot hull
#

@obtuse gale but can you have a completelly custom spawners system on 1.16 fingerguns

old wyvern
#

A percent can be assumed out of 1 ina sense

#

You can divide the value by the max which is 6 in your case

obtuse gale
#

probably

old wyvern
#

If you want it in proper percentage, multiply it by 100

#

probably
?

surreal quarry
#

definitely

#

thats how math works lol

obtuse gale
#

I just want something to have a 1 outta 6 percent chance of happening lol

surreal quarry
#

yea so (x/6)*100 is the percent chance

old wyvern
#

I just want something to have a 1 outta 6 percent chance of happening lol
100 * (1/6) chance of it happening

obtuse gale
#

where x is what? A random from 1-6 or

hot hull
#

or ya know, have a random of 100, then divide 100 by 6

surreal quarry
#

random from 1-6

hot hull
#

And check

#

And it's a 1-6 of hapening

old wyvern
#

In any case,

(A function returning a absolute value) / (Maxima of the function) => range of [0,1] 0 being 0% and 1 being 100%. Any intermediary value can also be converted easily with a simple multiplication by 100

obtuse gale
#

val chance = ((1..6).random()/6)*100

#

like that lol?

old wyvern
#

yea

#

But in this case

#

You really dont need to do all this I guess

surreal quarry
#

then bop a % at the end

obtuse gale
#

then what do i check to see if its passed lol

#

o

surreal quarry
#

then bop a % at the end
in the string where you use the percentage

#

not the math

obtuse gale
#

:what:

surreal quarry
#

just ignore me you have it right lol

old wyvern
#

(1/6) = 0.1666

#

i.e, 16.6%

obtuse gale
#

so then what do i chcek that with

old wyvern
#

Simply call the Math.random() function and check if its below 0.166

surreal quarry
#

you could maybe check if ((1..6).random() == yourotherint)

#

but idk if thats like a good way lol

old wyvern
#

or less than simply (1/6)

obtuse gale
#

if(Math.random() < 16.6){

old wyvern
#

0.166

#

not 16.6

#

range of Math.random() is [0,1]

obtuse gale
#

ah

lavish notch
#

What's intellij's refactor short cut?

hot hull
#

Ctrl + Alt + L

lavish notch
#

cheers

onyx loom
#

i never knew u could have an if inside of a ${} string 🤨

ocean quartz
#

You can, but it's ugly

onyx loom
#

ur ugly

obtuse gale
#

pro gamers write as much code as possible in ${}

onyx loom
ocean quartz
#

I am 😢

hot hull
#

Anyone know if there's a way to get rid of this hologram toggling at the top, kind of annoying (usin holographic displays)

errant geyser
#

Make your own holograms using an armour stand and just set its name, no more flickering fingerguns

obtuse gale
#

yo frcsty is that overlay just incase you get confused what buttons your pressing on your keyboard or what

#

Im more than disappointed with you btw

onyx loom
#

keystrokes mod OMEGALUL

hot hull
#

Yea I cba to disable it

obtuse gale
#

whyd you even get a client or mod or w hatever in the first place

#

im disappointed

onyx loom
#

labymod kapp

hot hull
#

Bruh these settings are from like 3-4 years ago

#

Gimme a break

obtuse gale
#

no

hot hull
onyx loom
#

next hes gonna say why u on a 1.8 client

#

so best get switching version fingerguns

errant geyser
#

Make your own holograms using an armour stand and just set its name, no more flickering fingerguns
@errant geyser ez Frosty

obtuse gale
#

yeah

#

still not better

hot hull
#

@errant geyser ez Frosty
@errant geyser Effort :((

#

Perhaps in the future

errant geyser
#

Its effort but its worth it

#

I'm actually working in this myself rn anyway lol

onyx loom
#

pr or shutup reversed_fingerguns

errant geyser
errant geyser
#

just got to remove the ExpireTime enum and make it a Long passed to HologramData instead

#

There we go, updated

hot hull
#

I mean it's easy to make them, just effort, it's a commission, and it's only the litle flicker thingy so not a priority

lunar cypress
#

Never use any libraries. Write everything from scratch

hot hull
#

Use eclipse

#

That's all you need

lunar cypress
#

Damn

onyx loom
#

dont use kotlin, gradle or intellij

lunar cypress
#

Future development career ruined with this simple trick

prisma wave
#

IDEs are overrated, the compiler will tell you everything you need to know

lunar cypress
#

Never look anything up on the internet

#

If you can't figure it out yourself you're not suited

onyx loom
#

u must open up ur pc and write the 0s and 1s onto the cpu chip itself

surreal quarry
#

binary good everything else bad

onyx loom
#

yup

surreal quarry
#

does anyone know how i can add a discord embed thing when i send a link to my website or is that handled by discord internally

lunar cypress
#

Your website needs certain meta tags for discord to create an embed

#

It uses facebook or twitter ones i think

#

Just look at the source of some website that gets embedded

surreal quarry
#

alr

analog crater
#

Don't write ones and zeros. Solder fixed circuits onto the chips themselves

hollow dragon
#

Is there any way to cancel a DeluxeChatEvent and its corresponding AsyncPlayerChatEvent

hot hull
empty flint
#

@prisma wave how do I add a member to a class that gets initialized in the constructor but not passed via parameters?

#

I have a val in the init {...} block but it doesn't seem to be part of the data class' toString() method

prisma wave
#

yeah because data class only generates based on constructor params

empty flint
#

ah, so I gotta re-write the toString?

#

no

#

wait

#

that member isn't visible anyway

#

how does that work exactly?

#

I am confused mucho

deft patrol
#

Should I use HikariDB to manage MySQL in my spigot plugin? Why would I need a connection pool?

#

I am not too fond of using HikariDB, I still don't know how to set it up properly in Maven. Last time it upped my jar size by 1MB amd it also throws random errors when I get it to work

drowsy widget
#

All of my commands are showing up twice

#

How i can fix this

hot hull
#

Show code Umpa

deft patrol
#

God, this server is confusing, now I see there is #development as well.. what's the difference?

hot hull
#

This is for debate, aimed at the question you had, development is for support

deft patrol
#

Ok

hot hull
#

Not really sure how this is confusing but mk

onyx loom
#

considering one is under the general category, and the other under a support category, its really not confusing

prisma wave
#

@deft patrol Hikari is usually a good idea

deft patrol
#

@hot hull I am new here, try to see all these channels through my eyes. When I first saw them, I was hesitant to comment in any of them cuz I didn't want to get the wrong channel, but I stil did somehow.. yeah, they are under different categories, but their names and their descriptions don't clarify anything. When I saw "support" I thought I'd get support, I think it can't be explained any easier than that. When I see "general" I think of free discussion, not necessarily a channel where I'd ask for support

prisma wave
#

That's correct

#

#development is for support, this channel is for circlejerking discussion

onyx loom
#

for example

#

kotlin

prisma wave
#

Good

onyx loom
#

java

prisma wave
#

BAD

onyx loom
#

thanks great example

prisma wave
#

My pleasure

hot hull
#

@deft patrol Well yes but no, also don't hesitate to ask, we're nice people here (mostly)

onyx loom
#

hey whats the mostly for

hot hull
#

When you mention eclipse, java, and maven in the same message

onyx loom
#

ah, makes sense

hot hull
prisma wave
#

Sx is gone

#

We're 100% nice

#

jk

steel heart
onyx loom
#

very epic

prisma wave
#

You can't

#

In kotlin you could have your companion object extend a class

#

Impossible in Java I'm afraid

hot hull
#

That's why kotlin good, java bad fingerguns

prisma wave
onyx loom
#

why hasnt sx replied to me in kotlinmemes 😭

obtuse gale
#
    trigger:
	    if player has permission "mc.broadcast":
            broadcast "&7• &c OGLOSZENIE &7• %colored arg-2%"


command /bc title <text>:
    trigger:
        if player has permission "mc.broadcast":
            send to all players title "&7• &c OGLOSZENIE &7•" with subtitle "&7%colored arg-2%" for 10 seconds```
#

Can somebody test it?

surreal quarry
#

:puke:

old wyvern
#

Skript.MinusOne

prisma wave
#

consider learning kotlin instead

#

or clojure

surreal quarry
#

kotlin good

prisma wave
#

now that's a good language

surreal quarry
#

i just can;t get behind clojure

prisma wave
#

you can and you will

#

no excuses

old wyvern
#

Consider learning any language

prisma wave
#

no

old wyvern
#

Anything but skript

prisma wave
#

not python

obtuse gale
#

Oh sorry

old wyvern
#

Python is still more useful than skript

obtuse gale
#

command /bc text <text>:
trigger:
if player has permission "mc.broadcast":
broadcast "&7• &c OGLOSZENIE &7• %colored arg-2%"

command /bc title <text>:
trigger:
if player has permission "mc.broadcast":
send to all players title "&7• &c OGLOSZENIE &7•" with subtitle "&7%colored arg-2%" for 10 seconds

old wyvern
#

Way more

obtuse gale
#

Now?

#

It's your opinion

ocean quartz
#

Lol

prisma wave
#

i hate skript even more than I hate java users

obtuse gale
#

This is not for me

prisma wave
#

and that's saying something

obtuse gale
#

I'm not using skript

surreal quarry
#

wot

#

is that not skript

old wyvern
onyx loom
#

i hate skript even more than I hate java users
@prisma wave thats saying something considering the AWFUL incident 😔 💔

ocean quartz
#

What even is that then?

surreal quarry
#

nah it is skript. he is using skript but its for his firend

obtuse gale
#

Yeaj

surreal quarry
#

which is worse. you are an enabler

prisma wave
#

it was truly awful 😭

old wyvern
#

Not a good reason

ocean quartz
#

Oh yikes, man's getting his hands dirty for a friend, that's friendship right there

surreal quarry
#

enabler*

narrow plover
#

does anyone know of a plugin or any other way to get a list of all ip addresses that have ever connected to a server?

prisma wave
onyx loom
#

that sounds sketch

prisma wave
#

a little

narrow plover
#

why? seeing ip's is already part of most anti-alt plugins anyway

#

i just dont want to have to do it one by one until i find the alt im looking for

surreal quarry
#

you probably gotta install it to start logging ips tbh but thats sketch for sure

narrow plover
#

trying to find an alt of a banned player is sketch now?

#

whatever lol

surreal quarry
#

just use litebans or something

#

which has features like that

#

where you don't need to log everyone's ip

narrow plover
#

we already do, but ipban only works if they log in from the same ip

#

change ip and it doesnt do shit

surreal quarry
#

there;s /iphistory or something to view the players ip history

narrow plover
#

yeah i see that too, but that still isnt helpful. i ipban Player A who logs in from IP A, okay great right? except if they use a second account from a vpn, that ipban is pointless

onyx loom
#

then whats a plugin that logs everyones ips gonna do about that?

#

ull never know if its someones alt if theyve never joined the server on that accoount before

narrow plover
#

bc i know the location theyre in, so i wanted to find all the ip's on the server that have logged in from that state from a specific time period so that i can monitor them

surreal quarry
#

also i might be wrong but iirc litebans sorta accounts for that by banning both the username and the ip

narrow plover
#

ipban is only useful if the banned player is too stupid to figure out how to use an alt + vpn

#

but the player im looking for straight up moved houses, so they wont be using a vpn

#

so all the antivpn plugins wont be helpful either

onyx loom
#

and how do u know its gonna be that guy that u have to ban?

#

it could just be someone else in the same city

narrow plover
#

which is why im not going to outright ban the player simply for logging in at the ip and why i said i was going to monitor them

prisma wave
#

you can do something like kotlin class Blah { companion object : OtherClass() { override fun blah } }

#

and therefore kind of force it

#

because you have to override the functions of OtherClass?

#

it's the closest thing you can get

#

although static inheritance is probably a really bad idea

#

yeah

#

could be an interface too ofc

surreal quarry
#

what does companion object do?

#

nvm

prisma wave
#

it's the equivalent of static

#

yeah

surreal quarry
#

just googled lol

prisma wave
#

ask me in future

#

i want xp 🙂

surreal quarry
#

you can give me an example plugin use case if you want lol

#

or just use case in general

prisma wave
#

of companion objects?

surreal quarry
#

yea lol

#

i mean you don't have to but if you want xp

prisma wave
#

normally you use them for class level constants and stuff

#

don't have any specific examples off hand lol

surreal quarry
#

alr lol

prisma wave
#

That's exactly what what what what what what what whq

onyx loom
#

what the fuck are those variable names

#

KnightzYT KnightzYTMeta

prisma wave
#

I'm not proud

#

lol

onyx loom
#

its not even the fact that u didnt know anything

#

its the fucking spacing that pisses me off the most

surreal quarry
#

haha fr

prisma wave
#

Wdym it's great

surreal quarry
prisma wave
#

Eclipse didn't change anything so it must be fine!

surreal quarry
#

were you using notepad as an ide

prisma wave
#

eclipse

#

Ofc

surreal quarry
#

lmao

onyx loom
surreal quarry
#

me too

#

hopefully its on 1.16

onyx loom
surreal quarry
#

lmao this one has like 20 blank lines in between 2 methods

prisma wave
#

it's great

#

I used allman accidentally

surreal quarry
#

honestly im more interested to know if you ever made the staff gui

prisma wave
#

I don't remember but I think i made a really buggy one

#

And then just gave up

onyx loom
#

giving up is not a good mindset!

surreal quarry
#

i think we should find the source and then redo it in kotlin

onyx loom
#

😳

#

im down

surreal quarry
#

make it the new HCCCE

prisma wave
#

good idea

#

With all the shitty spacing too ofc

surreal quarry
#

yea

onyx loom
#

😂

surreal quarry
#

we will make an intellij thing that autoformats it to look like shit

onyx loom
#

that might be hard to get used to, but sure

surreal quarry
#

its gonna be really good code except for the spacing

#

so no one wants to steal it lmao

onyx loom
surreal quarry
#

that looks fine to me

#

very good in fact

onyx loom
prisma wave
#

it is flawless code

#

Absolutely flawless

onyx loom
surreal quarry
#

Lmao

onyx loom
#

and how new were u thonking i swear ur other post was like 2015

#

2 years = "new"

prisma wave
#

good point

#

"really new" = "shit"

surreal quarry
#

i consider myself new

#

it boosts my confidence

#

its nicer than saying "fucking dumbass"

prisma wave
#

"I have a lot to learn" is good

#

It is optimistic

surreal quarry
#

that too

prisma wave
onyx loom
#

damn u got roasted

surreal quarry
#

null value in a constructor

#

gg

onyx loom
#

why he gotta do u like that

prisma wave
#

I've noticed that most of the time new people just completely ignore at least half of the advice they're given

surreal quarry
#

or they just don't understand it

#

at least thats how it was for me lmao

prisma wave
#

Well yeah but rather than asking for an explanation they usually just ignore it

surreal quarry
#

yea

prisma wave
#

it's very weird

surreal quarry
#

cause people dont wanna feel stupid

prisma wave
#

I guess

onyx loom
#

how am i giving u shit rn for this

#

i swear im the biggest dumbass on the planet yet still manage to know more than u at this point

prisma wave
#

you are definitely better than 2017 me

#

Lol

surreal quarry
#

you have no clue how long it took me to learn dependency injection lmao
i struggled for days trying to understand what "an instance of my main class" was

onyx loom
#

private Object plugin 😭

surreal quarry
#

privat

onyx loom
#

shush

prisma wave
#

😔

empty flint
#

Hm something bugs me about the default parameters in a method

prisma wave
#

@surreal quarry the thing is, if you don't have a clear understanding of what an object is, then DI is very confusing

surreal quarry
#

yea

prisma wave
#

@empty flint why?

surreal quarry
#

DI is probably a thing you guys explained to me a whole bunch and i just never understood it for the longest time lmao

onyx loom
empty flint
#

So when you specify a method with method(a: A? = null, b: B? = null, c: C? = null)

onyx loom
#

gonna bookmark this page for the future 😎

empty flint
#

You can call it via method(a, b), but not (a, c) or even (b, c)

prisma wave
#

because there's ambiguity

empty flint
#

where?

#

if A, B and C are distinct classes

surreal quarry
#
method(
  a = a,
  b = b
)```
empty flint
#

why would there be ambiguity

prisma wave
#

if

#

That falls apart when you apply things like subclasses

empty flint
#

that's why I made that example!

prisma wave
#

I see your point

empty flint
#

That falls apart when you apply things like subclasses
@prisma wave How so?

prisma wave
#

But idk it's probably a lot easier that way

empty flint
#

oh no I get it

#

but it bugs me

prisma wave
#

If B is a subclass of A there's ambiguity again, I know you said distinct classes

empty flint
#

it looks ugly

#

why make them default parameters at all then?

prisma wave
#

But it's probably easier to have consistence over a somewhat rare case

#

Why wouldn't you?

empty flint
#

I can do method() and method(a) and method(a, b) and nothing else makes sense

prisma wave
#

You could do method() or method(a) with default parameters

#

That's the point...?

surreal quarry
#

you can even do

method(
  a,
  c = c
)``` if you like it more
prisma wave
#

^

onyx loom
#

?plsnoarrowcode

compact perchBOT
surreal quarry
#

i really like the class name

#

KnightzMCRandomTP

onyx loom
#

its great

prisma wave
#

thanks

#

It's better than Main

#

¯\_(ツ)_/¯