#dev-general

1 messages Β· Page 205 of 1

distant sun
#

actually thonking

steel heart
#

Then use a map?

distant sun
#

Ye but idk how to get the certain Pet from a map

steel heart
#

You want to get the the type by a pet or what?

distant sun
#

I get the PetType from in-game and then I need to access the Pet subclass linked to that type

steel heart
#

Make a PetType<T extends Pet> and then in your PetType class, have a getter for the class T

#

Then make constants of PetType<MyPet> MY_PET = PetType.of(MyPet.class)

#

(Or something)

#

This will have the type exposed

distant sun
#

uhh

distant sun
#

I have an idea how to do this but is ugly 😦

hot hull
#

Why not just make your Pet a interface reversed_fingerguns

distant sun
#

Develop

hot hull
#

Huh?

distant sun
#

Develop your idea

#

It already is an interface

floral steeple
#

Good morning, it's my first time to configure DeluxeMenus, and I don't know why the menu won't open

distant sun
hot hull
#

Why u say it's an object then

#

Eee

floral steeple
#

Nobody answers me xd

distant sun
#

Smh frcsty

hot hull
#

Smh gaby

onyx loom
#

πŸ˜”

#

big brainfuck

distant sun
#

🀣

obtuse gale
#

hello how make rest api with sprong, thankyou please xoxoxo

prisma wave
#

RestController

obtuse gale
#

do I just make like my entities as per usual then just do fancy stuff with the controller

remote goblet
#

Witches in minecraft are dumb

#

20s of poison? monkaW

frigid badge
#

@obtuse gale just use rest repositories

obtuse gale
#

thats a thing?

frigid badge
#

or even better and use a lib like elide or crnk

#

rest repositories remove all the boilerplate but aren't as extensive as one of those libs ^

#

and that tutorial uses just normal spring which contains loads of boilerplate if you want a simple rest api

#

which is just plainly crud on entities

obtuse gale
#

right

#

so atm ive got a spring project, should i use like elide or crnk instead ?

frigid badge
#

elide & crnk are libraries for spring

obtuse gale
#

oh like in addition?

frigid badge
#

but it really depends on what type of rest api you are making

obtuse gale
#

idk too much about rest apis tbh

frigid badge
#

most rest api's are mostly CRUD and then there's no reason to have to make the controllers etc yourself since all they do is CRUD, hence why there's spring's rest repositories which allows you to write a repo and they'll have the routing etc done automatically. And then you have crnk or elide which take that to the next level and all you do is write entities with a few annotations on em and you have fully fletched filtering, pagination, searching, crud etc

obtuse gale
#

oh rightio

#

is one of those libs you suggested "better"

frigid badge
#

and what's even nicer is that crnk and elide use a json specification and an url specification (both JSON:API). Which means that your frontend (if you have one can use a libary which also follow that specification and therefore can communicate with your api without boilerplate once again

#

well I rarely use spring but crnk is more active and has some more integration into different systems from spring

#

while elide is even less boilerplate but less integration and less active

#

elide is made by yahoo btw

obtuse gale
#

hm

#

Ill try elide I guess

#

actually

#

crnk

#

also do you know if i can use java 15 or whatever record classes for JPA entities?

onyx loom
#

yahoo lol

frigid badge
#

no idea @obtuse gale

#

probably not

obtuse gale
#

rip

frigid badge
#

since jpa entities are mutable

obtuse gale
#

I miss kotlin 😦

frigid badge
#

and records are immutable

#

why not use kotlin with spring then

#

or is that too buggy

onyx loom
#

pretty sure it supports kotlin well iirc

obtuse gale
#

im using java cos im doing something with someone who doesnt know kotlin

frigid badge
#

ahh

distant sun
#

I think we will do php next semester 🀒

onyx loom
#

😬

obtuse gale
#

I think I do that next year

onyx loom
#

$

distant sun
#

and fucking ms access, like anybody on this planet uses it smh

frigid badge
#

lmfao

onyx loom
#

i had to do access too

#

its disgusting

frigid badge
#

it's because most schools get all their tools via microsoft

#

they get this package deal

distant sun
#

was made only for people that siat a desk smh

#

ye ik

onyx loom
#

true

distant sun
#

pretty cool ngl

frigid badge
#

no

#

it sucks

#

cause you get real shitty stuff

distant sun
#

wdym

frigid badge
#

that you don't want everything from one company

obtuse gale
#

my school it guy gave be a book on ms access as a joke

frigid badge
#

sure powerpoint, word are great

#

or excel

#

but access is just not it

distant sun
#

some businesses might use it I guess

#

or else why would they still working on it

onyx loom
#

MS should discontinue all other office programs except for PP word and excel xd

obtuse gale
#

Could not find io.crnk:crnk-setup-spring-boot2:.

#

No candidates found for method call mavenBom.

distant sun
#

pass a version

onyx loom
distant sun
#

or +

onyx loom
#

πŸ₯²

obtuse gale
#

oh wait

#

it says add them to youre classpath

#

is that the same as dependencies or is that something else

distant sun
#

classpath means to add them to your project or smth

#

make sure you have the repo and the right group, artifact and version

obtuse gale
distant sun
#

have you added the plugin?

obtuse gale
#
plugins {
    id 'org.springframework.boot' version '2.3.4.RELEASE'
    id 'io.spring.dependency-management' version '1.0.10.RELEASE'
    id 'java'
}
frigid badge
#

@heady birch happy with the new release?

#

rust fanboy

obtuse gale
#

gradle be like

#

Could not resolve everything

Buttttttt

BUILD SUCCESSFUL

obtuse gale
#

bruh ive been sitting here for ages try na get this thing to work lol

wispy oak
#

Hello

#

im looking for someone who knows something about guilds plugin

#

Im considering buying it

static zealot
wispy oak
#

yeah but i cant find all supported languages

static zealot
dusky drum
lavish notch
#

I've recently setup pterodactyl panel to use panel.<domain>, and whilst it works fine - it also works with <domain> which I'd like to use to display a different site. How would I do that? (I'm using nginx btw)

dusky drum
heady birch
#

and fucking ms access, like anybody on this planet uses it smh
@distant sun Hi

regal gale
#

Our school uses it

lavish notch
#

I hate it

onyx loom
#

disgusting

hot hull
#

tf is that

regal gale
#

You don't know ms access?

heady birch
#

Let me tell you a story

prisma wave
#

once upon a time

onyx loom
#

micorosoft created an application and it bad. the end.

prisma wave
#

😐

#

That's a pretty boring ending

onyx loom
#

just telling the truth

#

based on real life eventsℒ️

heady birch
#

Building a database system without programming skills is pretty cool in my opinion!

#

Whip up a schema in access. I remember writing SQL in Access 😐

#

Stupid MSSQL syntax

static zealot
#

So this application started to take over the world. Some people realised how bad it is and started an alliance to fight against it but it was to late. The application took over the world. But wait what is that? In the last minute a thing appeared in the sky. What could it be? An alien? A super human? No! It was Bill Gates, God himself. He said 2 words in an unknown language and the application vanished forever. After many years, hundreds of translators they figured out what the words were: "Begone thot". The End.

#

here @prisma wave a great story for you to read and farm xp

#

you're welcome

heady birch
#

how bad it is - source?

prisma wave
#

So this application started to take over the world. Some people realised how bad it is and started an alliance to fight against it but it was to late. The application took over the world. But wait what is that? In the last minute a thing appeared in the sky. What could it be? An alien? A super human? No! It was Bill Gates, God himself. He said 2 words in an unknown language and the application vanished forever. After many years, hundreds of translators they figured out what the words were: "Begone thot". The End.
@static zealot cool

heady birch
#

I have a authentic source

"Access is the biggest technological advancement in this century." - Niall, 2020

prisma wave
#

1920*

#

Ms access started the great depression

remote goblet
#

@ocean quartz how easy is it to make a bee follow a player like a pet using NMS

ocean quartz
#

Pretty easy

prisma wave
#

You probably don't even need NMS

#

setTarget?

remote goblet
#

setTarget makes them hostile i believe

ocean quartz
#

I think so too yeah

#

If you don't need spigot, you can use paper's mod api

remote goblet
#

Bees can be hostile

hot hull
#

Well yes..

prisma wave
#

then cancel damage event

#

Ez

remote goblet
#

but they get angy eyes sadcat

ocean quartz
#

Red eyes pet

hot hull
#

Matt

#

mf msg be stonks

remote goblet
#

Yeah i don't understand any of this matt HR_NayuSmile

hot hull
#

However add a Format#LEGACY_ALL

#

or smth

distant sun
#

Format#BAN_FROSTY

static zealot
#

πŸ‘

ocean quartz
#

shouldRun is just so it doesn't do all the tracking stuff every tick, and it skips most of the time
I get the distance between the player and the entity then check how far they are, if too far, tp, if just a bit far follow, the walk to function is
internal fun NavigationAbstract.walkTo(player: Entity, movementSpeed: Double) = a((player as CraftEntity).handle, movementSpeed)

#

I can do that yeah Frosty

distant sun
#

What about mine

ocean quartz
#

Can also do

distant sun
#

Ty bb

remote goblet
#

i'm confused sadcat

ocean quartz
#

What is confusing you?

remote goblet
#

All of it

#

NMS scare me

ocean quartz
#

I mean that's as much as i can explain everything else is pretty self explanatory xD

#

You use the navigation.a to make the entity move towards the target

remote goblet
heady birch
#

πŸ™‚

obtuse gale
surreal quarry
#

ask that on stack overflow

onyx loom
#

πŸ₯²

ocean quartz
#

They'll eat you alive on stack overflow if you ask that kek

onyx loom
#

bruh

obtuse gale
#

this was on yahoo questions lmaoo

hot hull
ocean quartz
#

First problem, Java smh

hot hull
#

Yes

distant sun
#

why O.o

#

and why are the constants at the top static?

hot hull
#

because constants are static?

ocean quartz
#

Why not make a Result object that will take those 3 values?

#

Simple data class

hot hull
#

I could, but it's used 2 times so really not that much of a big deal don't you think?

ocean quartz
#

It kinda is, using object array there doesn't really feel good

distant sun
#

do you really need a NicknameProfile object if it just store one value, a String?

potent vale
#

Its fine you can return it as an array

#

Im pretty sure its faster too

hot hull
#

Yes Gaby, going to probably add other stuff in the future, hence it's made this way

potent vale
#

But it can get rlly messy though

distant sun
#

ok

hot hull
#

Agreed

ocean quartz
#

Im pretty sure its faster too
How would it be faster? lol

potent vale
#

Arrays are pretty easy

#

Maybe not the best thing to do there

ocean quartz
#

I mean that doesn't justify it being faster, making an object array in that situation does not make sense, it's confusing and require unsafe casting

potent vale
#

It doesnt make sense and you wont know what kind of object it returns

#

It can be anything

ocean quartz
#

Exactly you are proving my point

potent vale
#

Results are better but arrays are ok if ya want that

#

Array are prolly faster, but has more disadvantages than advantages in this situation

ocean quartz
#

It would not be faster in this situation

potent vale
#

I think theyre faster, but really is not even much difference

#

Well the casting will slow the process abit

ocean quartz
#
Object[] result = new Object[]{null, null, null};

result[0] = file;
result[1] = configuration;
result[2] = section;

Then

if (result[0] instanceof File) file = (File) result[0];
... etc

vs

return new Result(file, configuration, section);

then

file = result.getFile();
... etc

How is the first better? And how is it faster?
That makes no sense

potent vale
#

Its not better at all, its accepted

#

Thats what i say, when you have to cast it, its gnna be awfull

#

It will also crash if casted wrong, you know that for sure

ocean quartz
#

Then why are you defending it? lol
Like i said because you can doesn't mean you should
In that situation it 100% makes sense to have an object
In no way an object array will be "faster"

potent vale
#

Unless you keep it an object

ocean quartz
#

Which he doesn't

potent vale
#

Well i only saw that file, so that might be true

#

Maybe not the best way

ocean quartz
#

do you cast each of the afterwards?

Yes

potent vale
#

But his way

#

I didnt read that, im on the phone

ocean quartz
#

Jesus, this argument

potent vale
#

Just sayin, that's its ok to use it nothing more

#

Not the best way though.

prisma wave
#

If my knowledge of the JVM is correct using an array will use slightly less memory

#

But I don't think there's any significant speed difference - they're both basically lists of pointers

potent vale
#

Yes

prisma wave
#

And it's too neglible to consider, so yeah result object is better

potent vale
#

Yes, i agreed

steel heart
#

I mean isn't lists better for manipulating data

#

Consider the functions that comes along

potent vale
#

It would be still an Object type

steel heart
#

What's your point?

potent vale
#

And since the amount of objects is always 3, you dont need a list

steel heart
#

Idk the context but use array if you dont need the features a list implementation provides

potent vale
#

My point is that Matts solution is the best of these 3, since:

It wont require casts
It wont require checks
It wont give errors

steel heart
#

Arrays are quite level languaged which I assume gives benefits as elera stated "memory"

ocean quartz
#

Doesn't give you enough benefits to be useful

steel heart
#

Depends

hot hull
#

Idk why y'all still debating about this, but I already changed it ages ago lol

prisma wave
#

it's neglible

ocean quartz
#

^

prisma wave
#

Object headers on a 64 bit JVM are something like 24 bytes iirc

#

And considering it's a result object chances are it'll be disposed immediately after creation

#

This entire discussion is useless

#

Well apart from xp ofc

gray elk
#

best way to cancel lava damage ?

ocean quartz
#

Event prolly

prisma wave
#

Yea

potent vale
#

Like we jave something to do

#

Have*

gray elk
#

??

potent vale
#

They say use an event, and check if its lava whay damages the player

#

What*

gray elk
#

i did but still damage

hot hull
#

@prisma wave sweet sweet xp

prisma wave
#

Then you did it wrong

#

@prisma wave sweet sweet xp
@hot hull ikr

#

This chat isn't for support

potent vale
#

Then cancel the dmg which "should" applies

#

Apply*

ocean quartz
#

This chat is for unnecessary arguments for xp kek

steel heart
#

@prisma wave would you recommend the Cache in guava ?

#

Like the LoadingCache

frail glade
#

For what purpose?

steel heart
#

Well Caching

frail glade
#

Yes but in what way? What is your intended use?

heady birch
#

No I would not

steel heart
#

Mostly just caching configurations

heady birch
#

Guava entirely was the downfall of many of my projects

#

Absolutley not

steel heart
#

What downfalls specifically

frail glade
#

Doesn't bukkit "cache" the main plugin config by default on startup?

heady birch
#

Guava

steel heart
#

Its lots of configs

frail glade
#

Matt and I use a library called ConfigMe, but I'm unsure if that'll be useful for your case. Don't typically have a bunch of configs.

steel heart
#

Oh well I've tried it and it works nicely but I have to shade it right?

#

I kind of want to avoid lots of dependencies

frail glade
#

Yeah but it's only like 100kb or something

distant sun
#

I personally like configurate more

frail glade
#

Configurate is pretty good too!

steel heart
#

I don't like Configurate that much

#

it's kind of over engineered

#

But well anyone else that has opinions about guava?

#

Idk if Niall is biased or smtng

frail glade
#

I mean, if you're wanting to avoid another dependency, then yeah, just use Guava.

steel heart
#

Yeah I mean, I could just go with my own implementation instead of their Cache implementation but Idk if it would be beneficial

#

I asumme a HashMap is more cheap than a ConcurrentHashMap

frail glade
#

Is this simply for just caching a config that won't change?

steel heart
#

Yeah

#

but it seems like guava was kind of using a CHM

#

And feels redundant if I don't need it

frail glade
#

So why not just load the object on startup? What is the reason you need an actual cache for it vs just a reference to the config object that's loaded?

steel heart
#

Well the config object is mutable

heady birch
#

I like configurate, not that I have used it, my kind of style of programming

#

Guava however

steel heart
#

yeah its not bad

frail glade
#

Let me change the question. What does the config contain?

heady birch
#

Let's not go there

steel heart
#

A lot of serialized custom objects

frail glade
#

Alrighty so you could probably just use a map of <key, object>.

steel heart
#

Yeah I will go with that feels way simpler. Well thank you for your wisdom waffle

#

king

#

and naill

frail glade
#

I actually just did this myself in the past week to load itemstacks from a config file.

steel heart
#

open source?

#

I have a lack of design

frail glade
#

Unfortunately not, but let me see if this is worth sharing.

steel heart
#

Sharing is caring

#

:]

hot hull
#

But he don't care

frail glade
#

So this project in particular is using Lucko's Helper lib. I literally just store it in a map via private final Map<String, ItemStackBuilder> cache = new HashMap<>();

#

And I don't store the itemstack itself but the builder reference because I have to change the contents of the items on-demand so I just modify the builder and build.

steel heart
#

ah okay, well I used his helper lib until I realized the stuff I was using wasn't shaded correctly

distant sun
#

what lib

frail glade
#

This is one of my first times using it too, it's pretty cool.

steel heart
#

Yeah if you want a fixed shaded version I got a jar of it

#

took quite some time but yeah its cool

frail glade
#

I'll also preface this with I was thrown into this project when it was like just half-way done? Not half-way but if that makes sense like, I didn't originally start it, I just had to adapt to what was there from the previous developer.

steel heart
#

Oww what are you working on that was half-way done?

#

Or like did the prev developer used helper or was that a choice of your own?

frail glade
#

I probably shouldn't say right now, but, here is what I came up with to adapt to how the items currently were being stored in the config.

    /**
     * Helper method to load items from the config into the cache
     *
     * @param configuration the config object
     * @param section       the path of the item to load
     */
    private void loadSection(final YamlConfiguration configuration, final String section) {
        for (final String key : configuration.getConfigurationSection(section).getKeys(false)) {
            final ConfigurationSection sec = configuration.getConfigurationSection(section).getConfigurationSection(key);
            cache.put(sec.getCurrentPath(), ItemStackReader.DEFAULT.read(sec));
        }
    }```

So this basically just takes the config object, gets all the children from a section and then stores it into the map as an itemstackbuilder.
steel heart
#

hmm yeah nice I will do something similar just that I cache like a lot of complex objects but really thanks for your time

frail glade
#

Wdym by complex?

#

Json objects?

steel heart
#

a Town

distant sun
#

Conclure, remember I have asked if I can link an enum value with a class? What if I put the class instance on the enum itself?
MONEY(other, values, here, new MoneyPet()...)

steel heart
#

or I mean several of them

#

Uh sure Gaby but the thing is that generics doesnt work well with enums

frail glade
#

Ahh. For objects like that, I don't even use config files. We straight up use mongodb clusters

steel heart
#

you cant have a type parameter for it

#

Yeah well that was a bad example

distant sun
#

uhh

#

welp I still need a way to do this 😦

frail glade
#

What are you trying to do Gaby?

steel heart
#

But I have a Rank object for instance which will be immutable unless you'd reload the config etc

distant sun
#

I have a Pet class and multiple implementations of it, such as MoneyPet so I was looking for a way to store them all and access by a key. The original system uses enums so I thought I could do that but doesn't look like

steel heart
#
enum PetType {
  MONEY(/*...*/, new MoneyPet())

  Pet pet;

  PetType(Pet pet) {
    this.pet = pet;
  }

  Pet getPet() { return pet; }
}
``` the problem here is that we will never be able to expose the type MoneyPet to the compiler
distant sun
#

I also need them mutable since the value is loaded from config

steel heart
#

We can make a getter for its class

#

but it wouldnt show us the type

#

Uh sure have a constant for it but let the object itself have mutable properties

#
enum PetType {
  MONEY(/*...*/, new MoneyPet())

  Pet pet;

  PetType(Pet pet) {
    this.pet = pet;
  }

  Pet getPet() { return pet; }
}
``` the problem here is that we will never be able to expose the type MoneyPet to the compiler

anyways the solution would be something like this

class PetType {
  public static final Supplier<MoneyPet> MONEY = () -> new MoneyPet(); 
}
prisma wave
#

java

steel heart
#

or smtng

#

dud

#

assuming there will be multiple instances of each pet type

distant sun
#

only 1

steel heart
#
class PetType {
  public static final MoneyPet MONEY = new MoneyPet(); 
}
#

then

distant sun
#
abstract class Pet<S: PetSettings>(

    open val petType: PetType,
    open val settings: S,
    open val blocksMined: MutableMap<UUID, Int>

) {

    companion object {
        lateinit var MONEY_PET: MoneyPet
    }

}```
prisma wave
#

Supplier<MoneyPet> money = MoneyPet::new

steel heart
#

Well idk if the object maybe had a zero arg constructor

prisma wave
#

@distant sun why are the properties open?

distant sun
#

uh

steel heart
#

Yo alex how does it feel to play overwatch on your mobile

distant sun
#

so each implementation can provide it own petType and settings?

prisma wave
#

@steel heart very fun

#

@distant sun it could be just passed as a constructor Param probably

#

Idk the full context but mutability bad

steel heart
#

Unless builder

#

or ?

distant sun
#

mutability on?

#

and ye, I guess I can remove the open part

prisma wave
#

Unless builder
@steel heart builder pattern bad in kotlin

steel heart
#

java though :]

#

and forge

#

wait why is builder bad in kotlin?

prisma wave
#

It's just not idiomatic

#

It's not necessary because kotlin is far less verbose

steel heart
#

I guess, well I mean what would you do instead ?

prisma wave
#

Default parameters usually

steel heart
#

so just invoking the constructor directly?

tiny kelp
#

cab someone help me

prisma wave
#

Yes @steel heart

tiny kelp
#

Can someone check my config?

steel heart
#

Well I mean thats possible in java as well except if you have like a 37 param constructor

#

which I got with the beloved modding api forge

#

and it gets quite deefficient

prisma wave
#

that's not such a big problem in kotlin though

#

you can usually express every possible combination in 1 single constructor

#

hence the builder patten isn't necessary

steel heart
#

yeah well I mean I had like many floats so it was kind of hard to distinguish in my case I guess but yeah very true

distant sun
#

bm where is x.use { } coming from?

prisma wave
#

wdym?

distant sun
#

tried to use it on some object and they don't have that property

prisma wave
#

oh

#

AutoClosable iirc

distant sun
#

oh

prisma wave
#

yeah well I mean I had like many floats so it was kind of hard to distinguish in my case I guess but yeah very true
@steel heart kotlin fixes that too

#

inline classes

steel heart
#

wow why am I not using kotlin

prisma wave
#

good question

distant sun
#

?. means it will only run the next code if the object is not null?

steel heart
#

alex I feel like that particular question really needs a profound answer

onyx loom
#

sounds about right gaby

prisma wave
#

yes gaby

#

@steel heart um

#

wdym lol

#
a?.b()

if (a != null) a.b()

these are equivalent

violet jacinth
#

does somebody know how to get an offlineplayer with a name in a bungeecord plugin?

prisma wave
#

afaik bungee doesn't have an offlineplayer analog

static zealot
#

pretty sure that's not possible + even the spigot one is deprecated

prisma wave
#

your best option is to query mojang's api

potent vale
#

its possible

#

store the players

prisma wave
#

that's probably a bad idea

#

it won't account for name changes and assumes that the player has played before

potent vale
#

yup

violet jacinth
#

because im working on a ranksystem over bungeecord and i wanna set a player's rank also when the player is offline

#

Wait? Is it possible to get all the offline players of all the lobby’s?

potent vale
#

a lobby which is a server? i think so

static zealot
#

yeah that's what he means considering he's using bungee

violet jacinth
#

Yes it is

#

I’m using CloudNet so I have lobby templates

#

And there is always atleast 1 Server for the main lobby online

onyx loom
#

i have a map that i need to access. would u recommend creating 1 instance of the class that the map is in (that is created at startup) or just put the map as top-level?

prisma wave
#

ehhhhhh

#

depends

#

if the map doesn't need to be associated with a class / instance, don't associate it

onyx loom
#

is there any downsides of using it as top level?

#

seems... too easy...

prisma wave
#

it's basically static, so accessible from anywhere and could get messy if you use it too often

onyx loom
#

πŸ₯²

heady birch
#

object {}

steel heart
#

object[]<> { object -=X> {

}

onyx loom
#

im going to have to stop u right there

steel heart
#

-=X> would be a cool lambda

heady birch
#

struct {
}

steel heart
#

rust is nice btw

heady birch
#

pub static extern "C" unsafe fn() {
}

steel heart
#

just looked into it

heady birch
#

Yes

#

Normalize changing your opinion after being presented with new information

steel heart
#

Well I never had anything against it

heady birch
#

I dont know why I liked it

#

My first introduction to lower level stuff really, references all that

steel heart
#

ngl its neat

frail glade
#

CloudNet seems pretty interesting.

steel heart
#

whats that?

frail glade
steel heart
#

oh looks like a killer but what is it for simplified?

frail glade
#

There's a readme here

#

It's supposed to be good for minigame servers I guess?

steel heart
#

Hmm interesting

#

so does it aim to replace bungee or what

#

I just kind of feel like its little overwhelming

#

oh yeah it does seem to do that

frail glade
#

It's basically like a panel without a panel

steel heart
#

worth a try once it gets stable enough

steel heart
#

@onyx loom I'm about to drop second dot typo fix, stay tuned

onyx loom
prisma wave
#

Oh dear

lavish notch
#

In gradle, how do I not compile with anything I'm not using?

hot hull
#

:what:

lavish notch
#

My compiled jar is 2.8Mb and it barely does anything.

prisma wave
#

minimize()

lavish notch
#

I have that already

hot hull
#

Well I mean why do you have so many useless dependencies then? :kek:

prisma wave
#

Not much else you can do then apart from removing dependencies

hot hull
#

Well "useless"

prisma wave
#

or pdm ofc

lavish notch
#
dependencies {
    //implementation "ch.jalu:configme:1.1.0"
    compileOnly "org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT"
    implementation "me.mattstudios.utils:matt-framework-gui:2.0.2"
    implementation 'com.github.brcdev-minecraft:shopgui-api:2.0.0'
    compileOnly "com.github.MilkBowl:VaultAPI:1.7"

}

//sort this out
configurations {
    compile {
        exclude group: 'ShopGUIPlus-SellGUI-1.0-all'
        exclude module: 'com.google.*'
    }
}

shadowJar {
    //relocate "ch.jalu.configme", "net.mackenziemolloy.SGPSellGUI"
    relocate "me.mattstudios.mfgui", "net.mackenziemolloy.SGPSellGUI"
    minimize()

}
prisma wave
#

shopgui can be compileOnly

lavish notch
#

you mean the api?

prisma wave
#

Yes

#

I assume it can anyway

lavish notch
#

Let me test it

#

Fantastic, it still works. Thanks

prisma wave
#

Np

hot hull
#

Anyone got any repo's I could contribute to fingerguns

prisma wave
#

pdm

#

Kotlin

#

Elara

lavish notch
#

@hot hull You want to contribute to my shit first plugin?

hot hull
#

Something which I've the braincells to contribute to BM smh

#

Mackenzie, link it

lavish notch
hot hull
#

oh god

lavish notch
#

I did say shit for a reason.

hot hull
#

Got any other ones?

prisma wave
obtuse gale
hot hull
#

Noice

throw RuntimeException("Get on the right version cunt")

steel heart
#

throw Throwable(

onyx loom
#

pdm
@prisma wave hows relocation going Kappa thonk

prisma wave
#

@prisma wave hows relocation going :Kappa: :thonk:
@onyx loom no comment

#

😦

onyx loom
#

πŸ™

heady birch
onyx loom
#

is it not java?

obtuse gale
#

πŸ€”

obtuse gale
#

@steel heart

prisma wave
#

mf-cmd vs acf

#

don't all say mf I want reasons

frail glade
#

It really depends on what you need to do.

prisma wave
#

Well they both do pretty much the same thing no?

#

As far as I know ACF gives a lot more control but it's also much more complicated

#

just wondering if there's anything ACF can do that MF can't

frail glade
#

It is a steeper learning curve.

#

Idk if Matt's has contexts completions and conditions.

prisma wave
#

I'm more familiar with acf so that's not really a problem though

#

yeah that's what I'm concerned about too

#

I know that with acf I can do pretty much whatever I need, even if it is a little complex, whereas MF might be lacking some things

onyx loom
#

havent looked at acf tbh. but mf clean af

prisma wave
#

acf is very similar

#

in basic syntax anyway

frail glade
#

It also goes back to depending on what you're trying to do.

#

If you need runtime command generations and whatnot, you could try cloud.

prisma wave
#

never heard of that

#

but I probably don't need anything that fancy

frail glade
prisma wave
#

acf's help message generation is nice, does mf have anything like that @ocean quartz ?

#

interesting

ocean quartz
#

Not yet, coming on v2 though

prisma wave
#

alrighty

#

I guess that's not a big deal

frail glade
#

I will be spending more time understanding cloud when I find a project that needs it.

prisma wave
#

all I'm really concerned about is: is there any point me learning MF when I'm already familiar enough with acf to get by with it?

#

cloud looks pretty complex

frail glade
#

ACF has done everything I've ever needed to do.

prisma wave
#

yeah same

frail glade
#

One thing I like about ACF is you can also make your own annotations

prisma wave
#

I didn't know that lol

#

seems handy though

#

I guess i'll stick with acf for now

frail glade
#

Yup. I've also written some wrapper that help with the language system so I can adapt Minimessage and whatnot

prisma wave
#

fancy

frail glade
#

But yeah, ACF is handling 100+ commands with ease.

ocean quartz
#

Not much reason tbh, only big difference and my main issue with acf is the message handling

prisma wave
#

yeah messages are a bit of a mess

#

the thing with acf is that everything works, it's just super complicated

#

now could be a good excuse to make BMF-CMD

frail glade
#

Lmao

#

Or just finish working with piggy on relocation support for pdm

prisma wave
#

very tempting

frail glade
#

What do you not like about the message system in ACF?

prisma wave
#

I think my main issue is the limited documentation, so it usually becomes trial and error to get it working

frail glade
#

That's valid. It's mainly community contributed wiki information

prisma wave
#

yeah which is a bit of a pain

#

and I seem to be banned from aikar's discord for some reason lmao

frail glade
#

It took me a bit myself to learn it

#

Oh?

prisma wave
#

Β―_(ツ)_/Β―

frail glade
#

This link doesn't work?

prisma wave
#

nope lol

#

I've got no idea why i'm banned

frail glade
#

Hmm okay

#

I'll ask

prisma wave
#

oh actually I think I joined a long time ago on another account, maybe something similar to aj's problem is happening

#

where phone number verification goes wrong or something

frail glade
#

Might be

#

One of my struggles lately was writing a clean way to have an item cache system which can on demand pass in a map for replacements. Finally got that going and integrated it into the item cache system and message system so the replacements are a lot easier.

prisma wave
#

Sounds fancy

#

am I supposed to know what replacements are or do you just mean like placeholders?

ocean quartz
#

@frail glade Personally don't like the file based message system acf has, mine is all in code, it gives you the player and you send the message you want the way you want without any hardcoded stuff

heady birch
#

kite-command

frail glade
#

That's fair

#

I think I've been able to shift to that a little bit

prisma wave
#

kinda hot

surreal quarry
#

very hot

#

plugin.handleCommand<Player>("name") { sender, args -> ...}

#

even hotter :)

prisma wave
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

ocean quartz
#

Don't think so

prisma wave
#

we'll have to agree to disagree on that one

ocean quartz
#

Same yeah

surreal quarry
#

lol

#

thats what i use for handling basic commands then mf-cmd for all the other lmao

steel heart
#

@steel heart
@obtuse gale ?

obtuse gale
#

hi

steel heart
#

Hi fofe

distant sun
#

is it only my IDE which is acting weird randomly? I want to close a project, some classes that are opened are closing and then nothing happens lol

old wyvern
#

You have other instances of the IDE opened probably

dark oar
#

Is this a channel I can get help with my code in?

surreal quarry
dark oar
#

thanks

distant sun
#

I don't @old wyvern

obtuse gale
#

you probably do

quiet depot
#

rpf > acf & mf & cloud

obtuse gale
#

if I wanna store like a reference to an image in a datbase should i be usinf like a cdn then just store the link?

old wyvern
#

rpf includes commands as well?

quiet depot
#

yes

obtuse gale
#

Can I have like

pallid gale
#

No

obtuse gale
#

k thanks

#

A has a OneToMany relationship with B which has a ManyToOne relationship with C?

#

actually im confusing myself here lol

#
class A {
    private String name;
    @OneToMany
    private List<B> bs;
    
}

class B {
    private String link;
    @ManyToOne
    private A a;
}

class C{
    @OneToMany
    private List<B> bs;
}
``` I think thats what I want lol
#

or is that a bad way to do things? It seems like it could easily get messy

hot hull
#

jesus

obtuse gale
#

lol

#

what should I do

hot hull
#

Well I mean what's the context

obtuse gale
#

So a User needs to have a connection to a List of images, and each of those images needs to have a connection to a list of staff basically

heady birch
#

class User {

obtuse gale
#

yes

#

what should do

heady birch
#

Can staff be in multiple images at once?

obtuse gale
#

wdym

heady birch
#

what is the user connection- the one who made/uploaded the image?

obtuse gale
#

each image has a staff member, multiple images can have the same staff member if thats what you mean

#

yes

heady birch
#
public class User {
  @OneToMany(mappedBy = "user")
  private List<YourImage> images;
}

public class YourImage {
  @ManyToOne
  private User user;

  @ManyToOne
  private StaffMember staff;
}

public class StaffMember {
  @OneToMany(mappedBy = "staff")
  private List<YourImage> images;
}
#

Something like that

#

Remember to add getter and setters

obtuse gale
#

each image can only have one staff member so would that change it from a manytomany to like a manytoone?

prisma wave
#

Don't add getter and setter

#

The look on James gosling's face would be so epic!

heady birch
#

think so

#

editing

obtuse gale
#

andd what does the mappedBy param do?

heady birch
#

just makes the annotations connect properly

obtuse gale
#

Does @CreatedDate actually handle it for you or do you still have to manually set it?

heady birch
#

Never used it

empty flint
#

is there a way to get the class of an instance during the instanceation of that instance?=

obtuse gale
#

interface B<X>{

}
class A implements B<Y>{

}

class C<Y>{
  @Autowired
  private B<Y> thing;
}```  can I do something like this lol?
hot hull
steel heart
#

@empty flint getClass?

frigid badge
#

@hot hull neato I'll have a look at it

heady birch
#

@hot hull you looking for contributions? draft me a group builder implementation in micrsoft doc

frigid badge
#

you can contribute to lemonmobcoins

#

;p

#

@hot hull what did you do with FileUtil lol

#

you can't use the bukkit plugin class there

#

since it's in the common package.

distant sun
#

!smart

hot hull
#

Yea I'm dumb ignore that, forgot to remove the plugin shit

static zealot
#

don't question that Lemmo. Just merge the PR!

heady birch
#

I give you classes- you implement sorted

distant sun
#

@ApiStatus.Internal from jetbrains should do the job ig

prisma wave
#

yikes compression

frail glade
#

Bruh

distant sun
#

BMF?

prisma wave
#

like MF

#

but better

#

except it's not actually called that

#

lol

distant sun
#

🀒

prisma wave
#

😦

frail glade
#

Too many frameworks

prisma wave
#

I agree

#

everyone should use mine

#

πŸ™‚

frail glade
#

But why

distant sun
#

matt's*

prisma wave
#

why not

frail glade
#

You haven't given us a reason that benefits us

distant sun
#

because there's none

prisma wave
#

this is much nicer for kotlin

distant sun
#

πŸ™‚

prisma wave
#

😦

#

no annotations

frail glade
#

Keep working on it I suppose

#

Then we'll be able to justify

prisma wave
#

it is very early stages but I think it's gonna be nicer for kotlin use

onyx loom
#

i can only support this

frail glade
#

Got a repo for it yet?

prisma wave
frail glade
#

What benefits does it bring for Kotlin?

prisma wave
#

well most command frameworks are annotation based (eg acf or mf-cmd), and cloud just seems like it would be a mess for anything big.
the benefits of targeting kotlin-first is you can have stuff like this kotlin val killPlayerCommand = command("kill", arg<Player>("target")) { target -> target.kill() }
so no annotations (much more extendable) and arguably more readable

#

the plan is you just define a file (not a class) which contains all your commands, and you're pretty much done

#
val broadcastCommand = consoleCommand("broadcast", vararg("message")) { message ->
    Bukkit.broadcastMessage(message.joinToString(separator = " ").color())
}
frail glade
#

the plan is you just define a file (not a class) which contains all your commands, and you're pretty much done
Can you elaborate a little bit on this?

prisma wave
#

Well you'd still need to register them, but rather than defining a "Commands" class which is full of annotated methods, you just have a file full of top level variables which call command()

frail glade
#

That's assuming your commands are smaller logic, right? You wouldn't want 20 big commands in the same class. Would get messy.

prisma wave
#

Indeed

#

but you'd still be able to put them in separate files, or a class

#

it just saves the overhead if you have lightweight stuff

frail glade
#

Seems pretty useful if you don't need a bunch of extra stuff ya

normal talon
#

what was the command to update your own database

frail glade
#

?

normal talon
#

I bought minecrates

frail glade
#

Okay

#

Well, cube will have to update the database when he wakes up and then you can use the =check command.

normal talon
#

I cant use check

#

no perms

onyx loom
#

spigot check

frail glade
#

Ahh yeah, you guys have something different.

prisma wave
#
val messageCommand = playerCommand(
    "message",
    arg<Player>("target"),
    vararg("message")
) { target, message ->
    target.sendMessage("&6${sender.name} &7-> &6you: &7${message.joinToString(" ")}".color())
}
``` simple but effective πŸ™‚
normal talon
#

but why can't I download the plugin tho

frail glade
#

Sometimes paypal holds for 24 hours.

#

If you can't download it, the PayPal transaction hasn't fully completed.

#

Looks cool BM

prisma wave
#

ty

normal talon
#

the money was sent, I will wait then.

still lintel
#

Is there a way to detect the name of an inventory? I need to ensure it's something specific (this is for automation).

distant sun
#

Inventory#getTitle

frail glade
#

Yup, sent != Received. I'd say wait 24 hours and if it's still not letting you download, mention it again.

#

I'm pretty sure that was removed in like 1.14? Maybe 1.15?

#

Pretty sure you have to get the inventory view and then the title.

still lintel
#

@distant sun Would that work with something like this?

#

Oh I can't send images

compact perchBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.

still lintel
#

I'll dm you it

#

Ah ok

distant sun
#

please no

still lintel
normal talon
#

not equals to recevied ?xd what

still lintel
#

I blurred the name as it's for automation (which isn't allowed on the server) but

frail glade
#

Just because it was sent doesn't mean it was received.

normal talon
#

but what if he doesnt recieve ?

frail glade
#

PayPal often will hold for up to 24 hours.

#

Well he doesn't have it setup to be manually accepted, so, it'll either clear or the money will come back to you.

normal talon
#

oh same thing with vk pfff

distant sun
#

cant you use a custom inventory holder that takes two parameters? @still lintel

frail glade
#

You've probabaly done some sus stuff lately then.

distant sun
#

player1, player2

still lintel
#

I'm wanting to make a mod for automation I've got it to use a form of baritone to find the player and trade but it has some querks

#

I'm needing it to double check the name of the inventory of the trade menu then to select the slot

#

From testing if someone else sends the alt a trade request it will auto accept thinking that is the target

#

Btw this is for automation moving items got from alts just scripting mining cobble endlessly to deposit the cobble to a target

frail glade
ocean quartz
frail glade
#

The new UI is so sexyyy

distant sun
#

Pics?

#

Oh damn

hot heron
#

Does anyone have a good resource that talks about the Singleton design pattern?

#

Definitely gonna Google it on my own, was just wondering if anyone had a preferred resource

soft remnant
#

There they helped me, later I realized that.

hot heron
#

That's for more specific issues. This is more of a general one

soft remnant
#

I understand, I'm quite confused with this discord even xD

ocean quartz
#

@hot heron Singleton pattern generally isn't a great idea

#

@soft remnant I mean it's pretty simple, #development is on the support category, this one is on general, general normally is just for chilling and talking about random dev things

hot heron
#

Yeah, I just was looking into learning more about it. It seems like I see a lot of singleton or pseudo singletons from plugin devs

#

And was wondering if plugins were meant to be singletons

#

But I'm just learning random things

ocean quartz
#

Many people use the main class of plugins as singletons, which they kinda are but not really, since there is only one instance of it
But doesn't necessarily mean you have or should use singleton pattern with it

cloud raptor
#

Hey matt

ocean quartz
#

Heyo, i cannot, sorry

cloud raptor
#

Damn ok

ocean quartz
#

It's pretty late for me so I'll be heading out, but just be a bit more patient and someone will help ;p

obtuse gale
surreal quarry
#

a classic not null nullable :)

ocean quartz
#

First one is ugly

hot hull
#

What a smart man

steel heart
#

final @NonNull @Nullable or @NonNull @Nullable final?

quiet depot
#

@ocean quartz the main class of a plugin is definitely an intentional singleton, and is one that’s actually enforced afaik. While singletons aren’t great, you really have no control over the fact that this is indeed a singleton, so you should therefore use it as one.

obtuse gale
#

how come proper names arent used for generics?

#

How come its always like one letter like T or something

prisma wave
#

To distinguish them from an actual type probably

quiet depot
#

@hot heron like someone else said, singletons generally aren’t a great idea, as they couple your code to it’s implementation, making it effectively untestable by conventional means (i.e. unit tests). So, the alternative is to simply carefully manage your instances, such as in the case of constructor dependency injection. You’re merely ensuring that the same instance is being passed around, but this isn’t enforced, and is therefore not a singleton. Something important to note, is that di frameworks such as guice have β€œsingleton” annotations, but these are not true jvm singletons, they’re just the careful instance control I described above.

#

tl;dr dependency injection > singletons

hot heron
#

Makes sense. I've just been trying to really dial down on why I do certain things or advocate for certain methodologies

quiet depot
#

singletons also go against oop

prisma wave
#

A singleton is just static in disguise

onyx loom
#

@steel heart annotations first imo

hot heron
#

And I saw a lot of people doing the whole getInstance() thing and it's always seemed wrong to me

#

Not just with the JavaPlugin class, but other classes as well

steel heart
#

@onyx loom yo same

#

Well the JavaPlugin.getPlugin is an IoC and I’d say that a static singleton for your java plugin main isn’t too bad

#

It’s only going to be one instance of it anyways so in a practical POV it’s not bad but PiggyPiglet and Alex have some good points

hot heron
#

I think my biggest setback with oop is just the right way to organize my classes efficiently. Especially in plugins where you don't have full control

distant sun
steel heart
#

I think solid and the principles should be more of a blueprint than a strict format and something that everyone is forced to follow

#

I mean no one is forced to follow it but if you don’t you’re certainly gonna get flamed

distant sun
#

ok time to learn how to use a maven repo lol

obtuse gale
#

I made something with generics :))

distant sun
#

oo

prisma wave
#

I think my biggest setback with oop is just the right way to organize my classes efficiently. Especially in plugins where you don't have full control
@hot heron as opposed to what?

#

Procedural / functional?

hot heron
#

No no, just like the overall design. I think I psych myself out a lot. But I can never figure out exactly the way I want to setup my structure

prisma wave
#

Yeah writing clean code is very difficult

#

I think learning design patterns helps a lot

hot heron
#

Small scale isn't bad. Like for instance, if it was custom stats for Mc, then the Stat itself would be easy for me, but setting up the system itself is where I'd start to psych myself out

prisma wave
#

Yeah, I find trying to scale OOP code is very difficult too

#

Usually becomes a horrible mess

hot heron
#

I'm a bit of a perfectionist too so I have a hard time doing things in a way that I don't feel is great

#

Like most of the time I just see people with a singleton style manager that handles some stats stuff but that just feels gross to me

prisma wave
#

Because it is

hot heron
#

Yeah, some people are capable of overlooking those things but it's hard for me. (not that that's a bad thing haha)

#

Especially since I want to learn the right ways to be prepared for professional development

prisma wave
#

I think generally there's always going to be improvements that you could try and make (or at the very least refactors), you have to find the balance between something messy and something overengineered

hot heron
#

Doesn't help that as a system, Bukkit is inherently flawed

prisma wave
#

Indeed

#

Bukkit development seems to encourage bad practices a lot (or the community does at least)

hot heron
#

I'd say it's because a lot of people start their learning with it

prisma wave
#

I think Spring Boot is pretty good for learning actually clean Java, because it encourages it a lot

#

Until you get to AbstractFactoryFactoryProvider

#

Yeah the majority of Bukkit developers are self taught with very little knowledge of clean coding techniques

hot heron
#

And it's just "easier" to make stuff static and do hacky workarounds

obtuse gale
#

imagine knowing java before bukkit

frigid badge
#

but bukkit == java

distant sun
#

🧠

obtuse gale
#

but java == time, copy + pasting doesnt

distant sun
#

Anybody want to diss some code?

obtuse gale
#

@sxtanna... oh wait

onyx loom
#

πŸ™

steel heart
#

@prisma wave would you say LuckPerms is over engineered even the slightest?

#

It’s not bad code but some of the code got perhaps 3+ abstraction layers

hot hull
#

@steel heart If you want api examples, lp is a gold mine

quiet depot
#

@steel heart it’s not

#

everything is comparatively under-engineered

#

lp isn’t my goto project for good code examples anymore though, I’d recommend looking at sponge for that purpose

#

not to say that there’s something wrong with lp, sponge is just better

hot hull
#

Sponge is supreme

#

Piggy, did you happen to test my papi pr?

#

Cause I've not, got 3 exams next week, as well as driving license classes every day, and 2 exams this week, so I'm basically fucked

steel heart
#

Hmm I haven’t tried sponge but other said it’s over engineered so really hard to know

prisma wave
#

@steel heart no idea, I've never looked at the codebase in much detai

heady birch
#

i will have to relook at it. there was something i did not approve

half harness
#
'TabCompleter' is abstract; cannot be instantiated
```How do I fix this? ```this.getCommand("protocolperworld").setTabCompleter(new TabCompleter());``````public class TabCompleter implements TabCompleter {```Anyone have any idea?
hot hull
#

Don't name it that

half harness
#

wdym

hot hull
#

Since you're importing the wrong one clearly

half harness
#

oh

hot hull
#

Name it MyTabCompleter or some shit

half harness
#

k

#

wait

#

Is it possible to rename a class?

hot hull
#

Refactor yes

half harness
#

wut?

#

oohhhhhhhhhh

#

ok

#

thanks!

hot hull
#

That's why you don't stuff like that

half harness
#

I didn't think of that :P

heady birch
#

StandardPPLTabCompleter
DefaultPPLTabCompletor
PPLTabCompleterImpl

prisma wave
#

No thank you πŸ™‚

steel heart
#

IDefaultAbstractBeanFoctoryProviderImpl

half harness
#

😦 protocolsupport api is so confusing

obtuse gale
#

Dammit Conclure, you forgot the .Builder nested class

#

smh πŸ˜”

steel heart
#

oh wait sorry

#

IDefaultAbstractBeanFoctoryProviderImpl.IBuilder.AbstractBuilder.BuilderImpl,BuilderPipelineSupplier

ocean quartz
#

Question, what would be, in your guys opinion, a good config lib?

frigid badge
#

supporting comments, supporting migrating of all config entries even multi line entries, default values, easy accessing through a nice api and good serialization

ocean quartz
#

Thank you, found a big limitation to ConfigMe that i really need, so really been considering writing my own or heavily modifying a fork of it

prisma wave
#

actual kotlin support

hot hull
#

Matt, u got any repos I could contribute to?

prisma wave
#

One thing I'd like is to be able to specify that you want a String and if there's a List, it gets joined with \n as a separator

hot hull
#

@frigid badge I'll push the change for the FileUtil tommorrow so you can accept the pr

frigid badge
#

neato, when you are working on it, fix the entire plugin as well kthx ❀️

ocean quartz
#

@hot hull Go write the rewrite to mf-cmds fingerguns
And i want that too BM

frigid badge
#

πŸ˜›

hot hull
#

I'm busy Lemmo

frigid badge
#

@ocean quartz you should look into Dynamic

#

could be useful

hot hull
#

In two weeks when I've got 1 week free I'll see

ocean quartz
#

Can you link me?

hot hull
#

@ocean quartz Issue is I don't think I've got the braincells to do that

ocean quartz
#

Aight, so if you want a quick "easy" contribution i think i have something for you

hot hull
#

Why does hacktober have to be just when I have a shit ton of exams ;(

frigid badge
#

also internationalization another feature

#

you'd want for the config lib

hot hull
#

"internationalization"?

#

As in multilang support?

ocean quartz
#

Ty Lemmo ;p

prisma wave
#
val locations = mutableListOf<Location>()

val locationsCommand = command("locations") {
    root aliasOf "list"
    
    subcommand("all") aliasOf "list"
    
    subcommand("list", arg<Int>("limit").optional()) { limit ->
        reply(locations.take(limit ?: locations.size).joinToString("\n"))
    }

    subcommand("create", sender<Player>()) {
        locations += sender.location
    }
}

thoughts on this?

hot hull
#

Annotations seggsier

prisma wave
#

absolutely not

#

i have come to realize that sxtanna was right

#

annotations are evil

steel heart
#

Alex do you know like more in detail how the message channel works, does it always have to take a player?

prisma wave
#

:what:

steel heart
#

yeah like the PluginMessageListener or what its called

prisma wave
#

oh right plugin messaging

#

yes it needs a player

steel heart
#

fukk

prisma wave
#

since it uses their connection to actually send the data between servers

steel heart
#

as I thought woaw

#

so is it possible to avoid this or do a workaround?

frigid badge
#

no

soft remnant
#

@soft remnant I mean it's pretty simple, #development is on the support category, this one is on general, general normally is just for chilling and talking about random dev things
@ocean quartz I get it.

frigid badge
#

you'll need to use a seperate connection

#

plugin messaging relies on the player no way to not do that

#

you need to make your own socket connection or smth like redis etc

steel heart
#

aww man

frigid badge
#

but what for data do you need to send?

prisma wave
#

elara will come with a native fix for this

frigid badge
#

cause what I for example use in one of my plugins is queuing plugin messages

steel heart
#

Uh I was thinking
backend -> proxy -> (all other) backend
mainly for updating data

prisma wave
#

sockets perhaps

#

http

steel heart
#

or would tcp be good?

prisma wave
#

depends what you're sending

#

sockets effectively are TCP afaik

#

you probably want to use some sort of protocol for the data (eg protobuf or CBOR)

frigid badge
#

sockets don't need to be tcp?

prisma wave
#

true

#

they could be UDP

#

in kotlin?

frigid badge
#

final variable

prisma wave
#

yeah

#

val a = 3
final int a = 3;

#

kotlin vs java

steel heart
#

okay I need to read on some shit here jesus well, should I try implement my own type of connection or what do you guys suggest?

frigid badge
#

not an exact match

#

final var a = 3;

#

smh

prisma wave
#

the 2 lines are effectively equivalent?

#

oh true

#

but java 10 isn't mainstream yet

#

@steel heart what I would do is sockets + some sort of serialization utility

frigid badge
#

idc about mainstream

#

lts

prisma wave
#

that's not valid C# afaik

ocean quartz
#

But what means Val
Means value

prisma wave
#

isn't it Console.WriteLine?

frigid badge
#

^

#

c# sucks though

steel heart
#

elera websockets specifically?

frigid badge
#

kotlin much better

prisma wave
#

@old wyvern

#

whoops

#

lol

ocean quartz
#

Kotlin for .net when

prisma wave
#

@steel heart Well a socket is basically a UDP / TCP connection, so yeah that's probably the cleanest way of doing it (and most lightweight) assuming you don't want to rely on bungee

if your data doesn't need to be reactive you could use something like redis instead (eg as a cache for player scores or something, just query a redis server rather than accepting "packets" to update the score)

#

there's a reasonable chance I've said something wrong there though, so take it with a pinch of salt

steel heart
#

Well I assume TCP would be good since it works with callbacks kind of right?

prisma wave
#

again it depends

#

TCP if you need to make sure that the data is valid, UDP if minor data loss isn't that big an issue

frigid badge
#

udp is for like streaming stuff

steel heart
#

Oh well TCP defo also WebSocket or a TCP Socket?

frigid badge
#

you just keep sending everything

#

not caring about it

steel heart
#

ah yes

frigid badge
#

see no reason to use a websocket in a non web environment?

steel heart
#

What does Redis use?

prisma wave
#

redis is a database that stores everything in memory

frigid badge
#

but at the same time why not use redis for this

prisma wave
#

so it's probably queried with TCP but idk

frigid badge
#

yes connecting to redis is using a tcp connection

steel heart
#

But with redis I could easily set up some type of data update enviroment?

frigid badge
#

yea

steel heart
#

Oh this is a database

frigid badge
#

an in-memory key-value store

prisma wave
#

redis is a database that stores everything in memory
@prisma wave πŸ™‚

#

hashmap

#

basically

frigid badge
#

you can use it for a lot of things

steel heart
#

So where should I start? Like what do I need for this to work, I already know the database but except that? Which dependency would I be using?

frigid badge
#

caching, queue's, actual storage etc

steel heart
#

Their website got a lot of stuff

frigid badge
#

redis isn't sql

steel heart
#

It sounds convenient

prisma wave
#

Jedis is pretty popular

frigid badge
#

idk never used redis in java

prisma wave
#

Same

frigid badge
#

I rarely use java nowadays 😭

prisma wave
#

What do you use instead

#

Elara I hope

frigid badge
#

it ranges whatever my boss throws at me

#

which is never java cause I'm the only one that has knowledge of that language at a good enough level

steel heart
#

lol what

prisma wave
#

shame

frigid badge
#

yeah I've tried convincing em

prisma wave
#

get them to learn elara

#

let πŸ™‚ πŸ‘

steel heart
#

let var const val

prisma wave
#

no thank you

#

union types

#

struct

#

let

steel heart
#

I mean why does javascript even have both let and var

#

feels unconvenient

prisma wave
#

because they do different things

#

in terms of scoping afaik

steel heart
#

yeah

prisma wave
#

idk the actual difference but there is one

steel heart
#

iirc let is just the current scope and var can be same and inner scopes

#

or smtng

prisma wave
#

javascript

#

elarascript

steel heart
#

lol

#

elera-ify

#

stuff

onyx loom
#

elara everything

steel heart
#

ye

frigid badge
#

basically var sucks

#

and you use let

prisma wave
#

let

steel heart
#

ok would it under any circumstances be beneficial to use var still?