#help-development

1 messages · Page 992 of 1

polar forge
#

How do I do it now?

valid burrow
#

make a variable of your class

#

Class c = new Class()

#

then

#

register c as an event

#

and as a command

#

@polar forge

polar forge
#

Mmmmmh

remote swallow
polar forge
#

Class c = new Class(); should be in the main class right?

valid burrow
valid burrow
#

the way you named it

#

not Class

polar forge
#

Ofc

valid burrow
#

but it right before you register it

#

in the onEnable

#

if you dont need the class instance anymore at least

tardy delta
#

please use a set of uuids

polar forge
remote swallow
#

show what you wrote

valid burrow
#

what did you have in them previously xd

polar forge
#

Class c = new InvestigateCommand();

valid burrow
#

first of all

icy beacon
#

yikes

remote swallow
#

woah its this all over again

#

?learnjava!

undone axleBOT
rapid vigil
icy beacon
valid burrow
#

do InvastigateCommand command = new InvestigateCommand

icy beacon
#

it's been going like this for like 3 weeks

valid burrow
#

look at the end of the day

polar forge
valid burrow
#

check your constructor

polar forge
#

Guys why are u so worried lmao, I am learning Java

icy beacon
#

we can see that

valid burrow
rapid vigil
remote swallow
#

voss in 2 months when he has 90 people asking for help in his dms

valid burrow
#

but i usually tell them either join my server or ask in spigot

polar forge
#

The Italian guy banned me from ur server :c

#

For no reason lol

#

But

#

Let’s continue

polar forge
rapid vigil
valid burrow
polar forge
#

public InvestigateCommand(Invastigate “”) {
this.”” = “”
}

#

What should I write instead of those “”?

valid burrow
#

whats „“

rapid vigil
valid burrow
remote swallow
#

and now they go back on the no help list

polar forge
#

Places that need something but idk what I should write there

icy beacon
#

cafebabe needs to have a ?vote command that allows people to cast votes to disallow people to use #help-development until they complete a basic 15 question java test without failing

#

because whatever the fuck we are doing right now is NOT productive

remote swallow
#

bet

icy beacon
#

you will write the code you want eventually

rapid vigil
#

agreed

icy beacon
#

what the fuck is the use if you don't undesrtand anything about it

valid burrow
#

„hey chef I came up with this recipe but i have no idea what ingredients i used can you tell me“

polar forge
#

Guys I’m trying to understand

valid burrow
#

until you have basic java knowledge

polar forge
#

I am learning Java

remote swallow
rapid vigil
#

you dont know day 1 of java stuff how are you learning java

icy beacon
rapid vigil
#

actually day 0

polar forge
#

Im in the meanwhile excercising

icy beacon
#

or at least have a background in any other programming language

valid burrow
#

you shouldnt be driving an uber while learning to drive should you

icy beacon
#

what the fuck

polar forge
#

If u have someone next to u

#

That let u learns it you’re good to go

icy beacon
#

ok if you are learning to drive then maybe

#

if you still confuse gas and brake then no

polar forge
#

If you’re in an empty parking lot then yes

valid burrow
#

you aren’t though

icy beacon
#

you are not in an empty parking lot and no you shouldn't be doing that even in a parking lot

valid burrow
#

there are tons of obstacles

#

snd you keep breaking your car

#

because you dont even know how many wheels it jas

icy beacon
#

you are coding with a library (framework if you insist)

#

it's like you are on an obstacle course

#

not a fucking empty parking lot

polar forge
#

Guys, why are u worried? I am learning Java, without doing such plugins I would never learn Java

valid burrow
icy beacon
#

"why are you worried" because we cannot help you with your problems. you are not progressing and all your questions eventually go down to spoonfeeding

polar forge
#

Now I am learning something new, and that is to register a listener class that also contains CommandExecutor

icy beacon
#

you don't even need to learn that

polar forge
#

Well I need

icy beacon
#

so you just avoid the first message

polar forge
#

?

polar forge
#

It is related to Java

icy beacon
#

no

#

it is related to spigot

polar forge
#

Spigot and Java are the same thing?

icy beacon
#

no java guide will go "don't forget to register your listeners and especially if they are commandexecutors"

icy beacon
valid burrow
icy beacon
#

WEROTYUHINRIENSVUYHBERSuiyTSVRDUIYHNDFYNTGRDFKH][

#

this message disproves everything you said

#

about "i'm learning java"

#

no the fuck you are not

#

if you think java and spigot are the same thing

polar forge
#

Well I think so

#

It’s literally the same

icy beacon
#

it's like saying that a cow and cottage cheese are the same thing

icy beacon
valid burrow
#

and you wouldve made alot

#

if you listened to us

polar forge
#

I am watching those videos of Java that won’t help me with what I am doing but hey at least “I am learning Java”

icy beacon
#

yes because if you are purely consuming you will not do any progress

#

do JAVA exercises

#

not SPIGOT PLUGINS

valid burrow
#

ofc they would it you watched them enough and actually learned what they teach

polar forge
#

That’s the same? I don’t understand

icy beacon
#

make a "guess a number" console app

remote swallow
#

i didnt learn java when i first started and it got me no where, when i finally decided to actually learn it properly and figure out whats happening and how stuff works it made making stuff so much easier

icy beacon
#

spigot is a library

#

a set of tools

icy beacon
#

to use which you need ot learn java

#

spigot does not exist without java

polar forge
#

Ok guys let’s do a promise together

icy beacon
#

java exists without spigot

#

no

polar forge
#

Ill learn Java

icy beacon
#

will you

polar forge
#

Can I at least get help on this? And I promise I’ll learn Java and tomorrow u can test me

icy beacon
#

tomorrow

polar forge
#

And if I fail

icy beacon
#

do you think learning a programming language is a one day journey

icy beacon
#

i give up

#

goodbye

#

best of luck

valid burrow
#

understanding advanced stuff 2 years

icy beacon
valid burrow
#

fully understanding OOP can take decades

#

i started getting into programming 5 years ago, been doing java for about 3

polar forge
#

Who Tf created Java? I could have done that and if I WOULD have done that it would have made the life of million coders easier

valid burrow
#

every. day.

valid burrow
polar forge
#

Yes

valid burrow
#

if you dont understand java

#

try something easier xd

polar forge
#

But guys

rapid vigil
#

learn Lua :)

polar forge
valid burrow
#

we are talking about development xd

icy beacon
polar forge
#

So let’s help our brothers who just started making plugins

icy beacon
#

do you read a book in chinese without knowing anything about chinese

valid burrow
stoic parrot
#

this is fun

icy beacon
#

but translate every character separately with google translate to see if that yields other results

polar forge
icy beacon
#

and don't even try to do anything better

#

why am i still here

valid burrow
polar forge
#

You guys make me crazy

valid burrow
#

you make us crazy

#

you dont understand a single thing about java

icy beacon
#

Crazy? I was crazy once. They locked me in a room, a rubber room, a rubber room with rats and rats make me crazy.

remote swallow
#

you are making this harder for yourself

rapid vigil
polar forge
#

Elgarl actually tells me and explains me everything

#

And I understand from him

icy beacon
#

he's old and apparently has too much time on his hands

remote swallow
#

we can all explain what we say its just you most likely wouldnt understand it

icy beacon
#

old as in

remote swallow
#

great grandad

valid burrow
#

Hes the kind of person to give his grand children all his money because he just loves them too much and couldn’t say no

icy beacon
#

elgar is the best grandad of spigot

rapid vigil
polar forge
#

We all love Elgarl 🥰🥰🥰

tepid turret
#

i cant tell if y'all r joking. is he actually a grandad?

icy beacon
#

yes

tepid turret
#

:o

valid burrow
#

one of if not the oldest person here

polar forge
#

But guys let’s get on the right track

icy beacon
eternal oxide
valid burrow
icy beacon
polar forge
#

Lmao

valid burrow
icy beacon
#

nice

polar forge
#

Guys how do I register a listener class, if the listener class also implements CommandExecutor?

icy beacon
#

welp

valid burrow
#

Alex makes sure to tell it everyone

eternal oxide
icy beacon
polar forge
eternal oxide
#

You my have told him but he doesn;t understand instances yet

icy beacon
#

try 1/3rd

pseudo hazel
#

yes, just like how you register anything else in spigot

valid burrow
polar forge
eternal oxide
#

Yeah, if he doesn;t understand it he ignores it 😛

#

ok, its instances time....

icy beacon
#

i'm back to geometry bye have fun explaining day 1 basics

polar forge
#

We’re talking about instances

valid burrow
polar forge
#

It’s not

valid burrow
#

that is exactly what an instance is.

polar forge
#

Instances come after “public”

young knoll
#

What

valid burrow
polar forge
#

Like

eternal oxide
#

If you have two applesjava Apple one = new Apple(); Apple two = new Apple();I have two apples, each one is it's own instance. They are identical but not the same Object(instance)

shell matrix
#

what am I reading here

polar forge
#

public Class() {
//instance
}

pseudo hazel
#

what do you think an instance is

#

thats a definition

valid burrow
eternal oxide
#

Not simple enough 😦

polar forge
#

Voss helped me

pseudo hazel
#

the "new" keyword creates an instance of the defined class

polar forge
#

What’s next?

valid burrow
#

register the instance

#

once as a command

#

and once as a eventlistener

polar forge
#

In main class or listener class?

valid burrow
#

main clas

#

where you usually register stuff

polar forge
#

So everything in main class?

valid burrow
#

just instead of typing new x inside of there

eternal oxide
#

so if you want to use ONE instance you make sure to only create one instancejava Apple one = new Apple(); registerAsListener(one); registerAsExecutor(one);

valid burrow
#

type the name of the instance

eternal oxide
#

Note registerAsListener is not a real method, just an example

polar forge
#

I really needed the note thx

#

So uhm

#

public InvestigateCommand(Investigate plugin) {
this.plugin = plugin
}

#

I know it’s wrong

eternal oxide
#

so where in your code you kept doing new class() when you wanted to use it... thats wrong

polar forge
#

But should it have the same structure?

valid burrow
pseudo hazel
#

wdym

eternal oxide
polar forge
#

So is this it?

valid burrow
#

depends on what you are trying to do.

eternal oxide
#

no, thats a DI constructor

valid burrow
#

If you need an instance of your plugin in your investigate command then this constructor is correct.

polar forge
pseudo hazel
#

the fact it implements multiple interfaces had nothing to do with anything

eternal oxide
#

your Constructor has nothing to do with registering

pseudo hazel
#

thats kind of how its designed

polar forge
#

I don’t get what you guys are saying

#

Usually I use

valid burrow
eternal oxide
#

ignore what is IN your class for a moment

polar forge
#

Bukkit.getPluginManager blah blah blah

#

But this time I can’t use it

eternal oxide
#

only focus on the instance/registering

polar forge
#

Bc it also implements a CommandExecutor

eternal oxide
#

doesn;t make a difference

rapid vigil
pseudo hazel
#

who told you you cant use it

polar forge
eternal oxide
#

They shoudl be in different classes, but this is a good leaning experience too

valid burrow
#

ONLY

#

THE PART

valid burrow
#

WHERE YOU ARE REGISTERING

eternal oxide
#

Just goto your Main class

#

in your onEnable where you do your registering

rapid vigil
eternal oxide
#

currently you do a lot of new

polar forge
#

This is my main class

#

Trying to registering it on line 21

eternal oxide
#

ThissetExecutor(new InvestigateCommand(this)); makes a NEW instance

#

you only want ONE instance

#

so create a variable (not a field)

#

InvestigateCommand command = new InvestigateCommand(this);

polar forge
#

But it tells me an error

eternal oxide
#

ignore for now

polar forge
#

Ok done

rapid vigil
#

if u notice the difference

eternal oxide
#

then replace all your current uses of new InvestigateCommand(this) with command

eternal oxide
polar forge
#

Unexpected token

rapid vigil
polar forge
#

And ; expected

valid burrow
eternal oxide
#

yeah one thing at a time 😉

rapid vigil
eternal oxide
#

show us the code you currently have in your onEnable

valid burrow
polar forge
#

Ok

#

Guys learn from Elgarl

#

Here is it

eternal oxide
#

excellent

icy beacon
rapid vigil
#

Sure but, why do you have this

eternal oxide
#

now you want to register it as a Listener too

rapid vigil
eternal oxide
#

yeah delete 12

polar forge
#

Ok

eternal oxide
#

do you know how to register an Event Listener?

polar forge
#

Bukkit.getPluginManager().blablahblaj

#

Right?

eternal oxide
#

yes

valid burrow
#

yea

eternal oxide
#

do that for command

rapid vigil
#

you have getServer

#

why use Bukkit

polar forge
#

Idk

eternal oxide
#

bukkit is fine, just static access

polar forge
#

And in the brackets of registerEvents(command) right?

#

Or

#

What

eternal oxide
#

yes

polar forge
#

Ok now errors

orchid trout
#

at this point just ask elgar to write the plugin for you

polar forge
eternal oxide
#

In all you are creatign a single instance of your InvestigateCommand class and registerign it as a Listener and the executor for three commands

orchid trout
eternal oxide
#

any errors/warnings?

polar forge
#

So I’m now setting it as an Executor and as an event

polar forge
icy beacon
pseudo hazel
#

mind sharing what errors you have?

polar forge
rapid vigil
pseudo hazel
#

double check your brackets

icy beacon
eternal oxide
#

does your InvestigateCommand class implement Listener?

icy beacon
#

because java sure does find it very weird

icy beacon
#

so weird in fact it won't compile

polar forge
#

implements CommandExecutor, Listener

eternal oxide
#

line 40, 41 and 42, delete teh last bracket )

rapid vigil
# polar forge Yes

PluginManager#registerEvents takes 2 parameters, a Listener and a Plugin 😜

eternal oxide
#

^

polar forge
#

So (command, this)?

eternal oxide
#

yes

#

perfect

polar forge
#

Ye

#

Done

#

Now let’s try it out

#

?tas

undone axleBOT
pseudo hazel
#

lmao

polar forge
#

It works

#

Thanks Elgarl

eternal oxide
#

np

pseudo hazel
#

as long as you know how to do it in the future its fine xD

still ridge
#

hello, I create a block with custom name, some persistant data but when I place it and I pick it I lose all the data 😦 , how can I make sure I don't lose the data ?

stoic parrot
#

If I want a subcommand eg:

/test reload
/test reset

They are coded in different classes, how should I register them?

eternal oxide
#

PDC does not transfer from an ItemStack to a Block

still ridge
eternal oxide
#

what attributes? Blocks have none

valid burrow
#

a sub command is just an argument

#

you have have noticed that the constructor of a command has 4 inputs

still ridge
valid burrow
#

with one of them being a string list

#

the string list is your arguments

eternal oxide
still ridge
eternal oxide
#

a Block doesn;t have attributes

#

Hardness is hard coded on blocks

still ridge
#

ok

stoic parrot
# valid burrow the string list is your arguments

Ahh, so then in the plugin.yml I have to make a subcommand for it instead of a new command?

commands:
  test:
    description: Test reload
    usage: /test reload
    permission: test.reload
    subcommands:
      test-reset:
        description: Reset Test
        usage: /test reset
        permission: test.reset
young knoll
#

no

#

subcommands aren't a thing in plugin.yml

stoic parrot
#

so, do I just register the main command?

valid burrow
valid burrow
#

lets say you have the command

#

/gamemode

#

survival

#

creative etc

#

they are just arguments

stoic parrot
valid burrow
#

dont worry

#

if you want "subcommands" to show up in tab you will need to make that yourself

polar forge
#

Arguments are your sub commands

valid burrow
#

using a tabcompleter class

remote swallow
#

you can tab complete in ur main command class

polar forge
#

Args[0] is your command, like /gamemode

valid burrow
#

thats not true

#

args[0] is the first argument

polar forge
#

Oh then got confused

#

Args[0] is the first argument u write after the command

stoic parrot
#

I get it, I'll do some testing and let you guys know if I face issues!

polar forge
valid burrow
#

red is the command green the arguments

valid burrow
#

remember that lists in java start at 0

#

so the first argument is 0 :)

#

and the second is 1

#

and so on

stoic parrot
valid burrow
#

nice!

tropic totem
eternal oxide
#

use a better site. I'm not doing a captcha just to see your paste

#

?paste

undone axleBOT
icy beacon
#

are you using a mod api with spigot

eternal oxide
#

why is getStorage() using NMS? Wrong import by chance?

lilac dagger
#

yes

icy beacon
#

this makes me more worried than getStorage

valid burrow
#

xDD

#

what kind of fork are you using

tropic totem
#

yes im using arclight and im planning to call infomation of cobblemon mod and use on plugin

icy beacon
#

?whereami

shell matrix
#

Im still not into this change with mojangs component system but do you guys think, the enchantment change will bring breaking changes like registration or maybe enhancements (thinking about custom enchantments adding a lore by default finally)?

tropic totem
valid burrow
#

just decompile it lmao

tropic totem
#

yes i decompile it and thats how i got the source and i get that error

valid burrow
#

well youre in the wrong place

#

we are the spigot server

#

and we dont provide support for any weird fork

icy beacon
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

polar forge
eternal oxide
#

?nms

obsidian drift
#

How can I get a LivingEntity to use the item in it's main hand? For example, use a goat horn they are holding

river oracle
#

Components reduced my nms lines by 3 fold for anything item related. So much more concise and sensible system

icy beacon
river oracle
icy beacon
#

hi kazuma

river oracle
#

It's sad he doesn't do that in the books

#

It makes me laugh in the anime

shell matrix
icy beacon
#

i still don't understand the difference between components and nbt per se. to me they just replaced { with [ and added some new properties like stack size

river oracle
#

One sec

river oracle
# icy beacon i still don't understand the difference between components and nbt per se. to me...

1.20.4

    @NotNull
    @Override
    public ItemStack setItemLore(@NotNull ItemStack item, @NotNull List<BaseComponent> lore) {
        final CraftItemStack craftItem = ensureCraftItemStack(item);
        final net.minecraft.world.item.ItemStack nmsItem = getItemStackHandle(craftItem);

        final CompoundTag tag = nmsItem.getTag() == null ? new CompoundTag() : nmsItem.getTag();
        if (!tag.contains(net.minecraft.world.item.ItemStack.TAG_DISPLAY)) {
            tag.put(net.minecraft.world.item.ItemStack.TAG_DISPLAY, new CompoundTag());
        }

        final CompoundTag displayTag = tag.getCompound(net.minecraft.world.item.ItemStack.TAG_DISPLAY);
        ListTag loreTag = new ListTag();
        for (int i = 0; i < lore.size(); i++) {
            loreTag.add(i, StringTag.valueOf(ComponentUtils.toJsonString(lore.get(i))));
        }

        displayTag.put(net.minecraft.world.item.ItemStack.TAG_LORE, loreTag);
        return CraftItemStack.asBukkitCopy(nmsItem);
    }

1.20.6

    @NotNull
    @Override
    public ItemStack setItemLore(@NotNull ItemStack item, @NotNull List<BaseComponent> lore) {
        final CraftItemStack craftItem = ensureCraftItemStack(item);
        final net.minecraft.world.item.ItemStack nmsItem = getItemStackHandle(craftItem);
        nmsItem.set(DataComponents.LORE, new ItemLore(lore.stream().map(ComponentUtils::toMinecraftChat).collect(Collectors.toList())));
        return CraftItemStack.asBukkitCopy(nmsItem);
    }```
stoic parrot
# valid burrow sure

Hey, so turns out the reset command works well but the reload one does not work at all.
I think the issue is with the plugin.yml. Can you give me a example on how it would look like?

icy beacon
river oracle
#

its built upon NBT

#

somewhat

icy beacon
#

I'm starting to get it probably lol

river oracle
#

its a worth while abstraction

icy beacon
#

Will need to work with it myself to see the changes better

#

I will probably need to do some component parsing from string in my plugin

#

Is that easy?

shell matrix
#

Im not that into nms but is it basically manipulating the lore?

river oracle
icy beacon
#

Surely there's some built in

icy beacon
river oracle
valid burrow
icy beacon
#

No idea, haven't done it with nbt lol

valid burrow
#

it should not contain any info about the arguments

icy beacon
#

Well I guess I'l see

shell matrix
#

cuz Ive been thinking about maybe moving my lore systems to some packet based system so I could add multi-language support as well as be able to dynamically change enchantment names etc but Idk if this is a good idea, especially with components

stoic parrot
valid burrow
#

usage is ofc a exception

#

u can put anything there

#

as it doesnt effect the command at all

grim hound
#

How can I override the callEvent implementation the CraftServer calls to?

#

since it's in SimplePluginManager, which is a final class

grim hound
stoic parrot
valid burrow
#

show me ur command class

stoic parrot
valid burrow
#

its an argument where would it show up xd

icy beacon
#

you've been doing so much code hijacking md_5 might be on a hunt for you

valid burrow
icy beacon
#

it looks cute

valid burrow
valid burrow
icy beacon
valid burrow
icy beacon
#

well shit

valid burrow
#

xd

grim hound
#

but the client just disconnects

#

refuses to join

#

no idea why

valid burrow
grim hound
stoic parrot
valid burrow
#

Okay

#

let me take a look

stoic parrot
#

oh wait I think I found out

grim hound
stoic parrot
#

omg

valid burrow
#

are you registering the tab completor?

eternal oxide
#

Magmaguy was messing around with logging in a fake user a while back

grim hound
stoic parrot
grim hound
#

cuz no idea what could be wrong, I read the contents

valid burrow
grim hound
#

and it seems just fine

valid burrow
#

im confused

stoic parrot
grim hound
#

and what did he do by that

eternal oxide
#

he's got some stupid name here now / somethign junk

#

look in users, he's a donor

#

^.^

valid burrow
eternal oxide
#

yep

grim hound
#

ye

eternal oxide
#

he started a few years ago, but if I remember right he was messing with logging in a fake player using packets

grim hound
#

THAT'S WHAT I NEED

#

wait no

#

logging in a real player using fake packets

#

that's what I need

pseudo hazel
#

wtf does that even mean

eternal oxide
#

well it would probably work the same, other than the encryption part

grim hound
#

and here I'm hijacking the function that sends those packets

#

and using my own, fake ones

#

but

#

this mfo still disconnects

#

and so I passed a dummy player and a dummy network manager

#

and instead of sending, the network manager stores the packets

#

translates them into PacketEvents' packets so I can change a bit

grim hound
tepid turret
#

yo how do i do like

#

Object.function(set);

#

or whatnot

grim hound
#

but the mfo still disconnects

tepid turret
#

idk im being stupid rn

pseudo hazel
#

static functions?

grim hound
grim hound
tepid turret
grim hound
tepid turret
#

ok basically right i kinda wanna do this as an input for something?

tepid turret
#
claim(boat ->
  boat.name = "test"
  boat.claimed = "real"
)
remote swallow
#

kotlin?

grim hound
#
claim(boat -> {
  boat.name = "test";
  boat.claimed = "real";
  return boat;
});
tepid turret
#

i dont know my brain hurts and ive been up for too long lately

radiant aspen
#

Yo, im messing around with resource packs, is there any way to embed a resource pack inside a .jar, or do I have to download it from the interwebs?

chrome beacon
#

You can embed it in your jar

tepid turret
chrome beacon
#

as long as you also embed a web server

remote swallow
#

but you have to host it

radiant aspen
#

thats dum

#

:/

remote swallow
#

you can host a webserver on your server

grim hound
radiant aspen
#

Yes, I know, I was just wondering if you can embed a folder inside a jar, and then send it via packets or something to the player

remote swallow
#

basically what you want is self hosting a webserver inside the plugin

grim hound
radiant aspen
radiant aspen
#

if thats the case, ig uploading it to dropbox or mediafire or whatever is fine

#

Otherwise I have to worry about firewall ports and other stuff which sounds like more of a pain

young knoll
#

Yeah you can run an internal server but you need to open a second port for it

remote swallow
buoyant viper
#

(disclaimer its mine)

remote swallow
#

imagine manually writing the manifest

buoyant viper
#

i do a lot from scratch smh

nova quail
pseudo hazel
#

why are you using a counter in the task

#

just add a bigger delay

eternal oxide
radiant aspen
#

especially if its a public plugin, since I dont know if something else is running on that port, if the firewall is configured for it ect

eternal oxide
#

oh I see you are running a task on every projectile, then cancelling it 10 ticks after it hits

young knoll
radiant aspen
#

True I guess

#

but people are idiots

eternal oxide
#

you need to also stop your runnable

#

as its a taskTimer

#

currently every projectile that hits leaves a new runnable ticking

grim hound
#

so how do I stop certain events from being invoked?

young knoll
#

You don't

grim hound
#

from being fired

eternal oxide
#

you can't stop it but you could consume the packet

#

Nope, ignore me, was a silly idea

grim hound
#

my current player disconnects after this

eternal oxide
#

instantly or after a few seconds?

grim hound
#

instantly

#

somehow

eternal oxide
#

not sending keep alives?

grim hound
#

it acknowedges that join_game is correct

grim hound
#

this is complete

#

also, they're not instant

eternal oxide
#

k

grim hound
#

also this is when I do a server start

#

but after a reload

#

wait, are server classes not reloaded?

#

during a reload

eternal oxide
#

why would they? its not a class loader reload for the game

grim hound
grim hound
# grim hound

I'm also curious why the client sends a custom payload

#

and the server responds (originally)

grim hound
#

like Vanilla, Forge, etc

young knoll
#

Could be

#

What's the data in it

eternal oxide
#

brand etc is sent in a PMC packet so that would be a custom payload

grim hound
young knoll
#

there ya go

grim hound
#

this is the server join sequence

#

Never knew the client got informed of the server's brand

acoustic pendant
#

Hey, so i'm trying to sout that Stringlist but it is returning empty, why is that happening?

#
   ConfigurationSection s = data.getConfig().getConfigurationSection("islands");
        for (String keys : s.getKeys(false)) {
         ConfigurationSection section = s.getConfigurationSection(keys);
                    System.out.println(s.getStringList("members"));```
eternal oxide
#

you do nothing with section

acoustic pendant
#

o

#

lmao

#

it was me being silly

still ridge
#

how I can create an Item entity from an ItemStack ?

grim hound
still ridge
grim hound
#

you can construct it yourself using this source code

still ridge
#

ok

sand spire
#

Is there a way to make an Allay fly to an entity, just like they do normally when picking up items?
#setTarget and #setMemory don't work and I can't find anything on google

eternal oxide
#

I'd assume you also have to put an item in its inventory

brittle geyser
#

What can i use instead of PersistentDataContainer?

eternal oxide
#

in older versions use an NBT api

brittle geyser
#

without any api

eternal oxide
#

nothing

brittle geyser
#

I need create own class?

sullen canyon
cinder abyss
#

Hello, how can apply a glow effect on a player with a custom color?

grim hound
#

Before

#

And uh

#

I might just be doing something wrong but the client still just disconnected

brittle geyser
#

Is this code create new object if map has same uuid

    protected static final Map<UUID, FastPlayer> FAST_PLAYER_MAP = new HashMap<>();
    public static FastPlayer getFastPlayer(UUID uuid) {
        return FAST_PLAYER_MAP.computeIfAbsent(uuid, uuids -> new FastPlayer(uuids, false, "", ""));
    }
ivory sleet
#

yea but its a bit goofy that u have it static (singletoned?)

ivory sleet
#

Yes really

stoic parrot
ivory sleet
#

Start timer is called before stop timer, exactly once?

stoic parrot
#

yes

brittle geyser
grim hound
#

It's a normal Map

#

And static access is convenient

cinder abyss
#

Hello, how can apply a glow effect on a player with a custom color?

young knoll
#

Scoreboard teams

stoic parrot
cinder abyss
stoic parrot
#

Remember to set glowColor

cinder abyss
#

Yeah

#

(it's for 1.19.4)

flint coyote
#

There is no setGlowingColor for Player as far as the docs tell

stoic parrot
#

oh wait

#

yeah

#

ur correct

cinder abyss
#

Hmm

cinder abyss
flint coyote
#

You set a team color

#
HashMap<Player, Team> tempTeams = new HashMap<>();
public void glowColor(Player player, ChatColor color) {
    assert Bukkit.getScoreboardManager() != null;
    Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
    Team team = scoreboard.registerNewTeam("temp-color-team-" + UUID.randomUUID());
    team.setColor(color);
    team.addEntry(player.getDisplayName());
    tempTeams.put(player, team);
    player.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, Integer.MAX_VALUE, 0));
}
public void stopGlowing(Player player) {
    player.removePotionEffect(PotionEffectType.GLOWING);
    tempTeams.get(player).unregister();
    tempTeams.remove(player);
}

"Borrowed" from this thread: https://www.spigotmc.org/threads/how-to-make-a-player-glow-a-color.621213/

cinder abyss
polar forge
#

I get it every time I /sethome

remote swallow
#

conclube ur gonna hate me when you look in verified

ivory sleet
# grim hound And static access is convenient

No it hinders modulization, it fucks up testability and reusability, it often causes leaky abstractions and if you at any point migrate said module code to work in a multithreaded environment you may fuck up publication and consumption of mem visibility, as well as thread safety, partly why SimpleDateFormat is objectively annoying to touch. You also weaken the expressiveness of your type system infrastructure.

#

Yes there are places where stateful static behavior makes sense

#

but often if you come across a static mutable map, its bad design

#

often as in 97% of times

ivory sleet
#

y u do dis to me

spiral escarp
#

anyone have a suggestion on how I add a stay function with a updating scoreboard title? ie. I want it to stay on one text for a certain amount of ticks and then continue to the next index in the List

remote swallow
remote swallow
#

also the fact you didnt like it before

spiral escarp
#

I completly forgot about that

torn shuttle
#

finally developers are getting the respect they are definitely owed

remote swallow
#

nuh uh

ivory sleet
#

once in a bluemoon

torn shuttle
#

I worked out so hard I am sick today

#

three days after the workout

#

this sucks

ivory sleet
#

physically or u mean like code wise?

torn shuttle
#

both sounds good

#

let's go with that

ivory sleet
#

lol alr

torn shuttle
#

whoever invented squats must surely be burning in squatting hell right now

remote swallow
#

do you not want fat ass

torn shuttle
#

at this point I am working backwards, my quads are getting so big I can't use a whole category of pants anymore

upper hazel
#

I forget what the site is called for thinning a project's github repository via the same github

#

I think it started with an 'i' or something like 'ilj'.

remote swallow
#

what

upper hazel
#

how name site call for create online repository for github project

#

in maven

remote swallow
#

reposilite? jitpack? repsy?

upper hazel
#

yes jitpack

tardy delta
#

what happened here

cinder abyss
#

Hello, how can I translate a md5 ChatColor to bukkit ChatColor? Does it works with custom colors?
And how can I put a custom color using hexadecimal in md5 ChatColor?

eternal night
#

bukkit chat color does not afaik (support RBG)

cinder abyss
eternal night
#

Well not without loss of information

cinder abyss
#

so let's translate hex to rgb

#

😎

#

I can't click 😭

cinder abyss
nova quail
#

Hello! I have made a sqlite database which stores info about player's choosen effect. Player need to choose effect in GUI and then it will be stored in database. All works great but I have problems with database. Can someone help please: https://paste.md-5.net/obifofacit.cs

#

All works great but sometimes plugin sends null errors in console after a long usage

cinder abyss
#

okay thanks

cinder abyss
#

Hello, how can I change the color of the player's name when he send a message in chat?

lilac dagger
#

Edit the chat format

dawn flower
#

eyo

cinder abyss
dawn flower
#

can i toggle glow for players? so they dont see glow

#

im guessing i have to listen for packets

lilac dagger
#

Event set format

cinder abyss
#

okay thanks

lilac dagger
#

If you want to change the name eveywhere you can set custom name

cinder abyss
#

okay 👍

nova quail
#

Better not to do this with database?

hazy parrot
#

That may be the problem

#

Try not to use that command and see if the problem persist

nova quail
#

maybe that was really problem

#

cause that error happened only today after i started reloading plugin

eternal oxide
#

using plugman I bet

nova quail
eternal oxide
#

plugman is bad with statics

tardy delta
#

makes data application bound rather than session

#

what are you gonna do, make everything static?

blazing ocean
#

you can be happy you haven't seen any of my projects

cinder abyss
#

Hello, why event.getFormat returns me that?

tardy delta
#

placeholders, one is for name one for message, dont ask me the format though

#

probably positional arg and representation

cinder abyss
#

hmmm

grim hound
#

It's not unmodifiable

#

But I don't directly see what's exactly wrong with that

reef brook
#

Hi everyone.
Why can I compile my plugin in JDK 8 with Spigot 1.20.3, but not with Spigot 1.20.4?
Has Spigot 1.20.4 dropped support for JDK 8?
To be clear: I'm using JDK 8 for compatibility reasons, as I'm developing a plugin compatible with a range of Minecraft versions

eternal night
#

spigot 1.20.4 api is compiled to java 17

reef brook
eternal night
#

that one still compiles to java 8

reef brook
#

ohh

glad prawn
#

Remind them that the new version requires higher java version, done.

ivory sleet
#

its susceptible to mutations

#

unlike Collections.unmodifableMap or ImmutableMap::copyOf/of
Map::copyOf/of

hazy parrot
#

does anyone know how can i transform this query from sqlite to duckdb ?

SELECT MAX(LENGTH(artist.name)), ar.name, artist.name
FROM artist
inner join area ar on ar.id = artist.area
group by ar.name
order by ar.name

this query in sqlite gives expected output (picture 1) while in duck db i also have to add artist.name into group by clause which later on makes query result unexpected (picture 2). Anyone knows solution ?

tardy delta
#

duckdb?

hazy parrot
white root
#

Does Bukkit.getPlayerExact() return offline players, too?

echo basalt
#

Is the return type OfflinePlayer?

white root
#

No, its Player

echo basalt
#

That's your answer

chrome beacon
#

Then there you have the answer

young knoll
#

The heck is duckdb

hazy parrot
#

idk, looks like sqlserver like database which i have to use at internship

young knoll
#

DuckDB is designed to support analytical query workloads, also known as online analytical processing (OLAP). These workloads are characterized by complex, relatively long-running queries that process significant portions of the stored dataset

hazy parrot
#

thing is i have to add everything from select into group by clause, and that fuck up results

mellow snow
#

I can't find the maven for md5 repository that contains libsdisguise dependency

tender shard
dawn flower
#

is it possible to make text displays FIXED and 2 sided?

#

ik i can make 2 text displays but who has enough time for that 😴

mellow snow
undone axleBOT
carmine mica
#

It’s just an unmodifiable view of a map, not an immutable map

#

Map.copyOf != Collections.unmodifiableMap

sleek estuary
#

sqlite

#

Does anyone know how to solve it?

tender shard
sleek estuary
#

1 second

tender shard
#

what's DatabaseExecutor line 93?

sleek estuary
#

with mysql no errors occur, but with sqlite yes

tardy delta
#

connection or commadn ull?

sleek estuary
tender shard
#

looks like you can't print out "unprepared" prepared statements in sqlite or sth?

tender shard
#

or something

#

like, what I said was just a wild guess

#

try to not print out the statement before you filled in the ? values

sleek estuary
sleek estuary
#

with mysql i not have problems

tender shard
#

yeah but apparently sqlite does not support that

#

it seems like sqlite requires you to fill in the prepared statement values before you can print it out

#

while mysql just uses ** NOT SPECIFIED ** when toStringing() the statement

sleek estuary
#

I only printed it because it was having problems

tender shard
#

well idk what you did before, I can only tell you what the problem is from the code you sent

sleek estuary
#

Before it was like this, I'll run the code then

#

and it will give an error on line 93

eternal oxide
#

check the state of your connection

sleek estuary
eternal night
#

"it seems like sqlite requires you to fill in the prepared statement values before you can print it out"

eternal oxide
#

isClosed()?

eternal night
#

you are still printing it there no?

#

or how does DatabaseStatment#toString look

tender shard
#

and what even is line 93 again lol

#

if you send code screenshots, please include the line numbers

sleek estuary
eternal oxide
#

then you can;t sysout a closed connection

sleek estuary
#

but I don't understand why it's closed

tender shard
#

are you using hikari or sth?

sleek estuary
tender shard
#

check hikari out. it'll manage connections for you, both for mysql, sqlite, and more. your connetion is maybe closed because you created it within a try-with-resources ealier (wild guess, haven't really looked at the code) since I gtg now

dawn flower
#

how do i fix that if theres 2 text displays inside of each other

sleek estuary
#

sqlite has it in spigot, I don't know why this happens

dawn flower
tender shard
sleek estuary
tender shard
#

did you set any other options for the hikariconfig? for sqlite I really only give it the jdbc string and nothing else , works fine for me

sleek estuary
#

I do it the same way I do it for MySQL. I already used hikari in mysql

tender shard
#

idk, maybe try the absolute path of the db file name - other than that, I also got no ideas - except that, as I said, I do not set any other config options for sqlite, only for mysql

#

another difference is that I create a HikariConfig and use that to create the datasource, instead of creating the DataSource directly - maybe that automatically handles getting the correct driver?

#

try to create your HikariDataSource using a HikariConfig object, then set the jdbc url directly in the config object, then pass that config to create the DataSource

#

no idea if that helps but maybe it does

dawn flower
sleek estuary
#

same error

tender shard
remote swallow
#

1.8.8 most likely doesnt have the sqlite driver

#

if it does its not loaded load it with Class.forName

tender shard
#

normally hikari should handle that itself, at least version 4.0.3 does that for me

remote swallow
#

bit outdated

#

use 5.x.x

tender shard
#

4.0.3 is latest that supports java 8

#

5.x requires java 11 I think

remote swallow
#

ah

#

smh supported outdated

tender shard
#

well they're using 1.8.8 so I guess they kinda rely on java 8 🥲

sleek estuary
#

if i have this line, the error is different

tender shard
#

well as said, sqlite doesn't support stuff like connection timeout etc

sleek estuary
tender shard
#

also you're still directly creating the DataSource instead of using HikariConfig

dawn flower
sleek estuary
sleek estuary
#

same error

tender shard
sleek estuary
glad prawn
#

directly use source.setJdbcUrl is fine

tender shard
tender shard
#

so you're still trying to add some mysql-only options to your hikari config / datasource

sleek estuary
#

like this?

tender shard
sleek estuary
tender shard
tender shard
#

oh hell no

#

I haven't used 1.8 since 1.9 came out

sleek estuary
#

It could be a problem with the sqlite driver that comes with spigot 1.8

eternal night
#

yea, would be my guess regarding the abstract method exception

#

in which case, bundle your own one

dawn flower
sleek estuary
tender shard
dawn flower
#

ok

tender shard
#

or on gradle, shadow plugin + implementation scope for the sqlite driver

sleek estuary
#

implementation("org.xerial:sqlite-jdbc:3.45.3.0")

tender shard
#

yeah looks good. no idea if that uses a different driver class name though, you'll have to check their docs

#

this is what spigot 1.20.4 includes

#

1.8.8 doesn't seem to include ANY sqlite driver, at least from my quick glance at their ancient pom

sullen marlin
#

It does

sleek estuary
#

gives error like this. Now I'll see loading the class

tender shard
tender shard
tender shard
#

idk ¯_(ツ)_/¯

sleek estuary
#

now this

sleek estuary
tender shard
#

yeah ik, lynx already proved me wrong on that

#

anyway, I'm out of ideas

sleek estuary
tender shard
#

please send both the full(!) exception, and your whole class as text pls

#

?paste

undone axleBOT
eternal night
#

Im just gonna say this is too old of an adapter for hikaricp

eternal oxide
#

yep

undone axleBOT
sleek estuary
tender shard
eternal night
#

I didn't see that

sleek estuary
#

I will run the plugin in Java 17

tender shard
#

okay just for fun:

#

try this

#
    try {
        Class.forName("org.sqlite.JDBC");
        HikariConfig config = new HikariConfig();
        config.setJdbcUrl("jdbc:sqlite:" + DatabasePlugin.INSTANCE.getDataFolder() + File.separator + fileName);
        config.setConnectionTestQuery("SELECT 1");  // Add this line
        hikari = new HikariDataSource(config);
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
#

to construct your hikari instance

tender shard
slender elbow
#

not really

#

when a class is queried for, a class loader will first reach to its parent class loader before itself

tender shard
#

Yeah whatever - just wanted to say: if my above snippet works, the issue is that the outdated sqlite thingy was used

#

In that case, relocate your shaded driver and use that. Or live with the workaround and use thw outdated one

tender shard
#

Great!

slender elbow
sleek estuary
tender shard
slender elbow
#

YEP

sleek estuary
#

what is jni?

tender shard
#

Native shit

sleek estuary
tender shard
#

JNI means java calling non-java code

#

(More or less)

sleek estuary
tender shard
#

According to Emily, i dont know myself, it means you cant shade or relocate a newer sqlite jdbc

eternal oxide
#

pretty sure you can't relocate sqlite due to natives

slender elbow
#

yeah

tender shard
#

Solution: dont use 1.8.8, use 1.21 or 1.20.4

sleek estuary
#

I can't allocate sqlite in the plugin because spigot has already allocated it?

eternal oxide
#

correct

sleek estuary
tender shard
#

Why do you need a newer sqlite jdbc?

sleek estuary
#

ok, I will use the mfnalex alternative. Thank you both for your help

tender shard
#

Np!

sleek estuary
wintry elk
#

can someone explain how to get the lore of an item because all the ways ive tried just dont work

sleek estuary