#dev-general

1 messages · Page 204 of 1

obtuse gale
#

Other 3 yrs he made a ton

prisma wave
#

👀

obtuse gale
#

With many customers

#

So yea

#

Should I go dev or photoshop ?

prisma wave
#

up to you

#

they both pay pretty well

obtuse gale
#

I really wanna tryout dev

onyx loom
#

its ur life, lol

prisma wave
#

so do whichever you think is more fun

onyx loom
#

maybe try both, and see which u prefer

#

ya

obtuse gale
#

It’s interesting and very demanded in the French community of modded pvp faction

#

So like I need to learn everything to make a server so like plugins + how to add new items in the game with effects and stuff

prisma wave
#

If you want plugins and mods then sponge is probably best

obtuse gale
#

The sad thing about minecraft is that you can literally make a server with the online plugins

#

The free to use

#

So it sucks

#

But yea. I’ll work with big servers which really need to make some different and never seen content

old wyvern
#

What sucks?

obtuse gale
#

It sucks for the devs that want to make money since you can make a server up without any dev

#

Like from internet

#

You just copy and paste

old wyvern
#

Nothing wrong with that?

obtuse gale
#

Yes nothing wrong

old wyvern
#

Why remake the wheel for everyone

obtuse gale
#

No I’m sorry

#

I apologize

prisma wave
#

It's difficult to make a fun server without custom things

obtuse gale
#

Yes I know

#

That’s why they always stay little

#

So if I get ever called it’s gonna be for bigger servers

#

But I first need to learn other a lot of time

#

Okay so I use sponge ?

#

I write sponge minecraft and can find it?

prisma wave
#

yeah, learn Java and then read through the Sponge API docs

obtuse gale
#

@prisma wave how long have you been coding

prisma wave
#

about 4 and a half years

#

I started late 2015 iirc

obtuse gale
#

How old are you now ?

prisma wave
#

16

obtuse gale
#

Damn

#

Lucky

prisma wave
#

I guess lol

obtuse gale
#

What do you use your knowledge for ? Getting payed to do work or for your own server?

#

Do you know if sponge works under minecraft under launchers ?

prisma wave
#

I started learning for my own server but I mostly work for money / fun now

#

wdym?

#

sponge is for forge iirc

#

idk, not used it much

obtuse gale
#

Cuz french faction servers are mostly modded with a custom everything

#

Like it’s under laucher

prisma wave
#

oh yeah

old wyvern
#

Arent factions usually not modded?

obtuse gale
#

Yes

#

But French versions yes

old wyvern
#

Havent seen any modded factions server atm

obtuse gale
#

It’s very different

old wyvern
#

Ah

#

I see

obtuse gale
#

So for exemple the server is called hypixel

#

It’s a laucher you click on it you log on it

#

And it opens a custom minecraft

#

You click join and basically everything is different and custom

old wyvern
#

Huh

obtuse gale
#

But you still keep all minecraft items

#

The inventory is different

#

Many other things are different

#

Is it basically the same then normal minecraft in terms of developing it or no

#

What is HelpChat ? I just typed discord for minecraft dev

onyx loom
#

help server for minecraft plugins mostly

#

mainly for clip's plugins

obtuse gale
#

Okay

#

And what’s the difference from plugins modding

old wyvern
#

Bukkit plugins are specifically server-side, while mods may be both server-side and client-side

ocean quartz
#

@prisma wave I think i figured my problem, when publishing it doesn't include the stuff on the plugin itself, for example, kotlin, spigot, the dependency i was trying to do, so when the plugin is getting added it'll search for the dependencies since it'll be on the pom

prisma wave
#

oh yeah

#

pdm had the same problem

#

It's not easy to fix 🙂

#

I had to make a custom shading method that shaded all the plugin's dependencies without including them in the published pom

ocean quartz
#

Tell me about it, nothing so far has been easy xD

prisma wave
#

ofc not lol

ocean quartz
#

Gradle is so poorly documented that i am surprised there are so many plugins
Gonna see if i can copy your method xD

prisma wave
#

good luck

#

it's a mess lol

ocean quartz
#

Also, plugins that can be used in the plugins block are only the ones on the main gradle repository right?

prisma wave
#

yeah I think so

lavish notch
#

What's the easiest way to get a ItemStack from a string?

IE:

"STONE" -> Stone ItemStack

surreal quarry
#

Material.parse something iirc

prisma wave
#

Material.matchMaterial + ItemStack constructor probably

surreal quarry
#

might be wrong

#

yea that ^

lavish notch
#

Have I done something wrong?

onyx loom
#

call ItemStack constructor

lavish notch
#

I'm not too sure what that is

obtuse gale
#

new ItemStack (material)

lavish notch
#

cheers

naive pelican
#

@obtuse gale I'm 20

hot heron
#

@obtuse gale Just put some time into it first and if you hate it, try something else out instead

obtuse gale
#

Hey

naive pelican
#

ye

obtuse gale
#

Ok

naive pelican
#

also it has more use if you own a minecraft server to test things out on

obtuse gale
#

And what is dev in part of your life?

naive pelican
#

but you first have to actually learn java

obtuse gale
#

Full time job ?

naive pelican
#

well I'm in college

#

so no dev job for me

hot heron
#

Same

obtuse gale
#

So what is it

hot heron
#

Last semester right now

naive pelican
#

I do work for some minecraft servers

#

nice

obtuse gale
#

And how much you made around in how long?

umbral mica
#

I'm still doing my education, but a lot of my free time is dev-related things, either chatting w/ devs in places like this, support for stuff, or actually programming

naive pelican
#

idk lol

hot heron
#

tbh I haven't made any money from dev yet haha

obtuse gale
#

How long you dev?

naive pelican
#

@umbral mica ye same on that one. It's just a hobby that mostly consists of developing things and supporting people (big part)

#

Oh really @hot heron

hot heron
#

Well I haven't really tried to make money yet haha

obtuse gale
#

It’s just “fun” ?

naive pelican
#

I think I make like €300-500 a month from minecraft dev things

umbral mica
#

I've been programming since nov and haven't made any effort to profit from my skills yet

#

(programming as in actually programming, I'd been fucking around with arduinos and such for many years before)

obtuse gale
#

@naive pelican how do you make that money?

naive pelican
#

that's one way of programming things

obtuse gale
#

Sell your progams or what?

naive pelican
#

@obtuse gale custom projects, spigotmc, sponsorships, website ads

obtuse gale
#

What?

#

How do you make money from website ads

#

And what sponsor?

#

Where do you find people in need of devs this is the real question

onyx loom
umbral mica
hot heron
#

It's not just for fun for me. I will start trying to get a job in programming very very soon

#

But I'm just focused on finishing my last semester because the burnout is real

obtuse gale
#

Yea but

naive pelican
#

How do you make money from website ads
@obtuse gale I got a website, google adsense (and another provider), people watch, I get money

obtuse gale
#

That’s not really big

naive pelican
#

But I'm just focused on finishing my last semester because the burnout is real
@hot heron I feel you buddy

obtuse gale
#

@naive pelican where do you get the people in need of service from?

#

Oh you got a channel ? What is it

naive pelican
#

idk my Discord server or SpigotMC DMs

#

people just come to me like Yo i need a plugin

#

but I don't think you should be focused on making money from developing minecraft plugins.

umbral mica
#

^

#

I do it for the fun not the $

naive pelican
#

exactly

#

and if you're lucky, you can get some cash out of it

#

period

onyx loom
#

^, i feel like ur too focused on the money. if u dont enjoy programming, u shouldnt do it

hot heron
#

@naive pelican I switched majors twice too 😛 I'm 27

obtuse gale
#

Meh

naive pelican
#

programming really isn't going to be fun if you don't like actually doing it

prisma wave
#

^

naive pelican
#

@hot heron what y doin now?

hot heron
#

^, i feel like ur too focused on the money. if u dont enjoy programming, u shouldnt do it

prisma wave
#

The real reward for me has definitely been the hobby and the stuff I've learned rather than any amount of money

naive pelican
#

ye

hot heron
#

Started as Chemical Engineering, went to CIT because the guidance people didn't know what they were talking about

naive pelican
#

most of the time it's just boring typing characters in a way that makes sorta sense

hot heron
#

and then ended up at Software Engineering

prisma wave
#

most of the time it's just boring typing characters in a way that makes kinda sense
@naive pelican when you reach that point, just learn a new language

naive pelican
#

ah nice

#

I'm doing Software Engineering as well

prisma wave
#

Then there's a whole new combination of letters to type fingerguns

hot heron
#

They told me backwards for CIT vs CS

#

Took me two semesters to realize

surreal quarry
#

learn vim

#

that'll keep you busy

prisma wave
#

Don't do that

naive pelican
#

@naive pelican when you reach that point, just learn a new language
@prisma wave I mean that's not what I think. I enjoy it. Otherwise I wouldn't be studying it

umbral mica
#

but why would you need vim

surreal quarry
#

you dont really lol

#

it was kinda a joke

#

but i like it

prisma wave
#

@prisma wave I mean that's not what I think. I enjoy it. Otherwise I wouldn't be studying it
@naive pelican even if you enjoy it, it's possible to get bored. I love learning new languages even if I never use them

#

I'm basically a Clojure expert for example

naive pelican
#

ye true

surreal quarry
#

im an elara expert 🤓

ocean quartz
onyx loom
#

shadow 🤢

prisma wave
#

im an elara expert 🤓
@surreal quarry in 2021 everyone will be an elara expert

surreal quarry
#

shadow jar removing gradle files wack

prisma wave
#

pdm would never

surreal quarry
#

theres probably a way to tell shadow jar to stop being stupid

naive pelican
#

oh look at that I reached level 5

surreal quarry
#

idk if minimize() might cause that if you have it, but thats my best guess lmao

#

actually idk if that does anything when you reload the gradle project

ocean quartz
#

Nah that is legit just adding the plugin, not even running anything kek

prisma wave
#

oh look at that I reached level 5
@naive pelican Do =github for free level 10

#

Ish

ocean quartz
prisma wave
#

No

#

In the pdm-gradle buildscript there's some shading wizardry iirc

naive pelican
#

@prisma wave in bot commands?

prisma wave
#

Yea

#

If you link your GitHub you get 1k xp

naive pelican
#

welp

umbral mica
#

@GCNT Do =github for free level 10
Isn't asking for people to star the repo in return for a reward against discord tos?

#

*GH

ocean quartz
#

I'm assuming it's this stuff

configurations {
    unzip
    shade
    compileOnly {
        extendsFrom unzip
        extendsFrom shade
    }
}
prisma wave
#

Yeah that's it

#

Isn't asking for people to star the repo in return for a reward against discord tos?
Hopefully not

naive pelican
#

@umbral mica you can just unstar it after, right..

#

that's what I do woops 🙂

prisma wave
#

Correct

naive pelican
#

I'm only level 6 now :/

#

more tricks?

hot heron
#

I lied, I have made money from dev. I'm a TA for a CS class lol

prisma wave
#

None that I know of

#

Boosting gets you a X2 multi

onyx loom
#

pay to win Kappa

ocean quartz
#

Now to see if that fixed my problem

naive pelican
#

ok well that spigot linking thing is broken

ocean quartz
#

Not errors though which is nice

naive pelican
#

has a bug*

#

btw yall, is there any good way to get contact details of a spigot user like they do here? API?

onyx loom
#

Spiget? or is that just for resources?

naive pelican
#

that's just resources

#

unfortunately

ocean quartz
#

Uuh spiget does it all?

naive pelican
#

nah it doesn't return such things as details

#

I think

ocean quartz
#

Oh you want more stuff
No what Barry uses is basically reading the html iirc

naive pelican
#

oh huh

#

thought that wasn't possible because of cloudflare

ocean quartz
#

It is but cloudflare definitely makes it harder

surreal quarry
#

what does it do matt

ocean quartz
#

The plugin adds the dependency to the project with the annotation, then once you build the project it'll scan your files for a class annotated with that and if it finds it it'll add the path to the generated plugin.yml

surreal quarry
#

oh nice

prisma wave
#

Very nice

umbral mica
#

how does it handle multiple things being annotated?

surreal quarry
#

blows up

#

would be the only logical response

prisma wave
#

deletes the plugins folder

#

Hopefully

ocean quartz
#

Well, for now it'll check if it also extends JavaPlugin, if still has more than one is found it'll ignore after the first

surreal quarry
#

sudo rm -rf /* is actually th best option

prisma wave
#

--no-preserve-root 😍

ocean quartz
#

I mean if you have 2 classes with it, it's user error

#

I guess i could make it not compile

surreal quarry
#

throw a lot of exceptions all at once

#

maybe enough to freeze their computer for their mistakes

umbral mica
#
while (true) {
  throw new RuntimeException();
}
surreal quarry
#

recursive exception throwing

#

actually that probably wouldn't work now that i think about it

ocean quartz
#

Also BM idk how PDM does it but it only lets me add the dependency if i do it afterEvaluate ;o

prisma wave
#

Huh

#

I didn't even know that existed

#

Pdm just does it in the method of Plugin, can't remember what it's called

#
while (true) {
  throw new RuntimeException();
}

@umbral mica that would break from the loop lol

umbral mica
#

oh shush it's called pseudocode

prisma wave
#

🙄

#

Excuses

ocean quartz
#

Why gradle why

obtuse gale
#

lmao

ocean quartz
#

@prisma wave Sorry for pinging so much, but i might require your big brain again
It doesn't seem to have any issue with shade for kotlin, but spigot is giving me NoClassDefFoundError, did you encounter that at any poing?

young kettle
#

is there a way one could limit the interval between which players can activate a button/lever?

surreal quarry
#

make a list of uuids on cooldown

#

or a map of that and when they went on cooldown

#

then cancel the event if they are on cooldown

ocean quartz
#

Aaaaand fuck... my idea won't work, trying to instantiate a class requires all it's dependencies 😩
Gonna have to find a different solution

young kettle
#

ah thanks james!

onyx loom
#

matt get some sleep today 😩

ocean quartz
#

No 😩

ocean quartz
ocean quartz
hot hull
#

Wait what's the point of this?

#

I'm confused

umbral mica
#

auto-gen plugin.yml I think

hot hull
#

I see, I mean mc dev does that for you so theotherpig

umbral mica
#

no like as in there's a config section in your gradle where you punch in the things and it formats it appropiately

#

plus it autodetects the main class with the annotation that matt's been working on for 2 days now

ocean quartz
#

Mc dev?

hot hull
#

Okay yea nah not the same then, neat then Matt

umbral mica
hot hull
#

Any reason why you don't just scan classes and just check if it extends JavaPlugin?

ocean quartz
#

Took me way too long to get the detection working xD
Can't do that unfortunately
Plus not every main class actually extends JavaPlugin directly

hot hull
#

Well I mean every plugin main class will extend it, and everything will get initialized within it

old wyvern
#

There could be an intermediate abstraction frost

#

Like that other lib someone sent earlier this week

ocean quartz
#

For example my plugins extend TriumphPlugin, which extends JavaPlugin, if I were to check I'd get the wrong parent

hot hull
#

Ah I see

ocean quartz
#

Also since when is ASM part of the jdk?

old wyvern
#

wdym?

ocean quartz
#

The lib

hot hull
#

No clue what ASM is

old wyvern
#

I dont think it is part of the jdk

ocean quartz
#

ASM is a bytecode editing lib

#

It is now

#

"now"

#

It's on the jdk 8 somehow

old wyvern
#

Wait really?

ocean quartz
#

Yeah

old wyvern
#

TF

hot hull
#

What in the

ocean quartz
#

It's what saved me, i was getting a bunch of NoClassDefFoundError but since it's in the jdk I don't need to worry about it

obtuse gale
#

Wait so what's the difference between this and mcdev

umbral mica
#

mcdev just generates the boilerplate stuff for you one time

obtuse gale
#

And what does this do

#

Is it like if you refactor your main class or something it'll update in plugin.yml?

ocean quartz
#

Basically there is no plugin.yml, you don't need the file

#

Gradle will generate it for you
I'll show an example tomorrow once it's a little closer to being done

obtuse gale
#

oh right

#

what if you wanna add like authors and stuff to it

#

and stuff like a load tag

prisma wave
#

@ocean quartz did you fix the NoDef error?

obtuse gale
#

I wanna make something cool but idk what to do :/

static zealot
#

I know what. something cool

obtuse gale
#

Thanks for the suggestion

prisma wave
#

Skript 2

#

But actually good

static zealot
#

and call it 2kript

old wyvern
#

Skript

static zealot
#

2kript > java > skript

obtuse gale
#

how do you make a skript thats actually good lol

old wyvern
#

ElaraScript > Everything else
k tnx bye

prisma wave
#

^

static zealot
#

^

old wyvern
#

how do you make a skript thats actually good lol
Contribute your soul to elara

obtuse gale
#

^

static zealot
#

^

obtuse gale
#

wait a ding dang minute

#

no

#

elara not good

#

you’re just bad

static zealot
#

someone ban this man before I destroy his entire life

obtuse gale
#

p

old wyvern
obtuse gale
#

whats so bad about skript?

static zealot
#

I dk. I know that the worst part are the users of skript

#

bcz they dk how to actually code and just make very bad skripts in terms of performance

#

and then sell them

prisma wave
#

Pretty much

static zealot
#

as if they were premium plugins

prisma wave
#

As a concept it's not bad

static zealot
#

^

old wyvern
#

it could have been executed a bit better tho. I mean currently to do anything you need 5 windows of each extensions documentation open

#

Because every sentence structure matters

static zealot
#

like its just better to learn java instead of actually learning skript

old wyvern
#

mhm

obtuse gale
#

On a completely unrelated note does spring work with spigot lol

prisma wave
#

There's a reason programming isn't done in natural language

old wyvern
#

One of my friends asked me to use skript to make this logger and I fucking bet you I wasted most of my time just looking for the right way to write a statement

#

And each extensions seems to bring in there own take on english

prisma wave
#

yeah

#

Very messy

old wyvern
#

mhm

obtuse gale
#

idk what to make lol

#

One of my friends asked me to use skript
And you consider that braindead to be a friend?

old wyvern
#

M8 calm your tits

obtuse gale
old wyvern
#

😂

obtuse gale
#

I hope you considered your relationship with that human being 🙄

#

Tsk

#

idk what to make lol
EssentialsZ

static zealot
#

EssentialsY ....

#

when?

obtuse gale
#

yeah

#

Y

static zealot
#

EssentialsZ is a plugin that will go in a different way than EssentialsX

old wyvern
#

Welcome to Pokemon: Essentials

obtuse gale
#

sounds not good

prisma wave
#

EssentialsXY

obtuse gale
#

ElaraX

#

When

#

Joke's on you, elara will never be superseded :^)

#

sounds like just a shitty version of the current essentials

prisma wave
#

Joke's on you, elara will never be superseded :^)
@obtuse gale elara 2

#

Coming soon

obtuse gale
#

™️?

prisma wave
#

Yes

obtuse gale
#

:0

prisma wave
#

new features:
None

#

doesn't need any new features

obtuse gale
#

Bump version

obtuse gale
#

This is very frustrating lol

#

it shouldnt be possible whats happening

#

basically if two maps are next to each other then it decides to combine them

#

idk if im being weird or spigoots being weird

distant sun
onyx loom
#

😮

obtuse gale
#

XYZ was a series I'll forever cherish 😭

hot hull
onyx loom
#

🤣

prisma wave
#

Elara:

frigid badge
#

'I suck'

prisma wave
#

☹️

hot hull
#

Such harsh language Lemmo

frail glade
#

Whelp. 1.16.4, here we come.

#

Probably should do my 1.16.3 releases, eh?

onyx loom
#

is 1.16.4 out or just announced?

regal gale
#

Okay, final answer

#

Should I even have module dependency require on js expansion?

hot hull
#

@frail glade What are the changes?

static zealot
#

Should I even have module dependency require on js expansion?
I don't even know what you're asking xD

frail glade
#

It's only announced, unsure of changes. Might be on JIRA.

regal gale
#
var pg = require('pg') //module loader (PostgreSQL)
pg.query()```
#

@static zealot

static zealot
#

well no I meant idk what you are asking because I don't understand the terminology so I can't answer xD

regal gale
#

It's called "node_module" iirc

static zealot
#

no no you don't understand me. I have no knowledge about what you are trying to do / doing. So I can't answer at all. I just said it to let you know I'm not just ignoring you.

regal gale
#

Alright

ocean quartz
#

@ocean quartz did you fix the NoDef error?
@prisma wave Not exactly, well i don't know why it was happening, but so far it stopped just because i am not really shading anything anymore
But i might wanna try fixing it just in case i need it again which i might

#

Apparently asm is part of the jdk

static zealot
#

if anyone got an idea and can help me. So basically I have a ptero panel set on my dedi and I forgot to renew my encryption certificate. My panel was completely broken but Piggy helped me renew it but now I can access the panel but can't access the console. Well I can access it but its not working at all and I get this error: https://i.imgur.com/xStgyJV.png. I googled a bit about this and I couldn't rly figure it out. If anyone got an idea what I could do to fix it please do tell. Thanks

ocean quartz
hot hull
#

@quiet depot Mark the commit for oktoberfest ;C

frigid badge
ocean quartz
#

Same for me on IJ

umbral mica
#

did jetbrains break something?

#

My settings are syncing fine

surreal quarry
#

isn't there a bukkit method where i can like get an instance of my class through bukkits plugin manager

#

i basically need to be able to get config values inside an enum and to do so I need an instance of my main, but i can't pass that into an enum lol

#

iguess i could use static

umbral mica
#

You can do it via bukkit, but that's not great

hot hull
#

JavaPlugin#getPlugin?

surreal quarry
#

yea thats what i was looking for

umbral mica
#

Most people use a singleton patern, like this

class MyPlugin extends JavaPlugin {
  private static MyPlugin instance;

  public void onEnable() {
    this.instance = this;
    ...
  }
  ...
  public static MyPlugin getInstance() {
    return instance;
  }
}
#

there is a getPlugin, but you need to provide the plugin name as a string, then nullcheck it, cast it etc. It's not great

surreal quarry
#

well JavaPlugin#getPlugin returns the Class you provide it

#

i think thats what i've used in the past, but maybe a static instance is better

umbral mica
#

oh am I having a brainfart?

surreal quarry
#

well there is one that takes a string

#

its like PluginManager#getPlugin i think

hot hull
#

If you need something and can't use a constructor, use JavaPlugin#getPlugin over static

ocean quartz
#

Static instance

hot hull
#

It took 20min for build tools to finish sheesh

umbral mica
#

oh yeah I forgot about the getPlugin(Class clazz) one, yeah that's probably better

#

It took 20min for build tools to finish sheesh
isn't that the normal time?

ocean quartz
#

When I need it and DI isn't an option I normally do
JavaPlugin.getPorvidedPlugin(Class::class.java)

umbral mica
#

getPorvidedPlugin()

hot hull
#

"Porvided"

ocean quartz
#

Shhhh

umbral mica
#

oh THAT'S how I never noticed that call, it's static on JavaPlugin.

surreal quarry
#

getPlguin returns my class, and getProvidingPlugin returns JavaPlugin

#

and I need my class to access a reference to a file manager

umbral mica
#

casting!

surreal quarry
#

well true

#

getPlugin just does the cast for me it looks like

ocean quartz
#

Though i'll tell you, doesn't seem like a good idea for you to get the config inside the enum, unless it's on a method, in which case just pass it as a parameter?

surreal quarry
#

its a Lang enum like this, and I have a get() method that I can pass things to but I really dont wanna have to pass my plugin every time even though it would be a better option

#

it goes to the path, and if thats null it uses the default

steel heart
#

iguess i could use static
I’d recommend using a static singleton over JavaPlugin.getPlugin even if it’s an ioc

#

iirc getPlugin has some reflection so using a plugins static singleton would be faster I guess although it’s negligible

prisma wave
#

there's no reflection apart from getClassLoader()

#

which isn't reflection afaik

empty flint
#

So I made a first plugin in kotlin where I am building everything from the ground up and I've decided to actually make it useful beyond just a kotlin learning experience. It's a debugging plugin that has will have a listener for every event, printing the relevant event info to the console. The event listeners will be toggleable (on and off so you can display only the relevant info). Do you guys think this is something I should maybe publish?

ocean quartz
#

@prisma wave Question, which would make more sense to be used in this situation?

with(yamlConfiguration) {
  set("key", value)
}

or

yamlConfiguration.apply {
  set("key", value)
}
frigid badge
#

2nd

empty flint
frigid badge
#

seems interesting and could give insights in plugins for end users @empty flint

empty flint
#

Dunno if I should pursue this project further or not

#

seems interesting and could give insights in plugins for end users @empty flint
@frigid badge Well it's not intended for end users really

surreal quarry
#

@empty flint make a gui to turn them on or off :)

frigid badge
#

the end user being a developer and a server owner is what I mean

old wyvern
#

Maybe also include the plugins that are listening to that specific event and their priority

ocean quartz
#

Gotcha ty lemmo

hot heron
#

@obtuse gale move here for the convo

obtuse gale
#

Ok

#

So photoshop

hot heron
#

You have a very warped sense of reality

#

Ooh new color

empty flint
#

It's intended so you don't have to implement debugging stuff into your code when you work with events. I plan to expand it further and not just have it handle events, but events are an obvious first attempt at this.

#

@empty flint make a gui to turn them on or off :)
@surreal quarry
Maybe also include the plugins that are listening to that specific event and their priority
@old wyvern

Great ideas! I will definitely add Yugi's suggestion. James' I do want to add as well but guis are not my priority right now.

surreal quarry
#

yea fair enough lol

#

it would be a massive gui too might not even be that helpfulk

empty flint
#

Yeah, I figure commands are faster than a gui anyhow

frigid badge
#

is it hardcoded which events?

#

or are you using reflection/event executor/whatever to retrieve all events

empty flint
#

is it hardcoded which events?
@frigid badge Well I am implementing each event by hand just to see how it works but I did want to see if there is a pattern that would allow me to use reflexion. The problem is that the field names and the values they carry are not very human-readable so for those 2 events I had to use some post-processing

old wyvern
#

Dont think you need reflection for this

empty flint
#

No but it would be nice because it would be robust to changes and additions by spigot/minecraft

#

But this is the kind of proessing I mean

frigid badge
#

well you can easily make mappings for that

old wyvern
empty flint
#

well you can easily make mappings for that
@frigid badge But not general ones as far as I can tell.

frigid badge
#

as in uppercase first letter, spaces at a new uppercase within a field and some specific ones for uniqueId -> UUID for example

empty flint
#

Sure but I'd have to map stuff for Address, LoginResult, Booleans...

ocean quartz
empty flint
#

And not all Booleans are the same etc etc

frigid badge
#

why would you have to map for booleans

#

or for address?

#

address would be fine with just uppercase first letter

#

I've made a similar system for translating from code fields to human readable names

#

but it was for work and in a different language

empty flint
#

I did it boys it's working
@ocean quartz Buy winrar, can't you see they're begging already? sheesh

#

Also congrats!

#

@ocean quartz I can highly recommend the grabver versioning plugin for gradle

#

So you don't have to manually type the new version every iteration

#

and just let a task increment it

frigid badge
#

but you wouldn't want to increment the version with every build though

#

(imo)

surreal quarry
#

congrats matt! looks great

frigid badge
#

and nice work @ocean quartz

empty flint
#

no and it doesn't have to be tied to any build task

#

why would you have to map for booleans
@frigid badge Because not all Booleans are named in a human-readable way that makes it understandable for somebody who doesn't know what that event does

frigid badge
#

then I'd be useful for like a pipeline on a protected branch such as master, staging, develop

#

a boolean is true or false

#

how hard can a mapping be?

empty flint
#

There are "on/off" booleans, "true/false" booleans, "is/is not" booleans.

#

It's not about making a mapping

#

it's about displaying information

#

the mapping is easy

ocean quartz
#

grabver versioning plugin for gradle
@empty flint What is it?
@frigid badge Doesn't really increase the version on every build, it just generates the plugin.yml from the gradle, so if you don't give it a version it'll grab it from the project

frigid badge
#

I was talking about grabver not about your gradle plugin matt

ocean quartz
#

Oh

empty flint
ocean quartz
#

Oh, don't really like that tbh

empty flint
#

then it's automatically saved to the new version

frigid badge
#

does it edit the build file

empty flint
#

and when building it is placed into my plugin.yml jar

#

so I only ever touch the version when a new major or minor version comes out which is not that frequent. When patching or hotfixing, I just hit a button and bingo bango bongo it makes versioning go brrrr

#

Don't have to worry about it at all

#

does it edit the build file
@frigid badge No it keeps track of the version in its own file:

#

You an edit that but you basically never have to touch it if you don't want to

frigid badge
#

ah okay

empty flint
#

and I can just replace those tokens

#

with the actual values

frigid badge
#

seems interesting for pipelines

empty flint
#

Exactly

frigid badge
#

there are a lot more and I've redacted the actual data for privacy reasons

empty flint
#

Also I have a basic "empty" plugin project with my core lib and everything ready to go when I want to start a new plugin project, I just copy paste, replace the name of the plugin in 2 places and I'm ready to go

#

Again, I want the information to be instantly logical and understandable, not just there

#

And the fields have horrible names

frigid badge
#

Iknow but it's a suggestion since that would make it easily usable over multiple versions

#

I mean how do they have horrible names

empty flint
#

Well I don't particularly like them. AsyncPlayerPreLoginEvent has "getName" for the player name for example. It's ambiguous because lots of things have names in MC. Idk it's just not my taste.

#

Also differentiating between fields that are for manipulating hte event and fields that display information is difficult to automate

#

without doing it custom for each event

#

I mean I do want to automate it all eventually and then I'll have to do a parser for event field names and types but for now, I retch at the thought

#

so yeah manual it is

empty flint
#

@old wyvern So what information would you like to have from the HandlerList of an Event?

#

Plugin Name, priority and isignorecancel comes to mind

#

anything else?

#

maybe how often it fires?

#

like event statistics

#

actually that's not tied to event handlers ^^

#

but still interesting information

old wyvern
#

What?

#

oh the debug thing

#

Yea I guess sure

empty flint
#

Maybe also include the plugins that are listening to that specific event and their priority
@old wyvern Any other info you'd be interested in from the EventHandler list?

old wyvern
#

Cant think of anything specific atm

fluid walrus
#

@everyone

loud gyroBOT
#

The 'everyone' mention is disabled so you can't annoy people.

fluid walrus
#

guys

#

i forgot

#

what was the better version of bungeecord?

#

velocity?

static zealot
#

xD

fluid walrus
#

:0

#

pls blitz

#

what was it? xD

static zealot
#

no idea. I use just bungee

fluid walrus
#

:0

#

can you guide me on how to use bungeecord? :D

static zealot
#

there's a wiki for that...

#

that's literally what I didn. Hadn't used bungee for years then just followed that wiki

fluid walrus
#

ok

static zealot
fluid walrus
#

ty

#

@everyone

loud gyroBOT
#

The 'everyone' mention is disabled so you can't annoy people.

fluid walrus
#

its fine

#

blitz helped me

#

:D

empty flint
#

What the hell does "Plugin.setNaggable()" actually do? Is that the flag whether the plugin's logger can be used? I am not sure I get the Javadocs...

surreal quarry
#

idk ive seen an error message that says like "something broke go nag author ... about ..."

#

it may enable that message when something doesn't work correctly

#

i ususally only see it on startup tho

empty flint
#

Is it possible to get all subclasses of a class in Kotlin if the class in question isn't sealed?

#

I know you can get super classes but I can't find subclasses...

surreal quarry
#

i dont think so

#

but i might be wrong

prisma wave
#

org.reflections or Classgraph can but not with "vanilla" reflection

empty flint
#

hm seems too hacky

#

I'll stick to manual

#

@prisma wave could you help me out with this reflection stuff a bit?
I have the supertypes of my event, which is List<KType>. I want to filter that list to only contain KTypes that represent Event classes. What's the connection between KType and java Class?

prisma wave
#

KType is the kotlin equivalent of Type

#

it won't necessarily represent a class, but most of the time it will

#

KClass is a subclass of KType iirc

empty flint
#

hm not sure I follow

#

let's do an example, hold on

#

BlockDamageEvent extends BlockEvent and implements Cancellable

#

The supertypes list will contain the KType of BlockEvent and Cancellable in that order afaik

#

how could I filter the list to only contain BlockEvent, without knowing that the event instance is a BlockDamageEvent?

#

I am guessing the KType of BlockEvent does not extend the KType of Event, right?

prisma wave
#

in this case the KType is almost always going to be a KClass

#

so you can basically just cast to that

empty flint
#

gimme a sec to see what I can do with KClass

#

oh I can check if the KClass of Event is in the allSuperclasses of KClass of BlockEvent

#

One problem though: KClass is not a subclass of KType :/

prisma wave
#

is it not?

#

nvm use jvmErasure I think

#

not too familiar with kotlin reflection

empty flint
#

I think I need to add kotlin.reflect.full to use allSuperclasses

prisma wave
#

probably

empty flint
#

KClass is a KClassifier

#

which is accessible from KType

#

lmao

#

Smart cast to 'KClass<*>' is impossible, because 'it.classifier' is a property that has open or custom getter

#

frick me

#

So what happens when you cast a subtype to a supertype and then get the class?

#

Does it return the superclass or the subclass?

prisma wave
#

the concrete class

empty flint
#

so the one you cast it to?

#

right

blazing minnow
#

ye

empty flint
#

Another last hacky question then

#

in java case... you can let it propagate down

#

can you let a when(...) continue with evaluating and doing stuff?

#

or do I have to make an if-tower?

#

basically I need to do

if(a) -> do a
if(b) -> do b
...

would be nice if that was possible in a when. I cant think of a way but maybe you know one 🙂

blazing minnow
#

don't know what you are talking bout, but u can call me, maybe i can help ¯_(ツ)_/¯ ))

empty flint
#

can't talk, no headphones

#

it's not that important though

prisma wave
#

yeah no, when doesn't fall through

#

it compiles to if / else if, not if / if

distant sun
#

blocksMined.merge(uuid, amount) { _, value -> amount + value }
I can't use smth similar to Integer::sum as 3rd param?

prisma wave
#

no, because the lambda takes 2 parameters

#

whereas Integer::add would only take 1

#

actually

#

yeah i don't think so

lavish notch
#

How do I remove a whole lib from ShadowJar? - more specifically, com.google

distant sun
#

remove?

#

@prisma wave how do I define a variable with value X extends Y

prisma wave
#

what

distant sun
#

I have this class called Settings and there can be multiple types

prisma wave
#

uh

distant sun
#

If on an interface I add "val setting: Settings" I dont be able to access the methods specific to one class

prisma wave
#

well yeah

#

because the compiler only knows that it's Settings

#

you need generics

distant sun
#

What is the syntax?

prisma wave
#
class Blah<T: Settings> {
  val settings: T
}```
distant sun
#

K

prisma wave
#

otlin

distant sun
#

no

prisma wave
#

yes

steel heart
#

T in out under above

distant sun
#

Also, can I use any letter for generics?

prisma wave
#

annotations?

#

yes?

#

they're just classes

steel heart
#

Yep

prisma wave
#

well interfaces

distant sun
#

generics*

prisma wave
#

oh yeah

#

they can be any valid identifier

steel heart
#

The stream pipeline has like a name for the type

#

T_OUT or smtng

#

But by convention just one letter is enough

#

And it’s short and maintainable I guess

distant sun
#

Aight

#

What about the link I sent above

prisma wave
#

i have no idea what that's supposed to mean

distant sun
#

The score should be provided. The annotation classes are not effective within the classpath. It's for Intellij IDEA.

#

Dope

prisma wave
#

bruh what does that mean

steel heart
#

I mean IJ recognize certain annotations which iirc can be changed in settings if that’s what he is talking about

#

It has some inspections and code generations in addition to the “whitelisted” annotations

distant sun
#

javax.annotations bad

steel heart
#

You’re probably already aware of that though

#

I guess

#

Tbf it doesn’t really matter

prisma wave
#

yes but what he said still makes absolutely no sense

steel heart
#

True

distant sun
gray elk
#

hey

#

please how can i remove a item from armor

steel heart
#

Yo epic I’m a contributor to pdm now

prisma wave
#

pff

#

that's a bit of an exaggeration

steel heart
#

Not at all

prisma wave
#

you literally changed 1 character

steel heart
#

I can write a good docs if needed

gray elk
#

victim.getInventory().remove(item);

steel heart
#

Or even more

gray elk
#

dont work

distant sun
#

getArmor i believe

steel heart
#

Johan you have to obtain the armor content array and change that then set it to the inventory

onyx loom
#

i am proud to say that i have committed more to pdm than conclure

distant sun
#

You changed 2 ??

#

Damn

steel heart
#

It was essential

distant sun
#

have you guys used java-deobfuscator/deobfuscator ?

steel heart
#

Nope

#

Is it good?

distant sun
#

Docs kinda suck

#

How would one generate mappings for spigot jar O.o

steel heart
#

Wait what are you actually trying to do

distant sun
#

Decompile a jar to see if I can find the cause of a problem we have

#

And from what I have seen on the fewer docs some transformers require a mappings file

steel heart
#

Oh you want to deobsfucate nms?

distant sun
#

No, a plugin

#

But I assume it needs the mapings to create constructors, methods etc

steel heart
#

yeah think so

distant sun
#

Anyways, gtg for now, Im tired

steel heart
#

Gn

#

Or gl

lavish notch
#

remove?
@distant sun what do you mean exactly?

empty flint
#
 +---< AsyncPlayerPreLoginEvent >---#
 |> Player: BlockyBorzan
 |> UUID: d144afc1-aa3b-47c7-a19c-cc0474a8e9cc
 |> Address: /127.0.0.1
 |> Login Result: ALLOWED
 |> Kick Message: 
 + -< inherited from Event >-
 |> Is Asynchronous: true
 |> Handlers: 
 |>  - BlockyDebug [Priority: MONITOR] (ignores cancel)
 |>  - LuckPerms [Priority: MONITOR] 
 |>  - LuckPerms [Priority: LOW] 
 +---< 2020-10-08 00:55:33.389 >---#
#

Kinda nice. Semi-manual with the inherited fields

surreal quarry
#

hot

empty flint
#

Tomorrow I'll add some event statistics

blazing minnow
#

so you created plugin which sends data on event?

empty flint
#

ye but it gets better

blazing minnow
#

what about NBT statistics?

#

of connected player

empty flint
blazing minnow
#

nice

empty flint
#

so you can clutter and unclutter your console

blazing minnow
#

what about NBT statistics?
.

empty flint
#

what about NBT statistics?
@blazing minnow Not sure what NBT statistics you mean

blazing minnow
#

like this

#
ID
Name
Last Played
First Played
First Played Date
Last Played Date
Bed Spawn Location
Total XP
XP Level
Selected Item Slot
GameMode
GameMode Name
Food Level
Health
Dimension
Dimension Name
Fly Speed
Is Flying
Invulnerable
Walk Speed
Last Location
surreal quarry
#

wow

#

thats a lot of stuffs

blazing minnow
#

(i just sent info from my plugin page)

#

that just sends data on command

trim hull
#

i need some help with my Bedwars plugin, because we have each map on its own server the Bedwars plugin doesn't have the placeholder support for multi servers so players wont be able tell if the game is currently going on or ready to join in the lobby

is there anything you can do to sync Placeholderapi across servers?

blazing minnow
#

it ust sends data on command

trim hull
#

i need some help with my Bedwars plugin, because we have each map on its own server the Bedwars plugin doesn't have the placeholder support for multi servers so players wont be able tell if the game is currently going on or ready to join in the lobby

is there anything you can do to sync Placeholderapi across servers?

surreal quarry
blazing minnow
#

send plugin messages/use sql or other db

surreal quarry
#

not their plugin

blazing minnow
#

i need some help with my Bedwars plugin,

surreal quarry
#

xqplc if you have your own plugin do that, but it sounds like its not yours

trim hull
#

oh sorry i mean the bedwars plugin i bought

surreal quarry
#

they were asking about PAPI tho

#

yea

trim hull
#

But does PAPI support sql

#

and let me move this convo to another chat

blazing minnow
#

That support placeholders

#

but how to make plugin sync with sql - author's decision

empty flint
#

like this
@blazing minnow
That would be a) too overwhelming for the console and b) not relevant to the evnet at hand

#

What NBT stats would you put for this event then for example:

 +---< BlockBurnEvent >---#
 |> Burning Block: Oak Leaves at [312, 66, -30] (minecraft:oak_leaves[distance=1,persistent=false]) 
 |> Igniting Block: Air at [312, 67, -30] (minecraft:fire[age=8,east=false,north=false,south=false,up=false,west=false])
 + -< inherited from Cancellable >- 
 |> Is Cancelled: false
 + -< inherited from Event >-
 |> Is Asynchronous: false
 |> Handlers: 
 |>  - BlockyDebug [Priority: MONITOR] (ignores cancel)
 +---< 2020-10-08 01:09:19.583 >---#
blazing minnow
#

meant player only

#

🤔

empty flint
#

No point. That could be another separate piece of info

#

like player stats or whatever

#

but not this

blazing minnow
#

np

gray elk
#

what is the best way to cancel knockback

ocean quartz
#

Probably velocity

gray elk
#

i want the knockback to be null i tried new vector but it still a little knockback

#

i did that code ```java
final Vector vec = new Vector();
    p.setVelocity(vec);

new BukkitRunnable() {
                 public void run() {
                     p.setVelocity(vec);
                 }
               }.runTaskLater(yourMainClass, 1l);
 ```

#

can someone help me?

surreal quarry
#

google says cancel the damage event and apply the damage manually

frail glade
quiet depot
#

@quiet depot Mark the commit for oktoberfest ;C
@hot hull I already marked it

obtuse gale
#

@frail glade what's that about?

frail glade
#

Mhmm

umbral mica
#

I dun get it lol

#

isn't that the point of literally every expansion

ocean quartz
#

I'm assuming it's for customizing with like config or commands, instead of making an entire expansion for it

hot hull
#

@quiet depot No I meant merged my pr so it counts for it

distant sun
#

Isnt javax.annotation removed from newer versions of jdk?

#

@frail glade what is the expansion supposed to do?

frail glade
#

Makes placeholders

#

It's pretty cool

regal gale
#

Wot

obtuse gale
#

isnt that what that js expansion does

frail glade
#

Well that does too

#

But if you need for an example a placeholder called burgers and needed it to contain the value of 5, you can do /cme create server burgers integer 5, and then if you parse %custom_server_burgers%, it'll return 5.

obtuse gale
#

oh right

#

can you make it so it doesnt always return 5?

#

Or is it moreso if you want something to change on all uses of the placeholder it would do that

frail glade
#

Idk that's a good question

#

I didn't write this one

obtuse gale
#

also why specify integer in the command

#

since wont it be a string anyway

frail glade
#

Yes

obtuse gale
#

yes

distant sun
#

there is a command to increase and decrease the value so It probably needs to know which values can be modified

scenic oak
obtuse gale
#

somethings returning null there probably

prisma wave
#

getDamageMod is probably nullable

#

Which is dumb

steel heart
#

what happens when no a class with no nullary constructor gets invoked by Class#newInstance?

#

InstantiationException

#

?

prisma wave
#

i believe so

#

You shouldn't be doing that anyway

#

It's deprecated for a reason

steel heart
#

It’s not deprecated ?

#

It’s CallerSensitive

#

Or maybe it’s deprecated in newer versions

#

Doesn’t seem to be in 8

prisma wave
#

pretty sure it is

steel heart
#

Ignore the quality lol

obtuse gale
#

10/10 on the screenshot

distant sun
#

-1 mpx

obtuse gale
steel heart
#

Well yeah java 8 is noob

obtuse gale
#

help, show me the wrong please
give %player_name% shield 1 0 {BlockEntityTag:{Base:5,Patterns:[{Color:0,Pattern:"bri"},{Color:0,Pattern:"bri"},{Color:0,Pattern:"bri"},{Color:0,Pattern:"gru"},{Color:0,Pattern:"gra"}]}},{display:{Name:"&d&l█ &5&lОбсидиановый щит",Lore:["&7Владелец: &e%player_name%","&7","&9Неразрушаемый","&cПроклятие утраты"]},ench:[{id:71,lvl:1}],Unbreakable:1,HideFlags:7}

#

What

#

this command is not working, i wanna know the reason, why?

#

and fix it

#

Wrong channel lol

#

Also e more specific, what's not working

#

[12:56:26 ERROR]: [org.bukkit.craftbukkit.v1_12_R1.util.CraftMagicNumbers] null net.minecraft.server.v1_12_R1.MojangsonParseException: Trailing data found at: ...:"gru"},{Color:0,Pattern:"gra"}]}},<--[HERE] at net.minecraft.server.v1_12_R1.MojangsonParser.b(SourceFile:61) ~[server.jar:git-Paper-1618] at net.minecraft.server.v1_12_R1.MojangsonParser.a(SourceFile:40) ~[server.jar:git-Paper-1618] at net.minecraft.server.v1_12_R1.MojangsonParser.parse(SourceFile:29) ~[server.jar:git-Paper-1618] at

regal gale
#

Wish if Barry had a json validator

#

Oh well

#

Add this: give %player_name% shield 1 0 [{BlockEntityTag:{Base:5,Patterns:[{Color:0,Pattern:"bri"},{Color:0,Pattern:"bri"},{Color:0,Pattern:"bri"},{Color:0,Pattern:"gru"},{Color:0,Pattern:"gra"}]}},{display:{Name:"&d&l█ &5&lОбсидиановый щит",Lore:["&7Владелец: &e%player_name%","&7","&9Неразрушаемый","&cПроклятие утраты"]},ench:[{id:71,lvl:1}],Unbreakable:1,HideFlags:7}]

#

Basically I just added surrounding square brackets

#

@obtuse gale

obtuse gale
#

Thank you mate!!! ❤️

heady birch
#

No problem

frail glade
#

Welcome back

heady birch
#

🥰 Thanks

empty flint
#

Holy shit multiline string indentation in Kotlin is cancer

prisma wave
#

Incorrect 🙂

hot hull
#

That's nice is it not?

empty flint
#

result in

#

this piece of shit output

#

pure indentation fuckery

#

like what?!

#

absolute horseshit

#

and it's so infuriating as well because you have 0 chance of figuring it out since in the code, the lines are all indented the same

prisma wave
#

uh

#

lol

empty flint
#

@prisma wave do you know how the Kotlin compiler knows when to smart cast things?

#

I made this extension function that's essentially apply but with a condition:
public inline fun <R> R.transformIf(condition: kotlin.Boolean, block: R.() -> R): R { contract { /* compiled contract */ }; /* compiled code */ }

#

so if the condition is met, the block gets executed yada yada

#

But if I use it like so:

#

the compiler does not recognize that in order to execute the part where event.isCancelled is called, the event has to be a Cancellable

prisma wave
#

what's the contract?

empty flint
#

gimme 5 minutes to look it up in my repo. I don't have that project locally on this laptop right now

prisma wave
#

okay

#

it should imply that condition is true

#

and that should be enough

empty flint
#
@OptIn(ExperimentalContracts::class)
inline fun <R> R.transformIf(condition: Boolean, block: R.() -> R): R {
  contract {
    callsInPlace(block, InvocationKind.EXACTLY_ONCE)
  }
  return if(condition) block() else this
}
#

this does not imply that I guess

#

What contract would do that?

#

So do I have to wrap the block in the contract or something?

#

Not sure how contracts work here

#

Because I have the if condition already

#

Shouldn't the compiler know that the boolean is true?

prisma wave
#

it would be something like implies condition == true I think

#

not necessarily

#

well probably

#

but I think there could be a case where it isn't

empty flint
#

and that is?

prisma wave
#

no idea

#

but the compiler is pretty smart

#

so it obviously couldn't for some reason

steel heart
#

When the compiler has higher iq than the developer (:

empty flint
#

but... 😦

#

me is s-m-r-t

steel heart
distant sun
#

Anybody want to help with a kt plugin? Basically I have a robots system (armor stands) and the problem is they get removed for no reason and the animation (their hand move to create a mining animation) freeze randomly

steel heart
#

If you teach me kotlin fundamentals

prisma wave
#

kotlin ez

steel heart
#

I have like 1 month experience and it’s by reading when you guys flame each other

#

mutableMapOf

distant sun
#

Bm help 😭 this thing drives me crazy

steel heart
#

T in and T out

distant sun
#

thot

steel heart
#

iana

prisma wave
#

what is problem

distant sun
#

I stated it above

prisma wave
#

oh

#

idk

#

probably not a kotlin problem

distant sun
#

I know, I just mentioned is made in kotlin

empty flint
#

I have like 1 month experience and it’s by reading when you guys flame each other
@steel heart That is probably the funniest thing I've read in this chat so far 😂

#

@prisma wave Nope, doesn't seem possible to use imply here

prisma wave
#
returns() implies (condition == true)
```?
heady birch
#

"smart compiler" you know nothing. Rust is the smart compiler

prisma wave
#

Silence

distant sun
#

said no person ever

empty flint
#
returns() implies (condition == true)
```?

@prisma wave returns() is true even if condition is not true

prisma wave
#

?

frigid badge
#

dude stop spamming

ocean quartz
#

Niall getting muted again smh

distant sun
#

stoopid

frigid badge
#

You won't be unmuted

distant sun
#

if I have an enum named PetType and a Map<PetType, class that extends pet> how can I make the map know which Pet class should return for each PetType?
PetType.MONEY -> MoneyPet
PetType.GEM -> GemPet
etc.

empty flint
#

Who is spamming? Why don't I see it?

frigid badge
#

there's this thing called anti-spam

empty flint
#
public class Favorites {
  private Map<Class<?>, Object> favorites =
    new HashMap<Class<?>, Object>();

  public <T> void putFavorite(Class<T> type, T instance) {
    if (type == null)
      throw new NullPointerException("Type is null");
    favorites.put(type, instance);
  }

  public <T> T getFavorite(Class<T> type) {
    return type.cast(favorites.get(type));
  }
}
#

Your enum PetType could contain a field with type Class<T extends Pet> or something and use that as the type here

steel heart
#

If its only enums as keys use an enummap

distant sun
empty flint
#

Do you need the P: Pet<...>?

#

Can't you just use Pet<...>?

#

(not sure, genuinely curious)

#

And what types does MiningPet extend/implement?

distant sun
#

Pet<S: PetSettings>

empty flint
#

try P : Pet<*>

distant sun
#

same

prisma wave
#

that won't work

distant sun
#

then what @prisma wave

quaint isle
#

is it possible to open two IntelliJ projects at once?
In Webstorm / PyCharm it asks me whether I want to open a new window when I attempt to open ap project. Or I can just launch Webstorm twice if I want to.
IntelliJ however does not do this. Is this not possible for some reason or is my IDE just acting up?

surreal quarry
#

i did it a while ago but it was really weird and sorta messed up my different projects gradle

distant sun
#

you probably ticked something, you can have as many projects opened as you want

surreal quarry
#

i dont even remember how

old wyvern
#

You can open 2 projects at the same time just fine

surreal quarry
#

they want it in the same window

old wyvern
#

Same window?

#

No

distant sun
#

yugi, help me with generics xd

old wyvern
#

Whats do you need help with gab?

quaint isle
#

I guess imma give restarting my PC a shot, it just doesn't do anything when I try launching another InteliJ instance and when I open a project it just opens in the same window 😄

surreal quarry
#

i mightve understood the question wrong then

distant sun
surreal quarry
#

are you trying to have 2 projects, one in each window separate?
noni ^

old wyvern
#

I guess imma give restarting my PC a shot, it just doesn't do anything if I launch another InteliJ instance and when I open a project it just opens in the same window 😄
@quaint isle
Just open a project from the File menubar, It will ask you if you want to open it in the same window or in another window, Choose another window

quaint isle
#

@surreal quarry yes exactly

surreal quarry
#

oh yea

#

you can do that

distant sun
#

I need that map to accept any subclass of Pet

surreal quarry
#

you mightve ticked dont ask me again on accident once

#

if it doesnt ask you how you want to open the project

distant sun
#

open settings and search for "open project" or smth like that

old wyvern
#

Gab You need to create an instance of the specified type

quaint isle
#

@old wyvern yup it doesnt give me that prompt. @surreal quarry I haven't, it's a fresh IntelliJ install. But lets see if it works after restart

surreal quarry
#

kk

#

on a different note, does anyone here use a windows / linux dual boot and if so how hard is it to setup

distant sun
#

wdym yugi

old wyvern
#

@distant sun
P there means a Specific subclass of Pet

#

You cant add any random implementation to a map of that

distant sun
#

well how do i make it accept any subclass of Pet?

#

MiningPet extends Pet<MiningPetSettings> (it should be Money but ...

quaint isle
#

Y'all were right. I forgot my IDE settings are backed up with Jetbrains and apparently I set it to "always open in same window" sometime in the past. Thanks for trying to help me! 😄

old wyvern
#

@distant sun
I suggest having the value of the map as in Pet<out PetSettings> instead

#

So a Consumer of Pet type which is a Producer of PetSettings type

#

as in

val pets = mutableMapOf<PetType, Pet<out PetSettings>>()

Or if you want to make sure the type P is used id suggest having a Factory class of sorts for Pets

quaint isle
#

on a different note, does anyone here use a windows / linux dual boot and if so how hard is it to setup
@surreal quarry Are you talking WSL or just installing Linux & Windows alongside eachother?
If it's the latter, it's really quite simple. If you got windows on your device already popular distros like Ubuntu will even give you an option to install it alongside windows10.

distant sun
#

What I actually want to do is a way to get the specific pet type by it's PetType value

surreal quarry
#

im gonna try the latter noni.
Right now I have a C and a D drive, and I think I would wanna have ubuntu installed on the D drive where I have the most available space. Looks like that would be possible right?

old wyvern
#

so its Pet that represents a specific PetType?

quaint isle
#

@surreal quarry yeah that shouldnt be a problem. I've only done it once, but it was super straight forward. Just burn some iso to an USB stick and I'm sure it's easier than you think

surreal quarry
#

cool

#

ty

distant sun
#

Yes @old wyvern

old wyvern
#

Ok you wont need the generic type P,
Also you should probably just have a normal map instead of a mutable one and just map up there

val pets = mapOf<PetType, Pet<out PetSettings>> (
    PetType.Money to MiningPet(MiningPetSettings(1,1))
)

@distant sun

distant sun
#

it has to be a mutable map cuz they are loaded from config

trim kraken
#

(I am Brazilian, I use the Google translator) Hello, I would like to ask a question, when I type a personalized command in it is still in the red conversation bar, I would like to know how I do it to make it blue, just like be in the picture: https://prnt.sc/uvqwna

half harness
#

Make sure that the command is in the plugin.yml

ocean quartz
#

@trim kraken Provavelmente vc nao esta registrando o comando direito

distant sun
#

Provavelmente to you too matt

ocean quartz
#

Thanks kek

trim kraken
#

Não tem como eu registrador, pois o plugin não é meu.
There is no way I can register, because the plugin is not mine.

distant sun
#

@old wyvern any way I can access MiningPet instead of Pet using pets[PetType.MONEY] ?

obtuse gale
#

guys

#

I'm scared

umbral mica
#

that's rare

obtuse gale
#

I was typing, y'know, normal stuff, and something popped up on my screen just when I hit the enter key

#

I have no idea what I just installed

umbral mica
#

uh check programs and features or whatever tf it's callsed

jaunty holly
#

Hello! I'm getting an error with SQL: No operations allowed after connection closed. while trying to get the balance of a player with PlaceholderAPI. I've tried looking up a fix but haven't found anything. Everything else in the plugin just not the Placeholders.

Placeholder Class: https://sourceb.in/9b86af4934
SQL Class: https://sourceb.in/27dd29ff7a

potent vale
#

Bruh

empty flint
#
 ┌───[ BlockDamageEvent ]
 ├ Breaks Instantly: false
 ├ Item in Hand: Diamond Axe ×1 (1556/1561)
 ├ Player: BlockyBorzan (OP) ❤ ×1,33 lv13
 ├───< inherited from BlockEvent >
 ├ Block: Oak Log at [314, 71, -22] (minecraft:oak_log[axis=y])
 ├───< inherited from Cancellable >
 ├ Is Cancelled: false
 ├───< inherited from Event >
 ├ Is Asynchronous: false
 ├ Handlers:
 ├ ─ BlockyDebug [Priority: MONITOR] (ignores cancel)
 └───[ 2020-10-09 01:48:23.982 ]

Can you think of any other useful info from the event?

oak tusk
#

Anyone know how to fix this error in Intellij?

Could not find artifact me.clip:placeholderapi:pom: in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

#

I copy and pasted the maven info from the github.

oak tusk
#

Fixed ✅

obtuse gale
#

Can I make spring entities java 15 records?

distant sun
#

If I have an object Pet and multiple subclasses such as MoneyPet, can I somehow like an enum value PetType with a certain subclass on a map or something?

steel heart
#

Just make a class with constants

#

Generics and enums doesn’t work good together

distant sun
#

I need the enum because I have to access them by a value