#dev-general
1 messages Β· Page 130 of 1
dependencies{
implementation 'ch.jalu:configme:1.1.0'
}```
yuck aj edit a space between {
Latest is 1.2.0 btw
plugins {
id 'java'
}
group 'ml.mackenziemolloy'
version '1.0.0'
sourceCompatibility = JavaVersion.VERSION_1_8
dependencies{
implementation 'ch.jalu:configme:1.1.0'
}
π
Ahh, I use the snapshot
what does configme do
Do I need to download the shit off github, or ?
Essentially a YAML hander lib thing
It's a glorified snakeyaml lib that supports beans and whatnot
Auto updating configs, keeps comments, migrations, etc.
@lavish notch no
vanilla snakeyaml supports that
and if u don't want to use snakeyaml, spigot also has gson
Is there a Gradle version of mvn install or do I have to write a pom as well?
configme is more of a declarative configuration library
Yeah
it has nothing to do with bean support really
so... is that all I need to be able to use ConfigMe?
@errant geyser gradle does not have a dependency format
So I do need to write a pom too then and use Maven to put it in my local repo
@lavish notch yes
No
or just dont use maven π
Add the maven-publish plugin
so.. what do I need to do exactly? (Using Gradle)
And that can put it in my .m2 repo?
yes
noice
@lavish notch wdym?
To be able to use ConfigMe
You already have it in your build file right?
I think so
Send your build file
plugins {
id 'java'
}
group 'ml.mackenziemolloy'
version '1.0.0'
sourceCompatibility = JavaVersion.VERSION_1_8
dependencies{
implementation 'ch.jalu:configme:1.1.0'
}
=paste
Please use a paste service to share configs, errors, code and long logs.
β’ HelpChat Paste
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"
}
I'm using gradle
that is gradle...
??
My bad - I just see maven and think that's not gradle
wot
just nrm
Yeah, gradle does not have a dependency format like I said earlier
No
Dont declare the dependencies block twice
Just put that line in your existing dependencies block
fixed
Also, please put repositories above dependencies
(doesnt really matter, but its kinda the standard)
done
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
done
send what you have now
Good
Thats pretty much it
Everything I say now is pretty much optional, and is just standards
- Normalize all your strings to use double quotes
- 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@"
those quotes aren't necessary
So hang on, what am I putting where?
If you dont want to have the all suffix on your jar shadow produces add this to your build file
shadowJar {
archiveClassifier = ""
}
?
@quiet depot ofc you dont need the quotes, but its a string, so quote it
Normalization is a good thing
sx the property thing is important
your archiveClassifier code won't work
archiveClassifier is final, and not a string
Thats not what Im talking about
ik
But ok
but it's more important than the yaml string
But thats not what I was addressing
well, to answer what you're addressing
Like ok, I fucking get it
so what am I relocating?
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
Its not verbosity to quote strings
"normalisation"
what does that mean
I've never seen it used in programming, except for the normalize.css library
the configme package, to a subpackage in your projects package
I'm not sure what the configme package is
Something is "normalized" if it is the "same" in every state or condition
it's usually the groupid.artifact id, but that's not guaranteed, so check their github
Another word is "standardized"
Where would the configme package be?
do i just download off of github?
idek what ShadowJar is
shadowJar {
relocate 'ch.jalu.configme', 'your.base.package.configme'
}
Add that to your build.gradle
its equivalent to maven shade plugin or whatever
And obviously, replace "your.base.package" with the base package of your plugin
Having fun with your new idea?
make the quote types consistent, like sx suggested before
' or "?
@quiet depot setting archiveclassifier works btw
Is my base package, the main package?
does ij give you a warning sx?
groovy is too slack .-.
Not really...
Is my base package, the main package?
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
no don't do that
So... how can I test that this was successfully setup? (The configme)
it should be in ml.mackenziemolloy.swordfilter, not ml.mackenziemolloy
What?
?
how?
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
There should be a play button in your build.gradle file
beside shadowJar
You can click that
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.
Yeah, its fine
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?
with configme, you declare the sections as properties
blocked words would just be a list of strings
replacements would be a map
Do you have a HashMap example?
example of what?
Brister suggested I use a HashMap
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
Mackenzie...
What are you asking?
Do you want to know how to go through them when youre doing the checks on the words?
yes
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
Okay, I'll give that a go
Is it worth having my own events for stuff? So people can cancel them if they want instead of having to use hacky ways?
yeah
It depends on what hes doing?
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)
imagine making your event cancellable
I'd expect Fuck1.8Event to not be cancellable
ofc
@quiet depot you can target it on eclipse
@lavish notch if you still need help setting up eclipse I gotchu
Stop trying to start a war Sxtanba
I know you want attention but you ainβt gonna get it
There is no war
"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
i got downvoted π lmao
intellij good eclipse bad
haha yeah i know, it took quote awhile for me to manage with its pathfinders
aight bet
kotlin good java bad?
Tanku, make it do a backflip

lmao that'd be an interesting pathfinder
Im down voting you
why
Toxic behaviour
Only I'm allowed to downvote Aj, how dare thy
Your getting down voted too
Kid
For talking back
smh frcsty
Do as you wish 
stop talking back

Downvote all my posts for all I care 
you wont win, kids always win in 'who can talk back the most'
Im gonna down vote ur whole family
Oi, chill before you start saying things you'll regret 
uploading him walking around rn π
@viscid prawn Imma wait for until it battles the ender dragon. Tnx
i mean... hypothetically i could do it
Better, now onto that backflip I was talking about
hypothetically I could also do 1.8
it's just a custom zombie with the disguise of a player and custom properties
so i could make it attack the ender dragon
idc what you do. make it do it
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
Make your own pathfinders, now that's the ultimate flex
@olive tusk #general-plugins
?
this is gonna go from a mini-game plugin to an npc that beats the game
I gotta remake an event waiter in Kotlin 
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 
what in the...
wat
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)
there's no reason to use streams
Kinda hard to tell you how without the types of the set and toRemove
It's jda utilities code, its garbage 
i'll just make the entire event waiter myself
even if i have to do it in Java and then convert it in kotlin
whats the point of converting then?

lol
https://github.com/JDA-Applications/JDA-Utilities/blob/master/commons/src/main/java/com/jagrosh/jdautilities/commons/waiter/EventWaiter.java i've already sent this garbage before but have it again 
So... this is my build.gradle: https://paste.helpch.at/conulowena.makefile
and I'm trying to use ConfigMe, but Intellij is complaining... that it can't find the various properties when I try to use ConfigMe
newProperty is a static function in PropertyInitializer
If you want to use them like that, you need to static import them
Is there an entry for configme under external libraries in the left pane?
You dont need to download anything
oh
Did you not refresh your build.gradle?
Anytime you change anything, a little icon should show up at the top right
Click that when youre done modifying the file
Ok
man im tryna send them fighting the ender dragon
but discord is breaking
ah its cause i cant send it here
?
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?
Do you guys know if eclipse got an update
yeah the update is called IntelliJ i believe
Switch to IntelliJ
never
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
Not an answer, even if it's a milisecond faster I needa know 
i am confusion
ur always confusion
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
what did i do here that could do that 
Not an answer, even if it's a milisecond faster I needa know
@hot hull
Yea getting values from a field is faster But the difference is probs not worth a ms.
@remote goblet its a nullable type?
it didn't create the src folder, fuck
Did you not choose java?
what type did you choose when doing gradle init?
1
that doesn't ask for a language type
do I select "application"?
no, just fill the rest in yourself
do i have to set the outputdir to project/src/java/main? @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 its a nullable type?
@topaz bay awot
it worked, thank @quiet depot
@remote goblet that type is nullable
And youre calling a function on it
Should it not be ?.attempt
yeah i figured that one out but i still have this 
why !! π¦
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?
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
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
Boolean?#collect()\ doesnt make sense
Ima pretend like i have enough intelligence to understand what either of you two said 
smh people thinking i have a brain
How do I compile a project in Intellij?
using gradle?
Are you using maven or gradle
gradle
Double press CTRL then type gradle build
ProjectFolder/build/libs
With the "minecraft development" or whatever it's called Plugin, do I still need to add a server jar to the external libs?
the mc dev plugin only creates a main class with onEnable etc with a plugin.yml
what
You add spigot to the dependencies in your build.gradle
But the mc dev plugin adds that automatically
When you make a project
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
So... I made my project prior to installing the plugin. Under what directory, do I make the plugin.yml?
This correct?
like name: "SwearFIlter"?
Yes
Do I do 1.15, or 1.15.2?
compileOnly "org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT"
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"
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
did you shade it or include it in the plugins folder for your server?
youre building with the jar task
I did what Sxtanna told me to do
build with the shadowjar task
How do I do that?
π₯£
By clicking shadowJar
In the gradle window
Or open your build file, and click the play button beside shadowJar
I told you earlier ;(
Add this to the bottom of the file
tasks.build.dependsOn tasks.shadowJar
And just run gradle build
how have you managed to break everything
bm always asking the real questions
So...
wait
why does your bukkit main class have a main method
that's why
JavaPlugin doesn't exist in a non-spigot context
SRP?
single responsibility principle
a class should only have 1 responsibility (1 thing that it does/handles)
How do I register the other class?
Hello, je configure vos serveurs Faction pour ceux qui souhaitent venez privΓ© π (c'est pas gratuit)
For french people
l'anglais sil vous plait
So... does this work?
Main: https://paste.helpch.at/devurezihe.java
onChat: https://paste.helpch.at/isanuqogaj.cs
@rose hornet d'accord #727778088972189767
@lavish notch depends entirely on what you're trying to do but probably not
Well... I'm trying to act upon the Chat Message event
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 π
I have some prior experience... nothing with substance tho.
add an onEnable method to ur main class then add
getServer().getPluginManager().registerEvents(new onChat(), this); i think
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Expected two arguments, got one
class names should be UpperCamelCase
D:
Is this your first plugin?
Done
spigot logs when your plugin is loaded, enabled, and disabled already
You dont need to do that
k
k
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
done
done
done...?
Error: Could not find or load main class ml.mackenziemolloy.swearfilter.SwearFilter
not done.
fini
D:
It isn't compiling
?
Error: Could not find or load main class ml.mackenziemolloy.swearfilter.SwearFilter
Ummm
π
The compiler should have no concept of a main class
Make sure youre running gradle build
congrats
I am officially a noob
worse than me
insert hyper emote IT WORKS
Heck
I just noticed a new discord feature
posting gyazo links, embeds the gif, and hides the url
now can you make the plugin read from a config to get which words arent allowed
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
Does the ChatColor.RESET (net.md_5.api...) still not work? Or has it been fixed?
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
@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
Let me deal with this in the morning as currently don't have internet on my pc (cause of stupid parents)
Ok
Wheres the best place to learn about generics and stuff? Just googling around and messing around? Also is it much different in kotlin?
Not really, it should be quite similar to kotlin syntax
Trial and error
But I'd recommend oracles documentation about it
should I learn java generics first or is it the same
kotlin generics are basically identical but better
Java has no analog for in afaik, but everything else is equivalent
Not really
Sxtanna, might you have a simple example of using ConigMe?
Note: star-projections are very much like Java's raw types, but safe.
IE:
Writing and Reading the file
π¦
Look on the wiki
π³
I have Sxtanna, unfortunately I cant seem to get it working.
CΒ₯
(Main) SwearFilter.java: https://paste.helpch.at/icidiyixac.java
Config.java: https://paste.helpch.at/dufiwenotu.java
Beep Boop
ive saw some recommending Jackson
@foggy pond I was told ConfigMe
which is what Im trying to use in the above messages
Does it not have a repository?
whats the problem with configme mackenzie?
isnt that just a normal npe?
whats line 30 in utils
if (!parent.exists() && !parent.mkdirs()) {
Where do you define parent?
whats parent
it's null
.withYamlFile(new File("config.yml"))
My main class (with the onEnable) btw: https://paste.helpch.at/icidiyixac.java
that's not how you should be getting the file
you need to pass the plugin data folder into the file constructor
mind providing me with the code I am missing?
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
So I just need to change 1 line of code?
?tryandsee
?help
Β» Give the helpers some details
Β» Ask suitable questions
Β» Be polite
Β» Wait
God I didnt mean to do it here
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");
why integer
Bad copy, and paste job kek
I'm having a brainfuck moment
how in the loving fuck
did i forget how to do String[] stringList = ???
String[] list = new String[size]; idk ive never used arrays before
List<String> probably better isnt it
String[] list = new String[]{"value"}
i am concerned how i forgot this
It was just String[] stringList = {"String1", "String2"};
maybe idk
@lavish notch it should be a list property
Might showing me an example?
actually... I'm stupid
so a list variable, and write that?
final Property<List<String>> words = newListProperty("words", "WORD1", "WORD2");
ofc make it static and all that shit
βΉοΈ
π
Should i make this plugin in kotlin for shits and giggles 
yes
well this will fail 
How do you convert those two into eachother
I have the bottom one, but I need the top one
UUID.fromString doesnt work
oh lol
idk if this is the right way xD
But if it works, I guess
You dont need regex for that
And that is INCREDIBLY slow
If you are going to use regex, use a precompiled pattern
what about split, sx?
insert char at
the values are always split by the same amount of characters
You can easily just insert the hyphens
easy
StringBuilder sbr = new StringBuilder("30daf97ee49342e19003ee715f078048")
.insert(20, '-')
.insert(16, '-')
.insert(12, '-')
.insert(8, '-');
System.out.println(UUID.fromString(sbr.toString()));```
Like this?
weird that youre doing it backwards, but sure
Kek
It would alter the positions the other way yea
if you want it from left to right then it's 8, 13, 18, 23
Ahh cheers Gaby
lol

like thats so much nicer than this
indeed

Thaaank you
i wanna actually see this collection
i wanna know how many of my emojis you've stolen
so you discovered a constructor?
basically yes
welp
i only have like
one project in kotlin
which is my bot and i dont use a constructor in that
how does that even work
fast .... nodding
nice collection 
@remote goblet data class
@onyx loom how did you got that hover for emojis?
saying from what server it is
it doesnt for me 
no
lol bad
discord updates are very inconsistent
it might be a beta feature
im not in beta
usually beta stuff are given randomly afaik
π€
to users / servers
flex
kali you are a beta male tho 
π
:)
request free
I'm thinking of having it like a "core" plugin
π
segfault
turn segfault off π
i bet rust doesn't have the elvis operator
"If the file ends up being to big, you can upload via a file site."
nothing is null
how big does he think plugins jar files are
NOTHING
I bet rust doesn't have Nothing
If a plugin is bigger than 3MB, you know there is something fishy
well
but kotlin π¦
i mean worldedit is 3.6mb
citizens is 3mb
thats different 
i'd say a core plugin for a server would be like
500kb
max
i mean the stacker plugin i use is like 868 
idk its 3.6 on my server
My core plugin is 10mbs
My core plugin is 10mbs
@topaz bay Mbps
Shut up
gaby measures file size in time
time travel
It has all the kotlin shit, a bunch of database drivers, some external reusable libraries
Its fucking loaded
did someone say, rats?
π
It better not be moira
no its a beautiful drawing

@obtuse gale Are you serious or? Lmao
i like the way u have to label it
Is that hosted on a potato?
just so people know its a rat
yes
so its hosted on ur pc?
Example?
?
Of non functional programming
that would be like 10 lines in an imperative style
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
@topaz bay that's hella clean
is it possbile to check the permission node for a command
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 >.<
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???
remove the malware
What is your plugins source
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)
This what the guy sees
Oh. Oof
That's not the usual warning
someone should make some malware that changes the message to "This computer may harm your file"
But you need to run it beforehand but it will get stopped because of the antivirus message
someone should make some malware that changes the message to "This computer may harm your file"
@quiet depot :)))
Bruh what the
I am also getting that
What should I do?
Why does chrome think it is a virus?
thought that was poo emoji
idk give me the lib ill analyse
You gotta remove the virus from it smh
if chrome blocked it like that, it's probably been flagged manually via a report
???????????
Is that even possible?
no clue
it downloade fine for me
It's only on chrome
Report to chrome?
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
downloads just fine on any other browser
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
Downloads fine for me, do you have any antivirus in your PC?
nah matt it's chrome
I mean i downloaded on Chrome and it's fine
works fine on Brave
I can't download it either on chrome
Google checks websites to see whether they host software or downloadable executables that negatively affect the user experience. You can see a list of any suspected files hosted on your site in the Se
Okay it seems like every plugin has that issue, the guy who reported it to me is wrong
Klyser is trying to boost his downloads 
Version 84.0.4147.89 (Official Build) (64-bit)
The source looks good
it's his plugin
No, its spigot.org
stupid as usual
Do other plugins have that issue too for you guys (on chrome)?
mhmm
nope
Tf is going on
Luckperms works for me too actually
I tried with some random plugin https://www.spigotmc.org/resources/custom-jumppads-1-8-1-16.44876/
That also gets blocked
ur plugins a virus 
That plugin was updated 22 minutes ago
Because if it is my plugin's issue, what the hell could make Chrome think that it is a virus
does it do any obfuscation?
For me i can download everything without issue
whats IIlegalMemoryAccessBypasser
I only use Chrome
I tried 3 different plugins, only 1 of them allows a download
Matt you might have the antivirus disabled on Chrome, but I think most users do not
I don't
@foggy pond check if you have a chrome update?
I wonder if it'd be different based on country?
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?
Yeah they made the download URL have that. I think the reasoning behind that was blocking auto-downloading stuff.
Have what?
captcha im guessing
The captcha.
thanks for the wisdom mr waffle
But that doesn't explain why suddenly spigot's plugins are being marked as malwares lol
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
can anyone add a permission node to a plugin for me that i had custom made
#727778089857187861 / #727778089697804288, I sure hope you have the source, otherwise ew
@steel heart just so you know you overtook BM on the Senpai Statusβ’οΈ scale
idk what that means but I'll take it as a compliment ig
UwU
Congrats
Thx, and no I didn't
Also I might have changed your buildscript somewhat but thats ok
ok

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
I think each item should have a multi map of actions which would allow them to have multiple actions per type
yeah
I'll take care of the API, thanks though
Essentially everywhere
It was just a mess
And only supported one action per type
Ok
Hmm I was kind of considering tracking the items by an int as id
Main Class: https://paste.helpch.at/acoribirec.java
How would I access settingsManager from another class?
Couldn't it be done via a UUID in the ItemStack's persistentDataContainer? @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>>
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
@lavish notch make that a field
and expose it with a method
And pass around your main class
I'll do some more googling ig (not sure on the terminology)
So... I've done this : https://paste.helpch.at/usuganejam.java @topaz bay
but when i try to access it externally, it complains of it not being static
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();
}
}```
@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
How'd I add the getter? (code wise - totally not looking for spoon feed kek)
public Class getClass() return this.class
k
@steel heart It's ?java-dependency btw
Write it up
can someone decompile something for me and add a line of code
its not nice to decompile stuff if its not open source.
i mean decompiling something can completely bonk an entire plugins code
and this ^
it completely changes all the methods and variable names
and why don't you have access to the source code? that seems dumb
