#dev-general

1 messages Β· Page 130 of 1

onyx loom
#

yea just add the dependencies under it

obtuse gale
#
dependencies{
  implementation 'ch.jalu:configme:1.1.0'
}```
onyx loom
#

yuck aj edit a space between {

frail glade
#

Latest is 1.2.0 btw

lavish notch
#
plugins {
    id 'java'
}

group 'ml.mackenziemolloy'
version '1.0.0'
sourceCompatibility = JavaVersion.VERSION_1_8

dependencies{
    implementation 'ch.jalu:configme:1.1.0'
}
onyx loom
#

πŸ‘

obtuse gale
frail glade
#

Ahh, I use the snapshot

quiet depot
#

what does configme do

lavish notch
#

Do I need to download the shit off github, or ?

errant geyser
#

Essentially a YAML hander lib thing

frail glade
#

It's a glorified snakeyaml lib that supports beans and whatnot

#

Auto updating configs, keeps comments, migrations, etc.

quiet depot
#

beans

#

bruh

topaz bay
#

@lavish notch no

quiet depot
#

vanilla snakeyaml supports that

obtuse gale
quiet depot
#

and if u don't want to use snakeyaml, spigot also has gson

errant geyser
#

Is there a Gradle version of mvn install or do I have to write a pom as well?

obtuse gale
topaz bay
#

configme is more of a declarative configuration library

frail glade
#

Yeah

topaz bay
#

it has nothing to do with bean support really

lavish notch
#

so... is that all I need to be able to use ConfigMe?

topaz bay
#

@errant geyser gradle does not have a dependency format

errant geyser
#

So I do need to write a pom too then and use Maven to put it in my local repo

topaz bay
#

@lavish notch yes

frail glade
#

No

topaz bay
#

Oh thats what you mean

#

No

onyx loom
#

or just dont use maven πŸ™ƒ

topaz bay
#

Add the maven-publish plugin

lavish notch
#

so.. what do I need to do exactly? (Using Gradle)

errant geyser
#

And that can put it in my .m2 repo?

topaz bay
#

yes

errant geyser
#

noice

topaz bay
#

@lavish notch wdym?

lavish notch
#

To be able to use ConfigMe

topaz bay
#

You already have it in your build file right?

lavish notch
#

I think so

topaz bay
#

Send your build file

lavish notch
#
plugins {
    id 'java'
}

group 'ml.mackenziemolloy'
version '1.0.0'
sourceCompatibility = JavaVersion.VERSION_1_8

dependencies{
    implementation 'ch.jalu:configme:1.1.0'
}
topaz bay
#

=paste

compact perchBOT
#
HelpChat Paste

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

topaz bay
#

Ok, now you'll want to add the spigot dependency and repository

#
repositories {
  mavenCentral()

  maven({ url "https://papermc.io/repo/repository/maven-public/" })
}

dependencies {
  compileOnly "org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT"
}
lavish notch
#

I'm using gradle

onyx loom
#

that is gradle...

topaz bay
#

??

lavish notch
#

My bad - I just see maven and think that's not gradle

onyx loom
#

wot

lavish notch
#

just nrm

topaz bay
#

Yeah, gradle does not have a dependency format like I said earlier

lavish notch
#

build.gradle

topaz bay
#

No

#

Dont declare the dependencies block twice

#

Just put that line in your existing dependencies block

lavish notch
#

fixed

topaz bay
#

Also, please put repositories above dependencies

#

(doesnt really matter, but its kinda the standard)

lavish notch
#

done

topaz bay
#

Add this to your plugins block at the top

id "com.github.johnrengelman.shadow" version "6.0.0"
#

This is the shadow plugin

#

An analog of the maven shade plugin

lavish notch
#

done

topaz bay
#

send what you have now

lavish notch
topaz bay
#

Good

#

Thats pretty much it

#

Everything I say now is pretty much optional, and is just standards

#
  1. Normalize all your strings to use double quotes
  2. Separate the sourceCompatibility from your group and version
#

If you want to have your plugin.yml automatically fill in the version from your build file, add this

processResources {
    from(sourceSets.main.resources.srcDirs) {
        filter org.apache.tools.ant.filters.ReplaceTokens, tokens: [version: project.version]
    }
}
#

And in your plugin.yml use

version: "@version@"
quiet depot
#

those quotes aren't necessary

lavish notch
#

So hang on, what am I putting where?

topaz bay
#

If you dont want to have the all suffix on your jar shadow produces add this to your build file

shadowJar {
    archiveClassifier = ""
}
quiet depot
#

sx archiveClassifier is a property

#

archiveClassifier.set("")

topaz bay
#

@lavish notch if it looks like code, its in your build.gradle

#

lol

lavish notch
#

So... am I now able to use ConfigMe?

quiet depot
#

lol yes

#

but relocate it

lavish notch
#

?

topaz bay
#

@quiet depot ofc you dont need the quotes, but its a string, so quote it

#

Normalization is a good thing

quiet depot
#

sx the property thing is important

#

your archiveClassifier code won't work

#

archiveClassifier is final, and not a string

topaz bay
#

Thats not what Im talking about

quiet depot
#

ik

topaz bay
#

But ok

quiet depot
#

but it's more important than the yaml string

topaz bay
#

But thats not what I was addressing

quiet depot
#

well, to answer what you're addressing

topaz bay
#

Like ok, I fucking get it

lavish notch
#

so what am I relocating?

quiet depot
#

you're right, it's important to have the verbosity, just incase you have single quotes in the string ig

#

and it's nice anyway, even if you don't ahve the single quote

topaz bay
#

Its not verbosity to quote strings

quiet depot
#

"normalisation"

#

what does that mean

#

I've never seen it used in programming, except for the normalize.css library

quiet depot
#

the configme package, to a subpackage in your projects package

#

I'm not sure what the configme package is

topaz bay
#

Something is "normalized" if it is the "same" in every state or condition

quiet depot
#

it's usually the groupid.artifact id, but that's not guaranteed, so check their github

topaz bay
#

Another word is "standardized"

lavish notch
#

Where would the configme package be?

quiet depot
#

ah ok

#

their github mackenzie

#

or you can decompile your jar

#

whatever is easiest

lavish notch
#

do i just download off of github?

topaz bay
#

No

#

Relocation is something you define in your shadowJar configuration

lavish notch
#

idek what ShadowJar is

topaz bay
#
shadowJar {
  relocate 'ch.jalu.configme', 'your.base.package.configme'
}
#

Add that to your build.gradle

onyx loom
#

its equivalent to maven shade plugin or whatever

topaz bay
#

And obviously, replace "your.base.package" with the base package of your plugin

lavish notch
heady birch
#

Having fun with your new idea?

quiet depot
#

make the quote types consistent, like sx suggested before

lavish notch
#

' or "?

quiet depot
#

doesn't matter

#

I prefer ", because java

#

but groovy doesn't discriminate

topaz bay
#

@quiet depot setting archiveclassifier works btw

lavish notch
#

Is my base package, the main package?

quiet depot
#

does ij give you a warning sx?

topaz bay
#

Ofc it does

#

But it works

quiet depot
#

groovy is too slack .-.

topaz bay
#

Not really...

lavish notch
#

Is my base package, the main package?

topaz bay
#

Its kind of the point of groovy to be extremely lenient

#

@lavish notch yes

#

You could technically set it to your project's group

#

Since that matches your actual base package

quiet depot
#

no don't do that

lavish notch
#

So... how can I test that this was successfully setup? (The configme)

quiet depot
#

it should be in ml.mackenziemolloy.swordfilter, not ml.mackenziemolloy

topaz bay
#

What?

lavish notch
#

?

topaz bay
#

No thats not true?

#

@lavish notch run the shadowJar task

lavish notch
#

how?

quiet depot
#

if you're putting it in ml.mackenziemolloy, then there's no point of relocating at all, because then if they use that package again, with the configme dep, a runtime error will occur

topaz bay
#

There should be a play button in your build.gradle file

#

beside shadowJar

#

You can click that

onyx loom
topaz bay
#

Or open the gradle window, its under the "shadow"

#

ok

#

play button is easier though

lavish notch
#

15:39:35: Executing task...

Task :help

Welcome to Gradle 6.5.1.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

For troubleshooting, visit https://help.gradle.org

BUILD SUCCESSFUL in 25s
1 actionable task: 1 executed
15:40:01: Task execution finished.

topaz bay
#

Yeah, its fine

lavish notch
#

so... let's say the config is something like...

blocked-words:
- CATS
- DOGS
- APPLES
replacements:
  g: q
  a: 4

Would I just use a forEach loop to cycle through the different replacements? Or is the a more efficient way?

prisma wave
#

HashMap

#

O(n)

#

wait

#

O(1)*

topaz bay
#

with configme, you declare the sections as properties

#

blocked words would just be a list of strings

#

replacements would be a map

lavish notch
#

Do you have a HashMap example?

topaz bay
#

example of what?

lavish notch
#

Brister suggested I use a HashMap

topaz bay
#

oh fuck me, Im still on configme

#

You mean when youre doing the checks??

lavish notch
#

That config example above..

#

I want to so I can add as many as I want

#

IE: It's not limited to just 1, or however many

topaz bay
#

Mackenzie...

#

What are you asking?

#

Do you want to know how to go through them when youre doing the checks on the words?

lavish notch
#

yes

topaz bay
#

How to load them using configme?

#

I think the most efficient way would be to create all the permutations when you load the config

#

Load the words, then all the replacements, and store all permutations in a set

lavish notch
#

Okay, I'll give that a go

hot hull
#

Is it worth having my own events for stuff? So people can cancel them if they want instead of having to use hacky ways?

topaz bay
#

yeah

heady birch
#

yeah

#

but dont cancel if another plugin cancels it

#

why should you?

topaz bay
#

It depends on what hes doing?

hot hull
#

I'm modifying the join and quit events, and I guess it's still easier to cancel my one than the entire one correct?

#

(since you've got control on what's cancelled)

obtuse gale
#

imagine making your event cancellable

hot hull
#

I'd expect Fuck1.8Event to not be cancellable

obtuse gale
#

ofc

twilit ledge
#

@quiet depot you can target it on eclipse

#

@lavish notch if you still need help setting up eclipse I gotchu

topaz bay
#

Eclipse is trash

#

No one should use it

#

If you do, you're an idiot

#

Dont @ me

twilit ledge
#

Stop trying to start a war Sxtanba

#

I know you want attention but you ain’t gonna get it

obtuse gale
#

There is no war

obtuse gale
#

"War is a situation or a period of fighting between countries or groups of people. A war generally involves the use of weapons, a military organization and soldiers. War is a situation in which a nation enforces its rights by using force. Not every armed conflict is a war."

#

Eclipse has no weaponry

#

intellij on the other hand

prisma wave
#

Lmao

#

This isn't a war, it's a massacre

viscid prawn
#

i got downvoted πŸ˜” lmao

obtuse gale
#

smh frcsty

#

so rude

hot hull
#

It's plain, you're just spawning an npc

#

Show it when it moves, and I'll upvote fingerguns_reversed

onyx loom
#

intellij good eclipse bad

viscid prawn
#

haha yeah i know, it took quote awhile for me to manage with its pathfinders

#

aight bet

onyx loom
#

kotlin good java bad?

hot hull
#

Tanku, make it do a backflip fingerguns fingerguns_reversed

old wyvern
#

make it do a mc speedrun

#

☠️

viscid prawn
#

lmao that'd be an interesting pathfinder

twilit ledge
#

Im down voting you

obtuse gale
#

why

twilit ledge
#

Toxic behaviour

obtuse gale
#

got nothing to do with fuck1.8 but ok

hot hull
#

Only I'm allowed to downvote Aj, how dare thy

twilit ledge
#

Your getting down voted too

hot hull
#

Kid

twilit ledge
#

For talking back

obtuse gale
#

smh frcsty

hot hull
#

Do as you wish fingerguns_reversed

obtuse gale
#

stop talking back

twilit ledge
hot hull
#

Downvote all my posts for all I care theotherpig

obtuse gale
#

you wont win, kids always win in 'who can talk back the most'

twilit ledge
#

Im gonna down vote ur whole family

hot hull
#

Oi, chill before you start saying things you'll regret fingerguns_reversed

viscid prawn
#

uploading him walking around rn πŸ˜›

old wyvern
#

@viscid prawn Imma wait for until it battles the ender dragon. Tnx

viscid prawn
#

i mean... hypothetically i could do it

hot hull
#

Better, now onto that backflip I was talking about

obtuse gale
#

hypothetically I could also do 1.8

viscid prawn
#

it's just a custom zombie with the disguise of a player and custom properties

obtuse gale
#

but like

#

nO

viscid prawn
#

so i could make it attack the ender dragon

old wyvern
#

idc what you do. make it do it

olive tusk
#

hello i have a question about EssentialsChat to show the guild's name
i check the wiki and try {GUILD} {GUILD_PREFIX} i still can't show the guild name

hot hull
#

Make your own pathfinders, now that's the ultimate flex

hot hull
olive tusk
#

?

obtuse gale
viscid prawn
#

this is gonna go from a mini-game plugin to an npc that beats the game

remote goblet
#

I gotta remake an event waiter in Kotlin EmiCool

#

no idea how tf to do this

#

or i just need to find out how to do set.removeAll(Stream.of(toRemove).filter(i -> i.attempt(event)).collect(Collectors.toSet())); in Kotlin mmSitStareMocha

old wyvern
#

what in the...

prisma wave
#

wat

old wyvern
#

use filterNot

#

or if you wanted to remove from the initial set strictly you can provide a lamba for the removeAll*

#

(in kotlin I mean)

prisma wave
#

there's no reason to use streams

topaz bay
#

Kinda hard to tell you how without the types of the set and toRemove

remote goblet
#

It's jda utilities code, its garbage CBPepeChristianServer

#

i'll just make the entire event waiter myself

#

even if i have to do it in Java and then convert it in kotlin

old wyvern
#

whats the point of converting then?

remote goblet
old wyvern
#

lol

remote goblet
lavish notch
topaz bay
#

What code do you have?

#

Please send the entire class

lavish notch
topaz bay
#

newProperty is a static function in PropertyInitializer

#

If you want to use them like that, you need to static import them

lavish notch
#

it doesnt like the imports

topaz bay
#

Is there an entry for configme under external libraries in the left pane?

lavish notch
#

Ah, no.

#

What do I need to download?

topaz bay
#

You dont need to download anything

lavish notch
#

oh

topaz bay
#

Did you not refresh your build.gradle?

lavish notch
#

Refreshing...

#

There we go

topaz bay
#

Anytime you change anything, a little icon should show up at the top right

#

Click that when youre done modifying the file

lavish notch
#

Ok

viscid prawn
#

man im tryna send them fighting the ender dragon

#

but discord is breaking

#

ah its cause i cant send it here

topaz bay
#

?

hot hull
#

If you're going for speed is it faster if you've got data stored in objects, or is it the same if you just get it from config?

twilit ledge
#

Do you guys know if eclipse got an update

onyx loom
#

yeah the update is called IntelliJ i believe

hot hull
#

Switch to IntelliJ

twilit ledge
#

No

#

Stop bullying mw

onyx loom
#

never

old wyvern
#

If you're going for speed is it faster if you've got data stored in objects, or is it the same if you just get it from config?
Pretty much same

#

@hot hull

hot hull
#

Not an answer, even if it's a milisecond faster I needa know fingerguns_reversed

remote goblet
onyx loom
#

ur always confusion

distant sun
#

How do I decompile a jar with cfr and load the files to iij?

#

I mean, I got the decompile part done but how do I import it as a gradle project

quiet depot
#

java -jar cfr.jar decompile.jar --outputdir project/

#

run gradle init in the dir

distant sun
#

oh

#

thanks

remote goblet
old wyvern
#

Not an answer, even if it's a milisecond faster I needa know fingerguns_reversed
@hot hull
Yea getting values from a field is faster But the difference is probs not worth a ms.

topaz bay
#

@remote goblet its a nullable type?

distant sun
#

it didn't create the src folder, fuck

topaz bay
#

Did you not choose java?

distant sun
#

I have just run "gradle init"

#

how do I select java?

topaz bay
#

Uhhhh

#

gradle init is interactive?

quiet depot
#

what type did you choose when doing gradle init?

distant sun
#

1

quiet depot
#

that doesn't ask for a language type

distant sun
#

do I select "application"?

quiet depot
#

no, just fill the rest in yourself

distant sun
#

Im confused

#

where do I select java from?

quiet depot
#

add the java plugin

#

id 'java'

topaz bay
#

Do 2, 3, 1, 4

#

with gradle init

#

And then just remove the application shit

distant sun
#

do i have to set the outputdir to project/src/java/main? @quiet depot

quiet depot
#

no

#

that's not the right directory structure

#

java is a source type, main is the actual source

#

other way around

#

source, then source type

remote goblet
#

@remote goblet its a nullable type?
@topaz bay awot

distant sun
#

it worked, thank @quiet depot

topaz bay
#

@remote goblet that type is nullable

#

And youre calling a function on it

#

Should it not be ?.attempt

remote goblet
onyx loom
#

why !! 😦

remote goblet
#

i dont know shut up

#

i wonder what yugi is typing

old wyvern
#

awot
@remote goblet
Kotlin manages nullability during compile time. You have to specifically handle all possible "null" values when you come across them.
For this you have nullable types. That is just any type suffixed with a '?' without the quotes

So if your type is "Player" it would be "Player?" if it could possibly be null at that point.

You can either specifically check for null with a if statement like you would in java and it would smart cast it to the normal type
Or you could use the safe call operator someThing?.lol()
Basically the safe call operator returns null as the return of the function call instead of throwing a NPE if the someThing is null in that case.
You can handle this with the elvis operator ?:

imagine you have this

val playerName: String = player?.name

Here you specified that playerName is strictly a String and not a nullable String / String?. But the return value from using a safe call is nullable so to solve this, we have:

val playerName: String = player?.name ?: "DefaultName"

i.e, the Elvis operator returns the right operand in the case that the left operand is null and now thats valid since the returned value is always a String and not a String?

remote goblet
#

oh jesus

#

ah yes, something i generally already knew

#

still dont know a fix for Out projected prohibits the use of 'public final fun attempt (event: T) Boolean? defined in xyz.oribuin.lilori.utils.WaitingEvent

old wyvern
#

as I said

#

The reutrn type of a safe call is nullable

#

You used safe call to call the attempt function

#

the returned value is nullable

#

but you didnt handle nullablity for the next call

topaz bay
#

kotlin has properly handled type projections

#

your attempt method expects T

old wyvern
#

Boolean?#collect()\ doesnt make sense

topaz bay
#

But your instance defines it as out projected

#

*

#

Those dont match

old wyvern
#

oh wait nvm i read that wrong lol

#

rip

remote goblet
#

Ima pretend like i have enough intelligence to understand what either of you two said EmiCool

#

smh people thinking i have a brain

versed ridge
#

I’m sorry @obtuse gale ☹️

#

I got bored

lavish notch
#

How do I compile a project in Intellij?

onyx loom
#

using gradle?

versed ridge
#

Are you using maven or gradle

lavish notch
#

gradle

versed ridge
#

Double press CTRL then type gradle build

lavish notch
#

ok

#

Where does the compiled jar get saved?

versed ridge
#

ProjectFolder/build/libs

lavish notch
#

With the "minecraft development" or whatever it's called Plugin, do I still need to add a server jar to the external libs?

versed ridge
#

eh

#

What do you mean exactly

onyx loom
#

the mc dev plugin only creates a main class with onEnable etc with a plugin.yml

lavish notch
#

ah.

#

So I still need to reference a server jar?

onyx loom
#

what

versed ridge
#

You add spigot to the dependencies in your build.gradle

#

But the mc dev plugin adds that automatically

#

When you make a project

lavish notch
#

So... I made my project prior to installing the plugin. Under what directory, do I make the plugin.yml?

analog crater
#

Src/main/resources/plugin.yml

#

And mark it as resources folder

lavish notch
topaz bay
#

Please use quotes

#

And dont forget to define api-version

lavish notch
#

like name: "SwearFIlter"?

topaz bay
#

Yes

lavish notch
#

Do I do 1.15, or 1.15.2?

#

compileOnly "org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT"

topaz bay
#

Do you use any 1.15.2 specific APIs?

#

That value is to signify the lowest version your plugin is able to run on

#

If you use nothing thats version specific, set it to "1.13"

lavish notch
#

Cannot find main class `ml.mackenziemolloy.swearfilter.main'

#

nrm

#

Im dumb

#

Umm..

#

Could not load 'plugins\SwearFilter-1.0.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: ch/jalu/configme/SettingsHolder

analog crater
#

did you shade it or include it in the plugins folder for your server?

topaz bay
#

youre building with the jar task

lavish notch
#

I did what Sxtanna told me to do

topaz bay
#

build with the shadowjar task

lavish notch
#

How do I do that?

onyx loom
#

πŸ₯£

topaz bay
#

By clicking shadowJar

#

In the gradle window

#

Or open your build file, and click the play button beside shadowJar

#

I told you earlier ;(

lavish notch
#

What play button?

topaz bay
#

Beside shadowJar

#

RIGHT THERE

#

Its green

lavish notch
#

ok

topaz bay
#

Add this to the bottom of the file

tasks.build.dependsOn tasks.shadowJar
#

And just run gradle build

lavish notch
#

I ran it

prisma wave
#

how have you managed to break everything

lavish notch
#

Β―_(ツ)_/Β―

#

Magic man

onyx loom
#

bm always asking the real questions

lavish notch
#

So...

prisma wave
#

wait

#

why does your bukkit main class have a main method

#

that's why

#

JavaPlugin doesn't exist in a non-spigot context

lavish notch
#

So...

#

What do I change

prisma wave
#

separate the classes

#

SRP

lavish notch
#

SRP?

prisma wave
#

single responsibility principle

#

a class should only have 1 responsibility (1 thing that it does/handles)

lavish notch
#

How do I register the other class?

prisma wave
#

with an instance of it

#

new OtherClass();

rose hornet
#

Hello, je configure vos serveurs Faction pour ceux qui souhaitent venez privΓ© πŸ™‚ (c'est pas gratuit)
For french people

onyx loom
#

l'anglais sil vous plait

lavish notch
prisma wave
#

@lavish notch depends entirely on what you're trying to do but probably not

lavish notch
#

Well... I'm trying to act upon the Chat Message event

prisma wave
#

that's not how you register events

#

I assume you're doing this blind, you are going to have a bad time without knowing Java

#

or kotlin 😏

lavish notch
#

I have some prior experience... nothing with substance tho.

onyx loom
#

add an onEnable method to ur main class then add
getServer().getPluginManager().registerEvents(new onChat(), this); i think

lavish notch
#

Expected two arguments, got one

onyx loom
#

edited message

#

forgot to add this 😐

lavish notch
#

nrm

#

fixed

topaz bay
#

class names should be UpperCamelCase

lavish notch
#

ok

#

and it cant see the class

topaz bay
#

Thats.... no...

#

delete that

lavish notch
#

D:

topaz bay
#

Is this your first plugin?

lavish notch
#

Ehh... yes, but no.

#

It's been a while since I touched plugin development

topaz bay
#

delete the main method

#

and remove that info call in your on enable

lavish notch
#

Done

topaz bay
#

spigot logs when your plugin is loaded, enabled, and disabled already

#

You dont need to do that

lavish notch
#

k

topaz bay
#

Mark this class as final

#

public final class

lavish notch
#

k

topaz bay
#

And change the name of the other class from onChat to OnChat

#

You could have 100% just had the listener in your main class because of how simple it is, but its fine

lavish notch
#

done

topaz bay
#

done

prisma wave
#

done...?

lavish notch
#

Error: Could not find or load main class ml.mackenziemolloy.swearfilter.SwearFilter

onyx loom
#

not done.

topaz bay
#

fini

lavish notch
#

D:

topaz bay
#

open the jar

#

is it there?

lavish notch
#

It isn't compiling

topaz bay
#

?

lavish notch
#

Error: Could not find or load main class ml.mackenziemolloy.swearfilter.SwearFilter

topaz bay
#

Ummm

heady birch
#

πŸ‘€

topaz bay
#

The compiler should have no concept of a main class

#

Make sure youre running gradle build

lavish notch
#

it compiled

#

let me run the plugin now

onyx loom
#

congrats

lavish notch
#

I am officially a noob

onyx loom
#

worse than me

lavish notch
#

insert hyper emote IT WORKS

onyx loom
#

nitro boost for the emote pls

#

then get a multi spin

lavish notch
#

Heck

#

I just noticed a new discord feature

#

posting gyazo links, embeds the gif, and hides the url

analog crater
#

now can you make the plugin read from a config to get which words arent allowed

lavish notch
#

Yeah

#

time to be more noob lol

heady birch
#

rust is kinda ass
@topaz bay

#

🀨

#

wrong channel

foggy pond
#

Made a hexadecimal color plugin which is a lot more successful than one that some other guy made a few weeks ago, he hit me up asking to merge the plugins

#

I said no but I feel bad lol

#

As there would be no benefit for his plugin to merge with mine as it's got nothing mine does't have

hallow crane
#

Does the ChatColor.RESET (net.md_5.api...) still not work? Or has it been fixed?

topaz bay
#

@heady birch it is ass btw

#

just saying

lavish notch
#

So... I'm trying to use configme, and intellij is fine, but when I run the plugin, I get this error..

Java.lang.NoClassDefFoundError: ch/jalu/configme/SettingsHolder

topaz bay
#

@lavish notch can you please send the full stacktrace?

#

Your plugin is relocating that package, so there should be no reference at that base package

#

Unless youre just using the jar output again, instead of shadowJar like I told you

#

If you just use jar, it will not work because configme isnt shaded into your plugin

lavish notch
#

Let me deal with this in the morning as currently don't have internet on my pc (cause of stupid parents)

topaz bay
#

Ok

obtuse gale
#

Wheres the best place to learn about generics and stuff? Just googling around and messing around? Also is it much different in kotlin?

steel heart
#

Not really, it should be quite similar to kotlin syntax

prisma wave
#

Trial and error

steel heart
#

But I'd recommend oracles documentation about it

prisma wave
obtuse gale
#

should I learn java generics first or is it the same

prisma wave
#

kotlin generics are basically identical but better

#

Java has no analog for in afaik, but everything else is equivalent

topaz bay
#

It does

#

There are compound generics in Java

prisma wave
#

There's some difference though right

#

* is different to ?

topaz bay
#

Not really

lavish notch
#

Sxtanna, might you have a simple example of using ConigMe?

prisma wave
#

Note: star-projections are very much like Java's raw types, but safe.

lavish notch
#

IE:

Writing and Reading the file

heady birch
#

😦

topaz bay
#

Look on the wiki

heady birch
#

When will they make C object oriented 😫

#

😭

#

πŸ˜”

distant sun
#

C++ is, isn't it?

#

or C#

heady birch
#

😳

lavish notch
#

I have Sxtanna, unfortunately I cant seem to get it working.

heady birch
#

C$

#

LOL

distant sun
#

CΒ₯

lavish notch
#

Beep Boop

foggy pond
#

Good alternatives go Snakeyaml?

#

(That support comments)

onyx loom
#

ive saw some recommending Jackson

lavish notch
#

@foggy pond I was told ConfigMe

#

which is what Im trying to use in the above messages

foggy pond
#

Does it not have a repository?

obtuse gale
#

whats the problem with configme mackenzie?

lavish notch
obtuse gale
#

isnt that just a normal npe?

lavish notch
#

idk

#

but it aint generating the config file

obtuse gale
#

whats line 30 in utils

lavish notch
#

if (!parent.exists() && !parent.mkdirs()) {

errant geyser
#

Where do you define parent?

obtuse gale
#

whats parent

prisma wave
#

it's null

lavish notch
#

That line is the API fyi

#

it isnt code i wrote

prisma wave
#

That relocation is very misleading

#

But anyway send onEnable:28

lavish notch
#

.withYamlFile(new File("config.yml"))

prisma wave
#

that's not how you should be getting the file

#

you need to pass the plugin data folder into the file constructor

lavish notch
#

mind providing me with the code I am missing?

prisma wave
#
new File(getDataFolder(), "fileName");
#

getDataFolder() represents plugins/PluginName/

#

if you don't pass a parent to the File constructor, it gets made in the working directory iirc

lavish notch
#

So I just need to change 1 line of code?

errant geyser
#

?tryandsee

compact perchBOT
foggy pond
#

?help

compact perchBOT
#
FAQ Answer:
Β» Give the helpers some details
Β» Ask suitable questions
Β» Be polite
Β» Wait

Source

foggy pond
#

God I didnt mean to do it here

lavish notch
#

Calm down lol

#

Is if I was wanting an output such as...

words:
- WORD1
- WORD2
- ...

would It just be

public static final Property<String> WORDS =
            newProperty("words", "WORD1", "WORD2");
obtuse gale
#

why integer

lavish notch
#

Bad copy, and paste job kek

remote goblet
#

I'm having a brainfuck moment

#

how in the loving fuck

#

did i forget how to do String[] stringList = ???

obtuse gale
#

String[] list = new String[size]; idk ive never used arrays before

heady birch
#

what you trying to do

#

what aj said

#

or

obtuse gale
#

List<String> probably better isnt it

heady birch
#

String[] list = new String[]{"value"}

remote goblet
#

i am concerned how i forgot this

#

It was just String[] stringList = {"String1", "String2"};

heady birch
#

?

#

Dont you need new String[]{"1", "2"}

remote goblet
#

maybe idk

obtuse gale
#

guess not

heady birch
#

I never knew that

#

im suprised intellij hasnt told me

topaz bay
#

@lavish notch it should be a list property

lavish notch
#

Might showing me an example?

#

actually... I'm stupid

#

so a list variable, and write that?

topaz bay
#
final Property<List<String>> words = newListProperty("words", "WORD1", "WORD2");
#

ofc make it static and all that shit

heady birch
#

☹️

topaz bay
#

shut up Niall

#

damn

heady birch
#

πŸ˜”

remote goblet
#

Should i make this plugin in kotlin for shits and giggles EmiCool

obtuse gale
#

yes

remote goblet
#

well this will fail EmiCool

runic flume
#

I have the bottom one, but I need the top one

distant sun
#

split or UUID#fromString() ?

#

assuming all UUIDs are the same

runic flume
#

UUID.fromString doesnt work

#

idk if this is the right way xD

#

But if it works, I guess

topaz bay
#

You dont need regex for that

#

And that is INCREDIBLY slow

#

If you are going to use regex, use a precompiled pattern

distant sun
#

what about split, sx?

heady birch
#

insert char at

topaz bay
#

the values are always split by the same amount of characters

#

You can easily just insert the hyphens

distant sun
#

easy

#
        StringBuilder sbr = new StringBuilder("30daf97ee49342e19003ee715f078048")
                .insert(20, '-')
                .insert(16, '-')
                .insert(12, '-')
                .insert(8, '-');

        System.out.println(UUID.fromString(sbr.toString()));```
Like this?
topaz bay
#

weird that youre doing it backwards, but sure

hot hull
#

Kek

topaz bay
#

Oh actually, no its not weird

#

updating the values in order would shift their indexes

hot hull
#

It would alter the positions the other way yea

distant sun
#

if you want it from left to right then it's 8, 13, 18, 23

runic flume
#

Ahh cheers Gaby

remote goblet
#

everyday i discover something else in kotlin

#

and i love it even more

obtuse gale
#

lol

remote goblet
errant geyser
remote goblet
obtuse gale
#

indeed

errant geyser
remote goblet
errant geyser
#

Thaaank you

remote goblet
#

i wanna actually see this collection

#

i wanna know how many of my emojis you've stolen

distant sun
#

so you discovered a constructor?

remote goblet
#

basically yes

distant sun
#

welp

remote goblet
#

i only have like

#

one project in kotlin

#

which is my bot and i dont use a constructor in that

errant geyser
distant sun
#

how does that even work

onyx loom
#

fast .... nodding

errant geyser
remote goblet
#

nice collection clap

prisma wave
#

@remote goblet data class

errant geyser
onyx loom
#

now all u gotta do is nitro boost

#

to use the emojis

#

then get a multi spin

distant sun
#

@onyx loom how did you got that hover for emojis?

onyx loom
#

just update discord

#

Β―_(ツ)_/Β―

distant sun
#

saying from what server it is

onyx loom
#

πŸ˜„

#

if u click it it doesnt work for u?

remote goblet
#

it doesnt for me EmiShrug

distant sun
#

no

onyx loom
#

lol bad

remote goblet
#

discord updates are very inconsistent

distant sun
#

it might be a beta feature

onyx loom
#

im not in beta

distant sun
#

usually beta stuff are given randomly afaik

onyx loom
#

πŸ€”

distant sun
#

to users / servers

onyx loom
remote goblet
#

kali you are a beta male tho EmiCool

onyx loom
#

😐

remote goblet
#

:)

heady birch
#

-Poor design

#

change resolved boolean to ReportStatus

onyx loom
#

request free

lavish notch
#

I'm thinking of having it like a "core" plugin

onyx loom
#

πŸ™‚

topaz bay
heady birch
#

lol

#

fewer

#

things don't crash in rust

prisma wave
#

segfault

heady birch
#

turn segfault off πŸ™„

prisma wave
#

i bet rust doesn't have the elvis operator

remote goblet
#

"If the file ends up being to big, you can upload via a file site."

heady birch
#

nothing is null

remote goblet
#

EmiThink how big does he think plugins jar files are

onyx loom
#

NOTHING

prisma wave
#

I bet rust doesn't have Nothing

lavish notch
#

If a plugin is bigger than 3MB, you know there is something fishy

remote goblet
#

well

onyx loom
#

but kotlin 😦

remote goblet
#

i mean worldedit is 3.6mb

onyx loom
#

citizens is 3mb

lavish notch
#

that's different

#

say 10MB then

onyx loom
#

thats different thonking

remote goblet
#

i'd say a core plugin for a server would be like

#

500kb

#

max

#

i mean the stacker plugin i use is like 868 EmiShrug

onyx loom
#

WE is 4mb lol

#

v7.1.0

remote goblet
#

idk its 3.6 on my server

topaz bay
#

My core plugin is 10mbs

onyx loom
#

😬

#

apparently ur core is dodgy then

distant sun
#

My core plugin is 10mbs
@topaz bay Mbps

topaz bay
#

It contains literally everything

#

Why would it be mbps

#

That doesnt make sense

distant sun
#

Shut up

onyx loom
#

gaby stoopid

remote goblet
#

gaby measures file size in time

onyx loom
#

time travel

topaz bay
#

It has all the kotlin shit, a bunch of database drivers, some external reusable libraries

#

Its fucking loaded

onyx loom
#

nah, its just fishy

#

probably will give ur pc 17 rats

topaz bay
#

It also has built in Odin evaluation

#

:)

remote goblet
#

did someone say, rats?

onyx loom
#

πŸ€

remote goblet
#

did i get the right url

#

prob not

topaz bay
#

It better not be moira

remote goblet
#

no its a beautiful drawing

onyx loom
#

why the fuck is ur domain so slow

#

it works

#

but takes 10 seconds to load a webpage thonking

remote goblet
hot hull
#

@obtuse gale Are you serious or? Lmao

remote goblet
#

the hastebin website is probably completely breaking it ngl

onyx loom
#

i like the way u have to label it

distant sun
#

Is that hosted on a potato?

onyx loom
#

just so people know its a rat

remote goblet
#

yes

onyx loom
#

so its hosted on ur pc?

remote goblet
#

its not actually

topaz bay
#

How do people just like... live without functional programming

distant sun
#

Example?

topaz bay
#

?

distant sun
#

Of non functional programming

prisma wave
#

that would be like 10 lines in an imperative style

topaz bay
#

Probably more tbh

#

Considering the try catches

prisma wave
#

yeah

#

a lot

jaunty maple
#

any1 having any idea of how to create custom api 4 jenkins or make unauthorized GET requests to the built in api work? (yes they don't work I get 403 when I try to request) oh and also I have no idea of how to authorize those requests else I'd made them authorized and call it a day

old wyvern
#

πŸ‘

hot hull
#

@topaz bay that's hella clean

digital patrol
#

is it possbile to check the permission node for a command

topaz bay
#

@hot hull fp tends to be

#

πŸ˜‰

#

ayyyyeeee

#

big

#

BIG

ocean quartz
#

Sx, any suggestion for preventing players from taking items from the GUI?
I thought it was working fine with just cancelling and stuff, but someone found that if your ping is high enough and you shift click an item and press E to close the inventory fast enough you get the item >.<

foggy pond
#

Lol wtf

#

Apparently my Plugin's new version is triggering Chrome's anti-virus shit

#

And chrome for some reason believes my plugin is malware

#

How???

#

Why???

versed ridge
#

remove the malware

analog crater
#

What is your plugins source

foggy pond
#

Wdym with source?

#

(Also this was told to me by someone who tried downloading, I don't have chrome myself so I cannot check really)

heady birch
#

are you sure its not

#

the normal "this file may harm your computer"

topaz bay
#

janky

#

@ocean quartz not a clue

#

I've never had that issue

foggy pond
analog crater
#

Oh. Oof

foggy pond
#

That's not the usual warning

quiet depot
#

someone should make some malware that changes the message to "This computer may harm your file"

analog crater
#

But you need to run it beforehand but it will get stopped because of the antivirus message

distant sun
#

someone should make some malware that changes the message to "This computer may harm your file"
@quiet depot :)))

foggy pond
#

Bruh what the

#

What should I do?

#

Why does chrome think it is a virus?

heady birch
#

thought that was poo emoji

remote goblet
#

dont try to give people a virus then

#

pepega

heady birch
#

idk give me the lib ill analyse

ocean quartz
#

You gotta remove the virus from it smh

quiet depot
#

if chrome blocked it like that, it's probably been flagged manually via a report

foggy pond
#

???????????

distant sun
#

Is that even possible?

quiet depot
#

no clue

heady birch
#

it downloade fine for me

versed ridge
#

It's only on chrome

distant sun
#

Report to chrome?

foggy pond
#

So what should I do? I can show the entirety of the source code and you will see there is not a bit that's shady

versed ridge
#

downloads just fine on any other browser

quiet depot
#

what is it klyser

#

link?

foggy pond
#

Yeah but a LOT of people use Chrome

#

I don't want this to ruin my credibility as a developer, since some people might think that there actually is malware

ocean quartz
#

Downloads fine for me, do you have any antivirus in your PC?

quiet depot
#

nah matt it's chrome

ocean quartz
#

I mean i downloaded on Chrome and it's fine

distant sun
#

works fine on Brave

quiet depot
#

I can't download it either on chrome

distant sun
#

f

#

what if

topaz bay
foggy pond
#

Okay it seems like every plugin has that issue, the guy who reported it to me is wrong

distant sun
#

Klyser is trying to boost his downloads thonking

ocean quartz
#

Version 84.0.4147.89 (Official Build) (64-bit)

analog crater
#

The source looks good

distant sun
#

it's his plugin

topaz bay
distant sun
#

stupid as usual

foggy pond
#

Do other plugins have that issue too for you guys (on chrome)?

topaz bay
#

mhmm

quiet depot
#

nope

foggy pond
#

Tf is going on

quiet depot
#

just downloaded luckperms off spigot

#

worked as expected

foggy pond
#

Luckperms works for me too actually

#

That also gets blocked

onyx loom
#

ur plugins a virus thonking

foggy pond
#

😒

#

I don't get if it is a Spigot issue or my plugin's issue??

versed ridge
#

That plugin was updated 22 minutes ago

foggy pond
#

Because if it is my plugin's issue, what the hell could make Chrome think that it is a virus

onyx loom
#

does it do any obfuscation?

ocean quartz
#

For me i can download everything without issue

foggy pond
#

Nope, none at all

#

Even on chrome Matt?

heady birch
#

whats IIlegalMemoryAccessBypasser

ocean quartz
#

I only use Chrome

heady birch
#

Lol

#

Joking

topaz bay
#

I tried 3 different plugins, only 1 of them allows a download

foggy pond
#

Matt you might have the antivirus disabled on Chrome, but I think most users do not

ocean quartz
#

I don't

topaz bay
#

@foggy pond check if you have a chrome update?

ocean quartz
#

I wonder if it'd be different based on country?

foggy pond
#

I think recently updated resources got some issues? Since any recent plugin does that to me

#

While plugins that have not been updated in a while work fine

#

Chrome is up to date

#

So I guess that it is a Spigot issue?

onyx loom
#

still blocked anyway

topaz bay
#

oooo

#

I can't even download my own resources that I haven't updated in actual years

foggy pond
#

Huh??

#

Wait let me try

#

Wanna see if I have that issue too

frail glade
#

Yeah they made the download URL have that. I think the reasoning behind that was blocking auto-downloading stuff.

foggy pond
#

Have what?

onyx loom
#

captcha im guessing

frail glade
#

The captcha.

onyx loom
#

thanks for the wisdom mr waffle

foggy pond
#

But that doesn't explain why suddenly spigot's plugins are being marked as malwares lol

onyx loom
#

i used to have it when downloading vks plugins, i just crossed it off tho as his are all obfuscated

#

and AVs dont like obfuscation

digital patrol
#

can anyone add a permission node to a plugin for me that i had custom made

hot hull
errant geyser
#

@steel heart just so you know you overtook BM on the Senpai Statusℒ️ scale

steel heart
#

I mean KM is kinda KM

#

But that’s something impressive ig

prisma wave
#

idk what that means but I'll take it as a compliment ig

hot hull
#

UwU

steel heart
#

Owo Tier VI

#

KM you achieved idk but cool stuff

errant geyser
#

Congrats

steel heart
#

Katsu now let me fix this for ya

#

Did you commit anything after?

errant geyser
steel heart
#

Also I might have changed your buildscript somewhat but thats ok

errant geyser
#

ok

remote goblet
errant geyser
steel heart
#

Katsu

#

Is the manager going to be a general manager for each item

#

or should each item have it's own map of actions etc?

#

@errant geyser

errant geyser
#

I think each item should have a multi map of actions which would allow them to have multiple actions per type

steel heart
#

Yeah that's best

#

Else it will be a hell

errant geyser
#

yeah

steel heart
#

Do you want me to create an API ?

#

Or just some classes is good enough?

errant geyser
steel heart
#

Where did it actually not work?

#

@errant geyser

errant geyser
#

Essentially everywhere

#

It was just a mess

#

And only supported one action per type

steel heart
#

oh

#

Okay I see

#

I will kind of go with the same style you did

errant geyser
#

Ok

steel heart
#

Hmm I was kind of considering tracking the items by an int as id

lavish notch
errant geyser
#

Couldn't it be done via a UUID in the ItemStack's persistentDataContainer? @steel heart

steel heart
#

Hmm yeah

#

Though rn I got a Collection registered Items. Consider removing it

#

Or perhaps

#

we store the Action<T> in the Listeners themselves

#

So each Listener has a Multimap<Item, Action<ThisEvent>>

errant geyser
#

hmm

#

That'd be interesting

steel heart
#

Considering the fact that creating many items can easily create too many maps

#

brb 10 min

#

Though if we do this

#

We should have each ActionType it’s own event

topaz bay
#

@lavish notch make that a field

#

and expose it with a method

#

And pass around your main class

lavish notch
#

I'll do some more googling ig (not sure on the terminology)

#

but when i try to access it externally, it complains of it not being static

steel heart
#

?faq java-dependency

#

=faq java-dependency

compact perchBOT
#
FAQ Answer:

Dependency Injection
Dependency injection is when we pass a class through other class constructors to access that specific class in those other classes.

public class Main extends JavaPlugin {

    @Override
    public void onEnable() {
        Other other = new Other(this);
        other.method();
    }

    public void myMethod() {
        /* Some code goes in here */
    }
}

public class Other {
    private final Main main;

    public Other(final Main main) {
        this.main = main;
    }

    public void method() {
        main.myMethod();
    }
}```
topaz bay
#

@lavish notch Make the field private

#

Add a getter

#

And pass around the instance of your main class

#

Also, constants should be UPPERCASE_WITH_UNDERSCORES

#

Your field Config.words should be Config.WORDS

lavish notch
#

How'd I add the getter? (code wise - totally not looking for spoon feed kek)

hot hull
#

public Class getClass() return this.class

lavish notch
#

k

hot hull
#

@steel heart It's ?java-dependency btw

steel heart
#

Yah

#

Can we have an implicit else faq

hot hull
#

Write it up

digital patrol
#

can someone decompile something for me and add a line of code

static zealot
#

its not nice to decompile stuff if its not open source.

remote goblet
#

i mean decompiling something can completely bonk an entire plugins code

static zealot
#

and this ^

remote goblet
#

it completely changes all the methods and variable names

digital patrol
#

oh

#

well it was a custom made one

#

like only for us

static zealot
#

and why don't you have access to the source code? that seems dumb

digital patrol
#

he only sent the jar file

#

i can show proof of my purchase