#dev-general

1 messages ยท Page 102 of 1

topaz bay
#

You should never hard code the path separator, if you want to use one, use the constant in File

obtuse gale
#

alright

topaz bay
#

file.readText()

#

You dont need to make a file reader, and you definitely dont need to make a json reader

#

Im pretty sure we told you this already

obtuse gale
#

lol I feel like you did

#

alrighty

topaz bay
#

use resolve

#

this is kotlin

#

and dont pass around JavaPlugin

#

Use Plugin

obtuse gale
#

._.

#

BM told me to..........

topaz bay
#

and you dont need to pass in the datafolder, get that from plugin

distant sun
#

Why are your param name tooltip thing so ugly

topaz bay
#

you also dont need to pass around world container

#

you can get that from Server

#

plugin.server.worldContainer

obtuse gale
#

I thought i was meant to minimise my use of plugin

#

._.;

heady birch
#

Moral?

#

Dont pass anything

#

Use ServicesManager

topaz bay
#

JavaPlugin implements Plugin

heady birch
#

Ok WHY is this not wokring

topaz bay
#

You are making an even tighter coupling by using JavaPlugin

obtuse gale
#

alright

heady birch
#
private void checkAnimationListenerAlreadyRegistered() {
        Listener previousListener = null;
        for (final RegisteredListener registeredListener : PlayerQuitEvent.getHandlerList().getRegisteredListeners()) {
            System.out.println(registeredListener.getListener().toString());
            if (AnimationListener.class.isAssignableFrom(registeredListener.getListener().getClass())) {
                System.out.println("MATCHED");
                previousListener = registeredListener.getListener();
            }
        }

        if (previousListener != null) {
            System.out.println("UNREGISTEREING " + previousListener.toString());
            HandlerList.unregisterAll(previousListener);
        }
    }
#

what am i doing

#

stupid

obtuse gale
topaz bay
#

@heady birch ummm

heady birch
#

WHAT

#

dont

#

Idk what I was thinking

#

instanceof lmao

topaz bay
#

What are you even trying to do here?

heady birch
#

Check if my listener is registered

#

If it is I unregister it

topaz bay
#

Why would you just not keep track of your registrations?

heady birch
#

Still dont F ing work

#

I ant

#

Papi expansion

#

I cant store it anyway if you see what I mean

topaz bay
#

I dont

heady birch
#

Go on then

#

if (registeredListener.getListener() instanceof AnimationListener) {

#

This dont even work

#

net.kitesoftware.animations.expansion.AnimationListener@548c98e5

#

Clearly the same type

#

@topaz bay what do you suggest

topaz bay
#

tracking your listeners properly

heady birch
#

I cant store an instance of it

topaz bay
#

why?

heady birch
#

If papi loads my class

#

Even static it doesnt work

topaz bay
#

Probably because its not the same class

heady birch
#

๐Ÿ˜ 

#

.... Exactly

#

So I cant track my listeners properly?

#

You know what

#

Ill just keep creating listeners

#

Server owners can F off

topaz bay
#

youre probably over complicating this

heady birch
#

You know what I'll just leave the cache

#

Wait?

#

Bukkit hsa Guava

#

?

distant sun
#
    // register new listener
}```
heady birch
#

๐Ÿ˜ฎ

#

Lmao

distant sun
#

Yes it does

heady birch
#

I can just use that

#

@topaz bay Dumb

topaz bay
#

?

distant sun
#

Nothing new

heady birch
#

Ceo of memory leaks

onyx loom
#

ceo of everything

#

๐Ÿ™„

distant sun
#

But esp of memory leaks

heady birch
#

I dont wanna use cacheloader

distant sun
#

Cache

heady birch
#

I will need my own BukkitPlayerAnimationServiceProvidingCacheLoader

obtuse gale
#

ThatsALongWord

heady birch
#

CALLABLE

heady birch
#

@topaz bay You know you shouldnt store Player in a map?

#

What about in a Guava cache

#

Also using a weak reference for a player wouldnt work would it?

hot hull
heady birch
#

Looks decent

prisma wave
#

Bit outdated

heady birch
#

net.kitesoftware.animations.expansion.AnimationListenerIs not an instance of: net.kitesoftware.animations.expansion.AnimationListener

#

.....

#

im done

#

done

#

Looks like it is to me

#
if (registeredListener.getListener() instanceof AnimationListener) {
    previousListener = registeredListener.getListener();
} else {       System.out.println(registeredListener.getListener().getClass().getName() + "" + "Is not an instance of: " + AnimationListener.class.getName());
}
#

Tell me thats wrong

prisma wave
#

Try Class#isAssignableFrom

heady birch
#

already did

#

both ways round

prisma wave
#

or print out Class#toString rather than getName

heady birch
#

and isInstance

#

Class.toString or the boject.toString?

#

Dickhead me

prisma wave
#

Uh

heady birch
#

I know what it is

#

There different classes

prisma wave
#

like AnimationListener.class

#

yeah

#

I was thinking that

#

toString should show a hashCode or something

heady birch
#

๐Ÿ˜ฆ

#

Cos papi reloads the expansion

#

He kept telling me to "keep track of my listeners"

#

Lol..

#

who else is gonna register an AnimationListener?

#

hopefully no one.. I'll just unregister anything that contains that in its name

#

PAPI 3 better have an unregister() method

#

the event is deprecated

onyx loom
#

papi 3 will never happen ๐Ÿ˜ข

pallid gale
#

soonโ„ข๏ธ

onyx loom
heady birch
#

Lol

#

Might just replace the HandlerList with my own one telling other plugins to go away

topaz bay
#

boom

hot hull
#

eh what

topaz bay
#

proper fully functioning string interpolation

hot hull
#

yea but where are you getting the 15 from?

topaz bay
#

add(number, 5)

heady birch
#

CEO of script njection

hot hull
#

oh I didn't even see that

heady birch
#

Enter your username: "${db.deleteAllUsers()}"

topaz bay
#

=paste

compact perchBOT
#
HelpChat Paste

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

topaz bay
#

spooky

heady birch
#

Poor

#

Arrow code

topaz bay
#

Not really

#

Thats the size of tabs youre seeing on the paste

#

The only thing that can really be inverted is the break on check in the while loop

prisma wave
#

@topaz bay very nice

topaz bay
#

oop

#

just found out my lexer doesnt support escaped quotes

#

๐Ÿ™ƒ

prisma wave
#

smh

#

imagine

#

ugh

#

why does intellij do this

distant sun
#

Its a sign

prisma wave
#

not there

topaz bay
#

and now, it does.

#

And it also supports interpolating INSIDE an interpolation

prisma wave
#

oh dear

heady birch
#

I can draw 100mb worth of shapefile in that time ๐Ÿ˜„

prisma wave
#

that sounds evil

topaz bay
#

The time is 1 second because it had to wait for me to type 45

#

you 4head

#

LOL

heady birch
#
Render time for: UK Water = 3
Render time for: UK Roads = 8
Render time for: World = 7
Render time for: UK Counties = 11
Total Render time: 29
#

Do you want to know the secret

topaz bay
heady birch
#

good job

prisma wave
#

slow

#

bad language :)

topaz bay
#

LOL

heady birch
#

Can you explain traits to me?

#

Are they like interfaces with default methods

prisma wave
#

they're like interfaces kind of

heady birch
#

Cos- that would be useful

#

So like...

#

Cancellable

topaz bay
#

odin has traits

#

smile

heady birch
#

could actually contain the logic behind setCancelled

prisma wave
#

help

#

why won't intellij run any classes

#

it can't even run unit tests

heady birch
#

did you press the "run" button

prisma wave
#

yes

heady birch
#

ok press it again

prisma wave
#

it's either class not found or not tests found

#

i did ๐Ÿ˜ฆ

heady birch
#

hello its me microsoft support

#

before we start, your bank detail so i can confirm it is indeed you

prisma wave
#

ok

#

my card number is 1278 1724 7583 1002

heady birch
#

๐Ÿ˜ฌ

prisma wave
#

praise the lord

#

it started working again

#

thank you microsoft support!

#

i will pay $80193

#

as I was saying

heady birch
#

๐Ÿ‡ฎ๐Ÿ‡ณ

prisma wave
topaz bay
#

How is that slow?

#

I mean, I guess it depends on what the input was?

prisma wave
#
print = value::Any -> _ {
    stdout.println(value)
}
print("Hello World")
#

4 lines

#

frigga is very speedy

#

She's an old woman who needs time to warm up

signal tinsel
#

I'm deadass tempted to build my own Redis server implementation

prisma wave
#

Why tho

signal tinsel
#

2 reasons

#
  1. I wanna learn more about Redis and shit like that
#
  1. I'm fucking bored
topaz bay
#

Ive done that

signal tinsel
#

I wanna build my own Cache implementation

#

Similar to guavas

heady birch
#

I was reading a technical spec and its from 1998

obtuse gale
#

kotlin people

#

dumb question here

#

nvm lol

#

I worked out dumb question

#

(๐Ÿคž)

prisma wave
#

Man you really got my hopes up there

#

I love dumb questions

#

They're free XP

obtuse gale
#

I worked it out but if you wanna answer it, it was how do i put like "defau;t" values in a mpa

topaz bay
#

Look at this little shit

#

sneaking its way into my parser

#

How dare he

prisma wave
#

a +?

#

smh

topaz bay
#

Who tf does he think he is

prisma wave
#

@obtuse gale kotlin actually has Map.withDefault or something

#

but it's a questionable implementation

topaz bay
#

ez

#

He just needed a little help being constrained

#

poor thing

#

=paste

compact perchBOT
#
HelpChat Paste

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

topaz bay
#

program trace ^

heady birch
#

for (int i = 10; i > 0; i--) {
final int i2 = i;
}

topaz bay
#

[] is the current stack

heady birch
#

its the final countdown hahahaha

prisma wave
#

SHUT UP

#

that was awful

heady birch
#

NiallLib has this really cool concept

signal tinsel
#

What?

heady birch
#

Every object is wrapped in N

signal tinsel
#

?

heady birch
#

N is very useful

signal tinsel
#

What's n

#

Lmao

heady birch
#

new N("Hello");

#

N can be anything

#

you make all your N's public

#

They have their own getters and setters

topaz bay
#

Imagine having to use new

heady birch
#

new MyClass().propertyOne.set()

#

N.of()

#

N is powerful

#

add propertly lsiteners and stuff

signal tinsel
#

What

heady birch
#

Bindings to another N

signal tinsel
#

What the fuck

#

Explain lmao

#

Or give examplse

heady birch
#

n.bind(otherN)

hot hull
heady birch
#
 N<String> myN = N.of("String 1");
 myN.set("New value!");
 myN.friend(N.of(":)"));
signal tinsel
#

What does friend do

heady birch
#

makes them friends

signal tinsel
#

....

heady birch
#

Pair<> alternative

signal tinsel
#

What does pair do

heady birch
#

Neat am I right?

signal tinsel
#

What does that do

topaz bay
#

This is literally FP

#

lol

signal tinsel
#

Idk

#

My brain rn

#

Anyway I gotta go to work

#

And I still have to wake up

heady birch
#

This is literally FP
@topaz bay FP?

#

oh

#

functional

topaz bay
#

damn thats hot

hot hull
#

nice

frigid badge
#

is it really hot though

topaz bay
#

Yes

#

Yes it is

topaz bay
#

@frigid badge wheres your language?

#

๐Ÿ‘€

frigid badge
#

nah it's nice

#

I've made one before

topaz bay
#

Lets see it then

frigid badge
#

I don't think it's on this pc to be honest

topaz bay
#

mmmm

#

Shame

frigid badge
#

and it's garbage

#

even made in a garbage language

#

I don't want to say it's name

prisma wave
#

Does it start with a P

frigid badge
#

it has a p that says enough

prisma wave
#

Oh dear

frigid badge
#

I called the lang Jaquar though

#

but eh

#

y'all flexing with that language

#

I'm flexing with the kernel

topaz bay
#

totally forgot I could just do that

topaz bay
#

You ever just...

#

๐Ÿ™ƒ

#

I have 0 idea how I want to resolve this

#

Cause like... yeah... thats working right

prisma wave
#

what's bar?

#

A String?

#

just handle string concatenation right smh

topaz bay
#

It is handling it correctly

#

xD

#

I would have to somehow unravel this expression

#

Oh you know what

#

I have an idea

prisma wave
#

If it's handled correctly why does it print out as an array

#

Checkmate liberals

topaz bay
#

Currently, when used in an expression, the look prepends a head marker command

#

and then appends a tail marker command

#

when the tail is hit, it walks up the stack until it hits the head

#

And adds all the values in between to a list, and then pushes that onto the stack

#

which is why its concatenating as a list

#

I think

#

I THINK

#

This is an opportunity for me

#

to add a 3rd pass

prisma wave
#

Imagine not knowing how your code works

topaz bay
#

No...

#

The I think was a new sentence

#

I know exactly how the head and tail walker works

#

I think I can add a 3rd pass that will detect that head and tail, and then modify the loop expression to include the left side of the operand inside the expression

#

to change this

bar += loop (cur++ <= barLength) {
    => "="
}

into this

loop (cur++ <= barLength) {
  bar += "="
}
prisma wave
#

Surely that second example would work anyway?

topaz bay
#

?

#

Ofc it does, that was the original code

#

Im attempting to add the first thing

#

Since a loop statement is the only construct that cannot be resolved as an expression

prisma wave
#

Oh I see

#

You're doing clever stuff

topaz bay
#

You asked for gimmicks

#

Im giving them to you

prisma wave
#

Thank you

#

I appreciate it

#

On a somewhat related note... Could function multiplication replace a for loop?

#

I guess the lack of an exit condition could make it problematic

topaz bay
#

That would probably be nutty

prisma wave
#

Does that mean good

#

Or bad

#

Nobody uses that word here

#

I think it's good

topaz bay
#

here we go

prisma wave
#

Yikes

topaz bay
#

so. fucking. close.

prisma wave
#

insert something motivational here

#

just subtract 1

#

easy

onyx loom
#

just like

#

be in bounds

prisma wave
#

so inspiring

onyx loom
#

ty

topaz bay
#

oh

#

my god

#

I've done it

prisma wave
#

๐Ÿ‘

#

now break it

topaz bay
#

YEEEESSSS

#

NO MORE LIST

#

IM A GOD

prisma wave
#

what happens if it's without a =>

topaz bay
#

It wont compile

#

The final statement on an expression loop has to be a stack push

#

(which is a reused return statement)

#

not a very pretty exception, but yeah

prisma wave
#

so is <= a thing?

#

to stack pull

topaz bay
#

no

prisma wave
#

๐Ÿ˜ฆ

topaz bay
#

It can though

prisma wave
#

direct access to the stack sounds kinda dangerous

#

if a function just pulled something it could disrupt a lot of things

topaz bay
prisma wave
#

hm

#

it would kinda be like a memory leak

#

but not exactly

#

say if a function pushed 10 things but didn't remove them

#

unless you've got scoping

topaz bay
#

There is scoping

#

But not on the stack

#

LMFAO

prisma wave
#

wow

#

very nice

topaz bay
#

it also works properly when its numbers

prisma wave
#

not bad

#

not bad at all

topaz bay
#

Who doesnt love a good gimmick!??!!

prisma wave
#

that's not entirely a gimmick

topaz bay
#

It is VERY gimmicky

prisma wave
#

it's like reduce but declarative

topaz bay
#

Its syntax sugar

prisma wave
#

true

#

but still

#

expression everything

topaz bay
#

ooo just found a bug in the string interpolation

prisma wave
#

tell me more

topaz bay
#

Its extending beyond its bounds

#

attempting to parse hello as a property

prisma wave
#

unacceptable

topaz bay
#

Very much so my diamond

prisma wave
#

๐Ÿค”

topaz bay
prisma wave
#

Ha

topaz bay
#

Fucking bot

#

On what PLANET

#

Is that an expression

prisma wave
#

I guess it's parsing as a property reference or something

topaz bay
#

...

#

LOL

prisma wave
#

What

#

That's not an unreasonable theory

#

And it makes sense

topaz bay
#

Well that part where its trying to find hello, obviously yeah

prisma wave
#

Although kinda stating the obvious...

topaz bay
#

But the interpolation resolution is completely separate from parsing

prisma wave
#

Apparently not

topaz bay
#

It literally is

#

Its basically a string utility

#

fixed it

#

This check was inside the wrong scope

#

It was only breaking if there were more matches of the interpolation marker

#

interesting

signal tinsel
#

Whose lang is dat

old wyvern
#

sxt

signal tinsel
#

Sicc

prisma wave
#

it sucks

#

frigga is better

signal tinsel
#

Ew kotlin

ocean quartz
#

Get out

prisma wave
#

alright you've crossed the line

signal tinsel
#

Lmao

onyx loom
#

yeah wtf bro ๐Ÿ˜ 

distant sun
#

Ew kotlin
@signal tinsel PlusOne

#

tbh id use kotlin only for some of it spicy functions, such as Extensions and string interpolation ๐Ÿ˜

onyx loom
#

u should use it anyway

#

idiot

signal tinsel
#

?

onyx loom
#

๐Ÿ™‚

distant sun
#

what did you said b1tch

signal tinsel
#

Extensions?

onyx loom
#

U HEARD ME

distant sun
#

add methods to classes that aren't yours, Maffie (might be more than that)

prisma wave
#

extension functions

#

heavenly

distant sun
#

does kotlin compile to java?

prisma wave
#
fun String.color() : String {
  return ChatColor.translateAlternateColorCodes('&', this)
}

"&cHello".color()``` is a simple example
#

sometimes

#

it can compile to .class files, or javascript, or native code

distant sun
#

I wonder how extensions looks in java

onyx loom
#

disgusting?

distant sun
#

Also, do you have to register it somewhere or just write it?

topaz bay
#

its just a normal method

#

it takes the receiver as the first parameter

signal tinsel
#

Shit thats real nice

prisma wave
#

extensions compile to static methods

distant sun
#

I thought it's more than that Sx

prisma wave
#

and no you don't have to register it, but you have to import it sometimes

topaz bay
#

its literally not

#

Its not magic

#

lol

distant sun
#

nice

#

stfu

prisma wave
#

it's kinda magic

distant sun
#

let me dream

prisma wave
#

it feels like magic

distant sun
#

and think kotlin it's nice

#

SMILE

#

b!tch

heady birch
#

I still use java for the complicated because im a little more confident

topaz bay
#

gross

remote goblet
#

i should learn kotlin

prisma wave
#

Good idea

remote goblet
#

intelliJ now tells you when to turn stuff to final

errant geyser
#

Ori

#

I know your a n00b and all

#

But it's been doing that for as long as I can remember

remote goblet
#

i've never had it do that

errant geyser
#

:feelsbad:

remote goblet
#

i think its an intelliJ ultimate thing

#

and its only now in community thinkDerp

#

but not sure

#

i'm dumb

errant geyser
#

It was there for me on community edition iirc

heady birch
#

enable final on local variable detection

topaz bay
#

@prisma wave Can you believe I still haven't added comments

prisma wave
#

neither have I

#

so yes

#

you don't really think about them

topaz bay
#

ez line comment

topaz bay
#

ez line and block comments

prisma wave
#

hardcoded chars

#

disgraceful

topaz bay
#

magic values are

#

ESSENTIAL

prisma wave
#

Odin shouldn't have magic

#

Frigga is a witch

#

She does

topaz bay
#

side effects @prisma wave

#

fucking bot

prisma wave
#

That's kinda disturbing

topaz bay
#

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

#

Maybe I should add specific operators for stack manipulation

#

lol

#

I love ligatures

prisma wave
#

That's really disturbing

topaz bay
#

honestly

#

this collapse api is so fucking useful

#

not having to change implementation code is fire

#

lmfao

#

too much power

topaz bay
#

You know whats kinda funky

#

The pull operator technically doesn't need an implementation

#

Since the pull from the stack is executed by the target

#

I just have this command that will optionally pull from the stack

#

When the type goes to parse an expression, it just adds the command and tells it to do nothing

#

(except for making sure the stack isn't empty ofc)

#

pretty error

prisma wave
#

Kinda cute

ocean quartz
#

Oh damn coroutines is huge, 1MB

distant sun
#

@topaz bay that symbol its nice :0

#

|> and <|

trim hare
#

I would appreciate some feedback on a plugin that I've been updating.
In particular some suggestions for simplifying/improving cross version support of different MC versions.
https://github.com/frost-byte/QuickBoardX

remote goblet
#

the main class

#

has so many comments

hot hull
#

That spacing makes me oof

remote goblet
#

its not even the allman

hot hull
#

Also this man be doing everything there is in the main class jeez

heady birch
#

Stop calling it main class

#

That aint no main class

#

Main classes have psvm

hot hull
#

It extends Java Plugin

#

Thus being main class

heady birch
#

no

#

I guess you could use main as a descriptor

#

but it is not the main class

#

it is the main class

obtuse gale
#

explain plugin.yml then ๐Ÿค” main: com.my.myshitplugin.Whatever

heady birch
#

๐Ÿ˜•

#

Thus being main class
@hot hull ๐Ÿ˜ 

#

MyPluginNamePlugin suffix

hot hull
#

Niall

remote goblet
#

the dude seems to have basic java knowledge

hot hull
#

You're a 4head

remote goblet
#

but everything is just a mess

heady birch
#

โ˜น๏ธ

#

Dont call me that Ori

#

Lol

trim hare
#

I've seen plenty of examples that apply a defined api to the main plugin class; if you have an alternative suggestion or example I can review that'd be great.
As far as having all of that functionality within the main plugin class, if you can suggest another approach that works with a multi-module that handles different versions for compatibility,
that'd be great. Which is why I asked for some feedback.

#

Ori, I've just refactored that part to use an additional method, because it I also felt that it was pretty ugly.

remote goblet
#

oh yeah btw

#

we dont give actual constructive criticism

#

we just bully the code and ruin your self esteem

#

:)

trim hare
#

Yeah I figured that out a while ago, which is probably why I'm generally inclined to help when I can ๐Ÿ˜› Just to be 'that guy'

remote goblet
#

tongue emoji skypepuke

trim hare
#

I do a lot of refactoring as I learn better approaches; most of the time getting something relatively functional doesn't necessarily mean it's clean.

remote goblet
#

90% of popular plugins on spigot

#

are coded like pure garbage

#

so its not just you, dw

quiet depot
#

wrong

remote goblet
#

fine

#

99%

quiet depot
#

bit more

trim hare
#

102%

quiet depot
#

I'd say around 99.95% of plugins are badly made

pallid gale
#

๐Ÿ˜ฎ

#

FishSlapper the only good one

remote goblet
pallid gale
#

The choice of variable names just really makes the project

quiet depot
#

wooly, where's your guice module?

trim hare
#

I want to obfuscate my code with meaningful variable names, just to be different. The original source should be like typical obfuscated code, amirite?

remote goblet
#

just don't obfuscate it ASevil

quiet depot
#

ah verison manager

trim hare
#

BinderModuleImpl

#

I was being fascetious

#

Ori

remote goblet
#

You're using complicated words

#

most people here don't know how to spell

trim hare
#

it's for obfuscation

#

yeah, but discord tells you when you're misspelling words.

quiet depot
#

wooly, I can't really give specific tips regarding making the version independence stuff simpler, but I can give general feedback if you want it

remote goblet
#

i wouldn't recommend that wooly ^

#

it's cyberbullying

trim hare
#

That's fine, I'm happy to have whatever feedback.

quiet depot
#

there's no such thing as cyberbulling ori

remote goblet
#

fine

#

it's bullying in general

versed ridge
#

As long as it's not Sxtanna then you're fine

#

:)

remote goblet
#

Piggy might be worse than sxtanna

#

Sx is just mean in general

obtuse gale
#

in every coding discord server im in theres one guy like sx

trim hare
#

I figure he doesn't even sleep in a bed, just falls out on the wrong side no matter what

obtuse gale
#

that just comes off as a prick unless you get to know them more lol

quiet depot
#

don't take things personally and you'll find that your perspective changes

remote goblet
#

Sx is a species

obtuse gale
#

I used to hate sx's lol

quiet depot
#

he's an acquired taste

#

wooly this project would benefit massively from some design principles

#

and considering you've got guice here, it's especially easy to follow them

trim hare
#

Well there is definitely a lot of reused code

quiet depot
#

that's DRY

#

the simplest of all things, I'd start with that

trim hare
#

which is one of the things that is related to the question i was asking

#

right, don't repeat yourself

remote goblet
#

sx hates me right now kekW

obtuse gale
#

sx hates everyone right now

quiet depot
#

I'd also recommend formatting the entire project wooly

#

whoever made this was definitely a c# developer

trim hare
#

Most of those issues for this project relate to creating mulitple versions, a binding for each of the mc versions I'm supporting.
I was curious if there was a general strategy or design pattern for handling changes in Bukkit/Spigot Interfaces and classes. Like Scoreboard and Team (bukkit actually)

#

I basically reworked the entire project

#

to make it multi module

#

the original developer was basically letting me and anyone else who felt like it support his plugins

#

and was never available on his discord

#

There were issues with how he was managing his plugin configs; overwriting changes made to them when the server shutsdown, as an example.

#

that and people were asking for backwards compatibility; I thought it'd be a good project to learn how to set up maven for multi-module as well.

hot hull
quiet depot
#

you and me have very different concepts of clean

hot hull
#

You're a 4head Piggy

trim hare
#

Right, I generally follow that approach. I have a far more complicated plugin with lots of Managers and code compartmentalized into separate classes

quiet depot
#

I honestly don't know what i'm looking at

trim hare
#

I would typically do intialization and teardown in the plugin class

#

and put all of the other stuff elsewhere

quiet depot
#

you're storing commands, listeners, "plugins", and also managing their registration in this class frosty

trim hare
#

I think that's supposed to be like a skeleton of a plugin

quiet depot
#

then you're also providing getters for "CompletionHandler", "MessageLoader", etc

#

and then you're also extending JavaPlugin, signalling this class is your main?

#

like pick a task lol

#

is it your application's entry point, an instance provider of your "managers/loaders", or a command, listener, and blah registrar?

hot hull
#

It's all ๐Ÿ˜Ž

quiet depot
#

well that's a violation of the single responsibility principle

hot hull
#

Indeed it is, but you're also violating it, so can't really blame me

quiet depot
#

pf

#

I shouldn't be your role model lol

hot hull
#

hehe

quiet depot
#

what can I say, it's hard to make your main class abide by that principle

trim hare
#

Some times I feel like that Single Responsibility Principle would cause a lot of fragmentation.
I mean I understand the concept, and from a maintenance point of view I get it. But sometimes it's just not as practical, depending upon the context.

#

Would you typically split off all the responsibilities for loading, registering dependencies into individual classes?

quiet depot
#

yes

trim hare
#

even if it's just one method with a couple of lines?

quiet depot
#

Some times I feel like that Single Responsibility Principle would cause a lot of fragmentation.
I mean I understand the concept, and from a maintenance point of view I get it. But sometimes it's just not as practical, depending upon the context.
I think all the solid principles are pretty sound, the issues come into play with oop itself, which is what solid builds upon

#

although I'd just like to mention, the example you provided before, is not an example of an oop/solid flaw, but rather just a lack of different perspective

trim hare
#

Now one of the things I've done, for example, is created a bunch of Manager classes, each handles specific aspects or features on the server.
They're basically glorified event listeners, and yet there's still a lot of interdependencies between Managers, which I manage with Guice currently.

#

I know that SRP pretty much mirrors the philosophy of a traditional unix cli program

#

If you need more complex behavior you can just pipe various commands together

quiet depot
#

is that just your comparison, or was that an actual inspiration for the principle?

trim hare
#

I think I've read that, but I'm also aware of it just from observation

obtuse gale
#

Quick question

trim hare
#

I've had a lot of exposure to it, and I know how it works from experience

obtuse gale
#

I dont really understand why its better to pass the individual things like file manager to a class, when it looks neater code wise to just mass through the main class which contains getters/setters to said file manager class

trim hare
#

So I have a frame of reference and can see how it's similar in some way

obtuse gale
#

It makes the constructor look hella messy

trim hare
#

That's why I switched to Guice

quiet depot
#

aj there's virtually no difference between the two things you've just mentioned

#

actually that's not true

#

ignore that please

obtuse gale
#

I was told last night to pass through the individual things

trim hare
#

I have like 40 commands, and I use ACF a command framework.

    /**
     * Register Console and Player Commands with ACF
     */
    private void registerCommands()
    {
        getLogger().info("VanillaEssence: Registering Commands");

        Set<Class<? extends BaseCommand>> commands = pluginReflections.getSubTypesOf(BaseCommand.class);

        commands.forEach(c -> commandManager.registerCommand(injector.getInstance(c)));
    }
quiet depot
#

by who?

obtuse gale
#

sx or BM or someone

#

soimeone who knows what theyre doing

trim hare
#

I use a reflection library at startup one time, and that can be optimized further, I just haven't done it yet.

quiet depot
#

org.reflections != reflection

#

important distinction

trim hare
#

I know

#

we've had this discussion

quiet depot
#

oh

distant sun
#

pig aka the ceo of org.reflections

quiet depot
#

nah i made my own thing after I realised org.reflections was kinda shit a while back

trim hare
#

this has suited my needs because it does the job, it runs at startup of the server. I just haven't had the time to do any further exploration, including the alternative you'd suggested.

quiet depot
#

wooly, I also do a form of classpath scanning for commands

#

and with your example before, my loading and registering process is separated

hot hull
#

๐Ÿคข

quiet depot
#

I have a "request" api, which allows me to request particular things from the scanning api, and bind them via guice. I then inject the scanned items, and register them elsewhere

trim hare
#

well I do this for a lot of things during startup/registration, not just commands

#
    /**
     * Register classes with Bukkit that implement its system for
     * serializing and de-serializing their data
     */
    private void registerConfigs()
    {
        /*
          Challenges and Objectives Configuration
         */
        getLogger().info("VanillaEssence: Registering Configurations");

        Set<Class<? extends ConfigurationSerializable>> configs = pluginReflections.getSubTypesOf(
            ConfigurationSerializable.class
        );

        configs.forEach(c -> {
            String simpleName = c.getSimpleName();
            getLogger().info("Registering " + simpleName);
            ConfigurationSerialization.registerClass(c, simpleName);
        });

        ServerData serverData = createInstance(ServerData.class);

        if (serverData != null) {
            serverData.onCreate();
        }

        LeaderboardData lbData = createInstance(LeaderboardData.class);

        if (lbData != null) {
            lbData.onCreate();
        }

        WorldData worldData = createInstance(WorldData.class);
        if (worldData != null) {
            worldData.onCreate();
        }
    }

Custom Configurations for example; since I'm not currently using a database.

#

using a guice factory to do assisted injection for the last three

heady birch
#

SX is the guy I go to help for

#

thats stupid

#

shut up

quiet depot
#

I've never actually used assisted injection

heady birch
#

your overcompilcating this

trim hare
#

it can be pretty complicated

quiet depot
#

what does it do?

trim hare
#

basically lets you mix things that need to be injected with parameters

#

that are different for each instance you want to create

#

so let's say you have four custom serializable configs; they all share some dependencies you want to inject.
But the path where each is stored is different

quiet depot
#

ah right

trim hare
#

or, in my case, the player data config is per player

#

so the file name is based upon the player uuid

quiet depot
#

I've just never needed to use it

#

found alternative ways I guess

trim hare
#

Yeah, I'm sure there are probably other approaches to doing the same thing.

quiet depot
#

did I show you my scanning/guice idea?

#

where you could do things like @Inject @Id("69") private Person person;

trim hare
#

You mentioned it above

#

is Id your own annotation or is that from Hibernate/something else similar?

quiet depot
#

it's just an example

#

that specific example would probably never appear in real code

#

it's kinda useless

#

but it show's the concept really well

#

perhaps this is a better example

quiet depot
#
@Inject @Extends(Command.class) private Set<Class<? extends Command>> commands;```
trim hare
#

Ah I see, by scanner you mean the class path scanner

quiet depot
#

well technically it's not a classpath scanner

trim hare
#

well, but in a sense it's finding all of your commands and registering them with guice/handling the injection; instead of explicitly registering each one.
Similar to what I was doing, but condensed, less verbose.

#

Did you create the @Extends annotation or is that from another lib?

#

or was that just an example

quiet depot
#

just an example I made up then

#

although that's definitely something I'm putting into my framework, now that I've thought of it

#

I've been trying to find a use for that concept for ages

trim hare
#

One of the biggest challenges with guice is avoiding circular dependencies; it took me a while to figure out how to refactor some of my code to avoid it

quiet depot
#

I had issues with that when I was first working with guice

trim hare
#

whether I use provides, or method injection; or events if I don't need a result immediately

quiet depot
#

my style of coding doesn't really allow for it though now

trim hare
#

what if you have multiple classes listening for the same event?

quiet depot
#

then I'll have multiple classes listening to the same event

trim hare
#

so that's not really an issue, I mean plugins collectively do that already I guess.

#

It's really only tricky when you need things to happen in a specific order, and you do have the priority for that, I guess.

quiet depot
#

I find my code rarely needs synchronization of that sort

#

maybe I just stray away from the kind of projects that need it, but I'd like to think it's my code style

hot hull
#

You rarely need that

quiet depot
#

oh you're probably right

#

i never thought of that lol, that maybe it's just rare in general

heady birch
#

I dont care unless theres a problem

hot hull
#

Piggy, I expect the thingy you're working on to be put on spigot

frigid badge
#

but that breaks the laws of spigot

#

there cannot be actual good code on spigot

heady birch
#

Decent XML parsing library

quiet depot
#

does the jdk have an xml library?

heady birch
#

Yeah but..

#

Its not exaclty fast

#

Not sure if jacksons extension one works with the streaming api

#

Actually its pretty small json anyway

hot hull
#

@ocean quartz, do I have to close and reopen the menu to update the lores? cause rn I'm using .update and it doesn't seem to be doing anything

ocean quartz
#

@hot hull You need to update the item, the item you add to the gui won't be the same you added since the nbt stuff will give you a copy of it

obtuse gale
#

come on mate

#

wtf

hot hull
#

Ah okay will try that, also, I had a kid spam my dms this morning asking if I knew someone who does web de

#

dev*

distant sun
#

Also wtf is wrong with this guy?
@ocean quartz ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚

#

Where is that message from?

ocean quartz
#

On their Discord

distant sun
#

Lame

#

Shows a lot of maturity

ocean quartz
#

Not sure what he's looking for, some sort of compliments?

distant sun
#

Maybe

#

Just ignore him

hot hull
#

Matt, I'm slightly confused

ocean quartz
#

Oh yeah I don't really care
Fullwall is a nice dude, this one is just an ass

#

What's up Frosty?

distant sun
#

Thats one of Citizens authors, frosty

onyx loom
hot hull
#

Not by that Gaby smh

#

By updating the menu, like every way I try it ends up in a loop..

ocean quartz
#

Show me your code

obtuse gale
distant sun
#

Remove kt

versed ridge
#

remove java

old wyvern
#

Whats wrong with citizensCMD??

remote goblet
#

delete java

ocean quartz
#

As far as I know nothing

#

I guess is just fun to create an API then when people use it you throw shit at them

hot hull
#

Can you rephrase that ,-,

remote goblet
#

as far as i remember

#

the dev of citizens is an angy dude

ocean quartz
#

He is yeah

remote goblet
#

i can imagine

old wyvern
#

I use citizenscmd on my server

#

Nothing wrong with it

#

Honestly i have no idea wtf denizens even is

ocean quartz
#

It's because he's upset that he tries to shove Denizen in people's face and they don't like it so they went for mine
But now Citizens have the commands built in so he has a reason to complain lol

old wyvern
#

๐Ÿ˜‚

#

Citizens have a builtin command rn??

#

Oh

ocean quartz
#

Yeah, a more complicated way to use but it's there

old wyvern
#

Welp

remote goblet
#

wait

#

is CitizensCMD yours?

ocean quartz
#

Yeah

distant sun
#

Denizen its just some skript competitor

#

Pretty shitty imo

ocean quartz
hot hull
#

skript ๐Ÿคข

prisma wave
#

@obtuse gale fix spacing and don't use a Utils class

#

We don't do that in kotlin

obtuse gale
#

๐Ÿค”

#

why

prisma wave
#

Because there's no need

#

You can have top level functions

obtuse gale
#

ah

#

right

#

them

prisma wave
#

So there's no point in putting functions inside an object

#

It's not very idiomatic

obtuse gale
#

wait so just like remove the object declaration and just have it as a file?

prisma wave
#

yes

obtuse gale
#

ah alrigh

prisma wave
#

object shouldn't be used to make util classes

#

it's for singletons mostly

#

and static methods when they're needed

obtuse gale
#

anything else weird with htat code lol?

prisma wave
#

ugly spacing

obtuse gale
#

code wise tho lol?

prisma wave
#

not particularly

#

there's very little you can say about a few constructor calls

obtuse gale
#

lol

#

How about the generator manager or store entity manager class

#

thats got the most in it probably

prisma wave
#

not very readable

#

would it kill you to format it

#

add a few line breaks every now and then

#

etc

obtuse gale
#

fine

#

is there a way I can do the entire project lol?

#

yep

#

alright

#

done lol >:)

prisma wave
#

Splendid

#

Now push

#

and I'll have a look

obtuse gale
#

ye

errant geyser
#

Any Git clients you guys recommend? I don't really like GHD

prisma wave
#

Gitkraken is alright

#

I never really use a client though

frigid badge
#

command line

prisma wave
#

^

#

Unless it's for merging, in which case intellij

frigid badge
#

yes or whatever other jetbrains ide I'm using

obtuse gale
#

any suggestions bm?

#

tryna make this as neat as possible

topaz bay
#

If you want to make it neat, why don't you use proper spacing and allman @obtuse gale

prisma wave
#

wise words

#

nice commit message btw

topaz bay
#

which

errant geyser
#

ew allman

obtuse gale
#

allman?

errant geyser
#

hi
{
}

quiet depot
#

it's just some inferior shitty style

obtuse gale
#

ew

prisma wave
topaz bay
#

Or if its something that encapsulates logic!

#

Like a countdown class

prisma wave
#

indeed

#

you sound very excited about that

topaz bay
#

@quiet depot you are wrong

#

I literally just woke up

#

I feel... strange

#

I usually wake up between 1-5am

obtuse gale
#

arent I using BukkitRunnable?

prisma wave
#

yes

#

that's my point

topaz bay
#

pea brain

prisma wave
#

use Runnable unless the task needs to cancel itself

obtuse gale
#

oh ok

topaz bay
#

NO

#

GROSS

obtuse gale
#

whats the difference

prisma wave
#

Runnable isn't ugly

#

also that's an awful lot of magic numbers you got there

topaz bay
#

apparently I already? clear the stack?

#

oh ya know what

#

nvm

#

Im dumb

prisma wave
#

wat

#

apparently I already? clear the stack?
this isn't english

errant geyser
#

Sx, why would anyone use your language over any others?

prisma wave
#

good question

#

use Frigga instead

#

it's better

obtuse gale
#

wdym magical numbers lol

errant geyser
#

Same with Frigga KM

quiet depot
#

what the frig is a frigga

topaz bay
#

Its... a toy language

errant geyser
#

KM's lang

prisma wave
#

random numbers with no mention of what they actually mean @obtuse gale

topaz bay
#

It doesnt exist to solve any problem

prisma wave
topaz bay
#

It exists because I was bored

#

And I wanted to design a programming language

prisma wave
#

Frigga will be the best functional language

obtuse gale
#

no clue why thats 2.0 lol

prisma wave
#

it will literally REDEFINE the programming market

jovial warren
#

good day all

errant geyser
#

Fair enough Sx, just thought you were making it for people to use

obtuse gale
#

its meant to be 0,0

prisma wave
#

hello

errant geyser
#

Hey BomBardy

jovial warren
#

what have I missed

prisma wave
#

you guys know what we haven't done in a while

#

some good old clash of code

#

anyone down?

obtuse gale
#

classic

onyx loom
#

who got the link

topaz bay
#

@prisma wave

prisma wave
#

ugly

topaz bay
#

functions have their own stacks

prisma wave
#

oh right

errant geyser
#

Not much. A monitor flex in #off-topic, some weird stuff here, nothing much in development @jovial warren

prisma wave
#

strange

topaz bay
#

Not really actually

#

Kinda makes sense

prisma wave
#

if functions have their own stack

topaz bay
#

no

#

I cant

prisma wave
#

oh

jovial warren
#

where did that arrow come from?

topaz bay
#

oh

#

lol Im dumb

prisma wave
#

ligatures

topaz bay
#

I didnt send the entire screen shot

prisma wave
#

I thought you showed some examples of that working yesterday

onyx loom
#

clash
of
code

topaz bay
prisma wave
#

lol

#

nice

#

join guys

topaz bay
#

clash is gay

obtuse gale
prisma wave
#

don't care

obtuse gale
#

hows that for storing GUI item

prisma wave
#

i'm bored

topaz bay
#

ew

#

gross

#

use korm

#

LOL

obtuse gale
#

na

jovial warren
#

heard korm was broken

obtuse gale
#

the name sucks

prisma wave
#

not broken

topaz bay
#

That is objectively untrue

prisma wave
#

just a not descriptive error message

jovial warren
#

actually it doesn't aj3

prisma wave
#

and dumb end users

onyx loom
#

JOIN SX

obtuse gale
#

im not gonna make the chicken korma joke again

prisma wave
#

welcome to the korm fields