#help-development

1 messages · Page 1075 of 1

quiet ice
#

I checked once a few years ago and they were clean

chrome beacon
#

They'd get a lot of infected systems if they did

blazing ocean
#

damn

#

blocked word

quiet ice
#

You must be getting so many warnings by now lol

runic pine
#

OMG! guess what happened

blazing ocean
#

not warnings (i hope)

quiet ice
runic pine
runic pine
#

If I don't put this line the compiler runs with any other version even if it is in 22

#

that's why I use this line

quiet ice
#

Yeah I know gradle well enough to know what these lines do

runic pine
#

So you made a mistake because the Java version changed, but the problem persists. 🤡

runic pine
quiet ice
#

But it would narrow down the faulty java version hypothesis, but that's not the thing here

runic pine
#

but it's worth remembering that I suffer from this problem in maven too

quiet ice
#

Are you SURE that lombok is compatible with J22?

blazing ocean
#

why do you even need to use J22

quiet ice
runic pine
#

i used yesterday

runic pine
#

only if the lombok crazies accessed my pc and changed it to a version without me knowing

#

and I have also tested it on Java 17, 21 etc.

runic pine
#

why te emoji @blazing ocean

blazing ocean
#

why even use 1.8

runic pine
#

I'm getting scared

quiet ice
#

Yeah, then I have one hypothesis remaining on that front, lemme see if I can find a way to invalidate that hypothesis

runic pine
#

You suddenly guess the name of my Windows

#

and keeps sending those hacker emojis

blazing ocean
earnest girder
#

I ran buildtools and it gave me spigot 1.20.6

blazing ocean
#

what version are you trying to get

runic pine
blazing ocean
#

right because there are none

#

there is no reason to keep 1.8 updated lmfao

quiet ice
#

That JavaCompile is for some ungodly reason not configured to run the lombok AP

runic pine
wet breach
quiet ice
#

Ah yes, custom mc servers

blazing ocean
#

choco rn:

wet breach
#

Like if you wanted a good base to implement your own fork for example and want a swerver with not much on it

quiet ice
#

Minestom is great tho

blazing ocean
#

forking 1.8 is a PITA because of dmca tho

wet breach
blazing ocean
#

wdym

runic pine
#

compare hosting prices brother

quiet ice
#

Only way I could think of that would invalidate it would be

tasks.withType(JavaCompile).configureEach {
    //enable compilation in a separate daemon process
    options.fork = true
}

however to invalidate it you'd need to look a bit into the build output when running with --debug, but the debug output contains confidential information and thus shouldn't be sent over the internet

blazing ocean
quiet ice
blazing ocean
#

no sane host charges you based on version

wet breach
#

1.8 doesnt have much in terms of code in regards to entities and logic what have you. This makes it optimal base platform to add things you need or want and good for a bare hub server etc

runic pine
quiet ice
#

yeah

runic pine
quiet ice
blazing ocean
#

sure if you do the right optimisations

runic pine
#

what is minestom

blazing ocean
#

you won't be able to do that with 1.8 OOTB tho

quiet ice
#

Or Folia

wet breach
blazing ocean
#

folia requires at least 16 cores iirc

runic pine
quiet ice
#

Well yea

wet breach
#

1k players on a single server was accomplished way back in 1.7 days

runic pine
blazing ocean
runic pine
#

take advantage and leave java

blazing ocean
#

also "4th generation intel processor" says basically nothnig

#

that could be anything

quiet ice
#

I have no idea what those numbers even mean

runic pine
#

paper fork

wet breach
#

Yeah it only gives a range of cpus lol

runic pine
#

but with paper its possiblet oo

blazing ocean
runic pine
#

try this

#

with paper

#

on 1.20

#

then

blazing ocean
#

regular default spigot 1.8 server
"pandaspigot"

runic pine
#

and i try on 1.8

quiet ice
#

You'd try it out with Folia either way

runic pine
quiet ice
#

Make it an apples to apples comparision

blazing ocean
#

i don't have 1000 players to join a server rq :p

runic pine
#

do this in paper at 1.20 then

runic pine
blazing ocean
blazing ocean
#

and also

#

if you need 1000 players on one server

#

you're doing something wrong

torn shuttle
#

yeah

#

you should really be aiming for 10000

blazing ocean
#

^

runic pine
blazing ocean
#

why do you need 1000 players to play on ONE server

quiet ice
runic pine
#

in an open world are you going to make separate servers?

blazing ocean
#

reliably and stable

blazing ocean
#

and folia

quiet ice
torn shuttle
runic pine
quiet ice
#

Just a shitton of cores

blazing ocean
#

just realise that you will need a good cpu to handle 1000 players lmao

torn shuttle
#

to be fair though if mc was built for it from the ground up it really wouldn't take that much processing power

#

but ya know

#

it definitely isn't

blazing ocean
runic pine
quiet ice
#

However at 100+ concurrent players you'll make so much money that you probably don't need to be worrying about the server hosting costs

blazing ocean
torn shuttle
#

you guys think we'll ever get vertical chunks

#

that would be so sick

young knoll
#

I mean

young knoll
#

Technically already a thing

#

But only for render culling

#

(And other internal logistics)

torn shuttle
#

yeah but I want it to be a real, real thing

quiet ice
torn shuttle
#

infinite up infinite down

runic pine
#

ok

blazing ocean
torn shuttle
#

come on mojang don't be cowards

blazing ocean
runic pine
#

tasks.withType<JavaCompile>().configureEach {
// enable compilation in a separate daemon process
options.isFork = true
}

#

gpt translated for me

#

thanks rad

#

hacker

#

❤️

blazing ocean
#

is kotlin not real

quiet ice
#

I have no idea whether kotlin script and kotlin is the same language

runic pine
#

yes

runic pine
#

what is kinda

#

querida?

#

dear?

blazing ocean
#

runic pine
#

what is kinda

blazing ocean
#

it means kind of

quiet ice
#

kindof

torn shuttle
#

hey augusto are you portuguese

quiet ice
torn shuttle
#

god damn it

runic pine
blazing ocean
#

kekw

runic pine
#

other hacker

#

??

torn shuttle
#

now I really want him banned

blazing ocean
#

magma is hacking once again

blazing ocean
runic pine
#

banned why wttf

#

you are messi?

blazing ocean
#

isn't it kinda funny how

runic pine
#

im messi fan too

blazing ocean
#

there have been three people called gongas all working on a pandaspigot 1.8 mc server called twinsmc

torn shuttle
#

what a coincidence

runic pine
#

It's just a coincidence

#

@quiet ice

#

What data is exposed?

#

on debug gradle xcmd

earnest girder
#

why do I keep getting "can't invote .setMaxStackSize because meta is null"?

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        System.out.println(event.getCurrentItem() + "          " + event.getCursor());

        ItemStack item1 = event.getCurrentItem();
        if(item1.getType() == Material.POTION) {

            ItemMeta meta = item1.getItemMeta();
            meta.setMaxStackSize(64);

            item1.setItemMeta(meta);
        }

        ItemStack item2 = event.getCursor();
        if(item1.getType() == Material.POTION) {

            ItemMeta meta = item2.getItemMeta();
            meta.setMaxStackSize(64);

            item2.setItemMeta(meta);
        }
    }

Here is console output: ItemStack{POTION x 1, POTION_META:{meta-type=POTION, potion-type=minecraft:swiftness, custom-effects=[]}} ItemStack{AIR x 1}

Shouldn't the meta not be null if the type is Material.POTION?

runic pine
#

if(item1.getType() == Material.POTION) {

        ItemMeta meta = item2.getItemMeta();
young knoll
#

It’s not null

runic pine
#

item1

quiet ice
runic pine
#

and after item2

quiet ice
#

signature gpg keyphrases are probably also included in there

torn shuttle
#
    public SetupToggleCommand() {
        super(List.of("setup"),
                Stream.concat(
                        Stream.of("toggle"),
                        EMPackage.getEmPackages().values().stream().map(emPackage -> emPackage.getDungeonPackagerConfigFields().getFilename())
                ).collect(Collectors.toList()),
                "Toggles the installation of specific content.",
                "elitemobs.*",
                true,
                "/em setup toggle <content_filename.yml>");
    }

last try before I give up and just go make a proper class, any way I can make a list on a single line that takes in lists as an argument without flattening it?

quiet ice
#

I mean, it's a debug command

blazing ocean
#

what's the command

quiet ice
#

And it explicitly tells you follows:

2024-07-23T00:50:27.588+0200 [LIFECYCLE] [org.gradle.launcher.cli.DebugLoggerWarningAction] 
#############################################################################
   WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

   Debug level logging will leak security sensitive information!

   For more details, please refer to https://docs.gradle.org/8.7/userguide/logging.html#sec:debug_security in the Gradle documentation.
#############################################################################
torn shuttle
#

man I can already tell that this is going to end up with a really filthy builder pattern too

quiet ice
blazing ocean
mortal hare
#

any good ways to hook into registry update code in Minecraft client code

quiet ice
#

./gradlew --debug build?

mortal hare
#

cant seem find proper way to hook in a way that my code would run when one of the dynamic registries updates

runic pine
blazing ocean
#

nope, just a bad interpreter

runic pine
#

geol see dm pls

blazing ocean
#

windows moment maybe

mortal hare
runic pine
#

i send yout he debug

quiet ice
#

Well your IDE probably also allows you to pass access flags to gradle but yea

mortal hare
#

i've had this before

blazing ocean
#

i'm on windows atm

mortal hare
#

convert your file from windows line ending to unix

blazing ocean
#

so yea

#

i don't use windows for dev anyway

#

so idrc 🤷

mortal hare
#

what's the packet name of this in moj mappings

#

or yarn?

blazing ocean
#

?mappings

undone axleBOT
mortal hare
mortal hare
earnest girder
blazing ocean
#

just look for Client|Serverbound....Packet

#

or (?:Client|Server).*Packet afaik

#

damn i'm getting decent at regex

inner ridge
#

hi is it normal that when i add an AttributeModifier to an ItemMeta it overwrite every others AttributesModifiers (for an armor or a tool for exemple) ?

blazing ocean
quiet ice
inner ridge
young knoll
#

Material#getDefaultAttributeModifiers iirc

inner ridge
#

ok it's material not itemstack

#

i'm gona try thanks you

runic pine
quiet ice
#

You could try to add -proc:full, but that should be the default

#

-verbose might also help to debug javac further

runic pine
#

?

#

oh no

#

wait

quiet ice
#

no, it's defined in the JavaCompile task

runic pine
#

./gradlew build --debug -proc:full -verbose

#

yes yes

#

this?

quiet ice
#

no

#

You need to modify the build.gradle again

vast ledge
#

It looks like you're talkign to yourself

worthy yarrow
#

What can you not see unverified people?

vast ledge
#

idk

#

who's sending messages?

quiet ice
#

options.verbose = true and options.compilerArgs += "-proc:full"

worthy yarrow
vast ledge
#

My discord is racist, if you're not verified it wont show you

vast ledge
# worthy yarrow

Oh that guy, i blocked him, ig i cant see the user blocked messages

runic pine
quiet ice
# worthy yarrow

they've blocked them and probably are using a discord modification for fully nuking them

worthy yarrow
#

Ah lol

vast ledge
#

I dont even remember addign that

worthy yarrow
#

Looks cool haha

quiet ice
#

IRC-style

vast ledge
#

Ah

#

found it

worthy yarrow
#

What in the hell

#

Discord clients are crazy

young knoll
#

Modded client detected

#

Execute

vast ledge
#

what

#

no

#

defenetly not

#

lies

worthy yarrow
#

jail time

vast ledge
#

cocain

#

that

#

halucination

#

definetly

runic pine
vast ledge
#

i just watched a space be added

worthy yarrow
#

kek

vast ledge
#

so that happens when it hides the message ig

worthy yarrow
#

Useful addition tho, I always find myself still reading the blocked peoples messages

#

the "blocked" makes it so much more appealing idk why

vast ledge
#

I was wondering why it was so quite :-:

quiet ice
#

I just use blocked messages as a reminder to not help a given person

vast ledge
#

xD

worthy yarrow
#

Fair enough kek

vast ledge
#

if you can't see em, you cant help em

#

even better

quiet ice
#

Usually awarded to jerks or total idiots

worthy yarrow
#

I'm a total idiot but can at least listen to and follow direction

worthy yarrow
#

Not coding in console rad

blazing ocean
#

you are refusing to learn to code in console

vast ledge
#

That seems to be a rather rare trait in the newer people .-.

blazing ocean
worthy yarrow
vast ledge
#

nano is fine

#

but vim

blazing ocean
#

i love vim

vast ledge
#

.-.

quiet ice
# runic pine idk how modify
 tasks.withType<JavaCompile>().configureEach {
    options.isFork = true
    options.verbose = true
    options.compilerArgs.add("-proc:full")
}

Though take it with a grain of salt, I am a dunce when it comes to writing kotlin code (groovy supremacy here)

blazing ocean
#

vim is great

#

lgtm

worthy yarrow
#

rad just likes to bully me ig

vast ledge
#

#nanoisbetter

worthy yarrow
#

Helped him one time with testing or something and now he's like my fcking father

quiet ice
#

I've so far not seen people main nano

#

Though for quick edits nano is cool

vast ledge
#

ye

#

i dont like writing in console

#

it feels

blazing ocean
#

lazyvim tho

vast ledge
#

idk clunky

quiet ice
#

Though by now I've accustomed myself to both

blazing ocean
#

nano is cli too 🤨

vast ledge
#

but i dont code in cli

worthy yarrow
#

Ikr

quiet ice
#

Only emacs remains

blazing ocean
young knoll
#

Who tf codes in cli

blazing ocean
#

i use vim for rust

#

it's great

worthy yarrow
#

I love making things harder on myself, every edit no matter the size has to be done in the ide or its a no go man

vast ledge
#

oof, thats a statement

quiet ice
blazing ocean
#

yup

#

with vim i just mean neovim

#

nobody really still uses regular vim

runic pine
vast ledge
#

i dont have either install ._.

young knoll
#

Smh go back to 1985 and code for the NES with your CLI

worthy yarrow
#

no

blazing ocean
#

smh my head

quiet ice
blazing ocean
#

arch had vi preinstalled iirc

#

not nano, not vim, not nvim

quiet ice
#

ChatGPT will probably be of better help than I am

worthy yarrow
#

... lies

blazing ocean
#

i haven'T installed nano to this day lol

worthy yarrow
#

geol has the knowledge 100%

#

he cannot be stumped

vast ledge
young knoll
#

That’s what they did!

vast ledge
#

Ik

blazing ocean
vast ledge
#

but since our friend @blazing ocean is so keen on being a grampa, he should probably write assembly ._.

blazing ocean
#

grampa 🤨

#

since when do grampas use arch

#

(btw)

vast ledge
#

that word looks wrong

#

idk if its written correctly

blazing ocean
#

grandpa

worthy yarrow
#

Bet grandmas know how to arch :p

vast ledge
#

oof

worthy yarrow
wet breach
blazing ocean
#

we cannot beat frostalf with gifs

runic pine
young knoll
#

Grandpas used dos

worthy yarrow
#

I've only got 2 favorited

wet breach
runic pine
#

tasks.withType<JavaCompile>().configureEach {
options.isFork = true
options.compilerArgs.addAll(listOf("-verbose", "-proc:full"))
}

#

gpt send me this

wet breach
#

I manually look up gifs to use lol

blazing ocean
worthy yarrow
#

But the two favorited are somewhat applicable to anything

blazing ocean
#

nobody finds macking cheese from the michael wave

worthy yarrow
#

macking cheese is getting old

blazing ocean
#

no 😭

remote swallow
#

rad

blazing ocean
#

ebic

remote swallow
#

you have 2 macking cheese gifs

vast ledge
blazing ocean
#

i have four

remote swallow
#

i have one favourited and its diff

worthy yarrow
worthy yarrow
vast ledge
#

I'm hungary

worthy yarrow
#

Why do they do this

#

You're old and you know it just accept it smh

blazing ocean
wet breach
runic pine
runic pine
#

and what command i execute now?

runic pine
#

./gradlew build --debug ?

wet breach
quiet ice
#

ye

vast ledge
#

I need a stabbing utensile

worthy yarrow
wet breach
olive lance
#

Can I compile my plugin against 1.21 which uses HASTE (the name changed from fast_digging) but still have it work on 1.20?

wet breach
#

Hopefully it will pass lol

olive lance
#

Or I guess I need to compile against 1.20 and it should work on 1.21

young knoll
#

You can only do the other way around

remote swallow
#

compile against 1.20 and it will work on 1.21

olive lance
#

Ok ok thank you

young knoll
quiet ice
#

Too much work

worthy yarrow
# wet breach Hopefully it will pass lol

Dude I kid you not, the other day at the water park me and girlfriend were in the lazy river with tubes, this kid swims up.... tickles my feet... then says "Skibidi Rizz fr bro" then swam off...

vast ledge
blazing ocean
#

yeah you really need a module with a provider and an abstract class, need an abstract factory provider too here

quiet ice
#

Gotta write the gradle buildscripts and all

vast ledge
#

Assaul

#

Assailt

blazing ocean
vast ledge
#

Assault*

wet breach
worthy yarrow
#

No

quiet ice
cedar saffron
#

:/

worthy yarrow
#

She's latina and short

blazing ocean
#

i love this discord

vast ledge
blazing ocean
#

i codeed nothing today but mostly chilled on here

vast ledge
#

^

quiet ice
young knoll
#

No girlfriends allowed

vast ledge
#

tf

#

no

vast ledge
young knoll
#

Unless you brought enough girlfriends to share with the class

worthy yarrow
quiet ice
#

I have no idea what that even means

blazing ocean
wet breach
worthy yarrow
#

I need spoonfeed

quiet ice
blazing ocean
#

i'll spoonfeed you once you learn to code in console

vast ledge
#

nah

worthy yarrow
#

I don't need your spoonfeed rad

vast ledge
#

ill spoondfeed your console before i do that

quiet ice
#

And well, evidently it's starting to get too late for me anyways

worthy yarrow
#

You friggen kotlin weirdo

blazing ocean
wet breach
blazing ocean
#

you always need me to code in conslle

runic pine
#

@quiet ice i sent on dm

vast ledge
#

Just dont code in console

worthy yarrow
blazing ocean
#

it's an inside joke

vast ledge
#

You're right, I dont

worthy yarrow
#

It's a big inside joke kek

vast ledge
#

._.

#

We ignored the poor guy that asked for help

worthy yarrow
#

I think me and rad are the only ones with context to the code in console joke lol

wet breach
#

Way back in the 90's it was required in programming to learn to program in binary. I remember my moms book of games you can program in binary lmao

#

Took forever to do that

vast ledge
#

understandable

blazing ocean
#

he was in the vc too

worthy yarrow
#

I hope he remembers

wet breach
#

Also if you make an error it was incredibly hard to spot

quiet ice
# runic pine <@755527678433427546> i sent on dm

Yeah, no idea. It looks as if the AP doesn't run, but I despise APs so much that I have no experience with debugging such issues. Hell - I generally prefer it if they don't run, but in that case you can't exactly not run it

blazing ocean
worthy yarrow
#

If anything that shit was a whole skit

blazing ocean
#

real

earnest girder
#

why do I keep getting "can't invote .setMaxStackSize because meta is null"?

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        System.out.println(event.getCurrentItem() + "          " + event.getCursor());

        ItemStack item1 = event.getCurrentItem();
        if(item1.getType() == Material.POTION) {

            ItemMeta meta = item1.getItemMeta();
            meta.setMaxStackSize(64);

            item1.setItemMeta(meta);
        }

        ItemStack item2 = event.getCursor();
        if(item1.getType() == Material.POTION) {

            ItemMeta meta = item2.getItemMeta();
            meta.setMaxStackSize(64);

            item2.setItemMeta(meta);
        }
    }

Here is console output: ItemStack{POTION x 1, POTION_META:{meta-type=POTION, potion-type=minecraft:swiftness, custom-effects=[]}} ItemStack{AIR x 1}

Shouldn't the meta not be null if the type is Material.POTION?

vast ledge
#

At this point he could've actually just written the friggin getters and setters by hand

worthy yarrow
blazing ocean
#

yea

#

💀

worthy yarrow
#

I got cooked tho he pulled my whole DyNaMiC iP

blazing ocean
#

yea :sk

vast ledge
#

Dynamic IP?

#

....

worthy yarrow
#

apart of the joke

blazing ocean
#

bro thought he doxxed him

runic pine
#

I'll have to remove the lombok manually anyway

vast ledge
#

oof

#

here have an IP 152.53.30.250

#

idk who it is

quiet ice
vast ledge
#

idk who it belongs to

#

but

worthy yarrow
#

I'd been more impressed by a google picture of my house but eh hope in one hand shit in the other

chrome beacon
#

the second one*

wet breach
blazing ocean
#

read the fucking manual

worthy yarrow
#

Real time future manuscript

drowsy helm
wet breach
#

I have a custom refactor setting to make setters and getters

vast ledge
worthy yarrow
#

Arrest him

torn shuttle
#
    public SetupToggleCommand() {
        super(List.of("setup"),
                SkibidiArgument.skibidiInit().skibidiAddString("toggle").skibidiAddList(EMPackage.getEmPackages().values().stream().map(emPackage -> emPackage.getDungeonPackagerConfigFields().getFilename()).collect(Collectors.toUnmodifiableList())).skibidiFlushToilet(),
                "Toggles the installation of specific content.",
                "elitemobs.*",
                true,
                "/em setup toggle <content_filename.yml>");
    }

Flawless code!

blazing ocean
#

here, have an ip: 192.168.0.3

vast ledge
#

Nah nah

#

have my ip

#

192.168.0.113

#

or have my network switch

worthy yarrow
#

...

blazing ocean
#

i'll tell you mine

vast ledge
#

192.168.0.111

worthy yarrow
#

it wont let me put a skull

quiet ice
#

Here: My IP: 2a02:b98:f181:2ddc:89af:2550:95c4:57e

blazing ocean
#

10.186.23.5

vast ledge
#

Even better ip

blazing ocean
vast ledge
#

192.168.0.1

worthy yarrow
runic pine
#

my ip is 192.0.0.1

blazing ocean
#

no

drowsy helm
#

Gradle build -x

eternal oxide
#

Bedless is a router

torn shuttle
#

I paid for a vanity IP actually, it's "localhost"

vast ledge
#

I'm officially a router

torn shuttle
#

it's like vanity plates for ip

blazing ocean
#

i OWN dns

worthy yarrow
#

"Show ips"

blazing ocean
#

my domain is "rad"

torn shuttle
quiet ice
#

I really need to configure my rDNS one of these days

vast ledge
#

Im also in shenzen supposedly

echo basalt
torn shuttle
#

that's why I'm the best in the biz

blazing ocean
drowsy helm
runic pine
#

@echo basalt you use lombok?

drowsy helm
#

Mb

echo basalt
#

why me

blazing ocean
#

what did he do to you

runic pine
torn shuttle
#

oh yeah illusion meet the new worst portuguese dev on here

vast ledge
echo basalt
#

I worked at akuma for a couple months

torn shuttle
#

except not really new but wahtever

worthy yarrow
blazing ocean
#

ah yeah same

runic pine
rigid loom
#

how do i remove a player from a hashmap that they are a member of?

echo basalt
#

Anyways I use lombok but I've been making an effort to use it less

runic pine
worthy yarrow
vast ledge
#

hashmap.remove(key)

drowsy helm
quiet ice
worthy yarrow
#

^

rigid loom
#

it doesn't do anything for some reason

echo basalt
vast ledge
worthy yarrow
runic pine
quiet ice
#

Just join a random IRC channel

rigid loom
echo basalt
quiet ice
echo basalt
#

although I believe the proper method is to use a gradle plugin

runic pine
#

but no works

vast ledge
echo basalt
#

Make sure that the version of lombok you're using is supported by your java version

quiet ice
#

Gradle plugin would result in random dependency resolution issues

runic pine
echo basalt
#

So something like 1.18.24 won't be recognized by java21 and will throw nasty errors while 1.18.34 works

drowsy helm
rigid loom
runic pine
#

i used 1.18.34 and java 22, 17 and 21

#

and no works

drowsy helm
#

Oh? That should work fine

blazing ocean
drowsy helm
#

Can you send code

olive lance
#

Can optic make my premium plugin into free so that way all the version history is not lost?

worthy yarrow
#

Yeah why not just id

rigid loom
#

cause im weird like that

drowsy helm
#

But yeah as string is sorta weirs lol

worthy yarrow
#

Just use the uuid object

torn shuttle
#

alright now that I have my skibidi code I can actually start making these commands

#

it's

#

okay-ish

vast ledge
#

got that gyat

worthy yarrow
#

What's this plugin for btw

vast ledge
#

/execute self

blazing ocean
#

lmfao

#

goddamn sonatype was down a bit ago

drowsy helm
worthy yarrow
#

oh dear

rigid loom
torn shuttle
#

me migrating out of sonatype

#

sonatype deez nuts

worthy yarrow
blazing ocean
#

me using my own repo for a while now

worthy yarrow
#

hunger games?

blazing ocean
#

used to use jitpack 💀

rigid loom
#

not that

#

Kingdoms

echo basalt
#

I remember importing an mcmmo version that had some dependency on an old version of worldguard that no longer exists

#

and it taking 5 fucking minutes to index

worthy yarrow
#

Hmm I only remember that guy from hunger games

torn shuttle
#

seem reasonable

#

you get paid by the hour anyway

rigid loom
#

and sparklez was the only notable person i remember streaming it

runic pine
#

lombok 1.18.34 and java 22 the compiler does not recognize lombok. Do you know what it could be? imllusion

worthy yarrow
#

So I assume kingdoms is somewhat like factions?

echo basalt
echo basalt
#

this was a commission project to update some crappy plugin to 1.21

torn shuttle
#

uh oh

echo basalt
#

But I resold the update :) so I made my money back

torn shuttle
#

that reminds me

#

I owe one such commission

#

eh how bad can it be

echo basalt
#

Got a couple going on

#

and a whole minigame to launch tomorrow night

torn shuttle
#

bet you have a pizza in the oven rn

worthy yarrow
#

You guys need a duck to complain to? Let me know I've got a bag of them

echo basalt
torn shuttle
#

ok so did you stop eating greasy chicken because you're now squatting in the attic of a pizzaria or something

#

you've had more pizza in the last 7 days than I've had in the last 7 years

echo basalt
#

I mounted an air conditioner with my dad on the building next to the pizzeria

torn shuttle
#

I knew it he's living inside the walls of a pizza shop

echo basalt
#

it was for some old lady

torn shuttle
#

that reminds me

#

I'm starting to creep up to my target weight

#

I'm going to have to find new goals

#

maybe I can still do a 450 press before the end of the year

worthy yarrow
#

Whats the body fat level

#

Trimmable at all? Maybe that can be a goal

torn shuttle
#

I don't have any accurate way of measuring it and I don't really care outside of just having it at a reasonably low level

worthy yarrow
#

fair enough

torn shuttle
#

still have a couple of months left to go though so not a rush either

wet breach
#

Gives you an idea

torn shuttle
#

yeah a bad one

#

also I do have a bioimpedence scale, it's just they're not that accurate

echo basalt
#

bmi my beloved

wet breach
#

Wouldnt say BMI standard is bad

echo basalt
#

10kg of muscle or 10kg of fat is 10kg either way

#

absolutely shredded? obese.

torn shuttle
#

it's bad if you're going 3.5 times a week to the gym and have a diet made for nothing but build muscle

#

the gym is full of bodybuilders that are obese by bmi standards

wet breach
#

Not if you do it properly

torn shuttle
#

...

wet breach
#

If you go by height and weight sure

#

But you are supposed to take measurements

torn shuttle
#

then it's not bmi

rigid loom
#

for some reason java v if (plugin.getChatFocus().get(player.getUniqueId().toString()).equalsIgnoreCase("STAFF")) { if (plugin.getStaff().containsKey(player.getUniqueId().toString())) { for (Player p : Bukkit.getOnlinePlayers()) { if (plugin.getStaff().containsKey(p.getUniqueId().toString())) { if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.DARK_AQUA.toString() + ChatColor.BOLD + Rank.JRMOD.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.DARK_AQUA + ChatColor.BOLD + Rank.JRMOD + " " + ChatColor.DARK_AQUA + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.YELLOW.toString() + ChatColor.BOLD + Rank.MOD.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.YELLOW + ChatColor.BOLD + Rank.MOD + " " + ChatColor.YELLOW + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.GOLD.toString() + ChatColor.BOLD + Rank.SRMOD.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.GOLD + ChatColor.BOLD + Rank.SRMOD + " " + ChatColor.GOLD + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.DARK_RED.toString() + ChatColor.BOLD + Rank.JRADMIN.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.DARK_RED + ChatColor.BOLD + Rank.JRADMIN + " " + ChatColor.LIGHT_PURPLE + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.DARK_RED.toString() + ChatColor.BOLD + Rank.ADMIN)) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.DARK_RED + ChatColor.BOLD + Rank.ADMIN + " " + ChatColor.LIGHT_PURPLE + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } event.setMessage(eventMessage); } } } } doesn't work

torn shuttle
#

bmi is a specific formula

rigid loom
#

it sends the message publicly

torn shuttle
#

weight / height (squared) iirc

rigid loom
chrome beacon
torn shuttle
#

I do assume that because I live in a real country that uses real units

chrome beacon
#

otherwise it's weight / height^2 x 703

hard socket
#

?nms

earnest girder
#

does BlockSpreadEvent#getSource() actually return the source mushroom block for mushrooms that spread?

#

because it's giving me air

#

and I want the original mushroom block

drowsy helm
#

i thjink i messed up

nova notch
#

why is it 99

young knoll
#

Why not

drowsy helm
#

guess i have to do it in chunks

blazing robin
#

hello guys, im creating a region bgm plugin, and I've got a problem

   @EventHandler
    public void onRegionEnter(RegionEnterEvent event) {
        Region region = event.getRegion();
        Player player = event.getPlayer();

        if (region != null) {
            player.playSound(player, Sound.MUSIC_DISC_5, 1, 1);
        }
    }

    @EventHandler
    public void onRegionLeave(RegionLeaveEvent event) {
        Player player = event.getPlayer();

        player.stopSound(Sound.MUSIC_DISC_5);
    }

it works very well but I wanna fade out when it's stop sound how can I do this?

subtle folio
blazing robin
blazing robin
subtle folio
blazing robin
drowsy helm
#

pretty sure once the packet is sent, you can't change it

alpine cairn
#

I'm trying to update an outdated plugin but it seems there is no longer an available API for one of its dependencies. How can I manually add the plugin as a dependency using the jar?

subtle folio
alpine cairn
subtle folio
inner mulch
#

guys im coding stats, should i make a Map<Stat,Double> or should every stat have its own field?

some stats might want to have their own field, so that when accessing the getter or the setter code can be executed, but on the other hand a map is much better to expand on the stats

subtle folio
#

depends what your use case is, do you plan on persisting these stats in a database? are all your stats doubles?

inner mulch
#

no and yes

subtle folio
#

then I see no issue with using a map 🤷

#

As your data gets more complicated though, you would definetely be better off using a record or a POJO

inner mulch
#

so a pojo with fields?

subtle folio
#

yep

wet breach
quaint mantle
#

What would be the best way to have a chain that rises? I want this to end at a certain block so it just kind of goes into a block and disappears, should I have a bunch of small block displays that move slowly up and hide each of them at the exact right time

wet breach
#

This way its a single display and no need to remove or add displays all the time

#

And the way i would do it is using custom fonts

#

So each font is a different length of chain

quaint mantle
#

I was going to use a block display

wet breach
wet breach
#

Then where does the chain come from?

quaint mantle
drowsy helm
subtle folio
#

oops

#
Minecraft Wiki

Chains are metallic decoration blocks. Chains can be mined using any pickaxe. If mined without a pickaxe, it drops nothing. Chains generate in bastion remnants and sometimes in ruined portals that...

wet breach
#

Well a chain is less then a block, so yeah it would partially enter the block. Before it gets to the top of the block you can remove it

#

Shouldnt be able to see it if done that way

quaint mantle
#

So the best way would to spawn like 25 of them in a stack and move them each up a certain amount in intervels then hide it

wet breach
#

Yep

#

So move it up like .85 on y and when it hits that value in intervals remove one

#

Not sure on the exact length of a chain. And it doesnt specify on the wiki either

#

So i think .85 distance is a good starting value

quaint mantle
#

yeah I'll just play around with the magic values

drowsy helm
#

public class CustomItemChoice implements RecipeChoice {

..other shit
    @Override
    public boolean test(@NotNull ItemStack itemStack) {
        CustomItemType type = ItemManager.getItemType(itemStack);

        if(type == null)
            return false;

        Iterator<CustomItemType> var2 = this.choices.iterator();

        CustomItemType match;
        do {
            if (!var2.hasNext()) {
                return false;
            }

            match = var2.next();
        } while(match != type);

        return true;
    }
}

gives me

.IllegalArgumentException: Unknown recipe stack instance com.mitchg.dev.sritems.item.crafting.CustomItemChoice@6e5d5b0d am I just not allowed to use my own recipe choice or can i register it somewhere?

wooden zodiac
#

hello people I need quick help

I want to make command which hides all operator command output from other operators like if I use /gamemode command it doesnt broadcast the message that DINOxANAS changed gamemode to creative to other people

#

what method or event handler i can use to make it work?

agile anvil
#

This is a server setting

wooden zodiac
#

which gamerule

agile anvil
#

"broadcast-console-to-ops=true" in server.properties

blazing robin
#

hey guys is there any way to play mp3?

vital sandal
#

convert to note block sound and play the note in correct pitch and volume

hexed quarry
#

Why is it not working? ```package com.example.loginplugin;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;

public class CommandListener implements Listener {

private final LoginPlugin plugin;

public CommandListener(LoginPlugin plugin) {
    this.plugin = plugin;
}

@EventHandler
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
    if (event.getMessage().toLowerCase().startsWith("/login")) {
        String playerName = event.getPlayer().getName();
        plugin.getLogger().info(playerName + " used the /login command.");
        event.setMessage("/login ***"); // Hide the actual password
    }
}

} package com.example.loginplugin;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.UUID;

public class LoginPlugin extends JavaPlugin {

private final HashMap<UUID, Boolean> loggedInPlayers = new HashMap<>();

@Override
public void onEnable() {
    getServer().getPluginManager().registerEvents(new PlayerLoginListener(this), this);
    getServer().getPluginManager().registerEvents(new PlayerQuestListener(this), this);
    getServer().getPluginManager().registerEvents(new CommandListener(this), this);
    getCommand("login").setExecutor((sender, command, label, args) -> {
        if (!(sender instanceof Player)) {
            sender.sendMessage("This command can only be used by players.");
            return true;
        }
        if (args.length != 1) {
            sender.sendMessage("Usage: /login <password>");
            return true;
        }
        // some more login code here 
        return true;
    });
}

public boolean isLoggedIn(Player player) {
    return loggedInPlayers.getOrDefault(player.getUniqueId(), false);
}

public void logOut(Player player) {
    loggedInPlayers.remove(player.getUniqueId());
}

}```

blazing robin
# vital sandal convert to note block sound and play the note in correct pitch and volume

what if i use this ?

       File file = new File("myfile.mp3");
        file = file.getAbsoluteFile();


        try {
            AudioInputStream stream = AudioSystem.getAudioInputStream(file);
            Clip clip = AudioSystem.getClip();
            clip.open(stream);
            clip.start();
        } catch (LineUnavailableException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (UnsupportedAudioFileException e) {
            throw new RuntimeException(e);
        }
vital sandal
blazing robin
#

ahh

nova notch
#

i think you might even be able to add custom sounds but i dont remember that much

vital sandal
nova notch
#

well its either that or note blocks which dont sound nearly as good

vital sandal
vital sandal
#

you can see some of video of note block playing with barely correction

nova notch
#

it depends, theres a lot of sounds note blocks simply cant reproduce

vital sandal
#

Sound is just a bunch of pitch

nova notch
#

anyway just a suggestion

vital sandal
#

you can add as much layer as you can

#

that is the way to correctly reproduce a music or etc

nova notch
#

well i dont know what their use case is but something like vocals wouldnt work with note block sounds

vital sandal
#

most of sound is missing bass or drum which can still be added in minecraft

hexed quarry
# vital sandal this isn't the way you register a command

The command works correctly, I registered it in various ways, but the password is not hidden from the server console. ```@Override
public void onEnable() {
saveDefaultConfig();
loadUsersConfig();

    discordUtils = new DiscordUtils(this);
    loggedInPlayers = new HashSet<>();
    inventories = new HashMap<>();
    playerLocations = new HashMap<>();


    getCommand("login").setExecutor(new LoginCommand(this));
    getCommand("register").setExecutor(new RegisterCommand(this));
    getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
    getCommand("exiva").setExecutor(new ExivaCommand());
    getCommand("discordId").setExecutor(new DiscordIdCommand(this));
    getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
    getServer().getPluginManager().registerEvents(new CommandsListener(this), this);
    getServer().getScheduler().scheduleSyncRepeatingTask(this, this::updateBotDescription, 0L, 1200L); // 1200 ticks = 1 minute




}```
vital sandal
#

for vocal it is too much stuffs to handle so it be nearly impossible.

vital sandal
hexed quarry
vital sandal
#

eventually you can change it in the spigot.yml

hexed quarry
#

I've read that the best way is onPlayerCommand Preprocess

vital sandal
#

just set the commandlog to false

hexed quarry
#

I don't want to throw out all logging commands, only those for logging in, registering, and changing the password. I would use authMe, but my login is linked to the gamer's discord account

#

In short, I'm making, a server for players who are on my Discord and need to connect their Discord account. If someone does not have a discord account and does not belong to the discord server, they cannot play. I don't want server operators to see user passwords in the console while working with it.

#

Everything works fine except for this one thing. I tested various examples from the Internet, those with filters and with onPlayerCommand Preprocess, but it seems that none of them work properly. The password is always shown in the console.

tidal finch
#

Hi, I am working on plugin themed around Greek Gods and I am adding abilities each role has. For Hades I had this idea of player throwing splash potion on the ground and it creating portal to nether made out of particles at hit area. My question is if it is possible to create some sort of shapes out of particles using just plugins? Circle for example. I have made circumference of area of effect particle indicators for different abilities but those are large so I can just spawn particle above each block but here I would like to be able to create shape in small area. At this point all I managed to do is spawn a bunch of particles, play nether portal sound, and teleporting player to nether.

drowsy helm
#

There are a few tutorials out there if you google it

tidal finch
hexed quarry
#

What are all the methods for PluginManagement? Such as onPlyerJoin, onPlayerLeave, onPlayerCommand. Where can I find the full list?

eternal oxide
#

?jd-s

undone axleBOT
hexed quarry
#

    private FileConfiguration usersConfig;
    private File usersFile;
    private DiscordUtils discordUtils;
    private Set<UUID> loggedInPlayers;
    // Mapa przechowująca ekwipunek graczy
    private Map<UUID, ItemStack[]> inventories;
    // Mapa przechowująca ostatnie pozycje graczy
    private Map<UUID, Location> playerLocations = new HashMap<>();

    private class CommandFilter implements Filter {
        @Override
        public boolean isLoggable(LogRecord record) {
            String message = record.getMessage();
            if (message != null && message.toLowerCase().contains("/login")) {
                record.setMessage("A player used the /login command.");
            }
            return true;
        }
    }

    @Override
    public void onEnable() {
        saveDefaultConfig();
        loadUsersConfig();

        Bukkit.getLogger().setFilter(new CommandFilter());
        discordUtils = new DiscordUtils(this);
        loggedInPlayers = new HashSet<>();
        inventories = new HashMap<>();
        playerLocations = new HashMap<>();


        getCommand("login").setExecutor(new LoginCommand(this));
        getCommand("register").setExecutor(new RegisterCommand(this));
        getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
        getCommand("exiva").setExecutor(new ExivaCommand());
        getCommand("discordId").setExecutor(new DiscordIdCommand(this));
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
        getServer().getPluginManager().registerEvents(new CommandsListener(this), this);
        getServer().getScheduler().scheduleSyncRepeatingTask(this, this::updateBotDescription, 0L, 1200L); // 1200 ticks = 1 minute




    }``` Why doesn't this apply a filter?
#

it looks like Bukkit.getLogger() return wrong console logger...

topaz kestrel
#

is 1.8 support discord server still exists

topaz kestrel
#

if its legacy you have to use legacy logger api ig

hexed quarry
#

1.20.1

river oracle
hexed quarry
#

... This is the fucking solution

#
        // Try to set the log4j filter
        try {
            Class.forName("org.apache.logging.log4j.core.filter.AbstractFilter");
            setLog4JFilter();
        } catch (ClassNotFoundException | NoClassDefFoundError e) {
            // log4j is not available
            consoleLogger.info("You're using Minecraft 1.6.x or older, Log4J support will be disabled");
            ConsoleFilter filter = new ConsoleFilter();
            logger.setFilter(filter);
            Bukkit.getLogger().setFilter(filter);
            Logger.getLogger("Minecraft").setFilter(filter);
        }
    }

    // Set the console filter to remove the passwords
    private static void setLog4JFilter() {
        org.apache.logging.log4j.core.Logger logger;
        logger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger();
        logger.addFilter(new Log4JFilter());
    }```
drowsy helm
#

I have spent a good 12 hours today working on a fake crafting table (and other systems)

#

just for it to look like ive 'done nothing

blazing ocean
#

damn

grim hound
#

I wanted to change the .jar output directory

#

this doesn't work

slender elbow
#

copy task

grim hound
grim hound
#

what is that

brittle geyser
grim hound
brittle geyser
#

use it

grim hound
#

what even is that?

#

it's not suggested

#

by auto-complete

grim hound
#

elaborate?

brittle geyser
#

Try to add this into your build.gradle

tasks {
    jar {
        destinationDirectory.set(file("$buildDir/someDir"))
    }
}
eternal night
#

copy task

grim hound
#

also I use Kotlin for gradle

eternal night
#

just use a copy task

#

don't fuck with the outputs of tasks

grim hound
eternal night
#

copy task is easy as fuck

#
tasks.create<Copy>("copyShadowOutputToLocalServer") {
    from(tasks.shadowJar)
    destinationDir = file(.....)
}
#

there

eternal night
#

I mean

#

then just tasks.jar

grim hound
#

do I need some shadowJar branch?

eternal night
#

if you don't use shadow

#

no

#

just, whatever output task you want to copy from

grim hound
#

and in the tasks.create<Copy>("copyShadowOutputToLocalServer") {

#

what do I replace the

#

str with?

eternal night
#

whatever task name you want

brittle geyser
#

it is not correct i think

eternal night
#

be creative

grim hound
#

yeah cuz the problem is that

#

uhh

#

it doesn't work

eternal night
#

"it doesn't work"

slender elbow
#

vomitOutputJarToUnderpoweredServer

grim hound
eternal night
#

I mean, you are running the new task right?

slender elbow
#

:clueless:

grim hound
#

I just click build

eternal night
#

Yea

#

which will not run that task

#

if you want build to run that task, just have build depend on it

grim hound
eternal night
#

yea

eternal night
#

declare a dependecy from the build task on the just created task

#

tasks.build {
dependsOn(tasks.copyShadowOutputToLocalServer)
}

grim hound
#

like this?

grim hound
#

yeah it works

#

thanks

eternal night
#

np 👍

grim hound
#

java.lang.RuntimeException: java.io.NotSerializableException: org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack

#

for this

#

and the paper method lacks as well

quaint mantle
#

How can I make http request in kotlin? I saw a library called okhttp.

chrome beacon
#

okhttp is a popular option

#

but you can use the regular Kotlin standard lib

quaint mantle
#

where can I find the docs page for the http request

grim hound
tender shard
tardy delta
#

public lib moment

grim hound
#

So can anyone tell me how I can serialize and deserialize a PlayerInventory?

slender elbow
#

BukkitObjectOutput/InputStream

tardy delta
#

does this seem like reasonable english? fail(f'git clone needed for bootstrapping build system failed with exit code {exitcode}', exitcode)

tender shard
eager wind
#

when I write a message in chat I get the name of the world first and at the end of the name $f how can I remove it? what plugin is it?

slender elbow
#

also you don't need to put it in a bytearrayoutputstream, you can just pipe the object stream directly to a file output stream

tender shard
eager wind
#

Sorry

#

Thanks

grim hound
grim hound
#

All I need, really

#

Don't care about the extension

tender shard
#

what's more important? saving a few bytes less or have it human readable?

grim hound
#

Saving it

#

I don't need it as human readable

tender shard
#

then just throw it into a BukkitObjectOutputStream and you'll get a byte array

grim hound
#

(In for reading)

tender shard
#

yes

grim hound
#

Alright, thanks

tender shard
river oracle
#

Use internals

slender elbow
#

add api

river oracle
slender elbow
#

yeah

river oracle
#

I might soon tbh I can just delegate to an unsafe method

#

Bukkit ItemStack Is just Craftbukkit ItemStack internally when???

slender elbow
#

🤔

river oracle
#

@worldly ingot how likely do you think slime would be to support moving ItemStack to an interface

worldly ingot
#

Depends on how you do it because you might end up fucking up tons of Bukkit behaviour as a result

#

You need to retain the concept of copies vs mirrors

river oracle
#

Well that is probably doable

#

I can't imagine making copies would be to hard to achieve

#

I think a good first step though would be mindlessly easy to add.

#

deprecate ItemStack constructors and add static methods to ItemStack that can either delegate to Bukkit or UnsafeValues

worldly ingot
#

If you do that, ItemFactory is the place to do it

river oracle
#

Oh yes I forget about that but yeah

#

Could delegate to there since it's an interface

slender elbow
#

over at {{ fork }} we did {{ thing }} wrt that

worldly ingot
#

idk what wrt is

lilac dagger
#

world record time?

slender elbow
#

with regards/respect to

zenith bobcat
#

can anyone give me a hint how i can change the Playertag of a Player in the Tablist and above the head with NMS Packets in Version 1.20.4

slender elbow
#

step one is to not use packets because you don't need them

zenith bobcat
#

I already found the ClientboundPlayerInfoUpdatePacket but for that packet to work I have to change the players Gameprofile which is private and final should i use reflection for that

zenith bobcat
#

but why is it working with protocol lib

#

does protocol lib use reflection for that?

slender elbow
#

protocollib is basically just reflection

zenith bobcat
#

ok thats pretty cool so far i used:

#

player.setPlayerListName(playerName); player.setDisplayName(playerName);

runic pine
#

AsyncPlayerChatEvent is called on commands?

zenith bobcat
#

but the player has still the false Name above there head and the PlayerjoinMessage is also not correct

tall dragon
slender elbow
#

i mean, for the join message you can just change it in the join event

#

packets wouldn't have helped you there anyway

#

and there are probably other messages too where that matters, death maybe, idk

zenith bobcat
runic pine
#

how the chat plugins work? for example /g ?get the message without the command?

#

and cancel the event

eternal oxide
#

They listen to the chat event

runic pine
#

how i send for some players?

@EventHandler
private void onAsyncPlayerChat(AsyncPlayerChatEvent event) {

    Player player = event.getPlayer();

    event.setFormat(plugin.getChat().getString("chat").replace("&", "§").replace("%player%", player.getName()).replace("%message%", event.getMessage().replace("%", "")).replace("&", "§"));
}
eternal oxide
#

you either modify the recipients or cancel and send yourself

runic pine
eternal oxide
#

depends if other plugins modified it

#

however

runic pine
eternal oxide
#

these days with signed chat its unlikely you can simply modify it like that. You need to cancel teh event and send yourself

runic pine
#

wdym signed chat

eternal oxide
#

by default now all chat is cryptographically signed

#

if you modify it it will error

#

since 1.19

runic pine
#

player.getNearbyEntities returns the player instance too?

runic pine
eternal oxide
#

then you can just modify the message/recipients

runic pine
#

@EventHandler
private void onAsyncPlayerChat(AsyncPlayerChatEvent event) {

    Player player = event.getPlayer();

    for (Entity entity : player.getNearbyEntities(30, 30, 30)) {

        if (entity instanceof Player nearby) {
            event.getRecipients().clear();
            event.getRecipients().add(nearby);
        }

    }
    
    event.setFormat(plugin.getChat().getString("chat").replace("&", "§").replace("%player%", player.getName()).replace("%message%", event.getMessage().replace("%", "")).replace("&", "§"));
}
runic pine
#

idk if nearbyentities return the player too

#

to see the own message

eternal oxide
#

it does

#

it also returns mobs and dropped items

runic pine
#

yes

#

i verify if instanceof player

eternal oxide
#

you should not be sending messages to them

runic pine
eternal oxide
#

you are clearing the recipients every time you find another player

runic pine
#

oh yes

eternal oxide
#

clear before the for loop

runic pine
#

@EventHandler
private void onAsyncPlayerChat(AsyncPlayerChatEvent event) {

    Player player = event.getPlayer();

    event.getRecipients().clear();

    for (Entity entity : player.getNearbyEntities(30, 30, 30)) {

        if (entity instanceof Player nearby) {
            event.getRecipients().add(nearby);
        }

    }

    event.setFormat(plugin.getChat().getString("chat").replace("&", "§").replace("%player%", player.getName()).replace("%message%", event.getMessage().replace("%", "")).replace("&", "§"));
}
#

done

slender elbow
#

you can't interact with the world async, that includes getNearbyEntities
use the sync PlayerChatEvent for that, since you are mutating the event with what you are doing sync

runic pine
#

ok thx

eternal oxide
#

you'd do better by simply looping the recipients and remove them if they are too far away

#

that can be done in the async chat event

near mason
#

how do i read vector array/list from config?

tardy delta
#

getList and cast it to List<Vector>

#

Vector is ConfigurationSerializable

near mason
#

ok thank you

hasty hamlet
#

@tawdry shoal

tawdry shoal
#

Hey, I'm making a plugin for a block with a gui, this gui has a certain button that starts the process, but if I exit the gui and come back in, the process will stop. How can I implement this process in the background? so that it works outside the GUI. Here is my code with a thread where I handle this process.

#

public static void startReworking(Inventory inventory, ItemRecipeManager recipeManager, Map<Inventory, Boolean> reworkingStatus, Player player) {
int itemCount = 0;
for (int i = 10; i < 17; i++) {
ItemStack item = inventory.getItem(i);
if (item != null && !item.getType().isAir()) {
itemCount++;
}
}

    if (itemCount > 0) {
        RecyclerGUI.createButton(inventory, false); // Устанавливаем красную панель перед началом переработки
        reworkNextItem(inventory, recipeManager, itemCount, 0, reworkingStatus, player);
    } else {
        RecyclerGUI.createButton(inventory, true); // Устанавливаем зеленую панель, если нет предметов для переработки
    }
}

private static void reworkNextItem(Inventory inventory, ItemRecipeManager recipeManager, int totalItems, int currentItem, Map<Inventory, Boolean> reworkingStatus, Player player) {
    if (currentItem >= totalItems) return;

    for (int i = 10; i < 17; i++) {
        ItemStack item = inventory.getItem(i);
        if (item != null && !item.getType().isAir()) {
            ItemRecipe itemRecipe = recipeManager.getRecipe(item);
            if (itemRecipe != null) {
                int slotIndex = i; // Сохраняем значение i в локальную переменную
                RecyclerGUI.createButton(inventory, false); // Устанавливаем красную панель

                String group = getPlayerGroup(player);
                int time = itemRecipe.getTime().getOrDefault(group, 10); // Default to 10 seconds if group not found

                Bukkit.getScheduler().runTaskLater(RustRecycler.getPlugin(RustRecycler.class), () -> {
                    if (!reworkingStatus.getOrDefault(inventory, false)) {
                        return; // Если переработка остановлена, выходим из задачи
                    }

                    List<ItemStack> items = itemRecipe.getTo().stream()
                            .map(To::generate)
                            .collect(Collectors.toList());

                    // Удаляем переработанный предмет
                    if (item.getAmount() > 1) {
                        item.setAmount(item.getAmount() - 1);
                    } else {
                        inventory.setItem(slotIndex, null); // Используем локальную переменную
                    }

                    addItemsToSlots(inventory, items, 28, 35);

                    // Проверяем наличие предметов в слотах 10-16 после переработки
                    boolean itemsPresent = false;
                    for (int j = 10; j < 17; j++) {
                        ItemStack checkItem = inventory.getItem(j);
                        if (checkItem != null && !checkItem.getType().isAir() && recipeManager.getRecipe(checkItem) != null) {
                            itemsPresent = true;
                            break;
                        }
                    }

                    if (!itemsPresent) {
                        reworkingStatus.put(inventory, false);
                        RecyclerGUI.createButton(inventory, true);
                        return;
                    }

                    if (currentItem + 1 >= totalItems) {
                        RecyclerGUI.createButton(inventory, true); // Устанавливаем зеленую панель, если это последний предмет
                    }

                    reworkNextItem(inventory, recipeManager, totalItems, currentItem + 1, reworkingStatus, player);
                }, time * 20L); // time * 20 тиков = time секунд
                break;
            }
        }
    }
}
undone axleBOT
hybrid spoke
#

i see a lot of static

tawdry shoal
hybrid spoke
#

typically you want to have your process as an object and store it somewhere in f.e. a ProcessHandler, which keeps track of them

lost matrix
# tawdry shoal Hey, I'm making a plugin for a block with a gui, this gui has a certain button t...
  1. Your code interacts a lot with mutable Objects. This means static is completely out of question for this. First step: Dont use any static here.
  2. It is important to decouple your logic from the actual user input.
    Your blocks functionality should have one method to start, and one to pause/stop it.
    How those methods are called should be completely irrelevant. (Could be a button click in a GUI or anything else)
#

So first write the logic of your block, without any GUIs in mind.
After that your GUIs should simply be a way to let the user interact with that logic.

#

Reduce the amount of dangling Maps, and other collections.
Start with a simple manager class which holds all your recyclers, and implement a Recycler class

public class Recycler {
  ...
}
public class RecyclerManager {
  private final Map<Block, Recycler> recyclerMap;
  ...
}
runic pine
#

If I make an enderchest plugin how do I block that dupe with freecam?

river oracle
#

Idk figure out how the dupe works

#

And then patch it

runic pine
river oracle
#

Then figure out how the dupe works

#

And try fixes

lost matrix
river oracle
#

It seems they don't even know ig

#

Otherwise they'd atleast have an idea of where to go for patching it

lost matrix
#

Im trying to understand what an "enderchest plugin" is in the first place.
Simply a command that calls

player.openInventory(player.getEnderChest());

?