#help-development

1 messages ยท Page 1003 of 1

slender elbow
#

make it multithreaded ๐Ÿ‘Œ ๐Ÿ’ฏ ๐Ÿ’ช

rough drift
#

real

#

just multi thread method calls

dapper flower
#

I am comparing 2 ItemStacks and i need to compare item metas, if one type is null it wont work as intended so i need to get its default item meta somehow

rough drift
dapper flower
# rough drift Objects.equals accounts for null

Lets say i want to compare an enchanted itemstack and an unenchanted one and i want it to ignore the enchant part and consider it equal, i csnnot do that if one is null, it will just return false

rough drift
#

i.e. AIR is one of the few that doesn't have it

drowsy helm
#

Whats not fast about this

#

It takes less then a ms

worldly ingot
#

If that lol

#

Fairly certain it's an O(1) operation

#

Yes. It's just a switch statement. I knew it was either that or a Map#get() call

real dew
#

what is the way to write into chat that isnt deprecated in 1.20.4?

icy beacon
#

what are you using rn

real dew
#

nothing, i tried to look online but all i find is mega old forum posts

icy beacon
#

#sendMessage to send message to somebody

#

#chat to chat on behalf of somebody

young knoll
#

Iโ€™m not sure #chat works anymore

icy beacon
#

rly?

young knoll
#

Because message signing

icy beacon
#

oh right that exists

#

i have blissfully forgotten about it

real dew
icy beacon
#

this is paper api

#

?whereami

real dew
icy beacon
#

yes

real dew
#

ah alr

#

ok ill go look at paper server then

#

๐Ÿ‘

icy beacon
real dew
icy beacon
#

if they use paper api, no

real dew
#

ah i see

icy beacon
#

spigot plugins are able to run on paper

real dew
#

so it only works one way

icy beacon
#

not vice versa

real dew
#

i see

icy beacon
#

paper adds to spigot

real dew
#

well ill prob just make a spigot plugin then

icy beacon
#

good call

#

?jd-s

undone axleBOT
icy beacon
#

current javadocs

eternal night
#

gOoD cAlL

icy beacon
#

well i'm on the spigot server so i'll be advocating for it

eternal night
#

true I guess

river oracle
icy beacon
#

anybody wanna go solve some parametric equations w/me?

eternal night
#

sendMessage("ยงxยงfยงfยงfยงfยงfยงfShut up miles")

river oracle
#

Speaking of which I need to improve my insertion feature

icy beacon
#

find all values of a so that the equation has at least 1 solution

river oracle
#

You have 2 variables and 1 equation

sand spire
#

Is there a way to get a textureValue and textureSignature from a textureURL?

I currently use this to get a PlayerProfile from an url, and it works for playerheads, but if I want to use it on an NPC I need to set its properties with a value and a signature.

I could just save the value and signature but I was hoping I could use the url for everything so I have to save less and I assume these values are somehow integrated into the link cause how else does it get the head texture.

public static PlayerProfile getProfile(String url, OfflinePlayer player) {
        URL urlObject;
        try {
            urlObject = new URL(url);
        } catch (Exception e) {
            return Bukkit.createProfile(player.getUniqueId());
        }

        PlayerProfile profile = Bukkit.createProfile(UUID.randomUUID());
        PlayerTextures textures = profile.getTextures();
        textures.setSkin(urlObject);
        profile.setTextures(textures);
        return profile;
    }```
river oracle
#

Look at heads db

#

Those texture values are likely base64

#

You'd have to decode it

worldly ingot
#

They are base64 encoded, yes

young knoll
#

The signatures are from Mojang

zealous osprey
young knoll
#

I donโ€™t think you can derive them from the texture value

sand spire
worldly ingot
#

You can generate a value, you cannot generate a signature. That's done by Mojang's servers

sand spire
#

and the link sends me to an image of the whole skin so it has to be in there right

#

oh

worldly ingot
#

That's the reason services like MineSkin exist ๐Ÿ˜›

#

I think MS has an API as well, so you may be in luck

young knoll
#

It does

worldly ingot
#

Fun ๐Ÿ˜„

young knoll
#

Citizens uses it

wintry oxide
#

hi friend, i'm running into some stupid error, and i'm not able to figure out y heres the code:

System.out.println(growable.get("material").toString()); // prints "cactus", "sugar_cane" which are a valid imput to
Material.getMaterial(growable.get("material").toString()) // which the function returns the same thing, it gives me error saying the param is null
worldly ingot
#

Even better, IT made a Java client library for it already cause she's a badass

wintry oxide
eternal oxide
#

also ensure you have api-version set in your plugin.yml

wintry oxide
#

no they are

eternal oxide
#

they are not. ALL Materials are upper case

young knoll
#

I believe getMaterial accounts for that

wintry oxide
#

haha

sand spire
young knoll
#

Idk I always use matchMaterial

wintry oxide
#

the upper case

#

that was the reason

#

but

#

what

worldly ingot
#

getMaterial() is an exception-safe valueOf(). matchMaterial() will do some string manipulation to turn it into a key and pull it from the registry

young knoll
#

Ah

worldly ingot
#

matchMaterial() > getMaterial() every time

wintry oxide
#

yes yes

worldly ingot
#

Or Registry.MATERIAL.match() if you want to be fancy, but the former existed long before lol

young knoll
#

Deprecate getMaterial when

worldly ingot
young knoll
#

Deprecate choco when

worldly ingot
#

I feel deprecated

#

I think that's called aging

young knoll
#

Probably

#

Silly 1999 boy

sand spire
slender elbow
worldly ingot
#

Touchรฉ

#

Do skulls even need a signature?

young knoll
#

No

#

But NPCs do

worldly ingot
#

Yeah so for skulls you should be fine, but for NPCs you need a signature

#

And to do that you have to use a service like MineSkin

young knoll
#

You also need a signature for tab list entries :/

worldly ingot
#

Or you can upload it to Mojang yourself by setting the skin of a dummy account, but why do that when MineSkin has a reserve of like 20 accounts to do it for you

sand spire
#

rn I get textures for a skull like this textures.setSkin(url);

#

and textures for an NPC like this profile.setProperties(List.of(new ProfileProperty("textures",value,signature)));

slender elbow
#

not spigot api !!!!

sand spire
#

oh

#

how do you know that from the top of your head damn

slender elbow
#

there is no setProperties or ProfileProperty in spigot api

sand spire
#

ic

#

i guess I will just have to copypaste and save 3 strings. pain

#

but thanks for trynna help

#

or

#

what if

#

there is an API that gets the URL, value and signature from mineskin using the mineskin url

slender elbow
#

never heard of one

#

always seen everyone recourse to nms for this stuff

sand spire
#

alright

drowsy helm
worldly ingot
#

idk. Ask Mojangles

#

All skins are hosted on their servers, so y'know

#

Might be a good way to identify a skin quickly

remote swallow
#

mojankles

drowsy helm
#

Or even just an api endpoint to encode an img to their b64

#

Mineskin shouldnt need to exist

icy beacon
#

it is called a parametric equation

icy beacon
#

i left to get coffee and now i'm back so i'll now solve it and show the solution

river oracle
#

I have not taken that yet

zealous osprey
#

Try with a=-1, not sure if that's what you want. Basically just a cos-curve but with higher amplitudes. Not sure if that's what you wanted

icy beacon
river oracle
#

is calculus

icy beacon
#

no derivatives/limits here

#

so no

spiral kindle
#

is this a ridel or are you looking for a solutioon?=

icy beacon
#

this is a math problem ๐Ÿ˜ญ

#

i thought someone would be down to solve it alongside and we'd compare solutions but apparently not so i'll just send my solution in like 10 minutes

spiral kindle
#

yea what i mean is: if you just wanna know the anser enter into a solver

river oracle
#

not sure how you're supposed to solve without a guess and check or a loop of some form

icy beacon
#

i'm preparing for an exam

#

how would that help me

river oracle
#

bro he knows how to solve it xD

spiral kindle
#

why do you post it in the spigot developer chat thogh XD

river oracle
#

cuz this is #general 2

#

as a fellow math enjoyer I love seeing math

spiral kindle
#

haven't done this stuff since scool XD probably forgot how to do that

drowsy helm
#

Damg been a while since ive done parametric equations

#

Not fun

spiral kindle
#

I have a problem I am not sure if it is solvable (about Spigot, not math XD):
GriefPrevention (I use the API) has an event handler that cancels an event and sends a message to the player causing the event.
Plugin B (mine) wants to allow it under certain circumstances.
Now I can just allow it with higher priority, but I still get the error message from GriefPrevention.
Is there a way I can suppress the message or prevent the event from reaching GriefPrevention?
The problem is that GriefPrevention does not use "ignore canceled" so I can't achieve this by just canceling it beforehand and allowing it again later.
If possible, I want to avoid using ProtocolLib to delete the packets.

drowsy helm
#

Is the grief prevention event itself cancellable?

icy beacon
#

i'm like halfway done so far

spiral kindle
ivory sleet
icy beacon
#

There we go

icy beacon
#

we need to find all values of a so that the equation has at least 1 solution

ivory sleet
#

yea

icy beacon
# icy beacon

this was the "easy" one, i now need to do this ๐Ÿฅฒ

#

find all values of a so that the equation has no solutions

#

well let's go

sand spire
#

shit

#

my ide crashed

#

pro tip: don't decompile Material

river oracle
#

this is why we are deprecating material

#

smh

icy beacon
#

i'm not mentally ready to add multiversion support across versions that have and don't have material

#

as soon as it gets marked for removal i stop supporting any versions lower than that

worldly ingot
#

Hey, Material decompilation is better now without all the switches

pine spear
#

Hello how can i make command that has multiple names

#

like if you type /spawn and /teleporttospawn it does the same thing

spiral tusk
worldly ingot
#

You're looking for aliases

pine spear
spiral tusk
worldly ingot
#
commands:
  spawn:
    # ... all the other stuff for the command ...
    aliases: [ teleporttospawn, gotospawn ]
spiral tusk
#

Have a look there

icy beacon
sand spire
#

all this time I was registering the command twice ๐Ÿ’€

icy beacon
#

but i can clamp that back into 4 if I think of II and III as D >= 0

short drift
#

When I add permissions from code, do I need to define each individual permission with their full paths?

#

Or do something like:

pluginManager.addPermission(new Permission("myplugin.*"));
#

Not sure how it's supposed to work.

#

Well, I'll just register all of them.

spiral tusk
#

Actually i never programaticaly registered permission. If i remembered correctly you can still check if a player has a permission that isn't registered and it will work

short drift
#

Really? That's weird, but ok.

icy beacon
#

right bottom is the answer

worthy yarrow
#

Sorry thatโ€™s incorrect

icy beacon
#

it matches the answer

worthy yarrow
#

No it doesnโ€™t, the answer is incorrect as well

#

Youโ€™ll just have to try again next year

pliant topaz
short drift
#

How does that quadratic equation relate to Spigot plugin development? @icy beacon

#

Projectile motion? Particle effects? Custom terrain generation?

orchid gazelle
zealous osprey
echo basalt
#

Meth

worthy yarrow
kindred sentinel
#

And why is it in russian?

worthy yarrow
#

Maybe he is

#

Also I think it's quadratic something or other

#

idk I'm a dropout

kindred sentinel
#

Well, is there a way to imitate a container inventory in new created inventory? I just added something like "custom blocks", and after that "custom inventories" but the thing is that custom inventories are new inventories created every time the player clicks on block, so it doesn't update when player changes something there. How to fix it?

vocal zealot
#

Is there a command for countries to form alliances with each other?

worthy yarrow
#

Then I map those serializations to a player

tardy delta
vocal zealot
#

land claim?

vocal zealot
#

yes

worthy yarrow
#

Then go to towny discord lol

vocal zealot
#

I've been doing some research and it led me here. haha

worthy yarrow
#

This is spigot development chat, we don't offer support for specific plugins and such but we have #help-server if you need stuff in regards to server sided info and what not, but there is no vanilla teaming / claiming system in minecraft

#

Towny is the most popular iirc

#

So go seek support in towny discord, they'll actually be able to give you the correct info as not everyone here may be an expert on towny

vocal zealot
#

ok thx

green prism
#

Is it bad if, in a realistic banking plug-in, I randomly generate (and display) a credit card number and then use UUID to manage data? ๐Ÿคฃ

worthy yarrow
vocal zealot
#

pls

worthy yarrow
vocal zealot
#

thankyou

worthy yarrow
#

I'd say keep a backup of those mapping as well but it depends on your system

short drift
#

Is there some benefit to registering?

#

Or am I just making my code more complex by doing so?

worthy yarrow
#

You're really just making it easier to manage permission related aspects when it comes to your plugin, ie: Luck Perms might have an easier time finding your nodes although I've never had an issue in those regards when not actually "registering" the permission

short drift
#

Okay, so it's yeah. Maybe useful. Maybe not.

worthy yarrow
#

More context dependent imo

ornate heart
#

Are there any good PDC enchantment libraries or would I have to create something on my own? Just don't feel like dealing with the whole lore display and such.

worthy yarrow
#

?pdc if you wanna do a bit of scouting you might be able to find something here

worthy yarrow
#

might I am not too sure

#

It does go over how to work with your own data types, given you decide to just do it yourself

ornate heart
#

Yea I'm actually working on a pdc system that stores enchantments. I just wanted to see if I was reinventing the wheel though

short drift
#

I think the AdvancedEnchantments is pretty popular.

#

Not sure if it's what you're looking for. But check it out.

ornate heart
#

Gotchu. Thanks

short drift
#

They have web interface and everything for people who are not comfortable working with MC data files.

ornate heart
#

Well, I wasn't necessarily looking for a plugin to use. I'm developing a plugin that is going to use custom enchantments.

I wanted to use some sort of library that didn't require me to depend on another plugin (I've got a lot of dependencies already. Would rather not depend on another plugin).

I may just bite the bullet and make my own system though.

short drift
#

If that's what it takes to make you happy.

worthy yarrow
#

A lot of dependencies don't make your plugin bad, rather just gives off a bit of laziness imo kek, not to say that's bad or anything because truly there is no point in like you said, reinventing the wheel

short drift
#

I just remade the functionality of a hat plugin. Because I wanted better control over how it works.

#

Took most of the day to iron out all the bugs.

spiral tusk
# short drift But. Then what's the point of registering any permissions at all - from code or ...

Like @worthy yarrow wrote, LuckPerms has a feature to help you autocomplete the permissions when edditing them. Or in their web editor they list all registered permissions. Those who are unregistered will not appear there. So if you have permissions that you know you need it makes sense to register them, but if you have generic permissions wich will be created or deleted during runtime it isn't necessery to register them all. (for example.: in a Lootbox plugin a custom permission per lootbox) At least i only know of LuckPerms that uses a mechanic like that ^^

short drift
worthy yarrow
#

That's the nice thing about source code (so long as you're not just copy/pasting), it really helps put the structure into relatable terms

worthy yarrow
short drift
#

I mean. I didn't know that LuckyPerms has that kind of auto complete feature.

worthy yarrow
#

But as mentioned if they are permissions that need to be clarified outside of your plugin, then for sure register them

short drift
#

I used PEX before.

worthy yarrow
#

Oh dear

short drift
#

That was 8 years ago.

worthy yarrow
#

Feels bad

short drift
#

Now I'm trying to learn LuckyPerms.

#

I actually quite liked PEX.

worthy yarrow
#

Luckperms is actually quite nice

#

and their api isn't half bad either

short drift
#

Seems a bit verbose.

#

But I'm getting the hang of it.

worthy yarrow
#

Imo they just have a lot of usable methods

#

It's a lot to take in but after about a week I got pretty much a complete handle

charred blaze
#

does location.getChunk().getX(); load the chunk?

royal heath
#

PEX, have't heard that name in years

icy beacon
charred blaze
#

i have it like this

#

oh nvm

#

wrong question

#

location.getX()

#

does this load the chunk it is in?

worldly ingot
#

Location#getChunk() will, Location#getX() will not

#

If you want the chunk's x coordinate, location.getBlockX() >> 4 should get you it

charred blaze
#

already know the second thing

#

thanks

scarlet gate
#

How do I get the CommandMap with spigot? I understand that it often needs some level of reflection?

chrome beacon
#

yes

#

What do you need it for

scarlet gate
#

I just want to register my commands in the CommandMap directly

worldly ingot
#

Okay, why?

#

What about the plugin.yml is insufficient?

scarlet gate
#

I am mainly doing it to allow admins to add their own command aliases directly in my plugin - I am aware they could just use the commands.yml file but would like to be able to give nice tab completion on the aliases

fossil flax
#

how can i set a custom metadatakey on an itemstack item? (example: CustomBlock_1)

worldly ingot
#

You'll want to access the persistent data container on the ItemMeta

charred blaze
#

will i have any problems getting location object from config if storing so?

worldly ingot
#

If you #set(Location), you can getLocation()

charred blaze
#

will that always work? i somewhy remember that i had issue with it but i dont remember details

worldly ingot
#

It should always work unless someone goes into the config and fucks up the format

#

But that goes for any data. You can't read key "x" if it doesn't exist

charred blaze
#

.getLocation doesnt load the chunk right?

wooden frost
#

How to check interact event each tick?

worldly ingot
#

From the config? No it doesn't load the chunk

worldly ingot
#

If you're holding down right click, the event will continue to trigger but I don't think it's every tick

wooden frost
#

I have done a work arround in bows, where it adds you to a map if you have interacted with it and rmeoves you if you shoot, but i noticed that if you just click once without holding the button, it will still count but wont remove you because you did not shoot

wooden frost
worldly ingot
#

What's the reason for listening for a recurring interact event though? Is there something about EntityShootBowEvent that doesn't suit your needs?

wooden frost
#

but when you just click, it does not fire it, so it wont remove you from the map i use

icy beacon
#

\๐Ÿ‘

#

๐Ÿ‘

#

what

icy beacon
#

i placed a \ before the : thumbsup: to show that it's thumbsup and not thumb

#

i thought it wouldn't convert to an emoji

#

somehow, it did

alpine urchin
#

i was laughing at myself

#

\๐Ÿ‘

#

ooh

#

thats cool

wooden frost
#

How do i check if player stops pulling bow without shooting it

icy beacon
#

\๐Ÿ˜”

#

wtf

#

how

alpine urchin
#

\๐Ÿ˜”

icy beacon
#

oh well

merry cove
#

wasn't 1.20.6 implementing entity size options? or did I they just abandon that? or is that nms?

#

oh its an attribute

fossil flax
#

how do i put here a custom metadata key to recognise this specific block?

ItemStack obs = new ItemStack(Material.OBSIDIAN);
ItemMeta itemMeta = obs.getItemMeta();
itemMeta.setDisplayName(Color.Colorize("&Custom OBS"));
obs.setItemMeta(itemMeta);

icy beacon
#

?pdc

fossil flax
# icy beacon ?pdc

does it work in 1.8 plugin?
ItemMeta dosn't have anything called getPersistentDataContainer

inner mulch
#

No

#

1.14

fossil flax
#

so is there a way to give an item a custom meta data key in 1.8?

chrome beacon
#

You'd need nms to attach nbt tags

icy beacon
#

yes but realistically please switch to a modern version you're missing out

icy beacon
inner mulch
#

I saw ur post

icy beacon
#

what post

inner mulch
#

Wait i meant y2k

icy beacon
#

ah kk

inner mulch
#

I dont know why but sometines i think you are him

#

Or he is you

icy beacon
#

anime pfps

remote swallow
#

they look very similar

icy beacon
#

even irl we look very similar

#

i met him yesterday while stalking his house

inner mulch
#

You know each other?

icy beacon
#

well he doesn't yet know but i live in his basement and steal his stuff

inner mulch
#

@river oracle ๐Ÿง

icy beacon
#

watch it you punk

slender elbow
icy beacon
#

i barely watch anime these days

#

i'm busy with stuff

inner mulch
#

Are you trying to uncover the secrets of the universe

icy beacon
#

yes

#

such as ocp

inner mulch
#

OCP code can predict every particle in the universe

icy beacon
#

it's the laplace's demon

inner mulch
#

Guys did you know that enums dont comply with the open closed principle

icy beacon
#

fuck enums

slender elbow
#

๐Ÿ˜ณ

inner mulch
#

I cant use enums ๐Ÿ˜” ocp is too overpowered

icy beacon
#

parametric equations bring joy to my life

royal heath
#

Holy crap lol. That makes absolutely no sense to me

icy beacon
#

they are difficult

#

and that is what makes them fun

#

(most often) not some easy shit that you can solve in your head

eternal oxide
#

The answer is 42

kindred sentinel
#

So there is no way to save inventory in some type of PDC? Only items from it?

young knoll
#

All an inventory is

#

Is a name, a size, and then the items inside it

carmine mica
#

well actually not a name

sullen wharf
#

-> save string on pdc

#

add other parameters you need

nova notch
#

If you use MorePersistentDataTypes you can just save it as a byte array

#

Or maybe spigot already has that I forget

young knoll
#

yeah byte[] is a built in type

kindred sentinel
#

ItemStack[]

nova notch
#

Oh I didn't even know that was a thing

kindred sentinel
tidal kettle
#

hey i have this in my config.yml, how can i get everything ?

#

i try getMapList but i didn't get aythin or maybe i'm dumb

remote swallow
#

config.getConfigurationSection("Settings").getValues() and it returns a map

kindred sentinel
#

or config.getConfigurationSection("Settings").getKeys(false) if it's about keys

sage patio
#

Hey, can I figure out a player ip (the ip he connected to my server like play.minecraft.net) in Spigot API or i should somehow handle it using bungee messaging and a Bungee/Velocity plugin?

royal heath
tidal kettle
royal heath
#

Np, would make things a lot easier for you and whoever downloads the plugin

worldly ingot
pseudo hazel
#

is it very expensive to update /replace like 36 items max in a menu every second?

worldly ingot
#

You can get the IP address of a player connected to a bungee network using the plugin messaging channel. There are 2 messages you would have to use. The GetPlayerServer and ServerIP messages

#

Check if they're actually online first though because if they're connected to your current server, then, y'know... they're on the current server

worldly ingot
#

Or maybe devise some system that would require a method call to actually invoke an update in the inventory for a specific slot

obsidian drift
#

Trying to remove the armor increase of an item but still there?:

itemMeta.removeAttributeModifier(Attribute.GENERIC_ARMOR);
itemStack.setItemMeta(itemMeta);
worldly ingot
#

Are you on 1.20.6?

obsidian drift
#

yeah

worldly ingot
#

Latest version? (/version)

obsidian drift
#

lemme update

worldly ingot
#

Oh, well, actually, I guess the issue is that you're removing attribute modifiers, which the armour doesn't have

#

Those are the base attribute values

obsidian drift
#

ah

#

i suppose i should set the base values to 0

worldly ingot
#

Correct

young knoll
#

Does ItemStack#equals involve cloning the meta

worldly ingot
#

I don't think so

#

Oh it does

#

That's annoying lol

sage patio
worldly ingot
#

Oh, no. Because x.y.z is gonna redirect to 69.69.69.69 because that's what a domain does

pseudo hazel
kindred sentinel
#

69...?

worldly ingot
#

placeholder

sage patio
#

D:

sage patio
kindred sentinel
worldly ingot
pseudo hazel
#

but every item has its own time

worldly ingot
young knoll
pseudo hazel
#

so I wanna make a task that updates all items in one go

sage patio
worldly ingot
#

Oh, well there's one packet for each, so you're kinda SOL there. Can't bulk update items

pseudo hazel
#

I figure its not too bad but just wanna know for sure

#

SOL?

slender elbow
#

shit outta luck

pseudo hazel
#

aha

#

yeah fair

sage patio
#

me and another server are migrating and i've to redirect all of their players to my server, for example my server is server1.com and his server is server2.com, i want to send their players to a server first to explain this migration to them then send them to my lobby

#

so anyone with my ip (server1.com) should be sent to lobby and server2.com to another server

pseudo hazel
#

just put a different server behind the different ip adress

sage patio
#

i can't use another ipv4

#

i can't have any other ipv4 actually

pseudo hazel
#

why not

sage patio
#

well hosting problems

#

i just can't

fossil wigeon
#

i suppose you could have 2 servers on a bungee, same ip but different ports. If they join from the old domain they go to the informational server, from which they can go to the main server (although this whole thing seems like a whole bunch of extra confusion)

#

dunno

sage patio
#

so this is the main problem

#

how can figure out which ip he connected

#

server1 which its mine or server2 (old server)?

fossil wigeon
#

from what I said you dont, you point each domain to a different server

#

server1 points to ip:1234
server2 points to ip:4321

ip:1234 is the informational lobby
ip:4321 is the actual server

sage patio
#

yea this is a good solution too, nice thanks

sage patio
fossil wigeon
#

the downside is you have a "useless" server that is wasting resources (the informational one)

#

a whole server just for forwarding

fossil wigeon
zenith rain
#

Good afternoon, an error is happening in my plugin, where everything that comes from config.yml is null, only in Main.java which is the main class that is not. I pass an instance with getInstance() in the main class to the other classes but it still doesn't work.

charred blaze
#

you need to pass the plugin instance

#

through your listener

#

add a constructor

#

Main plugin;
public ServerEvents(Main plugin) {
this.plugin = plugin;
}

#

also

#

you shouldnt name your main class Main

remote swallow
#

?main

charred blaze
#

mb

#

how many times is chunkloadevent fired?

#

i see it spamming while standing in a chunk

young knoll
#

Should only be once

#

When the chunk loads from disk

eternal oxide
#

unless the server just started

charred blaze
#

should only be passing all my checks exactly one time

eternal oxide
#

then you code is bad or your math is bad, or both ๐Ÿ™‚

charred blaze
young knoll
#

Well thatโ€™s going to print every single one

#

And then print matching ones twice

eternal oxide
#

Yep it was both ๐Ÿ™‚

charred blaze
charred blaze
#

well it is printing alot of times

#

and same name

zenith rain
charred blaze
#

show me your config

zenith rain
charred blaze
#

show me your test' servers config

#

not that one

zenith rain
remote swallow
#

show code

charred blaze
#

im pretty sure this two do the same thing

remote swallow
#

just call saveDefaultConfig

charred blaze
zenith rain
remote swallow
#

that looks correct, sysout plugin.getConfig().getValues

sullen canyon
#

Is it much of a problem if I am calling an async method inside of async code block?

Common.getInstance().getDataStorageController().getPlayerDataStorage().loadData() returns CompletableFuture and at the same time being called async

broken nacelle
young knoll
zenith rain
broken nacelle
#

mano, tenta usar as aspas duplas

#

ao invรฉs das aspas simples

#

"configblablabla"

#

sรณ de teste

#

se nรฃo for

#

coloca System.out.println(plugin.getConfig().getValues());

young knoll
#

English only please

charred blaze
zenith rain
sullen canyon
young knoll
#

Yes

#

That will make the future wait for the completion of the other future

sullen canyon
#

Ah I see, thanks

remote swallow
zenith rain
charred blaze
#

this is still spamming

broken nacelle
remote swallow
charred blaze
#

and why was my checks spamming?

zenith rain
broken nacelle
#

try to put the loadConfig method

#

in onLoad method

broken nacelle
zenith rain
#

ok

eternal oxide
glad prawn
#

have you try to set your on off key to something else?

glad prawn
#

that's boolean in snakeyaml format

eternal oxide
glad prawn
#

change to something like enabled and disabled instead

#

or put it in ''

broken nacelle
pseudo hazel
#

this is probably just a java question but might as well ask here. I have a Map<ChatColor, Float> called colors and I am trying to sort teh keys based on the float value. is there a better way to do that than using this ? List<ChatColor> sortedByPosition = colors.keySet().stream().sorted((c, b) -> Float.compare(colors.get(c), colors.get(b))).toList();

sullen canyon
young knoll
#

Why do you need to cast

sullen canyon
slender elbow
#

why does it return CompletableFuture raw?

#

why is the executor being ignored

#

:dies:

zenith rain
#

Finally it was

glad prawn
#

bruh

glad prawn
pseudo hazel
#

ah thanks

#

I knew the double lookup was feeling bad ๐Ÿ˜›

#

(this might still do double lookup I guess but now I dont have to worry about it)

slender elbow
#

this doesn't really do lookups in the same way you were doing them

pseudo hazel
#

yeah figured

vast ledge
#

player#hidePlayer()

#

maybe?

#

or you could send a entity destroy packet

worldly ingot
#

That's what #hidePlayer() does

vast ledge
#

Wasnt 100% sure on that, thats why i left the option open

short drift
#

Is it possible to drop from a loot table?

worthy yarrow
chrome beacon
short drift
#

Well, something like:

    private void createBirchLeavesDrops(Location location) {

        // Get loot table.
        LootTable lootTable = server.getLootTable(NamespacedKey.minecraft("loot_tables/blocks/birch_leaves.json"));

        System.out.println("Loot table: " + lootTable);

        // Get loot context.
        LootContext.Builder lootContextBuilder = new LootContext.Builder(location);

        // Get loot context.
        LootContext lootContext = lootContextBuilder.build();

        // Get loot.
        var loot = lootTable.populateLoot(new Random(), lootContext);

        // Drop loot naturally.

    }

chrome beacon
#

yeah like that

short drift
#

Really? Well that was just a guess.

#

How about the last step?

young knoll
#

World#dropItem

short drift
#

Should I do foreach on the collection?

chrome beacon
young knoll
#

Yeah

short drift
#

Ok, so:

loot.forEach(itemStack -> location.getWorld().dropItemNaturally(location, itemStack));

?

young knoll
#

Looks good to me

short drift
#

Ok, let's fire it up then and see if it works.

#

I might have gotten some detail wrong. I don't think it's dropping anything. Perhaps the path is wrong or it doesn't need the .json suffix or something.

young knoll
#

I think it might just be birch_leaves

#

Not too sure

broken nacelle
broken nacelle
short drift
#

Well. I can't get the loot table to work correctly. When I use the LootContext.Builder() it errors out with Missing required parameters: [<parameter minecraft:tool>, <parameter minecraft:block_state>] which are not available.
And when trying to use the LootContext directly it has private constructor. So the only way you can use it is via the builder.

#

Possibly it's not intended to be used like this.

#

It seems to have mostly things relating to living entities.

carmine mica
#

yeah, you need to add stuff to the loot context via the builder

short drift
#

That doesn't seem to be possible.

#

It only has stuff like lootedEntity, killer, luck, and lootingModifier.

carmine mica
#

yeah, that seems to be the case. that API has been broken for a while

short drift
#

I cannot provide it with the tool and block_state.

#

So I guess I will have to create the drops manually.

carmine mica
low marten
#

anyone have any experience with the LootGenerateEvent? I don't think its being called when underwater loot is generated, specifically for underwater ruined portals

tropic totem
#

hello what is the best way to convert the string to compountTag

green prism
#

?paste

undone axleBOT
green prism
green prism
echo basalt
#

Do whatever

orchid trout
echo basalt
#

Because it's a lambda not a method call

#

It's basically saying "this is the method we'll call"

#

and it gets called when the consumer.accept call gets called

#

๐Ÿค™

orchid trout
#

i have failed to grasp what you are saying

inner mulch
#

:: refers to the method

#

. calls a method

#

if he uses . he will enter the return type as a param

#

instead of the method

slender elbow
#

erm, techskcnically it's a method reference, not a lambda ๐Ÿค“

river oracle
young knoll
#

Hey be nice to Emily

#

She is one of the nice downstream nerds

vast ledge
#

@simple schooner Why not get a Normal ryzen 5 or ryzen 7?

slender elbow
#

:pepetos:

simple schooner
vast ledge
#

Whats your budget

#

and what socket do you have?

simple schooner
vast ledge
#

for the cpu?

simple schooner
young knoll
simple schooner
vast ledge
#

I mean, i can't find the cpu you were refering to so idk how much it would cost if you could get your hands on it

simple schooner
#

Here

kind hatch
#

Itโ€™s a lower end ryzen, but it was at least part of the Zen 2 refresh

simple schooner
#

Shit only if I could plug that in on a breadboard and hope that it will magically work

kind hatch
#

Arenโ€™t AM4 motherboards cheaper now?

vast ledge
kind hatch
#

Heโ€™s working with 8-bit registers. He knows what heโ€™s doing.

vast ledge
#

@simple schooner If you want a microatx you could get the ASRock B450M-HDV, its $60

simple schooner
#

I don't got the budget ๐Ÿ™๐Ÿ™

kind hatch
#

Whatโ€™s your budget then?

simple schooner
#

Maybe even less inflation is crazy here

vast ledge
simple schooner
#

THATS NOT 91 BUCKS AT ALL ๐Ÿ˜ญ

vast ledge
#

?

kind hatch
#

4600G?

simple schooner
#

Retail price

#

I cant wait to escape this shit hole of a country

#

I spawned in the worst region of the map

vast ledge
#

Where are you from?

simple schooner
#

Philippines

simple schooner
wet breach
simple schooner
wet breach
#

it shouldn't just have to be smart about it ๐Ÿ™‚

simple schooner
#

I'll also sell my testicles so I wouldn't be homeless when I migrate

simple schooner
echo basalt
#

ayo wtf

simple schooner
#

Before we get invaded by the chinese

wet breach
raw epoch
#

hello ! I want to use the new FoodComponent (1.20.5-6) but do i need to write that much code ?

import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.components.FoodComponent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;

@Override
public ItemStack build(int amount) {
    ItemStack itemStack = new ItemStack(this.getMaterial(), amount);
    ItemMeta itemMeta = itemStack.getItemMeta();

    if (itemMeta != null) {
        itemMeta.setDisplayName(this.getDisplayName());

        FoodComponent foodComponent = new FoodComponent() {
            private List<FoodEffect> effects = new ArrayList<>();

            @Override
            public int getNutrition() {
                return 4;
            }

            @Override
            public void setNutrition(int nutrition) {
            }

            @Override
            public float getSaturation() {
                return 0.3f;
            }

            @Override
            public void setSaturation(float saturation) {
            }

            @Override
            public boolean canAlwaysEat() {
                return false;
            }

            @Override
            public void setCanAlwaysEat(boolean canAlwaysEat) {
            }

            @Override
            public float getEatSeconds() {
                return 1.5f;
            }

            @Override
            public void setEatSeconds(float eatSeconds) {
            }

            @Override
            @NotNull
            public List<FoodEffect> getEffects() {
                return effects;
            }

            @Override
            public void setEffects(@NotNull List<FoodEffect> effects) {
                this.effects = effects;
            }

            @Override
            @NotNull
            public FoodEffect addEffect(@NotNull PotionEffect effect, float probability) {
                FoodEffect foodEffect = new FoodEffect() {
                    private PotionEffect potionEffect = effect;
                    private float effectProbability = probability;

                    @Override
                    @NotNull
                    public PotionEffect getEffect() {
                        return potionEffect;
                    }

                    @Override
                    public void setEffect(@NotNull PotionEffect effect) {
                        this.potionEffect = effect;
                    }

                    @Override
                    public float getProbability() {
                        return effectProbability;
                    }

                    @Override
                    public void setProbability(float probability) {
                        this.effectProbability = probability;
                    }

                    @Override
                    public Map<String, Object> serialize() {
                        return null;
                    }
                };
                this.effects.add(foodEffect);
                return foodEffect;
            }

            @Override
            public Map<String, Object> serialize() {
                return null;
            }
        };

        foodComponent.addEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1), 0.5f);

        itemMeta.setFood(foodComponent);

        itemMeta.setCustomModelData(this.getCustomModelData());
        itemMeta.setLore(this.getLore());
        itemMeta.getPersistentDataContainer().set(new NamespacedKey(HekaCite.getPlugin(), "custom_item_id"), PersistentDataType.STRING, this.getId());

        itemStack.setItemMeta(itemMeta);
    }

    return itemStack;
}

Cause it's a lot of lines for a simple component lmao

rough drift
#

yes, you do

hazy parrot
#

Is that even valid code

rough drift
#

yes it is

echo basalt
#

Why do I feel like there should be some generic impl

rough drift
raw epoch
hazy parrot
#

Where is class declaration

raw epoch
kind hatch
#

I thought components could work without setting every value as null entries just fallback to default behavior.

raw epoch
simple schooner
slender elbow
#

you can't just implement FoodComponent

echo basalt
#

new Player {

}

#

doubt me if you want

slender elbow
#

ClassCastException cannot cast dumb.Plugin$1 to CraftFoodComponent

vast ledge
#

isnt player an interface

#

you cant init those

echo basalt
#

you override all methods

vast ledge
#

This looks so wrong

echo basalt
#

pls always pls get and check null

#

(pins)

vast ledge
echo basalt
#

not that you clown

kind hatch
#

What about #getOrDefault()?

vast ledge
echo basalt
#

There should really be a getOrDefault(String, Supplier<T>) ngl

echo basalt
slender elbow
#

not the one object allocation!

#

what will i do with it

vast ledge
#

Why would i re-init it tho if its already existant?

#

oh

#

you mean that

#

that flew over my head like a plane

#

So this?

slender elbow
#

the idea is that you'd put it in a variable to not perform the lookup twice

#

just use getOrDefault

vast ledge
#

Ive never used that before

#

the more you know

#

So this

slender elbow
broken nacelle
#
Map<UUID, Splayer> cache
vast ledge
#

?

slender elbow
#

lol

vast ledge
#

what was that for tho?

echo basalt
#

static

vast ledge
broken nacelle
vast ledge
broken nacelle
#

๐Ÿค“

smoky anchor
# vast ledge

You should be doing Map<X, Y> map = new HashMap<>();
Some principle or something, idk

echo basalt
#

sounds like it could use a dedicated class

#

dedotated

vast ledge
vast ledge
vast ledge
vast ledge
vast ledge
echo basalt
#

Nah, has to do with hiding impl details and being able to change implementations quicker

#

Good ol' dependency inversion

smoky anchor
vast ledge
echo basalt
#

Let's say you want to replace HashMap to ConcurrentHashMap

#

Now you only need to type it once rather than twice

vast ledge
#

.-.

#

Man devs really are lazy

smoky anchor
#

If you pass the variable around, also use Map<X, Y> ;)

vast ledge
#

Never thought about that, should probably add that to my norms

echo basalt
#

check pins :)

#

it's there

#

down there somewhere

vast ledge
#

Yep, the 3rd thing i think
Avoid repeating collections calls:

#

So instead of something like this

this.getEffectivePermissionsStartingWith("skypvp.max.homes").forEach(perm -> {
    String[] split = perm.getPermission().split("\\.");
    if(split.length == 4) {
        int homes = Integer.parseInt(split[3]);
        if(homes > maxHomes.get()) {
            maxHomes.set(homes);
        }
    }
});

I should use

this.getEffectivePermissionsStartingWith("skypvp.max.homes").forEach(perm -> {
    String[] split = perm.getPermission().split("\\.");
    if(split.length != 4) return;
    int homes = Integer.parseInt(split[3]);
    if(homes > maxHomes.get()) maxHomes.set(homes);
});
eternal oxide
#

catch errors on parseInt

#

user input is often wrong

vast ledge
eternal oxide
#

just put all teh code in the try, so none of it runs if there is an error

#

no point in trying to set zero if it error

vast ledge
#

I forgot, the atomi ints default value is 0

echo basalt
#

Or you can just use a regular for loop

#

instead of .forEach

#

and avoid abusing atomics

slender elbow
#

setPlain/getPlain :chefskiss:

green prism
#

Hello! I'm currently developing a Bank Plugin and handling transactions, and I'm considering an optimization to minimize database queries by storing transaction data in a session format using a Map with player UUIDs as keys and sets of transactions as values:

Map<UUID, Set<Transaction>>

However, I've encountered a challenge regarding the structure of the Transaction POJO. Each transaction involves two UUIDs, one for the receiver and one for the issuer. This presents an issue where the same transaction can be associated with both UUIDs, leading to duplicate entries and potentially redundant queries. How would you address this problem efficiently within my implementation??

quaint mantle
green prism
quaint mantle
worldly ingot
#

I don't think you understand what they're asking lol

river oracle
#

Set is iterable I don't get the advantage here

#

It is irrelevant to their question too

worldly ingot
#

Why can't all transactions be dispatched in bulk? I don't understand the benefit of separating by involved UUIDs

#

Or, probably the better question, why are these being submitted in bulk to begin with? I can't possibly imagine you're handling thousands of transactions per second

river oracle
worldly ingot
#

I really don't think it's gonna matter

#

Database engines are meant to handle that kind of heavy load

#

There are times where bulk operations make sense. I don't really think this is one of them tbh.

green prism
# worldly ingot Is there a reason you're associating these with UUIDs to begin with?

Not really. There's a UUID for the transaction, one for the issuer, and one for the receiver. When looking for a transaction, I want to be able to do it by comparing the issuerId or the receiverId. At the same time, I want to prevent double-querying (if the issuer and the receiver search for the same thing) and prevent making the cache enormous, in certain cases

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Transaction implements SerializableMapConvertible<Transaction> {

    private UUID uuid, fromUuid, toUuid;
worldly ingot
#

An example of a valid situation for bulk transaction insertions would be if the bank wants to give every online player $100 or something. In that case you can collect all the transactions and then push them all at once. But this is on a case-by-case basis so I'd argue it's just better to have an insertTransaction(Transaction) and insertTransactions(Collection<Transaction>)

green prism
worldly ingot
#

That also depends and should apply on a case-by-case basis. If you're just doing quick transaction lookups via command or something, you're probably fine to query the database, maybe cooldown the command to only be executable once every 0.5 seconds or something to prevent bad actors

green prism
#

Thank you so much

#

The only significant issue could be querying hundreds of transactions for a player. Each query doesn't come up as a POJO but needs to be converted, which could be expensive

worldly ingot
#

Should be okay. You should only need to use one query for that, then it's just a matter of doing some very simple data conversions (e.g. from string -> UUID)

#

And that's all local, relatively quick, dependent on your hardware. But probably not to the extent that it would ever matter

green prism
# worldly ingot Should be okay. You should only need to use one query for that, then it's just a...

Yeah, something like that ๐Ÿคฃ

    @Override
    public Transaction fromMap(Map<String, Object> map) {

        if(map.get("uuid") != null) {
            this.uuid = UUID.fromString((String) map.get("uuid"));
        }

        if(map.get("fromUuid") != null) {
            this.fromUuid = UUID.fromString((String) map.get("fromUuid"));
        }

        if(map.get("toUuid") != null) {
            this.toUuid = UUID.fromString((String) map.get("toUuid"));
        }

        this.amount = (double) map.get("amount");
        this.description = (String) map.get("description");
        this.timestamp = (long) map.get("timestamp");
        this.bankOperation = BankOperation.valueOf((String) map.get("bankOperation"));

        return this;

    }
worldly ingot
#

Oh yeah you're totally fine

green prism
#

Perfect! Thank you again!!

vast ledge
#

@echo basalt
Would the Map thing also apply to this?

private ArrayList<OfflineItem> offlineItems = new ArrayList<>();

instead of that

private List<OfflineItem> offlineItems = new ArrayList<>();
carmine mica
echo basalt
#

who exactly are you asking

carmine mica
#

anyone, idk. it's the development questions channel

worldly ingot
#

cc @young knoll I guess

young knoll
#

Did I miss a better way to move the entity to the correct world?

worldly ingot
#

I'm just saying, PRs are welcomed

#

Think of it like you're contributing to Paper. It makes its way down there anyways :p

carmine mica
young knoll
#

fair enough

carmine mica
#

there is no changing an entities world, it just re-creates the entity in a different world inside changeDimension

sterile sapphire
#

Are Minecraft bedrock behaviour packs and Minecraft bedrock plugins the same?

shadow night
#

Well, this is the wrong server to ask, but

#

Behaviour packs are like datapacks in java, plugins are usually nukkit or pmmp plugins, so they are not the same

tame bobcat
#

hi guys, i started programming today and i'm trying to write my first plugin like:
package firstPlugin;

import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin{
}

when i try to import the class, Eclipse told me "The package org.bukkit is not accessible"
but i have import the .jar of the server so i don't understand the ploblem, can anyone help me? thanks

buoyant viper
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

dire marsh
#

Is there a way to exclude a specific class from relocation using gradle shadow. I am including adventure-platform-bukkit in my plugin for spigot compat and relocating adventure, but if I reference an adventure class that another api uses, stuff will break as Jabba thinks I'm referencing a different class

#

I guess it wouldn't be an issue if I was using the libraries feature since no relocation then, but I'm using a snapshot version that isn't on central...

teal oracle
#

how do i log to console? i know its the most basic thing, but, how im just starting out

#

is it this? getLogger().info();

worthy yarrow
teal oracle
#

thats pretty long

worthy yarrow
#

If youโ€™re doing it in main class ith you can just do getLogger

teal oracle
#

ah okay, but what does the # mean?

worthy yarrow
#

.

#

Bukkit#getLogger = bukkit.getlogger

quaint mantle
#

Bukkit.getLogger() for example

teal oracle
#

do they do exactly the same or are there cases where they arent the same

eternal oxide
#

# is just a notation for an instanced method. It will not be understood by your IDE. It basically means .

teal oracle
#

okay

worthy yarrow
#

Anytime you see someone do #someMethod just replace # with .

eternal oxide
#

its clearer to read/type than .

worthy yarrow
teal oracle
#

what am i doing wrong here (with the command)

public final class ManaCore extends JavaPlugin {

    @Override
    public void onEnable() {
        getLogger().info("ManaCore enabled");
    }

    @Override
    public void onDisable() {
        getLogger().info("ManaCore disabled");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

    };

}
worthy yarrow
#

Your main class isnโ€™t defined as a command executor

shadow night
#

JavaPlugin extends/implements CommandExecutor iirc

worthy yarrow
#

Extends javaPlugin, implements commandExecutor

eternal oxide
#

It actually is

worthy yarrow
#

Where?

eternal oxide
#

its the default registration for commands

#

so long as the command is in your plugin.yml

#

His command is not in his plugin.yml

worthy yarrow
#

Ah I thought you had to implement commandExecutor for any class with a command

teal oracle
#

isnt this enough? commands:
discord:
description: Sends the server's discord link

eternal oxide
#

also, delete the ;

#

yes

worthy yarrow
#

Oh you should probably make sure to actually register the command

eternal oxide
#

should not need to

worthy yarrow
#

Shouldnโ€™t, but if thatโ€™s in plugin.yml then I canโ€™t think of anything else causing an issue

eternal oxide
#

default is all commands will go though the JavaPlugin unless registered elsewhere

worthy yarrow
#

Hmm

eternal oxide
#

probably not teh actual plugin.yml in his jar

#

packaging/updating issue

worthy yarrow
#

I just use the install every time and itโ€™s yet to break

teal oracle
#

oh, i forgot importing the things

eternal oxide
teal oracle
#

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

is this how its supposed to be

eternal oxide
#

?tas

undone axleBOT
worthy yarrow
#

Iโ€™m confused because if it default runs through the javaPlugin class, without registering it anywhere how will the server know what string equates to that executor?

teal oracle
#

is this how i would do it? im just assuming as i thought the command argument represented the command sent

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.equals("discord")) {
            getLogger().info("Command thing");
        }
        return true;
    }

}
#

i have no idea what im doing

#

oh its command.getName()

#

whats the difference between
pluginname.jar, pluginname-shaded.jar and original-pluginname.jar?

#

its workong!! [18:13:52 INFO]: [ManaCore] Command thing
first plugin lets goo

teal oracle
#

yay

#

now, how do i send messages to players

#

i dont understand the spigot docs

vast ledge
#

player#sendMessage()

teal oracle
#

thanks

worthy yarrow
#

So youโ€™ll have to get a player variable, then simply player#sendMessage(โ€œmessageโ€);

teal oracle
#

would it be sender.sendMessage in this case?

worthy yarrow
#

Keep in mind if you want colorful messages youโ€™ll have to implement a gradient system or use ChatColor#translateAlternateColorCodes(โ€˜&โ€™, โ€œ&6 your messageโ€);

worthy yarrow
teal oracle
#

what about links and other components like hovering and such

quaint mantle
worthy yarrow
#

So you can derive the player from the commandExecutor but make sure to check that the commandExecutor is in fact a player before declaring a player variable from it

worthy yarrow
buoyant viper
worthy yarrow
#

Thatโ€™s what I thought lol, I never knew given the executor was in the main you didnโ€™t have to register it or even at that point implement commandExecutor

quaint mantle
#

Will be great if we can define plugin class path just by annotation

worthy yarrow
#

Thatโ€™d be pretty lit man

eternal oxide
#

you can

worthy yarrow
#

Elgarl sometimes I wonder if you got a spigot api book or genuinely have just spent all this time learning the docs

eternal oxide
#

lol, I've been at it a decade or so

worthy yarrow
#

Obv the experience lol, but damn wish there was a spigot api book

#

Too bad it changes too often for that to occur

quaint mantle
eternal oxide
#

no, it's a library

worthy yarrow
#

Damn it should be

teal oracle
#

how can i make text that people can click on which sends them to a link?

worthy yarrow
#

Text components

eternal oxide
#

Player#spigot().sendMessage(...

worthy yarrow
#

You can attach a hoverable to a message to achieve this

worthy yarrow
#

Thereโ€™s a message level for that?

worthy yarrow
eternal oxide
#

yes, thats the ...

worthy yarrow
#

Gotcha ok you almost broke my mind again

eternal oxide
#

lol

worthy yarrow
#

I thought there was a message level for sending hoverables based off that first one I was gonna be pissed

teal oracle
#

oh i found out it wasnt required, when i just added the link as a text i could just click it automatically without adding something

#

but i dont think im good enough for this, cuz i only understand like 10% of the words that you guys send

worthy yarrow
teal oracle
#

trying to learn c

#

almost nothing in java

worthy yarrow
#

?learnJava

#

?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! ๐ŸŽ‰

worthy yarrow
#

Those are all pretty good sources

#

OOP is OOP so c -> java is just quality of life imo

teal oracle
#

i know programming concepts very well tho, but its just java specific things like oop i dont understand

worthy yarrow
#

Go through some of those links and learn man, I made the mistake of learning java through spigot api so now my Java experience is strictly applied to spigot, that being said youโ€™ll still probably pick up enough to get out of spigot api

teal oracle
#

isnt this gonna take a lot of time if im gonna need to learn it very well

#

i dont even like java, i just wanted to optimize my server

rapid vigil
#

if you don't have the motivation it's pointless

worthy yarrow
#

I mean unless you want to hire someone youโ€™ll have to learn enough to be able to optimize what you want. Although optimizations arenโ€™t going to be easy if you donโ€™t actually know java

worthy yarrow
teal oracle
#

my motivation is to optimize my server

teal oracle
#

i think im gonna try

worthy yarrow
#

It just takes time man, if youโ€™re truly motivated then you will learn

teal oracle
#

well what do i do then

quaint mantle
#

You learn the basics of Java

worthy yarrow
#

?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! ๐ŸŽ‰

worthy yarrow
#

Learn man, weโ€™ve got that command for a reason

quaint mantle
#

?isspigotdown

undone axleBOT
vague grove
#

How can I check Boolean value?
like
if (FAKE_MSG == true) {
//code
}

(Im new dev for Java)

worthy yarrow
quaint mantle
#

What is the FAKE_MSG even supposed to do?

rapid vigil
quaint mantle
#

Seriously? Had to spoon feed?

rapid vigil
vague grove
nova notch
#

sorry but if you don't know how booleans work in if statements good luck using spigot API

vague grove
#

okay thanks for advice ill practice more

glad prawn
vague grove
#

i should remove "Boolean"?

tidal kettle
#

hey someone know how can i just delete this

#

like when i hover an item nothing show?

fossil wigeon
#

not sure what the issue here is, those red glass panes are just for visuals

#

red background

tidal kettle
#

yep

#

and i think like this it's ugly

fossil wigeon
#

ah you want just the wool?

tidal kettle
#

nope

#

(it's without item tooltip ON)

#

i don't want the ugly black square when i hover the item

fossil wigeon
#

oh the empty description box?

tidal kettle
#

yep

dapper flower
#

no way to remove it

fossil wigeon
#

honestly not sure if you can disable that

dapper flower
#

ripperoni

fossil wigeon
#

i would suppose no

tidal kettle
#

i'm sab bruh

dapper flower
#

maybe a texturepack but wouldnt bet on it

tidal kettle
fossil wigeon
#

maybe you could do it via client side mod? i doubt thats what you want tho, assuming its a public server

fossil wigeon
#

dunno how else they'd do it lol

#

i doubt texture pack can do it

#

since it'd be the same background of the info card thing for every item

dapper flower
#

coping mechanism

fossil wigeon
#

๐Ÿ˜”

remote swallow
#

there was a new item flag for that recently iirc

fossil wigeon
#

hmm?

dapper flower
#

never heard of it, what flag?

#

lemme check rq

dapper flower
#

maybe with nms?

remote swallow
#

@young knoll whats the new flag called

tidal kettle
young knoll
#

agdsrgh

#

Flag for what?

#

Ah hiding the tooltip

#

ItemMeta#setHideTooltip

dapper flower
#

he wants to hide the display name

#

Would removing the tag with nms work?

public org.bukkit.inventory.ItemStack hideItemInfo(org.bukkit.inventory.ItemStack itemStack) {
    // Convert the Bukkit ItemStack to an NMS ItemStack
    ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);

    // Get or create the NBT tag of the item
    NBTTagCompound tag = (nmsItemStack.hasTag()) ? nmsItemStack.getTag() : new NBTTagCompound();

    if (tag != null) {
        // Remove the display tag
        if (tag.hasKeyOfType("display", 10)) {
            tag.remove("display");
        }
        // Remove the ench tag to hide enchantments
        if (tag.hasKeyOfType("ench", 9)) {
            tag.remove("ench");
        }
        // Set the modified tag back to the item
        nmsItemStack.setTag(tag);
    }

    // Convert the NMS ItemStack back to a Bukkit ItemStack
    org.bukkit.inventory.ItemStack bukkitItemStack = CraftItemStack.asBukkitCopy(nmsItemStack);

    // Ensure the item meta is cleared as well (optional, for good measure)
    ItemMeta meta = bukkitItemStack.getItemMeta();
    if (meta != null) {
        meta.setDisplayName(null);  // Clear display name
        meta.setLore(null);         // Clear lore
        bukkitItemStack.setItemMeta(meta);
    }

    // Return the modified Bukkit ItemStack
    return bukkitItemStack;
}
slender elbow
#

thank god we have item components now for this stuff ๐Ÿ™

inner mulch
slender elbow
#

yes

inner mulch
#

Are the item components in 1.20.6?

#

Like are they alr available?

remote swallow
#

the best you get pre 1.20.6 is a space

tidal kettle
inner mulch
#

If you want to enjoy the features

remote swallow
inner mulch
#

Im pretty sure there are data driven paintings too?

remote swallow
#

ye

inner mulch
#

1.20.6 is so good

tidal kettle
remote swallow
#

yeah

tidal kettle
#

Okay

inner mulch
slender elbow
#

that's why you read the changelogs ;)

tidal kettle
#

WHERE

#

where pls

#

๐Ÿ˜„