#help-development
1 messages ยท Page 141 of 1
for snakeYaml
its perfectly fine to use
which i don't know anything about
whatever usecase you have for yaml should be doable with YamlConfiguration
anything you cannot do usually should not live in a yaml file in the first place
yeah, @boreal seal
SnakeYaml is basically the same as YamlConfiguration, except that everything is either the primitive type, or a Map<String,Object> :3
YamlConfiguration is obviously better than SnakeYaml
sounds easy
someday would take a look at it's github
What do you need help with
you can ask it here, there's no real need to dm only me
YamlConfiguration has convenience features like getString(...), getInteger(...) etc. In SnakeYaml, everything is just an Object. It's basically simply a Map<String,Object>
setupConversation()
yeah ok
maybe someday i would try it
Doesn't snakeyaml hide InputStream inside?
yeah basically it does
just looked it up
This way can write own yaml parser
Why is this not setting the pdc
and add ConfigChangeEvent to API
are u sure it doesn't set it?
it does set it
looks normal
Maybe the problem is with how I get it?
maybe, show your "get" code pls
"key" is the same thing?
yes
do /data get entity Wihy BukkitValues and see if it shows up there after setting it
why do you even ask this
yes, I'm gay
why?
next time just look at my profile and you'll see it instantly
It does
get is wrong then (๐คฏ)
then it's there, and then it means you are not getting the value properly
is this a proper .has() method
never coded for paper
paper has a .has(NamespacedKey) method. Spigot doesnt
let's not discuss my sexuality here
ye im using paper
you sure you don't pass null key as a parameter to your get method
thanks for sharing this totally useful information
yes, I'll debug and come back
cya?
@boreal seal , i'm gonna be home in like 15 minutes
i'm on a bus rn
going back home from university
when i get back i will probably dm you
if i don't dm me yourself then ๐
no
i have a nice girlfriend i love
why do you have such an obsession in knowing whether anyone is gay
I have no idea
this always returns null for some reason, even when the player has the specific pdc
you do set it as string, right?
yes
not being hetero is totally okay
this feels like im in middle school
do getPersistentDataContainer().getKeys() and loop over it, see if that at least returns the key of whatever you set
can you explain in furthur detail?
Take it to general sheesh
yeah I also don't get it
I also go off topic in this channel very often but this whole discussion is so pointless haha
that doesn't change the fact that this is #help-development, not #help-sexuality
keep it on-topic to the channel or take it to general, or take it to DMs ( i guess the thread works as well but still)
Thank you for your opinion
Gonna continue discussing โค๏ธ
agree
idk why my profile pic always causes so much discussions haha
yo mfnalex, is that what you meant? does this get the value of the key?
you should also print it out
ye just making sure
sth like this:
for(NamespacedKey key : data.getKeys()) {
System.out.println(key);
}
this should at least print out the key of the data you wanna get
how do I get the value tho
with get(key, PersistentDataType.STRING)
hi, idk why but the displayname wont show up
hi, that's because you forgot to set the meta back
wdym?
ItemMeta meta = myItem.getItemMeta();
// Now change the meta
myItem.setItemMeta(meta); // <-- this line
the last line
ayee it works
@serene sigil
oh wait I'm stupid, you DID do setItemMeta
I didnt see that
lol
its ok
hmmm
oh wait
but you add the recipe before you updated the meta
you have to update the meta BEFORE passing that itemstack into the recipe thing
oh okay
Anyone have idea what is placeholder for parameter in spigot logger, because log4j's {} doesn't seem to work ?
"placeholder for parameter"?
wdym
like this?
yes ๐
alr tysm
np
.info("{} something", object.toString())
where did you get that .info(...) method from?
logger
you cannot use it there IIRC
you have to format this stuff yourself
the .info and .warn methods etc just take a String array and log every line as you passed it, iirc
it isn't standard logger scheme then
also is there a way to add a lore to that item if u drop it?
or any kind of action
for what is .info(String, Object) used then ?
you have to listen to some events and manually add that lore then. E.g. EntityDropItemEvent (or however it's called) when they manually press Q, or PlayerDeathEvent (when they die), etc etc
so u do CustomItem.TrackerItemMtemstack.getitemmeta.setlore?
why do you need a lore for dropped items anyway, I wonder?
like this?
yes, where "lore" is a List<String>
but I wonder why you need to set for only dropped items
meta is a clone
its {indexOfParameter}, im sorry :/
that method doesnt even exist?
sorry its .log(Level, String, Object)
oooh I see
.info just returns .log(Level.info, msg)
yeah that should indeed replace it, but probably you gotta use %s and not {} although tbh I'm not sure
.
the dropped items thing was an example, so basically i wanted to make like a tracking compass that tracks where the dragon egg in the world is and will display the last tracked location as lore
{0} for example
oh ok. yeah you can just do setLore(someList) and then this will be the lore
oh I see. it's been a long time since I've touched any logging stuff ahaha
so would this work?
i just for some reason trough that spigot uses log4j and got really confused tonight ๐
it does use log4j
that's why everyone went insane last year ahaha
yap, figured it rn ๐
how do i do that in a separate class?
wdym?
like how do i get the itemmeta?
with getItemMeta() ?
getItemMeta() always returns a clone of the actual meta. So you need to get it, change it and set it back on the item.
yeah
๐คฆโโ๏ธ
that's what I said too ๐
yep ๐
no
nooo
?
like this:
remember every time you call getItemMeta() you get a copy of the original
oh
ItemMeta meta = EggTracker.EggTracker.getItemMeta();
meta.setLore(...);
EggTracker.EggTracker.setItemMeta(meta);
like this ^
oh so u have to create a new Itemmeta every time?
kinda, yeah
alr
IT always creates a new one, you have to store it so you have it to put back
unless you wanna change many things at once
actually that makes sense lol
you can also do it like this:
ItemMeta meta = myItem.getItemMeta();
meta.changeFirstThing();
meta.changeSecondThing();
meta.changeThirdThing();
// etc
myItem.setItemMeta(meta);
this e.g. would also work
it still doesnt work for some reason tho...
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
your variable scopes makes no sense at all
what is EggTracker.EggTracker
it's an itemstack
why is it static
tbh didnt we all start like this
yeah it doesnt make much sense, and why is the lore list a class field
btw
ofc
FREE JAVA LESSONS
checkmybio
legal but why
no, it's an interface
CraftItemStack
you would need a method to transfer your subclass back to itemstack
i dont understand
is a class that "implements" ItemStack
what did i do wrong?
everything
"everything" is bullshit
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
sheeeesh, mean!
she didnt do EVERYTHING wrong, she did SOME things wrong
alr so in EggTracker all my custom items are inside (actually im only creating one)
but it's hard to explain if she doesnt read one of those java tutorials fully
and EggTracker is the custom itemstack
he*
even if it's beautiful or smth
oh I confused you with this other person then, sry
oh nvm lol
wait no
I didnt confused you
you have "she/her" in your bio haha
so that's why I used "she"
thats a joke ๐
fat troller
ugh yeah
anyways...
?learnjava!
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
so why is that wrong?
because it violates the general idea of OOP
all of those tutorials linked above will explain it
you change meta of static itemstack field eggtracker
Yes
but like what is this and how do you check if it's working or not
do you give it to some player or what?
you didnt properly understand the difference between classes and instances of classes, and that's why I keep sending you ?learnjava
so u are saying that i should change the itemstack to be non-static?
that depends on whether you want all those items to have the same lore, or not
well, im only creating one custom item so yes?
no, you create many amounts of custom items, and you want to give them a specific lore thats different everytime, or did I understand this wrong?
if my above statement is true, then your item should not be static. but just removing the "static" keyword will not fix this either. you should read one of those java tutorials I've linked
tbh that drop thing was an experiment to add a lore to that item whenever an item is droped
Actually when you drop an item its not itemstack anymore
ik what static means -_-
I dont think you do. otherwise you wouldn't be asking this
we all know that an Item has a getItemStack() method sooo
still
he tries to change some random itemstack
not given by this getter
no ๐คฆโโ๏ธ
yes, you do
yes
okay fine, this is what i wanted to do:
check if the item u dropped is the custom item and if so giving it the lore
in that case, listening to https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/ItemSpawnEvent.html should do it
declaration: package: org.bukkit.event.entity, class: ItemSpawnEvent
use getItemStack getter
and change this itemstack's meta
actually check if it has PDC or smth similar
Anyone have a example of a good custom prison enchant?
to make sure it's custom item
My system kinda laggy ๐ข
what the heck is a good custom prison enchant
you know TVs
Idk
magical
Looping many blocks at once
Magic-powered coolers
It lags a bit, even on a different thread
why is it called prison lol
So looping the blocks then settjng them to air
I also dont get it
Dont ask me, its an mc thing
breaking thousands of blocks is no problem at all
The docs on fawe are ass
it will only cause troubles if you wanna break hundreds of thousands of blocks
Well some people say, use multiple threads
yes true
So like fawe
separating maths from main thread is nice
Cant rn, i just got off. I have to go to school
to edit the world? that makes no sense, the world object isn't thread safe
^
on complete set of blocks
Yeah, i do that
https://www.spigotmc.org/threads/guide-on-workload-distribution-or-how-to-handle-heavy-splittable-tasks.409003/ you are probably looking for this
if server can't handle it, try making block break stages, so it's less heavy for 1 tick
I'll check it out
and could this work now?
try it
but probably, no, this will never work
because you keep refusing to read the turorials I've sent
your == thing is already causing it to not work
why?
Cuz it compaers classes
every of those tutorials will explain it:
they are both itemstacks
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
oh nvm
in 99% of cases, you should NEVER use == for objects unless you know what you're doing
yea i forgor that
It's fine for enums tho
sure, those are public static final objects
and they will always be the same object
ItemStacks however arent
?paste
We had a huge discussion here because someone was like "NO YOU SHOULD USE equals() FOR ENUMS" lol
wut
And then proceeded to ask for a reason why you would not go "standard" way.
oh that's bullshit. equals() on enums also only does ==. so yeah it's useless to use equals() there, but also dont hurt very much
Yeah we told him. He said that's not a reason. Whatever. I told him everyone can do it however they like.
It indeed is. Forcing someone to == or .equals() on enums is like going to someones door and be like "my religion is better than yours"
it might result in the same code after compiling tho
there was a discussion about MY sexuality earlier today, in this channel haha
and I didnt even start it
idk if compiler handles it like this
Yeah idk either. I would guess the compiler would replace it.
it doesnt
Some are bi, some are gay. It's whatever. As long as nobody gets harmed
exactly
i read that java actually has inline, but only on compiler level
(or not harmed without consent lol)
with issimilar it works the first time (it prints out sth before i added the setlore code) but it didnt set the lore
but itll never replace == with equals or vice versa
you really sure about that
i mean in bytecode with inline set it would be the same probably
yes it didnt work after the secund time
not to you meh
-_-
what if it's a smart compiler that notices whether .equals() would lead to the default implementation?
then it might to that, but javac doesnt go that far
code so far
actually commit this on JCP
I mean how are you even supposed to know that? e.g. when I compile spigot, I only have the ItemStack INTERFACE and not the CraftItemStack implementation
Also seems kinda overkill for that little overhead xD
Maybe they would add this to java compiler
?paste
?paste
How can i create commands automatically?
it's basically c++ thing
I wonder what you mean by "automatically"
java devs can add this easily
they probably just mean "without plugin.yml"
I can' t find a good explaination on how to use command maps or do this
yeah that makes sense actually
so should i turn my itemstack non-static?
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
alex can u take a look at this https://paste.md-5.net/adozepirir.http
i was listening to 20 naruto openings through all this discussion
just realised it's already the last one playing
30 minutes passed instantly
custom_stack is always null, you never assign any value to it?
I do in setMeta();
no, you accept whatever gets passed into that method without validating whether it's null or not
somewhere, you do myClass.setMeta(someStack, someDisplayName, null, ... )
where "somewhere" is probably SmithingSetup line 73
help
please ?paste this as proper text
> Task :version-support1_12:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':version-support1_12:compileJava'.
> Could not resolve all files for configuration ':version-support1_12:compileClasspath'.
> Could not find org.spigotmc:spigot:1.12.2-R0.1-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/spigot-1.12.2-R0.1-SNAPSHOT.pom
- file:/C:/Users/Nurisantoso/.m2/repository/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
- file:/C:/Users/Nurisantoso/.m2/repository/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/spigot-1.12.2-R0.1-SNAPSHOT.pom
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/spigot-1.12.2-R0.1-SNAPSHOT.pom
- https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT/spigot-1.12.2-R0.1-SNAPSHOT.pom
Required by:
project :version-support1_12
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
3 actionable tasks: 1 executed, 2 up-to-date
that
Does not it making an instance when i input it as a parameter
did you ever use buildtools to compile 1.12.2 in the first place?
no?
ok
learnjava
how
I have tried this, but just because custom_stack is null, stack is not be defined
it's a method parameter
and where do you init it
it gets passed into that method
How can I use the Bastighg dowload
whut
in line 73 ๐ ahaha
omaaagaaad
The dowload of Bastighg chelenges how can i use it
i pointed it
no idea, ask the author, you're in the wrong channel. this channel is for people who code their own plugins
maybe you have 6th feeling
CustomStack.getInstance("itemsadder:ruby_sword") returns null then
np
it has to throw, there is not such a string to console
but its not throwing that
if it's null then it's null
your throw code is inaccurate probably
show it
at least
the code of CustomStack.getInstance(String)
Its because the hyper tension between the satellite to the hexagonal hemisphere collides to make two dimensions which open up and create magnetic force which radiates and expands
let me try something
basically it's just me shit in the toilet
causing his plugin to crash
๐๐
you know magnetic force is kinda strong when i do it
Must be the gamma rays always messing with the processor when running that code. Shouldn't cause a null pointer. Lets just get rid of the sun to fix that
have you tried turning it off and on again?
have you tried to slap it several times
oh I do that with myself every day
don't forget to blow some air on it
oof
clean with water
I tried pissing on it now my penis has caught fire
now you are a woman
are you able to color text with hex codes
damn bro
yes
that sounds very incovenient
many ways
Did you just assume my gender
Ok
erm
๐๐๐
my gender is Uh, summa-lumma, dooma-lumma
you assumin' I'm a human
What I gotta do to get it through to you? I'm superhuman
Innovative and I'm made of rubber so that anything you say is ricochetin' off of me and it'll glue to you and
I'm devastating, more than ever demonstrating
How to give a motherfuckin' audience a feeling like it's levitating
Never fading, and I know the haters are forever waiting
For the day that they can say I fell off, they'll be celebrating
'Cause I know the way to get 'em motivated
I make elevating music, you make elevator music
Im a non binary gender fluid ostrich
How can i get a players face as a buffered
it's not funny to make fun of people who realized that their actual gender is different from their biological one
me?
download their skin yourself, then toss it into the BufferedImage class
yeah
or like this yeah
didnt he get banned or sth
I need to get it for each player that joins
then do it in the playerjoinevent
yeah but would downloading the players skin be bad for the server
Th3Tr0LLeR#6969
if you dont do it async, then yes
can add him and try to get answer
no
just not in the main thread
i cant just get the skins face directly into a bufferimage or do i have to manually download it
cuz who knows what would happen
manually download probably
you can try to check the PlayerProfile class and do getSkin() or however it's called there
work around GameProfile class
yeah but GameProfile is basically NMS
spigot meanwhile has this built in, wrapped into PlayerProfile
๐ฅด
never needed
The face will take control of the main thread and replace everyones face on the server with that one. Furthermore every block will then look like the downloaded face. Artificial Intelligence Faces are scary man. Secure your main thread.
Basically i would get 999$ dollas on my paypal
sadly it's blocked in russia
so i would not be able to use the money i get
/give @p skull 1 3 {display:{Name:"Pumpkin Spice Latte"},SkullOwner:{Id:"9aac9003-8d9b-461d-bcdd-1ffa7b24dc3a",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWQyZDM2NzQ3YmMzZTJjMzdkOTFmYWZlYjU2MjhjZDg4N2ZjZjU0ZWVkNDllY2Y3ZGRjNTRkMjAzMzYzMzNmMCJ9fX0="}]}}}
How can I make my skull command do the same? ^
ooh haha no
it only works for 1.18+
for 1.8 you need reflection and the GameProfile class
You are in for some real pain on 1.8
Can you provide me with some useful reference for it?
no, 1.8 is so extremely old, that's long before I started doing Mc plugins
That's not really a valid reason, but whatever
hello?
bye
lol
it's not a valid reason to not know anything about stuff that was before I started to learn anything about it? o0
you should take java lessons
1.8 is outdated & dead
Not really, you need to learn basics of oop first
sucks to be you then
we don't know what's wrong in your plugin
we only saw one class
alright...
I think I'll finally block this roxy person now
?paste
bruh
+1
I've sent ?learnjava like 10 times
soooooooooooooo mean
and then there was also this weird quirk about making fun of people chosing a pronoun
idk this is enough now ahaha
well basically if i know you are XY or XX i don't care about who you wish to be, sorry
not gonna call you war heli
or pirate
discuss this somewhere else if you want to
e.g. in my DMs
don't want to discuss this either
kk
Yall fucking wack as shit
@fluid river https://paste.md-5.net/hajofadegi.java
but he left this discord
why me
Valid
and Y2K is cool too
cuz @tender shard is a dickhead
circling back to you on this, but the cancel method doesn't fire at all
say what
kk
never getting any messages
you will be gone here very soon if you keep insulting people here
or just any 1
Your a dickhead โค๏ธ๐งก๐๐๐๐
no, fuck off
โค๏ธ
๐ฟ
You're* ๐
haha
you should stop insulting ppl
Nkooo fucm you, you only ever stop show up to say that
You monster
Y2K and me are friends, we can insult each other as much as we want because we both know it's not serious โค๏ธ
I w a s serious 
i mean this
you claim that because optic isn't reading this channel
๐ณ optic is scarry
haha IKR
He should stay in #general
anyway can some one plz help???
no, stop spamming
read the pinned message
bruh this is #help-development not #mfnalex-being-a-dickhead
I sent you ?learnjava 10 times and all the time you refused to read it
well, im reading it rn
if you think I'm a dickhead, at least discuss this in DMs with me instead of doing it here. Thank you & have a great day
dude whats wrong with u @tender shard
Nothing is wrong with him
I'm usually a nice person but you upset me a bit. But as said, we can discuss this in DMs, and not here, it's not the right place
how did i upset u?
is possible to change the ==: Player directly to owner: [PlayerName] in a yaml custom config used for saving data
Actual file:
Elite:
owner:
==: Player
name: Gurwi30```
u upset me
No, that is a class
move it to DMs
can we just stop plz?
ok, thanks
yes, you can set an alias for that stuff
Yes, but you would want to save their UUID instead. Then use that to get the player object when you grab from the config file.
and why the heck are you dumping Player objects to a config?
idk how it happened but we should just stop
What's going on here
I think it's in the ConfigurationSerializable class (or the other one, I dont remember exactly)
How can i create it?
If all you need is owner: [PlayerName] just config.set("owner", player.getName());
ta-da
instead of creating an alias for somethign you should not be doing, perhaps do it correctly and stop pushing Players to the config
declaration: package: org.bukkit.configuration.serialization, class: ConfigurationSerialization
second argument allows you to specify an "alias"
Although ShadowMaster is right, you should store the UUID not the name
@tender shard
Or save both hehe
how to change my java version
can you please stop pinging me
yes or no?
i tryna running buildtools
idk what you wrote, I can't see that message
please just refrain from discussing your personal issues with me here and MOVE IT TO DMS!
๐๐ค
Okay can someone please help me with something rq
I'm trying to cancel an async task with an infinite loop inside, from outside it.
How do I go about this? Things I've tried:
Storing ids in a list, cancelling each one individually with BukkitTask#cancel(<id>)
Bukkit.getScheduler().cancelTasks(<plugin instance>)
Overriding cancel method of runnable to set a variable to true which would stop the inf loop (However the cancel method doesn't get called at all? what?)
Using a global scope boolean to cancel all runnables' loops (however I'd like to cancel them individually)
Make task a variable
So that you can access it outside
*** The version you have requested to build requires Java versions between [Java 8, Java 10], but you are using Java 18 *** Please rerun BuildTools using an appropriate Java version. For obvious reasons outdated MC versions do not support Java versions that did not exist at their release.
Then download the proper version?
https://adoptium.net/temurin/releases/?version=11
https://www.azul.com/downloads/?package=jdk
I can just do that with Bukkit.getScheduler().getPendingTasks()
I CANT
u blocked me
oke
and I tried calling cancel using that but it doesn't call still
oh ok then let me unblock you quickly
Yeah but how do you know which task is it
I don't need to, I'm tryna cancel all of them individually
you're unblocked now
I thought yesterday buoo said to add !isCancelled in the while loop?
Seems like a good solution to me
I addressed this in the message you're replying to
still cant
what happened here
but i wanted to say if we just stop this
Uhh, it should definitely be called
If I have the same task for different player for example I store task ID in hasmap with uuid
Ez fix
U tryna cancel all tasks?
I put a Bukkit.broadcastMessage in it and I'm not getting anything and the boolean isn't changing either
nothing worth of mention
Because you are actually not using class which override cancel method?
?paste the class where you're overriding cancel
in case u are wondering i still cant dm u
ight
weird, I also cannot DM you
although my DMs are normally open to everyone
https://paste.md-5.net/lawexacowe.java
Although keep in mind this code is (For the most part) generated, not hand-written
currently I'm trying to cancel with
public static void cancelTasks(){
for(BukkitTask task : Bukkit.getScheduler().getPendingTasks())
task.cancel();
}
Wdym generated
alright fine, basically what i wanted to say is can we plz stop fighting, idk how it even begun
code generated code
yes that would be nice ๐
With what
alright ty
โค๏ธ
If one of your threads is in an infinite loop, can't you just end the thread itself? I guess it depends on how you make it, but isn't there like #interrupt() method you could use?
in BukkitTask?
Hm, maybe for some reason it's not considered a pending task. Store the BukkitRunnable somewhere when you create it and then call cancel on that
I tried storing ids and using #cancelTask but it didn't work so isn't this just the same thing?
I mean I can try but just saying
Oh, I thought you meant actual threads. I'm not sure about BukkitTask, but I would assume it has something.
kinda, yeah
Well it's not a repeating task though, so I'm not sure how it behaves with single tasks that don't end.
I think everything that gets scheduled returns an int or a BukkitTask
but I might also be wrong
I'm wrong very often haha ๐
You're right
runTaskAsynchronously returns a BukkitTask so saving that and manually calling cancel on it would probably work versus attempting to use cancelTask(int) or getPendingTasks
^
Since to Bukkit, that Task has been executed so it doesn't care to save it's ID or anything.
I mean I just tried and still no results, here's my entire class if you're interested
https://paste.md-5.net/iwibequpul.java
its a god class!
Where are you calling cancelTasks?
love these things
bottom
oh you mean
oh I call it on a command
in another class
just for ease of use while testing
So you re-join the server, it starts the task, and then when you execute the command nothing changes?
yep
wat
I'm also broadcasting the amount of active tasks and it doesn't change
Bukkit.broadcastMessage(Bukkit.getScheduler().getActiveWorkers().size() + "");
DFPlugin.cancelTasks();
Bukkit.broadcastMessage(Bukkit.getScheduler().getActiveWorkers().size() + "");
like so
My only guess is that cancel() is called on the same Thread as the BukkitTask then, and since it's focused on the while loop it never calls it...?
maybe
is there a way to just straight up set a variable that's inside a runnable from outside it
I'm guessing no
atomic afaik
actually what I could do is just store storage per runnable in a hashmap
then inside the uh
the conditional in the while loop
I could check for that variable
if that makes sense
I mean you can try it I suppose
At this point anything is better than not working at all
I mean it has no reason not to work I was just looking for some syntactic sugar to cut down on new lines I have to generate
I'm sure it'll find a reason not to work
If the quantum array of the inter galatic particles conjoined together to form a multi dimensional coronary cavity then mars would be like jupiter and the force of the atom to the sun would multiply by 1000
๐คฏ
easy
goodbye alex
gn mfnalex!
good night ๐
thanks for your help xD
Man its just 17:00 ๐ง
we are in different country
@lost matrix would you get mad if I made my own bootleg spark plugin to graph system performance on grafana ๐ค
in here 21:05
Just make my crappy profiler
yea
can i send messages to players with the Color variable
what
ChatColor#of()
like can i send colored text but instead of using the color codes can i use the color variable java already has
you use bukkit/spigot ChatColor constants

or ChatColor.of for hex
i have a java color variable, but i need it to be a chat color variable
how do i convert them
You know, it helps to read over the entire chat.
<#help-development message>
yeah but thats for hex is it not
It takes both String and Color inputs.
it doesnt exist
Make sure you are using the Bungee ChatColor class and not the Bukkit one.
its depricated
It shouldn't be.
Are you importing net.md_5.bungee.api.ChatColor?
yes
You sure your using #of() instead of #valueOf()? Because the latter is deprecated, while the former is not.
im use of()
Hey! I'm having trouble making a plugin. Here is what I want to do:
So, when a player right clicks with a stick it will show them an inventory. They can place items and when they open it again the items have stayed, but if they leave the items are gone.
I made the right click detection, but can anyone help me how to do the rest?
create an inventory and then access it
Why ChatColor isn't enum ๐ค
why is @boreal seal banned
Well, you should be fine to use it. What version are you developing against? Cause the method isn't deprecated in the latest versions of the API?
im using 1.19.2
u mean spigot vers?
To set the player uuid in a variable i have to use UUID playerUUID = player.getUniqueID(); ?
in which class?
can you send your class
yes
package me.light.server.commands;
import me.light.server.Server;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
public class HeadCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) return true;
Player player = ((Player) sender).getPlayer();
player.getInventory().setHelmet(player.getInventory().getItemInMainHand());
BufferedImage image = null;
try {
URL url = new URL(player.getPlayerProfile().getTextures().getSkin().toString());
image = ImageIO.read(url);
} catch (IOException e) {
e.printStackTrace();
}
//8,8
//15,15
player.sendMessage(ChatColor.of());
return true;
}
}
Same reason why Enchantments are no longer enums. Something about switching to a class format provided them more flexibility or something. Choco explained it once before, but I forgot the exact details. Probably had something to do with how the game changed internally.
please use code block
how
and also where you used Color.of there ?
at the bottom
lolplayer.sendMessage(ChatColor.of());
?paste is the other approach
You passed nothign to it
then its not deprecated, its marked red because it's non existant
pass in a hex string or a color you said you already had
what is awt
java.awt.Color
I think it's due to the fact that #sendMessage takes a String and not a ChatColor.
your right
yup
player.sendMessage(ChatColor.of(new Color(image.getRGB(8,8))) + "");
now it works
How can i get the gang name by giving the player uuid, checking in witch gang is the player
test: <- Gang name
owner: !!java.util.UUID 'bc10ad35-b7db-429b-91e9-21ddce92cddc' ```
How?
#set("path.to.value", uuid.toString())
fileConf.getConfigurationSection("gangs").getKeys(false).forEach(key -> {
if (fileConf.getString("gangs." + key + ".owner").equals(formattedUUID)) {
return key;
}
});```
it is giving me an error in the return key section, "Unexpected return value"
cause with that code you return test
send your method
shuold return #getString("gangs." + key);
getGangsData().getConfigurationSection("gangs").getKeys(false).forEach(key -> {
if (getGangsData().getString("gangs." + key + ".owner").equals(playerUUID.toString())) {
return key;
}
});
return false;
}```
ahh yeah though he hasn't added a name behind test:
oh
it should return String
yeah yea then it's right
i forgot
also why this !!java.util.UUID 'bc10ad35-b7db-429b-91e9-21ddce92cddc'
Sorry
he used UUID directly
yeah
not UUID.toString()
i changed it
idk why he'd do that
now is UUID.toString()
can i use a custom font from a resource pack on plugins
Yes
how
You just need to use the characters directly.
ok
what should i put insted of the boolean? I put void but it gives me error
a string but putting string it gives me error either
How can I send a message using MiniMessage format?
It should be like this?
getGangsData().getConfigurationSection("gangs").getKeys(false).forEach(key -> {
if (getGangsData().getString("gangs." + key + ".owner").equals(playerUUID.toString())) {
return key;
}
});
return null;
}```
Isn't this paper stuff?
no?
It is, but you can use MiniMessage in spigot if you shade the library into your plugin.
yep
How can I send a message to a player?
a single player
Use their API? I thought it was as simple as MiniMessage#sendFormattedMessage() or something like that.
There isn't
I could do deserialize
Kotlin vs Cristiano Ronaldo
Kotlin
Kotlin shit af
Here's the original thread Mini made, maybe it could be of use.
https://www.spigotmc.org/threads/minimessage-userfriendly-json-messages.407958/
Hmm, it looks like it's no longer a standalone library. Which kinda sucks. Maybe you could depend on adventure and exclude everything except minimessage.
I can't see nothing useful doing MiniMessage.deserialize
Can't send the Component obj
Nothing useful in the world wide web :C
What about MiniMessageSerializer?
here you go
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.11.0</version>
</dependency>
What about MiniMessage.miniMessage().deserialize()?
It gives me a kyori Component which I can't send to the player
i mean like can i do fonts like this {"text":"<","font":"example:display"}
because i actually need to register the font when the text is typed
You should be able to so long as you provide the proper font file in your resource pack. You may want to take a look at how minecraft added the new Illager font to the game and use that as a reference.
yeah but like how would i do that as a plugin
i know how tellraw works i just dont know how to add a font when typing on the server
i found a solution but is uses basecomponent
Hey, can someone tell me why I'm getting an error on line 8 of this?
https://paste.md-5.net/zozuqejube.cpp
No idea how the world edit api works lmao
Why can't I use GameProfile class within 1.8.8 api version?
Because it doesn;t exist in 1.8
you asked about API. It doesn;t exist in the API in 1.8
I actually thought you asked about PlayerProifile, but same thing
So I can't use it or?
How can I access it then?
nms
okay, thanks
Replace the version with whatever 1.8 usesxml <!--Mojang --> <dependency> <groupId>com.mojang</groupId> <artifactId>authlib</artifactId> <version>3.5.41</version> <scope>provided</scope> </dependency>
Repoxml <repository> <id>minecraft-repo</id> <url>https://libraries.minecraft.net/</url> </repository>
With?
the version value?
no
I've no clue what version 1.8 uses for authlib. Just change your dependency to spigot and not spigot-api
so long as you ran buildtools to create a 1.8 jar
Cool it's working, thank you