#help-development
1 messages · Page 453 of 1
that would be awesome ngl
Bukkit.selectEntities(…)
oh I see
haha ty
pog
and commandsender instanceof.... commandblock?
Nah not really
You can just do it for any sender
you have BlockCommandSender
All senders can technically use @p/e/a/s
technically indeed
Also people should really refer to those as @peas
heh peas
Some won't work for console tho, right?
True
like @/p
What happens if you use that in vanilla commands on console
I assume it just yells at you
🍐
it might just pick a random player xD
lol it worked idk
probably ye
I guess it picks the closest player so… probably closest to 0,0? Idk
or that
hard to test on your own
probably either closest to 0,0,0; a rando; or it would just make the server crap its pants about it
ima test it uno secondo por favor
it does not crap its pants
Yes it just resorts to nms
Think it uses one of the nms brig argument implementations
As well as resolving the sender’s location through nms command wrapper or sth
Yea thats a good question
What is the location of console
Would assume it points to origo
Where does he live
idk but with one player, minecraft:say works
with @p
i'll test it with two in a bit
use set(path, location) and getLocation
Doesn’t spigot automatically preserve comments in newer versions?
set("path.x", x) isnt set(path, locationVar)
You’ll need to handle comments yourself then
its 1.8 so no idea
nani the fuck
have you not updated discord?
it's a "super reaction" lol
maybe they don't like you either
What are super reactions
We already had animated reactions
So are these just more animated
ah it doesn't show on mobile, at least on the version i'm on lol
Hello I want to reset all attributes of a player to default values, I've got this method
But the values are not the player default
Ah wait these should be getDefaultValue()
So the default values are not for the player
The default values can be changed
how?
Default value for movement_speed is 0.699999 when it should be 0.1
silly, even
So should I just store all the default values to be able to reset player's attributes? Or there is some method or a field...
I mean I figured getDefaultValue would get the default
Maybe it’s missing overrides for certain entities
Or maybe it’s some weird format
yeah I also wanna kick those fuckers in the shin
Does the method not work?
Yes it seems like its overridden
When it lands?
Use the event and check for nearby entities
I think it’s EntityChangeBlockEvent
i'd probably have a task that runs every tick* that checks for nearby entities and hurts them
- doesn't have to be every tick, could also be more than a tick of delay lol
yeah that's how I do it too
private final NamespacedKey defaultAttributesKey = new NamespacedKey(this, "default-attribute-values");
public void saveDefaultAttributes(Player player) {
EnumMap<Attribute, Double> attributeDefaults = new EnumMap<>(Attribute.class);
for (Attribute attribute : Attribute.values()) {
attributeDefaults.put(attribute, player.getAttribute(attribute).getBaseValue());
}
player.getPersistentDataContainer().set(defaultAttributesKey, DataType.asEnumMap(Attribute.class, PersistentDataType.DOUBLE), attributeDefaults);
}
public void loadDefaultAttributes(Player player) {
EnumMap<Attribute, Double> attributeDefaults = player.getPersistentDataContainer().get(defaultAttributesKey, DataType.asEnumMap(Attribute.class, PersistentDataType.DOUBLE));
if(attributeDefaults == null) return;
for (Attribute attribute : Attribute.values()) {
player.getAttribute(attribute).setBaseValue(attributeDefaults.get(attribute));
}
}
Thanks!
the code for getDefaultValue is fine
it returns the correct default value
it just happens that players do not use the default value
intriguing
yeah it's a bit weird lol
I guess it works well for like, knockback resistance
Since almost everything uses 0
But speed, not so much
But are all default values not used by a player? Or only a few ones? If so, I can use my code and just add some exceptions...
How can i make a Item Unbreakable in 1.8.9? meta.setUnbreakable doesnt work and meta.spigot() doesnt exist either
https://paste.md-5.net/ahagihofiz.java CODE
ERROR: https://prnt.sc/aZLZOr50VP-Z
ANY HELP?
you can get the default values of a player with NMS using Player.createAttributes()
Is that available for all entities?
it's the same as LivingEntity.createLivingAttributes(), except that
ATTACK_DAMAGE is 1.0
MOVEMENT_SPEED is 0.10000000149011612
and they have ATTACK_SPEED and LUCK, but no value set
yes
at least, it's available for all entity types I checked
How can I access this method?
?nms
it returns an AttributeSupplier.Builder lol
-_-
Thanks!
but yeah AttributeSUpplier is also just a Map<Attribute, AttributeInstance>
Right
why kills wont increase? https://paste.md-5.net/ahagihofiz.java
Sounds like it’s PR time :p
Exactly
Does it work for 1.19.4?
compile buildtools once
https://github.com/Spigot-Plugin-Development-Tutorial/bodied/blob/master/pom.xml
there's also the kodi's example for 1.17.x
yes, you just have to read the blog post
Okay thanks my bad
😛
🕳️ 👨🦯
I'm using scriptcraft, everything is fine, it has its engine but it says
"No JavaScript Engine available. ScriptCraft will not work without Javascript."
The server works fine, and scriptcraft loads too, but it doesn't responds to anything.
what the heck is scriptcraft
bruh
Instead of making plugins in java, we can create it in js with the help of it.
yikes, that sounds like a horrible idea
bruh
js would be pain in minecraft, its not like react or nodejs
I can handle it
java has ended support for java script engines
since java 7 i think
nashron js was the last engine
you should use a forked jre
its not a good idea to run js under java
its not supported anymore (as well as i know)
With the release of Java 11, Nashorn was deprecated citing challenges to maintenance, and has been removed from JDK 15 onwards
whatever
I'm using it, pain in the ...
java11*
https://openjdk.org/projects/nashorn. Contribute to openjdk/nashorn development by creating an account on GitHub.
last commit was 2 months ago lmao
ScriptCraft is alternate js engine (as I know)
j2v8 is a good one
try using nashorn supported jre(s)
lol
scriptcraft is weird
If you know how to use it, it'll be easy.
that are the included default scripts ^
😶
if you know how to use it, you know how to use it basically
a truly philosophical statement
?
there a better method to get a player instance in mysql? https://paste.md-5.net/ukokuqibiw.java
So, I just wasted 10 hours of my life? 🥲
if you want a better alternative for java
you can try writing your plugins in kotlin
someone can help?
And when I use java I get an error for my plugin.
unless your server is an offline one, you should use UUIDs instead of names
what error
Wait I'll open another folder and use java
uhh
how do i turn intellisense on
i created a new project and for some reason it's not on
intellij
This code is supposed to make the armorStand rotate depending on the player's rotation. The armor stand is always supposed to by 2 blocks to the right, 1 block back and 3 blocks high. But this code i have makes the armor stand rotate super fast and not how i described it. Can you correct it?
https://paste.md-5.net/locivubako.cs
By default, IntelliJ IDEA displays the code completion popup automatically as you type. If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift+Space once again.
https://www.jetbrains.com/help/idea/auto-completing-code.html
tried that already
ah
what the heck is IntelliSense lol
the auto-complete thing
isnt that just called auto complete
hmm, should I use buildtools.jar too?
this right here
It's a vscode thing AFAIK
is Power save mode enabled @icy beacon ?
yeah well that is not intellij though
shouldn't be
File -> Power save mode
well, yeah
you do not have intellisense if you use intellij
ok turn it off again
intellisense is just commonly used as a synonym
Do you use vsc for java?
can you show a screenshot of the whole window
for my plugin..
perhaps that's the wrong term but i mean the autocomplete & analysis
like a true chad
if you want to build a spigot .jar, sure
😭 I'm still all alone
for some reason there's no "Java Class/Kotlin Class" option?
i think intellij doesn't recognize the project
or smt
i mainly use eclipse and sometimes intellij if i have to work with lombok
you still have the power save mode enabled
no
hmmm..
there's a checkmark when it's on
just a notif
but that message should go away when you disable it
beautiful music
pog thanks
sigma
yes
also for some reason it has the paper icon even though it's a spigot project
lmao
i'm very confused at this rn
🤔
File -> Repair IDE
must be brocken
oh and maybe ?paste your pom
install -> Eclipse
?paste
(sh)e's b(r)o(ek)n
e's bon
e's bon
add to your <build> section: <sourceDirectory>src/main/kotlin</sourceDirectory>
sure
my indentation is all over the place lmao
one sec
yeah it shows up now, but the analysis is still off
hm no idea lol. maybe a bug in the "new ui"
intellij moment
what
idk
konaaaaaaaaaaaaaaaaa
and i've watched like 3-4 animes in my life
i tried learning japanese once
but i just forgor
it's surprisingly fun
yup do you know about marshallyin
nope
The code of the plugin should be in jar right?
no prob
remove the embed plz
no
the class files should be in the jar
ty
no prob
wha?
the class files should be in the .jar
so it should be in .java
ok i fixed the problem by creating a new class cuz it wouldn't analyze the old one
hava is new to this server
well i think you need to learn java first
xd
.java ---compile---> .class/.dex ---pack---> .jar
wait like this?
jar cvf plugin.jar *.class```
you don't have to do that, use maven/gradle
maven/gradle ftw
At minimum an ide though
^
^^^
\/\/\/
^^^^^^^
who reacted with the eggplant
no u didn't
thx
seems epic got a new pfp
that's epic
no
literally
i got profile deco
oh
im not using Intellij IDEA
exquisite
I hate that thing
i don't think so
use eclipse, intellij idea, vscode, netbeans - whatever the fuck you want
netbeans or eclipse also work
but if you are compiling manually you're a deranged psychopath
idea is the best ide to work with
chill, ok
The file system looks complicated to me...
bruh
eclipse's is more confusing to new people
you'll get the hang of it sooner rather than later
it always seemed straightforward to me ¯_(ツ)_/¯
maybe i'm just weird
you've ascended to a higher plane of existence
If you are afraid of normal ides use vscode tradeoff though is you might have to do some configuring
i mean how it shows src/main/java/me/epic/etc
and src/main/test/me/epic/etc seperate
what I dislike about eclipse is that it always uses this weird "workspace" stuff where you end up with 30 open projects
thats what @young knoll likes
I used eclipse before I switched to vsc seemed pretty intuitive to me
oh i'm certainly high
I#d much rather have one window or tab per project
Everyone should just switch to vscode you can do whatever the fuck you feel like on there :P
im good with idea
i use vsc
for non-java related stuff
but i do use it
i prefer gedit though 😎
Ugh
I'm a monster I use it for everything
don't tell me about the code auto-formatting gross
I dont like vsc
You are not. Eclipse is pretty easy to get the hang of
mf abouta open an mp4 in vsc 😔
„Ah, thats an interesting movie“
it took me almost 3 hours to get it done, and it just looks like stright c code formatting
It has good auto formatting only reason it'd suck is if you are using wrong plugins since the plugins manage formatting
Only issue is that eclipse has a large (albeit invisible) learning curve (But other IDEs have that too)
its just like installing google-chrome on windows, because edge is slow
I dont have any plugins in IJ lol
i have a few in eclipse
Eclipse is basically 90% plugins
Vsc is 100% plugins and IJ zero lol
yk just a few just 90% of the app nun' much
polar opposites
Vsc takes up less space for me than intellij + pycharm + webstorm + a haxe ide would take up
Who be chatting shit about ma boy IJ?
You have at least a dozen installed for a standard JDT install
110%?
Yes the builtin ones, i meant external plugins
it's over NINE THOUSAND!
the only additional plugins I use in Eclipse is a database one and a themes one
110/0 % 🔥
1.19.3 ig
1.19.3 atm iirc
it's over UNDEFINED!
?paste
still over UNDEFINED!!
Nothing is more terrifying to a math teacher than this right here
1/0 = infinity
pain
Two hands
terrifying to minecraft clients,try sending them through packets 🔥
three hands
Wrong: POSITIVE_INFINITY
potato tomato
I put a bukkit runnable after I spawn a mob with runTaskTimer so it repeats every 2 seconds so I can give the mob abilitys n shit but when I relog or die it just stops using the abilitys
any help would be great
thanks
Never forget my boy NEGATIVE_INFINITY
No need to specify its implied positive 
since it's RIGHT_CLICK_AIR, i believe if you hold the right mouse button it might count it as multiple events
not 100% sure
Why did they go with axis-angle for display entities and not Euler angles?
In b4 there is UNDEFINED_INFINITY (aka NaN)
I get quaternions
¯_(ツ)_/¯
Notch
There is a ?command here
Notch left like
Spaghetti 🍝 Code
But idk which one it is
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
9 years ago
And I guarentee there is still his shit plaguing the game
Anyway I find it’s best not to question Mojang
ah
Euler angles are just so much more intuitive to me
How do I rotate on all three rotational axis
I dont even know what an euler angle is lol
So a Vec3d
Yes
Oh ok lol
But using that to describe rotation
It’s intuitive because it’s just how far you’re rotated along each axis
what do you mean
armorstand hands rotations?
I might be crazy
Roll
Roll is the third one
Yes that I might be crazy
But I think they used to use pitch yaw roll
yes i think
And thats 3 doubles, isnt it
But not a vector
Lmao
🤓
To be fair in Unity they use a vector to represent an Euler angle
But I guess some people use stuff in a way they should not be used
But just because it’s a data type they already have
the last time i used euler is when trying to write a 3d mouse controller on a video game project
It’s just easy to reuse the tuple of three floats
(ESPECIALLY because the vector methods would be nonsensical)
Quaternion.euler?
Its 3 doubles in spigot
its easier in unity, u just need to get delta x and y, and put it in that function
Gotta have that extra precision I guess
Lmao
but its handy when it comes to libgdx
brackeys'(s?) game dev tutorials 😎
(Especially when it goes to 360 instead of 2pi)
Matrix math. Euler has a flaw where it suffers gimbal lock. Quaternions get around that issue.
Kidding kidding love radians
I do know about this
However they are still more intuitive to work with
I think quaternions are also more efficient for rendering
In some way
But I do not know that
But Gon is better
using eulers you get a different result depending on the sequence of rotations
I am making up stuff
Look I’m not saying it’s perfect
It’s definitely not
Idk what to do with 4 numbers though lmao
We’ll I do know what to do
then learn matrix math
I google Euler angle to quaternions converter
hey yall, need your opinion - what's your preferred config lib and why?
spigot's YamlConfiguration ,because it's straightforward and is builtin
and it can do everything I ever needed, and more
^
for non-spigot stuff like discord bots etc I just use plain snakeyaml and pretend that it's a YamlConfiguration lol
xD
i also used to use it, but i wonder if there's anything else that you guys use and enjoy
oh i should've clarified, i'm looking for something with easy support for upgrading configurations and comment support
org.json:json
i use gson for json
but anyway
alex, do you have anything in jefflib for config management?
agree
serialization is easier in json
actually
i might just do my config in json
but i still am not sure how to support upgrading
for example my users have an old configuration, and my new configuration has extra fields
how'd i go around that
yeah yaml is better
Configurate my friend
alrighty i'll take a look
sure thing
Okay so its a bit hard to use
Well
Its not very user friendly
But just ask if u wonder anything and we can help ya
Been using it for quite some time
as long as i can manage my configs easily i'm fine with that
Its extremely powerful, being an abstraction over config formats
i've had a bad config system for a long time
Whilst providing a robust design
messages & config in one file, no upgrading and shit
i hope to revamp my config system as i revamp the rest of the plugin
I usually have 2 different modules/components for langauge and config
i will make sure to use something from jefflib in UE just for the sake of it lol
but i will look into configurate
thx yall
Since language can usually grow somewhat more unstructured and sporadically than your configuration generally speaking
Best of luck
I may also recommend looking at how LuckPerms deal with config
(Raw object mapping)
(Its in common module, subpackage configuration iirc)
serialization easiest in tora https://github.com/imajindevon/tora
in rust ofc
how to remove glow enchant?
without hide flag
You'd want to hide the enchantments from the player and then apply the enchantment names to the lore
whats the correctest way to set a player's server join location in a non-blocking way? PlayerJoinEvent -> player.teleportAsync? I think that can send the original join location's chunks
there is no teleportAsync in spigot
Does it cost much to create asynchronous tasks? I have a command which begins creating spots (20/s) around a player, in each spot, many particle effects are played over time (4s), and then a lightning bolt strikes a few moments later. I could (1) have a sync task which creates asynchronous tasks for each spot as they are spawned, or (2) have one asynchronous task for the whole thing. What do you think would be better?
Well assuming you send packets or, use the api then that will get synced anyway
Isn’t Netty async
why would one use packets for particles
Lots of complex vector mathematics for the effect.
Maybe they’re on legacy presumptively
No.
It's just that I've found significant performance enhancements when I async the math.
How are you dispatching the async tasks?
This sounds like you should take advantage of a fork join pool
(Or well first you may wanna try to run it on the server thread)
But if its too heavy, then resort to asynchronous computation
dunno what fork join pools are, but I just use
new BukkitRunnable() {
@Override
public void run() {
//code
}
}.runTaskAsynchronously(AesopianProject.getAesopianProject());
If you use that, then go with as few async tasks as possible
is there a way to check a doublechest witch side i clicked left or right?
i tried it with.`
1.
Chest chest = e.getClickedBlock();
if(chest.getType().equals(Type.RIGHT){
2.
Chest chest = e.getClickedBlock();
if(chest.getBlockData().equals(Type.RIGHT){
Since a cached thread pool can’t take advantage of work stealing
Okay let me explain in simple terms
yes i am a simpleton
cached thread pool, what bukkit scheduler uses for its async tasks is a pool with threads, it has a single queue which the tasks are appended to before given to a free thread, where its then executed
work stealing is a concept where every thread has a queue of tasks, we will call this a worker, a worker can steal tasks from another worker, this is quite powerful for certain types of tasks where there might be a parent-child relationship or for smaller tasks generally
sounds cool
If you wanna know more I suggest doing your own research, but thats the gist of it
do you know any resources which explains this in Java so i might learn about it
Hmm I have some I think
i'd love to learn more
?paste
how do you detect if an item entity hits a solid block?
for example you drop an item
hrm
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/ForkJoinPool.html
https://docs.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html
declaration: module: java.base, package: java.util.concurrent, class: ForkJoinPool
This Java tutorial describes exceptions, basic input/output, concurrency, regular expressions, and the platform environment
conclure you know i think the work stealing concept is actually much better hrm
You can ofc google more about it xD
Yea for you it probably is I assume, hopefully you will be able to massively reduce latency
how can I replace properties in files using gradle? E.g. like ${project.version} in maven
can any 1 help?
Groovy or kotlin dsl?
Quick question would this cause any major lag if the Sets are huge?
like 100 items pr player
Lets say 100players 100 items
Thats 10^4 iterations
Hmm wouldnt say that’s gonna be that big of a problem
Conclure, as a follow-up, is it better that the tasks I give to a fork/join pool be long or short? I could, for example, make every single mathematic calculation a 'task', but I feel like that probably isn't its intended use.
I could give like 1000 calculations
I mean I feel like you should use a Map Banannus
Are you making this word up
'Map Banannus'
oh wait
you're responding to that guy
i thought it was a real java term for a second
groovy, but I could also switch to kotlin lol
Hello, how can I "force" a player to pay attention to a message? I don't want to freeze him and interrupt his gameplay. I thought about using sounds but I don't know which one is the best
Hmm well, I'm getting the set<PlayerData> from HashMap<UUID, Set<PlayerData>>
could use a title?, hard to miss those
So i would have to change the whole structure or what?
My problem is that several message may be sent within a period of minutes
so I have a conflict
Try and see, its very hard to predict the optimal size of the tasks actually
as in they might be send at the same time or?
nope, but multiple times a minute
let me know if there are ratings we can give helpers so i can rate u 5 star
not sure what the problem with that would be
Lol I guess you could review my spigot resource :>
But its not well like a serious one anyway
Alright I will go with titles, but I want to add sounds too.. do you have a suggestion?
it should be something like an alarm
the context is negative - something bad happens in real life and the players need to be notified
how do you detect if an item entity hits a solid block?
for example you drop an item
last time i made an alarm i just spammed 5 anvil hit sounds
Thank you 🙂 I will try!
Well
If you have kotlin
You can use this syntax
//build.gradle.kts
val property_name: String by project
//gradle.properties
property_name=something
can someone plz help?
ugh whut? 😄
i dont understand that
I need to set the version in plugin.yml
lol
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
Yeah thats the one
thx
and how does it look like in plugin.yml?
???
version: '${version}'
thx
Alex is learning gradle
Small step in the right direction:>
I always try from time to time, then I give up and convert it to maven
do it
no
shouldnt gradle be able to do it automatically?
I've no issue with Spigot supporting Gradle, but if it dropped Maven I'd stop doing plugins with Bukkit as a base
i think coll meant converting the actual spigot project to gradle
how can I do this in gradle?
<profiles>
<profile>
<id>export-to-test-server</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<outputDirectory>/Users/mfnalex/mctest/plugins</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
does gradle even support profiles or sth similar?
apply from: 'file.gradle' is the closest thing
what's that
one sec
i could put apply from: 'https://raw.githubusercontent.com/The-Epic/gradle-scripts/main/publishing.gradle' in any of my gradle files to have publishing info applied
but how would I then enable it only "sometimes"?
I want it to work like in maven where I can just enable/disable profiles before running it, e.g. with the IJ gui, or just by specifying it on the cli: mvn -P export-to-test-server package
i have changed the bot a bit
New code: https://paste.md-5.net/wicodamiwa.java
New error: https://paste.md-5.net/umahumabep.sql
Someone know how to fix?
plzzz help me guys!!!
you never call next() or whats it called
yeah we donthave that, you would just have to comment it out when you dont want it
not 100% if this makes sense but you could wait until the isOnGround() method returns true
lol
ok again time to go back to maven
yea but isnt there an event?
rs.nextInt();?
There are some ways
But its a bit more advanced
no
I can't believe that gradle doesnt support this, that'd be a joke
you could just create ur own task to sometimes enable copy to server
bruh so i just have to manually check with a loop?
what i need to do to fix my code
because they are not related to any entity instance
you put g instead of k btw
There’s no inherent support for it
But
Like
Ehh you'll want to abstract that a bit
Its fully possibly to create a similar system alex
And there’s presumably a plugin for it also
hmm but how? I couldnt find anything on google D:
So the way I would do it is to have a property
And then you have an argument when running build for instance
Where it overrides the property value
and then you like in ur buildscript check if the property has a value and then import the correct gradle file
Well “applying it”
that sounds overly complicated for a simple thing like this tbh
I'll just go back to maven
Yea thats alright
are there any public scripts for updating spigot mappings to the new version?
Is there a way of mods and plugins to communicate?
Yes
declaration: package: org.bukkit.plugin.messaging, interface: PluginMessageRecipient
It basically just uses the special packet Mojang added a long time ago
I was planning to make a custom bar in the hud but I guess you can make that with resource packs too
I guess something is malformed in your replacement string
You might need to escape some character...
but the replacement is no regex
Error: https://paste.md-5.net/nabihefoci.md
Code: https://paste.md-5.net/usesasenut.java
Any help
thoughts on code? https://paste.md-5.net/hoqivehona.java
btw can you put links in a commit message?
You have RegEx enabled, so the replacement is $1
You have to escape the closing parenthesis
'$1'\),
Not sure why IJ wants you to do that but that's the only thing I can think of that would be "invalid"
but the replacement string is never a regex
I mean what would even be the purpose of ( brackets ) in the replacement string
Yo guys
How do I store PersistentDataContainer to item with PersistentDataStorage ?
I have not found any non-version specific way to create instance of it.
?pdc
You simply get the PDC of your ItemMeta and apply your data there
Ye but what if I want to nest the PDC ?
I do not want everything in the one NBT tag PublicBukkitValues
Then you call pdc.getAdapterContext().newPersistentDataContainer()
Well, then you cant use PDCs
Because you only have this core container.
You can add new, nested containers to it tho.
Like I understand that with the API I have to store everything in the PublicBukkitValues
I want to add more containers to it
What you just sent is exactly what I needed (I think)
Thank you
Any way I can listen to click events in chat?
They have to run a command
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
So you can listen to the command event
yeah I generate a random UUID and then do /mycommand <uuid> to check whether the msg was clicked -> https://github.com/JEFF-Media-GbR/JeffLib/blob/master/test-plugin/src/main/java/com/jefflib/jefflibtestplugin/commands/JeffLibTestCommand.java#L54
Why not pass the player UUID
Oh wait
my bad
im using it
thanks
np
any good regexer's in here
it it possible to create two teams with the same name that are registered to two different scoreboards like this or will it still throw an IllegalArgumentException?
Scoreboard s1 = Bukkit.getScoreboardManager().getNewScoreboard();
Scoreboard s2 = Bukkit.getScoreboardManager().getNewScoreboard();
Team s1Team = s1.registerNewTeam("test");
Team s2Team = s2.registerNewTeam("test");
what would regex look like for finding §x§r§r§g§g§b§b occurances in strings
You wanna be able to get out the x r r g g b and b right?
yeah, no need for the x
minimessage is just dying at me because theres § in my string so im just gonna reformat it
Minimessage moment
&#rrggbb is better anyway
Do u really need a non capture group for first one?
Meh you also just skip the first match
along with using ^ to denote a pointer, as it is pointy. best explenation ive seen today
Ah i just realised a mistake. Im also matchin the '§' signs
Wait ur regex doesnt go for §x
(?<=§)([0-9a-f]{6})(?=[^§]|$) This would filter them out
Yea
But let Conclure maybe come up with something not so janky
Oh I can give a less regexy one if u want lol
regex is hard
public class Utils {
private static final Pattern spigotHex = Pattern.compile("(?<=§)([0-9a-f]{6})(?=[^§]|$)");
public static String convertHexFormat(String input) {
System.out.println(input);
Matcher matcher = spigotHex.matcher(input);
StringBuilder stringBuilder = new StringBuilder();
while(matcher.find()) {
String match = matcher.group();
String value = match.substring(1);
stringBuilder.append(value);
}
System.out.println(stringBuilder);
return stringBuilder.toString();
}
}
``` that manages to turn any inputted string to nothing
chatgpt cant even make correct regex and then reformat it
Fr?
fr
Damn
no cap?
ive asked in like 4 different chats and it cant even get it correct
it either fucks the regex up or manages to fuck the method up
I have had decent results with 4 in the past
https://i.imgur.com/CLIRqqN.png
Is there a way to remove that section of the lore?
its probably me asking the wrong thing tbh
Sure. Just replace the lore with an empty one...
oh
Is it? I have never seen that.
i set it to null and it didnt remove it
It's new
what would the chat gpt friendly version of "Make me a method that reformats §x§r§r§g§g§b§b to <#rrggbb> keeping values that come after it"
From like 1.19.3 or something, whenever they redid the creative menu
the part about "interact with"?
its cliend side not sure if a flag hide this in all cases
Wait, let me try something
Ah ok thank you
just tried exactly that and it gave me
Is anybody else having issues with PDCs in Spigot? I am currently using the CustomBlockData plugin to assign PDCs for blocks to the chunk. The PDCs work while the server is online but wipe when the server stops even when /save-all is used beforehand.
Is it possible to make another namespace for commands that are not intented for player use but rather internal commands?
Something like /plugininternal:veryinternalcommand
The block data plugin from mfnalex?
Yes
Hm, show some code. The PDC of blocks is just stored in their chunks.
Do you make sure that chunks get properly saved?
Is there anything I need to do to ensure proper saving? I didn’t write anything regarding that because I thought PDCs handled it. On my phone rn, but the only methods I have been using on PDCs are get, set, and has.
Also, this problem appeared recently. The saving was working for a while.
They save automatically
whats the max health I can give to a mob
it lets me give 200 to a spider but not 2500
whats wrong with this 👀
i want to convert from that
why dealing with that weird &
because its already formatted
You could group the class
and i need to convert it to minimessage-ify it
well idk, i wrote that atleast 2 years ago
Display entities at their best 😅
damn
😌
new api?
Btw idk when but I have 100x dev noted on my discord notes on ur profile
😀
Ok
Fourteen do u remember anything special u said? 😅
whats that supposed to mean?
Quite clueless actually
most mentally stable birb
to people who claim gradle is faster: not always true
i realised i could just add a String#replace
lol
Gradle is only faster because it caches half the universe
But then its often a bit faster
Yea
yeah but maven is also quite fast, in this case it was even faster
0.6 vs 0.9 seconds
how do i find url like this for 1.19?
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
url?
it's <groupId>:<artifactId>:<version>(:<classifier)
It's basically always 'org.spigotmc:spigot-api:<minecraft-version>-R0.1-SNAPSHOT'
where do i find it for 1.19
okay
artifact identifier
you replace 1.16.5 with 1.19
org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT
Technically u can check the repository if such a version exists
like this?
Depends on what u want
want to create 1.19.4 spigot plugin
do you have Tests
dont know. i just created gradle project
So you don't, you can remove it
you dont, you can remove it
thanks
im confused
why
I unit test my NMS library
Nice
it requires a server to run though lol https://github.com/JEFF-Media-GbR/JeffLib/tree/master/test-plugin/src/main/java/com/jefflib/jefflibtestplugin/tests
But do you integration test it, mutation test it and system test it? (/s)
i dont even know what that means lol
Well you have system tests that test whether the entire system fulfill its engineering requirements, then integration tests when your module fulfill its engineering requirements when talking to other modules, and mutation tests is a more tiresome process, but it essentially expects your code to fail as it will byte-code inject incorrect data into ur variables, if ur code still runs as fine then the mutation test fails
when you only have one module :)
🥲
(Additionally) You have acceptance tests that regard the business requirements (not the same as engineering requirements, as they’re more end-client directed)
someone drop him an article
you test an unit
wdym by unit
Well there are tons of other test types also, but those are probably most important
A unit is often a class, a unit test is a test (often a function) which tests whether a function from the unit works as expected
whats wrong bruh
What does the red say?
Show me ur gradle
i think gradle is the issue
i think i am issue
'org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT'
is this correct thing?
dam i wish i knew more about maven and github
i wish i knew how those git commands work
i wish i had good pc
Greened
how does people make it easier for updating plugins live
You need to add mavenCentral()
where
Under repositories {
thanks
How dare you
i have seen some people debug and maven outpout floder stuff
you dont ever want to work with gradle if you have a 450 lines long build.gradle
oh gosh sounds like pain
its called coding

and a few other build.gradle, and it complains that lombok generated methods cannot be found
Tbf u were using the poopy groovy dsl
https://www.spigotmc.org/wiki/build-you-spigot-plugin-with-gradle-groovy/ maybe try to follow this greened
I wrote this guide long time ago actually
already seen that
Maybe ye
U centralized the logic in one big file?
Understandable
Ah I see
Fair enough
🥲 kind of same
dark mode on spigotmc??
dark reader
ayo conclure what da dog doin
I got only a few because of all the tutorials
ya
:,)
real
Ah shii, been beaten
Well hopefully i can get some cool stuff once my little mod is done
you have more ratings though
Ah