#help-development

1 messages · Page 1005 of 1

worthy yarrow
#

Well I’ve never played with nms so I’m not even sure the benefits mixins bring

remote swallow
#

you dont get mixins on spigot

worthy yarrow
#

Right

#

Nms isn’t spigot tho

#

That being said, I still have only ever used spigot so the point stands

blazing ocean
eternal night
#

peeposhivering mixins

tardy delta
#

i use win32 to open a native os window that replaces the running minecraft session

young knoll
#

If paper is so good then why doesn't it have mixins!

worthy yarrow
#

What even are mixins?

remote swallow
#

basically a runtime patch

worthy yarrow
#

How does that work? Is it kinda like hot swapping?

tardy delta
#

would assume so, hot swapping is with shared libraries iirc

#

bytecode transformers maybe

young knoll
#

It's a fancy ASM wrapper essentially

worthy yarrow
#

Mapped means key - value

#

(Most contexts at least)

worthy yarrow
pseudo hazel
#

I mean yes

#

youre both right

#

its a mapping from obfuscated code to code someone can read

worthy yarrow
#

Ah that makes sense

pseudo hazel
#

it means to map it again or to something else

worthy yarrow
#

Obfuscated -> into actual readable values then I guess

pseudo hazel
#

there are different mappings

#

well

icy beacon
#

what time is it

pseudo hazel
#

depends on how you look at it

worthy yarrow
icy beacon
#

ty

pseudo hazel
#

you could consider mapped code to be a remapping of the obfuscated code

#

but thats just grammar

worthy yarrow
worthy yarrow
#

Sure!

pseudo hazel
#

wdym

#

its not that difficult

#

there is garbled code and some way to ungarble it based on what someone said it should be

#

yes

remote swallow
#

its remapped into mojang

pseudo hazel
#

it means its mapped like mojang code

short drift
#

Remapping means that you map something that is default into something else. For example if you press "A" you get "A". But if you remap it, you reconfigure it for example so that when you press "A" you get "F".
So "remapped Mojang" means that you have default Mojang things - which have been remapped.

pseudo hazel
#

no, you wouldnt remap it to be obfuscated

#

that would be stupid

#

then compile it

#

and obfuscate it

#

then its not your code to distribute

slender elbow
#

you can distribute plugins/mods using mojang mapped classes/fields, what you cannot distribute is the mappings file itself, or any "substantial portion" of mojang's own code (this is regardless of mappings)

tropic saddle
#

?mappings

undone axleBOT
slender elbow
#

but, yada yada IANAL perform at your own risk

wide moth
#

hi, I need to detect changes in inventory, what event should I use? I want to be able to detect all changes, even these made by setItem() and addItem().

quaint mantle
quaint mantle
#

Also, I tried to do adapter class but open inventory method requires nms inventory

worldly ingot
#

Just a bit of an unfortunate abbreviation lol

young knoll
#

You say unfortunate I say beautiful

worthy yarrow
#

Choco says unfortunate, coll says beautiful, I say fortuitous circumstance

obsidian wolf
#

Choco says unfortunate, coll says beautiful, NuclearKat say fortuitous circumstance, I say ok bro

remote swallow
short drift
#

I'm having terrible trouble accessing ServerboundClientInformationPacket with ProtocolLib.

chrome beacon
#

What part are you having problems with

short drift
#
    private void registerHatDetector() {

        protocolManager.addPacketListener(new PacketAdapter(
                this,
                ListenerPriority.NORMAL,
                List.of(PacketType.Play.Client.SETTINGS)
        ) {
            @Override
            public void onPacketReceiving(PacketEvent event) {

                var packet = event.getPacket();
                var packetType = event.getPacketType();

                if (packetType == PacketType.Play.Client.SETTINGS) {

#

This works fine.

#

But everything after this is just .. I'm not getting the data.

#

So basically:

                    var data1 = packet.getByteArrays().read(0);
                    System.out.println("Data: " + data1);
#

Tried with arrays, with bytes, with integers ..

#

Everything throws.

chrome beacon
#

So the listener is working fine?

short drift
#

Yes.

chrome beacon
#

but you're having problems reading

short drift
chrome beacon
#

What data are you looking for

short drift
#

Right at the end, this is the data I need:

[Netty Epoll Server IO #1/ERROR]: Parameters: 
net.minecraft.network.protocol.common.ServerboundClientInformationPacket@5209fdf0[
b=ClientInformation[language=fi_fi, viewDistance=16, chatVisibility=FULL, chatColors=true, modelCustomisation=126, mainHand=RIGHT, textFilteringEnabled=true, allowsListing=true]
]
chrome beacon
#

What do you want to read

short drift
#

Especially the "modelCustomisation"

#

Which holds the data whether the player has hat enabled/disabled, etc.

#

Ie. in their skin.

#

This is the docs for the packet.

#

I don't know what I'm doing wrong.

chrome beacon
#

Let me give it a try

short drift
#
Packet: PacketContainer[type=SETTINGS[class=ServerboundClientInformationPacket, id=10], structureModifier=StructureModifier[fieldType=class java.lang.Object, data=[com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor@fb3455b]]]
#

Do I need to use getModifier?

short drift
#

😢

rough drift
#

Hello chat weird question, does anyone know where the code for the console's line input is in?

chrome beacon
# short drift ``` Packet: PacketContainer[type=SETTINGS[class=ServerboundClientInformationPack...

Sorry for the wait I had some other stuff to do. As you can see in that error message the packet contains a single object. That object is the ClientInformation record which then contains the data you want. You can see this by looking using a debugger or just looking at the nms code (see attached image). So what you need to do is read the client info and then read the skin parts.

This would look something like this;

PacketContainer packet = event.getPacket();
StructureModifier<InternalStructure> objects = packet.getStructures();
InternalStructure clientInfo = objects.read(0);
int skin = clientInfo.getIntegers().read(1);
BitSet bitSet = BitSet.valueOf(new long[]{skin});
boolean hasHat = bitSet.get(6);
Bukkit.broadcastMessage("Has hat: " + hasHat);
short drift
#

🤔

chrome beacon
#

Feel free to replace that bitset with bitwise operations if you want

short drift
#

Ok, I'll try it out.

young knoll
#

I swear a lot of people seem to have this issue

#

I think something about updating intelij

#

Idk

eternal night
#

it does not

chrome beacon
#

You can use Toolbox to handle updates

short drift
chrome beacon
#

if you want something easier to work with checkout PacketEvents

short drift
#

Well, to be fair I don't really know any Java. I'm more familiar with C#.

chrome beacon
#

It is a bit hard to work with if you don't understand the internal structure of things

dawn flower
#

so uh i got abunch of text displays, about 30 but for whatever reason the specific 8 of them always just go poof by themself, i look at them and they suddenly dont exist (it happened twice on the same 8 text displays and the others didnt disappear), what could be causing it? i looked at every class in my plugin and nothing messes with non living entities

#

i tried using external hologram plugins but they're all packet based and can't be scaled with axiom (block and display entities editing mod), i tried making my own but they still die somehow (i had anti death mechanics)

eternal oxide
#

are they set to persist?

dawn flower
#

yes

eternal oxide
#

and you set remove when far away to false?

dawn flower
#

they dont have that in their nbt so im guessing thats for giants only

eternal oxide
#

ah living entity only

#

then setPersistent(true) should be enough

young knoll
#

True is the default

eternal oxide
#

unless you have a plugin removing them

dawn flower
#

i prob have one but i cant tell which one it is

eternal oxide
#

Thats a You problem then 😦

dawn flower
#

and i can't keep testing plugins cuz idek what causes that to happen

#

:-:

eternal oxide
#

dev on a clean server

dawn flower
#

it takes literal days to happen

#

i wish there was an EntityDeleteEvent or smth

#

wait what if i just listen for DEATH cause in EntityRemoveEvent

#

ah fuck it isn't cancellable

young knoll
#

Just listen for anything other than the unload reason

dawn flower
#

and the despawn

young knoll
#

You could use the current thread stacktrace to find where it comes from

eternal oxide
#

and log it to your own file so you can get a history

dawn flower
#

where is that

#

should i "respawn" the text display when it gets removed from PLUGIN or DEATH?

young knoll
#

I mean

#

How about just figuring out what is causing it

dawn flower
#

but what if it happens again

#

but instead it happens on all of them

young knoll
#

And then telling the author of said plugin to git gud

#

Idk this is why I normally opt for non-persistent hologram entities

#

And just spawn them on chunk load

dawn flower
#

these cant be scaled with axiom

#

and i don't want to go through the pain of using numbers

young knoll
#

What

dawn flower
#

this thing

young knoll
#

The heck is that

dawn flower
#

a mod

young knoll
#

Why is that relevant to spawning them on chunk load

remote swallow
dawn flower
#

because theyre stored in a variable, usually just the transformation and the display

#

and if i try to edit it with axiom, in the next chunk reload it'll reset

remote swallow
#

it is royally pissing it down outside and i can hear the rain through my headphones

remote swallow
worldly ingot
#

Axiom is pretty sick. The people writing that mod are awesome

chrome beacon
#

moulberry does make cool stuff

young knoll
#

I don’t understand why you need axiom to scale it

#

Scale is just a simple vector, no quaternion magic

slender elbow
#

but math is hard !!!!

dawn flower
#

i wouldn't like to mess with numbers 30 itmes

slender elbow
#

I dropped out in 2nd grade

remote swallow
#

so thats why your here

slender elbow
#

touche

young knoll
#

Epic did the same

remote swallow
#

gotta learn the math somewhere

young knoll
#

That’s why he never uses the right you’re

remote swallow
#

i do sometimes

young knoll
#

Just make a command to set the size and play around with that until you’re happy with it

#

Or hotswap, kek

remote swallow
#

you learnt how to hotswap all by urself didnt you

dawn flower
#

i miss armorstands

#

when u could just cancel entitydeathevent

young knoll
#

That was never a proper solution

dawn flower
#

that was

young knoll
#

Especially since it’s not cancellable on spigot, kek

dawn flower
#

then ask spigot to make entityremoveevent cancellable

#

problem solved

young knoll
#

Or

#

Find out what is randomly removing your entities

remote swallow
#

its much easier to just find out whats removing them

young knoll
#

I assure you they don’t die of old age, so something is explicitly doing it

dawn flower
#

how do i get the server stacktrace thingi

remote swallow
#

a thread dump?

eternal oxide
#

StringUtils.join(new Throwable().getStackTrace(), "\n");

#

nice and readable

young knoll
#

You can also just do Thread.currentThread.something

dawn flower
#

that gets everything?

slender elbow
#

Thread.dumpStack() moment

young knoll
#

That’s the one

#

Thank you

dawn flower
#

should i broadcast it or will i regret it

eternal oxide
#

log to file

dawn flower
#

nah ill broadcast it

young knoll
#

Depends how often display entities get ded on your server

dawn flower
#

try to stop me >:)

eternal oxide
#

its a huge text

dawn flower
#

my server has seen worse

remote swallow
#

"oh i cant read it, why didnt anyone stop me"

young knoll
#

Well it’ll be in the server logs

remote swallow
#

besides the point

dawn flower
#

that just throws an "exception"

#

a fake one

#

very useful

worldly ingot
#

Yes but it gives you the call stack

slender elbow
#

^

#

this is exactly why stack traces are useful lol

dawn flower
#

it's tiny and doesn't have anything related to entities tho

eternal oxide
#

both do. the dump does it to the error stream, the one I posted gives you a String you can use

worldly ingot
#

Where did you put it? KEKW

#

Ideally you put it somewhere that's triggered when your entity is removed and not somewhere totally unrelated

dawn flower
#

oh

#

so i have to wait until they disappear again

young knoll
#

Yes

dawn flower
#

crap

#

should i do it in EntityRemoveEvent

eternal oxide
#

You do it IN the event where you die/remove

worldly ingot
#

Yeah but your dump stack should be in like an entity remove event or something if you don't know how it's getting removed

#

ye

young knoll
#

^

#

And ignore the unload cause at least, because yknow

dawn flower
#

im gonna bet 5 chocolate bars it's not gonna disappear now that i want it to disappear

worldly ingot
#

No of course

young knoll
#

Then the bug is solved

#

Ship it

dawn flower
#

act like it never happened

worldly ingot
#

Now that you're trying to fix it, it's gonna scurry and hide

dawn flower
#

exactly

young knoll
#

One day someone will /kill all the display entities and the console will explode

#

But shhh, that’s their problem

dawn flower
#

oh wait how would i get the stack if it's just doing printStackTrace

remote swallow
#

the stack trace is the stack

young knoll
#

?

dawn flower
#

ur telling me to add it to my custom log file

remote swallow
#

no

#

just print it to console

dawn flower
#

yes

young knoll
dawn flower
#

im not gonna go through that big of a list

#

thanks

#

u mean String.join?

remote swallow
#

sure

eternal oxide
#

its an Apache lib

dawn flower
#

ah

carmine mica
#

can't you just do new Throwable().printStackTrace(); to print one?

#

or even better is Thread.dumpStack(); or smth

eternal oxide
#

you can, but you get a String array

carmine mica
#

printStackTrace prints a string array?

eternal oxide
#

it just depends if you want to log it and how readable you want it

young knoll
#

They want to log it to a separate file

#

So you can’t just dump stack

eternal oxide
#

yep

#

log is my code

#

apache commns is/was included in Spigot

young knoll
#

I don’t think it is anymore

dawn flower
#

im gonna have an amazing time reading it tmr

#

cries in pain

worldly ingot
#

PES3_HmmCoffee but String#join() accepts varargs. I dunno why you want to use Apache Commons so badly

#

I guess technically it takes a CharSequence varargs but that should be fine lol

ivory sleet
#

Even better

meager wolf
#

Im making a plugin for 1.18 - 1.20 and there is some small differences in the code in each version, how can i setup my project so i can work on multiple versions?

And how can i test the plugin in multiple versions quickly, idk if i can make a server for every single version :/

chrome beacon
#

?multimodule

#

Is there a command for that

chrome beacon
# meager wolf Im making a plugin for 1.18 - 1.20 and there is some small differences in the co...

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

worldly ingot
#

inb4

#

?module

#

Welp I tried

remote swallow
#

add

kind hatch
#

AHHHH, all the System.exit() calls are catching up to me.
I've been chasing my tail trying to figure out why things weren't working.

spice burrow
#

Can anyone recommend a good forum/docs to read up on creating animation sequences?

young knoll
#

What are you System.exit()ing in

analog mantle
#

Is there runPaper for maven?

slender elbow
#

run WHAT?!

analog mantle
#

runPaper

young knoll
#

?whereami

worldly ingot
#

You signed that document that says we are not personally liable for heart attacks, correct?

young knoll
#

The spigord

worldly ingot
#

That just sounds like we're a pumpkin

young knoll
#

Wait you guys aren’t pumpkins?

worldly ingot
trim bough
young knoll
#

You can

#

But premium resources obfuscated code still needs to be somewhat readable

worldly ingot
#

We'd rather your strings not be obfuscated at all

#

And, really, string obfuscation provides you no true benefit anyways so

young knoll
#

Does any obfuscation really provide significant benefit

analog mantle
worldly ingot
#

They may have gotten an exception. Unsure

sullen marlin
worldly ingot
#

Especially because it's an anti cheat I'm inclined to believe that that is the case

#

Oh, well, lol

trim bough
worldly ingot
#

I meant Vulkan, the one that uses ZKM

trim bough
sullen marlin
young knoll
#

Md got hit with the cringe

glad prawn
#

bruh

sullen marlin
#

Oof

spice burrow
#

?ban

river oracle
buoyant viper
#

would a trash can gui esque command be as simple as calling Bukkit.createInventory() n then just letting the player plop items into it

sullen marlin
#

Ye

buoyant viper
#

poggers

spiral bramble
#

Hey there, I know in an older April Fools version of Minecraft they implemented different colors for Nether Portals, was this feature kept in the newer versions? If so what is needed to actually adjust this?

blazing ocean
#

people would've done that if it would still be in the game

spiral bramble
charred blaze
#

is it possible to get item's width/height?

#

or block's

eternal oxide
#

?

charred blaze
#

when you place for example skull on the ground

#

what its height/width?

blazing ocean
#

just make a script to read all the block models

#

because i doubt you can do that as it's rendered by the client's resource pack

spice burrow
#

is this an acceptable way of using one MongoClient from my main file in spigot

public class PlayerHandler implements Listener {
  private final MongoClient mongoClient;
  // init ID
  private int taskID;

  // now we gotta have our plugin connection don't we c:
  public PlayerHandler(Prisons plugin, MongoClient mongoClient) {
    // mongodb stuffs
    this.mongoClient = mongoClient;
    Bukkit.getPluginManager().registerEvents(this, plugin);
  }

  @EventHandler
   public void displayScoreboard(PlayerJoinEvent event, Document playerProfile) {
     // mongoClient tings
     createBoard(event.getPlayer(), playerProfile);
     start(event.getPlayer());
   }
  // more tings and shtuff
}
eternal oxide
#

thats not how Listeners work

#

Do not ignore errors your IDE is showing you

#

actually, that won;t show as an error

spice burrow
#

I guess I'm having an issue understanding how to put documents from my mongoclient in different classes under the same MongoClient

eternal oxide
#

but its wrong

quiet ice
#

what's the reason you have a taskID in your listener?

eternal oxide
#

you can;t pass anything other than the event in a Listener

charred blaze
#

registering listener in the listener?

#

interesting

eternal oxide
#

I like self registering Listeners but I don;t do it as it's bad in principle

quiet ice
spice burrow
#

how should I be passing my MongoClient into my handler? or can I not?

quiet ice
#

could you show us the entire class so I can get a better grasp of what you are attempting to accomplish?

eternal oxide
#

you get it where you need it, you don't pass it

quiet ice
spice burrow
#

sure sorry give me a sec, I'm a bit new to this language/spigot so sry ab that

eternal oxide
#

passing yoru client in the constructor is fine

#

remove teh Document from the Listener

spice burrow
#

thanks for your patience with me lol

spice burrow
#

scratch that

spice burrow
# eternal oxide passing yoru client in the constructor is fine

don't mean to be annoying but how about this

  @EventHandler
  public void displayScoreboard(PlayerJoinEvent event) {
    Document playerProfile =
        playerProfiles.find(Filters.eq("UUID", event.getPlayer().getUniqueId())).first();
    createBoard(event.getPlayer(), playerProfile);
    start(event.getPlayer());
  }

eternal oxide
#

yep

spice burrow
#

great thanks

quiet ice
#

doesn't this cause issues with performance?

eternal oxide
#

it will

quiet ice
#

ok

quaint mantle
#

Wrap code into Async and call it a day

tepid flicker
#

anyone know how I would store custom plant values in mysql?

lilac dagger
#

plant?

#

you can use a Text data type and store json/base64 in there

#

and then serialize/deserialize

valid burrow
#

?xy

undone axleBOT
tepid flicker
lilac dagger
#

if it's an actual plant you can store the material

valid burrow
tepid flicker
#

im trying to make a custom plant

valid burrow
#

then store locations not the plant itself

eternal oxide
#

a custom plant out of what?

tepid flicker
#

but how would get help of mysql to do it

valid burrow
#

you can (de)serialize the location object and save it

tepid flicker
#

I don't know what I'm even doing

eternal oxide
#

Why do you feel you need to use SQL at all?

valid burrow
#

true just use yml files

tepid flicker
valid burrow
#

if you load yml files with bukkits loader u can just do file.setLocation

eternal oxide
#

what block are you going to use for the "plant"?

valid burrow
valid burrow
#

well you should definitely use yml files instead

#

or other files

#

but not a database

tepid flicker
#

well what if like many players have loads of farms wouldn't that yml file be pretty long?

valid burrow
#

what size are we talking

#

a few hundred lines? a few thousand? a few tens of thousands

tepid flicker
#

idk, but how would I use yml files then?

valid burrow
quaint mantle
quiet ice
#

just go with a custom flatfile file format :p

valid burrow
#

or use block pdc

tepid flicker
#

just a warning, I am very stupid and I am a beginner

#

so I don't know what yall are talking about

wraith delta
#

There’s also a “OfflineGrowth” plugin

#

If that’s what you’re intending

valid burrow
#

thats why you need to tell us what you are trying to do

#

like actually trying to do

#

?xy

undone axleBOT
eternal oxide
quiet ice
quaint mantle
#

ByteBuffer: 🗿

eternal oxide
#

?configs I'd just go yml

undone axleBOT
valid burrow
tepid flicker
valid burrow
#

lol

#

sure

#

burn your data in cds

quiet ice
valid burrow
#

that’s difficult

#

doesnt make it good

eternal oxide
#

A melon is probably not a good crop to use as it ends up placing a block in its final stage

tepid flicker
#

which is why I need help

#

not spoon feeding but instruction

valid burrow
#

hard != better

quiet ice
#

best being relative

tepid flicker
tepid flicker
#

oooooooooooh

#

kk

quiet ice
# quiet ice best being relative

In my bukkit plugin dev days I used to do quite a few PRs where I would yeet out .yml based configurations in favour of ByteBuffer/DataOutputStream solutions

valid burrow
#

thats only for certain scale though lol

quiet ice
#

I'm a fan of low-level optimizations

quaint mantle
#

I saved few bytes with bytebuffer yepiee

valid burrow
#

There are in every code lol

quiet ice
#

1 line fix? That is rather ambitious as that would usually be only memory management issues

valid burrow
#

well then 10 lines

#

what ever

quiet ice
#

well that is cheating

valid burrow
#

wdum cheating lmao

quiet ice
#

because that requires knowledge of algos I don't have at any given point in time

#

e.g. if you alter the library I use for voronoi gen then it is pretty obvious you'll get better performance

#

Same goes for QuadTrees or all other things that are a bit beyond me

valid burrow
#

you can optimize alot of stuff just by simple logic

#

99% of optimisation (that actually does any impact) is done by rewriting methods differently

ivory sleet
#

like infrastructure-wise almost

valid burrow
#

conclubuwu when r u gonna boost me in valorant

ivory sleet
#

lol dou even play anymore

valid burrow
#

sometimes yh

ivory sleet
quiet ice
quiet ice
ivory sleet
ivory sleet
valid burrow
#

which happens surprisingly quick

quiet ice
#

ah, so basically the ECS approach?

valid burrow
ivory sleet
#

well more generally than just that, but thats a part of it

ivory sleet
valid burrow
#

thats why we should all start writing our code in 1 class

#

who needs classes anyways

quiet ice
# ivory sleet yeah

from time to time I try to do it, but it doesn't happen super often I suppose

ivory sleet
#

well u compromise on maintainability, reusability and readability then arguably a bit too much

valid burrow
#

i was joking lol

#

i use oop alot

ivory sleet
#

yea, well maybe u should do a bit more of DOP instead

#

:]

ivory sleet
valid burrow
#

maybe im already doing it a bit

#

never learned it propperly

quiet ice
valid burrow
#

60 files changed

tardy delta
#

i heard the word ecs

quiet ice
#

Speaking of data structures: I've always wanted to make a plugin that would store all it's persistent data in a MappedByteBuffer, but I never got around doing this. Storing strings in there in a way that is efficent is surprisingly difficult

eternal oxide
#

yeah, fragmentation/indexing

quiet ice
#

Plus you get issues once you want to actually remove data. It might be good if you need some kind of ring buffer (logs?) or store data that can't/shouldn't be removed (logs), but outside of that I've yet to find a good use for it

ivory sleet
#

but yea also the new module export/import feature is gonna be lit

eternal oxide
#

module?

tardy delta
#

did i miss something?

ivory sleet
tardy delta
#

oh god

eternal night
#

pretty ass

tardy delta
#

is that meant for people who write imports theirselves?

ivory sleet
eternal night
#

I mean, what is the actual difference to a wildcard import

#

beyond only importing exported types

tardy delta
#

so one could do import module java.base? \🤔

eternal night
#

it's still going to break if names change or whatever

#

not that importing is an issue for anyone but people writing in notepad either KEKW

young knoll
#

Pfft who uses imports

#

I always use the fully qualified name

eternal oxide
#

I can;t see much of a usecase

young knoll
#

Less work for the compiler <3

quiet ice
#

Eclipse Ctrl + Shift + O keybind is the best

eternal night
#

Feels like a "you have to write this on paper in an exam? There yo go" JEP KEKW

tardy delta
#

imagine even having to press a keybind, cringe

eternal night
#

completely useless for any normal developer OMEGALUL

quiet ice
eternal oxide
#

basically replacing .* with module

quiet ice
#

It can even automatically import static methods!

tardy delta
#

damn

#

i press ctrl + alt + l and it formats my whole file including everything you said

young knoll
#

I just press CTRL S for that

tardy delta
#

i press <space>fd in neovim for that \💀

quiet ice
#

Well I can do Ctrl + A, Ctrl + Shift + F if I wanted that, but I never do that because it breaks my very special line wrapping

eternal oxide
#

same

tardy delta
#

editorconfig file?

eternal oxide
#

I do CTRL + SHIFT + F on select code

#

I don;t always format things the same, for readability

quiet ice
#

I could also configure eclipse to automatically format on saving, but that I only do if I want to kill the performance of the IDE

charred blaze
#

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65

eternal night
#

is your server running with java 21

#

or well, share more of the error/whats the context

gentle inlet
#

?paste

undone axleBOT
gentle inlet
#

Can someone tell me how to start the travel task when a player join so they get the effects even if they leave adn rejoin I know my code is very messy and bad but I just want to know hoe to start the task for the player on join thanks. https://paste.md-5.net/ifigamufak.cs

charred blaze
#

it should be

eternal night
sacred cedar
#

Hey,
I am trying to display a simple string under the players name and i cannot figure out how to make it work properly on all versions

I've seen that there are ScoreFormats ore something like that that removes the number in front of the string displayed below the name.
But that only works for 1.20.4 clients i've tried using a 1.20.4 server with via version but that doesn't work.
If i am using scoreboards and displayes it still displays the number and i don't want that tbh

I've also tried using a packet api for that but that didn't worked either.

So i am thinking of entities like armor stands or something but that would probably cause massive performance issues in the future so i hope there is another solution for that.

Any help is much appreciated

blazing ocean
#

you can have a y-translation to specify the height coordinate

young knoll
#

How far back do you want to go

sacred cedar
young knoll
#

Because display entities are 1.19.4+

sacred cedar
young knoll
#

Yes

sacred cedar
blazing ocean
#

that's how many servers (e.g. mcc island) do it too, but it really shouldn't cause perf issues as it's just a fancy text component

young knoll
#

They don’t tick

sacred cedar
blazing ocean
#

just do it on-demand

young knoll
#

With 100 players you’d have 100 display entities so that’s basically nothing

sacred cedar
young knoll
#

Not ticking just means they don’t run any logic every tick

blazing ocean
#

say you have a Map<UUID, TextDisplay> you just edit the text component

young knoll
#

They still respond to updates

sacred cedar
#

and how should i handle the normal name tags?
i mean if i want the string to be below the player name then it would be inside the player if do it below the vanilla height of the vanilla nametage?

blazing ocean
#

/transformations

#

where you can have e.g. a y-translation of 0.15f, you'll just have to figure out the magic digits

blazing ocean
#

e.g. i just have something like this

        val textDisplay = world.spawnEntity(player.location, EntityType.TEXT_DISPLAY) as TextDisplay
        textDisplay.text(nameTag)
        val transformation = textDisplay.transformation
        transformation.translation.add(0f, 1f, 0f)
        textDisplay.transformation = transformation
        textDisplay.billboard = Display.Billboard.CENTER
        player.nameTagDisplay = textDisplay
        player.addPassenger(textDisplay)
cinder abyss
#

Hello, with Player#spawnParticle, the particle spawned is only visible for the player ?

blazing ocean
#

yes

sacred cedar
cinder abyss
blazing ocean
sacred cedar
#

or do i need to disable it and create it with a text display?

blazing ocean
#

using scoreboard teams you can hide em

sacred cedar
blazing ocean
vast ledge
#

Ye, add them to a team, and disable name tag visibility

cinder abyss
#

Hello, how can I create a colored particle for spigot under 1.13 ?

vast ledge
#

Packets

cinder abyss
blazing ocean
#

nms my beloved

cinder abyss
#

okay...

blazing ocean
cinder abyss
blazing ocean
cinder abyss
vast ledge
cinder abyss
#

oh perfect thanks

#

because ParticleAPI is a bit heavy, so I want to lightweight a bit my plugin

#

and I'll get more knowledge by doing that

vast ledge
#

Then your plugin is version dependent tho

cinder abyss
sacred cedar
vast ledge
#

NMS changes across version alot

cinder abyss
sacred cedar
#

alrightz

#

alright*

cinder abyss
#

but I only need to make from 1.9 to 1.12.2

vast ledge
#

Then you need diff reflections for each version

cinder abyss
#

but mfnalex is here with his great tutorial(s)

sacred cedar
#

thanks for the help @blazing ocean, @young knoll, @vast ledge

sacred cedar
#

SORRY

cinder abyss
#

x)

blazing ocean
#

which doesn't work across worlds

#

or was that paper

sacred cedar
blazing ocean
#

?jd-s

undone axleBOT
sacred cedar
blazing ocean
#

might work not sure

sacred cedar
blazing ocean
#

i just edit paper to always include that flag

sacred cedar
blazing ocean
sacred cedar
blazing ocean
eternal night
#

doubt they'd benefit from forking paper KEKW

blazing ocean
#

yeah it just depends on your usecase

young knoll
#

Folia is a bit more than just paper but better performance

blazing ocean
#

yeah

eternal night
#

*tiny bit omegaroll

eternal night
#

I wanna say you are just failing at shadow plugin

#

but the one line you posted isn'T really enough to conclude that

charred blaze
eternal night
#

Well yea, you need to switch to the fork

remote swallow
charred blaze
eternal night
remote swallow
#

goober

young knoll
#

We love goober

#

I don’t care that it’s not goober, it is in my heart

remote swallow
#

they mistyped their name

#

its actually goober

sacred cedar
# blazing ocean translations

alright i got it spawning and set it as passanger to the player but 1. it doesnt rotate with the player 2. i cant get it to out of the player model with the transformation

young knoll
#

Set the billboard to vertical to have it rotate

sacred cedar
young knoll
#

You 100% can get it out of the player model with the transformation

#

You can basically put it anywhere

sacred cedar
young knoll
#

Yes

sacred cedar
young knoll
#

Show code

sacred cedar
# young knoll Show code
  TextDisplay textDisplay = player.getWorld().spawn(player.getLocation(), TextDisplay.class);
  Transformation transformation = textDisplay.getTransformation();
  player.setPassenger(textDisplay);
  transformation.getScale().set(0, 6, 0);
  textDisplay.setBillboard(Display.Billboard.VERTICAL);

  textDisplay.setText("Test Display");

i've tried scaling the Y thing up and down but it didnt end up doing anything

young knoll
#

You never do setTransformation

royal heath
#

Is it possible to use JUnit in spigot if it accesses JavaPlugin? I'd imagine not?

young knoll
#

Also use translation not scale

sacred cedar
#

youre right

river oracle
#

Or make your own equivalent

#

Warning mockbucket Is severely limited in use

sacred cedar
royal heath
cinder abyss
silver robin
blazing ocean
cinder abyss
young knoll
#

Center also rotates horizontally

blazing ocean
#

oh

young knoll
#

I don’t think player names do? Idk

sacred cedar
sacred cedar
silver robin
# cinder abyss I forgot to say that : it's for 1.9-1.12.2

the same applies 🙂
instead of concatenating version to org.bukkit.craftbukkit. or net.minecraft.server., create a prefix string and reuse it everytime you need to load a class from there, so you don't care if that prefix string has a version in it or no

blazing ocean
cinder abyss
#

so basically:java public String nms; public String craftBukkit;
? @silver robin

blazing ocean
#

but i guess you could just hide your own nametag

sacred cedar
blazing ocean
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

sacred cedar
blazing ocean
#

yea

sacred cedar
#

and i can see through it from the other side

blazing ocean
blazing ocean
sacred cedar
# blazing ocean looks weird, cna you show your code

Code:

TextDisplay textDisplay = player.getWorld().spawn(player.getEyeLocation(), TextDisplay.class);
Transformation transformation = textDisplay.getTransformation();
player.setPassenger(textDisplay);
transformation.getTranslation().set(0, 1, 0);
textDisplay.setTransformation(transformation);
textDisplay.setBillboard(Display.Billboard.VERTICAL);
textDisplay.setText("Test Display");

CatalyaCore.subTitleMap.put(player.getUniqueId(), textDisplay);
sacred cedar
blazing ocean
#

but that looks fine to me

#

no, add to the translation, not set it

#

it just looks like this for me

        val transformation = textDisplay.transformation
        transformation.translation.add(0f, 1f, 0f)
        textDisplay.transformation = transformation
        textDisplay.billboard = Display.Billboard.VERTICAL
        player.nameTagDisplay = textDisplay
        player.addPassenger(textDisplay)
young knoll
#

The translation is 0 0 0 by default

#

So set and add are the same

blazing ocean
#

makes sense ig

sacred cedar
#

and there is no add lol

#

its just set

blazing ocean
#

there is for me 🤷

blazing ocean
#

transformation.translation.add()

sacred cedar
#

oh you mean that

young knoll
#

getTranslation()*

#

Silly Kotlin user :p

blazing ocean
sacred cedar
sacred cedar
#

it still spawns like this

eternal night
#

hopefully immutable

young knoll
#

What is

blazing ocean
#

wouldn't have happened with kotlin

eternal night
#

oh yea it is mutable OMEGALUL

grim hound
#

Does anyone know how the UUID in LoginStart from the client is determined?

eternal night
sacred cedar
blazing ocean
#

think it's see through

sacred cedar
blazing ocean
#

okay then wdym

sacred cedar
sacred cedar
#

its like not there

blazing ocean
sacred cedar
blazing ocean
#

try setting the billboard to center

sacred cedar
#

now its moving with the cam so its moving up and down

#

and normal nametags do the same thing if i see it correctly

#

i am so fucking stupid

grim hound
shell matrix
#

is anyone experienced with converting old base64 strings to the new format? e.g. 1.20.2 inventories that should be converted for 1.20.6?

silver robin
silver robin
grim hound
#

What does he base it on?

#

Or is it purely random on each join?

silver robin
grim hound
#

Does the client do the exact same thing?

silver robin
#

no, the client of course sends his own real UUID (which the server won't use anyway), the client doesn't have to generate anything for that packet

#

unless you're talking about pirated clients, in which case you gotta find out yourself

chrome beacon
silver robin
#

in summary, the cracked user does not generate their uuid, the server does that based on their username

eternal night
#

omegaroll as if anyone gives a shit about cracked players

#

sounds like a personal issue

grim hound
#

A uuid in login start

sacred cedar
# blazing ocean coll smh

uhm i am now having the issue where the new name tag is weirdly moving and is not really mounted to the player in this case

here you see the vanilla nametag and the custom one: https://imgur.com/a/cc9grBJ
the custom one should be at the same location that the vanilla one is but it isnt staying there
you know how to fix it?

grim hound
#

What does the client base it on

grim hound
silver robin
eternal night
#

(which, clients could put anything in there KEKW)

silver robin
#

and that's why the server deliberately ignores that data

wet breach
wet breach
#

since the server doesn't need to do any verification it simply just doesn't look to the packet for any uuid stuff

#

but, online mode requires a uuid, so they didn't want to have duplicate stuff 😛

silver robin
cinder abyss
wet breach
#

just as I remembered

#

the exploit 2 years ago had to do with mojang having legacy auth api still available

#

had nothing to do with UUID's

silver robin
# cinder abyss and for getting nms package?

unless you are asking for half of the NMS package instead of something specific, you might want to use .getHandle() on OBC objects, it gets most stuff done

otherwise, if there is any connection between Spigot and NMS just how spigot and OBC are closely related, you could resolve NMS package from there, I don't know about any though

wet breach
#

well 4 years ago I mean

grim hound
#

Then is there any way for the server to send a packet containing a certain value, so that if that same client logs in and the server requests that value the client replies with the saved value?

wet breach
slender elbow
#

i mean you have cookies now but those are ephemeral

#

so, not without a mod

grim hound
#

But minecraft

silver robin
grim hound
#

That's something you can save on the client's pc

wet breach
slender elbow
#

you can't get RPs from a client

grim hound
#

Can you request for that?

grim hound
wet breach
#

because I am pretty sure the server already does that

grim hound
wet breach
#

cracked players don't get authenticated

grim hound
#

As an addition to my login plugin

wet breach
#

so what are you wanting to cache?

grim hound
#

So not mojang auth

#

My auth

wet breach
#

but how would you guarantee that?

slender elbow
#

that's what they're trying to figure out lol

silver robin
#

by the way, this lib worked great, the only thing I'd like to ask for is is there a way to modify the packet before it gets sent S->C, or modify a C->S packet before it gets processed by the server?

grim hound
wet breach
#

there is only one way to do it that I know of

grim hound
#

Their packet listeners

#

Do that automatically

#

So just register a PacketListener

#

And set PacketEvent#setCancelled(true)

grim hound
#

I'm out of ideas myself

wet breach
#

you would need to use your own custom launcher that simulates mojang's auth stuff. Essentially you will have to run your own auth server. However, this is probably one of the few things that would probably land you in hot water as this is directly violates DMCA as the whole user login stuff is considered DRM

grim hound
#

Please go on

grim hound
#

No custom launcher

#

Too much hassle

wet breach
#

its the only way, and that is how Mojang does their auth

#

unless you go with a mod I guess

silver robin
#

PacketEvents packet data interception and modify

wet breach
#

add in the menu to login, and have that sent over using plugin messaging channels or whatever

slender elbow
#

crazy idea, but, have you considered asking the player for a password? 🤯

wet breach
slender elbow
#

yeah lmao

chrome beacon
#

You can replace the auth server that both client and server uses

#

that will allow for "online" mode

chrome beacon
#

but using your auth server

kind hatch
#

But you're entering mod/custom client territory at that point.

chrome beacon
grim hound
#

But now I'd want a way for an autologin

#

Except FastLogin and IP autologin

#

Since ip autologin might be dangerous

eternal night
#

@slender elbow caught supporting offline mode people?

grim hound
#

I'd want another way for non-premium to auth

slender elbow
eternal night
winter cradle
#

i literally just asked her that myself lol

cinder abyss
#

Hello, how can I includes those as classes in Class#getMethod? I know how to cast but it returns me an array, so it's not in the arguments of this method...

kind hatch
#

That looks like reflection. You can just use ClassName.class

cinder abyss
#

on what should I use that?

vast ledge
#

God

kind hatch
#

On the parameter asking for a class.

cinder abyss
#

I've done that:

#
protected Object callMethodWithReturn(Object instance, String methodName, Object... args) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
    Class<?>[] classes = (Class<?>[]) Arrays.stream(args).map(Object::getClass).toArray();
    
    Method method = instance.getClass().getMethod(methodName, classes);

    return method.invoke(instance, args);
}```
#

is it good?

grim hound
#

Ye

cinder abyss
#

okay thanks

cinder abyss
# grim hound Ye

😭 Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Class;

tardy delta
#

first id assume

cinder abyss
eternal night
#

you don't get to cast arrays like that

cinder abyss
grim hound
#

for loop

cinder abyss
#

logical

#

okay, let me cook

eternal night
#

final Class<?>[] array = Arrays.stream(args).map(Object::getClass).toArray(Class[]::new)

tardy delta
#

and why exactly doesnt that work?

#

runtime type would be the same no?

eternal night
#

no

grim hound
#

Oh it's a Object[]

#

But each entry holds a Class

#

I guess

cinder abyss
#

oooh

#

I need to get the super class

eternal night
#

Yea that is going to be the non fun part of "dynamically" guessing the method signature

tardy delta
#

arrays are covariant so i dont see the issue here

blazing ocean
#

reflection looks like so much fun

blazing ocean
cinder abyss
#

after it works

tardy delta
#

Array.newInstance moment probably

eternal night
#

arrays are objects like anything else

#

if you create a Object[] and fill that with strings, that does not magically make it a String[]

grim hound
eternal night
#

it is an Object[] array but with strings inside, not a String[] with strings inside

grim hound
#

Into int[]

#

Even if each entry is an int

slender elbow
#

i mean that isn't gonna work but for different reasons

tardy delta
#

whereas generics are invariant

slender elbow
#

you can cast a String[] into an Object[] just fine, but that doesn't mean you can cast every Object[] into a String[]

eternal night
#

if you worked a bit with java, I am sure you ran into that message

tardy delta
#

type erasure ofc yes

eternal night
#

yea its because the array type is more than just "array of something"

cinder abyss
wicked sinew
#

Is it normal for some things to just not appear in the 1.20.6 snapshot? 🤨 or did I break my maven, cannot find random things such as EventPriority, or EquipmentSlot

remote swallow
#

update intellij

eternal night
#

update IntelliJ

#

🥷

remote swallow
#

get sniped

slender elbow
#

update intellij

eternal night
#

update vscode

wicked sinew
#

how is that a thing 🤣

#

They were right tho, IntelliJ

remote swallow
wicked sinew
#

"You already have the latest version of IntelliJ IDEA and plugins installed." hmmm

tall saffron
#

How do i get if a message contains a url?

wicked sinew
eternal night
tall saffron
wicked sinew
wicked sinew
eternal night
cinder abyss
tall saffron
tardy delta
#

create a Pattern, and use it to create a matcher for a string

wicked sinew
pliant topaz
#

update to IntelliJ 2024

wicked sinew
#

yea-- just saw that and already did 🤣

#

no clue why tf I had 2022

#

thank you

cinder abyss
#

Hello, how can I define the color of a redstone particle in nms? Here is what protocol says

#

but, actually when I put my values of rgb in data, divided by 255, I get a red dust, and without dividing, looks like it's a random color

slender elbow
#

afaik nowadays the color is written as 3 floats, 0-1 for each rgb component

cinder abyss
slender elbow
#

ah good luck

cinder abyss
#

lol, thanks

obsidian wolf
#

Does anyone know why my server keeps "timing out" when I try and load this schematic?

#

heres what the schamatic page says

kind hatch
#

Probably because it's a massive schematic

#

You should be using FAWE if you need to modify large chunks of the world.

obsidian wolf
#

so do I just delete my old worldedit plugin and try and use FAWE

blazing ocean
#

yes

obsidian wolf
#

and will FAWE work with little lag?

#

(and not crash the server 💀)

blazing ocean
#

i mean it should

kind hatch
#

It's a significant improvement over regular worldedit.

blazing ocean
#

?tas

undone axleBOT
kind hatch
#

There are a few bugs with some of the more advanced commands, but it's far better for general stuff like pasting schems and simple edits.

#

Especially since it uses workload distribution

obsidian wolf
#

ah

#

i gotchu'

obsidian wolf
wide moth
#

Hi, how to make custom drops in BlockBreakEvent, I tried adding my item do getDrops(), but getDrops() creates copy.

inner mulch
trim lake
#

Is there some way how to get plugin main class else than static getter in main class or sending true constructor to all classes? I want to build PDC util but I kinda dont want to send main class true all classes with will use this util.

remote swallow
#

could Bukkit.getPlugin it

#

or getProvidingPlugin

trim lake
#

sounds better and I will not need to send instnace to every class witch will use pdc, or I will just make static getter for this and fkit and how bad it is lol

wet breach
#

why are you avoiding OOP?

alpine urchin
#

he's come from C

wet breach
#

there is objective C

alpine urchin
#

XD

#

which is objectively better

#

that's irony btw before you type an essay

wet breach
#

not necessarily, just a different style

slender elbow
#

i mean tbh NamespacedKeys are something you should be able to keep as constants, which you can if you use the deprecated factory methods anyway

trim lake
#

it is anyoing for me to send the main class to each class that will work with PDC... I know I should do that that way lol

wet breach
#

ok, but why would every single class need the main class?

trim lake
#

nah but lot of them

wet breach
#

then you have a design problem if that is the case

trim lake
#

I only need main class bcs of NamespacedKey... thats the issiue

#

mostly I will need NamespacedKey not main class it self

wet breach
#

so pass that to another class

trim lake
#

but will need main class for them

eternal night
#

or just use the constructor that takes two strings 😉

wet breach
#

or that

kind hatch
#

Or use the static getter from JavaPlugin to use for the key.

trim lake
#

yep... probably will need to do that, I will make some enum list or what ever that will hold my NameSpacedKeys that will be best probably

trim lake
slender elbow
#

just do whatever

#

it's fine for something like a NamespacedKey

trim lake
#

Okey thanks, kinda want to store PDC keys in enum (maybe list/map will be better) to be ezy accessible and consistent that what I will think of how to do it on my own. Thanks guys

silver robin
#

when I add a new property in config.yml, and run the plugin, the old config file remains and the new property isn't in there
I just do this.saveDefaultConfig() for now
any way to update the config without losing previous data?

kind hatch
#

Not with a simple api method.
You have to add the sections yourself.

quasi gulch
#

Hi. Does every OfflinePlayer i get with getOfflinePlayers from the server cache have a PlayerProfile with Textures and a name? Or are there cases that dont have them?

mellow edge
#

why is there no class called "CraftTeam"

#

?

chrome beacon
mellow edge
#

or does it have an alternative

chrome beacon
#

You can update the profile though

#

will fetch textures and names

quasi gulch
#

okay

worthy yarrow
mellow edge
#

I want to get the class that is implementing org.spigot.scoreboard.Team, I cannot find it, probably because CraftBukkit has nothing to do with Spigot classes.

#

but I still need the class

chrome beacon
#

CraftTeam does exist

#

Why do you need it though

mellow edge
#

my main goal:

#

I try to send PacketPlayOutScoreboardTeam to hide a username of my npc, but I don't exactly know how I could do it.

chrome beacon
#

Just use the api

#

There's no need for packets

mellow edge
#

but the NPC is not registered into the server it is just sent with packets

chrome beacon
#

Teams don't care

#

It probably won't work

#

I mean try it and see

worthy yarrow
#

… I mean I’d give you a ?tas, but why would you do that anyway?

mellow edge
#

I will try to just register the team and then add the npc into it, I don't know how this will work, I did not register it anywhere.

obsidian wolf
#

Does anyone know any spigot NPC mods where if you right click or smth it teleports you like a rtp command? (that is free)

chrome beacon
#

Citizens

#

also this is the wrong channel

obsidian wolf
#

Citizens is a paid plugin though no?

chrome beacon
#

no

alpine urchin
#

it's paid on spigotmc

chrome beacon
#

You can get it for free

obsidian wolf
#

does the bukkit one still work?

alpine urchin
#

but you can get it for free

obsidian wolf
#

on 1.20

alpine urchin
#

you can pay for it to support

#

the dev

worthy yarrow
#

^ I would

#

Citizens almost as large as towny innit?

obsidian wolf
#

would it work on 1.20 (the free one)

chrome beacon
#

There is no difference

alpine urchin
#

it's free dude

#

try it

obsidian wolf
#

ok

chrome beacon
#

Citizens is pay for support

alpine urchin
#

if ur not gonna pay for it

#

u got time to try it

worthy yarrow
#

Truth

worthy yarrow
#

Citizens is pretty cool

alpine urchin
#

why me

worthy yarrow
#

Not you specifically

#

Just meant whether you pay to support or just get it free, you should have the time to test it lol

alpine urchin
#

ok xd

worthy yarrow
#

Don’t look at me like I’m dumb

#

I’m fresh outa bed!

alpine urchin
#

i don't run a server