#dev-general

1 messages Β· Page 117 of 1

prisma wave
#

hmm

frigid badge
#

so I am no good at it

topaz bay
#

HA

#

Nerd

prisma wave
#

do you accept that it is objectively better than java though?

topaz bay
#

bad at kotlin

#

get rekt

faint bobcat
#

imagine not using kotlin smh

prisma wave
#

smh

frigid badge
#

it has definitely it’s pros yes

faint bobcat
#

so you say it has.. cons?

prisma wave
#

that sounds unenthusiastic

#

^

frigid badge
#

lmao

#

smh Ref you turning against me

#

I made you become who you are now

#

xD

faint bobcat
#

that's correct 😭

#

but you've driven off topic

onyx loom
#

did someone say kotlin

topaz bay
#

Yes. More flame.

faint bobcat
#

i did

onyx loom
#

dont mind me. just grabbing my free xp

faint bobcat
#

did someone just say exp

jovial warren
#

still gotta get the JAR that jenkins builds with shadowJar on to the build

#

anyone here used CI before?

frigid badge
#

yes

#

use teamcity tho

jovial warren
#

teamcity?

frigid badge
#

yes

#

jetbrains

jovial warren
#

oh it's the JetBrains CI

#

yeah but it ain't free

frigid badge
#

yes it is

jovial warren
#

I'd prefer to stick with Jenkins for now tbh since I've spent ages making it work

#

you know about how Jenkins Gradle plugin works?

frigid badge
#

should’ve used docker smh

jovial warren
#

I am using docker

frigid badge
#

then how was it hard to set it up

jovial warren
#

that wasn't what was hard

frigid badge
#

that’s like literally one command or a simple compose file

jovial warren
#

getting Git and GitHub to work was more difficult

#

it wasn't difficult to do it's just I couldn't really follow the guides well

#

so yeah that's my fault

frigid badge
#

hmmmm

#

:p

topaz bay
#

cause you aint using kotlin

frigid badge
#

but just throw your issue in here

topaz bay
#

tsk tsk

jovial warren
#

yes I am sx

topaz bay
#

SHUT UP

jovial warren
#

okay, so I've got Jenkins set up to clone and build from my GitHub repo on push, and I've got Gradle set up to use the gradle wrapper and run build followed by shadowJar, which both run. the problem is idk how to get the JAR that's output from shadowJar to upload with the build

#

you know how CIs like PaperMC have the JAR build and be publicly available on push? yeah I want that basically

#

do I use the post-build "Archive the Artifacts" option?

#

actually that's probably not gonna work

timid niche
#

@errant geyser It cant work if you want to call the List, when it's null!

errant geyser
#

What are you replying to?

timid niche
#

A moment.Xd

#

You see the while loop?

errant geyser
#

Yeah

timid niche
#

So. There is that NullPointerExeption-Exeption problem

#

So it can't work

errant geyser
#

Yeah idk. You should probably look into more examples of plugin messages

timid niche
#

But not a bad idea. Thank you again. :3

#

I am now using a list. and Im checking if it's empty

jovial warren
#

about time

barren cloud
#

After lots of test, I've decided to not use multi arena for my games at all. Firstly, for resetting arena we have simple solution which is load and unload the world but with multi arena system, it makes lag spikes to other arenas in same instance. On the other hand, the bungee arena system using processor and makes slow other servers in the same machine. So, the best way is use only an arena in one instance and using map reloading system except reloading server. Do you have any idea guys?

signal tinsel
#

You can somehow asynchronously just replace all the blcoks again

#

blocks

hot hull
#

You can't modify the world async

barren cloud
#

Nope, for the performance the only way is to use one arena for one instance and restart after a while(an hour maybe more idk) due to memory usage.

#

Minecraft has own method to save player datas and other structure and that makes a little bit memory leak. So after a while, there will be a memory leak and it doesn't matter the server is vanilla or not.

signal tinsel
#

Oh

heady birch
#

Really?

#

Wouldn't they fix that

jovial warren
onyx loom
#

πŸ‘

jovial warren
#

also, the way BardyBot was designed, anyone can just kinda download the JAR and self-host it

#

if anyone wants to test him out

#

he's not finished yet though

quiet depot
#

have u fixed the code yet?

jovial warren
#

take a look

#

I think that's fixed

#

it currently only plays music

pallid gale
jovial warren
#

but it'll do what it did before

#

HAHA

#

lol

#

well, there's been a few iterations

quiet depot
jovial warren
#

lol

#

you can get the JAR from the CI as well if you wanna self-host it and do some testing

#

lemme know how you guys find my CI theme btw

hot hull
#

Linked twice in the span of 16 messages.

jovial warren
#

yep

#

well, gotta keep it relevant xD

#

even though it never was and never will be

quiet depot
#

should've used https://github.com/PiggyPiglet/Framework instead of spring, as https://github.com/PiggyPiglet/Framework has a discord api ;). Infact, a discord api was one of the first things I implemented in https://github.com/PiggyPiglet/Framework, although it probably needs a bit more work before I advertise https://github.com/PiggyPiglet/Framework for that reason.

obtuse gale
#

if ive got a class that has a map, that I have a get method, can I do that fancy kotlin thing where I can like use [] instead of .get?

onyx loom
#

i believe so ye

#

but dont listen to me

obtuse gale
#

do i need to do smthn to the method?

onyx loom
#

Β―_(ツ)_/Β―

jovial warren
#

Piggy you just put 4 links to the same framework in one message smh

#

also, I'm using Spring because of the project structuring

#

and ofc the other benefits

#

but the way Spring helps you stick to SRP is mainly why I use it

quiet depot
#

lol

#

4 links in one message

#

still not on par with kangarko

jovial warren
#

lol

#

does your framework have built-in command management as well?

quiet depot
#

yes

jovial warren
#

so basically you do Spring + JDA + Matt's Framework for JDA = Piggy's Framework

#

although I doubt your framework is as extensive as Spring is

quiet depot
#

my command framework is nothing like matt's, jda is a tiny part, and I'm not sure spring is a fair comparison yet

#

I don't actually know what spring offers

#

that's an end goal though, to be a competitor

jovial warren
#

Spring offers pretty much anything

#

you name it, I'll tell you if Spring has it

quiet depot
#

dynamic di bindings

jovial warren
#

afaik yep

twin thorn
#

hi

jovial warren
#

yeah it has dynamic DI

#

anything else?

quiet depot
#

just trying to think of anything rpf may have that spring doesn't

twin thorn
#

why when pplayer voted,the broadcast said %player_name% instead of displaying player name?

jovial warren
#

good luck piggy

twin thorn
#

how do i fix it

prisma wave
#

@obtuse gale operator fun

jovial warren
quiet depot
#

oh wait I've got it

#

2mb vs 20mb

jovial warren
#

not 20mb

obtuse gale
#

ah ok

quiet depot
#

my bad

#

40mb

jovial warren
#

you can choose what you put in

prisma wave
#

2mb? How do you work that out lol

#

Guice alone is pretty big

jovial warren
#

actually yeah mine is 44.3 MB

#

lol

#

any way to reduce that file size by excluding things I don't use?

quiet depot
#

guice is ~720kb kotlin

prisma wave
#

huh

#

always thought it was bigger

quiet depot
#

it comes with guava

prisma wave
#

Because bytebuddy and stuff

#

yeah

#

mb

quiet depot
#

guice doesn't use bytebuddy

#

it uses cglib

prisma wave
#

the other one

#

Yeah that's it

#

Forgot then name lol

#

Ima shut up now

#

Before I look even dumber

quiet depot
#

k

#

biggest thing in my framework is actually the material enums on the mc common api

#

they're huge

#

1.16 material list is 54kb uncompressed, uncompiled

#

@jovial warren I can't think of anything my framework has that rpf may not, unless you count things like platform bindings

#

I don't think that's a fair comparison though, as spring wasn't made for things like minecraft

jovial warren
#

yeah true

quiet depot
#

however

#

when you take into account the relative sizes

#

I think what my framework offers is very impressive, compared to spring

jovial warren
#

I really need to find a way to reduce the file size of this

quiet depot
#

once I implement load balancing, you could honestly use it as a replacement for spring rest stuff

#

should probably also replace my use of nanohttpd with something a bit more respectable

#

I honestly haven't encountered any performance issues with nanohttpd yet though

jovial warren
#

I suppose another good thing is that your framework doesn't have class names like HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor

#

or singleton factories

#

or any other really stupid enterprise logic

quiet depot
#

mine has both of those actually

#

logger factories for example, virtually always need to be singletons

#

as they store the logger implementation, but also provide creation utilities

jovial warren
#

but it's a bloody singleton piggy

quiet depot
#

although if you're talking about true singletons, not just managing instances carefully, my framework doesn't use any true singletons

jovial warren
#

what about the stupid class name

#

you said yours has both

quiet depot
#

ManagerManager

jovial warren
#

tf

rotund egret
#

Ahaha I love it

heady birch
#

😦

#

ManagerService

jovial warren
#

^^^^

quiet depot
#

rpf's nomenclature matches that common within this community especially

rotund egret
#

"My parents named me major major major"

quiet depot
#

you don't see people calling shit services in spigot

#

that's enterprise only

jovial warren
#

RPF reminds me of the file type used to store GTA V resources

#

and RPM

quiet depot
#

oh that's the master branch

#

woops

#

don't think I've edited manager api on dev anyway actually

jovial warren
#

is master supposed to be your stable branch?

#

then dev is indev

quiet depot
#

my git best practices are severely lacking

#

master for the longest time was where all the action happened

#

dev contains a major rewrite of a bunch of components, which was necessary for papi 3

#

don't want people running shit code you know

#

along with the addition of the mc api

#

to answer your question, right now, no, I wouldn't consider any version of rpf to be stable

#

that is that plan though

#

master -> stable

jovial warren
#

fair enough

quiet depot
#

spring has got a bunch of annotations, rpf goes mad with generics. you can actually do loads of cool shit with generics

jovial warren
#

also, when PAPI v3 comes out hopefully we can get working on ECloud 2

onyx loom
#

papi 3 😬

quiet depot
#

ecloud 2 could be in rpf

jovial warren
#

ECloud 2 is a planned rewrite of ECloud in Spring

quiet depot
#

I have an ecloud mockup somewhere which uses rpf

jovial warren
#

it's me, Niall, and BM
unless you have your own plans

quiet depot
jovial warren
#

also can't we do it?

#

or you got your own plans

quiet depot
#

current ecloud is already updated for papi 3

jovial warren
#

yeah but it's in Django apparently and you're the only one who knows Python

#

idk

quiet depot
#

I don't know python

jovial warren
#

Niall came up with the idea to rewrite eCloud in Spring

quiet depot
#

I despise python

jovial warren
#

nobody knows Python then

quiet depot
#

and I can assure you, that idea has been circulating for a long time in private channels

pallid gale
#

The ecloud is held together with various layers of duct tape

onyx loom
#

duct tape is pretty strong tbf

jovial warren
#

I think that was why Niall suggested we rewrite it lol

quiet depot
#

not that simple

jovial warren
#

idk, your choice if you wanna let me, Niall and BM rewrite it in Spring or if you want to do it yourslef

quiet depot
#

=ecloud breakdown

compact perchBOT
#
Command Moved!

These stats are now in the =stats command as ecloud and ecloud_breakdown

quiet depot
#

=stats

compact perchBOT
#
HelpChat Stats | Invalid Usage

Command Usage: =stats <object> [days]

Currently Tracking Stats for:
messages, commands, images, words, xp, levelups, wins, daily, users, ecloud, ecloud_breakdown, top_channels, top_users

jovial warren
#

=stats ecloud_breakdown

quiet depot
#

=stats ecloud

onyx loom
#

do top_users too pls

compact perchBOT
#
eCloud Stats | Requests

A total of 13,695,137 requests have been made to the eCloud.
These are the past 7 days:

quiet depot
#

=stats ecloud

compact perchBOT
#
eCloud Stats | Requests

A total of 13,695,137 requests have been made to the eCloud.
These are the past 7 days:

jovial warren
#

nice

quiet depot
#

200k+ requests per day

#

that's not something you can just hotswap over

jovial warren
#

Spring can handle that no problem

#

it's like a walk in the park

#

services like Netflix use Spring

#

and they have millions of watchers

quiet depot
#

netflix also uses guice

#

because guice > autowired

#

fyi you can use guice with spring

jovial warren
#

if Spring can handle Netflix's payload it could handle eCloud easily

quiet depot
#

considering your 44mb, no harm in trying

jovial warren
#

idk

#

anyway, as I said, about eCloud 2, your choice whether you want to let us go ahead or do it yourself

#

πŸ™‚

quiet depot
#

if there was going to be a rewrite, it'd probably be done behind closed doors

jovial warren
#

fair enough I guess

#

idk

quiet depot
#

dw, it'd probably be open sourced at completion. Not a fan of open sourcing popular projects while in development

#

people just suggest shit that's already on the roadmap

#

or worse, make an implementation for a feature you've already started on

#

and their implementation is really, really bad, then you've got to tell them that it's shit

jovial warren
#

can anyone outside of the admin team work on it whilst it's indev?

#

like not any old randos

quiet depot
#

yeah

jovial warren
#

I'm just asking if maybe we could get whitelisted on that

#

I'd love to contribute to something like that

quiet depot
#

most of the papi action takes place in rpf

jovial warren
#

can't be that hard to use

quiet depot
#

?

jovial warren
#

your framework

quiet depot
#

loads of people have access

jovial warren
#

I'd use your framework if it meant I got to contribute on a project like that

#

I mean if eCloud was to be rewritten Piggy, not the current PAPI project

#

would that be AO or could some people get whitelisted to work on it

quiet depot
#

people could get whitelisted

#

I mean if people want to get access to papi 3 rn, I usually add them

jovial warren
#

can I have access?

quiet depot
#

i mean there's nothing actually on the papi repo, as I said before it's mostly in rpf

#

but sure

#

what's your gh

jovial warren
#

same as discord

versed reef
#

Could anyone help me with my Citizens plugin, they don't seem to be spawning

prisma wave
errant geyser
obtuse gale
pallid gale
#

Wew baby we got a tripple

jovial warren
#

oh baby a triple indeed

quiet depot
jovial warren
#

cheers

#

@prisma wave you got access to that btw

ocean quartz
#

404 😒

jovial warren
#

ask for an invite matt

prisma wave
#

@prisma wave you got access to that btw
no?

jovial warren
#

ask for an invite

prisma wave
#

i'd actually rather not atm

jovial warren
#

fair enough lol

prisma wave
#

got work to be doing, don't wanna get distracted with any side projects lol

jovial warren
#

I see it's under GPL v3

quiet depot
#

there's nothing to distract you in there

#

invited all 3

#

all plugins are under gpl v3 bardy

jovial warren
#

nice

#

doesn't that mean this has to be OS lol

#

I guess it will be eventually

quiet depot
#

it will be os

#

but right now, legally, it doesn't have to be

onyx loom
#

whatd be the best way to read from a file and put the lines into a list? currently its formatted like

2. item2
3. item3

but im sure i can deformat it pretty easily

quiet depot
#

only when it's publicly distributed do we have to share the code at request

hot hull
#

items:

#

then have the items

quiet depot
#

although the code will be publicly available, not via request

jovial warren
#

also archiveFileName = "PlaceholderAPI-${project.name}-${project.version}.jar"

#

πŸ€”

quiet depot
#

?

jovial warren
#

what's that gonna end up putting out?

quiet depot
#

PlaceholderAPI-bukkit-3.0.0.jar

prisma wave
#

@onyx loom String.lines is a thing in kotlin, so you can just do file.readText().lines()

jovial warren
#

oh it's bungee as well isn't it

#

silly me

quiet depot
#

proxies may not be available on initial release

onyx loom
#

tyty

hot hull
#

sPoNgE πŸ‘Œ

jovial warren
#

also version should be 3.0.0-SNAPSHOT

#

just saying πŸ™‚

quiet depot
#

no

#

snapshot meta is stupid

jovial warren
#

SNAPSHOT means incomplete afaik

#

like a build that's still being worked on

#

it gets removed once the build is complete

ocean quartz
#

Softwares are never complete, sounds redundant

quiet depot
#

projects like papi are never in a complete stage

jovial warren
#

true

remote goblet
onyx loom
#

πŸ˜„

quiet depot
#

like matt said actually, 99% of software is never in a complete stage

#

therefore the meta of using snapshot, is stupid

#

it's unnecessary to indicate something is a snapshot, that should be an assumption

#

hell

#

put release at the end

#

that's something I can support

ocean quartz
#

Imo, -alpha or -beta if it's very unstable and just numbers if it's stable

jovial warren
#

or FUCKED if it just doesn't work lol

quiet depot
#

just working on the mc api design

#

for papi to work, we have to have a fully functional minecraft api that supports the functionalities of bungeecord, velocity, sponge, bukkit, and nukkit

jovial warren
#

I'm trying to think of what I could put in to this

quiet depot
#

and nms because i'm nice

jovial warren
#

yeah

quiet depot
#

luckily

#

sponge has set an excellent example for me to follow

#

regarding api design

pallid gale
jovial warren
#

lol

onyx loom
#

oof

#

i would also like to point out that DM 1.13.2 is pretty fucked too 😬

jovial warren
#

what you working on atm Piggy?

onyx loom
#

PlayerInventory.java

quiet depot
#

player api, which inherently includes inventory/item/material apis

remote goblet
#

i need an api that will write plugins for me

quiet depot
#

main design goal is the separation of immutability and mutability, with immutability by default and requestable mutability

onyx loom
#

sure ori

jovial warren
#

you got anything I could help you with?

onyx loom
#

give me 1 sec and pull it out my ass

remote goblet
#

hot

quiet depot
#

No sorry

hot hull
#

Glare dead dead or just dead?

quiet depot
#

i don't know any glares

#

just waffle king

hot hull
#

Okay then porkchop boi

jovial warren
#

alright

#

might take a look at wip/commands

quiet depot
#

is that frosty's thing?

jovial warren
#

I saw glare committed

#

so idk

quiet depot
#

oh shit was it merged

hot hull
#

I pushed earlier

jovial warren
#

no it wasn't

hot hull
#

That's why I'm asking if Glare's dead ee

quiet depot
#

guess i better review this code frosty

hot hull
#

mhm

#

Don't be too mad of the design I chose

jovial warren
#

okay can't build

#

license violations apparently

#

tf does that mean

quiet depot
#

?

rotund egret
#

Stop violating the license

quiet depot
#

build what

rotund egret
#

Smh

jovial warren
#

license violations when I try to clean build

obtuse gale
#

smh

jovial warren
#

the whole lot

#

wip/commands

quiet depot
#

oh

jovial warren
#

gradle clean build

quiet depot
#

OHHH

#

wip/commands is papi3

jovial warren
#

yeah

#

duh lol

quiet depot
#

uh

#

try gradle updateLicenses

jovial warren
#

okay that did something

#

okay clean build worked I think

quiet depot
#

god what am I saying

#

stop using your local gradle installation

#

./gradlew

hot hull
#

:kek:

jovial warren
#

ah okay

quiet depot
#

that won't fix the issue, just better practice

jovial warren
#

yeah might help with third-party projects like this

quiet depot
#

updateLicenses should've fixed the issue tho

jovial warren
#

yeah it did

onyx loom
#

@prisma wave is there a way i can compare a string to another thats stored in a list? but instead of checking if it matches exactly, it just contains the string? if i use in then it seems to check if the string matches an item exactly

jovial warren
#

it's just indexing

prisma wave
#

@onyx loom example?

#

oh I think I know what you mean

quiet depot
#

list.stream().anyMatch(str -> str.contains(element));

prisma wave
#

List#contains would compare equals rather than String#contains

quiet depot
#

copy that into intellij

prisma wave
#

^

quiet depot
#

it'll convert to kotlin

prisma wave
#

or in kotlin, list.any { element in it } or list.any { it.contains(element) }

jovial warren
#

what JDK does it use piggy?

quiet depot
#

8

#

idk

jovial warren
#

okay

quiet depot
#

check the build.gradle

onyx loom
#

thanks ill try that πŸ˜„

quiet depot
#

well, most

#

not all

#

even then passing plugin via constructor seems so wasteful

remote goblet
#

ew java

#

jk

quiet depot
#

doesn't papi have a static instance getter?

#

it does

jovial warren
#

for some reason gradle just doesn't want to work today lol

#

let's try reimporting

hot hull
#

smh didn't know there was a static ee

quiet depot
#

@jovial warren pull

#

i pushed my local stuff

jovial warren
#

okay

#

how do I force that?

#

since I've made minor changes

#

or actually I need to integrate my changes with yours

quiet depot
#

hard reset your copy to my commit

#

well actually

#

what are your changes?

jovial warren
#

just was in the middle of fixing massive yellows in the build.gradle, and was gonna write some commands in common

quiet depot
#

if you've written anything valuable, do a soft reset

jovial warren
#

I haven't lol

quiet depot
#

although you might have to do a manual merge

#

anyway

jovial warren
#

also, I'm working with the one I cloned from your repo anyway

quiet depot
#

./gradlew shadowJar works for me btw

jovial warren
#

yeah same for me

#

I just had to reimport

#

okay time to fork

#

wait forking disabled?

hot hull
#

How else would you pass in the instance without static tho since static ew?

even then passing plugin via constructor seems so wasteful

jovial warren
#

forking's disabled Piggy?

hot hull
#

You can't fork private repos iirc

jovial warren
#

how do I commit and pull then?

quiet depot
#

there's nothing wrong with using a static instance getter on a bukkit plugin's javaplugin frosty

jovial warren
#

submit a pull I mean

hot hull
#

ah, then gimme like 5min and I'll change it

jovial warren
#

what I'd usually do is fork, clone my fork, commit, push, then submit a pull req

quiet depot
#

can you open a pr from local?

jovial warren
#

not sure

#

maybe

quiet depot
#

do you have gh pro?

jovial warren
#

yeah

#

why?

quiet depot
#

should let you fork then Β―_(ツ)_/Β―

jovial warren
#

maybe I need perms to

#

check permissions in settings

quiet depot
#

try now

jovial warren
#

still disabled apparently

quiet depot
#

aight well you have permission

jovial warren
#

lemme try with a testing repo

#

join it and lmk if it lets you fork

#

I'll check settings

#

maybe not then

#

Β―_(ツ)_/Β―

#

maybe it'll update at some point

#

ah okay you gotta allow forking on the organisation first

hot hull
#

Pushed Porkchop

jovial warren
#

can you fork the repo frosty?

hot hull
#

Gimme 5min for chrome to open

jovial warren
#

Piggy needs to turn on forking of private and internal repos for the organisation I think

#

also you should set up Jenkins Piggy

quiet depot
#

there is a jenkins

jovial warren
#

private?

#

also did you read my other messages?

quiet depot
#

it's on my jenkins

#

private account

jovial warren
#

ah okay

quiet depot
#

that one is staff only sorry

jovial warren
#

alright

#

did you read my other messages though

#

about setting forking enabled for private repos on the organisation settings

quiet depot
#

uh

#

I actually can't

jovial warren
#

you're not admin on the organisation are you

quiet depot
jovial warren
#

okay who owns the organisation? clip?

quiet depot
#

your time is better invested figuring out how to pr locally

jovial warren
#

true

#

don't think that's possible though Piggy

#

no docs for it on GH

quiet depot
#

try forking it now

remote goblet
quiet depot
#

use replace instead of replaceAll

hot hull
#

That config setter hurts

quiet depot
#

imagine not using object mappers

hot hull
#

Imagine not using

remote goblet
#

this entire plugin hurts

hot hull
#

Also, have ya heard of a thing called final 😏

onyx loom
remote goblet
#

At the time i had made the plugin, not really no

hot hull
#

Missing 5 more Kali

obtuse gale
#

Y r all ur things .java

onyx loom
#

:))

remote goblet
#

my bf is just watching me have a mental breakdown trying to understand why i did this

obtuse gale
#

Any son know hoer to get them entires message historhu o n a channel with jda? getOteralableHostory says. It only gets the recent history

#

Oh god

onyx loom
#

what the fuck

remote goblet
#

Aj is having a stroke

obtuse gale
#

It’s 2.30 and I’m on my phone

onyx loom
#

aj having another seizure, no worries

#

GO SLEEP

obtuse gale
#

I’ll reword that lol

hot hull
#

@remote goblet If you don't got a mental breakdown, are you even developing?

remote goblet
#

Absolutely not

obtuse gale
#

Anyone know how one would get the entire message history of a channel with JDA. Apparently getIterableHistory only gets the recent history

remote goblet
#

the lack of final

#

hurts

hot hull
#

:c

remote goblet
#

its loading the config

#

everytime someone types

#

my brain

#

it hurts

hot hull
#

πŸ˜‚

ocean quartz
#

Yuck getInstance()

hot hull
#

@quiet depot Anything else you'd like changed, or are you gonna let Glare do the judging?

obtuse gale
#

Welp, I’m off to go scroll through shitty Instagram memes for the next hour before I go to bed

#

Wish me luck

hot hull
#

Or ya know just go sleep?

obtuse gale
#

Yeah but like

onyx loom
#

r/kotlinmemes is better

obtuse gale
#

My phones got 13% so I should let it drain

quiet depot
hot hull
#

It's handled within the command itself, so is it necesarry?

#

And it'll always return true

quiet depot
#

if that's the case, make execute a void

#

and remove the usage from options

obtuse gale
#

It’s actually 5000iq, my graphics teacher tells me I shouldn’t sleep with my phone near my head, or with it in my pocket cos it might radiate my schling or smthn, so by letting it drain power I’m saving myself

hot hull
#

Never heard of em

quiet depot
#

wtf is min and length

hot hull
#

min args and command length

hot hull
#

The completion is for glare to finish

quiet depot
#

k

#

yeah looks like handleUsage & handleCompletion shouldn't be abstract

#

and i'm not sure about this min/length shit

hot hull
#

I've renamed it to proper shit now

quiet depot
hot hull
#

When it comes to actual commands, blame clip ;c

remote goblet
hot hull
#

Assuming what?

quiet depot
#

well generally processes happen in steps

#

e.g.

#

process begins
process finishes
tell user process result

hot hull
#

so message after execution

quiet depot
#

you tell the user the process result before the process has even happened

#

replace all calls to PlaceholderAPIPlugin.getInstance() with a constant variable

#

also does the command completion api actually use the list structure?

#

surely you can return a set instead

hot hull
#

The completion is for glare to finish

#

And yes I believe it does

quiet depot
hot hull
#

Ah

#

Should be all fixed I guess?

obtuse gale
#

Guys, I'm Italian, but I know English well enough. Can you recommend a guide to start developing plugins?

hot hull
#

Are you familiar with java?

onyx loom
#

are u familiar with kotlin 😏

errant geyser
#

^

#

@prisma wave for a plugin would you go for the whole Exposed + HikariCP DB thing or just the native SQL thing + CompletableFutures like I used last time? Bearing in mind I'd only be using SQLite, and not MySQL or smth.

old wyvern
#

Why would you want connection pooling for SQLite?

errant geyser
#

Β―_(ツ)_/Β―

jovial warren
#

SQLite connection pooling?

#

just setup connection pooling for MySQL, MariaDB, PostgreSQL and other databases you wish to support

#

I recommend sticking to SQL databases though

#

since NoSQL is a pain, especially MongoDB

prisma wave
#

Afaik Hikari for SQLite is pointless

#

But I'd recommend coroutines instead of futures if you're using kotlin

rotund egret
#

If you're using kotlin
Who isn't using kotlin anymore

#

Oh Matt I have another issue for you in a sec

ocean quartz
#

πŸ‘€

prisma wave
#

If you're using kotlin
Who isn't using kotlin anymore
Very true

hot hull
#

I'm not using kotlin

ocean quartz
#

Ooh gotcha, yeah i think that makes sense, i think what happened is that I added the global prefix later so i think i forgot that part

hot hull
#

😎

prisma wave
#

Not for long

hot hull
#

22

prisma wave
#

22 days left I believe

#

He's

#

yes*

ocean quartz
#

I'm sorry to hear that Frosty

rotund egret
#

Convert your framework to kotlin Matt πŸ˜›

ocean quartz
#

Actually i first started making it in Kotlin
But then Piggy told me to merge it with the spigot one so i made in java to do that later

errant geyser
#

@prisma wave teach me coroutines

#

Ez xp

prisma wave
#

can't rn

#

but they're basically callbacks generated by the compiler

#

With some extra API spice

errant geyser
#

OOoooooOOOOO spciy

prisma wave
#

Very spicy

old wyvern
#

Basically your whole segment run inside a coroutine is split into a few pieces i.e, on every suspend function call,
Every time a suspend function is called in a coroutine it creates a Job in one of the Executors to execute that and passes the the rest of the code as a Continuation function which is executed after your suspend function returns.
Its basically Continuation Passing Style but without the troublesome boilerplate
https://en.wikipedia.org/wiki/Continuation-passing_style

In functional programming, continuation-passing style (CPS) is a style of programming in which control is passed explicitly in the form of a continuation. This is contrasted with direct style, which is the usual style of programming. Gerald Jay Sussman and Guy L. Steele, Jr. c...

#

@errant geyser

signal tinsel
#

Ok so I'll just write my own way to add hex code support in my messages.yml

#

Cuz I managed to fail to use oris spoonfed method lmao

old wyvern
#

so a suspend function compiles down to something like
doSomething(otherArgs...., Continuation continuation)

signal tinsel
#

Oh that's nice

old wyvern
#

I was continuing my other message btw

signal tinsel
#

Yah

old wyvern
#

oh also if you are looking for hex in config and stuff minimessage probably has everything you might need

#

also suppourts hex

signal tinsel
#

I make my own shit

old wyvern
#

alrighty

signal tinsel
#

Actually for messages.yml it might be what I need

ocean quartz
#

Mini's lib doesn't work well with hex yet

digital patrol
#

does anyone here know how to compile a plugin file with eclipse jdk 8

#

maven build

ocean quartz
#

Zod, try out 1.1.14-BETA it should have been fixed, i couldn't test since i'll need to leave in a sec but seemed like a simple fix

rotund egret
#

Once it uploads/lets me download I'll give it a go

#

Yeah that worked, tysm Matt

ocean quartz
#

Nice ;p

jovial warren
#

thoughts anyone?

rotund egret
#

That logo looks familiar

topaz bay
#

first thing that came to mind was the ubuntu logo

jovial warren
#

you're thinking of the Debian logo I think

topaz bay
#

No

#

The ubuntu logo

digital patrol
#

i compiled a plugin correctly got the jar file loaded it in my server and it hasnt came up

topaz bay
#

Although yes, it does look more like the debian logo

versed ridge
#

@topaz bay How can I install my shadowJar to my local repo and use that?

topaz bay
#

@versed ridge well 1. dont.

#

you should publish your code only

#

And leave it up to the end user application to shade necessary dependencies

errant geyser
#

Heyyyy Sx KM said to use Coroutines for DB calls in Kotlin. Can you give me an example?

topaz bay
#

What kind of example are you looking for?

errant geyser
#

Just an asynchronous coroutine

#

I was going to look into Futures/callbacks but KM said to use this instead

topaz bay
#

I mean... coroutines are by nature asynchronous

errant geyser
#

Ok then, can I have an example of one?

#

Just like how to make it so I can slap my code inside it and hope for the best

digital patrol
#

anyone able to fix this

topaz bay
#

@errant geyser depends on the context

#

just slap the code inside of launch

errant geyser
#

@digital patrol you have two of the same plugin in your plugins folder. Delete one

#

Ok so it's basically for DB calls. So all I'd have to do is

launch {
    //my calls here 
}```?
topaz bay
#

yes

errant geyser
#

Oh, ok, that's simpler than I expected. What happens if I need to grab the value from the DB and then use it? Like I used callbacks for that in java, is there any special way to do that here or do I just put it all inside the launch?

topaz bay
#

You would change your code to be sequential

#

Look at this for example

#

imagine launch as routineWork

#

everything inside of that is asynchronous, so that method just returns a value

digital patrol
#

@errant geyser thats for wiipay but that doesnt cause any problems

topaz bay
#

Then you can use it directly

errant geyser
#

Oh cool

#

So I call functions to do the stuff I wanna do with the value from the DB inside of the launch? Or am I completely off track here

topaz bay
#

Literally just instead of using callbacks, you make your methods return the values directly

errant geyser
#

@digital patrol it's all from your exams plugin. Update/fix/remove it

#

Oh ok, thanks

quiet depot
#

someone should fact check it for me

quiet depot
topaz bay
#

@quiet depot Why does the example use the bukkit dependency...

quiet depot
#

fixed

topaz bay
#

The second block under syntax is missing a closing quote

quiet depot
#

added

topaz bay
#

You also seemed to have grouped this property with group and version

#

Which would imply its a part of that

#

That should be grouped with the UTF-8 specification, as those are both configuration options for the java plugin

#

You also missed the bukkit dependency in the other code block

quiet depot
#

fixed both of those

prisma wave
#

"I could most certainly right the former from memory" write*

#

Personally I'd also mention that since gradle scripts are code, they're more extendable under pros as well

quiet depot
#

oh yeah forgot about that

#

fixed both

topaz bay
#

Damn.... you straight up yoinked my shit

quiet depot
#

yeah

#

tahsnk

#

you want credit lol? idm

topaz bay
#

No?

#

It wasnt a new or groundbreaking idea

#

Just seems strange considering the one I have is open source and on github

quiet depot
#

would actually be beneficial to link to yours as you have more examples

#

done

topaz bay
#

mhmm

errant geyser
#

Wait so Piggy, I could change all my dependency stuff to have the version of '+', and it would always fetch the latest?

#

TIL

topaz bay
#

Don't do that though

quiet depot
#

I wouldn't recommend it, not good practice

#

I'll edit the guide to specifically mention that

errant geyser
#

y tho

quiet depot
#

problem is the api may change of a dependency

#

and then your shit is broke

#

and you can't remember what version of the dep it was last working for

errant geyser
#

True, but lets say I'm updating a plugin and I want the latest version of everything

quiet depot
#

then use +

#

look at the gradle dependencies tab

#

find the versions, and replace the +

errant geyser
#

Smort

quiet depot
#

updated the guide to include a warning about that

topaz bay
#

In the case of spigot with the multiversions within the same minecraft version, you can append + to the end to stay only within the latest for that version

#

compileOnly "com.destroystokyo.paper:paper-api:1.15.2+"

#

And it will only update to the latest that starts with 1.15.2

quiet depot
#

added that too

#

didn't know you could do that

topaz bay
#

I dont think this would work actually

quiet depot
#

I tested everything on there

topaz bay
#

the bungeecord chat api isnt in spigot's repo

quiet depot
#

welp

#

you got me there

#

I've got no idea how my shit compiled

#

you're right, it does need sonatype

topaz bay
#

Oh actually wait, I think it is in there now

quiet depot
#

yeah

topaz bay
#

Looks like they just mirrored them

quiet depot
#

that's nice

#

was worrying that gradle was doing something funky for a second there

topaz bay
#

I still just use paper's

#

Β―_(ツ)_/Β―

quiet depot
#

I think the config I copied from voxmc uses paper

topaz bay
#

It does

#

Also... THIEVERY

quiet depot
#

well

#

you said no to the credit

#

and os

#

and you love me

topaz bay
#

That is unequivocally false.

quiet depot
#

ok mr vocabulary

topaz bay
#

That is barely a high vocabulary word

obtuse gale
#

thats like 6 syllables

#

holy shit\

topaz bay
#

I use that word literally all the time

quiet depot
#

it's kinda useless

obtuse gale
#

dr phil uses it quite alot

topaz bay
#

It literally means "without a doubt"

quiet depot
#

like false and true are already words of absolute certainty.

topaz bay
#

Except unequivocally doesnt modify that word, it modifies the target of that word

#

The subject is without a doubt true or false

#

Also, those words are not of absolute certainty

#

lol

remote goblet
#

do i have the patience to use sqlite for this

errant geyser
#

Yes

#

Join the club of must-use-SQLite

hard cedar
#

SQlite best stuff

errant geyser
#

meh

hard cedar
#

i dont use mysql if not needed

#

bcz i have to transfer it when changing server

remote goblet
#

idk if i want to do this tho lmao

errant geyser
#

Thats a strange way of doing it, no?

#

A wait no

#

Its the same way I did it just you pass it into the method as a consumer and not return a Future

prisma wave
#

Those 2 runnables aren't callbacks

#

They're the task you run

#

A callback is a function called when the task is complete

obtuse gale
#

Would line numbers in errors be wrong if the things coded in kotlin?

#

For a discord bot

onyx loom
#

if im trying to check if an input is an int, what should i do? so toIntOrNull, then should i just return null or what?

hot hull
#

Ints.tryParse, or use regex

obtuse gale
#

Caused by: org.hibernate.PropertyAccessException: Null value was assigned to a property

#

the fuck is this

#

var user = userRepo.findByDiscordUserId(member.id)

#

Its on this line tho :////

#

but then if you look at the error it talks about something completely different

heady birch
#

???

#

Uh idk

#

If its nullable in db make sure its nullable in hibernate?

#

Or kotlin maybe

obtuse gale
#

all the fields I assign to anything in the db are non-nullable

heady birch
#

Are they marked with ?

#

String?

#

e.g

#

For nullable in kotlin

obtuse gale
#

o

#

i missed 1

#

bruh

prisma wave
#

@onyx loom yes that'll work

onyx loom
#

just making sure thats the best way

prisma wave
#

Probably yes

#

Idiomatic and the fewest amount of operations

heady birch
#

everything I write is idiot matic

onyx loom
#

smh niall

#

service managers

regal gale
#

From the third glance, idk why I'm starting to hate 3d prespective rendering into 2d lol

#

I mean, I did handle it but that's really annoying

#

Had to take smth from three.js for a while

obtuse gale
#

Say I have something like this

data class Y(
  val things:List<String> = listOf()
)
interface YRepo: JpaRepository<Long, Y>

How can I get a Y by something that the list contains

#

actually there might be multiple with that thing in the list

prisma wave
#

Define a function called something like findByThings

#

Spring does the rest of the work for you

obtuse gale
#

should that return a list of Y tho?

#

or just Y

prisma wave
#

If it's a list it will probably need to be findAllByThings

#

Or possibly findAllByThingsContains

#

Depends what you want to return really

obtuse gale
#

wait can you even have lists in things?

#

'Basic' attribute type should not be a container

prisma wave
#

Use @ElementCollection

remote goblet
#

@signal tinsel ignoring that Exception catch like its a not an issue kekW

remote goblet
#

^ this supports versions lower than 1.16

signal tinsel
#

Ofc i ignore it

remote goblet
#

why would you ignore it

#

its pointless

signal tinsel
#

It throws an exception if its invalid

onyx loom
#

is there any files i dont need to add to github repo? such as .idea folder?

signal tinsel
#

Target

#

And it intentionally doesnt use non 1.16 colors

distant sun
#

@onyx loom

.idea/
.gradle/
build/
out/
*.iml```
onyx loom
#

they didnt even show up πŸ‘

prisma wave
#

^ or more generally, any IDE/ build tool files that aren't necessary to make the build reproducible

onyx loom
#

BuildTools committed πŸ™‚

#

anyways, code review bm?

#

not that theres much

obtuse gale
#

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.aj3douglas.helpme.core.Request.embedIds, could not initialize proxy

Use @ElementCollection
@prisma wave

prisma wave
#

Send code

#

@onyx loom gimme like 10 minutes

obtuse gale
#
@Entity
data class Request(
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id:Long = 0,
    var type:String = "Undefined",
    var description:String = "Undefined",
    @ElementCollection
    var embedIds:List<String> = listOf(),
    var channelId:String = "Undefined"
)```
prisma wave
#

Uh

#

I guess initialize it eagerly

#

There will be something in the ElementCollection annotation I think

obtuse gale
#

initialize it eagerly?

onyx loom
#

be eagar and eventually itll initialise

#

works everytime

obtuse gale
#

oh is that FetchType.EAGER?

prisma wave
#

Yes

obtuse gale
#

ah

prisma wave
#

Eager = fetching as soon as possible
Lazy = fetching only once the data is needed

#

But lazy loading will only work if there's an active connection

#

Transaction*

obtuse gale
#

ah

#

yeah that fixed it

signal tinsel
#

Finna experiment with gh packages tmrw

obtuse gale
#

tfw u dont change anything but your bot just stops logging in

signal tinsel
#

Ikr

obtuse gale
#
    @Bean
    fun setupJDA():JDA{
        println("Setting up JDA")````
#

What would the cause of this just suddenly not being called be lol

prisma wave
#

the bean is only initialized once

obtuse gale
#

its not being ran at all

#

It was working literally 5 seconds ago

#

And I havent touched anything related to it

prisma wave
#

are you using a jda instance anywhere?

heady birch
#

Probably needs to be autowired somewhere

prisma wave
#

it won't be called if it's never used

#

so yeah

obtuse gale
#

Can I just autowire that class in anywhere in my code?

heady birch
#

Bro dont call it setupJda

#

Yeah

#

Or else youl be autowiring like

obtuse gale
#

Do I need to call the method in it?

#

Just weird that it was working 10 seconds ago

heady birch
#

public class CoolClass(final JDA setupJda)

#

no

obtuse gale
#

wait what

heady birch
#

dont autowire the class

prisma wave
#

you don't call bean methods manually

heady birch
#

autowire JDA

obtuse gale
#

oh ok

#

Do I need to do this in my main class?

#

wait wdym dont autowire the class lol

jovial warren
#

I've got an example of this in my bot code hold on lemme get a link for you aj

#

obviously I'm using runCatching there

obtuse gale
#

well yeah thats what ive got

#

I never use that class tho

jovial warren
#

then I autowire that to other places

obtuse gale
#

Just the class?

jovial warren
#

I inject jda() in to the commandManager() bean

#

lemme get where I inject command manager

#

probably a better way to do that tbh

obtuse gale
#

I meN

#

In one of my classes I have

#
@Autowired
private lateinit var jdaComponent:JDAComponent```
#

but its really weird, I didnt touch anything related to my bot and its just stopped running that method

signal tinsel
#

Lateinit?

prisma wave
#

constructor injection >>>

obtuse gale
#

soo

#

what should i be doing lol

prisma wave
#

constructor injection for 1 thing

#

but send the full class

obtuse gale
#

The JDAComponent class?

prisma wave
#

nah

#

although

#

wait

#

send the class

@Autowired
private lateinit var jdaComponent:JDAComponent```

that this is in

obtuse gale
#

well I dont use the JDAComponent anywhere in that class

#

I just chucked it in a random class lol

#

I dont need the jda instance anywhere, I can get it from all events

prisma wave
#

bruh

#

you should autowire the JDA instance, not the component

obtuse gale
#

lol

#

wdym

prisma wave
#

@Autowired val jda: JDA

obtuse gale
#

is it smart enough to get JDA from that method?>

prisma wave
#

yes

#

you should only autowire the dependencies you need

#

not something else

obtuse gale
#

that methods still not happening lol

prisma wave
#

send code

obtuse gale
#

w h a t c o d e

prisma wave
#

the full class with the autowired jda

obtuse gale
#

I dont use JDA in that class anywhere

jovial warren
#

just autowire the bean factory

prisma wave
#

no

#

don't do that if you can help it

#

I dont use JDA in that class anywhere
doesn't matter

jovial warren
#
@Service or @Component
class MyServiceOrComponent @Autowired constructor(private val beanFactory: BeanFactory) {

    fun myFunction() {
        val jda = beanFactory.getBean(JDAComponent::class.java)
    }
}
```?
prisma wave
#

no

jovial warren
#

well I got some rewriting to do then

prisma wave
#

you shouldn't be autowiring the component in the first place

jovial warren
#

you autowire the bean

prisma wave
#

and as I said, you should only use the bean factory when you can't do manual injection

#

ie when you can't just have the actual object autowired

#

which in this case, and most cases, you can

obtuse gale
#
@Component
class RequestReactionListener :ListenerAdapter() {
    val config = Config()
    @Autowired
    private lateinit var ticketManager: TicketManager
    @Autowired
    private lateinit var jda: JDA
    override fun onGuildMessageReactionAdd(event: GuildMessageReactionAddEvent) {
        if(event.channel.id != config[Setting.SUPPORT_CHANNEL]) return
        event.reaction.removeReaction(event.user).queue()
        ticketManager.createTicket(event.member, event.guild)
    }
}```
jovial warren
#

jesus christ that's ugly

#

get some spacing

obtuse gale
#

thats literally it lol

#

nO

prisma wave
#

constructor

#

injection

jovial warren
#

^^^^

prisma wave
#

force spring to provide a value

obtuse gale
#

alright

#

still nothing

prisma wave
#

code?

obtuse gale
#
@Component
class RequestReaction @Autowired constructor(
        private val jda: JDA,
        private val ticketManager: TicketManager
) : ListenerAdapter() {
    val config = Config()
    override fun onGuildMessageReactionAdd(event: GuildMessageReactionAddEvent) {
        if (event.channel.id != config[Setting.CREATE_A_TICKET_BETA_CHANNEL]) return
        event.reaction.removeReaction(event.user).queue()
        ticketManager.createTicket(event.member, event.guild)
    }
}```
prisma wave
#

you are restarting the app right?

obtuse gale
#

yes lol

prisma wave
#

just making sure

#

print out the JDA instance somewhere

#

also navigate to the bean definition with intellij

#

you might have 2 or something

obtuse gale
#

wait

#

is it a problem that this class doesnt get autowired anywhere until the JDAComponent class is initialized?

jovial warren
#
@Component
class RequestReactionListener @Autowired constructor(private val ticketManager: TicketManager,
                                                     private val jda: JDA
) : ListenerAdapter() {

    val config = Config()

    override fun onGuildMessageReactionAdd(event: GuildMessageReactionAddEvent) {
        if (event.channel.id != config[Setting.CREATE_A_TICKET_BETA_CHANNEL]) return
        event.reaction.removeReaction(event.user).queue()

        ticketManager.createTicket(event.member, event.guild)
    }
}
```that's what I'd have
prisma wave
#

wdym

jovial warren
#

same thing

obtuse gale
#

as in

prisma wave
#

spring initializes them all on startup I believe

#

unless you have lazy loading configured

obtuse gale
#

oh ok

#

i shouldnt

#

so should I just print out JDA in an init { } blcok?

prisma wave
#

worth a try