#help-development

1 messages · Page 1069 of 1

keen charm
#

In my plugin I send this packet like this: connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(Collections.singletonList(serverPlayer)));

eternal oxide
#

malformed packet or sent at the wrong time

keen charm
#

And what would cause it to be malformed?

#

Also it shouldn't be malformed since I'm using the native function to create the packet

#

Caused by: io.netty.handler.codec.DecoderException: Malformed public key bytes

#

It seems to be malformed :/

#

Why though?

#

I've deleted NoChatReports plugin and joined from a vanilla client and it seems to work fine

#

Could it be due to chat reports?

sullen belfry
#

is this the best way to do infinite potion effects?

pseudo hazel
#

iirc there is an infinite duration constant

sullen belfry
#

i understand Integer.MAX_VALUE = 3.4 years roughly but still... it doesn't look pretty lol

pseudo hazel
#

but I think its -1

sullen belfry
pseudo hazel
#

yeah try that

sullen belfry
#

alright

sullen belfry
#

you are the one

echo basalt
sullen belfry
#

?

#

both work the same

#

which would be better practice?

echo basalt
#

INFINITE_DURATION is going to keep up with updates as long as you change the api version you're building against

sullen belfry
#

alright

#

Thanks for the help both of you!

obsidian river
#

does someone know how i can remove the tooltip for the spawners? thanks 🙂

pseudo hazel
#

i just remember it being set to -1

torn shuttle
#

does anyone know if the scale attribute can be used on player?

#

that would be very funny but I'm guessing no

eternal oxide
#

I'm told yes

torn shuttle
#

really?

muted otter
#

yes, i have done it

eternal oxide
#

might be fun to have all players 0.5 or 2x size

mellow edge
#

I am not really an expert with databases, but I want my plugin to support bungee-like (velocity, waterfall, etc.) servers, so it will store config per-player in a database instad of a local file, so that the player will on any proxy have the same data in my minigame. My question is whether:

  1. this is a good idea?
  2. I should use JDBC?
  3. I can have multiple mysql connections with the same account concurrently accessing the same table (from different mc proxies)?
eternal oxide
#
  1. yes 2. yes 3. yes
#

however, when changing servers behind a proxy the player will move to the new server before the quit event fires on the leaving server.

#

ie, the data on the SQL is likely to be out of date on the join

burnt current
#

does somebody code with intellij?
I just set up a new Spigot project and added a server file so i can test and debug the plugin faster. This worked well, there is just one big problem if i try to make inputs in "Run" which is the console, like testing commands or op someone, nothing happens. I cant do any inputs in the console with intellij. But if i start the server itself without Intellij, and the normal console starts, everything works fine.
Does someone know how to solve this issue?
Somebody said i need to run it in the terminal but how do i do this?

blazing ocean
#

just run the server in your terminal

mellow edge
summer scroll
#

I'm, trying to use a virtual anvil, but the gui does not work like a regular anvil. This is the code

// Create anvil inventory
Inventory inventory = Bukkit.createInventory(null, InventoryType.ANVIL);
// Open the anvil
player.openInventory(inventory);
#

Same goes for smithing table and maybe other inventory type too.

cinder abyss
#

Hello, how can I do a multi-module gradle project to use mojmaps with spigot and nms ?

shadow night
#

by creating multiple modules

cinder abyss
cinder abyss
#

there is another thing necessary to group everything ?

remote swallow
#

im pretty sure its on ?nms

#

?nms

remote swallow
#

wow it is

cinder abyss
remote swallow
#

its exactly the same except the nms module has that

shadow night
#

Multi module should be just making many modules and shadowing them into your core basically

shadow night
#

Well, there is some gradle stuff

remote swallow
#

well there is more stuff but its basic

shadow night
#

I think there was some method to get a module as a dependency

#

Just compileOnly the core for all the modules (besides the core ofc) and implementation all the modules in the cores build.gradle[.kts]

cinder abyss
#

okay thanks

tardy delta
#

is impl like provided?

shadow night
cinder abyss
#

let's try that, and destroy the base code (because he's using PAPER as a base, but for 1.20.5+, well goodbye spigot support because cb notation has been removed :/)

tardy delta
#

so compileonly is provided hmm

river oracle
#

You don't need to worry about that

cinder abyss
shadow night
#

implementation will be shadowed/shaded, compileOnly won't. You don't need to shade your core into modules but you need to shade the modules into the core

river oracle
#

Don't worry about what they do

#

They want to keep comp

cinder abyss
shadow night
keen charm
#

Paper is gud, Spigot is gud

#

Gud 👍

shadow night
remote swallow
cinder abyss
shadow night
keen charm
remote swallow
#

for spigot it must inlude that, paper will remove it and make it work for papermc servers

cinder abyss
#

so keeping the actual code (who uses paper as base) would drop spigot support for 1.20.5

remote swallow
#

no

river oracle
#

If it uses paper and their tooling yes

remote swallow
#

if you use paperweight with paper mappings as a base yes it would drop spigot support

remote swallow
#

if you want spigot support use the remapper that alex has

cinder abyss
#

yeah

#

PATRICK 🗣️

shadow night
#

Everybody these days has their own remapper

cinder abyss
#

🤮🤮🤮

shadow night
#

Atleast they have a plugin

cinder abyss
#

at least

blazing ocean
cinder abyss
#

but that's paper

river oracle
cinder abyss
#

and I'm a spigot one

blazing ocean
#

it allows me to use remapped nms from my own fork within one line

river oracle
#

Spigot by base us maven

#

Paper by base is gradle

shadow night
#

But why use maven

blazing ocean
#

real

cinder abyss
river oracle
shadow night
cinder abyss
#

that's 0*

eternal oxide
#

MAven and Gradle are both fine. Its down to preference

shadow night
#

maven is just for people who prefer maven

burnt current
cinder abyss
shadow night
#

I like gradle more, because I can program it

blazing ocean
cinder abyss
#

but the more I look to maven, the more I see that like "too many characters"

river oracle
shadow night
cinder abyss
#

like, look at this thing

blazing ocean
low marlin
#

where can I find the spigot api for 1.21 after installing buildtools?

#

in the folders

blazing ocean
#

why do you need the files

shadow night
low marlin
river oracle
blazing ocean
#

use a proper buildtool

#

?maven

undone axleBOT
shadow night
blazing ocean
#

i prefer gradle because it has the kotlin dsl and i can just code something without having to look up how to do it

#

it's also more readable

shadow night
#

And since I said "in my opinion" nobody can tell me anything, I'm protected

blazing ocean
#

bro used protection

shadow night
eternal oxide
#

it was super effective

cinder abyss
blazing ocean
#

predicated?

#

bro IS a predicate

cinder abyss
cinder abyss
shadow night
burnt current
cinder abyss
shadow night
blazing ocean
#

what is sûr

cinder abyss
#

💀

tardy delta
#

sister

blazing ocean
#

"you are sister"?

tardy delta
#

what

keen charm
sterile breach
#

What is the difference between EntityTargetLivingEntityEvent

And EntityTargetEntityEvent?
Not sure to understand

eternal oxide
#

the second would fire for a zombie targeting a door (probably)

#

nah thats bollox

cinder abyss
#

(TileEntity ?)

eternal oxide
#

first one Called when an Entity targets a LivingEntity and can only target LivingEntity's.

#

No idea what entities they'd want to target thats not living

cinder abyss
#

humm

sterile breach
#

Stranger

cinder abyss
#

GOODBYE STRANGER 🗣️

#

SUPERTRAMP

sterile breach
#

If I cancel entity targeting, it don't retry to target me directly?

eternal oxide
#

it might, in the next tick

sterile breach
#

For my case I am doing it for a vanish plugin (I cancel player packets but entity can see me) maybe I just can give an invisibility effect ?

eternal oxide
#

just cancel all target events if teh target is vanished

sterile breach
#

Zombie will not attack me if I cancel target ?

eternal oxide
#

no

topaz kestrel
#

is there a skin packet to update player' skin for a specific player

burnt current
sterile breach
# eternal oxide no

I also have to prevent enderman eyes contact and creeper explode, lot of évent to prevent, are you sure is not better to just give invisibility effect who fixe all thèse problems?

blazing ocean
burnt current
#

i dont understand

burnt current
blazing ocean
#

you just copy your jar to your servers plugins folder

#

and then you run your server

burnt current
#

but then the server starts outside intellij

blazing ocean
#

okay

#

and how is that bad

eternal oxide
burnt current
#

idk, i just searched for a possibility to debug the plugin and not to leave intellij, so its more automized, but like i said the console doesnt work there

eternal oxide
#

That link has two methods of debug

#

as a server and IDE as debug server

#

the second is probably what you want

burnt current
silk vine
#

Is there a plugin that will remove the item on the floor with a every few minutes?

eternal oxide
#

I guess not. I've never used it as I don;t use IJ

burnt current
obsidian river
#

hey does anyone know how i can remove that interact and the blue text?

chrome beacon
#

ItemFlags

obsidian river
pseudo hazel
#

spawnerMeta.setItemFlags

obsidian river
#

does this work too?

pseudo hazel
#

no

#

the item flags are added to hide stuff

#

by default everything is shown

obsidian river
pseudo hazel
#

mb its addItemFlags

obsidian river
#

ahh

#

alr thanks

#

and how can i remove it just ""?

pseudo hazel
#

no

#

its like ItemFlags.HIDE_ADDITIONAL_TOOLTIP or which ever

#

you can find the m in the docs

obsidian river
remote swallow
#

its either attributes or potion effects

obsidian river
#

yea

chrome beacon
#

probably potion effects

remote swallow
#

^^

chrome beacon
#

it's generally used for item specific descriptions

obsidian river
#

and i cant use removeItemFlags?

pseudo hazel
#

no

#

I just told you

obsidian river
#

okey and why?

pseudo hazel
#

you add an item flag to hide a part of the lore

chrome beacon
#

^^

pseudo hazel
#

thats how it works

remote swallow
#

by default no item flags are present

slender elbow
#

you add the flag to hide things

#

you remove the flag to show things

obsidian river
#

ah okey

slender elbow
#

if you remove the flags, it'll show all the things

obsidian river
#

so just like this: meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_ATTRIBUTES);

pseudo hazel
#

?tas

undone axleBOT
obsidian river
#

hehe thank you

torn shuttle
#

I'm losing my gourd

#

why is this plugin compiling in java 22

#

and not 21

#

?paste

undone axleBOT
torn shuttle
#

where is this even coming from

quaint mantle
#

Maven compiler plugin

#

Set target to 21 ig

torn shuttle
#

but it's set to 17 right

#

because it's reporting as 22 when it pops up on console

remote swallow
#

check what ver ur server is running

torn shuttle
#

21

#

my remote testbed is on java 21

#

I checked

blazing ocean
#

change everything to 21 lmao

torn shuttle
#

I think cleaning and recompiling fixed it

#

weird

umbral arch
#

I only am just getting back into plugin development. It seems that the Material field for ItemStacks have become depreciated? How else am i supposed to set ItemStack material in an inventory??

umbral arch
#

I might be an idiot

#

okay.. nothing has changed😭

worthy yarrow
#

invalidate caches

umbral arch
#

What does this have to do with my question though?\

worthy yarrow
#

Do you want it fixed or not

#

It's a goofy intelliJ thing man

umbral arch
#

Ofc i do, I'm just not following. I've invalidated my caches, IntelliJ is starting up. didn't mean to be rude btw

worthy yarrow
#

You're not, it's alright

umbral arch
#

Thank you, what's next?

worthy yarrow
#

Actually ok

#

This is weird

umbral arch
#

Hm?

worthy yarrow
#

Wait I lied I was looking at the wrong api page

umbral arch
#

lol no worries

worthy yarrow
#

Nothing here is deprecated so, like I said earlier intelliJ likes to fuck around

umbral arch
#

Ah, i should mention I'm not running this on 1.21. I'm using 1.20.5, Is it imperative that I use 1.21?

worthy yarrow
#

No, but the updating/invalidating should have fixed it

#

should with a grain of salt? It's always fixed it for other people

umbral arch
#

I'm looking at an API page and it's saying that Materials are depreciated 😭

worthy yarrow
#

that's .materials iirc

#

not .Materials

umbral arch
#

Huh okay

worthy yarrow
umbral arch
#

I'm still not following I'm not gonna lie

worthy yarrow
#

Let me see if I can find someone else to help lol, I'm not sure what else would be causing the issue

umbral arch
#

I'm seeing that some other people have had the same issue, i'm going to dm them and see if they ever fixed it

worthy yarrow
#

let olivo finish

chrome beacon
#

NuclearKat appears to be confused

#

What exactly is deprecated

worthy yarrow
#

Maybe I am

#

Still in the waking up process so maybe I'm just dumb idk

umbral arch
chrome beacon
#

That would be an Intellij bug

carmine mica
#

what is your intellij version?

worthy yarrow
#

I knew it

chrome beacon
#

Set Java version to 21 and update Intellij

umbral arch
worthy yarrow
#

oh that woulda been a good question

#

You said you're running 1.20.6 right?

chrome beacon
#

btw :)

worthy yarrow
#

Ith that's what got me so confused

umbral arch
worthy yarrow
#

either way

#

thats j21

chrome beacon
umbral arch
#

I only need to change the java version in the pom.xml correct?

worthy yarrow
#

yeah then reload maven

chrome beacon
#

and set the jdk in project settings

worthy yarrow
#

it doesnt do that automatically when setting the lang level in pom?

chrome beacon
#

not sure

worthy yarrow
#

Or at least when compiling

chrome beacon
#

maven does the compiling

worthy yarrow
#

That's why I'd think the pom would be fine to just change but eh just to be safe do both

chrome beacon
#

but then again I believe IJ sets the jdk it uses 🤷‍♂️

worthy yarrow
#

Fair enough

subtle folio
#

why do multiple lines of text displays sometimes center and sometime dont?

#

these pics are taken between one restart with no code change

brittle geyser
subtle folio
brittle geyser
#

use armor stands

remote swallow
#

no

#

text displays are designed to be used instead of armor stands

remote swallow
subtle folio
#

as a passenger

remote swallow
#

is it a passenger

subtle folio
#

yes

remote swallow
#

with it actually being a passenger i hav eno idea then

#

@young knoll might know

subtle folio
#

@young knoll wakke up

remote swallow
#

ntdi can you say this word

#

or type it

subtle folio
#

why

remote swallow
#

no reason

subtle folio
#

only 🪭

remote swallow
#

smh

ivory sleet
#

bru even us mods get timed out for it

remote swallow
#

lmfao

ivory sleet
#

like its crazzy

remote swallow
#

wtf

subtle folio
#

LOL

remote swallow
#

did you try it conclube

ivory sleet
#

na retroop told me

#

and I tried yk... woops

remote swallow
#

does it let you untime urself out

ivory sleet
#

idk tbh

tardy delta
#

onłyfans

ivory sleet
#

i think not last time, but that was on phone so quite possible i could

remote swallow
#

you should try it

ivory sleet
#

@worthy yarrow I assume u said the word?

tardy delta
blazing ocean
worthy yarrow
blazing ocean
#

split the bitmap up

remote swallow
#

conclube can you untime me out in a minute

worthy yarrow
#

He peer pressured me into it 😦

ivory sleet
#

lol well its revoked now

ivory sleet
subtle folio
#

should i define it in the font setting

blazing ocean
#

that's not a thing

subtle folio
#

wym

burnt current
#

does EntityType still exist?

I tried to create a Npc at the players location with a command

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            if (player.hasPermission("createNPC")) {
                Location loc = player.getLocation();
                Villager npc = (Villager) loc.getWorld().spawnEntity(loc, EntityType.Villager);
                npc.setCustomName("Click me for a menu!");
                npc.setCustomNameVisible(true);
                npc.setAI(false); 
                npc.setInvulnerable(true);

but Somehow Intellij says "EntityType" does not exist, while "spawnentity" needs a location and an EntityType.
Does somebody know what the problem is?

subtle folio
remote swallow
#

thanks cowoconcluwube

blazing ocean
#

you cannot define the width 😂

subtle folio
#

height and width?

blazing ocean
#

that's different

#

a lot different

subtle folio
#

??

blazing ocean
#

it doesn't do what you expect it to do here

subtle folio
#

how 2 fix

blazing ocean
#
Minecraft Wiki

The font is the typeface that Minecraft uses. It was first added in Java Edition Classic 0.0.2a and has seen many revisions and additions since.
Its design has been present in all ports of the game.
In Java Edition, the font’s name is Minecraft Seven. It contains 2,426 characters. Multiple fonts can be defined and referenced with resource packs.

blazing ocean
subtle folio
#

off center

blazing ocean
#

split it into bitmaps of sizes like 8px

subtle folio
#

oh

#

thats lame

blazing ocean
#

because you are presumably using some other weird width

#

like 23px or sth

subtle folio
#

it changes per image

#

its just the full width

blazing ocean
subtle folio
tame wolf
#

Hello! I'm having trouble with SnakeYAML refusing to import?

I import it by doing

import org.yaml.snakeyaml.Yaml;

but I get the error
error: package org.yaml.snakeyaml does not exist import org.yaml.snakeyaml.Yaml;

These are my dependencies in my build.gradle:

dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
        classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1'
        implementation 'org.yaml:snakeyaml:2.2'
    }
#

I even went directly to MavenCentral directly and got the implementation line from it

remote swallow
#

why are you classpathing plugins

tame wolf
#

Except when I try to compile my plugin it gives me the error in my original message

remote swallow
#

you should be adding them to the plugin block

tame wolf
#

IntelliJ told me to do it!

blazing ocean
#

it certainly didn't do that

remote swallow
#

rad you can explain how to fix it

#

thanks

tame wolf
#

(As in lower in the build file)

kindred valley
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

hybrid turret
#

Isn't Player#setPlayerListName supposed to change the name in the tablist?

kindred valley
#

Certainly

spice bough
#

does java 8 have custom model data feature

hybrid turret
#

then it's acting up

tame wolf
kindred valley
spice bough
hybrid turret
#

changing the name in the GameProfile works and all but setting the tablist name with said method won't do shit

hybrid turret
#

well

#

player.setPlayerListName(name)

kindred valley
#

Do you equalize it to an object

#

Imean player object

hybrid turret
#

i don't get what u mean in this context, lol

#

oh-

#

apparently i have to change the tablist name BEFORE changing the name in the GameProfile

#

lol

kindred valley
#

Wdym game profile

kindred valley
spice bough
hybrid turret
#

i wrote a method for FULLY changing the name, chat, tablist and gameprofile

#

basically a nick

kindred valley
#

What spigot version

spice bough
#

Cannot resolve method 'hasCustomModelData' in 'ItemMeta'

blazing ocean
#

what mc version

spice bough
#

1.12

pseudo hazel
#

💀

tardy delta
#

💀

kindred valley
hybrid turret
#

1.12 is an interesting version to code on these days

hybrid turret
spice bough
#

i think its not important i just selected it when i created the project

pseudo hazel
#

the java version is not related to the minecraft version

hybrid turret
#
public static void setName(Player player, String name) {
    GameProfile profile = getProfile(player);
    try {
      player.setPlayerListName(name);
      player.setDisplayName(name);
      Field field = profile.getClass().getDeclaredField("name");
      field.setAccessible(true);
      field.set(profile, name);
    } catch (Exception ignored) {
      player.sendMessage("Failed to change username.");
    }
  }
blazing ocean
#

as well as anything <1.20

spice bough
#

i'm making it for from 1.8 to 1.20

pseudo hazel
#

well the game version is like the most important part xD

#

then you have to use 1.8 api

#

but good luck with that 😛

blazing ocean
hybrid turret
#

from what i've heard 1.8 api is so bad compared to today lol

#

why do you want to make it for so many different versions?

blazing ocean
spice bough
#

because all plugins works from 1.8 to newest versions

hybrid turret
#

💀

pseudo hazel
#

9

spice bough
#

and i want it too

hybrid turret
#

for example mine dont

#

LOL

spice bough
#

still a lot of plugin supports 1.8

pseudo hazel
#

thats their fault

spice bough
#

most popular plugins always support 1.8

hybrid turret
#

I started on 1.8 but nobody is really playing that version anymore except for old aah pvp shit.

and since it didn't fit the purpose of the plugin i migrated to 1.19.2 and then to 1.19.4 (there was a lot of time in between the migration bc idk i got bored or sum)

I couldn't bother to migrate to 1.20 bc i think some stuff changed there and i was like "eh- not worth it. not yet"

hybrid turret
blazing ocean
spice bough
#

but i think there is no big difference between java 8 and java 17 etc.

hybrid turret
#

there kinda is

pseudo hazel
#

yeah that may be true

#

but there is a huge difference in minecraft versions

hybrid turret
#

well

#

for mc not that much. but in the api versions

blazing ocean
hybrid turret
#

like a L O T

blazing ocean
#

please just use latest

hybrid turret
#

or at least a fairly new version

blazing ocean
#

1.20+

hybrid turret
#

especially when you want to get into the topic of coding

#

did that much change between 1.19.4 and 1.20?

blazing ocean
blazing ocean
hybrid turret
#

i mean - that again - depends on the purpose of your plugin lmao

spice bough
#

btw why lowest mc version option is 1.12 in project settings

blazing ocean
#

what 🤨

hybrid turret
#

what project settings?

blazing ocean
#

what project setting

hybrid turret
#

lol

spice bough
#

when i create new project

hybrid turret
#

what IDE are you using?

spice bough
#

intellij

hybrid turret
#

with the Minecraft Development Plugin, i suppose?

pseudo hazel
#

because 1.8 is ancient

blazing ocean
#

mc dev plugin sucks

chrome beacon
#

mcdev can be quite useful when working with mixins

hybrid turret
#

lol for me the lowest version is 1.18 XDD

chrome beacon
#

but that's not Spigot so no need for it

worthy yarrow
still jacinth
#

alright so i have this weapons and i modified its attribues, i noticed when changing a single one it removes the vanilla attributes (diamond sword) so i added them back as so

meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(UUID.randomUUID() ,"generic.attack_damage", 7, AttributeModifier.Operation.ADD_NUMBER, getItemSlot(player.getInventory(), itemStack)));
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(UUID.randomUUID(), "generic.attack_speed", 1.6, AttributeModifier.Operation.ADD_NUMBER, getItemSlot(player.getInventory(), itemStack)));
itemStack.setItemMeta(meta);```
#

but the attack speed seems to be a lot faster than usual, and from searching in the forums i found that the modified applies on top of the players attributes, so i set the attack speed to a negative number and that seemed to work, so now im just looking for a way to do this that dosent involve the negative number so that it can display properly as 1.6 instead of -2.4 on the weapon

meta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier(UUID.randomUUID(), "generic.attack_speed", -2.4, AttributeModifier.Operation.ADD_NUMBER, getItemSlot(player.getInventory(), itemStack)));
#

sorry for flood :/

blazing ocean
#

you can't code in console

hybrid turret
#

you're only cool, when u know how to close vim

#

and nano

worthy yarrow
blazing ocean
#

kat refuses to leaen vim

blazing ocean
worthy yarrow
#

Your loss

hybrid turret
#

vim is actually such a good text editor lol

#

neovim is even better

blazing ocean
#

lazyvim >>>>

hybrid turret
#

uh oh

#

linux rabbit hole

blazing ocean
hybrid turret
#

hahahah

blazing ocean
hybrid turret
#

we goin down the linux rabbit hole now?

blazing ocean
#

sure why not

worthy yarrow
hybrid turret
#

first thing: what linux version are you mainly using? i'm boring and use plain debian

hybrid turret
hybrid turret
#

distro

#

mb

blazing ocean
#

arch btw

hybrid turret
#

ohhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

i resign

#

🏳️

remote swallow
hybrid turret
#

arch is a different breed

hybrid turret
umbral ridge
#

arch is love

blazing ocean
#

real

umbral ridge
#

without arch

#

my life

remote swallow
umbral ridge
#

is

hybrid turret
#

arsch

blazing ocean
hybrid turret
#

😎

umbral ridge
hybrid turret
#

oops

#

outed myself

umbral ridge
#

har har har harr har

#

😂

blazing ocean
hybrid turret
#

my cover is blown, i have no idea what wm is supposed to stand for

blazing ocean
#

window manager

hybrid turret
#

ahh

#

xfce4

#

lol

#

hello? upload? internet?

#

oh there we go

blazing ocean
#

xfce 💀

hybrid turret
#

yeaaaaaa

#

i know i know

#

but i can't bother to change it rn

#

too much to do

blazing ocean
#

desktop environment 💀

hybrid turret
#

m

#

um

#

okay ig i barely scratched the unix surface

#

since i outed myself as a german yall pobably know (or not) that it's after 10pm and i gotta work tomorrow. gnight gang

blazing ocean
#

kek

#

half this server is german

hybrid turret
#

yea i figured lol

#

was very comforting tbh when i realize then 7's nick is gestankbratwurst schnitzel

shadow night
blazing ocean
#

insert one of your gifs here

blazing ocean
#

of raydan

#

i'm on mobile so i don't have fav gifs

blazing ocean
still jacinth
hard radish
#

java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients

    compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")

    compileOnly 'org.projectlombok:lombok:1.18.34'
    annotationProcessor 'org.projectlombok:lombok:1.18.34'

    testCompileOnly 'org.projectlombok:lombok:1.18.34'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'

    implementation 'org.mongodb:mongodb-driver-sync:5.1.2'
    implementation 'org.mongodb:mongodb-driver-core:5.1.2'
    implementation 'org.mongodb:mongodb-driver-legacy:5.1.2'
    implementation 'org.mongodb:bson:5.1.2'


    compileOnly 'io.lumine:Mythic-Dist:5.6.1'
}```
tender shard
#

are you using the shadow plugin?

hard radish
#

no

tender shard
#

you need to use it to create a shaded .jar (one with dependencies included)

hard radish
#

so i just have to add the shadow plugin dependencies correct?

tender shard
chrome beacon
#

MongoDB is on maven central

#

so using the library loader is also an option

blazing ocean
#

use gooolers shadow

#

it works with java 21

chrome beacon
#

^^

#

old shadow isn't maintained anymore

#

Use gooler fork

young knoll
#

Rip John shadow

hard radish
#

thank yall for the help

chrome beacon
blazing ocean
chrome beacon
#

Yes

#

and as I said in the earlier message mongodb is on central

blazing ocean
#

paper supports other repos with paper plugin loaders which you seem to be using already (paper)

hard radish
#

correct im using paper

hard radish
azure zealot
#

how can i send a custom achievement complete message?

cinder abyss
#

Hello, what should I use instead of new NamespacedKey(string, string)) ?

shadow night
#

new NamespacedKey("string:string") I think it was something like that

cinder abyss
#

I think I've found

#

NamespacedKeyfromString

shadow night
shadow night
chrome beacon
#

yeah it's fromString are you sure you actually have to use it

cinder abyss
cinder abyss
shadow night
chrome beacon
#

It's deprecated so people actually use their own plugins namespace

#

and not something else

#

or at least that's how I understood it 🤷‍♂️

shadow night
#

I think I've heard it being used internally somewhere but I'm unsure

chrome beacon
#

might be

#

no idea

shadow night
#

Could be new NamespacedKey("bukkit", somethingElse) or something, would fit the bukkit style

cinder abyss
#

hum, then I'll use that

#

And also

remote swallow
cinder abyss
#

Why should I use build.gradle.kts instead of build.gradle for plugin development ?

remote swallow
#

kotlin v groovy

cinder abyss
#

yeah

remote swallow
#

intellij has intellisense for kotlin

cinder abyss
#

@blazing ocean, I appreciate the kotlin syntax

remote swallow
#

nothin for groovy

cinder abyss
blazing ocean
#

olivo no

cinder abyss
#

I like kotlin

chrome beacon
blazing ocean
#

yes it does

chrome beacon
#

guess mine is broken

remote swallow
#

smh stop breaking gradle

worthy yarrow
#
private static BlockVector3 getBlockVector3(Player player, Location targetLocation, Location oppositeCorner) {
        BlockVector3 pasteLocation = BlockVector3.at(
                Math.min(targetLocation.getBlockX(), oppositeCorner.getBlockX()),
                Math.min(targetLocation.getBlockY(), oppositeCorner.getBlockY()),
                Math.min(targetLocation.getBlockZ(), oppositeCorner.getBlockZ())
        );

        BlockFace facing = player.getFacing();

        int offsetX = 4;
        int offsetZ = 2;

        if (facing == BlockFace.NORTH) {
            offsetX = -1;
            offsetZ = -3;
        }

        pasteLocation = pasteLocation.add(BlockVector3.at(offsetX, 3, offsetZ));
        return pasteLocation;
    }```

You guys ever seen a more hardcoded solution?
chrome beacon
#

Well I mean it's partially working

#

just like Groovys intellisense is working partially

cinder abyss
#

looks like it's better than groovy one for now

remote swallow
#

i get intellisense on everything

cinder abyss
#

this is beautiful

remote swallow
#

why isnt src a core module

cinder abyss
remote swallow
#

so modify it

cinder abyss
#

nah, it's perfectly working

#

why should I do that ?

remote swallow
#

more organized

cinder abyss
#

I prefer like that

quiet ice
remote swallow
cinder abyss
tardy delta
#

the reason i dont use gradle

blazing ocean
#

sbt

tardy delta
#

maven

blazing ocean
#

skull

blazing ocean
cinder abyss
worthy yarrow
#

They all kinda suck who cares to argue about them kek

blazing ocean
#

you only need a build.gradle.kts

remote swallow
tardy delta
#

i prefer awful xml over caching half the universe, having a bunch of files and having a gradle daemon that always crashes 😳

blazing ocean
remote swallow
#

a lot of people push all but .gradle to make it easier for other people to build, without it you could get someone with a different wrapper or gradlew and something could stand the chance to not work

blazing ocean
#

but it literally just works without installing shit with the gradle wrapper

cinder abyss
#

you see @tardy delta, my pom.xml for ONE module can't even fit in discord

tardy delta
#

cringe

#

not inheriting parent pom?

cinder abyss
#

it is

#

it inherits

tardy delta
#

pom.toml when

#

already preparing for the hate dms

#

this server seems to be collectively against toml files

cinder abyss
#

bruh

blazing ocean
#

toml ftw

tardy delta
#

last time you said toml sucks

lilac dagger
#

well, we have yaml which works

blazing ocean
#

never did

tardy delta
#

someone else then

blazing ocean
#

i'm a diehard toml enjoyer

lilac dagger
#

i think toml is worse at making lists no

#

?

tardy delta
#

how so

lilac dagger
#

i think someone here said so

cinder abyss
tardy delta
#

[] is valid in yml too

#

pom.hcl

lilac dagger
#

yeah but you can't type them by hand as nicely

inner mulch
#

I'm animating the tablist, animations can be changed once per tick, if 100 players have such a tablist that is constantly updated once per tick, will it affect the performance drastically?

lilac dagger
#

as in a

  • one
  • two
tardy delta
#

:/

cinder abyss
inner mulch
tardy delta
#

would be less verbose

inner mulch
#

so how do big servers animate without performance loss

cinder abyss
inner mulch
#

yeah thats why i cant check

blazing ocean
sinful hatch
lilac dagger
#

but they do take the hit

cinder abyss
lilac dagger
#

or they change as little as possible

inner mulch
chrome beacon
lilac dagger
#

it can

inner mulch
#

nice

blazing ocean
lilac dagger
#

it's similar to chat no?

chrome beacon
#

What's it even being used for?

blazing ocean
#

api too i think

inner mulch
blazing ocean
#

packets can always be sent async iirc

lilac dagger
#

oh yeah

inner mulch
#

ok

lilac dagger
#

packets are all async anyway

#

but think of optimizing, change only what's necessaryy

#

or even offset steps to spread the load

sinful hatch
inner mulch
lilac dagger
#

wait, are you only updating the header and footer?

inner mulch
#

thats what the tablist is isnt it

blazing ocean
lilac dagger
#

it shouldn't be that expensive then

blazing ocean
#

updating header every tick for ~50 players isn't expensive at all for me

inner mulch
#

alright

chrome beacon
#

ncp is open source

blazing ocean
alpine urchin
blazing ocean
#

retro the packet man 💪

alpine urchin
#

a slow connection shouldn't make your game stutter

#

think of it

lilac dagger
#

retro the limbo guy

sinful hatch
alpine urchin
#

lol

#

but it's important to know what context you are in

#

sometimes you are already in an async context

#

where it might not be necessary to switch to another thread

chrome beacon
#

That seems odd

lilac dagger
#

as far as i know netty has a thread pool it uses, making it async from the get go

chrome beacon
#

Looked it up it should be able to

#

with m2Local as the repo name

#

or are you talking about installing it to local?

sinful hatch
#

huh, surprised it will do that, usually likes to be quite hermetic

#

i'll just stick the jar into git anyway, not like nocheatplus is receiving major updates

chrome beacon
#

There is a maintained fork of it

sinful hatch
#

ik, im only using the api so it shouldnt matter really

alpine urchin
#

doing heavy processing on netty threads can also overload the cpu and delay everything

#

leading to "higher" ping for everyone

#

very interesting

lilac dagger
#

oh yeah

#

that's something to look for as well

alpine urchin
#

people often go crazy on async

#

and everything

#

frick the main thread

#

till they forget that its still running on their cpu kek

#

don't neglect the main thread unnecessarily

lilac dagger
#

pretty much

chrome beacon
#

Virtual threads are nice though

grim hound
#

does fastutil not have concurrent support?

#

would need int2object of a concurrent hash map

chrome beacon
#

It does not

#

I believe Trivago has a couple concurrent versions of fastutil maps

#

Not all of them though

grim hound
quiet ice
#

I have a ConcurrentInt62Set, but not a map variant

#

Though uh, the way Trivago does concurrency is a bit laughable

grim hound
#

?

young knoll
#

What the heck is an Int62Set

quiet ice
#

that one is based on long-arrays at it's core, with 2 bits used for access control to ensure that no duplicate values are in the set

#

one bit is used to disable writing while the other bit is used to disable reading, it's a bit unintuitive but also not that complicated really

hard radish
#

is there a tutorial on how to custom generate (schematica) a region for a player?

quiet ice
hard radish
#

example would be something like prison server's private mines

chrome beacon
#

You can use the WorldEdit API for schematics

grim hound
#

I think I'll just reimplement the int2objectopenhashmap into a concurrent one

young knoll
#

If it’s 62 bits of data isn’t that closer to a long

#

Smh

quiet ice
#

Longs are still integers

young knoll
#

Tell that to java!

quiet ice
quiet ice
young knoll
#

Exactly

#

I say they fight over it

quiet ice
#

Be happy that you have no long long here

young knoll
#

What about a short short

remote swallow
#

what if i want a short long int

grim hound
#

I read the src of java's concurrent hash map

#

so I know how it works pretty much

quiet ice
#

If you consider slapping a synchronized on it "concurrent" then yeah - easy, otherwise not really

quiet ice
#

Java's CHM uses APIs inaccessible to normal Java programs

grim hound
#

only on the currently modified bucket

humble tulip
grim hound
#

Unsafe, my friend

humble tulip
quiet ice
hard radish
humble tulip
#

Why do you need custom spacing?

grim hound
#

I hope

young knoll
#

Kek

quiet ice
#

The methods used have been nuked in newer versions of Java (~J17), but the replacements don't yet exist in Java 8

#

It's not an instance of "oh, in a future version it's gone" but more like "oh, it's already gone"

echo basalt
quiet ice
#

You thankfully can still do quite a bit with AtomicIntegerFieldUpdater et al, it just wouldn't be a 1:1 copy of CHM

echo basalt
#

Packets are sent async, sure

grim hound
echo basalt
#

But some incoming packets are often processed in the main thread

#

Especially packets related to blocks or entities

echo basalt
grim hound
#

oh wait yeah, they are

echo basalt
#

For example, what we know as "the anchor point"

grim hound
#

simple

mint nova
#

How i can disable that when player dont click any items the gui cant be closed?

echo basalt
#

Let's say you have a housing system where all houses are dynamically loaded and saved in the same world. In order to maintain data integrity (and make it all simple), we store everything as a "relative" or "delta" of the "anchor point"

#

Every schematic is pasted at the anchor point, and everything that can be configurable is also configured as relative positions

humble tulip
echo basalt
#

In order to make it super simple, you can have an empty world where you build your house at 0, 128, 0 and that's your anchor point

#

For things like spawn points just use the same XZ and subtract 128 at the Y

humble tulip
grim hound
echo basalt
#

It'd look like "Spawnpoint A is (0, 0, 3) blocks away from anchor"

grim hound
#

ah wait what

humble tulip
young knoll
#

It’s not cancellable

drowsy helm
#

Swm ftw

grim hound
#

makes sense

echo basalt
#

The rest of the logic becomes trivial. You can use something like a grid to pick your anchor point

#

And everything else is relative to it

mint nova
humble tulip
#

Oh right you reopen

humble tulip
mint nova
humble tulip
#

Then re open the inventory when the player closes it

#

If they didn't click the item yet

echo basalt
#

The grid can be in a single axis (anchor = 1000*houseId, 128, 0) or more complex (spiral pattern, potentially reusing indexes)

hard radish
echo basalt
#

Your anchor point is just assumed to be "0, 0, 0"

mint nova
# humble tulip Then re open the inventory when the player closes it
    @EventHandler
    public void onInventoryClicked(InventoryClickEvent event) {
        if (!event.getInventory().equals(inventory)) return;

        if (event.getCurrentItem().getType() == Material.GRASS_BLOCK) {
            Player player = (Player) event.getWhoClicked();
            Location location = new Location(player.getWorld(), 10, 1000, 10);

            player.teleport(location);
        }
    }

    @EventHandler
    public void onInventoryClose(InventoryCloseEvent event) {
        Player player = (Player) event;
        while (player.getInventory().equals(inventory)){
            player.openInventory(inventory)
        }
    }

I write this but the second handler dont work

echo basalt
#

Let's make the distinction between absolute and relative coordinates

#

Absolute coordinates are relative to 0,0,0, relative coordinates are relative to the anchor point

#

relative = absolute - anchor
absolute = relative + anchor

mint nova
echo basalt
#

You could store the anchor point and make everything absolute and just compute at runtime

#

You can store everything as relative and skip storing the anchor point

humble tulip
#

Replace while with if

echo basalt
#

Another way of thinking of the anchor point is just to see it as "the island's center"

humble tulip
#

And you MAY need to open it a tick later

#

Unsure

echo basalt
#

So that one table is 5 blocks above the island's center

#

The chest is 1, 0, 3 away from the island's center etc

keen charm
mint nova
humble tulip
echo basalt
#

As for the grid, its entire job would be about picking/reserving the next available anchor point

hard radish
echo basalt
#

So you can pasted the schematic and load all relative data to it

echo basalt
mint nova
# humble tulip Replace while with if

Caused by: java.lang.ClassCastException: class org.bukkit.event.inventory.InventoryCloseEvent cannot be cast to class org.bukkit.entity.Player (org.bukkit.event.inventory.InventoryCloseEvent and org.bukkit.entity.Player are in unnamed module of loader java.net.URLClassLoader @108c4c35)

But wait i maybe found a solution

young knoll
#

Don’t cast the event to a player

humble tulip
#

Use event.getPlayer()

mint nova
#

Ok

hard radish
#

hummm ok in my mind currently is just making XZ cords 0,0 and depending on how big the schematic is, then subtract the size of the schematic to get the corner of the schematic and paste it there and have a interval number of how much times the schematic has been pasted and do (XZ cords of my first pasted schematic * (number of pasted schematics))

echo basalt
#

That's an example of a grid

#

Start with an interface and create some implementations

#
public interface MinecraftGrid {

  Location reserveAnchorPoint(UUID islandId);
  void disposeIsland(UUID islandId);

}
#

The islandId only matters if you care about reusing locations

echo basalt
echo basalt
#

You kinda want an expanding array of indexes instead of using the list size

echo basalt
#

You can, for example, make a grid that loads a temporary world with the island id as its name

mint nova
hard radish
#

does that mean i can sey a UUID for it or is it just automatically generated?

echo basalt
#

Can be anything, as long as it identifies the island / house / whatever

hard radish
#

sorry havent used worldedit api at all so dont really understand these things

echo basalt
#

It could be something like

public class SingleAxisMinecraftGrid implements MinecraftGrid {

  private static final double DISTANCE_PER_ISLAND = 1000.0;

  private final UUID worldId; // Let's not store a hard reference to the World
  private int ongoingIndex = 0;

  public SingleAxisMinecraftGrid(World world) {
    this.worldId = world.getUID();
  }

  @Override
  public Location reserveAnchorPoint(UUID unused) {
    return new Location(this.getWorld(), DISTANCE_PER_ISLAND * ongoingIndex++, 128, 0);
  }

  @Override
  public void disposeIsland(UUID unused) {
    // do nothing, we aren't tracking islands
  }

  private World getWorld() {
    return Bukkit.getWorld(this.worldId);  
  }
}
hard radish
#

ok I understand now thanks for your help!

cinder abyss
#

Hello, how can I make my project support nms 1.20.5-1.21 while supporting java 17 (1.19-1.20.4) ? Because I can't compile with java 17, I get an error

I tried adding targetVersion to java 21 in the 1.20.5-1.21 modules, it drops the "class file being 65" as error

Here's my code :
https://github.com/Paulem79/BiomesAPI

GitHub

Create Custom Biomes in Spigot / PaperMC! Contribute to Paulem79/BiomesAPI development by creating an account on GitHub.

chrome beacon
#

The old shadow isn't maintained anymore and doesn't support Java 21

quaint mantle
#

does anyone have a plugin for passeges with a timer

chrome beacon
#

Don't ask in every channel

quaint mantle
#

okay sorry

wicked sinew
#

As for HashMap, what's the condensed version of if(map.containsKey(uuid)) return map.get(uuid) else map.put(uuid, value) return map.get(uuid)

echo basalt
#

computeIfAbsent

#

(It's on pins)

wicked sinew
#

Did not expect that to be pinned 😂 thank you

cinder abyss
drowsy helm
#

oh wait illusion already replied oops

wicked sinew
#

I've worked with Java very little since Java 8, so I'm not used to all these new things

drowsy helm
#

yeah theres a lot of little methods you learn along the way

wicked sinew
#

I still have 0 clue what streams are

drowsy helm
#

fancy for loops

wicked sinew
#

So what you're saying is.. I shouldn't be doing
stream().forEach(obj => obj) 💀

drowsy helm
#

streams are pretty costly

rough ibex
#

do I need to write a TypeAdapter for Location so that Gson can do its thing with it? Pretty sure I'm getting an error from trying to deserialize some JSON into a List<Location> and it's not liking it

rough ibex
young knoll
#

Weak reference world to be specific :p

drowsy helm
#

apparently jackson doesn't ignore transient fields. lovely

slender elbow
#

jackson uses getters for serialization

#

@JsonIgnore is a thing you can use

drowsy helm
young knoll
#

😳

drowsy helm
#

Man, gson is so slow but it works so much better than everything else

rough ibex
#

is jackson included or not

drowsy helm
#

I've tried FST, kryo, jackson, gson

young knoll
#

Isn’t there another one

drowsy helm
#

protobuf?

#

theres many

young knoll
#

Moshi

#

It’s supposed to be a modern-er gson

drowsy helm
#

hmm you ever tried it?

young knoll
#

Nop

#

Gson is already shaded in spigot so I just go with it

worthy yarrow
#

I need a better understanding of data structures and why yml/gson/etc are better in which cases

lime wave
#

Does anyone know how to make an inventory that's different to every player? e.g. the player can sort the contents of the inventory by price, and things like that

drowsy helm
worthy yarrow
#

Do you mean a personal shops sorta plugin?

lime wave
worthy yarrow
lime wave
#

I'm trying to do an auction plugin

drowsy helm
#

does not count on indentation

worthy yarrow
#

Ok so then one main gui for all currently auctioned items, helper guis for other operations such as checking your current auctioned items and whatnot

young knoll
#

Doesn’t have proper comment support

drowsy helm
lime wave
worthy yarrow
#

Well what else?

worthy yarrow
#

So then you place items into the gui by these sorting definitions, comparators and whatnot

drowsy helm
worthy yarrow
lime wave
#

and how could I make that?

worthy yarrow
#

Not each player

#

You just put like buttons for the sorting options or something

lime wave
#

but how could I remake the GUI only for the player that sorted it by e.g. price

lime wave
worthy yarrow
#

I don't think you need a whole new gui, just swap the way items are sorted within it

#

reopen the inv

#

Maybe a way to track state with the player eg: the sorting options

lime wave
worthy yarrow
#

Then reopen original gui with the sorting option param or something

drowsy helm
#

theres nothing wrong with having a new Inventory instance for each player

young knoll
#

You can either store an inventory object for each player

#

Or just make a new one each time

lime wave
#

but where should I start?

drowsy helm
#

make an inventory manager

worthy yarrow
#

I just mean like you don't have to create a new gui ie:

inventory inventory = bukkit.createInventory,

You just reopen the original gui with a sorting param attached or something

drowsy helm
#

where you keep track of who is using what inventory

young knoll
#

Bukkit#createInventory :p

#

Then just populate it with whatever data you have stored

worthy yarrow
#

Your code still decides how to populate the inventory so why not just have some support for differnet sorting methods

#

Creating a new instance vs a new object is what I'm trying to argue so maybe I'm just stoned and thats what he meant

lime wave
#

If I want to create a new instance each time, how could I Bukkit.getPluginManager().registerEvents for each new GUI?

drowsy helm
#

no

young knoll
#

You don’t

drowsy helm
#

have a manager which propagates the event

young knoll
#

You just do it once and then delegate to the instance for that player

lime wave
#

ok, guess I got it

#

I'll prob be back

#

thanks for the help

worthy yarrow
#

InventoryClickEvent holds the player, so for each time this method is called you could consider it an individual player

#

6 inventoryClickEvents means 6 different players clicking some inventory

drowsy helm
#

do you guys think it makes most sense to order it by the way it shows up in package explorer

#

or group by functionality

worthy yarrow
#

functionality

#

well

#

Who's going to be needing to know?

drowsy helm
#

no one really, its just incase someone needs to go back and find where it's registered

#

ig ctrl f exists

worthy yarrow
#

I'd still stick with functionality

echo basalt
#

As in all the slave listeners on one group, all the master ones on another

worthy yarrow
#

kek you're the only reason I said that illusion

#

Your yelling was effective

drowsy helm
echo basalt
#

Only time I'd do alphabetical order is if I have like a million packets in a folder and they all fall under the same category