#help-development

1 messages · Page 1255 of 1

thorn isle
#

i've had enough of zombies spending 3% of tick trying to find doors to break

wet breach
#

you would think such ai would only be in place if doors were even nearby

echo basalt
#

you gotta look for em

thorn isle
#

it's a tragic case of generalization and abstraction, it uses the RemoveBlockGoal to search for doors in some arbitrary range

echo basalt
#

I wonder if it does pallette lookups

thorn isle
#

it does chunk lookups so for sure palettes must be involved as well

#

i think checking the current/next node in the pathfinder path for being a door would be enough

#

not sure why it searches a range

echo basalt
#

Yeah but a pallette contains is a lot faster than range checks

#

see if the chunk has it and skip it if it doesn't type shit

thorn isle
#

the uh

#

maybeHasAny

echo basalt
#

there might be some low level optimization

thorn isle
#

or whatever they called it

echo basalt
#

lemme see before assuming give sec

thorn isle
#
        for (int i2 = this.verticalSearchStart; i2 <= i1; i2 = i2 > 0 ? -i2 : 1 - i2) {
            for (int i3 = 0; i3 < i; i3++) {
                for (int i4 = 0; i4 <= i3; i4 = i4 > 0 ? -i4 : 1 - i4) {
                    for (int i5 = i4 < i3 && i4 > -i3 ? i3 : 0; i5 <= i3; i5 = i5 > 0 ? -i5 : 1 - i5) {
                        mutableBlockPos.setWithOffset(blockPos, i4, i2 - 1, i5);
                        if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
                            this.blockPos = mutableBlockPos;
                            this.mob.movingTarget = mutableBlockPos == BlockPos.ZERO ? null : mutableBlockPos.immutable(); // Paper
                            return true;
                        }
                    }
                }
            }
        }
#

nuh

#

it's too abstract to make use of palettes

#

since whether it's valid or not is just some arbitrary condition that might not even have anything to do with the block type

echo basalt
#

it just checks the target nodes and stuff.. hm

thorn isle
#

or actually i think i misread this

#

this is almost certainly the turtle egg attack goal, not doors

#

i'm not sure where i got doors from

echo basalt
#

it's most likely the turtle egg

#

door destruction uses pathfinding and just extends DoorInteractGoal

thorn isle
#

yeah that makes sense, that's how i assumed that'd work

echo basalt
#

but yeah nested loops for lookups are icky

#

lemme check

thorn isle
#

makes sense for it to search for a range then but i wish it'd cache them as poi's or something instead of searching the entire area every however many ticks

#

or like override canUse and check the block palettes of the nearby few chunk sections to see if there are any eggs in them at all

#

it defaults to a search range of 24 blocks 🤡 jesus christ

echo basalt
#

Yeah this could use some micro optimizations

wet breach
thorn isle
#

x and z, y is set to 3

wet breach
#

I suppose y being constrained to 3 is better then 24 lol

thorn isle
#

for sure

#

but that's still like 17k blocks

wet breach
pseudo hazel
#

1.7k

wet breach
#

yeah, math checks out on the 1.7k

thorn isle
#

well, it's a range

#

so x/z is 24+1+24

#

and y is 3+1+3

#

or i'm not sure about that +1, it could just be 48*6*48, but that's still 14k

wet breach
#

pretty sure the range is centered on the entity already o.O

#

regardless, it is still per zombie

#

so whether its 1.7k or 14k its a lot of blocks

eternal night
#

honestly, the most taxing operation there is gonna be the chunk lookup

echo basalt
#

eh

thorn isle
echo basalt
#

we could skip half the ops if we looked up the blocks and kept an internal ref of the pallette?

eternal night
#

wat

echo basalt
#

like ran a contains on the chunk pallette and had a Map<ChunkKey, Chunk> or whatever

thorn isle
#

do you mean doing a chunk lookup only once for each chunk section intersecting the search area?

echo basalt
#

I worded it terribly

pseudo hazel
#

clearly the fix is turning the eggs into an entity so the lookup is quicker 😎

eternal night
#

oh yea, you could 100% do a pretty solid "skip" of a lot of this if you were to #contains on the pallette

#

but yea, as said, isValidTarget does not yield you a nice way to do this

#

tho potentially easy to add, given you can default to isPotentiallyValidSection() to true

echo basalt
#

build a list of targets, sort by nearest and filter?

thorn isle
#

yeah, we'll have to override canUse to check the sections first and short circuit to false if none of their palettes contain eggs; otherwise delegate to super

eternal night
#

is that code actually that hot KEKW

#

I'd honestly semi expect the getChunkAtImmediately calls to be the most taxing part

#

over indexing into a palette and comparing a block state

echo basalt
#

afaik the most time consuming stuff at a large scale is zombies and spawners

thorn isle
#

zombies are the most cpu intensive mob of all the basic monsters and this is one part of why

echo basalt
#

somehow zombies manage to consume more resources than villagers

young knoll
#

Just remove zombies

#

Problem solved

echo basalt
#

what if

#

:)

#

I made a plugin w bytebuddy

#

to optimize mob

thorn isle
#

sell it for $200

#

async optimized mobs plus

eternal night
#

that outer loop is truely disgusting tho KEKW

#

the order that search is happening in is gonna make it really annoying to skip sections

young knoll
#

I mean you could probably just remove the egg and door goals

#

Who actually remembers those mechanics exist

thorn isle
eternal night
#

🗣️

eternal night
thorn isle
#

we reorder the loop

eternal night
#

you can't

#

the search order is a gameplay mechanic

#

if you change it, you break vanilla compat

thorn isle
#

yeah well whoever relies on that can go eat shit

eternal night
young knoll
#

There’s probably some wacky farm that relies on it

thorn isle
#

we reorder it to go by chunk, then section, and finally blocks

#

sort the final end results by whatever magic order it's currently in if we have to stick to it 🤡

echo tangle
#

i'm using protocollib's nbtlists, yet whenever i create one it comes out as {"name":"whateverthenameis","value":["a","b"]}, and i don't think that works in 1.21 as it isn't working for me? is there a way to just format the nbt as {"messages":["a","b"]}

hollow vessel
#

Hi, how can I glow entity but only for cerain player. 1.21.3 version.

player.sendPotionEffectChange(horse, horseConfig.whistleEffect);

public PotionEffect whistleEffect = new PotionEffect(
    PotionEffectType.GLOWING,
    20 * 15,
    1
);

it doesn't work

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.

hollow vessel
#

entity is not getting glowing effect

echo tangle
#

this, i'm trying to do packet.getNbtModifier().write(0,nbtvar), except i can't get the nbtvar right because of this

hollow vessel
chrome beacon
#

Any errors?

chrome beacon
echo tangle
#

blockentitydata

#

or tile_entity_data in protocollib

sullen marlin
#

What are you trying to do with protocollib

echo tangle
#

i'm trying to send a blockentitydata packet after a blockchange packet so that i can edit the lines of text on a clientside sign

sullen marlin
#

Isn't there an API method for that

chrome beacon
#

There is

sullen marlin
#

Someone mentioned it earlier

echo tangle
#

sendsignchange?

#

i tried it, but i still wouldnt set the lines of text on the sign

sullen marlin
#

What about sendBlockUpdate or whatever

thorn isle
#

have you tried waiting in between sending the change and the sign open packets

blazing ocean
#

sendBlockChange

echo tangle
sly topaz
#

I'd have expected sendSignChange to just delegate to sendBlockUpdate but turns out that isn't the case implementation-wise

#

well, aside from the fact sendSignChange only lets you change the front of the text and not the back

prime sonnet
#

hi, how do i make the itemstack add armor when it's on my head, i use it but it adds armor when it's in my hand

#

meta.addAttributeModifier(Attribute.ARMOR, new AttributeModifier("armor", 2, AttributeModifier.Operation.ADD_NUMBER));

sly topaz
sly topaz
#

also, the AttributeModifier constructor that uses String as key is deprecated

#

dang, beat me to it

manic delta
#

i can only get the output slot item name from a anvil just using nms right?

#

because printing inventory contents only returns the input item

echo tangle
prime sonnet
#

meta.addAttributeModifier(Attribute.ARMOR, new AttributeModifier(new NamespacedKey(plugin, "armor"), 2, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlotGroup.HEAD)); its good?

sullen marlin
sullen marlin
winter jungle
#

Someone why some players getting kicked with Network Protocol Error after a player joins?

#

there is no error in the console

sly topaz
#

that's usually underground or above their heads

#

I think you can place it as far as 15 blocks or something like that

sly topaz
prime sonnet
sly topaz
#

you'd also want to use the key if you want to get the attribute from the item stack, be it to modify it or just get its value

sly topaz
#

oh, apparently the AnvilInventory methods are deprecated and you're meant to use the AnvilView only now

manic delta
#

(inventory.holder as AnvilView)?

sly topaz
#

you get the anvil view when you open the inventory

manic delta
#

wait let me do the code again

#

i was frustrated and deleted it

#

kekw

sly topaz
#

or if you didn't open it, in the InventoryOpenEvent, or Player#getOpenInventory

manic delta
#

maybe i can undo the github push

sly topaz
#

famous last words kek

manic delta
#

i forgot how to undo it

#

damn

#

wait

sly topaz
#

you just got to do git rebase --hard HEAD~1 then git push -f

manic delta
#

i guess i can copy it from here too

echo tangle
manic delta
sly topaz
manic delta
#

like this

sly topaz
#

it isn't noticeable at all tho, unless you're in the void and the player enters perspective mode

sly topaz
manic delta
#

the InventoryHolder

blazing ocean
#

isn't that a paper thing

manic delta
#

yes

#

but

#

anyway

#

i just use paper for that plugin because of mob goals lol

sly topaz
#

?whereami

manic delta
#

I know, but the problem doesn't have to do specifically with paper.

sly topaz
#

to be completely fair, if you support both platforms, it gets kind of funny

#

in the paper discord you'd probably be told to just stop supporting legacy platforms

#

and in here people might just help you if they feel like it

#

there's no winning lol

blazing ocean
manic delta
sly topaz
manic delta
#

In the end we are programmers and we want to learn

blazing ocean
manic delta
worthy yarrow
blazing ocean
#

it could still be paper changing the logic, we don't know /shrug

sly topaz
manic delta
#

yea thats a point

sly topaz
#

I am not faulting you for it, but you'll have to bear the whereami whenever you ask a question since that's just the culture lol

manic delta
#

ye iknow

polar forge
#

Does anyone have experience with LogBlock?

sly topaz
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

polar forge
sly topaz
polar forge
#

Im trying to make a plugin that alerts the admins when someone breaks a block, placed by a player

sly topaz
#

now that's more of a question

polar forge
#

so technically a GriefAlert

sly topaz
#

so you're looking to use logblock's API I imagine?

polar forge
#

but since im using LogBlock, and this plugin stores every broken block into a db

#

yes

eternal oxide
#

what block specifically are you trying to warn about?

sly topaz
#

does LogBlock even have API I wonder

polar forge
#

Chests, Doors, Wooden Blocks, Torches, Signs

#

basically every block that was placed by a player

eternal oxide
#

do you not want players to place any of them?

polar forge
#

no i want that the players can place them, LogBlock logs the placement, but if any other player (rather than the original player) that breaks that block, every admin gets an alert saying "Player broke (block) of (player)"

eternal oxide
#

but only for player placed blocks?

polar forge
#

yes

sly topaz
#

do you only care about blocks being manually broken by a player, or any kind of grief

eternal oxide
#

in that case as Javier posted you need to query LogBlock about the specific block

sly topaz
#

make sure to not run that method in the main thread though

polar forge
sly topaz
#

I don't know what kind of grief methods players use nowadays but whatever possible way

polar forge
#

fire spread is disabled as well

#

so only manual

sly topaz
#

if that's the case then you only have to care about manually broken, so yeah you can just listen to the BlockBreakEvent and check with that method above if the block was placed by someone else

glossy laurel
#

is it possible to retexture an item as a head without a resource pack?

#

there are more tabs than code on my screen

polar forge
sly topaz
#

all you have to do is get a LogBlock instance with LogBlock#getInstance then call getBlockChanges on it

eternal oxide
#

Bukkit.getPlugin("LogBlock")

polar forge
#

I would need to implement the API so that the plugin knows which blocks are placed by a player and which not

#

omg this is so difficult

sly topaz
sly topaz
polar forge
#

./lb tool

glossy laurel
polar forge
#

and then i receive a wooden pickaxe and with that i knw who placed a block

deep dagger
#

i had prefix formatting plugin and after i deleted it my prefix is still there, i've restarted my server several times but it won't go away

sly topaz
#

did you check if there are scoreboard teams? Also, this is a question for #help-server

sly topaz
#

that said, LogBlock looks horrible, I wouldn't touch it with a 10ft pole

polar forge
#

Yea i know its old asf, and it didnt get updated in the last 7 years

sly topaz
#

it is more of an issue with the code rather than it being old lol

#

no API whatsoever, most classes I've looked at got no encapsulation (all public fields) and the QueryParams parsing gives me nightmares

polar forge
#

I would need to edit it a bit, since i think u didnt understand very well what the plugin should do but im thankful!

#

Idk if u already tried it out, but ill do it

sly topaz
#

I haven't tried it, I made deepseek generate it by feeding it the whole of the QueryParams then checked if everything it did was fine

#

it looks sensible enough to me, what it is supposed to do is to stop a player from breaking the block if they haven't placed it themselves

chrome beacon
#

I don't think that works

sly topaz
#

yeah, I also doubt it

#

it probably is too late to cancel the event at that point

chrome beacon
#

Yeah you need to be blocking the event

sly topaz
#

blocking on every block break doesn't sound like a good idea to me, but I don't know if you'd have any other option lol

polar forge
#

What type of paste bin is this btw javier that u use

sly topaz
#

pastes.dev is lucko's paste service (LuckPerms creator)

polar forge
sly topaz
chrome beacon
#

Otherwise the event will complete and the cancel will do nothing

sly topaz
#

yeah, I am aware, I was just commenting on the fact that it'd be a bad idea even if you do it the "proper" way

#

luckily they just want to send an alert and not cancel the event, so timing doesn't matter

#

you might not even need to go back to main thread to send the message tbh

sly topaz
#

I wasn't gonna bother trying to comprehend whatever they were doing in that class by myself lol

polar forge
#

I guess i would need to put LogBlock into the dependencies right?

sly topaz
#

yes

#

if this is a new-ish server, what I would do instead is take logblock's database, and import all the data you need to a sqlite database, then track block placing yourself instead

polar forge
#

yea it is kinda new

#

almost a month

#

the problem is, idk. how i would accomplish that

grand flint
#

Is BungeeGuard built into bungeecords later versions or am I just being stupid

young knoll
#

No

echo tangle
#

is there an alternative to a respawn packet to refresh a player's skin (after sending playerinfo packets)

sly topaz
#

why is the respawn packet an issue tho

echo tangle
#

just can't get it work via protocollib (unsure of what exactly to put in it) or packetevents (just straight up not working)

sly topaz
#

nowadays you're better off using PacketEvents as that's the better maintained one

#

that said, what have you tried

#

do note that even if you use ProtocolLib/PacketEvents, you might have to use NMS to call some methods on the CraftPlayer instance to sync with the server properly

echo tangle
#

using packetevents, i get this error when trying to output, which i don't get because i believe those are the correct arguments for the wrapper?

No matching static constructor: WrapperPlayServerRespawn.<init> called with (com.github.retrooper.packetevents.protocol.world.Dimension@62fe237f (Dimension), world (String), easy (Difficulty), 8101906099017792395 (Long), CREATIVE (GameMode), null (Null), false (Boolean), false (Boolean), false (Boolean), null (Null), null (Null))

sly topaz
#

ah, I see the issue

#

you're passing the dimension instead of the DimensionType/DimensionTypeRef

echo tangle
#

there's two constructors though, is there not? one for dimension and one for dimensiontype

#

also, i fixed smt in my code and that error is gone, now it just says the packet is null

sly topaz
#

just show the code ig

echo tangle
#
SpigotConversionUtil.fromBukkitWorld(p.getWorld()),
p.getWorld().getName().toString(),
Difficulty.getByValue(p.getWorld().getDifficulty().ordinal()),
p.getWorld().getSeed(),
SpigotConversionUtil.fromBukkitGameMode(p.getGameMode()),
null,
false,
false,
false,
null,
null)```
echo basalt
#

that's some ugly ass code

echo tangle
#

lmao

echo basalt
#

pls shift+f6 rename p to player

sly topaz
#

it isn't so much the issue with the naming but just that being a long ass constructor lol

#

you're missing one argument

echo tangle
#

which?

sly topaz
#

portalCooldown

#

why is portalCooldown an Integer and not an int

#

retrooper what you doing smh

#

though that constructor is deprecated so may as well not use a deprecated one

echo tangle
#

ohh, i see, the ones with dimension are deprecated

echo tangle
#

unsure why it's still not working, i must be missing something completely. how would you do it with protocollib?

desert aspen
#

how could i make that pufferfish follows the nearest player?

manic delta
#

modifying his ai

topaz hollow
#

is it possible to use armour stands as memory cells in minecraft and store data in it as armour stand can have millions of tunic armour and trim armours

sly topaz
#

but is this actually a plugin development question? Because I see little point in using armor stand as some kind of storage when you can just have a database in a plugin?

topaz hollow
sly topaz
#

if it is for the sake of proving a concept then go off, I guess. You can use literally anything as storage with enough effort, it having more states does give you some liberty on the format you can use with it

sly topaz
topaz hollow
sly topaz
#

well, I am really not seeing the picture here, but it sounds doable and the concept is interesting enough. I'd go through with it and see how it goes

dapper night
#

kiory Audiences...
Wondering what audiences might be and what it takes care of
My interest:

particles
sound
actionbar
bossbar
(i need booleans works for it or not)

#

(i suck at reading but i think it involves all of above?)

sly topaz
#

message is a bad word to describe it as they can receive any type of minecraft media, and message leads one to think about text-based communication, while it can be sounds or even resource packs

#

for some reason particles are out of scope but alas

dapper night
#

oh i see

#

particles out of scope

#

kinda weird

#

(thats actualy bad since i cant send particle to specific audience and it will lag my server)

#

unless ill find other way ofcourse (im new to dev)

eternal oxide
#

particles can be sent per player

valid basin
#

I hate that vibe coding became so prevalent

#

Like just learn to code. It's not that difficult if you enjoy it

chrome beacon
#

Yeah too many people are relying on AI

valid basin
#

Yep

quaint mantle
#

Do you have a link to this or something?

#

Would really make things easier

young knoll
#

What on earth is vibe coding

chrome beacon
young knoll
#

How is that related to vibes

chrome beacon
#

You vibe with the AI

young knoll
#

It seems like a joke

#

But knowing humans

sonic goblet
#

I can’t believe they took the name “Vibe Coding” from us to use with AI

daring temple
#

Hi, I am working on a plugin for 1.21.1 and I am struggling on filling in the ancient city blocks on right click. I have tried some ways which either are bugged or just do not work. Pretty much like filling in a portal with blocks.

chrome beacon
#

What did you try and what happens

daring temple
#

I tried this.

The issue I have come across is that I have to place 2 blocks of reinforced deepslate or else it does not work at all. This can be seen more clearly in the image.

However it will still not work to expectations as it will offset the frame filling by one block as seen in the other image.

chrome beacon
#

?paste

undone axleBOT
smoky anchor
#

Those streams look horrible and probably worse way than doing it manually
6 iterations over just one

daring temple
#

By manually do you mean by just going to the next block untill I conplete the loop

smoky anchor
#

looping over the block set, using Math.min/max

#

And this somehow horryfies me frameBlocks.iterator().next()
Never seen this, does this even work properly ?

daring temple
#

😭 I am relatively new so I am not suprised my code can be this scuffed and messy

chrome beacon
#

Not sure how you even ended up doing that

#

That seems like a real odd piece of code

smoky anchor
#

And if I'm not mistaken, you do no not show where you call fillFrameWithIce

daring temple
#

oh yeah sorry

blazing ocean
#

can somebody throw it in a paste my phone won't download it, I wanna see this

daring temple
#

private void fillFrameWithIce(Set<Block> frameBlocks) {
int minX = frameBlocks.stream().mapToInt(Block::getX).min().orElse(0);
int maxX = frameBlocks.stream().mapToInt(Block::getX).max().orElse(0);
int minY = frameBlocks.stream().mapToInt(Block::getY).min().orElse(0);
int maxY = frameBlocks.stream().mapToInt(Block::getY).max().orElse(0);
int minZ = frameBlocks.stream().mapToInt(Block::getZ).min().orElse(0);
int maxZ = frameBlocks.stream().mapToInt(Block::getZ).max().orElse(0);

    for (int x = minX + 1; x < maxX; x++) {
        for (int y = minY + 1; y < maxY; y++) {
            for (int z = minZ + 1; z < maxZ; z++) {
                Block block = frameBlocks.iterator().next().getWorld().getBlockAt(x, y, z);
                if (!frameBlocks.contains(block)) {
                    block.setType(Material.STONE);
                }
            }
        }
    }
}
chrome beacon
#

?paste

undone axleBOT
blazing ocean
#

or.. that

#

okay so no

chrome beacon
#

That's not all the code

smoky anchor
blazing ocean
#

that is certainly something

#

stream enjoyers when they see this

smoky anchor
#

Where do you call fillFrameWithIce from

daring temple
#

@EventHandler
public void onRightClick(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block clickedBlock = event.getClickedBlock();
if (clickedBlock != null && clickedBlock.getType() == Material.REINFORCED_DEEPSLATE) {
Set<Block> frameBlocks = new HashSet<>();
findFrame(clickedBlock, frameBlocks);
fillFrameWithIce(frameBlocks);
}
}
}

daring temple
rotund ravine
blazing ocean
#

they seem to-

smoky anchor
#

Personally not a fan of that recursion there
Surely you can do floodfill in a better way

#

But begginer, so I guess it's fine

daring temple
#

I am still trying to figure out how to solve this. I want to just restart

#

ill have a look at some floodfill spigot forums and try again

smoky anchor
#

floodfill is not spigot specific thing lol

daring temple
#

obviously. I mean its more in context so its a little easier

smoky anchor
#

But again, it's fine as you have it

daring temple
#

it doesnt work at all

smoky anchor
#

So, what you're trying to do is to create the same thing nether portals do, filling a portal frame with blocks.

daring temple
#

yes

#

exactly that

smoky anchor
#

well for starters, it seems that your portal check is completely wrong

#

What you have now would fill more of a box if you had some blocks "to the side"
Which I assume is what you're seeing

#

This still confuses me tho lol

#

Oh right it works 'cause of this

daring temple
#

really sorry but I gtg for like 10mins. I will read anything you write and reply to you when I am back.

smoky anchor
#

I think you have to redesign this completely
Something like:
From starting block, decide one starting direction (let's say NORTH) and start going in a line there until you find a block going up
Then just go up until you find a block going to south, then down, then back north again until you reach starting block
If a block is missing switch to going in the other cardinal direction (in my example it would be EAST)
If both fail, you do not have valid portal

#

Also,

findFrame(clickedBlock, frameBlocks);
fillFrameWithIce(frameBlocks);```
This is just bad
_at least_ have findFrame return Set<Block> instead
This is just for future
#

And I assume you'd want some check to make sure the inside of the portal frame is empty
And have some max size too

echo basalt
#

If you're looking for an exact structure you can brute force it instead

inner mulch
#

can i take a function as a param but with an unspecified amount of parameters? just like Function<Object> but it can be 2, 3, 4...

smoky anchor
#

Probably can do <Object[]>

inner mulch
#

do i need to pass an array then, or does it interpret it as multiple params?

smoky anchor
#

Needs array

#

You can't have "var arg generics" or whatever to call it

blazing ocean
#

Object...?

inner mulch
#

thats illegal

#

for a Consumer

#

😔

smoky anchor
#

There's a reason for this :D

inner mulch
#

i think we need java 2

blazing ocean
inner mulch
#

that wont help

blazing ocean
#
public interface SomeFunction {
  void doSomething(Object... args);
}
inner mulch
#

yeah, im doing that but i wanted to allow lambda too

blazing ocean
#

that allows lambdas

#

it's a SAM interface

smoky anchor
#

That's the same as Consumer<Object[]> tho

blazing ocean
#

true yeah

inner mulch
#

ok

blazing ocean
worldly ingot
ivory sleet
echo tangle
#

is the only way to fix chat validation error after changing someone's skin using a plugin to remove chat validation in its entirety

mental frigate
#

hello, I'm writing a plugin for Minecraft 1.21 and for some reason I can't import anything from net.minecraft or bukkit.craftbukkit (Working with spigot)

thorn isle
#

which build system are you using

mental frigate
#

maven

thorn isle
#

let's see your pom.xml

mental frigate
#

i cant send a file here, can i?

worthy yarrow
#

?paste

undone axleBOT
mental frigate
#

this way?

worthy yarrow
#

Perfect

mental frigate
#

thanks

rotund ravine
#

Ur using the api

#

And not the bundled jar

#

Build spigot using buildtools and remove -api from the artifact

mental frigate
#

oh buildtools.. okay ill try

#

will you help me in case i needed?

thorn isle
#

try it and ask if you run into a problem and we will see whether anyone can or will help, i won't write any blank checks

mental frigate
#

sure thing

polar forge
#

why do i get some errors if i add this depo

#
        <groupId>de.diddiz</groupId>
        <artifactId>logblock</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>```
#

Invalid it doesnt exist

blazing ocean
#

VERSION

slender elbow
#

you probably need to set VERSION to a valid version…

polar forge
#

what type of version

blazing ocean
#

the... version of the library?

polar forge
#

Where do i find it?

slender elbow
#

where did you find this library?

#

it's probably mentioned in their readme

polar forge
slender elbow
#

probably the same as the plugin version if I had to guess

polar forge
#

nop still doesnt work

#
      <dependency>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot-api</artifactId>
          <version>1.21-R0.1-SNAPSHOT</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>de.diddiz</groupId>
          <artifactId>logblock</artifactId>
          <version>1.19.0.0</version>
          <scope>provided</scope>
      </dependency>
  </dependencies>```
#

my whole dependencies block

random stump
#

Hi guys does anybody know about ClueScrolls plugin?
if yes, please tell me like there is a random quest scroll which i want to be stacked, like i have 2 type of scrolls
Obsidian quest scroll and Golden quest scroll
Both have their own random like so
Random Obsidian Quest Scroll
and for golden
Random Golden Quest Scroll
i just want to stack random ones only but not when we right click them and we get the actual quest. I just want to stack random ones how can i do please tell.

random stump
polar forge
#

@sly topaz how did u put the dependency

thorn isle
#

did you also add the repository

muted echo
#

i bought a plugin a few days ago of spigot and i checked today and it says i have to buy it again

left jay
#

was wondering if yall can help me with this dependancy error:

#
java.lang.ClassCastException: class io.github.***.menuSystem.MenuSystem cannot be cast to class io.github.***.menuSystem.MenuSystem (io.github.***.menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @38afc57a; io.github.***.menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @bbca529)
        at io.github.***.expertiseStylePlugin.ExpertiseStylePlugin.onEnable(ExpertiseStylePlugin.java:27) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:492) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugin(CraftServer.java:576) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugins(CraftServer.java:490) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:641) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:426) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:269) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1017) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]```
chrome beacon
#

from two different plugins or classloaders

#

If you're shading you should relocate the dependency

blazing ocean
#

why are you redacting your github name

left jay
eternal oxide
#

btw your issue is your menu system is a Plugin and you also have it in your other plugin as a dependency but with no scope

warm mica
#

Or accidentally shading it

eternal oxide
#

he just has his menu system as a dependency with no scope so it gets shaded

#

when its a plugin

inner mulch
#

Is it expensive to combine 2 hashsets?

chrome beacon
#

Depends on the size of them and how you do it

inner mulch
#

Is there a better way than checkinh which one is smaller and then iterating?

chrome beacon
#

can just use the addAll method

#

instead of iterating

inner mulch
#

Im guessing this scales with the amount of items?

chrome beacon
#

It's still iterating

#

Just no need to do it yourself

inner mulch
#

Ok

sly topaz
left jay
sly topaz
#

if for some reason you cant' compile it yourself, you can also use the maven install-file goal from the maven install plugin to inject the jar directly into your local maven repository with a specified group and artifact id, but ideally you should be able to compile it. That way you can make sure you are using the same version both on your server and development

left jay
#

Ok 👍

granite idol
#

Can anyone help me I want a map where the world is only one biome that has no water and only small hills/mountains like in mcprac.net for: Desert, Badlands, Snow, Plains, Mushroom PLSSS

orchid brook
#

Hello anyone know how can i disable mongodb logger for my spigot plugins ? I try:

Logger.getLogger("org.mongodb.driver.client").setLevel(Level.OFF);
Logger.getLogger("org.mongodb.driver.cluster").setLevel(Level.OFF);
Logger.getLogger("org.mongodb.driver.connection").setLevel(Level.OFF);
``` but nothing working
blazing ocean
smoky anchor
granite idol
#

got a link 😄

smoky anchor
#

And this is probably not a good place for this

granite idol
#

? pls ?

smoky anchor
#

got google ?

granite idol
#

no

thorn isle
#

womp womp

smoky anchor
#

did the guy just leave ?

thorn isle
#

skill issue

proud badge
#
            if() {
                player.getInventory().remove(i);
            }
        }```
 what would I have to change here to include the offhand slot aswell?
thorn isle
#

that seems like a rather silly way of clearing the contents

#

consider iterating over slot numbers or something instead

proud badge
#

hmm

blazing ocean
#

which is what mongo uses iirc

thorn isle
#

or if you want to iterate over the content array itself, call setAmount(0) on the itemstacks to clear them

#

because what you are doing now is going one by one over the items in the inventory, and then searching for similar items in the inventory and clearing the first one

#

since you're calling Inventory::remove(ItemStack)

#

to clear the offhand slot specifically you can Inventory::setItem(EquipmentSlot, ItemStack) and pass OFF_HAND for the equipmentslot, and null for the itemstack

sly topaz
orchid brook
echo tangle
#

where would i go to see what information i need to set on a protocollib respawn packet (i.e. packet.getBlah().write(0,blah))to get it to work as i'm not really sure what to put in it

dapper night
#

can i set biomes with spigot api

#

using biomeprovider?

#

it says biomes now set with biomeprovider but when i open it i cant find explaination on website as turns out i end up in confusion

#

im asuming api is incomplete?

smoky anchor
#

But no, BiomeProvider can not set biomes, you can only get them, hence the name provider

smoky anchor
#

lol

dapper night
#

🥴

#

so i asume api is incomplete

smoky anchor
#

Well BiomeProvider API is complete

#

that note is just wrong

dapper night
#

uhhh xD so i was confused and now more confused

smoky anchor
#

World#setBiome(int, int, int, Biome)

#

Mind you that you can not set biome per block, only per 4 blocks and the biomes have some noise

#

And you have to relog to see the changes right away I believe
Or make some "hack"
Really not sure if that API send biome updates

grizzled surge
#

Does somebody know how I can get the ItemStack of a player head with a base64 texture in 1.21.4?

sly topaz
#

but the respawn packet isn't where I would expect people to stumble when it comes to spawning npcs

echo tangle
sly topaz
#

wait, were you spawning npcs or changing player skins? I forgot

echo tangle
#

oh changing players skins, sending a remove info then update info packet

sly topaz
#

is there a reason you aren't just using NMS for it

#

well, for respawning I don't think you even need to send the packet? You can just call the method on the player

young knoll
#

Pretty sure that requires them to be dead

echo tangle
#

you mean for respawning?

sly topaz
#

I mean for everything

#

mostly because you'll have to call some craft methods regardless of whether you use protocollib or not

sly topaz
#

I think SkinRestorer has a Bukkit API only way of doing that, I don't exactly remember what was possible just with API and what wasn't anymore

echo tangle
sly topaz
#

if you are using NMS, it is easier to send the respawn packet using it lol

echo tangle
sly topaz
#

connection.send(new ClientboundRespawnPacket(serverPlayer.createCommonSpawnInfo(serverPlayer.serverLevel()), ClientboundRespawnPacket.KEEP_ALL_DATA))

echo tangle
#

ohh, yeah i see lmao, lemme try that

#

i thought the last part was the issue but im still on the loading terrain screen for 30s

sly topaz
#

let me give it a try myself I guess, but have you tried doing everything else you have to do after sending the respawn packet and see if anything fixes it

sly topaz
# echo tangle i believe so?
import net.minecraft.network.protocol.game.ClientboundRespawnPacket;
import net.minecraft.network.protocol.game.ClientboundSetExperiencePacket;
import net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.players.PlayerList;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.PositionMoveRotation;
import org.bukkit.entity.Player;
import org.bukkit.craftbukkit.v1_21_R3.entity.CraftPlayer;

import java.util.Collections;

public class PlayerRefreshUtil {
  public static void refreshPlayer(Player player) {
      if (!(player instanceof CraftPlayer craftPlayer))
          return;

      var serverPlayer = craftPlayer.getHandle();
      var connection = serverPlayer.connection;
      var level = serverPlayer.serverLevel();

      connection.send(new ClientboundRespawnPacket(serverPlayer.createCommonSpawnInfo(level), ClientboundRespawnPacket.KEEP_ALL_DATA));
      serverPlayer.onUpdateAbilities();
      connection.internalTeleport(PositionMoveRotation.of(serverPlayer), Collections.emptySet());
    
      var playerList = serverPlayer.server.getPlayerList();
      playerList.sendPlayerPermissionLevel(serverPlayer, false);
      playerList.sendLevelInfo(serverPlayer, level);
      playerList.sendAllPlayerInfo(serverPlayer);

      connection.send(new ClientboundSetExperiencePacket(serverPlayer.experienceProgress, serverPlayer.totalExperience, serverPlayer.experienceLevel));
      for (var effect : serverPlayer.getActiveEffects())
        connection.send(new ClientboundUpdateMobEffectPacket(serverPlayer.getId(), effect, false));
  }
}
#

if that doesn't work as it should then nothing will

#

(completely not code from certain fork)

#

wonder how much of that could be done with the API instead of just using the raw methods for it

echo tangle
#

eureka, works, thank you so much!

left jay
sly topaz
#

you are also declaring the maven compiler plugin and the resources block for no particular reason

left jay
#

no actually yeah youre right i didnt need to do that

left jay
sly topaz
left jay
#

yeah

sly topaz
#

the exact same error?

left jay
#

yep

sly topaz
#

try removing all plugins except this one, just to make sure it is an issue with shading

left jay
#

alr sure

flat lark
#

Performance I've seen set is better than list. I am not to worried about order I just have 2-3 seconds before my ui opens because its retrieving data from my database.

paper viper
#

is Guava eventbus fine to use

#

over any lib

sly topaz
#

I am not sure if you meant to follow up that statement with a question lol

left jay
sly topaz
sly topaz
#

also, what does your pom.xml look like now

paper viper
sly topaz
#

then again, do you need a separate event system, is there a reason you can't just use Bukkit's

paper viper
#

I think personally I don't really like the HandlerList, and I would want just my users to just subscribe to an eventbus but idk

left jay
# sly topaz the exact same error again? Can you send it?
java.lang.ClassCastException: class io.github..menuSystem.MenuSystem cannot be cast to class io.github..menuSystem.MenuSystem (io.github..menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @741848c4; io.github..menuSystem.MenuSystem is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @1c51670f)
at io.github.***.expertiseStylePlugin.ExpertiseStylePlugin.onEnable(ExpertiseStylePlugin.java:27) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:492) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugin(CraftServer.java:576) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.enablePlugins(CraftServer.java:490) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:641) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:426) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:269) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1017) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.lambda
s
p
i
n
spin0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]```
sly topaz
#

it should be throwing a ClassNoDefFoundError if you removed all plugins

left jay
#

oh

#

oh i completemely misunderstood that

#

gimme a sec

left jay
# sly topaz so it is still just complaining about the fact that you're using MenuSystem clas...

yeah it did

org.bukkit.plugin.UnknownDependencyException: Unknown dependency MenuSystem. Please download and install MenuSystem to run this plugin.
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:280) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_21_R1.CraftServer.loadPlugins(CraftServer.java:465) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:236) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1017) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]```
sly topaz
# paper viper I think personally I don't really like the HandlerList, and I would want just my...

you're looking for fancy, which is fine if you feel like experimenting, but any users of your plugin's API would much appreciate you using the normal event API rather than having to learn a different one. It is overhead that isn't well received unless your plugin has become big enough to need something custom, like LuckPerms does to maintain a common interface across platforms, among other things

sly topaz
#

or is it supposed to be a library you shade in to use

left jay
#

also side note, i cant find it anymore after moving it out of my plugin folder so thats fun

sly topaz
left jay
sly topaz
#

why is it throwing an unknown dependency exception when it isn't listed there, what the hell

sly topaz
sly topaz
# left jay

are you sure you replaced the plugin in your test server with the one you recently compiled? Because based on that plugin.yml, there couldn't be an UnknownDependencyException as there isn't even a depend or softdepend list, unless it is below the command definition

#

your api version is also wrong, since you are running 1.21.1 and not 1.21, minimal thing but I'd change it

#

wait, are you using getPlugin to get an instance of MenuSystem class? But it isn't a JavaPlugin

left jay
#

also yeah i forgot about that

sly topaz
#

you cannot use getPlugin to get instances of anything, it just gets instances of the currently loaded plugins

#

if it is a shade-in library, you have to instantiate everything yourself, including registering any listeners which I suppose you have since it is supposed to be a menu library

left jay
#

oh yeah i alr had all of that sorted

sly topaz
#

if that is the case then it is all working now? Lol

left jay
#

yeah everything seems fine

sly topaz
#

well, glad you got there lol, at last

#

but in all honesty, I wouldn't bother with a custom menu library and instead use a well-known one like stefvanschie's IF or DevNatan's inventory framework

left jay
#

maybe, but i did put some stupid shit into mine that are important + im bad at interperting other peoples code

#

like ive tried to import and understand 3 plugins by now and everytime i dont understand sheit so i might as well do it myself

sly topaz
#

being able to understand other people's code is a big part of being a developer, so I'd recommend training that skill as much as you can

#

that said, there's nothing wrong with making custom stuff, just that it is often brittle in comparison to something geared towards the general public

#

even more so in a constantly changing ecosystem like the plugin's one is

left jay
#

Yeah cuz u probably right about that

wicked bluff
#

Has anyone figured out how to get the Cow Variant in 1.21.5 yet?

sly topaz
mental frigate
#

hey guys, I have a problem with hoverable chat messages, I'm showing an item on hover but for some reason it doesnt have its attributes like enchantmens etc.

    private HoverEvent getHoverable(ItemStack item) {
        ItemTag tag = ItemTag.ofNbt(item.getItemMeta() == null ? null : item.getItemMeta().getAsString());

        System.out.println(tag);

        return new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(
            item.getType().getKey().toString(), item.getAmount(), tag
        ));
    }```
mental frigate
chrome beacon
#

.0?

mental frigate
# chrome beacon .0?
<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.21.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
smoky anchor
#

Could have just said .1
But nowadays breaking changes happen in these versions too so you gotta specify it fully

mental frigate
#

oh okay, do you know how to help?

young knoll
#

I believe you need to use getAsComponentString now

chrome beacon
#

Yeah as far as I can tell the serializer is just broken and gives the wrong tag

#

Not sure about 1.21.1 though was testing on 1.21.4 and .5

mental frigate
#

instead of new Item(...) or what?

#

like that?

private HoverEvent getHoverable(ItemStack item) {
        ItemTag tag = ItemTag.ofNbt(item.getItemMeta() == null ? null : item.getItemMeta().getAsComponentString());

        System.out.println(tag);

        return new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(
                item.getType().getKey().toString(), item.getAmount(), tag
        ));
    }```
#

it doesnt seem to be working..

#

it seems like the Item object is created correctly, same with HoverEvent, it has correct nbt tags, but the item on hover isnt displayed correctly

smoky anchor
#

Assuming I'm reading the BungeeCord source correctly and that that thing is actually used in Spigot
It's wrong, the serialization is just incorrect and md has to update it
It will not generate the correct json
-# And speaking of generating json, text components now use nbt instead so I assume this has to be translated to nbt which is just adding pointless slow down
The correct format should be: {"hover_event":{"action":"show_item","id":"minecraft:golden_chestplate","count":1,"components":{"minecraft:unbreakable":{}}},"text":"TEXT"}

#

I too am going by latest btw

chrome beacon
#

Yeah that's what I also noticed while digging through the code

smoky anchor
#

You could reflection into VersionedComponentSerializer and replace the gson field with basically the same, but fixed ItemSerializer
(I believe reflection allows you to replace private final field? I know there have been changes around that)
But this is extremely hacky and probably a bad idea :D

#

Would be better if you just used NMS or some different chat api

mental frigate
#

oh, so what should i do

chrome beacon
#

Could probably just tell Spigot to run the tellraw command

#

getAsString and getAsComponentString seem to give the correct nbt depending on version

#

so you'd just pass that in to a full tellraw string and run that

thorn isle
#

can't you deserialize the json string from that into a component and send that?

chrome beacon
#

would require nms to send

#

but yes

thorn isle
#

what, do we not have a facility to deserialize json into components in spigot?

chrome beacon
#

Which is what's broken

mental frigate
#

im so confused rn

smoky anchor
thorn isle
#

didn't you say serialization, not deserialization, is broken

chrome beacon
#

both are

thorn isle
#

🤡

chrome beacon
#

even if you tweak the string to get deserialized properly it needs to be serialized when sent

#

so it's broken eitherway

chrome beacon
#

at least for now until someone decides to fix it

smoky anchor
#

Yep, agree

chrome beacon
#

Using adventure is also an option

mental frigate
#

adventure doesnt work at all

#

or im dumb

chrome beacon
#

Should work just fine

mental frigate
#
private Component getMessage(Player player, ItemStack item, String slot) {
        Component message = Component.text(
            this.plugin.getMessage("Messages.show-%s".formatted(slots.contains(slot) ? slot : "other"))
                .replace("{player}", player.getDisplayName())
        );

        Component itemText = Component.text(
            this.plugin.getMessage("Messages.item-format")
                .replace("{amount}", String.valueOf(item.getAmount()))
                .replace("{item}", this.getItemName(item))
        ).hoverEvent(getHoverable(item));

        System.out.println(itemText.hoverEvent());

        message = message.replaceText(TextReplacementConfig.builder()
            .matchLiteral("{item}")
            .replacement(itemText)
            .build()
        );

        return message;
    }

    private HoverEvent<HoverEvent.ShowItem> getHoverable(ItemStack item) {
        return HoverEvent.showItem(
            HoverEvent.ShowItem.showItem(
                Key.key(item.getType().getKey().toString()),
                item.getAmount(),
                item.getItemMeta() == null ? BinaryTagHolder.binaryTagHolder("") : BinaryTagHolder.binaryTagHolder(item.getItemMeta().getAsString())
            )
        );
    }```
#

hover didnt work at all

chrome beacon
#

Are you on Paper?

mental frigate
#

you mean server engine?

#

or plugin dependency

chrome beacon
#

The API you're compiling against

mental frigate
#

im using spigot

#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.21.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>26.0.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-api</artifactId>
            <version>4.14.0</version>
        </dependency>
        <dependency>
            <groupId>net.kyori</groupId>
            <artifactId>adventure-platform-bukkit</artifactId>
            <version>4.3.2</version>
        </dependency>```
slender elbow
#

4.3.4 is the latest of adventure-platform-bukkit, and you shouldn't need to specify adventure-api explicitly

#

and what server version are you running?

mental frigate
#

1.21

#

now trying with 1.21.1

slender elbow
smoky anchor
#

What kind of matryoshka doll shit is this

slender elbow
#

admittedly, I have no idea

slender elbow
mental frigate
#

ye but it doesnt work without this xD

#

but i agree its so dumb

slender elbow
#

i mean, it doesn't work either way, does it?

mental frigate
mental frigate
smoky anchor
#

omg that's so baad
who made it
who can I curse at

mental frigate
#

i mean BinaryTagHolder

slender elbow
#

because you are depending on an old version of adventure

#

Since:
4.17.0

mental frigate
#

what is the latest version of adventure

slender elbow
#

4.20.0 but idk if adventure-platform is updated to it

#

it is community maintained after all

#

it'll get as far as people want it

mental frigate
#

ah ye, but shouldn't the hover message appear anyway?

#

even if the tags are not handled correctly

#

right?

slender elbow
#

not necessarily

#

hover events have changed a lot in recent versions

#

if old adventure doesn't know how to deal with new minecraft version, it will skip it

mental frigate
#

so first of all, I should update adventure?

smoky anchor
#

Latest for bukkit platform seems to be 4.13.1
So what Emily sent would not work anyways
Use tellraw, construct the command yourself

#

-# There is a PR for support for 1.21.5 tho :D

mental frigate
smoky anchor
#

well ye

#

That is indeed what I said

mental frigate
#

but will plugin written for spigot 1.21.5 work on 1.21?

smoky anchor
#

Unlikely

mental frigate
#

so i gotta fuck around with the tellraw?

smoky anchor
#

In this case, most likely not
'cause the format was changed between those versions too I believe

smoky anchor
#

Or NMS

mental frigate
smoky anchor
#

Only if you plan on updating the plugin

mental frigate
#

oh, if it's gonna stay on 1.21 I'll be alright?

smoky anchor
#

Depends on you I guess
Personally I have no problem working with NMS

#

Apart from the updating
But I have not touched spigot in over a year so I have not suffered since :)

mental frigate
#

isn't it really obfuscated?

smoky anchor
#

Not if you use

#

?mappings

undone axleBOT
smoky anchor
#

wait no

chrome beacon
#

?nms

mental frigate
#

ah, gracias

#

so I'll try later

#

thank you for your help

smoky anchor
#

not doing friend requests or support in DMs, feel free to tag me here tho

mental frigate
#

@smoky anchor so from what I understand I should just send a packet with the message to player?

smoky anchor
#

hellno
you do not need to send a packet by yourself
Construct the message and then use a method to send it to player, most likely in the player object
You can get that if you cast the bukkit Player object to CraftPlayer or something and getHandle()

mental frigate
#

oh okay

#

like that?

CraftPlayer craftPlayer = (CraftPlayer) player;```
smoky anchor
#

sendSystemMessage I believe it should be or maybe a bit different, I'm looking at decomp of 1.21.5

smoky anchor
#

I don't exactly have code at hand, I'm going by docs and memory

mental frigate
#

and then srnd the Component message using

craftPlayer.sendMessage()```
smoky anchor
#

Hmmm not from CraftPlayer I don't think ?
That would not take NMS text

mental frigate
#

we'll, I'll see when I get home

#

what time is it for you rn?

smoky anchor
#

3PM

mental frigate
#

alr good, same as me

smoky anchor
mental frigate
#

alr thanks

hollow vessel
#

hello, does anyone here know a cool gui library that will allow me to make a simple animation? Inventory 2 rows, items in row 1 "appear" from the left and stop, and in row 2 from the right. If no one knows such a library, my idea is to make such "frames" of animation, i.e. some List where there are <slot, item> maps and set the gui content with a delay

chrome beacon
#

That's not too hard to do yourself

hollow vessel
#

yea I know, but how can I do it good with and not to waste resources (efficiently)

#

is my idea okay?

chrome beacon
#

Not sure I understood what you meant

#

but you'd just use the scheduler or smth to set the next slot

left jay
#

question, how do you get the value of an attribute?

chrome beacon
#

There can be multiple attribute motifiers

#

their values are added together to make the final result

#

Also why is there a reduntant loop there

left jay
#

where?

chrome beacon
#

You're looping over a list you made with only one entry

#
  • There's no need to loop over every entry in the multimap to find elements with you key
#

use the get method

manic delta
#

olivo i love you

left jay
chrome beacon
#

also no need to get the item twice and the item meta twice

#

use the variables

wet breach
chrome beacon
mental frigate
#

@smoky anchor it works, thank you so so much man

jaunty gazelle
#

how do i load a pre configured config.yml file from my resources folder

chrome beacon
#

?configs

undone axleBOT
jaunty gazelle
paper viper
rugged fern
#

Why is intellij not installing the dependency? i installed buildtools and run it for 1.21.5: ``` <repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/repository/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://repository.sonatype.org/content/groups/public/</url>
</repository>
</repositories>

--> <dependencies>
--> <dependency>
--> <groupId>org.spigot</groupId>
--> <artifactId>spigot</artifactId>
--> <version>1.21.5-R0.1-SNAPSHOT</version>
--> <classifier>remapped-mojang</classifier>
--> <scope>provided</scope>
--> </dependency>
--> </dependencies>``` --> is marked red

smoky anchor
#

And what does the red say

rugged fern
#

Oh sorry, its says the dependency is not found somehow

undone axleBOT
quaint mantle
#

🗣️

rugged fern
#

i got this error: ```
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [sh, /home/raven51229/Desktop/BuildTools/apache-maven-3.9.6/bin/mvn, -Dbt.name=4479, -P, remapped, clean, install]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.runMaven0(Builder.java:936)
at org.spigotmc.builder.Builder.runMavenServer(Builder.java:905)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:683)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)

thorn isle
#

then please pastebin the entire BuildTools.log.txt file when seeking support

rugged fern
remote swallow
#

Looks like your not using a jdk from a quick glance

rugged fern
#

java -version was working

#
OpenJDK Runtime Environment (build 21.0.6+7-Ubuntu-124.04.1)
OpenJDK 64-Bit Server VM (build 21.0.6+7-Ubuntu-124.04.1, mixed mode, sharing)
chrome beacon
#

Now run javac -version

rugged fern
#

well okay that wasnt working

chrome beacon
#

So you're not running a jdk

#

TIme to install one

rugged fern
rugged fern
tawdry bloom
#

Hey, I try to implement specific Unicode to display custom GUI with the resource pack but I have this error:
[Render thread/WARN]: Couldn't find glyph for character  (\uf7b3)

My <namespace>/font/default.json include that:

{
    "providers": [
        {
            "type": "bitmap",
            "file": "<namespace>:font/test.png",
            "ascent": 60,
            "height": 256,
            "chars": [
                "\uF7B3"
            ]
        },
    ]
}

In my textures folder I have a test.png: <namespace>/textures/font/test.png

Someone have an idea? Im in 1.21.4 =)

chrome beacon
rough ibex
#

or just the font part

tawdry bloom
#

the font json?

rough ibex
#

and the png

tawdry bloom
#

yep

rough ibex
#

I want to test it with my WIP library, see if it loads it OK

tawdry bloom
#

👍

unborn hollow
#

unsure if this belongs here or in #help-server but how do you prevent player/entity nudging?

chrome beacon
#

Are you writing a plugin?

unborn hollow
#

yes but i was unsure if it's just a simple setting in the server properties file considering so many servers have that turned off

rough ibex
tawdry bloom
rough ibex
#

ok

chrome beacon
rugged fern
chrome beacon
#

Make sure you built 1.21.5 with the remapped flag

rugged fern
#

i run this command: java -jar BuildTools.jar --rev 1.21.5 --remapped

chrome beacon
#

Did you reload maven after BuildTools finished running?

rugged fern
#

yes i did

chrome beacon
#

Could you send your pom

#

?paste

undone axleBOT
rugged fern
chrome beacon
#

Your pom is incomplete

#

?nms

rugged fern
chrome beacon
#

Did you run BuildTools as root?

#

because it seems to be installing the dependency in to it's .m2

#

at least in one of the earlier logs*

rugged fern
#

i used sudo was that wrong?

chrome beacon
#

yeah

slender elbow
#

yes

chrome beacon
#

Don't do that

sly topaz
#

right now that one is outdated both in the minecraft version and the maven plugin version (though just by 2 minor versions)

young knoll
#

Shh don’t teach people to copy and paste everything

#

That’s how we got vibe coding

chrome beacon
#

too late

#

😢

slender elbow
#

i was gonna say that i'd rather i give someone the text to copy paste than them resourcing to ai, but, nahhhh

sly topaz
#

it isn't a big deal if you only have to do it once, but if you create new projects constantly, it gets annoying lol

slender elbow
#

doesn't intellij say "hey there's a new version of xyz dependency available" with maven?

young knoll
sly topaz
#

it doesn't do that, but it lists the new versions in auto-complete if you're replacing them

slender elbow
#

mkay that's good enough lol

sly topaz
#

that way I can also use ${spigot.version} as api-version in the plugin.yml

#

I also didn't understand for the longest time why there were two executions to that goal until I actually took the time to look at what it was doing

#

since it just calls specialsource, it is going, mojmap -> obfuscated -> spigot using obfuscated "mappings" as intermediary

plush tree
drowsy helm
#

Also show your code for what youve tried far. We dont have a lot of context

plush tree
# drowsy helm Also show your code for what youve tried far. We dont have a lot of context

package br.com.pixelmonplugin.Listeners;

import br.com.devpaulo.legendchat.api.events.ChatMessageEvent;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.battles.attacks.specialAttacks.basic.HiddenPower;
import com.pixelmonmod.pixelmon.entities.pixelmon.abilities.AbilityBase;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.Gender;
import com.pixelmonmod.pixelmon.enums.EnumType;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import java.util.Optional;



public class PokeShow  implements Listener {

    @EventHandler
    private void onChat(ChatMessageEvent event) {

        try {

            Player player = event.getSender();
            String message = event.getMessage().trim();


            if (!message.contains("@poke")) {
                return;
            }

            event.setCancelled(true);

            String[] parts = message.split(" ");


            TextComponent finalMessage = new TextComponent("");

            for (String part : parts) {
                if (part.startsWith("@poke")) {
                    String slotStr = part.substring(5).trim();

                    try {
                        int slot = Integer.parseInt(slotStr);

                        if (slot < 1 || slot > 6) {
                            player.sendMessage(ChatColor.RED + "Slot inválido: " + slot + ". Use um número entre 1 e 6.");
                            continue;
                        }

                        PlayerPartyStorage pstore = Pixelmon.storageManager.getParty(player.getUniqueId());
                        Pokemon pokemon = pstore.get(slot - 1);

                        if (pokemon == null) {
                            player.sendMessage(ChatColor.RED + "Não há Pokémon no slot " + slot + ".");
                            continue;
                        }

                        String hoverText = createPokeHoverText(pokemon);
                        String displayName = ChatColor.GOLD + "[" + ChatColor.BLUE + ChatColor.BOLD + pokemon.getDisplayName() + ChatColor.GOLD + "]";


                        TextComponent pokeComponent = new TextComponent(displayName + " ");
                        pokeComponent.setHoverEvent(new HoverEvent(
                                HoverEvent.Action.SHOW_TEXT,
                                new ComponentBuilder(hoverText).create()
                        ));

                        finalMessage.addExtra(pokeComponent);

                    } catch (NumberFormatException e) {
                        player.sendMessage(ChatColor.RED + "Formato inválido. Use @poke<slot> (ex: @poke1).");
                    }
                } else {
                    finalMessage.addExtra(new TextComponent(part + " "));
                }
            }

            

        } catch (Exception e) {
            Player player = event.getSender();
            player.sendMessage(ChatColor.RED + "Erro ao processar o comando. Contate um administrador.");
            Bukkit.getLogger().severe("Erro no PokeShow: " + e.getMessage());
            e.printStackTrace();
        }
    }```
drowsy helm
#

player.spigot().sendMessage(component)

plush tree
drowsy helm
#

so you want to send a message on behalf of a player?

drowsy helm
#

With a text component it's gonna be a lot harder. With a regular string you have Player#chat(String).

But if you're using a text component you might have to manually invoke the AsyncPlayerChatEvent and use that formatting

eternal oxide
#

The chat plugin likely has an API you can pass text to for it to format

eternal oxide
plush tree
#

no have support for text component

drowsy helm
#

It's a bit hacky but I can't really think of another way to get formatting

left jay
#

anyone know why intellij is yelling at me? it wasnt like this a couple hours ago

chrome beacon
#

Are those classes in your project?

#

Or are they in a library/dependency

left jay
#

in my project

chrome beacon
#

Are they imported?

left jay
#

nope

chrome beacon
#

Time to do so

left jay
#

no like they are but

chrome beacon
#

Try invalidating caches

#

It's under the File dropdown

drowsy helm
#

what build tool are you using

left jay
#

that worked

left jay
drowsy helm
#

oh you're using artifacts?

#

or maven

left jay
#

both, depends on how im feeling that day

chrome beacon
#

Use maven

left jay
#

why?

chrome beacon
#

Makes builds work outside Intellij. No relying on jars and good practice to keep the project easily portable (most of the time when deps are in a non-local repo)

manic delta
#

dont use maven

#

use gradle

ivory sleet
#

whats wrong with maven?

chrome beacon
ivory sleet
#

dont get me wrong, I use gradle, but im curious to know ur opinion on why "dont use maven"

manic delta
eternal oxide
#

I use Maven. I'd never use Gradle to build against Spigot

manic delta
#

why

eternal oxide
#

because it doesn;t need anything "more programmable or configurable" as Spigot is designed to work easiest with Maven

chrome beacon
chrome beacon
#

For what?

eternal oxide
#

Not to build for Spigot you don;t

manic delta
manic delta
eternal oxide
#

First off, thats for paper

manic delta
#

is the same

eternal oxide
#

No its not

ivory sleet
# manic delta I think it is more programmable and has easier tools to configure.

yes but a lot of the industry already uses xml, so easier is extremely subjective - a lot of stuff that run java will bind its dependency through spring or dagger xml files, it will bind its logging and log configs through xml files, so in that way, pom.xml with maven is very natural to experienced devs in the industry

it is more programmable- but at the cost of being more scripty, and the fact that u have to rely on the gradle api, now dont get me wrong: thats all great once u get it to work, I also see tons of gradle scripts that dont follow conventions and use bad practices, which doesnt happen in maven cuz like- its just xml

manic delta
#

it does lmao

ivory sleet
#

for simple stuff where u dont need to pivot snippets of code around ur build pipeline, maven works excellently

chrome beacon
#

I would keep that versioning logic out of the build file

ivory sleet
#

and converting to gradle when it does get more complicated works reasonably well also

chrome beacon
#

Doesn't really belong there

manic delta
#

gradle build system looks better

eternal oxide
#

"better"

ivory sleet
#

build system?

chrome beacon
eternal oxide
#

I see simpler as better

ivory sleet
manic delta
#
plugins {
    id 'java'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'com.google.code.gson:gson:2.10.1'
}

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
    
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ejemplo</groupId>
    <artifactId>mi-proyecto</artifactId>
    <version>1.0.0</version>

    <dependencies>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.10.1</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
    </repositories>
</project>
#

which look better

#

and more easy

ivory sleet
#

its a shit example

manic delta
#

wym

#

it does

ivory sleet
#

yea it does if u just generated a blank project

chrome beacon
#

No publishing task

ivory sleet
#

but most if not all major projects that use gradle imports tons of gradle plugins

ivory sleet
#

javadocing, versioning, shading, modularity etc

manic delta
#

for spigot dev you only need two

ivory sleet
#

two?

#

two what

manic delta
# ivory sleet two?

only this

plugins {
    kotlin("jvm") version "2.1.20"
    id("com.gradleup.shadow") version "8.3.2"
    id("xyz.jpenilla.run-paper") version "2.3.1"
}
#

literally two

ivory sleet
#

like u didnt even include the spigot api as a dependency

#

idk if ur trolling

manic delta
#
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.kotlin.dsl.named
import xyz.jpenilla.runpaper.task.RunServer
plugins {
    kotlin("jvm") version "2.1.20"
    id("com.gradleup.shadow") version "8.3.2"
    id("xyz.jpenilla.run-paper") version "2.3.1"
}

group = "com.system32"
version = "1.0"

repositories {
    mavenCentral()
    mavenLocal()
    maven("https://repo.papermc.io/repository/maven-public/") {
        name = "papermc-repo"
    }
    maven("https://oss.sonatype.org/content/groups/public/") {
        name = "sonatype"
    }
    maven { url = uri("https://jitpack.io") }
    maven ("https://repo.codemc.io/repository/maven-snapshots/")
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("com.github.system32developer:SystemCore:1.6.3")
    implementation("net.wesjd:anvilgui:1.10.4-SNAPSHOT")
}

val targetJavaVersion = 21
kotlin {
    jvmToolchain(targetJavaVersion)
}

tasks.build {
    dependsOn("shadowJar")
}

tasks.processResources {
    val props = mapOf("version" to version)
    inputs.properties(props)
    filteringCharset = "UTF-8"
    filesMatching("plugin.yml") {
        expand(props)
    }
}

tasks.register("acceptEula") {
    doLast {
        val runDir = file("$rootDir/run")
        val eulaFile = file("$runDir/EULA.txt")

        if (!runDir.exists()) runDir.mkdirs()
        if (!eulaFile.exists()) {
            eulaFile.writeText("eula=true")
        }
    }
}

val path = "com.system32.schooldaysPets.shade"

tasks.named<ShadowJar>("shadowJar") {
    relocate("net.wesjd.anvilgui", "$path.anvilgui")
    manifest {
        attributes["paperweight-mappings-namespace"] = "spigot"
    }
}

tasks.named("runServer").configure {
    dependsOn(tasks.named("acceptEula"))
}


tasks.named<RunServer>("runServer") {
    minecraftVersion("1.21.1")
}


#

this is a fully file

#

for spigot dev

ivory sleet
#

yea now thats realistic example

manic delta
#

yea

#

it looks much more better than maven

ivory sleet
#

dont get me wrong, its far more complicated than maven

#

maybe less verbose

manic delta
#

i dont think so really

ivory sleet
#

maybe "cleaner" in ur eyes

manic delta
#

let me search one from maven

ivory sleet
#

but objectively, its more complicated, because u use the grammar from kotlin script, and u use api calls from gradle api, and u use types etc

manic delta
#

if your project is for java

ivory sleet
#

groovy u mean?

manic delta
#

yea

ivory sleet
#

ye but dont troll

#

no1 uses shit groovy for gradle

#

that shit is popo

manic delta
#

then learn kotlin

#

or just use java

ivory sleet
#

its not java buddy

manic delta
#

give me a second

ivory sleet
#

its groovy

manic delta
#

yea

ivory sleet
#

if u deny this, u're delusional - im sorry

#

that being said, yes gradle has a lot of benefits

#

dont get me wrong

manic delta
# manic delta ```gradle import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar impo...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.system32.ultimatewhitelist</groupId>
    <artifactId>UltimateWhitelist</artifactId>
    <version>1.9.8</version>
    <packaging>jar</packaging>

    <name>UltimateWhitelist</name>

    <properties>
        <java.version>16</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>16</source>
                    <target>16</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>shade</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>de.tr7zw.changeme.nbtapi</pattern>
                            <shadedPattern>com.system32.ultimatewhitelist.UltimateWhitelist</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>codemc-repo</id>
            <url>https://repo.codemc.io/repository/maven-public/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>opencollab-snapshot</id>
            <url>https://repo.opencollab.dev/main/</url>
        </repository>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>placeholderapi</id>
            <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.geysermc.floodgate</groupId>
            <artifactId>api</artifactId>
            <version>2.2.2-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.21.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>de.tr7zw</groupId>
            <artifactId>item-nbt-api</artifactId>
            <version>2.14.1</version>
        </dependency>
    </dependencies>
</project>

maven one

jagged thicket
#

i like gradle because brackets

#

and i hate doing <> <\>

manic delta
# manic delta ```gradle import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar impo...
plugins {
    id 'java'
    id("xyz.jpenilla.run-paper") version "2.3.1"
}

group = 'com.system32'
version = '1.0'

repositories {
    mavenCentral()
    maven {
        name = "spigotmc-repo"
        url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
    }
    maven {
        name = "sonatype"
        url = "https://oss.sonatype.org/content/groups/public/"
    }

    maven { url "https://maven.enginehub.org/repo/" }
    maven { url "https://jitpack.io" }
    maven { url "https://www.matteodev.it/spigot/public/maven" }
}

dependencies {
    compileOnly("org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT")
    compileOnly("com.github.LoneDev6:api-itemsadder:3.6.1")
    compileOnly("dev.lone:LoneLibs:1.0.58")
    compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.12'
}

def targetJavaVersion = 21
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8'

    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release.set(targetJavaVersion)
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}

tasks {
    runServer {
        minecraftVersion("1.21.1")
    }
}

#

groovy

ivory sleet
#

no one uses groovy as said - the intellij support for the groovy dsl sucks

manic delta
#

i think gradle is 0 complicated

ivory sleet
#

u are wrong

#

but thats fine

manic delta
#

lol

chrome beacon
ivory sleet
#

visible disappointment

jagged thicket
#

jus use kt

chrome beacon
#

I prefer it over Kotlin

jagged thicket
#

wy

ivory sleet
#

really, I had so many syntax highlighting issues with it

manic delta
ivory sleet
#

and ide auto suggestion issues

chrome beacon
#

Had the same problem with kotlin

#

So not much of a diff there

ivory sleet
#

i remember it not recognizing shadowJar types, tho that might be because shadowJar gradle plugin was coded poorly initially

manic delta
#

@jagged thicketwhich one you think is better

ivory sleet
#

but also just the fact that its... groovy makes it somewhat daunting to even touch

jagged thicket
manic delta
#

why

jagged thicket
#

what?

manic delta
#

explain why

#

i use kts gradle too

jagged thicket
ivory sleet
#

@chrome beacon why u up

manic delta
#

oh

chrome beacon
#

My sleep schedule is broken

#

How about you

ivory sleet
#

fbm, same same

#

u working on anything cool?

manic delta
#

mine sometimes

jagged thicket
#

its 6:30 am

#

in the correct time zone

manic delta
chrome beacon
manic delta
#

i want to buy a raspberry pi

jagged thicket
#

i have rasp 3

manic delta
#

is it good?

jagged thicket
#

no

manic delta
#

i was thinking about 4

#

with 8gb

chrome beacon
#

More like burned out

manic delta
ivory sleet
jagged thicket
#

raspberry pi sucs for anything useful