#help-development
1 messages ยท Page 1064 of 1
bump
ItemMeta#spigot().setUnbreakable
buc og pvp game.
new pvp not Beautiful for 1.9+
Cooldown and Delay hit
That's literally all you get for the price of buggier software, more exploits, etc etc, there are plenty of ways to emulate 1.8 pvp on higher versions isn't there?
and bad kb
Hi, Im getting this error when shading the plugin, java version and jvm is 21
Unsupported class file major version 65
Gradle?
update shade plugin
update the shade plugin then
sniped gg ez
good job epic
kek
lynx is a prism user!?!?
obviously
good choice
Would anyone know why, when creating a new project (intelliJ / maven) the language level always try to default to 1.8? I use graal 21 for the jdk but it still likes to make me do extra work every time
Hey, any of you guys are experienced with packed related duping problems?
Some players use ui-utils to dupe items, we have some information but couldn't figure out how excatly they do that, if anyone can help me solve this I can pay good amount. I don't mean to make this sound like a job post just looking for help ๐
Usually the answer is always poorly coded menus / backpack / enderchest systems
is the correct way to move a lightning strike when it occurs to teleport it
it would help if you would share the information with us
not working
ItemStack stoneSword = new ItemStack(Material.STONE_SWORD);
ItemMeta meta = stoneSword.getItemMeta();
if (meta != null) {
meta.addEnchant(Enchantment.DAMAGE_ALL, 2, true);
meta.setUnbreakable()
stoneSword.setItemMeta(meta);
}
read it again
meta.spigot().setUnbreakable(true)
yes, ty.
magic
kekw
-
Only place player can place a chest is, their own "world" can think like a skyblock server
-
Also we are disabled dropping items in any way. So if player tries to drop item from a chest it goes to their inventory (We think its related to this and ui-utils but not sure)
-
So first thing the duper does it, goes to his world, places a chest, opens the chests (does something with the item he wants to dupe)
-
Logs out, logs in and items are duped in his inventory
-
Also we have instances so some people assume they somehow login to the server "twice" with some sort of mod/client
@blazing ocean have you got a clue?
what actually decides the name of the placeholder when using placeholderapi in your plugin
are you using maven
Is that code called async ?
can you show us the code on where the items get transferred back to the inventory?
pretty sure there's an IJ setting for maven lang level
I thought I looked maybe I didn't look hard enough
@worthy yarrow i think
I think I found the issue
you should give up on java and start learning to code in console
That's literally why we have you
yeah but i'm not around all the time
That's fine I'm patient :p
What's any persons purpose tbf
I feel its subjective
You may have more of a purpose in one situation than another
@blazing ocean how hard would it be to add an extra slot to the players inventory? Maybe an extra armor slot for cosmetic items?
I couldn't packet my way out of this?
no
shite
player inventories have fixed sizes
I know they do
e.g. armour, 4 slots, hotbar, 9 slots, main part 27 slots, offhand 1 slot
depends on what you mean by that
Idk if packets even really work here to display an extra armor slot or wtv
I mean you said they didnt
It's strictly supposed to be for a cosmectic slot
The idea was to fake a second chestplate slot to apply wings
well, by cosmetics i assume you mean something like retextured leather hourse armour, which can only be applied to a players head
not possible afaik
"How hard do you think it would be to make a plugin that generate a second offhand slot so players could equip wings/backpacks on their back?"
This was the question
13/10 on a hardness scale, on a good day
I guess I misunderstood the slot, but still the same concept here right?
Yeah that's basically what I told them haha
i have just realised that that sounds so fucking weird w/o context
how can I get the block the player is stepping on when jumping?
player.location.block is always air
try Math.floor(y) or something like this I don't remember exactly what I did for this
I just did -1 to the block Y
Is there any way to find chunk with some laggy stuff?
I assume he's doing this on playerMoveEvent being iteration may not be the best use here
For some reason the play button in intellij idea is greyed out and i cannot compile my plugin how do I fix
Ith you could just click the maven/gradle tab and compile there?
I've always just used the install option, haven't had an issue
Sorry, I mean compiling it to a jar file to upload to my server
Yeah that's what I do, then move it from the output directory to the server plugin folder
Or you could change the output path directly to the plugin folder
Maybe have to add a build configuration then?
some people can as well do package if they don't need to update the local repository
Doesn't the minecraft development plugin automatically do that?
I thought so
omg you upgraded to the new ui!!
Hey it suggested it to me
Maybe I accidentally deleted it or smth, is there a way to regenerate one?
Under the 3 dots it just says nothing here
If I go in general vc i can screenshare it
NEVERMIND
Got it?
nope apparently you can't screenshare in vcs
W update discord
or is it just this server
Usage: !verify <forums username>
!verify MrNameless666
A private message has been sent to your SpigotMC.org account for verification!
I'm screensharing intellij, can someone help me fix it
NO HE DID NOT
Just created a completely new fresh spigot plugin project using minecraft development and can confirm that is broken aswell
I think im gonna reinstall intellij
Use the maven tab
Send an image
The play button in top is greyed out its greyed out the same way in maven menu aswell
I can't really open it as i just uninstalled intellij
ill try again once i reinstall
These are all grayed out?
I reinstalled intellij and that prebuiltstructures folder is now visible and the play button is green again
I must have just deleted it at some point accidentally
kek well good that its back now haha
Aaand its gone again
as soon as i tried to load my plugin it went gray and bricked my intellij installation i think
wat the fuck
Thanks
will that still work if I add nms to the project?
Yes
yes
That's just how you compile the project
All it's doing is telling Intellij to run mvn package
Never seen a more glorious sight
What do you mean?
It should just look like this, minus the remapped
Short little showcase of the plugin
@floral drum
?
are you actually ticking or just altering the time?
Unrelated dw
by ticking do you mean /tick and if yes then no
ie plants grow at a faster speed too
its changing the time but this is a server im working on and im gonna be changing how plants grow anyway
also using /tick has a limitation of 20x slower than default whereas this doesn't
so if i wanted to make the minecraft day last 24 real life hours i could
why doesn't this work: https://paste.md-5.net/iramapavil.java
Do you ever .replace the placeholder?
Isn't that only for plugins that use placeholders, my plugin is creating custom placeholders
Well if you're expecting a valued result from %cycle_time% within your plugin, you'd still have to do that
guys i want to make my plugin for other java versions too. my project's java version is java 17. but i want it also works on java 8 , java 11, java 21. how can i do it
The placeholderapi wiki never mentions replacing anything, how do i do that
Oh you're doing placeholders through papI/
uh
Maybe you don't have to then, another plugin can just hook papi and figure your placeholders from there yeah
Same as you btw
Use Java 8
Well compile to Java 8
You might need a newer jdk for it to understand certain classes
but i must make project java version java 8 for multi java versions. is it true?
other plugins work from 1.8 to 1.20 . i want it
You can mix java versions in the same project by using maven/gradle modules
The majority of the code will probably be written in Java 8 though
Since that's what 1.8 uses
Damn support all the way back to 1.8 sounds like a fcking task
Some people enjoy being miserable lol
I don't need build tools if I am using the spigot maven repository, right?
IntelliJ?
Yes
iirc don't think so
Oh update intelliJ
Update IJ
btw you still helping that geopol @alpine cairn ?
Which one?
EPirate?
yeah
Server died
This may be silly but how do I update Intellij?
I just did it from the site
But it should be within intelliJ somewhere
should with a grain of salt
Gotta fit all those other QOL buttons into the ide man
Personally I just use toolbox
Ah gotcha
If I want to temporarily change an attribute should I change the base attribute or the modifier?
whats the best way updating a mongo document? (like changing 1 stat inside a document)
Base ith
Both are valid ways
Well it depends on context
yeah ig its the same thing either way
It depends on how you want it to work
Might be easier to change the modifier or the base kinda design choice
It's not quite the same thing
Just checking for a playerMoveEvent, changing it, then changing it back
I'd argue for base in most cases
So like do enchantments and what not use the base or modifier methods?
Depends on the enchantment
Say like sharpness for a sword, that would be modifier right?
nw
How can I remove the PDC data from a entity?
Bu that will remove full key yeah?
yes
but the rest of the entities I have with that key will still have the data?
Yes
how can i change a mongodb document value?
Might have been updateOne and updateMany
i did read i just need an example on how to use it
They give examples?
i still don't understand, thats why i asked here
Should probably learn the craft a bit more then
im just new to coding and i only asked how to update a document, not anything else
Right so as being new to coding, you should probably learn a bit more of coding right?
Before taking on complex tasks I mean
i know of course i wanna learn more because i wanna know how to use database properly
is editing a document a complex task?
I wouldn't say that complex, it all takes time and experience so the best thing anyone can suggest is to keep trying
Not a lot of people like to spoonfeed here
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
is it spoonfeed? i already know how to use some of the database methods, delete, create i just can't figure out the update so i ask help to know more
Well from what I've read you've gone over the docs so I would think probably
The Mongo docs give code examples
He's confused on the examples
me teaching my nephew how to modify a database
Idk what time say then
Hello everyone, got a quick question here. looking through old code on github. why do people pass instanced classes to the listener class?
this.afkManager = afkManager;
}```
Maybe they need to perform operations that require an instance of that class within the listener
is it bad to do this?
Not really
What part are you having troubles with?
Depends on your design
no you should do it
i'm just trying to edit a key in a mongodb document
Proper oop, you'll follow separated concern principal in your design
i've just never seen it done like this. but if thats an easier way to store instances then i guess i could learn that lol
but im also new ๐คทโโ๏ธ
thanks for the information
Yes and what's the problem?
this is how godot recommends you do singletons for their classes in game dev fyi
it's pretty common
isn't your beard suppose to be longer?
i don't know how to do that, i tried looking at docs but i can't understand the examples there
bud how long of a beard do you think I need to have
I'm already halway to gandalf there
I am pretty sure you trimmed it
since? yes
@torn shuttle im still learning. thats why i come to the people that know lol. a dumb question is dumb but more knowlege to me
yeah, so it wasn't as long as I remembered it being XD
it gets weird when you're doing it with c# and a game engine
Be more specific what don't you understand about the example
Beard looks good man idk what these goons are on about
the longer the beard the more wise you are supposedly
unity has different recommendations iirc but it's been a while
it was slightly longer some time ago and basically was just confirming if it had been trimmed
oh does anyone know why paper has AsyncPlayerChatEvent deprecated?
I mean hey it looks quite good
right now I have it way trimmed
yeah it does, didn't say it looked bad
just its shorter is all
also had to make sure my memory wasn't faulty either
everything to do with chatevent actually.
Tbf that original comment just came out of my ass
oh so you are not a nice person
I think the beard looks good
that is way too short
I think the longer looks better for sure
oh they just want you to use their ChatEvent. nevermind
everyone's a critic
my god are you a handsome fellow
See, critics everywhere
Can someone help troubleshoot my custom time plugin, I added a calendar feature to it but the return value of getFormattedTime() is always the same:
https://paste.md-5.net/merimixoku.java
https://paste.md-5.net/ejisekulit.java
just the avg spigot dev
then how low do I place?
and who the hell goes beyond this?!
have not
I've never seen md5
there he is
Idk if md5 works out that much
https://streamable.com/wcr8lr I miscalculated
and have no idea how to fix
he's the least buff spigot dev too
will just make it a clock hand
I've been going to the gym every other day, matter of fact today is arms & shoulders day
how is that possible?
I just do calesthenics and cardio by running with mah dog
still doesn't fix face tho
you've never seen a spigot developer meetup?
gotta be born with that
have not
never
there must be a pattern
gotta do a study on spigot deving and working out
If you use spigot api, you are automatically pumped full of steroids and for some reason want to workout 22/6 (we leave the other time for programming)
if you can't program while lifting you're not even a real spigot dev
I'm constantly lifting my soul up
Well that's not to say we don't, it's just better to allocate some time specifically for programming
but gotta free it too to prevent OOME
I actually managed to get under 91kg for the first time in a while today
how tall are you @torn shuttle
6'1
I am like literally the same
beef cake ๐ช
nice
Well
I think I'm like 10 cm shorter
@grim hound so you are shrinking already?
I'm 16
That is even worse
you still got time to grow up and be a real boy
bruh
Already shrinking before you got to be an adult a shame
brother I'm not pinocchio
Brother you are using cat ears
weird your pfp's nose just grew
I'm 5'6 at 18 I don't know if I'll grow anymore
you are gay
no 198 cm?
my pfp is wearing a mask
ok dream
no it's not like that-
You are the one that said you are 10cm shorter but not sure what my cat ears have to do with this
I just once found a cool skin when using /skin with skinsrestorer
and I did /skin Paint
and kept using it from that day
LOL
and two people drew the character for me
ok dream
What if they cant?
bump
Then they are not getting enough rem sleep
than the guy
not compared to my past self
please, guy was my father, call me magma
I don't get that reference
that's fine I'm sure it got a laugh from the target audience
Can I just say that I laughed?
I don like being the non-understanding guy
cmonn
explain
The only movie I can think of is rushmore
Compiling Spigot & Spigot-API
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Child module C:\Users\Codin\SpigotBuildTools\Spigot\Spigot-Server of C:\Users\Codin\SpigotBuildTools\Spigot\pom.xml does not exist @
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.spigotmc:spigot-parent:dev-SNAPSHOT (C:\Users\Codin\SpigotBuildTools\Spigot\pom.xml) has 1 error
[ERROR] Child module C:\Users\Codin\SpigotBuildTools\Spigot\Spigot-Server of C:\Users\Codin\SpigotBuildTools\Spigot\pom.xml does not exist
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\Windows\system32\cmd.exe, /D, /C, C:\Users\Codin\SpigotBuildTools\apache-maven-3.9.6/bin/mvn.cmd, -Dbt.name=582a, -P, remapped, clean, install]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.runMaven0(Builder.java:936)
at org.spigotmc.builder.Builder.runMavenServer(Builder.java:905)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:683)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
am I the only one
try to remove all your buildtool files
do you have to create the configurationSection and save it before adding it?
getConfig().createSection("Homes");
getConfig().set("Homes.Current homes", 0);
getConfig().set("Homes.Allowed homes", 0);
this.saveConfig();```
When i do this it saves as
```Homes:
Allowed homes: 0
No you don't
You can just set whatever path you'd like and it creates sections that it has to automatically
Not sure why it does that for you. As a rule for myself I don't use spaces in config paths
So I'd do something like allowed-homes instead
But that doesn't seem to be the issues
Since Allowed homes saved
its always done that for me lol, i've always done a workaround and saved the section before adding
It just seems kinda dumb to have to do that
That's not the case
Friends, what should I do to prevent the /lf subcommand text every time a command is used in the plugin I developed?
What version did you update to
And what JDK are you using
Try invalidating caches
Not sure how to do that
I see it
It's actually JDK 21
Invalidating caches didn't work
But I didn't check any of the optional boxes
Hmm other than that make sure your project version and language level is correct
Canโt think of anything else
I don't need the build tools if I have the Spigot API imported with the .pom, right?
You have to run BuildTools if you want to develop with spigot. The repos are installed to your local repository through the tool.
You need build tools to have the dependency
Is your language level set?
How do I check that?
Anybody have a clue?
@drowsy helm why so toxic?
xD
He answered your question lol
i know i dont but what about you?
?
"No, you don't [need to create a configuration section before adding it]"
why do people always think im attacking them
maybe its how i type
You're definitely attacking them
Okay let me rephrase
Does that make sense in relation to "anybody have a clue" or does it make more sense that it'd be an answer to your original question
Hello mrarcane, I have a clue on the answer to your question! No, you don' need to createa a configuration section before adding it.
chatgpt response
I'm use to an old forum called rune-server where people were just toxic, knew the answer just being an ass lol
it's called Hanlon's razor
"Never attribute to malice that which is adequately explained by stupidity."
so sorry i misread that @drowsy helm i now know your intentions were good.
lel
anways, i think its not setting the other one because the field name
not sure if you're supposed to have spaces
yeah supposed to be underscores or hyphens
i removed the spaces taking the advice, still does the same thing lol
i feel like its removing the memory when i create the new section
Good
getConfig().set("Coins", 0);
nice
getConfig().createSection("Homes");
Why you do dis
getConfig().set("Homes.Current-homes", 0);
your not even there ^
getConfig().set("Homes.Allowed-homes", 0);
Oh hey theres something to add ^
this.saveConfig();
You donโt need the create section
The following set calls should handle creating it
Yeah that's what you've got written
it doesnt have Current-homes
wat
yeah it now looks like getConfig().set("Coins", 0); getConfig().set("Homes.Current-homes", 0); getConfig().set("Homes.Allowed-homes", 0); this.saveConfig();
its like once it sees a new section its like "remove old memory"
try set a third one
does that overwrite all of them?
or set it to a value that isnt 0
does anyone know how to remove a component from an item (remove the jukeboxplayable component from a disc to make a base item) (using paper 1.21)
getConfig().set("Homes.Current-homes", 0);
getConfig().set("Homes.Allowed-homes", 0);
getConfig().set("Billy mays", "But wait theres more!");
this.saveConfig();```
it just adds the last.
ill try to make the values 1
@wise fiber meta.getPersistentDataContainer().remove(new NamespacedKey(this, "jukeboxplayable"));
what would "this" be referencing?
plugin
yeah, just grabs the last.
public ItemStack removeJukeboxPlayableComponent(ItemStack item) {
if (item == null || item.getType() != Material.MUSIC_DISC_11) {
// Ensure it's a valid music disc
return item;
}
ItemMeta meta = item.getItemMeta();
if (meta != null) {
// Remove the jukeboxplayable component
meta.getPersistentDataContainer().remove(new NamespacedKey(this, "jukeboxplayable"));
item.setItemMeta(meta);
}
return item;
}
ok so "this" is ItemStack?
I don't get it
wtf
would using the plugin make it use the plugin as the namespace
ill give that a shot
Really weird
you can get the minecraft or bukkit namespace instead
declaration: package: org.bukkit, class: NamespacedKey
yeah i thought something was funky abt that
i see
ive always had this problem, even back in 2020
Itโs probably just ItemMeta#setJukeboxPlayable(null)
ItemMeta im = item.getItemMeta();
im.setJukeboxPlayable(null);
Celestia.getInstance().getLogger().info(im.getJukeboxPlayable()+"");
item.setItemMeta(im);
"CraftJukeboxComponent{handle=JukeboxPlayable[song=EitherHolder[holder=Optional.empty, key=ResourceKey[minecraft:jukebox_song / minecraft:13]], showInTooltip=true]}"
seems to not have worked
i can still place the disc into a jukebox
Would this be doing it?
this.dir = dir;
this.name = name;
getConfig();
}
public FileConfiguration getConfig() {
file = new File(Main.instance().getDataFolder() + File.separator + dir, name + ".yml");
//See if the Folder String exists.
if (dir == null) {
file = new File(Main.instance().getDataFolder(), name + ".yml");
}
//If the file doesn't exist.
if (!file.exists()) {
file.getParentFile().mkdirs();
try {
file.createNewFile();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
//Finally load the config
config = new YamlConfiguration();
try {
config.load(file);
} catch (IOException | InvalidConfigurationException e) {
throw new RuntimeException(e);
}
return config;
}
public void saveConfig() {
try {
config.save(file);
} catch (IOException e) {
throw new RuntimeException(e);
}```
this is how i store data pretty much
i just super from this class.
Hello again, is it possible to have all these built jars in the target folder go to one centralized folder?
Im using maven
have a distribution module and shade them all in
oh wait target folder
We have that set up at work, not sure how it's done on maven
thanks illusion
yeah but that only copies over the original verison of the jar
good ol' gradle
maven ftw imo
pretty sure its an option on the shade plugin iirc
let me do more digging
I did it on one of my projects, Iโll chrck once I get home
kk
why not do it, like, properly
I have updated Intellij to the most recent version, made sure the .pom was correct and reinstalled buildtools and manually added the jar as a dependency but still no materials are being recognized. What am I doing wrong?
I didn't set it up, blame my lead dev
Manually added the jar ?
You cannot use maven and manual dependencies in the same time
When you add spigot to the pom, do you compile with maven?
I... don't know?
what does that entail?
this is why build engineer is an actual job position lmao
Are you saying I don't need build tools if I use maven and the Spigot API?
Not getting a clear answer from ppl
does anyone know the default sprint value for this? https://wiki.vg/Protocol#Player_Abilities_.28clientbound.29 the .1 value i believe is the default non-sprinting value
To recap: I have been told I don't need build tools, just maven, I have been told I need both, and I have also been told I can't use both at the same time. Tried all of them and I'm still staring at this thing telling me that IRON_HELMET can't be resolved.
You need to run BuildTools for the version you want to develop for.
Make sure you depend on the spigot-api artifact if you donโt need nms.
Then reload your pom.
I ran it and produced the jar, but it didn't seem to change anything.
I tried changing the pom to just spigot then back to spigot-api, no dice
So this might be a silly question but how does Intellij find the BuildTools without the jar being manually assigned as a dependency?
Do the build tools have to be run in the actual folder for the local maven repository?
BuildTools installs the spigot api to your local maven repo.
IntelliJ looks at your local maven repo and lets you use spigot since it was installed.
can we see your pom
How do I do the thing for pasting code?
java: cannot find symbol
symbol: variable IRON_HELMET
location: variable MATERIAL of type org.bukkit.Registry<org.bukkit.Material>
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
ngl I don't even know what that is
Update IntelliJ
he already did
I was able to get it to place nice by importing just that item but that means if I need to reference a whole bunch of items I need an import statement for each one, which doesn't seem right.
import static org.bukkit.Material.IRON_HELMET;
I may have been doing the first one
Is that deprecated?
Oh
It's just this one line really
if (p.getInventory().getHelmet().getType() == IRON_HELMET) {
First I was doing MATERIAL.IRON_HELMET
And I used the import that it gave and it wouldn't find it
ye
oddly enough when serialized, an item spawned with [!minecraft:jukebox_playable] will have an error message when serialized unhandled: H4sIAAAAAAAA/+NiYOBikFbMzcxLTS5KTCuxyirNTk3Kr4gvyEmsTEzKSWVgAABkGencIwAAAA== removed: - minecraft:jukebox_playable
and it will work when reserialized, the error message seems to be consistent between items, but cannot be added to items that did not serialize with it already enabled
I still cant seem to find a way to do the [!minecraft:jukebox_playable] within a plugin though, sadly
erm
The spigot forums lied to me
Unreal
alr I definitly feel dumb for that one
I mean at first I did actually have to update
actually it might not be an error message, hard to tell since ItemMeta is an interface so it doesnt show what serializing actually does
Seems like a bug, you should make a ticket
?jira
Ideally nothing should be unhandled
is there a particle plotter website for spigot?
nvm found one
i dont think theres a spigot one
but it lets u visualize what it would look like at least
ok i made one
i still cant find anything about removing the jukebox_playable component in a plugin
the closest i got was setting the jukeboxplayable component to null like you said
but that seems to not edit the ItemMeta whatsoever
what the hell did I even do
I broke something and I have no clue how
my http requests are now bodiless
can u play the nether portal animation to a player
does anyone here have an example of a multi-module gradle project? trying gradle out for the first time and im lost lmao
You can take inspiration from this blogpost from alex https://blog.jeff-media.com/maven-multi-module-setup-for-supporting-different-nms-versions/
thats maven
My bad I'm tired
as.setBasePlate(false);
as.setCanPickupItems(false);
as.setCustomNameVisible(false);
as.setVisible(false);
as.addPassenger(player);
// Velocity to set Armor stand backwards + upwards
as.setVelocity();```
I'm currently trying to use .setVelocity() to do what the comment says, any help? I'm having trouble trying to understand how it works
Do you have basic understanding of Vectors?
ah mb, just got it working sorry lol
Why do you need to put the player on an armorstand tho?
was gonna have it so that when the player dies they get put on an invisible armorstand which moves backwards from the death location as a way of zooming out from where it happened
Though I wasn't sure if moving the player themselves or using an armorstand to control the movement would be more effective
putting them as a passenger is probably easier and more consistent
If you want to control the actual view of the player I would recommand using a boat. Usually the transitions are more smooth
You could teleport the boat instead of actually applying velocity. It will allow you to control better the effect
ty
while youre here, is there a big diff between kotlin and groovy dsl?
okay im restarting then lol
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
can someone point me to the guide that covers how to move files from the resources package to a directory? I haven't done that in years and I don't remember how it's done
but some features that java 8 doesnt have will be problems for java 8 versions. i dont understand
I think Plugin#getResourseAsStream is what u want
I think it's Class rather than Plugin
And then u can pass it to Files.copy
p sure plugins have that too
Do they?
oh hell
Usually it's a java method on the class class
half remembered this thing from like 5 years ago
oh damm
Neat lil utility in bukkit
Its just a shortcut to classloader -> getresource 
Lmao
Which is why you don't use them
fun toNMS(c: CustomPhase): AbstractDragonController {
return object : AbstractDragonController(this) {
override fun getControllerPhase(): DragonControllerPhase<out IDragonController?> {
try {
val constructor: Constructor<*> = DragonControllerPhase::class.java.getDeclaredConstructor(
Int::class.javaPrimitiveType,
Class::class.java,
String::class.java
)
constructor.setAccessible(true)
val enderDragonPhaseInstance: DragonControllerPhase<*> = constructor.newInstance(
8,
c.javaClass, "MyCustomPhase"
) as DragonControllerPhase<*>
return enderDragonPhaseInstance
} catch (err: java.lang.Exception) {
err.printStackTrace()
}
return DragonControllerPhase.HOVER
}
override fun d() {
c.start()
}
override fun e() {
c.stop()
}
override fun a(): Boolean {
return c.isSitting
}
override fun b() {
c.clientTick()
}
override fun c() {
c.serverTick()
}
override fun g(): Vec3D {
return Vec3D(-509.0, 9.0, 1173.0)
}
override fun f(): Float {
return c.flyingSpeed
}
}
}
fun setCustomPhase(c: CustomPhase) {
val nmsPhase = toNMS(c)
try {
DragonControllerManager(this).setControllerPhase(nmsPhase.controllerPhase)
} catch (err: IndexOutOfBoundsException) {
err.printStackTrace()
}
}
setCustomPhase(CustomPhase(entity as EnderDragon))```
there are no errors, but the dragon still does not fly at the specified coordinates
pls help
beautiful names
Please use mojang mappings
hello
hello
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.suffren.src.Main.getCommand(String)" is null
my main:
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Objects;
import me.suffren.src.Commands.testCMD;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
System.out.println("My plugin is enabled!");
getCommand("tuto").setExecutor(new testCMD());
}
@Override
public void onDisable() {
System.out.println("My plugin is disable");
}
}
did you put your command in plugin
yml?
yeah
You forgot to put the command in your plugin yml
not for versions below 1.17, what about my problem?
Send it
version: '1.1'
main: me.suffren.src.Main
description: a plugin for my private server in 1.21
api-version: '1.21'
bootstrapper: me.suffren.src.MainBootstrapper
commands:
test:
description: tuto
permission: admin.tuto
permission-message: Tu ne peux pas utiliser cette commande!
my yml
?nohello
test != tuto
the command is called test not tuto
i replace by tuto ?
I am sorry I am not familiar anymore with those versions
use the same name in both places
version: '1.1'
main: me.suffren.src.Main
description: a plugin for my private server in 1.21
api-version: '1.21'
bootstrapper: me.suffren.src.MainBootstrapper
commands:
tuto:
description: tuto
permission: admin.tuto
permission-message: Tu ne peux pas utiliser cette commande!
[09:48:39 ERROR]: Error occurred while enabling MyFirstChest v1.1 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.suffren.src.Main.getCommand(String)" is null```
Did you recompile correctly? And did you restart the server?
It seems the plugin.yml was not updated in the jar file
I have to recompile it every time? because I only did it when creating my server ?
Yes
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Yes
okay
Looks fancy
it's called fart we do a little fart
lol
pretty sure there is hot reloading
if configured properly
Hey
Does Player#hidePlayer() work for self player?
Or do we need to send remove, respawn & add packet?
probably yes
?tas
Not sure you can write a file like that that is inside of the resource folder
Why would you even change something inside of compiled jar
mfo I'm clearly not doing that
Mmm you are
Was about to say that
it has the main method
You are getting the resource inside resources folder
This file is present in jar file
You are trying to edit the jar file itself
Yeah, you can't do that easily
This is like trying to perform a surgery on yourself
^
but when running main it doesn't actually compile to a jar
It does
It sure does
or does it simulate it?
You just don't see it
is it like runtime stored?
It's mostly cached somewhere
yeah it doesnโt always, i mean it compiles the classes but doesnt necessarily bundle them to a jar
esp if u just run a random main method somewhere in intellij
(So its a bit weird, if u run it in ur ide u may be able to edit files directly in ur project, but then when you compile it to an executable jar it may work a bit differently)
I mean, it's not weird, that is just how the classpath works
yea well, u still get the code โonceโ, debug everywhere experience
I have not debugged my code under windows for a very long time now.
Meh, noone uses my software anyways
Donโt you write unit tests?
Or integration ones w/e
Only if I am trying to fix a very particular issue or testing something I barely understand
Most of the time I make tests in the form of an interactive interface or a standalone CLI tool
yea, i remember ur concurrency code being surrounded w tests, so I mean that sort of acts like a preemptive way to catch bugs
fair enough
That was mainly because I discovered /something/ was buggy and had to narrow down what exactly it was without restarting the actual application 10 times in a row and redeploying the maven artifact and all that jazz.
However for other datastructures such as https://github.com/Geolykt/FastStar/blob/2b898e28b8d14d381a75b00240194c96a33e75ad/src/main/java/de/geolykt/faststar/intrinsics/SpatialQueryArray.java I don't do tests as in this case the algorithm behind it is just stupidly simple.
yea, for data structures benchmarks become far more interesting i suppose
Hey, how can I change a player skin?
I've searched forums and looked at some plugins' code but I couldn't figure it out
On Paper I just do Player#setPlayerProfile() but I'm not sure on what'd be the equivalent of it in Spigot
I also realized that using async-profiler instead of proper benchmarks is quite a bit easier - especially once you wrap async-profiler in a nice UI in-game
There is a profile api on spigot also
i think it can be used equivalently to what uโd in paper
But no Player#setPlayerProfile()
And no Player#getPlayerProfile() etc, you have to do some workarounds, and I couldn't figure them out
Is there a basic example code that changes skins?
There is
Unless youโre on an old version allegedly
Yeah, on recent versions https://hub.spigotmc.org/javadocs/spigot/org/bukkit/OfflinePlayer.html#getPlayerProfile() exists
Other than that there is no setPlayerProfile, how would that work?
It probably does not return a clone
im sorry but nms it is for you then (or paper or some other lib)
I'm looking for a reference, so that's ok
That's what I'm looking for haha
Only the texture is mutable though
And that's what I'm looking for xd, good to hear
I see
After that do I do Player#hidePlayer() and Player#showPlayer()?
How you are supposed to obtain a PlayerTextures instance is a bit beyond me though
maybe - maybe not. You'll have to look at that
That's what I'm confused on sadly
I mean, you probably don't need to get it right the first try anyways
iirc
U get a fresh profile and that gives u a fresh texture to play around with
maybe thereโs just a static factory method somewhere u could use also to get a texture instance
You probably can just mutate the PlayerProfiler#getTexture method - however that one can be null so yeh
@NotNull
PlayerTextures getTextures()
Gets the PlayerTextures of this profile.Returns:
the textures, not null
Documentation 100
why on earth did I read or null instead of not null
Probably because explicitly defining non-null behaviour is rather uncommon I guess
Also, is PaperMC not liked around here?
Why would you think it isn't liked?
Not liked is relative - it's more that this is the spigot discord and paper has it's own discord you can ask help in
However there are a few people that take this philosophy to the extreme - I'm honestly not fond of completely ignoring alternative solutions but oh well.
Got it
Also PlayerTextures takes an URL
I have my own texture and signature value
How do I pass it there?
I'm using Mineskin if it helps
it probably is some arcane way of encoding the URL (Base64 perhaps?)
Mineskin appearently returns URL, I'll use that
But thanks for your reply
Also, if we don't specify a cape using setCape, no cape is loaded, right?
most likely
Especially since it's @Nullable
I don't see a way to set signatures
probably not necessary then
How is it not necessary tho?
It's something required by Yggdrasil if I remember
Does YamlConfiguration support cyrillic or any other alphabet other than the Latin one? because in the console this is happening [13:06:04] [Server thread/WARN]: while parsing a block mapping [13:06:04] [Server thread/WARN]: in 'reader', line 3, column 3: [13:06:04] [Server thread/WARN]: NoPermissionError: '&cโจะญโคะโจโโจโโคะโจโก โคะโจโโจโ ... [13:06:04] [Server thread/WARN]: ^ [13:06:04] [Server thread/WARN]: expected <block end>, but found '<scalar>' [13:06:04] [Server thread/WARN]: in 'reader', line 443, column 38: [13:06:04] [Server thread/WARN]: ... esDesc: "&8โจะญโจโโจโโคะโจโโจโโจโกโคะโจโก โจโโจโโคะโจโโคะ โจโโจโโคะ "โจโคโจโกโจโโจโกโจโ โจโโจโโคะโจโ โคะโคะโจโกโจโโจโ"." My code for loading is quite standard https://pastebin.com/PU4A3Mq2
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Try it out and see I suppose? I can't quite imagine how it's not exposed if it is required.
Probably because the signatures for the minecraft texture server are the same? But I have never experimented with it
Use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/file/YamlConfiguration.html#loadConfiguration(java.io.Reader) instead with Files.newBufferedReader(path, StandardCharsets.UTF_8)
Hey
How do I turn value and signature to URL again?
Decode it and get URL by parsing it as a json?
can someone tell me why gradle thinks i have a module called untitled, despite it not being mentioned anywhere
i've deleted my .gradle and .idea, ran gradlew clean
i have no clue how to get rid of it
Do Ctrl+Shift+F and search for untitled
yep not there
File>Project Structure
not there either
Did you click modules there?
yep
Have you tried to invalidate cache and restart ?
Hi All,
I used to be quite a proficient developer 2 or more years ago, leaving from massive burnout from a large project. I have the itch to get back into it and finish this project (which will probably have to be restarted) but I find it really daunting to get back into it as I've forgotten so much down to the very basics. Where should I look to re-fresh my knowledge?
oh hey i remember you zoibox
I need to break these two rules
welcome back
reflection
how?
new URL("https://host/path")? Signature is probably irrelevant
but honestly just check out spigot wiki, but the most help is just jumping straight in tbh
how would you override a final method with reflection?
I did it by parsing json, so kinda what you said
But I got an issue, if I do Player#hidePlayer() to myself it doesn't work
you can remove the final flag and set it's value
Without AT, AWs or comparable - not possible.
METHOD
what?
what's that?
I'll have a look there! I was one of the few still stuck in the old ways in 1.8 but it's only that I've seen recently how many people have really moved on from 1.8 and are on newer versions. The server content possible on newer versions in incredible, its closer to bedrock then ever before
I need to override this
You could do some extreme shenanigans with hotswapping and mass ASM, but that's a bit on the extreme side of things
any bytecode manipulator
never understood asm that well
but it's the only one I've ever used
Hm right, you could do the old-fashioned hotswap agent there without the need of mass ASM - but you can only do callback listeners, but manipulating the access flags is out of reach
why is that?
also I'd need to call the original method if determined so
Hotswapping only allows to mutate the contents of the methods, but not any other metadata.
Unless you are using DCEVM or comparable - which people generallyc don't use in production.
depends on the agent being used
you could technically drop all the classloaders if you use an appropriate agent but then we start getting in the realms of unsafe lmao
For hotswapping, that's completely impossible. If you mutate the class before it's being classloaded then yes everything is allowed
uh
that's akin to restarting the server
I just need to override one variable
Might as well modify the server jar
This is funny
How can I download a full dependency javadoc from intellij (using Gradle)
asm sounds the most familiar to me
does PlayerPickupItemEvent trigger if the player is given an item?
asm is msa backwards
what the hell is msa
With hotswapping you could just insert
ALOAD 0
INVOKESTATIC InjectHandlerClass.handleAccept(Lmy/target/Class;[Z)Z
IFEQ label
RETURN
label:
Which would be roughly equivalent to a conditional @Override. However actually attaching the hotswap agent is not something I have experimented much with especially since in the future this won't be supported by the Java runtime.
what the hell is that
asm backwards
that makes sense
The Pakistani maritime security agency
java bytecode?
It's roughly equivalent to
if (InjectHandlerClass.handleAccept(this, addr)) {
return;
}
yes, but that is not an option as they probably still intend on writing a plug & play plugin
Blame ron
Ronald McDonald?
uh
Ron pressler
why the label tho
Thatโs for the if
Because otherwise it'd be an unconditional return
ah
so
how do I use this?
to override a final method
and if it ain't gonna be supported
is using ASM possible?
That is asm
that'd involve using ASM. However it'd be ASM with extra steps as you also need to attach a hotswap agent - something I can't quite guide you with in it's entirety, but there should be plenty of guides out there in the wild (though most of them will probably involve bytebuddy or javassist - if you'd like to not shade in a massive dependency, skip over those)
why can't it just be asm by itself?
how can i disable put lava bucket on water?
ASM by itself just mutates a byte-array describing the class. However, you'd need to tell the JVM to forget the current bytecode of a class and instead use different bytecode (= hotswapping)
You need a java agent for asm to work
Which either involves a command line argument or runtime attaching
Latter will inevitably be patched out of the JVM
Indeed
just like Unsafe?
Sadge
Yeah
In fact, I believe runtime attachment currently only involves using Unsafe? I'm not too familiar with the hacks needed for this
Integrity by default
Hiding a random raw byte[]-transformers should probably be a bit saner and avoid people abusing it from all the wrong reasons
so what would be the best way to override a final method?
Rewrite the jvm
it's class is already loaded
and in constant use
Use ignite and modify before use/load
it's already in use
Either recompile it, rewriting the class where the final method is located in (what I described prior) or by rewriting all references to the class and/or method
and it's loaded
Won't be if you use ignite
I can override all of the references
Hi guys
Is there a way to make the fishing rod push system like this way at this video?
https://streamable.com/rs10hi
thanks โค๏ธ .
Then that's a feasible approach that wouldn't involve hotswapping
but how can I
you know
create a class that'd be treated normally by the jvm
just like the original class
but with a different a bit bytecode
of the final method
the method is in io.netty.channel.unix.Socket
You don't create a new class, you just change what the current class is
and the package-private extension of it that's used is io.netty.channel.epoll.LinuxSocket
but how exactly?
That's the entire gimick of hotswapping - although it's primarily for use in debugging, but you can abuse it for other reasons
but
how
do I
rewrite
a final method
As I said, I never did that
I still don't know
Attach a javaagent and we can go from there as that'd return us to territory I'm familiar with
what is that?
A program that bootstraps mixins