#help-development

1 messages · Page 875 of 1

quaint mantle
#

Cute name

#

I found it very funny

#

Lol

river oracle
#

its named after my lib Pineapple

quaint mantle
river oracle
#

i name all my libraries either a word in another language or after some random tihng

#

my Database Library is called Raven

upper hazel
#

what is the best way to make events compatible from 2 different plugins if there is a possibility that 1 event will be processed in 2 two plugins at once

quaint mantle
#

@EventHandler(priority = EventPriority.HIGHEST)

timid hedge
#

I have no idea why but when i launch my server im getting a warning about the server couldnt read my config correct

Config: https://pastebin.com/D1RvhAPr

upper hazel
#

which one is best

quaint mantle
#

well just look at the enum

#

read what it says

upper hazel
#

i mean what priority is usually given if the role is the same

quaint mantle
#

CTRL + LEFT_CLICK on it too jump to the enum

quaint mantle
#

I think their is EventPriority.NORMAL that's given by default

#

HIGHEST
Event call is critical and must have the final say in what happens to the even

#

LOWEST
Event call is of very low importance and should be run first, to allow other plugins to further customise the outcome

river oracle
#

@eternal night kinda confused how to include the core in my published jar. Right now it only contains the modules code https://paste.md-5.net/uricuhohix.cs. Are you sure I don't need shadow jar?

quaint mantle
#

Use "LOWEST" if u want first call

#

Use HIGHEST if u want last licks

upper hazel
#

for example, there is protectionStones which processes possibly playerMoveEvent and my plugin does the same

#

both need send message to player

#

what they in region

quaint mantle
#

Whats wrong?

quaint mantle
#

Its very common that multiple plugins listen to same event lol

upper hazel
quaint mantle
#

If that other plugin sends the message

#

And you cannot disable it, therefore you must remove that plugin, or change that plugins code to not do that

#

Otherwise your stuck with two plugins doing the same thing

upper hazel
#

does that mean 1 of them should have priority?

#

like LOWEST

quaint mantle
#

Either way the message will be sent from that other plugin

#

I just said

#

Re-read what i said please

upper hazel
#

bruh

#

if this so

quaint mantle
#

What i would do:

  • See if you can change the message in the other plugin to include the message you would have wanted to send in your plugin's 'PlayerMoveEvent'

  • Decompile the other plugin and just change it manually, and then re-compile

quaint mantle
upper hazel
#

I just didn’t expect everything to be like this, I was told that protectionStones will be in the assembly just now

quaint mantle
#

Have you tried configuring it to stop the message from sending? As I suggested previously.

upper hazel
#

translation error - I mean I didn't expect it to be like this because I was told the build would only change now

quaint mantle
upper hazel
#

BRUH stupid translation

#

i so dont like this google translation

rotund ravine
#

@burnt elm Purpur. jk jk

burnt elm
#

what?

rotund ravine
#

silkspawners

burnt elm
#

Yes?

rotund ravine
#

Purrrpurrr

lilac dagger
#

guys, there's a homeless cat in here

burnt elm
#

why are you purring at me lmao

#

Im using Luckperms and SilkSpawners and i just need someone to guide me through setting it up man 🥲

lilac dagger
#

it shouldn't be too hard, read all the config keys

#

they should have enough info

burnt elm
#

Im sorry, it is hard for me as ive never done any of this before and understand nothing lmao.... I tried typing the command for permissions in minecraft but it still dont work so im out of luck

lilac dagger
#

out of luck with luckperms? how strange

burnt elm
#

thanks for the help.

lilac dagger
#

i'm sorry, i didn't mean to to be mean, it was just a joke, i haven't played with those two and i don't know how i can help you on top of my head

river oracle
#

its a web editor and it gives auto completion for most commands

#

also lets you easily add and manage groups

#

you can find SilkSpawners permissions likely on their plugin page or wiki if they have one

lilac dagger
#

these seem to be helpful

burnt elm
remote swallow
#

if you have op it should work

#

if not run it in console

river oracle
#

if you don't have any form of operator you can't setup luckperms

#

so no i suppose in that sense

burnt elm
#

Ok tysm! Ill read all of this in a sec

burnt elm
#

Ok so i do have operator. For example; I tried using the "silkspawners.break.*" on myself in the lp editor website. But it still didnt work. What am i doing wrong...

chrome beacon
burnt elm
#

Yes! I clicked the save button and ingame it said i loaded x many configs blabla

sage patio
chrome beacon
#

yeah

#

Most things in the Spigot api are not thread safe

echo basalt
#

Mm songoda

hollow oxide
#

[22:32:16 INFO]: item^3: block.minecraft.stone
[22:32:16 INFO]: item^4: block.minecraft.air

for

Bukkit.broadcastMessage("item^3:"+item.getType().getBlockTranslationKey();
Bukkit.broadcastMessage("item^4: "+item.getTranslationKey());

i'm doing an ItemStack builder and it's not working, i think this may be the issue.

remote swallow
#

you have to use it inside a translation component

sage patio
sage patio
inner mulch
#

java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Float (java.lang.Integer and java.lang.Float are in module java.base of loader 'bootstrap')

why can i not cast a int to a float?

worldly ingot
remote swallow
#

read what choco said

worldly ingot
#

Soon you'll be able to have an ItemType and just pass it directly to a TranslatableComponent Kreygasm

hollow oxide
#

k thx i'll try it

rotund ravine
#

I'll marry ur wife too

worldly ingot
#

Taken like bacon

remote swallow
#

jan is ur wife now

hollow oxide
#

Caused by: java.lang.ClassNotFoundException: net.md_5.bungee.api.chat.TranslatableComponent at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[bukkit-1.20.1-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[bukkit-1.20.1-R0.1-SNAPSHOT.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] at fr.axsc6_l.wamasterv3.interfaces.Interface.command(Interface.java:104) ~[?:?] at fr.axsc6_l.wamasterv3.commands.Commands.onCommand(Commands.java:48) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[bukkit-1.20.1-R0.1-SNAPSHOT.jar:?] ... 23 more

for

remote swallow
#

why are you running bukkit

rotund ravine
#

run spigot

#

or a fork thereof

#

also run newer

remote swallow
#

also you cant broadcast a translateable component

#

you need to use Player#spigot().sendMessage

hollow oxide
#

k

hollow oxide
remote swallow
#

spigot includes bukkit

#

bukkit doesnt include spigot

hollow oxide
#

k

#

thx

icy monolith
#

Anyne knows fix to this? Why sometimes when adding to a value it eather does something that ends with 0001 or 9999 and dosnt round it even tho all i did was add 0.2 to the value

hollow oxide
#

it's a problem from java (the actual language)

#

there is the same problem with python

sullen marlin
#

how did you even get a bukkit jar

young knoll
#

Yay floating point precision

hollow oxide
sullen marlin
#

yeah

hollow oxide
#

it's a craftbukkit

#

i guess

sullen marlin
#

yeah how did you even get that

young knoll
#

I have my guesses

hollow oxide
sullen marlin
#

it hasn't been made by default in like 4 years

#

maybe longer

lilac dagger
#

wait a second, it's 69mb too

remote swallow
#

what craftbukkit

lilac dagger
#

it's recent

young knoll
#

Well yeah

remote swallow
#

ah get bukkit

#

thats not offical

young knoll
#

It’s 1.20.1

remote swallow
#

dont use it

sullen marlin
#

why are they still releasing such jars

remote swallow
#

fuck knows

icy monolith
remote swallow
#

one site even realease vanilla mc jars

young knoll
#

Round your output

lilac dagger
#

some of my plugins for example won't work on craftbukkit

young knoll
#

Or numberformat it

hollow oxide
#

that's the first website when writing bukkit or spigot

icy monolith
young knoll
#

Well you will get less precision errors since it has more bits to work with

#

But yes

lilac dagger
#

it's double in precision

young knoll
#

Exactly!

lilac dagger
#

that's why the datatype

#

not sure why floating point is the name for floats

young knoll
#

Because the decimal point floats

hollow oxide
#
for (List<String> arg :argss){
            for (String i : arg){Bukkit.broadcastMessage(i);}
            Material m = Material.valueOf(arg.get(1));
            ItemStack item = new ItemStack(m,Integer.parseInt(arg.get(2)));
            inv.setItem(Integer.parseInt(arg.get(0)),item);```

this does not works 
arg contains: 
[22:54:48 INFO]: 20
[22:54:48 INFO]: STONE
[22:54:48 INFO]: 0
[22:54:48 INFO]: 0
[22:54:48 INFO]: -1
[22:54:48 INFO]: ¤name¤
[22:54:48 INFO]: €lore1€
[22:54:48 INFO]: €lore2€

but i did try without and it's still not working
young knoll
#

What

hollow oxide
#

?

rotund ravine
#

What is argsss

young knoll
#

What doesn’t work

rotund ravine
#

This looks cursed

hollow oxide
hollow oxide
torn shuttle
#

this is a first

#

someone asking for support in latin

young knoll
#

Did you try to run it again

icy monolith
#

Qick question, does use of Public Static hurt efficiency? I use it in my Manager classes that manage stuff like setting new locations so that i can call them form anywhere with just <class>.<function>().

inner mulch
young knoll
#

Yeah you can’t do that

inner mulch
#

no way to fix?

young knoll
#

Make a new runnable

inner mulch
#

i saved the runnable as a final variable as they never change

#

so a new one it is?

young knoll
#

Yes

lilac dagger
#

use it for utils, singletons and some other things

#

like static final fields

ivory sleet
#

In general, using public static fields nonfinal is considered a bad practice mainly because its hard to maintain

#

public static final can be fine,
private static is fine for singleton instances
public static methods that are stateless and pure

icy monolith
#

I might need to learn what exaclty public, private, static and final stand for. but thanks ill note that. Up to this point i just used public and if the editor corrected me i changed it lol

lilac dagger
#

public and private is for if you can access a method field from outside or not while final is to prevent fields from being reassignable and for methods it prevents sub classes from overridding said method

#

if final is used in the class declaration it prevents subclasses from extending said class

icy monolith
#

Yeah, atm i only use static for utils and for GUI's

lilac dagger
#

you might wanna reconsider in guis

icy monolith
#

I use it to call openInventory command

#

So it comes out as <guiname>.openInventory(player)

lilac dagger
#

yeah but if you hold an object somewhere you could then do events checks on said inventory

#

using names to check if you are in a specific inventory is quiet dangerous since deluxemenu found out what happened

icy monolith
#

i dont use names My classes are the gui name

lilac dagger
#

how do you check in your click event if you are in the right menu?

icy monolith
#

i said <guiname> bc all guis have a class that is named after the gui

icy monolith
hollow oxide
#
for (List<String> arg :argss){
            Material m = Material.valueOf(arg.get(1));
            ItemStack item = new ItemStack(m,Integer.parseInt(arg.get(2)));
            player.spigot().sendMessage(new TranslatableComponent(item.getType().getBlockTranslationKey()));
            Bukkit.broadcastMessage(arg.get(2)+arg.get(0));
            inv.setItem(Integer.parseInt(arg.get(0)),item);}

got this in chat

#

but th inv is empty (it's an inventory)

icy monolith
#

When creating ui it saves the inventory as inv and then i just check if it is the inv

#

value

lilac dagger
#

alright

icy monolith
#
inv = Bukkit.createInventory(null, 27, StringManager.parse("&6Backpack"));

initItems(player);

player.openInventory(inv);```
#

example of how i would save it and create it at the same time

#

And StringManager would represent one of my Utils classes for strings

lilac dagger
#

StringManager is misleading, name it a StringUtil instead

hollow oxide
young knoll
#

You are setting the itemstack amount to 0

timid hedge
#

I know this dosent belong to here but i dont know where i else should get help

So i have a plugin that i can connect mysql to, but when i try it i am getting this error in the console
Caused by: java.sql.SQLInvalidAuthorizationSpecException: Access denied for user 'root'@'localhost' (using password: NO)
And all the information is typed right in, i have checked many times

rotund ravine
#

If ur not the dev

tender shard
hollow oxide
sullen wharf
#

And what is Either.Left/Right 🤔

rotund ravine
slender elbow
#

Either type my beloved

minor junco
# tender shard Very useful IJ

No idea about Kotlin, but couldn't it be that result is nullable thus it is expected from you to also handle the null branch

sharp heart
#

Hello, with nms in 1.20.4, to spawn an entity, X Y and Z types are "Double", but EntityDataSerializers don't have Double, how I must do ?

chrome beacon
#

The spawn entity packet takes doubles

tender shard
#

its again only IJ complaining

#

but IJ complains all the time when depending on a shaded project artifact duh

#

meanwhile gradle doesnt complain

sharp heart
chrome beacon
#

Yeah

#

You're not supposed to put the coordinates there

sharp heart
#

I'm supposed to set it in the entity ?

#

so the coordinates will be sent with ClientboundAddEntityPacket

chrome beacon
#

As I said the packet takes the coordinates

sharp heart
#

which packet ?

chrome beacon
#

Add entity

sharp heart
#

this packet the the coodinates of the entity in the constructor, there isn't other way to set it

chrome beacon
#

Yeah

sharp heart
#

the problem is that I cant define entity coordinates

#

it give me a NoSuchMethodError

chrome beacon
#

Use the constructor?

chrome beacon
sharp heart
#

and my server is spigot

sullen marlin
#

?whereami

sharp heart
#

i'm using paper but I need to test my plugin on spigot servers

rotund ravine
chrome beacon
#

So this was an xy problem all along

sharp heart
rotund ravine
#

Use spigot as dependency

eternal night
#

if you support spigot, depend on spigot ^

chrome beacon
#

?xy

undone axleBOT
rotund ravine
#

If spigot is ur usecase

sharp heart
#

I need to use paper for nms

rotund ravine
#

?nms

rotund ravine
#

Spigot has maven remapping too

sharp heart
#

maven 😐

eternal night
#

if you are fucking around in internals you need two different sets of modules anyway

#

there is 0 guarantee that papers internal functions remotely close to spigots

#

or that the same methods exists

orchid gazelle
sharp heart
#

the problem is that this method use maven

sharp heart
rotund ravine
#

Ignore DaFeist

orchid gazelle
chrome beacon
#

Gradle is pain

orchid gazelle
eternal night
#

not that this matters

sharp heart
#

Paper is more simple to manage nms

eternal night
#

I mean, either drop spigot as a supported platform or figure out how to import and remap it under gradle

rotund ravine
#

If u wanna use paperweight and paper, .. ^^

eternal night
#

I thikn there are third party gradle plugins

#

for that

orchid gazelle
eternal night
#

completely wrong

#

spigot nms is spigot NMS

#

it is not guaranteed to be compatible with paper

orchid gazelle
#

paper nms 99% works with spigot nms

remote swallow
#

it should be for now

#

untill you guys stop relocating

eternal night
#

no, it does not

#

we yank methods

orchid gazelle
#

haven't had an issue with it yet

eternal night
#

we change stuff

sharp heart
#

wanna die

remote swallow
#

ill yank ur mom

rotund ravine
sharp heart
#

I don't fck want to use maven

eternal night
sharp heart
#

gradle is x100 better than maven

chrome beacon
eternal night
#

again, I tzhink there are third party plugins

#

let me see if I can find a link

orchid gazelle
#

idk in which world gradle is 100x better than maven

#

smh

sharp heart
eternal night
orchid gazelle
#

are you living in another universe?

sharp heart
tender shard
eternal night
#

actually @tender shard do you recall thje spigot gradle plugin

remote swallow
#

patrick choe spigot remapper

rotund ravine
#

Idk

#

Google gave this

remote swallow
eternal night
#

yea ^

#

that one is the one I recalled

tender shard
orchid gazelle
eternal night
#

the one epic linked

rotund ravine
#

The actual comparison should be more accurate in difficulty

#

Gradle is nowhere near making ur own campfire

eternal night
#

if the only addition you can make to a conversation is trashing on build tools, maybe find a better discussion to be apart of

tender shard
sharp heart
orchid gazelle
eternal night
#

go to general to be bored kekwhyper

orchid gazelle
#

well but nobody was talking there

eternal night
plain plaza
#

What event is triggered when giving an allay an item?
PlayerInteractAtEntityEvent and PlayerInteractEntityEvent both doesn't seem to work.

rotund ravine
#

Interesting

sharp heart
eternal night
#

quick last side node

#

spigot NMS is not always compatible with paper NMS

#

if you need/want both, have modules for both or at least the option to do so

fervent robin
#

?paste

undone axleBOT
fervent robin
#

Hey, I keep getting "Operation not allowed after ResultSet closed" on the getCoins method

hazy parrot
#

don't return ResultSet

#

its inside try-with-resources

#

it will be closed before you use it again

#

i would personally use consumer here

#

but you can also return CachedResultSet

tender shard
#

why does git claim that my main branch is up to date with remote, even though there's new commits (which I also could successfully pull)

worldly ingot
#

Because you didn't git fetch :p

fervent robin
tender shard
#

like yeah I bought a book about git, I don't want to read 50 pages about the advantages of git duh

worldly ingot
#

I mean I never read a book but you're always going to learn something new about git as time goes on. Best you can do is just fuck up and learn

hazy parrot
worldly ingot
#

Learning fixup commits and interactive rebasing was a life changer

tender shard
remote swallow
worldly ingot
#

Dude I wish all novels would just give away the ending at the beginning 😔 ✊

tender shard
#

git out or I'll commit a crime, choco

worldly ingot
tender shard
slender elbow
#

wanting to contribute to a certain project that works around patches and stuff

#

🤔

remote swallow
#

Purpurfisj

worldly ingot
#

Spigot does it, but yes, I do have to work on Paper forks at work lol

#

(not Hypixel - just clarifying)

remote swallow
#

Fuck

slender elbow
#

heretic

slender elbow
remote swallow
#

I was just about to say when did they update

worldly ingot
#

git commit --fixup <reference> lets you basically amend a commit's contents later down the line. It will commit to the HEAD of your branch and the commit message of the reference one and prepend "fixup!" for an interactive rebase to automatically find it and be like "ayo this is a fixup, imma squash this"

slender elbow
#

I was hoping you'd give me their source code

#

for vbucks

worldly ingot
#

and interactive rebases lets you do pretty much anything with each individual commit

#

including squashing, editing, amending a message, or even reordering if you want

remote swallow
#

Choco ill give you 9 freddos and a dog for ur hypixel ftp info

worldly ingot
#

OMEGALUL he thinks we're using FTP

remote swallow
#

Are you not

#

Why would hypixel not use some form of ftp

tender shard
remote swallow
#

Oh wait you have auto instance starting so its kubernates type thing

#

Smh

#

I append my offer to all hypixel logins and domains of them

crystal magnet
#

With BungeeCord being multithreaded, do I need to use concurrent collections if I access them in an event handler, or is it safe to use normal ones?

sullen marlin
#

would need to be concurrent or otherwise thread safe

#

an event to do with a certain player will always be on the same thread though

crystal magnet
#

so event handlers are called on the player's connection thread?

sullen marlin
#

Yes

deep herald
#

anyone know how to get the player's ip?

#

is it player.getAddress().getAddress().getHostAddress()

#

it says geta

sullen marlin
#

Read the docs

#

?jd-bungee

#

?bd

#

?jd

undone axleBOT
sullen marlin
dry forum
gloomy ocean
#

hello all, does anyone know of a shop chest plugin that uses minecraft metals like iron, gold, diamond, and emerald as currency or do i have to make one

cursive kite
#

I am struggling with a dumb thing

#

I am trying to push my project to my github repo

#

but it keeps missing some of the packages

#

i cant figure out how to force push everything

ashen quest
#

Why is reload different from a stop and then start

And is there a way using code to reload a specific plugin

quaint mantle
#

how do i get a map canvas from a map

ashen quest
cursive kite
#

I am using eclipse

sullen marlin
quaint mantle
#

this

#

so i can draw on it

sullen marlin
#

Yes but where do you want to get from

quaint mantle
#

a map

sullen marlin
#

A map item?

quaint mantle
#

yeah

sullen marlin
#

?jd

undone axleBOT
sullen marlin
#

Bukkit.getMap(MapMeta.getMapId())

#

MapMeta from ItemStack.getItemMeta

quaint mantle
#

then maprenderer?

sullen marlin
#

Yes then you add a custom renderer

quaint mantle
#

im so confused

knotty aspen
#

its a class you can extend

sharp heart
#

Hello I'm back, so i'm trying to make a plugin with paper packets and spigot packets, but I don't understand how I'm suppose to import spigot packets

dry hazel
#

there is no API for packets

tender shard
#

but what are "paper packets" or "spigot packets"?

#

there's only NMS / mojang / vanilla / however you wanna call it packets

shadow night
#

If the server sent a custom packet to a client the client would leave the server with an error of invalid packet afaik

sharp heart
tender shard
#

no clue what paper methods you're talking about

#

do yo uhave any example?

quaint mantle
#

does anybody know why this method works on my 1.20 project and not on this 1.8.9 plugin ?

#

says "Cannot resolve method 'of' in 'ChatColor'"

shadow night
tender shard
#

paper also doesnt have any packet api

shadow night
#

Obviously.

#

A packet api would be a pain in the ass

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

tender shard
#

1.8.9 API doesnt have that method yet

#

hex colors were added in 1.16

quaint mantle
#

got it

tender shard
#

1.8 only has the regular 0-9 and a-f colors

sharp heart
#

Ok I will resume my main problem, I'm trying to spawn an entity through packets, with paper it works, but with spigot I need to define x y and z pos of the entity, but I just can't

tender shard
#

show your code

sharp heart
#

I don't undertstand how I'm supposed to define entity pos with spigot only

tender shard
#

packets work exactly the same on spigot and paper. so how does your current code look like?

sharp heart
#
   private void build() {
        final Display display = this.getDisplayType();
        display.setBillboardConstraints(net.minecraft.world.entity.Display.BillboardConstraints.FIXED);
        display.setInvulnerable(true);
        display.setPos(this.location.getX(), this.location.getY(), this.location.getZ());
        display.setYRot(this.yaw);
        display.setXRot(0);
        display.setId(this.entityId);

        this.display = display;
    }
#

this is my entity

#

setPos method doesn't exist with spigot

knotty aspen
#

packets for displays seems needlessly complicated, they don't even tick

tender shard
#

which type / class is "Display"?

knotty aspen
#

so really no reason to make them fake, you can have tens of thousands of them and the server won't care

sharp heart
tender shard
#

? nms

#

?nms

tender shard
#

^

sharp heart
tender shard
knotty aspen
#

Using packets for entities makes sense if you want to avoid load on the server

#

Display entities are incredibly cheap and don't cause any meaningful load

sharp heart
knotty aspen
#

Yes

#

I've literally had 25k display entities before, at 3 ms per tick

tender shard
knotty aspen
#

They do absolutely nothing on the server, they just sit there and have no physics or anything

sharp heart
tender shard
#

you should just spawn them normally using spigot

knotty aspen
#

It adds a lot of complexity for little to no benefit

sharp heart
#

I made packet to make them visible in a certain distance

tender shard
sharp heart
#

bro wtf..

#

this shit exist

tender shard
#

in 99% of cases, using packets is a bad idea

lilac dagger
#

does buildtool have latest as revision?

sharp heart
#

GREAT

#

bro I made a fck subprojet system for gradle

#

so that all versions of packets should be compatible with my plugin

tender shard
lilac dagger
#

oh it does, nice

#

i can just run buildtools whenever i want now

tender shard
#

"latest" usually isn't really latest until a month later

lilac dagger
#

uh

tender shard
#

8 december, 1.20.4 released
8 january, 1.20.4 is "latest"

lilac dagger
#

that's quiet sad then

#

we need an -actuallatest flag then

sullen marlin
lilac dagger
#

oh thank you

weak bear
#

Hello did you know how can I check if a player is behind entity when interact with it ? Thanks you in advance

obsidian drift
#

What is the difference between VehicleExitEvent and EntityDismountEvent?

#

Is VehicleExitEvent only for controllable entities?

quaint mantle
#

i think yes

sullen marlin
#

Yes

sullen marlin
lilac dagger
#

i like the angle method in vector as well for this

pulsar shore
#

Hello everyone!
I'm trying to make a cosmetic plugin that allows to equip armor and cosmetic at same time.
So i tried to overwrite PacketPlayOutSetSlot, PacketPlayOutWindowItems and PacketPlayOutEntityEquipment.
But it didn't worked when inventory is open. (except player's inventory)

So, can i filter PacketPlayOutSetSlot and PacketPlayOutWindowItems packets by inventory? (stateId?)

Sry for my bad english

echo basalt
#

Sounds a bit hacky, but you can get the container ID from the nms player

pulsar shore
sharp heart
#

Do u know why this following error is produced ?

java.lang.Throwable: null```

My code :
```java
public void delete() {
        for (final ItemDisplay item : this.items) {
            item.remove();
        }
        for (final TextDisplay text : this.texts) {
            text.remove();
        }
        for (final ItemDisplay border : this.borders) {
            border.remove();
        }
    }
eternal night
#

Cannot remove entity off-main

#

you are calling .remove() off the servers main thread

sharp heart
#

hmmm

#

thanks

quaint mantle
#
[11:54:42 WARN]: Skipping Entity with id zombie
[11:54:42 INFO]: [Rxlism: Unable to summon object]```

does anybody know what could be causing this ?
#

it happens with any mob, even without specifying a tag

eternal oxide
#

try a sheep

quaint mantle
#

and the game is not in peaceful mode

quaint mantle
#

this is minecraft 1.8.8

eternal oxide
#

blocked location

quaint mantle
#

?

#

am i in a biome that doesnt let me summon that mob ?

eternal oxide
#

have you set a game rule for mobspawning?

quaint mantle
#

nope, just spun up a spigot server didnt change any gamerule

eternal oxide
#

no clue then

quaint mantle
#

had to capitailze zombie to Zombie lol

fallow gyro
#

Hi. There's a plugin on a server I play one where, when you click an item in a gui, it sends the player some text in chat which says "Click me to do x". When you click it, it opens up the players text box field, and pastes some text in there. I'd like to do something similar with my plugin.

For example, in one of my plugins double chest guis, when you click a compass, I'd like it to send one of these "click me" links to the player, who can then click the link and have the starting part of a command pasted into the text box, such as "/search for whatever you want ", where the player can then fill in the last part of the command.

The gui bit I have figured out, but could someone point me towards a method which can fill in the text box? Thanks.

remote swallow
fallow gyro
obsidian drift
#

Is there any sort of entity sound event or some way for me to know when entities make a sound

chrome beacon
#

What sound do you want to detect

sharp heart
#

Do u know if there a way to get the block picked in inventory in creative (middle click), and maybe replace it ?

obsidian drift
#

i can intercept the packet but its the sound packet not entity sound packet, so it doesnt tell me which entity it is only where it is

#

looking at the libsdisguises source, it looks like they just compare the sound and entity coordinates until a match is found

chrome beacon
#

You'll only see slot set packets

obsidian drift
chrome beacon
#

hence the Creative event

tribal zephyr
#

Is there a way to prevent null packets?

tender shard
#

?

#

if you don't manually throw "null" into the sendPacket method, there won't be any

river oracle
#

Don't send them CH_BigBrain

tribal zephyr
#

No I meant
the packet in the string being too long / it has null values

river oracle
#

You can't

#

If the packet can have a null value it can have a null value

#

You could always wrap in Optional but like java optional is cringe for parameters

tribal zephyr
#

NullPacket crash is the most problematic thing

#

oof

river oracle
young knoll
#

I think these are C2S packets

#

I assume?

river oracle
#

I thought it was C2S but that last statement makes me think it's S2C

#

I don't think the server would crash from receiving null in a single packet

young knoll
#

ha

#

ha...

#

Mojang likes to trust the client

#

Probably worse in older versions too

river oracle
young knoll
#

indeed

silent ice
#

I just started developing using spigot and I am trying to alter the drop logic for sweet berry bushes. I have two events, PlayerHarvestBlock and BlockBreakEvent which calls a function to drop the correct items. However I need to cancel the ordinary drops as well, it was easy to do in the BlockBreakEvent by just setting the dropitems to false.

But when I set the cancelled to true in the harvest event it stopped obviously but that also included the de-aging of the bush. How do I manually change the age of the berry bush?

young knoll
#

I wonder if the latest snapshot helps with that

#

BlockData

#

It's probably just Ageable

river oracle
#

^ cast the BlockData to Ageable

silent ice
young knoll
#

what is the error

#

Because the JD does say it's Ageable

silent ice
#

Basically it says it can't cast to ageable

young knoll
#

Wait

#

Is it the wrong agable

river oracle
#

Oh God classic API momwnt

young knoll
#

You want org.bukkit.block.data.ageable

worldly ingot
#

org.bukkit.block.data.type.Ageable

young knoll
#

Uhh aktually there is no type

worldly ingot
#

type is for specific blocks, yeah

#

mb

river oracle
#

What is the other Ageable from

young knoll
#

entity

river oracle
#

Bruh

silent ice
#

So this is the correct one:

import org.bukkit.block.data.Ageable;

young knoll
#

At least it isn't structure

silent ice
#

Alright I'll compile and check

river oracle
silent ice
#

Also this is my first time using spigot so I don't know a lot sorry

young knoll
#

I should change PlacedStructure to just Structure

#

Then we can have 4!

icy beacon
young knoll
#

Shh

#

We probably should avoid duplicate names in the future tho :p

icy beacon
#

Nooo, imagine if we have like 6 Tag classes, 11 Structure classes, and like 10 packages that are named almost the same

#

That would confuse the shit out of newcomers

#

And that'd be soo funny

river oracle
icy beacon
young knoll
#

I think imma do generated structure

#

Since I might be exposing them before they are fully placed soon™️

river oracle
#

Let's not upgrade the API

river oracle
#

We need to redo the plugin loading systrm at some point tho it aint ready for the config phase

young knoll
#

Yes but shh

river oracle
#

That's gonna be weird to implement

young knoll
#

My first thought is load: REGISTRY or something

river oracle
young knoll
#

correct

#

That's why you need to specify it

river oracle
#

Fr but what api would be expozed that's the real question

young knoll
#

Registry stuff

#

ig

#

Or at the very least you could copy a datapack into the datapack folder before the server loads them

river oracle
#

But Bukkits world system is so wack

young knoll
#

Yeah and you need registry stuff for that

#

Custom worlds are a registry entry

river oracle
young knoll
#

ah the seperate folders?

river oracle
#

Yeah

young knoll
#

Shouldn't be too bad

river oracle
#

What's the historical reason

young knoll
#

Per world gamerules maybe?

#

idk

river oracle
#

I'm forking spigot and removing all patches to create VanillaSpigot

#

It'll do exactly what it says pepeLaugh

#

Only L is VanillaSpigot doesn't have plugins

young knoll
#

I mean

#

Datapacks that add custom worlds still work fine afaik, so I don't see any issues

river oracle
young knoll
#

Go scroll through PR history :p

silent ice
#

Is there a way to add data to planted crops so that when you harvest them you get different drops depending on that

river oracle
#

yesn't

#

basically you'll need to use blockpdc library, by default in vanilla though the answer is no

#

?blockpdc

undone axleBOT
river oracle
young knoll
#

Block PDC in spigot when

silent ice
dusty herald
young knoll
#

You could like

tender shard
river oracle
young knoll
#

Spawn a marker entity there in vanilla

#

and add data to that

river oracle
#

that'd get laggy though

silent ice
silent ice
#

Ok so it works for both

river oracle
#

bukkit does not exist separetely from spigot

#

they are equivalent

#

spigot both maintains and updates the Bukkit API

#

Spigot API == Bukkit API and vice versa there are only a few things you can find that are specifically API to spigot

eternal night
#

.spigot().sendMessage looking dumbfounded

river oracle
#

by Choco :P

eternal night
#

about to OMEGALUL

#

I hope so

#

I need that scoreboard format API COPIUM

river oracle
#

as soon as he writes his ASM xD

eternal night
#

inserting a new operation is certainly doable OMEGALUL

river oracle
eternal night
#

Yea I know xD

river oracle
#

truly going to be a great time I'm sure

silent ice
#

What I'm trying to accomplice is making custom berries, idk if it's possible but I want to try

eternal night
#

not that I understand why that needs to be in ASM

#

given that you are not yanking the old methods out

river oracle
eternal night
#

or are you ? is .spigot().sendMessage dropped ?

#

interesting

#

Well then that makes more sense yea

river oracle
#

I think he wants to drop the patch from spigot

eternal night
#

Well, you can drop the pathc from spigot and just re-implement it in bukkit

river oracle
eternal night
#

that doesn'T matter

#

but if the methods are gone that means this will be waiting for 1.20.5 or 1.21

river oracle
#

I think we want to leave the Spigot interfaces behind here can't say for sure, but I'd guess that's the goal

eternal night
#

which yay

#

Well if you are, then you could just do a normal forward to the new methods by rewriting the impl

silent ice
river oracle
river oracle
#

if you aren't using Maven I'd highly reccomend switching to it

silent ice
#

I've never used it before so let's see how this goes

eternal night
#

that is only a thing if you actually drop those methods

#

which, insane to some degree

river oracle
#

it's a legacy articact :P

eternal night
#

Yea but now you are in API break world

#

which means this whole shit needs (or should, but hey, this is spigot) to be deprecated first for removal

#

during which you'd have the old methods properly forward to the new ones

silent ice
river oracle
#

that I can't argue with, Shrug

young knoll
#

Yeah choco gets to write the asm

tender shard
young knoll
#

cries

eternal night
#

I mean, ASM does not matter either

river oracle
eternal night
#

you'd still break API

river oracle
#

into your dependencies block

eternal night
#

you won't break ABI

#

but still an API break, which is annoying and should probably be left to a new version

river oracle
#

yeah should probably give heads upwith deprecated for removal first

river oracle
#

tbh

tender shard
# silent ice It's red

Sometimes, people suggest you to change something in your pom.xml, and then IntelliJ starts to complain: That is totally normal. You simply have to click the “maven reload button” in IntelliJ. Maven will then continue to download the required dependency/plugin, if it’s available. After a few seconds, everything should be fine. You can find the.....

young knoll
#

Would make my life easier too

#

:p

eternal night
#

but I digress, ever since the setResourcePack trash I lost my hope

river oracle
#

maybe that's something to be brought up either on discord or the PR :P

silent ice
#

I'm new to everything java so yeah

young knoll
#

ASMing some of the spigot interfaces was easy, but the others have additional methods

river oracle
tender shard
#

and then read the second headline "How to sahde dependencies" from here, then you can use it @silent ice https://blog.jeff-media.com/common-maven-questions/

People just getting started with maven always ask me the same 3 questions, so here’s a a short FAQ! How to change the output directory? Read this. How to shade dependencies and what it means Sometimes you are using certain libraries (for example, my CustomBlockData class, or similar stuff) that is not already present at...

eternal night
# river oracle what happened with that xD

the method prior to 1.20.2 would replace the resource pack of the client because the client could only have one.
With the addition of stacking packs, some mystical neuron ended up having the method now only add the sent pack.
It does not drop the existing ones

#

which is a complete and udder API break

#

with no warning or anything

young knoll
#

Wasn't me

#

hides

eternal night
#

now, if my "texture switch plugin" (a plugin I actually did write) calls the method on 1.20 it properly switches the resource pack.
If it does so on 1.20.2 it just adds it

river oracle
#

CH_KekLaugh classic spigot moment. Truly I do love this software

late sonnet
#

i dont remember if i take that xd

eternal night
#

We talked about that in an issue

#

that the addition of addResourcePack would be benefitial

#

because you could revert setResourcePack back to its proper API promise

#

and have new plugins that need the stacked pack mechanic use the new method

late sonnet
#

ohhh then not sorry that PR still in wait mode xd
the PR handle set like set (remove all and add the new) and include the add

eternal night
#

niceee 🙏

eternal night
#

yea phoenix talked about it a couple days ago in paper

late sonnet
#

if wanna check and avoid.. comments when the PR was merged ConterLost

eternal night
#

oh yay md approved it

#

thank god

late sonnet
eternal night
#

nice prayHalo yea, it has been annoying because on paper we reverted the initial API break back to the proper impl.
And then people were sobbing that them abusing the API break did not work on paper

#

fun times

late sonnet
#

yeah its like the DamageSource PR... xd

eternal night
young knoll
#

Paper when it breaks our breaks

#

Oh yeah lynx, Md did have a look at gitlab

late sonnet
#

pleae.. i rebase that like 1 week ago..

eternal night
#

Yea miles pinged me yesterday

#

kinda sad they gutted their open source version like that

young knoll
#

You know what that means

#

Our own open source git, blackjack, hookers

eternal night
#

Well, my offer stands eternal to implement a CLA bot for the orange slime myself

#

could be a fun community project

eternal night
#

gitlab's community edition

young knoll
#

Imagine 5000 closed PRs though

young knoll
#

Because cla

eternal night
#

I mean

#

paper does not have a CLA and we are at 3.8k closed PRs

#

I think it would be fine

young knoll
#

Closed as in rejected?

eternal night
#

nah closed or merged

#

lemme see how many are closed and not merged

late sonnet
# eternal night gitlab's community edition

ohh... many time with not using gitlab... i remember a self hosted version only xd
for the work use more bitbucket cloud.. and LIKE how a yarn build in local take 2min and in cloud take 30min

eternal night
#

your paper PR has a 70% chance of being merged

young knoll
#

So 1.2k yeeted

eternal night
#

yes NODDERS

young knoll
#

Man now I want to work on more PRs

#

but idk what XD

late sonnet
eternal night
#

which one is that

#

Ah I see

late sonnet
#

that many itemstacks xd

eternal night
#

we have another PR session today, maybe I'll bump it kekwhyper

late sonnet
#

i dont remember the last comments maybe i get stuck in how handle and surrender try more

young knoll
#

I kinda want to revive ArmorEquipEvent, but afaik the author isn't dead just busy
Although it has been a little while :p

eternal night
#

the worst author to be busy is johnrengelman

late sonnet
young knoll
#

True I could do that

late sonnet
#

like Choco with the docs xd

river oracle
young knoll
#

Or shoot Diamond a message on discord to see how they are

eternal night
#

gradle shadow plugin has not seen a new commit in 10 months skully

young knoll
#

John is ded

eternal night
#

would be a chad move to fork it

#

and maintain it under the io.papermc group kekwhyper

young knoll
#

Are you offering

#

smh

eternal night
#

easiest ad ever

young knoll
#

put it under org.spigotmc

eternal night
#

there is a fork of the guy that PRed the java 21 support

#

idk how popular that got

#

and if they moved it into a more stable environment than a fucking user account OMEGALUL

late sonnet
young knoll
#

Doh apperently it's time to rebase ItemType/BlockType again

#

:c

eternal night
#

must be a fun thing

young knoll
#

guh

late sonnet
#

in my case is only one class with conflicts... i hope what is broke now xd

tender shard
#

does gradle shadow have an option to completely leave a certain class/file untouched, e.g. not apply any relocations to that?

agile hollow
#

i just installed the vaultapi but idk why i'm getting that error:

java.lang.ExceptionInInitializerError: null
        at org.giutv.giukitop.onEnable(giukitop.java:31) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) ~[hub.jar:git-Spigot-21fe707-741a1bd]
        at java.lang.Thread.run(Thread.java:1623) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.plugin.RegisteredServiceProvider.getProvider()" because "rsp" is null
        at org.giutv.managers.VaultHook.setupChat(VaultHook.java:30) ~[?:?]
        at org.giutv.managers.VaultHook.<clinit>(VaultHook.java:55) ~[?:?]
        ... 12 more```

if you need more info about that just ask thx for the help
ivory sleet
#

maybe package wise

#

but rly doubt class wise

young knoll
#

I wish

#

I want to not minimze certain packages in my case

icy beacon
agile hollow
agile hollow
tender shard
icy beacon
#

Show your code then

#

That inits rsp

young knoll
#

Time to fork shadow bois

tender shard
agile hollow
# icy beacon Show your code then
    private static Economy econ = null;
    private static Permission perms = null;
    private static Chat chat = null;

    public static boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        econ = rsp.getProvider();
        return econ != null;
    }

    public static boolean setupChat() {
        RegisteredServiceProvider<Chat> rsp = Bukkit.getServicesManager().getRegistration(Chat.class);
        chat = rsp.getProvider();
        return chat != null;
    }

    public static boolean setupPermissions() {
        RegisteredServiceProvider<Permission> rsp = Bukkit.getServicesManager().getRegistration(Permission.class);
        perms = rsp.getProvider();
        return perms != null;
    }

    public static Economy getEconomy() {
        return econ;
    }

    public static Permission getPermissions() {
        return perms;
    }

    public static Chat getChat() {
        return chat;
    }

    static {
        if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
            setupEconomy();
            setupChat();
            setupPermissions();
        }
    }
}

that my vaulthook

echo basalt
#

static aboos

tender shard
icy beacon
#

You do not null-check rsp before calling getProvider

icy beacon
agile hollow
astral scroll
#

armor equip event would be the love of my life

young knoll
#

It's actually EntityArmorChangeEvent

#

Which is even better

icy beacon
#

Yeah and don't do that... Make a constructor that would call these methods at least, instead of calling them immediately

astral scroll
#

but revive it

#

😭

proud badge
#

How would I ensure my plugin loads after worldedit? Because only loadbefore exists not loadafter

icy beacon
#

Depend on it afaik

echo basalt
#

softdepend

young knoll
proud badge
#

will softdepend work

#

Ok

#

Epic

icy beacon
#

Should

astral scroll
icy beacon
#

I'll gladly steal

agile hollow
#

@icy beacon ok no error rn but the when i do /vault-info it send [Vault] Economy: None [null] why?

icy beacon
#

Please do not ping me

agile hollow
icy beacon
#

I am not sure why that could happen tbh, but very possibly it's because of you calling the methods in a static block

astral scroll
river oracle
#

don't abuse static blocks

proud badge
#

what if plugin1 has loadbefore: plugin2 and plugin2 has loadbefore: plugin1

icy beacon
#

And instantiating the class in onEnable

river oracle
#

make a proper singleton

sharp heart
#

Is there a way to remove the error "org.bukkit.plugin.InvalidPluginException: Unsupported API version X.XX" ?

#

and just check via other methods made by me ?

tender shard
tender shard
icy beacon
#

I am now silly 😛

astral scroll
#

lol

#

it will load hopefully with legacy load3er

young knoll
#

If you want to support old versions

astral scroll
young knoll
#

Generally using api version 1.13 is recommended

sharp heart
#

But if I dont precise api-version I have an error with Material enum

astral scroll
#

but it works

tender shard
#

why not just declare a proper api version instead of none?

young knoll
#

What error with the enum?

astral scroll
#

i didnt declare api in a 1.8 coded plugin and worked in latest

sharp heart
#

No legacy enum constant for BARREL. Did you forget to define a modern (1.13+) api-version in your plugin.yml?

astral scroll
#

so ig its not good to do that

#

but it works sometimes

tender shard
astral scroll
#

depending on which api you use

young knoll
#

yeah so declare an api version

#

A valid one*

tender shard
sharp heart
#

so I can't load older version ?

young knoll
#

you can

#

Use api-version 1.13 and it will load on anything

sharp heart
young knoll
#

yes

sharp heart
#

ok

young knoll
#

It's just a minimum version

tender shard
#

ofc, api-version is the "minimum supported version"

astral scroll
young knoll
#

yes

tender shard
#

and 1.12 and earlier do not check api-version

young knoll
#

^

tender shard
#

because they are ancient

agile hollow
tender shard
icy beacon
icy beacon
#

Not main

astral scroll
icy beacon
#

Typo

agile hollow
tender shard
#

do NOT create a new instance of your plugin

icy beacon
#

TYPOO

tender shard
#

oh

icy beacon
#

For example

public void onEnable() {
   VaultHook hook = new VaultHook();
   hook.setupPermissions();
   // etc
}
#

You could do this

#

Instaed of your static block

#

Or, since your methods are static, you don't even need an instance

#

Just do VaultHook.setupPermissions() etc

agile hollow
tender shard
agile hollow
#

nothing changed

icy beacon
#

Oh

#

You probably don't have the plugins that provide then

tender shard
#

and do you have any economy or chat plugin installed?

agile hollow
#

what economy plugin i have to install i want to make a custom one

icy beacon
#

Ah

tender shard
#

then you have to register your own service provider

icy beacon
#

Well this is out of my territory I've never done that so I'll let Alex take over with helping here lol

tender shard
proud badge
#

Hi, where did I mess up?

> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.sk89q.worldedit:worldedit-bukkit:7.1.18.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/sk89q/worldedit/worldedit-bukkit/7.1.18/worldedit-bukkit-7.1.18.pom
       - https://repo.papermc.io/repository/maven-public/com/sk89q/worldedit/worldedit-bukkit/7.1.18/worldedit-bukkit-7.1.18.pom
       - https://oss.sonatype.org/content/groups/public/com/sk89q/worldedit/worldedit-bukkit/7.1.18/worldedit-bukkit-7.1.18.pom
     Required by:
         project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.1.18'

tender shard
#

you just create your own class that implements / extends vault's Economy class, then register it to the services manager, and that's it

tender shard
proud badge
#

oh

tender shard
proud badge
#

ok nice

agile hollow
# tender shard you just create your own class that implements / extends vault's Economy class, ...

i can't use that one? ```public final class VaultHook {
private static Economy econ = null;
private static Permission perms = null;
private static Chat chat = null;

public boolean setupEconomy() {
    if (getServer().getPluginManager().getPlugin("Vault") == null) {
        return false;
    }
    RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);
    if (rsp == null) {
        return false;
    }
    econ = rsp.getProvider();
    return econ != null;
}

public boolean setupChat() {
    RegisteredServiceProvider<Chat> rsp = Bukkit.getServicesManager().getRegistration(Chat.class);
    if (rsp == null) {
        return false;
    }
    chat = rsp.getProvider();
    return chat != null;
}

public boolean setupPermissions() {
    RegisteredServiceProvider<Permission> rsp = Bukkit.getServicesManager().getRegistration(Permission.class);
    if (rsp == null) {
        return false;
    }
    perms = rsp.getProvider();
    return perms != null;
}

public static Economy getEconomy() {
    return econ;
}

public static Permission getPermissions() {
    return perms;
}

public static Chat getChat() {
    return chat;
}

}```

chrome beacon
tender shard
#

i thought you wanted to write your own economy plugin

#

what do you even want to do

chrome beacon
#

Can't make an economy plugin without making an economy plugin?

tender shard
#

??

agile hollow
tender shard
#

then why do you try to hook into existing economy plugins

#

and why do you get the chat and permissions provider?

#

what do you need them for?

agile hollow
#

i want to create an economy hook in vaultapi

tender shard
#

there is no "default file of vaultapi" ?

chrome beacon
#

They mean the example usage

tender shard
#

as explained in the forums post

agile hollow
tender shard
#

the economy one

#

and then you have to register it to the bukkit serviceprovider

agile hollow
#

it implements a lot of method i have to edit that or i can just use it?

tender shard
#

i don't think you know what vault even is

#

do you already have your own economy logic?

#

storing a player's amount of money, etc?

tender shard
#

then you cannot hook it into vault

inner mulch
#

does OfflinePlayer#getPlayer() only return a player if the player's online?

tender shard
#

yes

inner mulch
#

okay

icy beacon
#

Is it possible at all to make an item glow without adding an enchantment to it, or is the only way just adding a useless enchantment

tender shard
# agile hollow no

You have to write your economy system first. and when it's done, you can write an implementation for Vault's economy interface, that delegates all the calls to your own economy thing. Then other plugins can use your economy plugin through vault

young knoll
#

You gotta add an enchant

#

Or maybe mess with the nbt

tender shard
icy beacon
#

Absolutely no other way?

tender shard
#

it was possible to set the Enchants tag to an empty [] tag compound

#

but IIRC that is also not possible anymore

icy beacon
#

Bc I am already adding a spoof enchantment, but 1.20.4 fucked with custom enchantments so I now have to add a real one

young knoll
#

Guess I'll check vanilla

icy beacon
#

I had an empty enchantment basically which I added

#

But not anymore

agile hollow
tender shard
#

which do you think are "not needed"?

agile hollow
tender shard
#

ofc, it implements Economy

young knoll
#

So in singleplayer 1.20.4 /give @p diamond_sword{Enchantments:[{}]} 1 works, but not on a spigot server

#

Did we change this for a reason or?

icy beacon
#

Probably deemed as a vanilla bug and thus fixed

late sonnet
young knoll
#

yeah I'll have a look at it

obsidian drift
#

Is there any way to listen for a ClientboundSoundPacket synchronously?

lilac dagger
#

Bukkit,runtask

obsidian drift
#

I have to match up the packets location and an entities location and I can only read the packet asynchronously and the locations dont line up anymore

#

It's a time based thing though

lilac dagger
#

ah, no then

obsidian drift
#

I've seen LibsDisguises do it with protcollib but im trying without

lilac dagger
#

then it should work without as well, you're probably thinking the problem wrongly

obsidian drift
#

I thought onPacketSending was always called asynchronously, but then the code checks if it's async return?

    @Override
    public void onPacketSending(PacketEvent event) {
        if (event.isCancelled() || event.isAsync() || event.isPlayerTemporary()) {
            return;
        }

        handleNamedSoundEffect(event);
    }
young knoll
#

Modern plib has an option for both

obsidian drift
#

Is synchronous packet listening hard to implement without protocollib

young knoll
#

idk

lilac dagger
#

you probably have to listen early

#

on sendPacket

obsidian drift
#

what like invent a time machine

lilac dagger
#

no

#

like tracing what connection does

heavy zephyr
#

hmm

obsidian drift
#

Surely you would have to pause the main thread then resume

#

but that just sounds so wrong

#

there needs to be a sound event they need to add taht

#

even if some of the sounds are client side

heavy zephyr
#
    public void onPlayerInteractEntity(PlayerInteractEntityEvent e) {
        Player p = e.getPlayer();
        Entity entity = e.getRightClicked();

        if (entity instanceof EnderDragon) {
            entity.addPassenger(p);
        }

        }

    }

``` So, here, it isn't letting me actually ride the dragon when I right click.
quaint mantle
#

Hey, why is my plugin message not being sent from spigot, am I missing anything?

public class BungeeListener implements PluginMessageListener {

    private final SpigotPlugin plugin;

    public BungeeListener(final SpigotPlugin plugin) {
        this.plugin = plugin;
    }

    /**
     * A method that will be thrown when a PluginMessageSource sends a plugin
     * message on a registered channel.
     *
     * @param channel Channel that the message was sent through.
     * @param player  Source of the message.
     * @param message The raw message that was sent.
     */
    @Override
    public void onPluginMessageReceived(final @NotNull String channel, final @NotNull Player player, final byte @NotNull [] message) {
        if (!channel.equalsIgnoreCase("login:inject")) {
            return;
        }

        UUID target = UUID.fromString(new String(message));
        Player online = Bukkit.getPlayer(target);

        if (online == null) {
            plugin.logger().log(LogLevel.SEVERE, "Tried to inject into offline player {0}", target);
            return;
        }

        plugin.logger().log(LogLevel.INFO, "Injecting into player with UUID {0}", target);

        ClientInjector injector = plugin.getSpigot().getInjector();
        injector.inject(player);

        System.out.println("Sending message");
        online.sendPluginMessage(plugin, "login:inject", new byte[0]);
    }
}
public void onEnable() {
  getServer().getMessenger().registerIncomingPluginChannel(this, "login:inject", new BungeeListener(this));
  getServer().getMessenger().registerOutgoingPluginChannel(this, "login:inject");
}

When BungeeCord sends the message, it works, spigot receives it and logs everything, but then in BungeeCord, I don't receive anything

tender shard
#

how does your bungee code look like?

quaint mantle
#
 @Override
 public void onPluginMessageReceived(final @NotNull String channel, final @NotNull Player player, final byte @NotNull[] message) {
     if (!channel.equalsIgnoreCase("login:inject")) {
         return;
     }

     UUID target = UUID.fromString(new String(message));
     Player online = Bukkit.getPlayer(target);

     if (online == null) {
         plugin.logger().send(LogLevel.SEVERE, "Tried to inject into offline player {0}", target);
         return;
     }

     ClientInjector injector = plugin.getSpigot().getInjector();
     injector.inject(online);

     Bukkit.getScheduler().runTaskLater(plugin, () ->
         Bukkit.getServer().sendPluginMessage(plugin, "login:inject", new byte[0]), 20);
 }
blazing ocean
#

hi, I'm having the issue that DataWatcher, DataWatcherRegistry, DataWatcherObject and PacketPlayOutEntityMetadata don't exist when using remapped NMS. doesn't work using this:

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>

works using this:

        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

and I don't want to use un-remapped NMS because I'm not a psychopath

#

remapped: