#help-development

1 messages ยท Page 1064 of 1

worthy yarrow
#

No I meant

#

why are people still devving and using ancient technology

sterile flicker
#

bump

remote swallow
#

ItemMeta#spigot().setUnbreakable

turbid lodge
#

new pvp not Beautiful for 1.9+

#

Cooldown and Delay hit

worthy yarrow
#

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?

turbid lodge
#

and bad kb

quaint mantle
#

Hi, Im getting this error when shading the plugin, java version and jvm is 21
Unsupported class file major version 65

eternal night
#

Gradle?

quaint mantle
#

nop

#

maven

remote swallow
#

update shade plugin

eternal night
#

update the shade plugin then

remote swallow
#

sniped gg ez

eternal night
#

petTeawieUwU good job epic

worthy yarrow
#

kek

remote swallow
#

lynx is a prism user!?!?

eternal night
#

obviously

remote swallow
#

good choice

worthy yarrow
#

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

clever spear
#

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 ๐Ÿ˜„

echo basalt
#

Usually the answer is always poorly coded menus / backpack / enderchest systems

hushed spindle
#

is the correct way to move a lightning strike when it occurs to teleport it

hybrid spoke
turbid lodge
# remote swallow ItemMeta#spigot().setUnbreakable

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);
}

remote swallow
#

meta.spigot().setUnbreakable(true)

turbid lodge
#

yes, ty.

grim hound
#

how the fuck

grim hound
#

HOW DO THEY JUMP LIKE THAT

#

HOW

blazing ocean
#

magic

grim hound
#

these fuckers straight up

#

change magically

#

is it just log4j skipping logs?

blazing ocean
#

kekw

clever spear
# hybrid spoke read it again
  • 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

worthy yarrow
split tinsel
#

what actually decides the name of the placeholder when using placeholderapi in your plugin

blazing ocean
#

are you using maven

hazy parrot
hybrid spoke
blazing ocean
#

pretty sure there's an IJ setting for maven lang level

grim hound
#

then yes

worthy yarrow
grim hound
#

on 1 thread

#

that isn't the main thread

blazing ocean
#

@worthy yarrow i think

worthy yarrow
#

I think I found the issue

blazing ocean
#

you should give up on java and start learning to code in console

blazing ocean
#

damn

#

you can't code in console

#

and don't even want to learn it

#

what a loser

worthy yarrow
#

That's literally why we have you

blazing ocean
#

yeah but i'm not around all the time

worthy yarrow
#

That's fine I'm patient :p

worthy yarrow
#

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?

blazing ocean
#

impossible without mods

#

data driven inventories when

worthy yarrow
#

I couldn't packet my way out of this?

blazing ocean
#

no

worthy yarrow
#

shite

blazing ocean
#

player inventories have fixed sizes

worthy yarrow
#

I know they do

blazing ocean
#

e.g. armour, 4 slots, hotbar, 9 slots, main part 27 slots, offhand 1 slot

worthy yarrow
#

I just assumed you could fool the client

#

w/o mods anyway

blazing ocean
#

depends on what you mean by that

worthy yarrow
#

Idk if packets even really work here to display an extra armor slot or wtv

#

I mean you said they didnt

blazing ocean
#

well

#

you could do resource pack fuckery

#

that could work

#

somewhat

worthy yarrow
#

It's strictly supposed to be for a cosmectic slot

#

The idea was to fake a second chestplate slot to apply wings

blazing ocean
#

well, by cosmetics i assume you mean something like retextured leather hourse armour, which can only be applied to a players head

blazing ocean
worthy yarrow
#

"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

blazing ocean
#

13/10 on a hardness scale, on a good day

worthy yarrow
#

I guess I misunderstood the slot, but still the same concept here right?

worthy yarrow
blazing ocean
worthy yarrow
#

kek

#

๐Ÿ“ธ

quaint mantle
#

how can I get the block the player is stepping on when jumping?

#

player.location.block is always air

worthy yarrow
#

try Math.floor(y) or something like this I don't remember exactly what I did for this

quaint mantle
#

I just did -1 to the block Y

kindred sentinel
#

Is there any way to find chunk with some laggy stuff?

worthy yarrow
#

I assume he's doing this on playerMoveEvent being iteration may not be the best use here

split tinsel
#

For some reason the play button in intellij idea is greyed out and i cannot compile my plugin how do I fix

worthy yarrow
#

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

split tinsel
#

Sorry, I mean compiling it to a jar file to upload to my server

worthy yarrow
#

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

split tinsel
#

But the button is grey for me and cannot be clicked on

#

on both of them

worthy yarrow
#

Maybe have to add a build configuration then?

lilac dagger
#

some people can as well do package if they don't need to update the local repository

split tinsel
#

Doesn't the minecraft development plugin automatically do that?

worthy yarrow
#

I thought so

blazing ocean
worthy yarrow
#

Hey it suggested it to me

split tinsel
worthy yarrow
#

Maybe here?

#

If you get the 3 buttons anyway

split tinsel
#

Under the 3 dots it just says nothing here

#

If I go in general vc i can screenshare it

#

NEVERMIND

worthy yarrow
#

Got it?

split tinsel
#

nope apparently you can't screenshare in vcs

#

W update discord

#

or is it just this server

remote swallow
#

need to be verified iirc

#

run configurations are setup per project too

worthy yarrow
#

I think his bugged out tho?

#

Or perhaps he deleted it... not too sure

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

split tinsel
#

!verify MrNameless666

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

split tinsel
#

I'm screensharing intellij, can someone help me fix it

sullen canyon
split tinsel
# sullen canyon 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

chrome beacon
#

Use the maven tab

split tinsel
#

That doesn't work either

#

its greyed out

chrome beacon
#

Send an image

split tinsel
#

The play button in top is greyed out its greyed out the same way in maven menu aswell

chrome beacon
#

The maven tab is closed

#

Open it

split tinsel
#

I can't really open it as i just uninstalled intellij

#

ill try again once i reinstall

worthy yarrow
#

These are all grayed out?

split tinsel
#

I must have just deleted it at some point accidentally

worthy yarrow
#

kek well good that its back now haha

split tinsel
#

as soon as i tried to load my plugin it went gray and bricked my intellij installation i think

worthy yarrow
#

wat the fuck

split tinsel
#

its gray again

#

arghhhh

chrome beacon
#

That's pefectly fine

#

Now open lifecycle and run package

#

(Double click package)

worthy yarrow
#

Oh breh

#

He lied to me!

split tinsel
#

will that still work if I add nms to the project?

worthy yarrow
#

Yes

blazing ocean
#

yes

worthy yarrow
#

That's just how you compile the project

chrome beacon
#

All it's doing is telling Intellij to run mvn package

split tinsel
#

Never seen a more glorious sight

chrome beacon
#

That's not the jar you want to be using

#

But sure it's working :)

split tinsel
worthy yarrow
#

It should just look like this, minus the remapped

split tinsel
worthy yarrow
split tinsel
eternal oxide
worthy yarrow
split tinsel
eternal oxide
#

ie plants grow at a faster speed too

split tinsel
#

its changing the time but this is a server im working on and im gonna be changing how plants grow anyway

split tinsel
#

so if i wanted to make the minecraft day last 24 real life hours i could

worthy yarrow
#

Do you ever .replace the placeholder?

split tinsel
#

Isn't that only for plugins that use placeholders, my plugin is creating custom placeholders

worthy yarrow
#

Well if you're expecting a valued result from %cycle_time% within your plugin, you'd still have to do that

spice bough
#

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

split tinsel
worthy yarrow
#

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

chrome beacon
#

Well compile to Java 8

#

You might need a newer jdk for it to understand certain classes

spice bough
#

other plugins work from 1.8 to 1.20 . i want it

chrome beacon
#

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

worthy yarrow
#

Damn support all the way back to 1.8 sounds like a fcking task

vocal cloud
#

Some people enjoy being miserable lol

alpine cairn
#

I don't need build tools if I am using the spigot maven repository, right?

worthy yarrow
#

IntelliJ?

alpine cairn
#

Yes

worthy yarrow
#

iirc don't think so

alpine cairn
#

hmmm

#

None of the materials are being recognized

worthy yarrow
#

Oh update intelliJ

chrome beacon
#

Update IJ

worthy yarrow
#

btw you still helping that geopol @alpine cairn ?

worthy yarrow
#

uh

#

I forgot the name lol

alpine cairn
#

EPirate?

worthy yarrow
#

yeah

alpine cairn
#

Server died

worthy yarrow
#

Figured that

#

I really only made one proper plugin for them anyway haha

alpine cairn
#

This may be silly but how do I update Intellij?

worthy yarrow
#

I just did it from the site

#

But it should be within intelliJ somewhere

#

should with a grain of salt

chrome beacon
#

^ top right

#

Should be an update icon

alpine cairn
#

Ah

#

That was a sneaky little update button

worthy yarrow
#

Gotta fit all those other QOL buttons into the ide man

chrome beacon
#

Personally I just use toolbox

worthy yarrow
#

What's that entail?

#

Rather what's it offer

chrome beacon
#

It manages my jetbrain ides

#

So updates and such

worthy yarrow
#

Ah gotcha

alpine cairn
#

If I want to temporarily change an attribute should I change the base attribute or the modifier?

delicate gust
#

whats the best way updating a mongo document? (like changing 1 stat inside a document)

worthy yarrow
#

Well it depends on context

alpine cairn
#

yeah ig its the same thing either way

chrome beacon
#

It depends on how you want it to work

worthy yarrow
#

Might be easier to change the modifier or the base kinda design choice

chrome beacon
#

It's not quite the same thing

alpine cairn
#

Just checking for a playerMoveEvent, changing it, then changing it back

worthy yarrow
#

I'd argue for base in most cases

worthy yarrow
chrome beacon
#

Depends on the enchantment

worthy yarrow
#

Say like sharpness for a sword, that would be modifier right?

chrome beacon
#

Not sure

#

Check the source

worthy yarrow
#

nw

quaint mantle
#

How can I remove the PDC data from a entity?

grim hound
#

with a key

quaint mantle
#

Bu that will remove full key yeah?

grim hound
#

yes

quaint mantle
#

but the rest of the entities I have with that key will still have the data?

chrome beacon
#

Yes

quaint mantle
#

I just want to delete from the PDC a specific entity

#

ok

delicate gust
#

how can i change a mongodb document value?

chrome beacon
#

Using the update method

#

Iirc

#

This ^

chrome beacon
delicate gust
#

i did read i just need an example on how to use it

chrome beacon
#

They give examples?

delicate gust
#

i still don't understand, thats why i asked here

worthy yarrow
#

Should probably learn the craft a bit more then

delicate gust
#

im just new to coding and i only asked how to update a document, not anything else

worthy yarrow
#

Right so as being new to coding, you should probably learn a bit more of coding right?

#

Before taking on complex tasks I mean

delicate gust
#

i know of course i wanna learn more because i wanna know how to use database properly

#

is editing a document a complex task?

worthy yarrow
#

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

chrome beacon
#

?spoon

undone axleBOT
#

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.

delicate gust
#

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

worthy yarrow
#

Well from what I've read you've gone over the docs so I would think probably

river oracle
#

The Mongo docs give code examples

worthy yarrow
#

He's confused on the examples

torn shuttle
#

me teaching my nephew how to modify a database

river oracle
#

Idk what time say then

viscid carbon
#

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;
}```
worthy yarrow
#

Maybe they need to perform operations that require an instance of that class within the listener

viscid carbon
#

is it bad to do this?

worthy yarrow
#

Not really

chrome beacon
worthy yarrow
#

Depends on your design

hybrid spoke
#

no you should do it

delicate gust
worthy yarrow
#

Proper oop, you'll follow separated concern principal in your design

viscid carbon
#

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

chrome beacon
torn shuttle
#

it's pretty common

wet breach
delicate gust
torn shuttle
#

I'm already halway to gandalf there

wet breach
#

I am pretty sure you trimmed it

torn shuttle
#

since? yes

viscid carbon
#

@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

wet breach
#

yeah, so it wasn't as long as I remembered it being XD

torn shuttle
#

it gets weird when you're doing it with c# and a game engine

chrome beacon
worthy yarrow
wet breach
torn shuttle
#

unity has different recommendations iirc but it's been a while

wet breach
viscid carbon
#

oh does anyone know why paper has AsyncPlayerChatEvent deprecated?

worthy yarrow
torn shuttle
#

right now I have it way trimmed

wet breach
#

just its shorter is all

viscid carbon
wet breach
#

also had to make sure my memory wasn't faulty either

viscid carbon
#

everything to do with chatevent actually.

worthy yarrow
wet breach
#

oh so you are not a nice person

worthy yarrow
#

I think the beard looks good

torn shuttle
#

short style

wet breach
#

that is way too short

worthy yarrow
#

I think the longer looks better for sure

viscid carbon
#

oh they just want you to use their ChatEvent. nevermind

torn shuttle
#

everyone's a critic

worthy yarrow
#

Ofc we are

#

You've got your own I'm sure as we all do

grim hound
worthy yarrow
#

See, critics everywhere

split tinsel
torn shuttle
grim hound
grim hound
torn shuttle
#

haven't you seen pics of md5?

#

they're quite viral

grim hound
worthy yarrow
#

I've never seen md5

torn shuttle
#

there he is

worthy yarrow
#

of

#

fucking

#

course

grim hound
#

ah

#

that doesn't make sense

#

but okay

#

anyway, enough of real life

worthy yarrow
#

Idk if md5 works out that much

grim hound
#

and have no idea how to fix

torn shuttle
#

he's the least buff spigot dev too

grim hound
#

will just make it a clock hand

torn shuttle
#

I've been going to the gym every other day, matter of fact today is arms & shoulders day

grim hound
grim hound
#

still doesn't fix face tho

torn shuttle
#

you've never seen a spigot developer meetup?

grim hound
#

gotta be born with that

grim hound
worthy yarrow
#

never

torn shuttle
#

they're pretty wild

grim hound
#

gotta do a study on spigot deving and working out

worthy yarrow
#

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)

torn shuttle
#

if you can't program while lifting you're not even a real spigot dev

grim hound
worthy yarrow
#

Well that's not to say we don't, it's just better to allocate some time specifically for programming

grim hound
torn shuttle
#

I actually managed to get under 91kg for the first time in a while today

grim hound
#

I'm like

#

61 kg

subtle folio
#

how tall are you @torn shuttle

torn shuttle
#

6'1

worthy yarrow
subtle folio
#

beef cake ๐Ÿ’ช

grim hound
worthy yarrow
#

Well

grim hound
wet breach
wet breach
#

That is even worse

torn shuttle
#

you still got time to grow up and be a real boy

grim hound
#

bruh

wet breach
#

Already shrinking before you got to be an adult a shame

grim hound
grim hound
torn shuttle
#

weird your pfp's nose just grew

worthy yarrow
#

I'm 5'6 at 18 I don't know if I'll grow anymore

grim hound
#

you are gay

subtle folio
#

no 198 cm?

grim hound
torn shuttle
#

ok dream

grim hound
#

no it's not like that-

torn shuttle
#

uh huh

#

you're going to tell me what the point of the mask is?

wet breach
grim hound
#

I just once found a cool skin when using /skin with skinsrestorer

#

and I did /skin Paint

#

and kept using it from that day

grim hound
#

and two people drew the character for me

torn shuttle
#

ok dream

wet breach
#

What if they cant?

worthy yarrow
grim hound
#

not compared to my past self

torn shuttle
#

please, guy was my father, call me magma

grim hound
torn shuttle
#

that's fine I'm sure it got a laugh from the target audience

worthy yarrow
#

Can I just say that I laughed?

grim hound
#

cmonn

#

explain

worthy yarrow
rapid meadow
#
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

viscid carbon
#

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
humble tulip
#

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

viscid carbon
#

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

brittle gate
brittle gate
# brittle gate

Friends, what should I do to prevent the /lf subcommand text every time a command is used in the plugin I developed?

alpine cairn
#

I updated Intellij but it still isn't recognizing materials

#

Any ideas?

drowsy helm
#

And what JDK are you using

alpine cairn
#

I believe JDK 22

drowsy helm
#

Try invalidating caches

alpine cairn
#

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

drowsy helm
#

Hmm other than that make sure your project version and language level is correct

#

Canโ€™t think of anything else

alpine cairn
#

I don't need the build tools if I have the Spigot API imported with the .pom, right?

kind hatch
#

You have to run BuildTools if you want to develop with spigot. The repos are installed to your local repository through the tool.

drowsy helm
#

You need build tools to have the dependency

alpine cairn
#

hmm

#

I'll try running them again

drowsy helm
#

Is your language level set?

alpine cairn
kind hatch
#

CTRL + ALT + SHIFT + S

#

Check project SDK

#

And then language default

alpine cairn
#

SDK 21 and LL 20

#

What would it look like if something were wrong?

drowsy helm
#

Why is java 22 only now just allowing statements before super

#

How stupid

drowsy helm
#

You dont

viscid carbon
#

@drowsy helm why so toxic?

drowsy helm
#

how is that toxic

#

i'm answering your question

viscid carbon
#

xD

worthy yarrow
#

He answered your question lol

viscid carbon
#

i know i dont but what about you?

worthy yarrow
#

?

drowsy helm
#

"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

worthy yarrow
#

You're definitely attacking them

viscid carbon
#

you replied to "Anybody have a clue"

#

then said "no you dont"

drowsy helm
#

Okay let me rephrase

worthy yarrow
#

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

drowsy helm
worthy yarrow
#

chatgpt response

viscid carbon
#

I'm use to an old forum called rune-server where people were just toxic, knew the answer just being an ass lol

drowsy helm
#

it's called Hanlon's razor

#

"Never attribute to malice that which is adequately explained by stupidity."

viscid carbon
#

so sorry i misread that @drowsy helm i now know your intentions were good.

drowsy helm
#

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

viscid carbon
#

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();

young knoll
#

You donโ€™t need the create section

#

The following set calls should handle creating it

viscid carbon
#
  Allowed-homes: 0
#

does the same thing

worthy yarrow
#

Yeah that's what you've got written

drowsy helm
#

it doesnt have Current-homes

worthy yarrow
#

wat

viscid carbon
#

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"

drowsy helm
#

try set a third one

#

does that overwrite all of them?

#

or set it to a value that isnt 0

wise fiber
#

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)

viscid carbon
#
        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

mortal vortex
#

@wise fiber meta.getPersistentDataContainer().remove(new NamespacedKey(this, "jukeboxplayable"));

wise fiber
drowsy helm
#

plugin

wise fiber
#

ok ty

#

wait

viscid carbon
mortal vortex
#
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;
    }
viscid carbon
#

wtf

wise fiber
drowsy helm
#

try updating your spigot jar maybe?

#

could be an old bug

viscid carbon
#

ill give that a shot

worthy yarrow
#

Really weird

drowsy helm
young knoll
#

PDC doesnโ€™t interact with components

#

Lul

drowsy helm
#

yeah i thought something was funky abt that

viscid carbon
#

ive always had this problem, even back in 2020

young knoll
#

Itโ€™s probably just ItemMeta#setJukeboxPlayable(null)

wise fiber
#
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]}"

wise fiber
#

i can still place the disc into a jukebox

viscid carbon
#

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.

subtle folio
#

Hello again, is it possible to have all these built jars in the target folder go to one centralized folder?

#

Im using maven

drowsy helm
#

oh wait target folder

subtle folio
#

yeah target folder

#

just for the ease of dragging them all over to my console

echo basalt
#

We have that set up at work, not sure how it's done on maven

subtle folio
#

thanks illusion

drowsy helm
#

lmao

#

outputDirectory in build

subtle folio
#

yeah but that only copies over the original verison of the jar

echo basalt
#

good ol' gradle

subtle folio
#

maven ftw imo

drowsy helm
#

pretty sure its an option on the shade plugin iirc

subtle folio
#

let me do more digging

drowsy helm
#

I did it on one of my projects, Iโ€™ll chrck once I get home

subtle folio
#

kk

slender elbow
alpine cairn
#

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?

echo basalt
#

I didn't set it up, blame my lead dev

agile anvil
#

You cannot use maven and manual dependencies in the same time

#

When you add spigot to the pom, do you compile with maven?

alpine cairn
#

what does that entail?

slender elbow
alpine cairn
#

Not getting a clear answer from ppl

spice burrow
alpine cairn
#

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.

kind hatch
#

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.

alpine cairn
#

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?

drowsy helm
#

no

#

can be anywhere

alpine cairn
#

It doesn't build

#

Not sure how to build on the command line

kind hatch
#

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.

drowsy helm
#

can we see your pom

alpine cairn
#

How do I do the thing for pasting code?

undone axleBOT
alpine cairn
kind hatch
#

First off. Change the Java version to 21.

#

Secondly, your shade plugin is kinda old.

alpine cairn
#

java: cannot find symbol
symbol: variable IRON_HELMET
location: variable MATERIAL of type org.bukkit.Registry<org.bukkit.Material>

kind hatch
#

?img

undone axleBOT
#

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

alpine cairn
young knoll
#

Update IntelliJ

drowsy helm
#

he already did

young knoll
#

Wack

#

Thatโ€™s worked for people so far

alpine cairn
#

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

wise fiber
# wise fiber "**CraftJukeboxComponent{handle=JukeboxPlayable[song=EitherHolder[holder=Optiona...

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

alpine cairn
#

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

wise fiber
young knoll
#

?jira

undone axleBOT
young knoll
#

Ideally nothing should be unhandled

dawn flower
#

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

wise fiber
#

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

torn shuttle
#

what the hell did I even do

#

I broke something and I have no clue how

#

my http requests are now bodiless

dawn flower
#

can u play the nether portal animation to a player

drowsy helm
#

does anyone here have an example of a multi-module gradle project? trying gradle out for the first time and im lost lmao

agile anvil
agile anvil
#

My bad I'm tired

stark sierra
#
        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
agile anvil
#

Do you have basic understanding of Vectors?

stark sierra
#

ah mb, just got it working sorry lol

agile anvil
#

Why do you need to put the player on an armorstand tho?

stark sierra
#

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

nova notch
#

putting them as a passenger is probably easier and more consistent

agile anvil
#

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

stark sierra
#

oo I see, i'll try that out then

#

ty

blazing ocean
drowsy helm
#

ty

drowsy helm
blazing ocean
#

90% of people use the kotlin dsl

#

it's way nicer to write, better ide support

drowsy helm
#

okay im restarting then lol

green kraken
#

?img

undone axleBOT
#

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

green kraken
#

Hllw

#

Anyone tell me what's the problem here

#

Please help me anyone

dawn flower
#

u fucked up in plugin.yml

#

send us ur plugin.yml

torn shuttle
#

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

spice bough
ivory sleet
#

I think Plugin#getResourseAsStream is what u want

shadow night
ivory sleet
#

And then u can pass it to Files.copy

blazing ocean
shadow night
#

Do they?

torn shuttle
#

oh hell

shadow night
#

Usually it's a java method on the class class

torn shuttle
#

I managed to guess my way through it

#

I ain't going senile yet boys

torn shuttle
#

half remembered this thing from like 5 years ago

shadow night
#

Neat lil utility in bukkit

ivory sleet
#

Its just a shortcut to classloader -> getresource kekw

shadow night
#

Lmao

torn shuttle
#

we love data compliance

ivory sleet
#

Do we?

#

๐Ÿคจ

chrome beacon
sterile flicker
#
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

pseudo hazel
#

beautiful names

agile anvil
#

Please use mojang mappings

exotic zephyr
#

hello

agile anvil
#

hello

exotic zephyr
#

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");
    }
}
pseudo hazel
#

did you put your command in plugin
yml?

exotic zephyr
#

yeah

chrome beacon
#

You forgot to put the command in your plugin yml

sterile flicker
chrome beacon
exotic zephyr
#
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

smoky anchor
undone axleBOT
pseudo hazel
#

the command is called test not tuto

exotic zephyr
#

i replace by tuto ?

agile anvil
pseudo hazel
#

use the same name in both places

exotic zephyr
#
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```
agile anvil
#

Did you recompile correctly? And did you restart the server?

#

It seems the plugin.yml was not updated in the jar file

exotic zephyr
#

I have to recompile it every time? because I only did it when creating my server ?

chrome beacon
#

Yes

exotic zephyr
#

here ?

#

channel for send a picture ?

agile anvil
#

?img

undone axleBOT
#

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

exotic zephyr
#

okay thanks

#

here ?

#

for compile my pl

chrome beacon
#

Yes

exotic zephyr
chrome beacon
#

You should go ask Paper

#

Since you're making a paper plugin

exotic zephyr
#

okay

torn shuttle
#

I'm a bit of an artist

#

it's called art we do a little art

shadow night
#

Looks fancy

torn shuttle
#

it's called fart we do a little fart

shadow night
#

lol

halcyon hemlock
agile anvil
grim hound
#

why doesn't this work

#

when writing to a file that's from the project I'm working on?

keen charm
#

Hey

#

Does Player#hidePlayer() work for self player?

#

Or do we need to send remove, respawn & add packet?

grim hound
smoky anchor
#

?tas

undone axleBOT
grim hound
#

file returns that it exists

hazy parrot
#

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

grim hound
hazy parrot
#

Mmm you are

keen charm
#

Was about to say that

grim hound
#

it has the main method

keen charm
grim hound
keen charm
#

You are trying to edit the jar file itself

smoky anchor
#

Yeah, you can't do that easily

keen charm
#

This is like trying to perform a surgery on yourself

hazy parrot
#

^

grim hound
hazy parrot
#

It sure does

grim hound
#

or does it simulate it?

keen charm
#

You just don't see it

grim hound
keen charm
#

It's mostly cached somewhere

ivory sleet
#

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)

quiet ice
#

I mean, it's not weird, that is just how the classpath works

ivory sleet
#

yea well, u still get the code โ€œonceโ€, debug everywhere experience

quiet ice
#

I have not debugged my code under windows for a very long time now.
Meh, noone uses my software anyways

ivory sleet
#

Or integration ones w/e

quiet ice
#

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

ivory sleet
#

yea, i remember ur concurrency code being surrounded w tests, so I mean that sort of acts like a preemptive way to catch bugs

quiet ice
#

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.

ivory sleet
#

๐Ÿฅฒ

#

pain

quiet ice
ivory sleet
#

yea, for data structures benchmarks become far more interesting i suppose

keen charm
#

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

quiet ice
#

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

ivory sleet
#

There is a profile api on spigot also

#

i think it can be used equivalently to what uโ€™d in paper

keen charm
#

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?

ivory sleet
#

Unless youโ€™re on an old version allegedly

keen charm
#

I'm on 1.16.5, that's possibly why

#

Should upgrade ๐Ÿ˜‚

quiet ice
keen charm
#

Other than that there is no setPlayerProfile, how would that work?

quiet ice
#

It probably does not return a clone

ivory sleet
#

im sorry but nms it is for you then (or paper or some other lib)

keen charm
ivory sleet
#

PlayerProfile is mutable iirc

#

So u mutate it directly

keen charm
#

That's what I'm looking for haha

quiet ice
#

Only the texture is mutable though

keen charm
keen charm
#

After that do I do Player#hidePlayer() and Player#showPlayer()?

quiet ice
#

How you are supposed to obtain a PlayerTextures instance is a bit beyond me though

quiet ice
keen charm
quiet ice
#

I mean, you probably don't need to get it right the first try anyways

ivory sleet
#

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

quiet ice
#

You probably can just mutate the PlayerProfiler#getTexture method - however that one can be null so yeh

ivory sleet
#

that is annotated not null

#

but the setter takes a nullable argument kekw

quiet ice
#

@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

keen charm
#

Also, is PaperMC not liked around here?

tame wolf
#

Why would you think it isn't liked?

quiet ice
#

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.

keen charm
#

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

quiet ice
#

it probably is some arcane way of encoding the URL (Base64 perhaps?)

keen charm
#

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?

quiet ice
#

most likely

keen charm
#

But how does signatures work with setSkin?

quiet ice
#

Especially since it's @Nullable

keen charm
#

I don't see a way to set signatures

quiet ice
#

probably not necessary then

keen charm
#

It's something required by Yggdrasil if I remember

cobalt flame
#

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

quiet ice
# keen charm How is it not necessary tho?

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

cobalt flame
#

Its the same error

#

nvm i fixed it

#

thank you

keen charm
#

How do I turn value and signature to URL again?

#

Decode it and get URL by parsing it as a json?

drowsy helm
#

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

keen charm
drowsy helm
#

yep not there

keen charm
#

File>Project Structure

drowsy helm
#

not there either

keen charm
#

Did you click modules there?

drowsy helm
#

yep

hazy parrot
#

Have you tried to invalidate cache and restart ?

drowsy helm
#

compeltely forgot about invalidating caches fml

#

one sec

#

still comes up

crude charm
#

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?

grim hound
#

soo

#

how can I override a package-private class' final method?

drowsy helm
#

oh hey i remember you zoibox

grim hound
#

I need to break these two rules

drowsy helm
#

welcome back

crude charm
#

Thanks!! lol

#

I do infact remember seeing you around too lol

grim hound
quiet ice
drowsy helm
grim hound
keen charm
#

But I got an issue, if I do Player#hidePlayer() to myself it doesn't work

drowsy helm
quiet ice
grim hound
crude charm
#

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

grim hound
#

I need to override this

quiet ice
#

You could do some extreme shenanigans with hotswapping and mass ASM, but that's a bit on the extreme side of things

drowsy helm
#

ah

#

you need javaassit

#

for that

young knoll
#

Or asm, mixins, access transformers

#

Etc

drowsy helm
#

any bytecode manipulator

grim hound
#

but it's the only one I've ever used

quiet ice
#

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

grim hound
quiet ice
#

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.

wet breach
#

you could technically drop all the classloaders if you use an appropriate agent but then we start getting in the realms of unsafe lmao

quiet ice
#

For hotswapping, that's completely impossible. If you mutate the class before it's being classloaded then yes everything is allowed

grim hound
#

uh

quiet ice
grim hound
#

I just need to override one variable

quiet ice
#

Might as well modify the server jar

shadow night
#

This is funny

grim hound
#

of its

young knoll
#

Just uhh

#

Use ignite to bootstrap mixins

hazy parrot
#

How can I download a full dependency javadoc from intellij (using Gradle)

grim hound
#

asm sounds the most familiar to me

crude charm
#

does PlayerPickupItemEvent trigger if the player is given an item?

slender elbow
#

asm is msa backwards

grim hound
quiet ice
#

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.

slender elbow
grim hound
young knoll
#

The Pakistani maritime security agency

quiet ice
grim hound
#

ygolohcysp

#

reversed psychology

grim hound
#

never seen it

young knoll
#

You can attach a hotswap agent the proper way

#

With a command line argument

quiet ice
#

It's roughly equivalent to

if (InjectHandlerClass.handleAccept(this, addr)) {
  return;
}
quiet ice
young knoll
#

Oof

#

You are super screwed then

quiet ice
#

Blame ron

young knoll
#

Ronald McDonald?

quiet ice
#

Ron pressler

young knoll
#

Thatโ€™s for the if

quiet ice
#

Because otherwise it'd be an unconditional return

grim hound
#

ah

grim hound
#

how do I use this?

#

to override a final method

grim hound
#

is using ASM possible?

young knoll
#

That is asm

quiet ice
#

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)

grim hound
exotic obsidian
#

how can i disable put lava bucket on water?

quiet ice
#

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)

young knoll
#

You need a java agent for asm to work

#

Which either involves a command line argument or runtime attaching

quiet ice
#

Latter will inevitably be patched out of the JVM

young knoll
#

Indeed

grim hound
young knoll
#

Sadge

quiet ice
#

Yeah

grim hound
#

nice, removing useful tools

#

oracle โ˜•

quiet ice
#

In fact, I believe runtime attachment currently only involves using Unsafe? I'm not too familiar with the hacks needed for this

young knoll
#

Convince MD to give us mixins

#

Kek

chrome beacon
#

Integrity by default

quiet ice
#

Hiding a random raw byte[]-transformers should probably be a bit saner and avoid people abusing it from all the wrong reasons

grim hound
#

so what would be the best way to override a final method?

young knoll
#

Rewrite the jvm

grim hound
#

and in constant use

chrome beacon
#

Use ignite and modify before use/load

grim hound
quiet ice
#

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

grim hound
chrome beacon
#

Won't be if you use ignite

grim hound
silk pumice
quiet ice
#

Then that's a feasible approach that wouldn't involve hotswapping

grim hound
#

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

quiet ice
#

You don't create a new class, you just change what the current class is

grim hound
quiet ice
#

That's the entire gimick of hotswapping - although it's primarily for use in debugging, but you can abuse it for other reasons

young knoll
#

We should return to C

#

Solves all these problems

grim hound
#

how

#

do I

#

rewrite

#

a final method

quiet ice
#

As I said, I never did that

grim hound
#

I still don't know

quiet ice
#

Attach a javaagent and we can go from there as that'd return us to territory I'm familiar with

chrome beacon
#

Or go the easier route with ignite

#

Which doesn't use a javaagent

grim hound
young knoll
#

A program that bootstraps mixins