#dev-general

1 messages ยท Page 158 of 1

prisma wave
#

๐Ÿ™‚

ocean quartz
#

@empty flint I can give you in just a sec

#

IJ kinda reset my font settings fuck

hot hull
#

Damn KM

prisma wave
#

isn't it great?

lunar cypress
#

very useful for

#

you guessed it

hot hull
#

sec restarting IJ

prisma wave
#

making brackets rainbow fingerguns

hot hull
#

You disgust me with that white theme Johnny

prisma wave
#

the clojure is hot tho

ocean quartz
#

Which font do you use again BM? I forgot the name

prisma wave
#

Jetbrains Mono

hot hull
ocean quartz
#

Is that the same Sx used? I think i used the same as him hmm

prisma wave
#

Yeah pretty sure it is

ocean quartz
#

It was most bold i think

lunar cypress
#

it's the default intellij one

prisma wave
#

mine isn't that bold

hot hull
#

But it's not actualy rainbow tho :((

prisma wave
#

I used to use Jetbrains Mono Medium

hot hull
#

Also only 5 colors, sad

prisma wave
#

pretty sure you can add more

quiet sierra
#

This is a great guide to being productive

prisma wave
quiet sierra
#

Spend half your time making your IDE rainbow

prisma wave
#

if it looks pretty then it must be productive

surreal quarry
#

how do i get rainbow intellij

prisma wave
#

rainbow brackets plugin is necessary

#

then uhhh

#

a nice theme

quiet sierra
#

then uhhh
Bet this is just for XP

ocean quartz
prisma wave
#

it is

quiet sierra
#

I literally think of xp before I send messages

hot hull
#

Someone should make a plugin to make everything rainbow

prisma wave
#

Im about 300xp away from #4 so I'm trying to write very long and elaborate sentences

hot hull
#

it is

quiet sierra
#

I'm like 300xp away from posting imges

prisma wave
#

@hot hull that small example was a single exception since most of the time I'm using very long sentences ๐Ÿ™‚

hot hull
prisma wave
#

thank you for pointing it out though, you made a very compelling point and I can see that you are attentive enough to notice my brief moment of hypocrisy

lunar cypress
#

making a full rainbow plugin shouldn't be too hard

prisma wave
#

now give me xp

surreal quarry
quiet sierra
#

I am unable to can

hot hull
#

That string color is hidious tho

prisma wave
#

@surreal quarry yes! that is the theme made by GitHub for their Atom Editor (built with electron) that has come to be known as "Atom One Dark"

surreal quarry
#

LMAO

#

anything for xp

#

but thankls

prisma wave
#

I use it in conjunction with / alongside the IntelliJ IDEA plugin known as "Rainbow Brackets" for a very pretty (in my opinion because of course this is all subjective) look in my coding workspace

#

@ocean quartz oh yeah Fira is pretty similar to JB mono

quiet sierra
#

You can extend your phrases by typing in letters the exact same way as you would if you type a full essay.

hot hull
#

If it looks great, it must work great fingerguns

ocean quartz
#

Doesn't seem to have the retina option anymore

prisma wave
#

๐Ÿ˜ฆ

#

a tragic loss

#

257 xp away

quiet sierra
#

Just write really long sentences into your clipboard and then proceed to spam the following key shortcuts: CTRL + C; CTRL + V

prisma wave
#

Java bad, Rust bad, C++ bad, ruby bad, python bad, JavaScript bad, Haskell bad, Fortran bad, PHP bad, assembly bad, Odin absolute horseshit, C bad, Go bad, V bad, Dart bad, Swift bad, Objective-C bad, XML bad, Groovy bad, Scala bad, Clojure bad, Lisp bad, COBOL bad, html bad, typescript bad, yaml bad, coffeescript bad, skript bad, C# bad, skript bad

kotlin good

#

that's gotta do it

#

right?

empty flint
#

Can an interface have an init block in Kotlin?

prisma wave
#

no

surreal quarry
#

Clojure bad

obtuse gale
#

wait

hot hull
#

Clojure bad
sheesh

obtuse gale
#

clojure bad

surreal quarry
#

im surprised

ocean quartz
#

Got it back to retina nice

prisma wave
#

that makes no sense, it's an interface

quiet sierra
#

Kotlin bad VBScript good

prisma wave
#

it can't have a constructor

lunar cypress
#

a tragic loss
257 xp away
You mean: Oh my! A tragedy just came upon me. I am two hundred fifty seven experience points away from reaching redemption in the form of a new level rank

prisma wave
#

@surreal quarry it was an outdated copypasta that does not reflect my current views

surreal quarry
#

Kotlin bad VBScript good
๐Ÿ˜ 

#

ah ok

empty flint
#

that makes no sense, it's an interface
@prisma wave Maybe you got an idea of how to do this then:

obtuse gale
#

Jaims it was an outdated copypasta that does not reflect my current views
excuses excuses

prisma wave
#

You mean: Oh my! A tragedy just came upon me. I am two hundred fifty seven experience points away from reaching redemption in the form of a new level rank
I do! Just to show how much I mean that, I'll copy exactly what you said!
Oh my! A tragedy just came upon me. I am two hundred fifty seven experience points away from reaching redemption in the form of a new level rank

#

Valid excuses

#

times change

lunar cypress
#

People change, people change

surreal quarry
#

blocky i assure you he has an idea. he would love to give you a very long and detailed explanation of it too

empty flint
#
interface Rank : Identifiable {
    val name: String

    init {
        ranks[name] = this
    }

    companion object : Unique<IMPL_Rank, String> {
        private val ranks = mapOf<String, Rank>()

        override fun get(id: String): IMPL_Rank? {

        }
    }
}
#

the init block here is invalid

lunar cypress
quiet sierra
#

Oh my! A huge tragedy just came upon me. I am one hundred and seventy experience points away from reaching redemption in the new form of a new level rank which provides me with permission to send images on other text channels such as this current one.

prisma wave
#
interface Rank : Identifiable {
    val name: String

    init {
        ranks[name] = this
    }

    companion object : Unique<IMPL_Rank, String> {
        private val ranks = mapOf<String, Rank>()

        override fun get(id: String): IMPL_Rank? {

        }
    }
}

@empty flint I see your problem, and just to make sure that I've fully understood it I'm going to quote it

surreal quarry
#

๐Ÿ˜‚

empty flint
#

Oh excuse me the companion object should be:

companion object : Unique<Rank, String> {
private val ranks = mapOf<String, Rank>()

    override fun get(id: String): Rank? {

    }
}
prisma wave
#

Oh excuse me the companion object should be:

companion object : Unique<Rank, String> {
private val ranks = mapOf<String, Rank>()

    override fun get(id: String): Rank? {

    }
}

@empty flint easy mistake to make. as far as I know there's no way of putting a constructor in an interface (it doesn't really make sense anyway)

empty flint
#

@empty flint I see your problem, and just to make sure that I've fully understood it I'm going to quote it
@prisma wave So I want the interface's companion object to keep track of each object that is created

ocean quartz
#

@lunar cypress Damn that brought me back a few years, I remember his Potion Seller video

prisma wave
#

best recommendation would be to use an abstract class instead of an interface

empty flint
#

do abstract classes have init blocks?

#

I suppose they should, right?

prisma wave
#

yes

#

they do have the language feature in the kotlin language that's known as an "init block" because it uses the keyword init along with a section of code known as a "block" enclosed in curly brackets

#

:)

hot hull
#

Damn potions now stack to 16 ๐Ÿ˜ฎ

prisma wave
#

finally

quiet sierra
#

Oh my! A huge tragedy just came upon me. I am one hundred and sixty six experience points away from reaching redemption in the new form of a new level rank which provides me with permission to send images on other text channels such as this current one.

#

Takes forever to get xp

#

Do code blocks count for xp?

prisma wave
#

Oh my! A huge tragedy just came upon me. I am one hundred and sixty six experience points away from reaching redemption in the new form of a new level rank which provides me with permission to send images on other text channels such as this current one.
@quiet sierra

Takes forever to get xp
@quiet sierra
Do code blocks count for xp?
@quiet sierra
I'm sorry to say that I don't know! But I've noticed that the closer you get to something significant, it always takes longer to gain xp, which frankly I find to be very distressing and upsetting

quiet sierra
#

yay for 3 pings

prisma wave
#

:)

#

100xp away for me

quiet sierra
#

Barry is open source

prisma wave
#

no he isn't?

quiet sierra
#

Pretty sure he is

dusky drum
#

rly?

errant geyser
#

He isn't

quiet sierra
#

oof the github repo just has some json files

obtuse gale
#

I forgot the command lol

#

=barry

compact perchBOT
#
Hey, I'm Barry!

I'm a unique Discord bot created especially for HelpChat.

Authors:

I was created and I'm maintained by @pallid gale with support from the Admin team.

Code base:

I'm created in Javascript using Discord.JS

Source code:

At this stage I'm closed source due being a mess and some secret internals. However you can contribute to my links/version knowledge here.

quiet sierra
obtuse gale
#

there we go

dusky drum
#

so it is closed hehe

prisma wave
#

65 xp away from #4

quiet sierra
#

Give me xp daddy

prisma wave
#

this is getting really quite infuriating now! I'm gonna write one final indignant paragraph just to show how frustrated I am!

empty flint
#

I am getting Leaking 'this' in constructor of non-final class Rank warning in IntelliJ when assigning a value to this in the init block. Is there a better way to do this?

#
abstract class Rank : Identifiable {
    abstract val name: String

    init {
        if(ranks.containsKey(name)) {
            throw IllegalArgumentException("A rank with name $name already exists!")
        }
        ranks[name] = this
    }

    companion object : Unique<Rank, String> {
        private val ranks = mutableMapOf<String, Rank>()

        override fun get(id: String): Rank? {
            return ranks[id]
        }
    }
}
#

ranks[name] = this is the culprit

prisma wave
#

HUGE

#

@empty flint you can't really avoid that

ocean quartz
#

How does this look? The class name
kinda feel like it doesn't fit
@hot hull Your cyan was too bright

#

Ooh i found one i like

prisma wave
#

That's quite nice

#

I don't like the inconsistency though

ocean quartz
#

What do you mean inconsistency there? Like red with blue, purple and green?

prisma wave
#

well the sort of Teal for types but then blue for a constructor

ocean quartz
#

True, let me try making the constructor slightly teal too
Though it's normally even worse, since constructor was blue and type yellow

dusky drum
#

where can i change those colors?

hot hull
#

Code style

dusky drum
#

oke

#

need to find where that is

ocean quartz
#

Settings > editor > color scheme

dusky drum
#

nice

ocean quartz
#

@empty flint Still want it?

#

Also question boys, final @NotNull Type or @NotNull final Type? thonking

dusky drum
onyx loom
#

@NotNull final

ocean quartz
#

I like that more too

#

Gasper you should try my font, Fira Code Medium

#

It's thicc

empty flint
#

@empty flint Still want it?
@ocean quartz Yes

#

Give it to me baby

#

Ah-ha! Ah-ha!

#

Give it to me baby

#

Ah-ha! Ah-ha!

ocean quartz
lavish notch
empty flint
#

ty

lavish notch
hot hull
#

Packages Mackenzie ๐Ÿ˜ญ

lavish notch
#

you're welcome frosty

ocean quartz
#

And "Main" ๐Ÿ˜ญ

lavish notch
#

Help me here

#

naming can be sorted later

empty flint
#

paste the config.yml pls

#

might be invalid yml

hot hull
#

plugin.yml as well

#

Well bungee.yml

empty flint
#

since org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 2

ocean quartz
#

Not trying to be mean Mackenzie but what the hell is this? (Main.instance = this).createFiles();

lavish notch
#

Also @hot hull ^ that's the config.yml

tranquil crane
#

that's a work of art is what that is

lavish notch
empty flint
#

hm the config is valid anyhow

hot hull
#

author: Mackenzie Molloy

#

Can you have spaces without a "" ?

tranquil crane
#

yes

empty flint
#

Can you have spaces without a "" ?
@hot hull yes

hot hull
#

Only thing that would actually stand out for the input error

empty flint
#

I think that's legit

#

depends on the yml version prob tho

lavish notch
#

I tried without the fancy characters, and it still had the same error

hot hull
#

Also why Mackenzie :((

public static Main instance;
public static Configuration cg;

lavish notch
#

blame bmsg

hot hull
#

The what now?

lavish notch
#

read comments

hot hull
#

Just start fresh

#

It'll be easier

empty flint
#

@lavish notch did you make sure to save your file with utf-8 encoding?

lavish notch
#

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

dusky drum
#

colors*

hot hull
#

sexy

dusky drum
#

its quite bright

empty flint
#

Save the config.yml file with utf-8 encoding and try again

ocean quartz
#

Would be nicer with a better font ;p

static zealot
#

how do you change colors and font in IIJ?

lavish notch
#

How do I save it with utf-8 encoding in intellij?

dusky drum
#

i havent changed font yet

#

need to decide on one

empty flint
#

No_Permission: '&4&lHelpOp &cยป &fYou do not have permission!' has the utf-8 char ยป

ocean quartz
#

@static zealot Settings > Editor, then you have color scheme and font

dusky drum
#

any recos?

hot hull
#

Comic Sans best font

ocean quartz
#

Fira Code Medium is the best

empty flint
#

How do I save it with utf-8 encoding in intellij?
@lavish notch Google it, idk by heart.

hot hull
#

I'm legit not seeing a difference Matt

static zealot
#

ty matt

empty flint
#

I use SublimeText 3 to edit my yml

ocean quartz
#

What do you mean Frosty?

hot hull
#

Do I have to restart IJ?

empty flint
#

Does this throw a cast exception if the cast fails?

attributes[name] as Attribute<T>? or does it return null because Attribute<T>?

Do I have to use attributes[name] as? Attribute<T>? ?

ocean quartz
#

@hot hull Oh you might be editing the wrong place, there is two places with font, editor and colorscheme font

prisma wave
#

@empty flint it will ClassCastException

dusky drum
hot hull
#

Ah I see, Color Scheme one is taking over for some reason

dusky drum
#

?

hot hull
#

(The font)

dusky drum
#

ARIAL

#

arial?

hot hull
#

no

dusky drum
#

idk

static zealot
#

ok I'm dumb can't even find the settings in IIJ xD

hot hull
#

File > Settings

empty flint
#

@prisma wave Is there a way to get the type parameter name from an unknown?
Attribute<*>?

static zealot
#

ah ctrl alt s

#

oh ty Frosty

empty flint
#

like print the class that * actually has

prisma wave
#

I don't think so

#

Type erasure is a thing you know

empty flint
#

I know ๐Ÿ˜ฆ

static zealot
#

oh man I'm so bad with color schemes

hot hull
#

Quick question boys, how do you set a target jar name with gradle? (As in what the built jar is called)

versed ridge
#

You building with shadowJar?

hot hull
#

Yessir

versed ridge
#
shadowJar {
    archiveFileName = 'FileName.jar'
}
#

That's what I use

hot hull
#

And what do I use for version?

versed ridge
#

wym

hot hull
#

nvm

steel heart
#

when you by mistake shade in spigot

onyx loom
#

how does one shade spigot by accident thonking

prisma wave
#

By being a 4head

steel heart
#

cuz dependency hell

normal talon
#

anyone please

onyx loom
#

whats the issue

#

oh isnt it meant to be spigot-api in the dependencies?

empty flint
#

@prisma wave how do I invoke the super's secondary constructor from the child's secondary constructor?

normal talon
#

oh isnt it meant to be spigot-api?
It isnt building like before, before I had the free ultimate trial on Intellij but now it wont build

onyx loom
#

and whats the error?

#

giving us a build script doesnt really help if we dont know what the issue is

normal talon
#

the issue is also in the paste

onyx loom
#

o

normal talon
onyx loom
#

> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_261 contains a valid JDK installation.

#

do u have the jdk installed and is set on the project?

normal talon
#

idk maybe

#

I have a jdk

runic flume
#

1.16 is weird

#

For some reason its triggering my interact event twice

#

xD

dusky drum
#

first is on click second is on click of isnt it?

runic flume
#

wdym

#

lmao

dusky drum
#

idk

#

maybe

#

since i had same issues

#

its triggering twice on click idk why tho

runic flume
#

on click isn't a thing

tranquil crane
#

interact event triggers for left and right hands separately

runic flume
#

its PlayerInteractEvent

dusky drum
#

ye

runic flume
#

yeah probs Nicole

#

xD

#

gae stuff

dusky drum
#

but when you like click on block its interact stuff right but it still triggers twice

old wyvern
#

Yes, One for each hand

#

It has been that way way before 1.16

runic flume
#

ohh

#

oh

old wyvern
#

What are you on about cod

runic flume
#

well I switched from 1.8 to 1.16

old wyvern
#

Ah

#

I see

dusky drum
#

interesting

runic flume
#

I'm messing around with some stuff for my new server

tranquil crane
#

Represents an event that is called when a player interacts with an object or air, potentially fired once for each hand. The hand can be determined using getHand().

runic flume
#

And i wanted to try 1.16

#

xd

tranquil crane
#

you will find the 1.16 api to be far superior

runic flume
#

in the interact event

#

i used event.getItem()

dusky drum
#

it gives same item both times.

runic flume
#

and not PlayerInventory#getItemInMainHand

dusky drum
#

for me.

runic flume
#

xD

dusky drum
#

idk why it gives same item both times if its for 2 different hands??

errant geyser
#

@empty flint its like

class something(private val example: Example) {
  constructor(whatever: Whatever) : this(whatever)
}```
normal talon
#

> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_261 contains a valid JDK installation.
How do i import new jdk @onyx loom

signal tinsel
#

Hm

#

Trying ACF

#

So far I like it

steel heart
#

aikars command framework?

signal tinsel
#

Ye

steel heart
#

I use luckos

signal tinsel
#

Link

onyx loom
#

matt rn: sadrain

signal tinsel
#

Just a command I wrote to test a bit

#

I really like the conditions system

ocean quartz
#

Nah lol

signal tinsel
#

Matt don care

normal talon
signal tinsel
#

wrong channel

surreal quarry
#

this isn't really a suipport chnanel

#

jesus i can't type lmao

signal tinsel
#

But you only installed the runtime environment

#

Install the jdk

normal talon
#

I installed the JDK

signal tinsel
#

You didn't

#

Obviously

onyx loom
#

oh right yea

normal talon
#

dude I have a freaking jdk installed

onyx loom
#

use the JDK, not the JRE in ur project

signal tinsel
#

That's an option

steel heart
#

you have to specify as well

normal talon
#

howww

steel heart
#

project settings probs

onyx loom
#

file > project settings

surreal quarry
#

isn't it project structure

normal talon
#

it is xd

#

and then ?

onyx loom
#

set the jdk

#

its at the top or smth

normal talon
surreal quarry
#

i think its under Project in your project structure

#

that thing right?

steel heart
#

You might have to specify it to gradle otherwise or smtng

onyx loom
#

yeah

signal tinsel
#

Yeah its there

ocean quartz
normal talon
surreal quarry
#

can you send that again but like not so blurry and zoomed out lol

normal talon
#

its a screenshot tho xd

surreal quarry
#

nvm i opened the link an can sorta see it there

#

probably 14

#

since thats your most up to date one

normal talon
#

it returns to 1.8

#

even tho I switch to 1.8

#

its still the same error

dusky drum
#

jre1.8.0_261

#

check if you have same version

#

or edit project jdk

#

you can specify path and everything

normal talon
#

java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)

prisma wave
#

echo %JAVA_HOME%

#

you probably have it configured to a JRE instead of a JDK

normal talon
#

uh

#

I fixed it

#

so basically I had 1.8.251

#

as A jdk

#

and somehow my 261 got removed

#

so I downloaded it again and now it works fine

runic flume
#

my brain

#

xD

#

didnt know this was a thing

remote goblet
#

ew

#

val spawner = event.blockReplacedState as CreatureSpawner > CreatureSpawner spawner = (CreatureSpawner) event.getBlockReplacedState();

runic flume
#

xD

#

kotlin

#

lmao

prisma wave
#

kotlin good

runic flume
#

what is CraftBlockState

prisma wave
#

the implementation of BlockState

runic flume
#

But how would I get CreatureSpawner then

dusky drum
#

how can i do
Bukkit#getOnlinePlayers#streamtocollectionofnames?

prisma wave
#

Stream#map?

#

@runic flume it's not a spawner

runic flume
#

List<String> collect = Bukkit.getOnlinePlayers().stream().map(HumanEntity::getName).collect(Collectors.toList());

#

What then

prisma wave
#

Idk

#

But you can't cast it because the block isn't a spawner

runic flume
#

oh

#

oooooh

#

I'm dumb

#

XD

dusky drum
#

omg i forgot toList at end.

#

and i was like

#

why da fak its not working

#

return Bukkit.getOnlinePlayers().stream().map{ player -> player.name}.toList()

runic flume
#

bro

#

just copy paste mine

dusky drum
#

why=

runic flume
#

mine will work

#

99% sure

dusky drum
#

so?

#

im on koltin not java

#

kotlin*

onyx loom
#

return Bukkit.getOnlinePlayers().stream().map{ player -> player.name}.toList()
@dusky drum .map { HumanEntity::getName } instead?

#

then the .collect part is redundant in kotlin afaik

runic flume
#

doesnt intellij have an option to convert it to kotlin

prisma wave
#

ah

onyx loom
#

idk im stupid lol

prisma wave
#

kotlin

#

map(HumanEntity::name) iirc

#

also

#

you don't need streams in kotlin

dusky drum
#

so

#

just list#map?

prisma wave
#

yes

dusky drum
#

okay

prisma wave
#
Bukkit.getOnlinePlayers().map { it.name }```
dusky drum
#

what ta frik is it :?

distant sun
#

Default variable name for lambda

dusky drum
#

aha

#

okay

#

i understand it now :3

#

simple

hot hull
#

IT

dusky drum
#

TISTO

hot hull
#

Tiho

distant sun
#

Potato

hot hull
#

I need a good movie to watch

prisma wave
#

kotlin documentary

#

actually

hot hull
#

No

prisma wave
#

๐Ÿ™‚

old wyvern
#

oh god

pastel imp
#

is creating my own perm plugin a good or bad idea?

runic flume
#

just use LuckPerms

pastel imp
#

ik LP exists

#

but that's not what I am asking

dusky drum
#

pretty much bad idea if you ask me since you already have good options for free

errant geyser
#

that ^

steel heart
#

only me? but listening to star wars music while attempting to code is very comfortable and convenient

#

oww

dusky drum
#

Lel

#

i listen to some bassssss music to destroy my brain so i can code

steel heart
#

lol

dusky drum
#

yes yes

#

gotta love that

#

your picture remembers me about that sunguuuuuda member "pupper"

steel heart
#

wth

dusky drum
#

yep

steel heart
#

oh lol

dusky drum
#

its banned

#

dont use it

steel heart
#

why though

dusky drum
#

ask support i guess

prisma wave
#

controversial

steel heart
#

ah remembers me of brianna

#

or what she is called

dusky drum
#

ye

reef maple
#

Hi ! I would like to know how to get a list of the first configurationsection key, like knight and recruit, but not their content. It needs to be done automatically, so i don't put their name inside my code.

recruit:
    display: "&f[&aRECRUIT&f]"
    starting-level: 1
    maximum-level: 10
knight:
    display: "&7[&3KNIGHT&7]"
    required-class-level: 10
    starting-level: 1
    maximum-level: 20
dusky drum
#

use

#

configurationsection

steel heart
#

FileConfiguration#getKeys(false)

dusky drum
#

or ^^

steel heart
#

Seems like that was at top level ๐Ÿคท

dusky drum
#

i wasnt sure :3

steel heart
#

yeah doesn't fileconfiguration inherits configurationsection or smtng anyways

dusky drum
#

idk

steel heart
#

they have one interface in common iirc

dusky drum
#

but it doesnt work for some reason...

steel heart
#

woooo

reef maple
#

thanks guys /o/

steel heart
#

imagine using Listeners

dusky drum
#

?

steel heart
#
        Events.subscribe(PlayerMoveEvent.class).handler(e -> {

        });
#

well its not in the api

dusky drum
#

wtf is this

steel heart
#

a forked version of luckos antiboilerplate

#

or I mean I did fork it cuz dependencies was fucked up

dusky drum
#

hem

steel heart
#

its alg now :p

surreal quarry
#

gasper you're in kotlin, you can use extension functions for events

steel heart
#

^

dusky drum
#

ล P?

surreal quarry
#
@EventHandler
fun EventClass.onEvent() {

}```
dusky drum
#

eh

steel heart
#

thats kinda lit

#

but still @EventHandler

dusky drum
#

eh i'll stay like i am

steel heart
dusky drum
#

running test server on shitti xeon vps with 2.3Ghz clocks

steel heart
#

loll

dusky drum
#

yeh

#

my pc would die if i ran so much shit at once

steel heart
#

well mine would too

dusky drum
#

thats why i have vps with jfrog, and servers

#

when mc server is starting up

steel heart
#

holy s

#

thats a lot of stuff going on

dusky drum
#

not really

#

1 mc, bot, jfrog

steel heart
#

hm

#

I dont use any console

dusky drum
#

=?

#

thats htop

#

i just use screens

steel heart
#

yeah ig

dusky drum
#

i used to have Dedi machine (i7 6700, 64gb ram) running Pterodactyl panel

steel heart
#

I still use my wifi

dusky drum
#

?

steel heart
#

like to host stuff

dusky drum
#

public host?

#

so others can join?=

steel heart
#

uhm no

#

not intentionally

dusky drum
#

idk what you mean by wifi?

#

wireless internet?

steel heart
#

i guess that'd be it

errant geyser
#

or u could use ASF's listener module rather than Lucko's thing Conclure fingerguns

#

pretty hot

steel heart
#

yeah how does that look

errant geyser
dusky drum
#

kinda nice

#

but i'll stick to bukkit stuff

steel heart
#

kotsu good

#

but we should make so ppl dont have to put their plugin instance all the time

errant geyser
#

True

dusky drum
#

well

steel heart
#

else very neat

dusky drum
#

is that possible?

steel heart
#

yes

#

JavaPlugin.getProvidingPlugin(Class<? extends Plugin>)

errant geyser
#

I have no classes that extend plugin tho fingerguns

lunar cypress
#

imagine not using spiglin smh

steel heart
#

whats that

dusky drum
#

some class needs to be plugin?

steel heart
#

read the description

lunar cypress
steel heart
#

oh well if that'd work with java purely I'd probably try it out. not so experienced in kotlin rn

errant geyser
#

I have no classes that extend JavaPlugin tho Conclure

steel heart
#

yes but someone will probably use it in their plugin?

errant geyser
#

But I have to pass a class that extends JavaPlugin

#

And I don't got one

dusky drum
#

how do you then enable the plugiN?

errant geyser
#

its not a plugin?

dusky drum
#

oh

lunar cypress
#

I love that when I look up "lucko antiboilerplate" it gives me results about terrorism and google safe search complains lmao

steel heart
#

no but the thing is like this. we just get a plugin reference from JavaPlugin.getProvidingPlugin and lets say you have a java plugin which you extend the javaplugin class. now you also shade in the lib to the plugin. the plugin will be like a host for each class it is loading.

errant geyser
#

I need to test that

steel heart
#

so idm

errant geyser
#

holy crap

#

Johnny

#

It actually does

dusky drum
#

haha

steel heart
#

johnny oh its actually called helper

#

kotsu I think matt got rid of all the Plugin parameters and switched it to the providing thing

errant geyser
#

What so I can just have a blank "main" class that I don't actually use except for this kinda stuff, and it'll actually become the shading plugin's plugin instance?

steel heart
#

no

#

but we can have a Utils class

lunar cypress
#

nice one

steel heart
#

with a static getter with the name like getHostingPlugin and that would call JavaPlugin.getProvidingPlugin(Utils.class)

errant geyser
#

Oh so like ASF.initialise(this) and use it as a sort of injector for obtaining a JavaPlugin instance?

steel heart
#

and we wouldn't need any injection with the javaplugin

#

yeah johnny I mean I like it although I think there is a bug with some of the dependencies

lunar cypress
errant geyser
#

Add MF, MF-GUI, IAL, ASF here? ๐Ÿ˜‰

steel heart
#

add TaskChain, Commodore, Brigadier

errant geyser
#

Scratch that

#

Remove it all

steel heart
#

lol

errant geyser
#

And just link to kotlin

steel heart
lunar cypress
#

do feel free to make prs

steel heart
#

sure

#

lemme fork

#

can donate a star as well

prisma wave
#

wow

#

im on that

#

honoured

dusky drum
errant geyser
#

mabyeee tomorrow, I'll find my waayyyy to contribute

prisma wave
#

this guy gets a star

errant geyser
#

PDM MLM intensifies

steel heart
#

@lunar cypress what would I categorize projects that essentially has stuff for commands, scheduling and all that stuff?

#

big utility collection

lunar cypress
#

May fit into the framework category after adjusting the description and/or name

#

feel free to rearrange stuff

steel heart
#

sure

ocean quartz
#

Oh nice my command framework is there

dusky drum
static zealot
#

org.bukkit.plugin.InvalidPluginException: Abnormal plugin type now this is a new one xD

#

and already figured it out xD

prisma wave
#

you got a constructor in your main class?

#

lol

static zealot
#

nah

#

for some reason I made it abstract

quiet sierra
#

Who tf makes an abstract plugin

empty flint
#

@prisma wave Can you think of a way to make this a one-liner?

    var modified = "test string"
    pairs.forEach { (f, s) -> modified.replace(f, s) }
    return modified
static zealot
#

dk why haven't worked on this project since last week and I kinda forgot

prisma wave
#

@empty flint not really in any way that won't significantly hinder the readability

#

although that code won't actually work

#

since replace() returns a new string

empty flint
#

Would this work?

fun String.replace(vararg pairs: Pair<String, String>): String {
    var modified = this
    pairs.forEach { (f, s) -> modified = modified.replace(f, s) }
    return modified
}
#

oh no I can't reassign this

#

How about now, @prisma wave

prisma wave
#

yeah still not really

static zealot
#

I think you need a new variable

prisma wave
#

trying to make it a 1 liner would just make it an unreadable mess

static zealot
#

or nah?

lunar cypress
#

How about reduce

#

Or fold or whatever kotlin calls it now

prisma wave
#

might work

lunar cypress
#

replacements.fold(this) { result, (match, replacement) -> result.replace(match, replacement) }

#

Something like this

prisma wave
#

๐Ÿ‘€

empty flint
#

trying to make it a 1 liner would just make it an unreadable mess
@prisma wave I don't need it readable, I need it compact

prisma wave
#

famous last words

empty flint
#

do I have to import a .kt file for the extension methods to work?

#

oh yeah

#

nvm

frail glade
#

Did I miss the party?

#

1.4 is out

quiet sierra
#

I missed the free xp

frail glade
#

@prisma wave

prisma wave
#

woah

frail glade
onyx loom
#

๐Ÿ˜ฎ

#

oh em gee

#

Introduce KotlinNothingValueException and throw it instead of NPE on expressions of type Nothing kotlin stay winning with the 0 NPEs fingerguns

prisma wave
#

huge

frail glade
#

Added another 150Kb oh boy

onyx loom
frail glade
#

I guess it's still really new

#

Yup 6 hours

#

Cause there's no post yet on the website for it nor is there an update in IJ yet.

#

Hopefully in the official update notes they will do a TL;DR of the changes.

prisma wave
#

yeah it looks good but a bit verbose

ocean quartz
#

Happy they added the functional interfaces

empty flint
#

This is more of a generic software architecture question but I'd like to know what the best way to implement this scenario would be:

If I have a class Person and a class Car, a Person can drive many cars and a car can be driven by many drivers. So persons can share the same car instance.

If I wanted to delete a car instance (for example if a person sells a car), every other driver of that car should get notified of that car's deletion, right.

Should I keep a list of Persons that use a car in the car class and before removing any static record of the car tell each person object to remove the car from their lists? How is such a circular dependency usually resolved?

quiet sierra
#

Can a Person drive many cars at once?

steel heart
#

blocky borzan idk but maybe solved with a linkedhashset

#

per car

unreal briar
#

@empty flint not necessarily

#

if the object becomes null you can handle it lazily whenever you need to

#

there's no point in doing calculations for stuff you don't even know if you'll need to access

#

You'd have a list of cars in your person object

#

when the car disappears the car object in that list (or set) will be null

#

you know that null means that value got removed

#

based on how many nulls there are, you know how many cars were removed, etc

empty flint
#

Can a Person drive many cars at once?
@quiet sierra Well obviously not at the same time but they can own multiple cars or whatever

#

when the car disappears the car object in that list (or set) will be null
@unreal briar How do you make the object itself null for every other object that uses it?

steel heart
#

Its possible to implement that yeah

empty flint
#

Say if personA has a set of cars in a list: (car1, car2, car3)
personB is their spouse and doesn't like to drive car2 so their list looks like this (car1, car3)

car1, car2, car3 are 3 instances, so personA's car1 is also personB's car1 instance of Car. Car keeps track of all created cars statically via the companion object.

#

Now personA sells car3. personA can make its list looks like this (car1, car2, null) but personB's list will still look like (car1, car3) and the static list of all cars in the Car companion object will also look like (car1, car2, car3)

steel heart
#

well you would encapsulate a driver in each car

#

making the object mutable

#

kinda

quiet sierra
#

Why does that seem like a school project

#

The backend for that is doable

#

But you should do it yourself

empty flint
#

I'm 25, school was a long time ago. I know it's doable. I'm asking HOW to do it the right way.

#

Why does that seem like a school project
@quiet sierra Because I simplified it so I didn't have to paste the 5 different classes this is actually relevant to in my project. Don't be so condescending...

steel heart
#

blocky I mean

#

when a car switched driver, just get the older driver and remove the car from his list

quiet sierra
#

Maybe have a variable inside Car that points to the driver Person

#

And a Person[] or a List<Person> that are the passengers

steel heart
#

not a normal array

empty flint
#

when a car switched driver, just get the older driver and remove the car from his list
@steel heart Not applicable. Imagine them both doing something with the car at the same time. Like one is cleaning it, the other is checking the tyre pressure or something.

quiet sierra
#

Some sort of collection

steel heart
#

blocky so you want multiple owners at once?

#

/users

empty flint
#

Should I keep a list of Persons that use a car in the car class and before removing any static record of the car tell each person object to remove the car from their lists?
So this is a yes on my initial approach?

#

blocky so you want multiple owners at once?
@steel heart yes

steel heart
#

you either have a set in your car or somesort of multimap and handle everything through one class

empty flint
#

Another approach would be to have personA and personB only keep the serial number for their car. If they want to access a car instance, it has to happen via the serial number. if Car.get(serialNum) results in a null value, then the car has been deleted and they can delete the serial number.

steel heart
#

yh

#

well I mean what is this for ?

quiet sierra
#

Could be a hashcode ๐Ÿค”

empty flint
#

Could be a hashcode ๐Ÿค”
@quiet sierra Doesn't have to be. in my case just a string id.

#

well I mean what is this for ?
@steel heart A parameter implementation that is shared between two classes where each class gets their own value for the same parameter and all the values are kept sorted at all times according to a priority list where the priority is determined by the class the value originated from.

#

So if one class decides to delete its parameter value and no other class uses that value, there is no need to keep an instance of the value-wrapper that points to a null value.

#

thus the fuckery begins

#

I think I will go with the id approach, I like that...

keen creek
#

does anyone know how to delete a world using the multiverse api?

kindred crystal
#

What would be the best way to implement custom messages/languages? My current system's file is way too big and messy, I need something that's really efficient as well because I have tons of messages in my plugin. Also need a way to customize menu items from the config.

steel heart
#

I use enums

#

I can send u mine btw

distant sun
#

md5 paste ??

steel heart
#

had that one on my browser

#

cuz was helping someone there

distant sun
#

still

kindred crystal
#

I use enums right now but it seems like such a pain to write an enum and the config file, I would rather not use enums

steel heart
#

well you have to write the paths or the strings somewhere

kindred crystal
#

couldn't I load it in a hashmap as a key?

#

from the embedded file

#

I have over 200 messages rn ;-;

empty flint
#

What would be the best way to implement custom messages/languages? My current system's file is way too big and messy, I need something that's really efficient as well because I have tons of messages in my plugin. Also need a way to customize menu items from the config.
@kindred crystal Resource Bundles. IntelliJ supports them in a very readable manner and you basically use them like the Enum that @steel heart has defined but it handles all the stuff internally. All you need is a locale to tell it which translations to use.

steel heart
#

archy if you want, although seems unnecessary to me

distant sun
#

imo enums are just fine for messages ๐Ÿคท

kindred crystal
#

I'm gonna look into what @empty flint said because I kinda want to support multiple languages at the same time for different players

ocean quartz
#

After a good amount of head banging, color finally carries over no matter how the format changes

empty flint
#

Can I simplify these 2 methods into one?

fun autoRankup(value: Boolean?) = autoRankup.set(context, value)
fun autoRankup() = autoRankup.get(context)
surreal quarry
#

yes

#

set a default for value

#

value: Boolean? = null

#

then like your method body will be something like

when (value) {
  null -> autoRankup.get(context)
  else -> autoRankup.set(context, value)
}```
distant sun
#

what about if statement xd

surreal quarry
#

if 5 lines, when 4 line

#

unless you do a one liner lol

distant sun
#

๐Ÿ˜‰

empty flint
#

then like your method body will be something like

when (value) {
  null -> autoRankup.get(context)
  else -> autoRankup.set(context, value)
}```

@surreal quarry Ah but then I cannot set the value to null which I need to be able to do...

#

Otherwise I would have to create another method to remove the value, which doesn't help me reduce the methods...

surreal quarry
#

yea probably not then

empty flint
#

Does anybody know of a sortedMap with a custom comaprator?

distant sun
#

Where can I find a class used to create kotlin thonking

#

Looked on github but there's too many files ๐Ÿ˜‚

empty flint
#

Where can I find a class used to create kotlin thonking
@distant sun How do you mean "used to create kotlin"? Convert Java to Kotlin or what?

distant sun
#

Like the base of kotlin

#

It's code

ocean quartz
#

nice, perfect screenshot, only cut a bit of it, gj me

surreal quarry
#

niceee

glad spear
#

neat

keen creek
#

how would i loop through a List<String>?

obtuse gale
#

for(String thing : list){

}

keen creek
#

how would i create the list<string>?
I have an error and im tying to figure out what it is so im just double checking how to do these

hot hull
#

List<String> list = new ArrayList<>();

keen creek
#

ok ill try this now

hot hull
#

Make sure you import both

keen creek
#

done

#

works now thanks, i did the list<string> wrong lol

hot hull
#

UpperCamelCase

quiet depot
#

TIL PortalCreateEvent#getBlocks doesn't include the bottom obsidian blocks thonking

hot hull
#

It's spigot, what u expect

#

What you working on btw ๐Ÿ‘๏ธ๐Ÿ‘„๐Ÿ‘๏ธ

quiet depot
#

one of gian's things

hot hull
#

How do you delete a resource on spigot again?

quiet depot
#

report it to staff

hot hull
#

Ah yes, that dumb thing

errant geyser
#

Seriously you cant delete your own resource?

#

That's just

#

Why

quiet depot
#

it makes perfect sense

#

can't have snowflake developers deleting their widely used resource after they get a "fuck you" from a smooth brain kid

errant geyser
#

That seems like an edge case, but then again we're on about spigot sooo

viscid charm
#

yo how would I get to a level where I can code most level of plugins meaning like essentials orlike minions, or like custom enchants, skyblock, and plugins of such level without causing any lag in the shortest time. I also had a talk with some devs on me showing them a dev who won facebook hackercup (2nd place) and asking if he would be better than most devs. They all said it's more expeirence thing rather than skill what do you guys think?

keen creek
#

I'm trying to generate a new world that's a certain size and guaranteed to have certain structures, example, stronghold and village. I just can't find anything on how to do this

viscid charm
#

Also what do you mean by Snowflake developer @quiet depot ?

quiet depot
#

expeirence thing rather than skill
@viscid charm they're not mutually exclusive, unless for some reason, you're incapable of learning from your experience. Once you get to a certain point skill wise, you can make absolutely anything (in that language), regardless of whether you've worked with the specific api, field, or whatever before. Takes quite a while though, lots of dedication

viscid charm
#

Basically like a snowflake which melts under pressure is what I always thought Snowflake meant

quiet depot
#

yeah nah

viscid charm
#

but some people think snowflakes think they are special because a snowflake is never teh same

quiet depot
#

a snowflake is extremely sensitive, melts at the touch

#

at least I assume, i've never seen a real snowflake lol

viscid charm
#

so if your super thick skin your never a snowflake?

quiet depot
#

so by saying a person is a snowflake, it's saying they're the weakest possible form of a human

#

mentally*

viscid charm
#

Weakest in terms of what tho? Like being lazy or

quiet depot
#

well, read the definition

#

they get offended by everything

obtuse gale
#

isnt it just like, someone says ur codes bad and you get offended by it

viscid charm
#

thats a lot of devs ^

#

I buy plugins from a l oto f diff ones

quiet depot
#

yes, they could be considered snowflakes

viscid charm
#

and if you say that, they wont code you anything even if you pay them good

#

@quiet depot how long you think it will take me learn it so I can technically make anything with easy/no help in short time without looking shit up? (How long does it take for most people?)

quiet depot
#

never

#

what you describe is impossible

#

everyone looks things up

dusky drum
#

^^^^

viscid charm
#

Medium sized plugins is what I meant

dusky drum
#

you still might find something that you'll have to look up

quiet depot
#

actually I think I was mistaken in my original statement

#

technically you could get to that level in a relatively short amount of time

#

the key difference is quality of code

dusky drum
#

^^

quiet depot
#

you could easily get to the point of creating anything, within a few months

viscid charm
#

hmm one of my devs when he gets the time to code me a plugin, he sometimes does it live in front of me, he doesn't look anything up tho. They are not huge plugins but its not like right click heal item

#

Within Few months? hmm I see

#

What about like NO Lag but Dogshit Quality code is that possible?

quiet depot
#

no

#

quality and lag are linked to each other

dusky drum
#

ah i just remembered still have to find good sql storage solution, now i just send remove/insert statements for each block broken/placed so if someone breaks 1 block 10000 times its gonna send 10000 statements (i update data every 5 mins). so im not sure if sending 10k statements is good.

#

im not realy the best with logic stuff

old wyvern
#

Is not

hot hull
#

Did someone say snow theotherpig

dusky drum
#

yes

viscid charm
#

@quiet depot can I ever become better then some of my devs who have been coding for 5 years?

quiet depot
#

yes

viscid charm
#

Cus they will obviously keep coding, so wouldnt they always be better/

quiet depot
#

some people never attempt to improve

#

I've encountered quite a few of them

#

some are even oblivious

dusky drum
#
fun addCrop(crop: CropData, location: CropLocation){
        if(crops[location.toString()] == null){
            updated.add(UpdateData(crop, location, false))
            crops[location.toString()] = crop
        }
    }

    fun removeCrop(location: CropLocation){
        val crop = crops[location.toString()]
        if(crop != null) {
            updated.add(UpdateData(crop, location, true))
            crops.remove(location.toString())
        }
    }

basicly then i go thru list of updated and make sql statement for each updated entry.

viscid charm
#

You code outside MC ^?

quiet depot
#

ye

viscid charm
#

oh wat do u code?

quiet depot
#

Is not
@old wyvern y not?

keen creek
#

I'm trying to generate a new world that's a certain size and guaranteed to have certain structures, example, stronghold and village. I just can't find anything on how to do this

quiet depot
old wyvern
#

10000 statements together

quiet depot
#

o

old wyvern
#

๐Ÿคทโ€โ™‚๏ธ

#

Batch them if thats the last choice

quiet depot
#

didn't know u were replying to gasper

dusky drum
#

XDDD

old wyvern
#

Ah

#

xD

dusky drum
#

i could make like check or something so it deleted previus entires or something, bu i have no idea how

#

my brain just doesnt have power to think how to.

quiet depot
#

oh wat do u code?
@viscid charm i dabble in lots of genres

#

games, web, desktop, server, api

#

server & api are probs my favourite

dusky drum
#

interesting

viscid charm
#

@quiet depot do you do it as a job or hobby ?

#

Quick question does System.out <- what is the dot doing?

#

Is it just searching 1 class, then the dot searchs for a class inside that class?

quiet depot
#

I do it as both

#

System is a class, out is a field (holding an instance of PrintStream iirc)

prisma wave
#

^

quiet depot
#

@viscid charm

viscid charm
#

But i mean like what does the . <- mean

#

the dot itself what does it mean

#

does the dot mean like GO inside?

prisma wave
#

. Means to access a property inside the thing on the left

viscid charm
#

basically access ANYTHING INSIDE the thing on the left?

#

or only a property?

quiet depot
#

just properties, not everything in a class is retained at runtime

#

properties = fields, methods, subclasses

viscid charm
#

But you can also classes

#

Ok

dusky drum
#

class inside class?

quiet depot
#

yes

viscid charm
#

yea thats a subclass i think

quiet depot
#

they're actually called inner classes in java iirc

#

probably should've used that terminology before

dusky drum
#

oh

#

so nested classes?

quiet depot
#

oh maybe it's called that

#

i should probs just search it

viscid charm
#

no its called super and sub with Java

#

I wathced in tutorial

prisma wave
#

Those are different

quiet depot
#

disregard anything you see in tutorials freshpeppermint

#

they're all bad

dusky drum
quiet depot
#

nested it is!

dusky drum
#

java page says nested

prisma wave
#

Superclass and subclass refers to a hierarchy

viscid charm
#

^

quiet depot
#

hold up

#

gasper

#

read the actual content

#

we were both right

dusky drum
#

yes

#

we were

viscid charm
#

Wait so what are fields btw?

#

the shit in the brackets?

quiet depot
#

class level variables

viscid charm
#

hello(String hi)

quiet depot
#

that's a parameter (still a variable, but not a field)

viscid charm
#

isnt that a method?

dusky drum
#

i love how minecraft names air in caves CAVE_AIR

quiet depot
#

well hello is a method, but the bit inside the paranthesis is a parameter

viscid charm
#

what owuld be example of field then?

quiet depot
#
public final class HelloWorld {
  private static final String MESSAGE = "Hello World!";
}```
#

this is a field

viscid charm
#

what is field?

quiet depot
#

it's also a constant

viscid charm
#

thats a method tho right?

quiet depot
#

MESSAGE is the name of the field

#

it's not a method

viscid charm
#

ISNT MESSAGE Name of the varirable?

quiet depot
#

fields are class level variables

viscid charm
#

wat does it mean by class level?

quiet depot
#

java has different scopes (levels)

#

for example:

#
public final class HelloWorld {
  private static final String MESSAGE = "Hello World!";

  public static void main(String[] args) {
    final String MESSAGE = "Hello Local World!";
    System.out.println(MESSAGE);
  }
}```
#

see there's two variables there, both called MESSAGE

#

the first is a class level variable (a field)

viscid charm
#

yea

quiet depot
#

the second is merely a variable inside the method

#

the variable declared in the method is the local scope

#

it only exists inside that method

viscid charm
#

yea

quiet depot
#

the first MESSAGE variable exists in the entire class

#

so, it's class level

viscid charm
#

so if we run that method in that class

#

what would happen

#

errors?

quiet depot
#

no

#

it'd print Hello Local World!

#

local & class variables can have the same names

viscid charm
#

but it will always pick local one

quiet depot
#

it would, in that case

dusky drum
#

yes i managed to drop from 10k statements to just 2 statements finally!!!!!!!!!!

viscid charm
#

unless you specify (super)

quiet depot
#

no

obtuse gale
#

If I wanted to replace everything thats not inbetween two : : with nothing, would I use regex for that or?

viscid charm
#

right?

quiet depot
#

no

#

to reference the top MESSAGE in that case, you'd do

#
System.out.println(HelloWorld.MESSAGE);```
viscid charm
#

AH so

#

YOU CAN call classes oUtside of classes?

quiet depot
#

?

#

we're not outside of a class

#

you can't exit a class in java, everything is bound to them

viscid charm
#
public final class HelloWorld {
  private static final String MESSAGE = "Hello World!";

  public static void main(String[] args) {
    final String MESSAGE = "Hello Local World!";
    System.out.println(HelloWorld .MESSAGE); <- Your calling the class above the main one.
  }
}```
quiet depot
#

main is not a class

#

it's a function

viscid charm
#

Ok wahts a method then btw?

obtuse gale
#

method = function

viscid charm
#

I thoguht it was method I juts forgot its not a class and a method

quiet depot
#

a method is a function, that's bound to an instance

#

no aj, they're not the same

obtuse gale
#

o

quiet depot
#

in java, methods and functions are differentiated by the static keyword

#

if it has static infront of it, it's a function

viscid charm
#

Method is like GENERAL? Function is more specific?

quiet depot
#

other way round

#

function is general, method is specific

viscid charm
#

Oh

#

so its correct to call methods function but not the other way around

#

What's difference between static and non static tho?

quiet depot
#

static means the property is not bound to an instance of that class

viscid charm
#

Wait wait wat do u mean by bound to an instance

#

what do u mean by instance?

quiet depot
#

Ok, so pretend "instances", have ids

#

i'll explain what an instance is in a sec

#

everytime you contruct an instance of a class, it has a unique id

#

instances are constructed via the new keyword in java

#

so, propose this:

viscid charm
#

OH yea so new is an instance right?

quiet depot
#
public final class CoolObject {
  private final String test;

  public CoolObject(String test) {
    this.test = test;
  }
}```
viscid charm
#

whats the instance in taht ^?

quiet depot
#

you can then construct an instance of CoolObject, via new CoolObject("a string");

#

you now have an instance of the CoolObject class, which stores a string

#

in this case, the string is "a string"

#

the id of this object, is 1

viscid charm
#

how do u know its 1?

quiet depot
#

we now construct the same object again, with another string

viscid charm
#

u make that up or is that how it works?

quiet depot
#

just making it up for now

#

just pretend

#

we now make another instance

obtuse gale
#

Can I invert a regex selection?

quiet depot
#

new CoolObject("another string");

#

the id of this one is 2

obtuse gale
#

cos ive got this :\w+: and I wanna replace everythinig that isnt selected with ""

quiet depot
#

now, one more

#

new CoolObject("a string");

#

what do you think the id of this object is?

#

@viscid charm

viscid charm
#

1

quiet depot
#

no

#

it's 3

viscid charm
#

WAIT

#

new CoolObject("a string");

#

that us aid above

quiet depot
#

yep

viscid charm
#

its the same shit

quiet depot
#

they contain the same string, but they're different instances

#

and therefore, have different ids

#

that's one of the key principles you need to know

viscid charm
#

Oh

#

Hmm Ok

quiet depot
#

even though their content is "the same", they're different

#

so now, with that in mind

#

I can explain methods

#

methods, interact with the instance itself

#

for example, like this:

#
public final class CoolObject {
  private String test;

  public CoolObject(String test) {
    this.test = test;
  }

  public void setTest(String test) {
    this.test = test;  
  }
}```
#

so, propose we do

#

CoolObject obj = new CoolObject("test");, and it's id is 1, then obj.setTest("test2");

viscid charm
#

wait doesnt eveery method need a return type?