#help-development

1 messages · Page 1299 of 1

grand flint
#

well its mostly dark vs light theme

#

not like theme themes

kind hatch
#

Application first if and when possible, database as fallback

grand flint
#

yeah i think

#

thats the smartest

#

if they change it on that application

#

it saves there

mortal hare
#

I would even say that technically denormalized data doesnt exist. Every data store should be normalized to the context of usage. If its not normalized than means data is useless on its own because it has no context. Thus nosql views for application persistence is normalized to the application logic context, and relation database persistence store would be normalized for generic context acting as a single source of truth for various types of context-specific normalizations

flint coyote
#

Yeah databases should be used as a final guard and shall be built upon some caching layer that acts as an in-memory store. And for most applications you either don't have concurrent (write) access or you are able to circumvent it because you are within a single application instance. Which is precisely the reason I never took the step to use Databases for Minecraft Plugins. A single file per user does the same job since there won't ever be concurrent access as long as you don't mess up your multithreading (if you even need that) and it's simple to cache the usually relatively small amount of playerdata using a hashmap and a data class

#

I'm sure you can have plugins with a huge amount of data where a database CAN make sense. E.g. LogBlock. But more often than not a (or multiple) flat-file(s) stored in-memory with periodic saving will do just fine.

#

Just make sure to have backups. The minecraft server exploding would destroy your data when using flat-files. This won't happen with a DB running on a different server. But you could just have an automatic system that grabs the file(s) every day and stores them on another server as well

potent crescent
#

omg too long message

wet breach
#

caching is only necessary if your DB can't handle the amount of queries you are doing

#

internet these days is really reliable and redundant. But you can implement caching if internet is a concern I suppose

#

validation does not necessarily need to happen as soon as possible, only really needs to happen for things that need it

eager arrow
#

can someone help me delete my thread

drowsy helm
eager arrow
#

on spigot itself or on discord?

drowsy helm
#

on the forums website

#

theres a report button

eager arrow
#

alright thank you

mortal niche
#

is there a way i can make it soe parteicles render from farther away

eternal oxide
#

no

inner marsh
#

Anyone helping with BuildTools

#

i setup BuildTools but i didn't get net/minecraft and bukkit/craftbukkit in my maven

chrome beacon
#

And if you're using Mojmaps; that you used the --remapped flag

inner marsh
#

I didn't use promt, I downloaded via the interface, and I didn't encounter any problems, unless the maven part was skipped, but how do you know that :/

chrome beacon
#

The gui has a toggle for the remapped flag

#

And you can check the log for what it did

young knoll
eternal oxide
#

I didn't think you could override the client render settings

potent heron
#

How i can edit a plugin Or update it

mortal vortex
#

Probably by... editing it?

#

If you have the source then just edit the files.

young knoll
#

No guarantee on specific client behaviour

#

I think the vanilla client just renders it as long as the chunk is visible

mortal niche
cinder abyss
#

Hello, is there a guide/code example for spawning and editing ItemDisplay with packets (ProtocolLib) ?

wraith oasis
#

is there a way to make block displays appear only for specific player (protocollib) and manipulate them?

slender elbow
#

there sure is

wraith oasis
worthy yarrow
#

Which part

#

Appearing for specified players means sending some packets to only specified players, and manipulating the displays means manipulating the displays and then sending some more packets lol

wraith oasis
kind hatch
#

I don't think you even need protocollib when we have Player#showEntity & Player#hideEntity

wraith oasis
worthy yarrow
wraith oasis
#

for example there will be like 500 players working with 25 blocks each at one time

young knoll
#

Of course you can move existing entities

kind hatch
worthy yarrow
#

^

wraith oasis
worthy yarrow
#

Entities are server side

young knoll
#

You just need the entities internal ID to tell the client which entity your packet is for

wraith oasis
wraith oasis
worthy yarrow
#

elaborate on spawned blocks

kind hatch
#

If you keep track of them yes

worthy yarrow
#

Like block displays?

young knoll
#

Presumably protocollib already has an api to fetch a free entity id

wraith oasis
worthy yarrow
wraith oasis
worthy yarrow
#

I remember asking why DH hasn't switched to display entities and they said because packets are more performant

#

As well as complaining that display entities tick, but they don't iirc?

young knoll
#

They can still use display entities with packets?

#

And yes they do technically tick

kind hatch
young knoll
#

They check if their vehicle is still valid

#

And that’s it

worthy yarrow
#

Ah

#

Complex computations man

kind hatch
#

Even then, it's still much more performant than armorstands

worthy yarrow
#

I mean I get the work of an overhaul but still

#

People complain we don't get modern tools

We get modern tools

People don't use them

young knoll
#

Not much to overhaul tbh

#

Just changing some packets

worthy yarrow
#

I think another one of their complaints was versioning support, but like you already have the armorstand shit written so...

wraith oasis
#

is there a way to set transparency/opacity of display blocks?

#

i haven't found a way yet

worthy yarrow
#

I think you may need a custom model, iirc block bench has some opacity config when designing models

fickle spindle
#

hello, the idea of making an homes plugins and a team plugins came to my mind but i don't want to make both in the same .jar i want to make them work one alone of the other but i would love to integrate some stuff of one to the other for example the homes one i want to integrate an item in the gui of the homes that it's the team home how can i make the 2 communicate? (Sorry if it's a stupid question but I'm really new to creating API or whatever can make them communicate)

alpine solar
#

multi maven modules

potent heron
#

How can I edit the description of a plugin already uploaded to Spigot? Also, how can I upload a new version? I can use @ to reply to you.

eternal oxide
#

enable 2fa

potent heron
#

@eternal oxide i need 2fa?

eternal oxide
#

yes

potent heron
#

ok

fickle spindle
grand flint
fickle spindle
grand flint
fickle spindle
grand flint
#

dows it better?

fickle spindle
grand flint
#

no it doesnt so follow it

fickle spindle
#

okok

#

ty

pure dagger
#

do i have to a deep copy when i want to return ItemStack[], and make sure outer methods cant edit it ?

#

like do i just create another one and place all of the contents in loop ?

#
 public List<ItemStack> getContent() {
        List<ItemStack> clonedContent = new ArrayList<>();
        for (ItemStack itemStack : content) {
            clonedContent.add(itemStack.clone());
        }
        return clonedContent;
    }
grand flint
#

why would that not be editable

#

u can still edit the list no?

thorn isle
#

Yes, itemstacks are mutable, so a defensive clone of a collection of them must be deep

pure dagger
#

i dont wanna outer methods to edit it

#

read only

#

so i return a clone

grand flint
#

just return a constant

#

im so smart

thorn isle
#

Thankfully cloning itemstacks is fairly cheap nowadays

pure dagger
pure dagger
#

do i ...

#

what do i do

grand flint
pure dagger
#

i think i should override getter in recird

#

record

thorn isle
#

Construct a copy of the record with a clone of the itemstack

pure dagger
#

no noooo

#

i should just clone it in getter in record

#

right

thorn isle
#

Ideally not

pure dagger
#

why

#

the record was supposted to be immutable

thorn isle
#

Shallowly immutable

pure dagger
#

or idk

thorn isle
#

But sure if you want to enforce it to be deeply immutable, do that, but also remember to clone the stack in the constructor, and be aware of any performance impact repeatedly cloning it might incur

pure dagger
#

ooookay

#

couldnt they make an ImmutableItemStack class?

#

or smth

#

or is it stupid

#

instead of cloning it every time in getter i would just do new ImmutableItemStack(Itemstack) and return that

#

i could return the same one many times

#

is that stupid ?

thorn isle
#

It'd be nice if there was an immutable itemstack type yes

pure dagger
#

so you can do it yourself

#

?

#

or too complex

lean pumice
#

why there is an error downloading XSeries depdencies?

#

i am tring to download decentholograms that contains XSeries, but it don't find in https://jitpack.io, but i tink it is in maven

worldly ice
#

i believe it's case sensitive

#

make sure you have the right caps in groupId and artifactId

worldly ice
#

you need caps

lean pumice
#

only XSeries doesn't work

worldly ice
#

what is xseries

lean pumice
#

but... it is in maven

worldly ice
#

send relevant info from pom

lean pumice
#

wait, now i fixed cleaning, installing, and packaging

#

tnx

hard socket
worldly ice
#

you could try translating the item display with interpolation instead of tp'ing it but not sure if that's recommended

young knoll
#

You can set the teleport interpolation too

worthy yarrow
#

Make a little bit of a better algo kek

young knoll
#

The default is 0, which means it doesn’t have any interpolation when teleporting

#

Where most (all?) other entities do

worldly ice
#

thats neat

zealous scroll
#

what event is called when a player clicks an interaction entity

#

or are none called

worthy yarrow
#

Should be playerInteractEntityEvent iirc

#

It should be at least one of the playerInteract events

forest cobalt
#

How to make tickrate of hopppers fast like what settings

#

ticks-per:
hopper-transfer: 100
hopper-check: 100
hopper-amount: 100 what do i do for this to make it go very fast and collect speed

zealous scroll
#

ill debug a bit more

worthy yarrow
#

It's been a little while since i messed with interaction entities, but something is telling me only right clicks are noticed

zealous scroll
#

yeah its a right-click

young knoll
#

It fires a damage event for a left click

#

And InteractEntity or InteractAtEntity for right click

#

Don’t remember which

zealous scroll
#

i didnt mean to leave mention on the reply enabled sorry

#

I tested with both events and both were called for other entities but not interact events

its a problem with nexo, nevermind

sick hinge
#

is there a way to wait a specific amount of seconds, not ticks?
I'm writing a plugin that does potentially expensive operations asynchronously and I want to make sure that if the operation takes longer than a certain number of seconds it is automatically cancelled
I worry that if I use ticks, the operation could cause tps to drop leading to the operation being given more time than it actually should

worldly ice
#

you could create a new thread and use Thread.sleep to sleep a certain number of ms and cancel after that time has passed

#

though it depends on what you're using for those async operations

#

for example you can use Future::get with a timeout

wet breach
#

using ticks or seconds is not relevant to a timer

sick hinge
#

if the operation is using cpu resources wouldn't it lag the server if it's doing too much?

#

like, this is noticeable with FAWE for instance

#

even though I think it does almost everything in other threads

wet breach
#

the only difference is that if you go based on ticks, if the server lags, your task will also be delayed where as if you use seconds then your task will ask to be executed but since server is lagging still may get delayed in executing

sick hinge
#

if I use ticks and the tps drops that means the task (that is potentially lagging the server) gets more time than it actually should

#

that's what I'm worried about

wet breach
sick hinge
wet breach
wet breach
sick hinge
#

I didn't know if there was any oddities with using it

#

like it could make sense if it has weird behavior on server shutdown etc.

wet breach
#

your only downside is that you wouldn't be able to rely on the bukkit task api if you are handling your own threads

wet breach
#

as for the whole ticks and seconds part, you should in general rely on ticks though. Because this keeps everything at the pace of the server, where as if you use seconds then you may not necessarily be in sync with the server but some tasks do require this

sick hinge
#

I don't really understand why that matters
when I need to actually get things to the main thread I can just schedule a task

#

also this is for the purpose of a timeout

wet breach
#

because if the server is going slow you want your task to slow down with it

sick hinge
#

that's not really what I want here

wet breach
#

if you go faster then the server can process, all you are doing is contributing to the problem

#

I guess you are not quite understanding

sick hinge
#

what I want here is to kill a task when it's taking too long

worthy yarrow
#

The way you’d have to tell time is the same way the server does, so your system is only ever going to be as aware as the server in this case

wet breach
#

when the server slows down, its not that your task is slowing anything down, or that its spending too much time on your task

#

rather the server as a whole has slowed down

#

the server will start skipping ticks and it remembers it has done this

#

if everything gets too slow for too long

sick hinge
#

maybe I misunderstand how the scheduler works
if tps is 10, and I schedule a task for 20 ticks later, will it execute after 2 seconds or 1 second (roughly)?

worthy yarrow
#

21 ticks technically iirc

wet breach
#

you should probably do research on game loops. The tick rate of the server is essentially the game loop and it doesn't necessarily control how fast anything executes per-say especially when it comes to threads, but it does control how fast everything in the game goes

worthy yarrow
#

Task scheduling would take a tick + wtv you define as the delay -> ran every x ticks

wet breach
#

the server can still count ticks even if it is running slower

#

in comparison to real world time. It would take 50% longer. So technically if you are measuring with a clock it would take longer to get to that 30th tick at 10tps, then it would at 20tps

#

but the same amount of ticks would go by before your task executed

#

20TPS is 50ms just fyi

#

so if we run at 10tps then we are at 100ms

#

which in comparison for executing stuff is relatively fast lmao

sick hinge
#

by that you mean mspt?

wet breach
#

or was it 1 tick is 50ms 🤔

sick hinge
#

1s = 1000ms
1 tick = 1/20 s = 1000/20 ms = 50ms

wet breach
#

right so, 1 tick is 50ms, so if we go to 10TPS then, 1 tick is 100ms

sick hinge
#

I mean like, still, not killing a task that is lagging the server after the timeout period (because the server thinks less time has passed) seems like a bad idea

wet breach
#

I think a better thing you should do if you are that concerned is to have a thread separate from everything that keeps track of TPS

#

if it hits 10TPS or whatever you decide, you can just pause your tasks

#

until TPS improves

#

to pause a task you wouldn't cancel, instead you would add in your code a boolean where if its true it would just skip to the end of the method

sick hinge
#

that doesn't really work in my case (tasks are player-submitted, they're going to expect them to be done somewhat soon after submitting a command; I want to make sure that if they do a task that's too large it's killed after a certain timeout)

wet breach
#

this way your task is still there, just waiting.

worthy yarrow
wet breach
worthy yarrow
#

If a task is "too large" then I guess you could split the workload into multiple threads... or just not allow tasks of that size

wet breach
#

at this point it is up to you which time you want it to depend on, that is real world time or in game time

#

since both are not always in sync

sick hinge
#

I can't predict in advance what will take longer (well, unless someone solves the halting problem that is)

#

users submit code that may perform actions on the world

worthy yarrow
#

Well what defines a player submitted task? Couldn't you gather enough context from this to decide whether or not it's a heavier load?

wet breach
#

but I think if you implemented a method that would just simply pause a task instead as a first measure it might be better then just outright killing it. Maybe reserve that for tasks tthat are taking like 10 minutes?

sick hinge
worthy yarrow
sick hinge
#

I was thinking to check Thread.interrupted occasionally and have another task run after a timer that interrupts the thread but just checking the timer then instead is definitely better

wet breach
#

you should avoid interrupting a thread

#

because you could indefinitely suspend a thread on accident this way

sick hinge
wet breach
#

yeah so after like 2-3 minutes I would kill the task

#

maybe sooner

thorn isle
#

Are you talking about suspending a thread?

wet breach
#

I meant that they should learn how to interrupt a thread properly otherwise you won't be able to interrupt it at all

#

and thus unless you implemented some way to kill it, the thread runs indefinitely

ivory sleet
#

ye interrupts can get messy if ur undisciplined

potent heron
grand flint
#

Why would anyone pick that plugin rather than everything else available

potent heron
#

Because I'll be adding a lot of things to it.
I'll add that when you say bad things in the chat, you'll get an alert, and when you have certain alerts, I'll ban you for 1 hour. Give me ideas, otherwise.

grand flint
#

but make sure everything is configurable

#

i dont think u should add a lot of things

#

just make the things u do add perfect

#

add minimessage formatting as well

slender elbow
#

add a /dn command

potent heron
potent heron
thorn isle
#

here we go

slender elbow
#

lol

#

deez nuts

potent heron
#

ok

#

emily do you crete plugins?

slender elbow
#

sometimes

grand flint
#

nobody likes a modern plugin without minimessage

potent heron
#

ok

thorn isle
#

i will die on the § hill

#

16 colors is perfectly sufficient

torn shuttle
#

man I should've done this a long time ago

echo basalt
grand flint
#

aura

#

eugh

torn shuttle
grand flint
torn shuttle
#

couldn't be me

grand flint
#

same w node modules

echo basalt
#

it auto downloads and stuff

torn shuttle
#

this does something way more useful, it auto symlinks

#

that's true pog behavior

echo basalt
#

can be achieved with a gradle task

torn shuttle
#

sure

#

if you're CRINGE

#

like you

torn shuttle
#

this is much nicer

thorn isle
#

imagine maintaining compat against more versions than just latest

torn shuttle
torn shuttle
#

damn illusion how'd you grow up to be such a cringelord that doesn't appreciate a proper ui

#

I guess the universe had to even out after producing a gigachad

echo basalt
#

😔 if only I read elitemobs' src and discovered half the UIs are hardcoded

grand flint
#

elitemobs eugh

#

mythicmobs

torn shuttle
#

this man wants to be able to customize literally the plugin setup page like modifying what it says would make any sense

echo basalt
#

this guy gets it

#

make a config generator webpage that links back to the plugin

#

like

#

/elitemobs setup

#

click to open link, set my settings and shit

#

light/dark mdoe button

#

press "confirm" and maybe even run a command

grand flint
#

ohh but its by magma so now its good

torn shuttle
#

here's a counter argument

#

how about just no

#

it adds nothing

#

there's only three buttons

echo basalt
#

I forgot you're the guy who refused adventure support because 4 people asked for it

thorn isle
#

i support magmaman because i dislike mythicmobs much more

torn shuttle
#

if I was going to add a feature every time 4 people asked for it I would have to add and support 50443 new features

grand flint
thorn isle
#

nuh

grand flint
#

yuh

thorn isle
#

your mythic dumpster is a dumpsterfire

grand flint
#

mythic has the best plugins no questions asked

echo basalt
#

ah mythic my beloved

thorn isle
#

i can feel my blood pressure rising just thinking about it

echo basalt
#

add a negative space to mythichud and it breaks all kinds of alignment

torn shuttle
#

that's literally all mc gui spacing

grand flint
#

well yeah it calculates the alignment by it self

#

so negative space fights it

echo basalt
torn shuttle
#

then you should do the math numbnuts

echo basalt
#

even if I counterbalanced the thing it still fucked itself up

#

it literally adds 1px to every character

torn shuttle
#

isn't this a done issue now

echo basalt
#

stupid ass plugin

torn shuttle
#

didn't we get custom uis

#

with like

#

1.21.7 or whatever

echo basalt
#

dialog

torn shuttle
#

yeah that

echo basalt
#

buddy thinks mythichud is a deluxemenus alternative

thorn isle
#

it's not a cure-all but it's pretty cool

grand flint
#

the other hud plugin is better

#

i forgot name

echo basalt
#

betterhud

#

never got it working proper

thorn isle
#

yeah the whatever hud plugin that isn't part of the mythic ecosystem

echo basalt
#

happyhud used to be separate but then mythic bought it

#

mythic buys a bunch of shit

#

private equity firm type shit

thorn isle
#

they are the king midas of shit

#

everything they touch becomes shit

echo basalt
#

took like 4 months to update to 1.21.4

torn shuttle
#

I remember when songoda did the same thing

echo basalt
#

songoda my beloved

#

instead of ruining plugins she ruined lives

torn shuttle
#

porque no los dos

echo basalt
#

thought you were fr*nch not a spaniard

torn shuttle
#

imagine being born 5 minutes ago and not even knowing early 2010s memes

echo basalt
#

😔

#

can you rhyme with vaseline

torn shuttle
#

I'll dunk you in gasoline

echo basalt
torn shuttle
#

that was so bad I feel like you owe me something greater than money

echo basalt
#

BJ at the back of that mcdonalds?

torn shuttle
#

it feels like yu now owe me some kind of spiritual debt

echo basalt
#

close enough

torn shuttle
#

you need to stop putting everything you find in a fast food joint in your mouth

echo basalt
#

😔

torn shuttle
#

anyway we were talking about that dialogue thing

#

isn't that a better option

slender elbow
torn shuttle
#

I haven't looked into it yet

echo basalt
#

it doesn't fill the same purpose

#

mythichud is about permanent hud elements

#

dialogs are an alternative to chest UIs

#

bit like bedrock forms

torn shuttle
#

oh

#

k

#

never even really bothred to much with those ui elements

#

otherwise I'd probably already have made a plugin for it

#

eh who knows maybe something to add to fmm in a distant future

#

do dialogues work on bedrock with the same functionality?

#

or no, or not yet

echo basalt
#

bedrock forms are different to dialogues

#

bedrock forms can take in pictures and shit

#

they have a different UI style (and language)

torn shuttle
#

fml

echo basalt
#

lets you do shit like this

torn shuttle
#

why does mojang do this

#

just make it once and make it universal

echo basalt
#

dialogs are more about this

torn shuttle
#

feels like raw java ui design

echo basalt
#

yup

#

except it has to be sent in the configuration phase and there isn't much you can do

#

bedrock UIs can be sent at any time and it's just a big json object

#

bedrock's protocol is a lot more flexible when it comes to things like these

torn shuttle
#

hm

echo basalt
#

you can just define a new entity and spawn it in

#

change its hitbox on the fly

#

and play custom animations

torn shuttle
#

well I can do that one lol

#

but it took some work

echo basalt
#

happy ghast?

#

Interaction entities?

#

bedrock is native

torn shuttle
#

why use interaction entities when you can just scan events instead, it's so much worse!

echo basalt
#

virtual hitbox?

#

yikes

torn shuttle
#

it's not aabb because aabb is cringe

#

it's obb

#

rotates with the entity and can have a different x and z

#

plus since it's virtual I can customize interaction distances

#

damn it I have accidentally created a ghost server

#

I don't even where is htat process

#

gottem

thorn isle
#

oh, neat

#

i figured there'd have to be some way of doing that or else people wouldn't have it running doom already

pseudo hazel
thorn isle
#

with enough resourcepack magic you could probably pull it off

#

what i do find strange is that the far more flexible and exploitable (and more 13-year-old-frequented) bedrock dialogs don't have a huge ⚠️ sign always at the top of the dialog, while java's more gimped and less customizable dialogs do

young knoll
#

You could probably make a fancy theme with font magic

thorn isle
#

this isn't google

slender elbow
#

solution: do not attempt to hide player while disabled

pseudo hazel
thorn isle
#

i wish they didn't, in this particular instance

#

i wonder if we can get rid of it with resourcepack nonsense or if it's hardcoded

pseudo hazel
#

the warning sign is not the biggest issue I have with the dialogs on java

#

that would be the aforementioned fact that its like a 80% fleshed out system with just being shy of the right amount of customization

worldly ingot
#

It's a starting point

#

Consider it version 0.1

#

And remember, this is a dialogue. As in a form. For user input.

pseudo hazel
#

thats true I guess they could be updating it

#

yes but still

#

for example it would be nice if we can change the text on the dialog based on like an option the player selects or a value in an input box

worldly ingot
#

Anything with user input should have a warning saying "Look, this is third party, we can't guarantee what this unknown server is going to do with that data". If they don't include that warning, Mojang can be culpable

#

Liable*, sorry, is the more appropriate word

#

It's the same reason they have the checkbox when you first open the multiplayer menu

pseudo hazel
#

yeah so they kinda dropped the ball with that for bedrock

worldly ingot
#

Yes, but Bedrock is maintained by Microsoft, so their design decisions are theirs

#

I think that it too has a third-party server warning though

pseudo hazel
#

yeah I guess the general server warning when you enter multiplayer should be enough though?

#

or is it because the dialog looks like an actual minecraft menu

worldly ingot
#

Could be that, yeah

pseudo hazel
#

and the warning is also there to prevent softlocks

worldly ingot
#

There's that as well, yes

pseudo hazel
#

with the disconnect ability

torn shuttle
#

man I need to take a look at this a year from now when over 50% of people are running a server capable of using it

pseudo hazel
#

it means you can do something like /dialog show player {} where {} is the actual contents of the dialog, instead of some link to an existing dialog

#

and ofc throught the API is the same thing

slender elbow
#

a direct holder rather than a reference holder

#

you can either register dialogs to the registry with a datapack, which will be sent to the client, and then open them via their resource location, or create them on the spot and send the whole dialog layout every time you want to open them

sly topaz
#

so we are not that far away

#

I am amazed at the amount of people who got stuck at 1.21.4 though

uncut zodiac
#

where should i go/look for a complete beginner

lean pumice
#

how i can avoid this?

#

then i cancel the interact event

worldly ingot
#

Hasn't that been fixed for a long time now?

#

I guess you could send a block change one tick after you cancel the event

worldly ice
thorn isle
lean pumice
thorn isle
#

so it's working?

worthy yarrow
#

love double negatives

young knoll
#

I don’t not love double negatives

worthy yarrow
#

kek

remote swallow
buoyant viper
#

jesus

ripe depot
#

are registered recipes automatically unlocked in the crafting book when you have the materials?

sullen marlin
#

Good question

#

I don't know though. Maybe try and see?

#

I know some part of recipes is weirdly advancement based, but might not be unlocks

fleet pier
#

is there a way to play a SPECIFIC cave ambient sound in spigot 1.8.9

#

there has to be a way right 🥹

grand flint
#

yeah

#

update to latest

fleet pier
#

ur a funny one

#

😍

grand flint
#

pretty sure they are defined under a single sound id

#

so no u probs cant

fleet pier
#

not even through packets?

#

wild

grand flint
#

no bc its already on the client im pretty sure

#

if u say please ill double check

#

@fleet pier

fleet pier
#

please

#

🥺

grand flint
#

and a kiss

fleet pier
#

💋

#

mmm

modest crypt
#

⁉️

grand flint
#

rate my new plugin page

#

ignore the bottom part

fleet pier
#

vulcan not good

#

so

grand flint
#

who deleted my link

#

yall r racist

grand flint
fleet pier
#

ill give it a 6

#

out of 10

grand flint
#

@ivory sleet ik u did it

ivory sleet
#

?

grand flint
#

u deleted my link 💔

ivory sleet
#

ugh it wasnt me this time

grand flint
#

yay

fleet pier
grand flint
#

i forgive u then heart_regen

fleet pier
#

💔

#

i gave him a kiss and everything

grand flint
#

ight so

#

im not checking it

fleet pier
#

and he still didnt answer my question

grand flint
#

while i was mid

#

checking it

fleet pier
#

well

#

im waiting

grand flint
#

yeah no

#

its not even defined, its in a single file

#

its in ambient.cave.cave

#

i think its hardcoded icl

fleet pier
#

🌧️

#

why are we ghost pinging @grand flint

eternal oxide
#

are you trying to play a specific cave sound?

#

if so use teh play sound method where you can provide an extra value (random or something)

#

start at 1 and go up one by one untill you get the sound you want

#

1.8? Nope, send a packet providing a seed to play sound

young knoll
#

It’s just a long

#

It’s used as the seed on the client

#

Afaik there’s no nice way to figure out which seed will yield which variation

austere crow
#

why would a plugin not decomplie im using something to decomplie this plugin but when downloading the result it is justa empty zip if i do this same decomplier with a diff plugin it works perfectly

#

can i do it somehow on intellij cuz i tried just a jar to zip but then i get the .class files not java those are read only on intellij cuz the JD converts them to .java for viewing

buoyant viper
#

some obfuscators will jumble up the code and purposefully cause most decompilers to crash while attempting to read a class

#

but still have the code able to run on the JVM

#

i believe Paramorphism is a prime example of an obfuscator that has this feature

austere crow
#

yes this was a possibility but it wasnt the issue it was actually windows now reading contents switched to non windows computer it worked had to use 7zip not normal to unzip but thx for helping

#

i dont know why but did i just get the notification for those messages

buoyant viper
#

F

modest cosmos
#

Hey, I'm trying to download Leaderheads, but when I click on the spigot page, it shows me this error

sly topaz
modest cosmos
sly topaz
#

no idea then

modest cosmos
sly topaz
#

?support

undone axleBOT
modest cosmos
#

ty, apreciate it

sullen marlin
#

The plugin is long deleted

modest cosmos
warm scroll
#

Does anyone know how to develop a plugin

sullen marlin
#

?ask

undone axleBOT
#

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

warm scroll
chrome beacon
#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

warm scroll
echo basalt
#

?services or check pins in #general

undone axleBOT
echo basalt
#

Mods and plugins are different things BTW

warm scroll
potent heron
#

that fails?
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>Vault</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
</dependencies>

chrome beacon
#

Did you forget to add jitpack as a repo

potent heron
#

now?
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
    <!-- Spigot API -->
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.20.1-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>

    <!-- Vault API -->
    <dependency>
        <groupId>com.github.MilkBowl</groupId>
        <artifactId>Vault</artifactId>
        <version>1.7</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
slender elbow
#

use 1.7.1, and make sure you refresh maven on intellij (little floating maven button)

#

also it's VaultAPI, not Vault

potent heron
#

@slender elbow

slender elbow
#

did you do the refresh

potent heron
#

oh thanks xd

wooden bay
#

🥄 🍚

potent heron
#

you can try the plugin

wooden bay
#

what you finished it?

potent heron
#

When I finish it, this plugin is a plugin that I've been working on for a few weeks.

potent heron
wooden bay
#

you finished faster than me

potent heron
#

but I've been doing it for a month

keen charm
#

👋

#

When listening to Clientbound packets using NMS, should I do super.write(ctx, rawPacket, promise); for each subpacket in a ClientboundBundlePacket or just do it for the main bundle packet?

chrome beacon
#

just the bundle packet

dreamy glade
#

Hi. Is this the only way to do this or there is a more optimal approach? Thanks

// I want to get the player available slots.
final PlayerInventory playerInventory = oPlayer.getInventory();
int totalEmptySlots = 0;
for (int i = 0; i < playerInventory.getSize(); i++) {
    if (i < 0 || i > 35)
        continue;

    final ItemStack itemInSlot = playerInventory.getItem(i);
    if (itemInSlot == null)
        totalEmptySlots++;
}
young knoll
#

One improvement would be to just use an enhanced for loop on the inventory itself

#

Inventories are iterable<ItemStack>

dreamy glade
#

I see. Thank you.

keen charm
#

👋

#
[17:20:03 WARN]: java.lang.IllegalStateException: void future
[17:20:03 WARN]:        at io.netty.channel.VoidChannelPromise.fail(VoidChannelPromise.java:198)
[17:20:03 WARN]:        at io.netty.channel.VoidChannelPromise.addListener(VoidChannelPromise.java:58)
[17:20:03 WARN]:        at io.netty.channel.VoidChannelPromise.addListener(VoidChannelPromise.java:26)
[17:20:03 WARN]:        at ZelHide-1.1.7.jar//com.zeltuv.hide.nms.NMS_v1_21_7$1.write(NMS_v1_21_7.java:81)
[17:20:03 WARN]:        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:891)
[17:20:03 WARN]:        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875)
[17:20:03 WARN]:        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984)
[17:20:03 WARN]:        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868)
[17:20:03 WARN]:        at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:964)
[17:20:03 WARN]:        at io.netty.channel.AbstractChannel.write(AbstractChannel.java:300)
[17:20:03 WARN]:        at net.minecraft.network.Connection.doSendPacket(Connection.java:496)
[17:20:03 WARN]:        at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:476)
[17:20:03 WARN]:        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
[17:20:03 WARN]:        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
[17:20:03 WARN]:        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
[17:20:03 WARN]:        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
[17:20:03 WARN]:        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
[17:20:03 WARN]:        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
[17:20:03 WARN]:        at java.base/java.lang.Thread.run(Thread.java:1583)

I'm getting this error when trying to add a listener

#
                            // Write raw packet for final outcome
                            try {
                                LINE 81 -> promise.addListener(ignored -> Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, () -> {
                                    // Unlist
                                    if (!player.isOnline()) return;
                                    if (!addedPlayer.isOnline()) return;
                                    unlistPlayer("REMOVE", addedPlayer, List.of(player));
                                }, 10L));
                            } catch (Exception exception) {
                                exception.printStackTrace();
                            }
hybrid spoke
keen charm
#

Is it possible to add a listener somehow?

hybrid spoke
#

a VoidChannelPromise is probably still passed in, since overriding the method doesn't change the parameters passed.
you could try to unvoid it

grand flint
#

did java not get the transfer packet??

keen charm
hybrid spoke
grand flint
#

i thought it was but it says the client needs to have the mod installed lmao

young knoll
#

Guess they didn’t feel like changing new versions to the transfer packet

grand flint
#

i cant find a single plugin that does it this

#

they made a proxy using the transferproxy

#

how very smart

#

if i wanted a proxy

#

id just use velocity

#

who made this shit bro 💀

#

how does this transfer packet work am i just confused

#

or does nobody bother to make a proper plugin w it

young knoll
#

It just tells the client to transfer to another server

#

If that server has transfers allowed

sly topaz
#

The transfer packet means transferring the connection out of the proxy, hence why velocity or bungee wouldn’t use it

young knoll
#

You can also do it with a command

#

/transfer mc.hypixel.net 25565 @a

worldly ingot
#

You should run that command on your server

#

For no reason in particular

sly topaz
#

“Wow this server looks a lot like Hypixel”

young knoll
#

Oh hell yeah minehut has transfers open

#

Time to modify my ban command

worldly ingot
#

Oh we don't have transfers open lol

#

Forgot about that LaughingKirby

grand flint
#

based on the transfer protocol LMAO

#

also can i not transfer from one proxy to another?

sly topaz
sly topaz
#

I imagine they use cookies in order to do that

grand flint
sly topaz
#

when are you ever needing to transfer a player into a different server completely

#

only person I see loving this is probably minehut

grand flint
#

Or transfer to another network

tame ibex
#

is it possible to add images to scoreboard in older minecraft versions using resourcepack too?

#

or let me ask this what version starts making it possible

sly topaz
#

hence why, it has little use

sly topaz
#

so whenever custom fonts were added

tame ibex
sly topaz
grand flint
#

what about large servers

sly topaz
grand flint
sly topaz
#

they might, but even in big servers you don't see this kind of thing due to the way things were before that packet existed

grand flint
#

proxy down -> transfer to another proxy

sly topaz
#

proxies have been made and configured to work without it, so there's little use for it now

grand flint
#

well ye most large servers dont run anything on their proxy anyways

#

idk though i think its useful asf

torn shuttle
#

the path to make a plugin able to do this was honestly downright stupid

#

so much god damned effort and work

#

I could've just made a standalone game

grand flint
#

what does the plugin do

lilac dagger
#

that's so cool

#

do chairs work?

grand flint
torn shuttle
#

a lot of work went into making that api be buttery smooth

#

it uses callbacks

#

it's very neat

potent heron
grand flint
#

not bad

#

i wouldve roasted u if u put a global radius

#

but its a radius around each player

lilac dagger
sick hinge
#

I'm trying to create a block display entity with protocol lib but I can't figure out how to set the block state (or scale for that matter)
I get that I'm supposed to send an entity metadata packet, but I can't figure out how exactly to do that (I've tried a few things based on the protocol wiki page but none of them seemed to work)
here's my code (kotlin):

// spawn block display entity (this part seems to work)
run {
    val packet = PacketContainer(PacketType.Play.Server.SPAWN_ENTITY)
    // header
    packet.integers.write(0, player.regionEntityId);
    packet.uuiDs.write(0, UUID.randomUUID());
    packet.entityTypeModifier.write(0, EntityType.BLOCK_DISPLAY);
    val box = region.box;
    // position
    packet.doubles
        .write(0, box.start.x.toDouble())
        .write(1, box.start.y.toDouble())
        .write(2, box.start.z.toDouble());
    pm.sendServerPacket(player, packet);
}
// set entity metadata (this is wrong but idk how to fix it)
run {
    val packet = PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
    packet.integers
        .write(0, player.regionEntityId)
    val blockData = WrappedBlockData.createData(Material.BLACK_STAINED_GLASS);
    // throws Field index 0 is out of bounds
    packet.blockData.write(0, blockData);
    pm.sendServerPacket(player, packet);
}
toxic sage
#

Hi, I have a strange issue.
When I add an attribute modifier to a player's max health, their hunger suddenly decreases without any reason.
Here's the code:

String test = "test";
for (Player player : Bukkit.getOnlinePlayers()) {
    player.sendMessage("add");
    AttributeInstance instance = Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH));
    instance.addModifier(new AttributeModifier(test, 4, AttributeModifier.Operation.ADD_NUMBER));
}

new Scheduler(JavaPlugin.getPlugin(CostumePlugin.class)).later(() -> {
    for (Player player : Bukkit.getOnlinePlayers()) {
        player.sendMessage("remove");
        AttributeInstance instance = Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH));
        List<AttributeModifier> list = instance.getModifiers().stream()
            .filter(v -> test.equals(v.getName()))
            .toList();
        list.forEach(instance::removeModifier);

    }
}, 50);

Current: git-Purpur-1632 (MC: 1.18.2)*

  • You are running the latest version
#

I don't really know why this is happening

potent heron
chrome beacon
potent heron
#

Ok

echo basalt
#

Writing to blockData isn't the same as writing a data value of type "block data" at a given index

sick hinge
echo basalt
#

something like this

#

you should have a method to get the serializer for block data without having to pass a class

supple zodiac
#

hey

#

im making a skyblock plugin and im looking for developers to help me

young knoll
#

?services

undone axleBOT
hexed robin
#

I am making a custom implementation of bungeecord

I have a simple setup
192.168.50.64 is the bungeecord server (ferriscord)
192.168.50.2:25565 is the mc server
192.168.50.2 is the minecraft client

I am stuck when the player tries to join in the game at Joining World
I have attached a log file to show what happens
Am I missing some step regarding connecting the user?
I do not in this example do mojang authentication

Minecraft Server (paper 1.21.8)

[02:46:43 INFO]: UUID of player TRiLON is 9600b880-7c04-4dcc-87f2-491971200012
[02:46:13 INFO]: Disconnecting TRiLON (/192.168.50.2:56864): Took too long to log in
[02:46:13 INFO]: TRiLON (/192.168.50.2:56864) lost connection: Internal Exception: io.netty.handler.codec.EncoderException: Pipeline has no outbound protocol configured, can't process packet ClientboundLoginDisconnectPacket[reason=translation{key='multiplayer.disconnect.slow_login', args=[]}]```

Any ideas?

If possible someone explain to me what bungee < -- > paper does during connection
Thanks in advance
Tag me please
buoyant viper
#

if ur on paper u should probably use Velocity

hexed robin
#

But I'm making my own, I don't want to use velocity

young knoll
#

Does the minecraft wiki have the login sequence documented like wiki.vg did

#

?protocol

undone axleBOT
fleet pier
#

did a lot change regarding scoreboards from spigot 1.8.9 to 1.19

drowsy helm
fleet pier
#

idk whats more embaressing

#

😭

mortal vortex
buoyant viper
fleet pier
#

clown

#

for the scoreboards

echo basalt
#

"clown"

#

chill out

#

no the scoreboard system is STILL dogshit

#

also 1.19 was a while ago

slender elbow
#

I was gonna say that scoreboard entries now can have cool display names and score entries, number format etc

#

but spigot has no API for that

#

🥸

sick hinge
# sick hinge I'm trying to create a block display entity with protocol lib but I can't figure...

continuation of this; I managed to get to this code

val packet = PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
packet.integers
    .write(0, player.regionEntityId)
packet.dataValueCollectionModifier.writeSafely(0,
    listOf(
        // type = block data
        WrappedDataValue(0, Registry.get(java.lang.Byte::class.java), 14.toByte()),
        // index = block state
        WrappedDataValue(0, Registry.get(java.lang.Integer::class.java), 23),
        // (the block state value)
        WrappedDataValue(
            0,
            Registry.getBlockDataSerializer(false),
            WrappedBlockData.createData(Material.BLACK_STAINED_GLASS)
        ),
        // end sentinel
        WrappedDataValue(0, Registry.get(java.lang.Byte::class.java), 0xFF.toByte()),
    )
);
pm.sendServerPacket(player.player, packet);

but I'm now getting

io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_entity_data'
Caused by: java.lang.IllegalArgumentException: Can't find id for 'WrappedBlockData[handle=Block{minecraft:black_stained_glass}]' in map net.minecraft.core.IdMapper@22c8c639

I'm not really sure what that means or how to fix it

sick hinge
#

nvm, I figured it out:

val packet = PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
packet.integers
    .write(0, player.regionEntityId)
packet.dataValueCollectionModifier.writeSafely(0,
    listOf(
        WrappedDataValue(
            23,
            Registry.getBlockDataSerializer(false),
            BukkitConverters.getWrappedBlockDataConverter().getGeneric(WrappedBlockData.createData(Material.BLACK_STAINED_GLASS))
        )
    )
);
pm.sendServerPacket(player.player, packet);
sly topaz
sick hinge
#

(to denote a selected region)

sly topaz
#

you could do that with the API no?

sick hinge
#

I don't believe there's a way to make an entity for solely a single player

#

I don't want the entity to actually exist in the world

sly topaz
#

you can make an entity, set visible by default to false and then show it to that player specifically

sick hinge
#

(also, I'm in too deep now /j)

sly topaz
worthy yarrow
#

What's the issue with the entity existing?

sick hinge
#

I don't want to have to keep track of what entities are owned by my plugin if I can help it

worthy yarrow
#

Unless you're dealing with thousands or more, I get it but otherwise... ?

sly topaz
#

eh, they're already half-way there, no point in going back now

worthy yarrow
#

Just curious

sly topaz
#

just make sure to spawn the entity every time the player goes out of view distance (unless you're constantly teleporting them nearby)

sick hinge
worthy yarrow
#

There's no probably lol it would have been less pain (.)

#

Anytime you can use the api, you probably should

sly topaz
#

I wonder if using packetevents would've been easier, I don't know whether their wrappers for entity data are good

#

if it was I would totally recommend people to use that instead

sick hinge
#

honestly I don't think I regret doing it this way because I learned a lot about how minecraft packets work

worthy yarrow
#

It's good to learn for sure, but again less pain is less pain

sly topaz
#

hopefully you just don't have to deal with cross-version support, that's where things start to get annoying

#

though for block displays I don't think their entity data changed at all since their introduction

#

oh, that is apparently not true, their block state data had the id 22 in 1.20.1, it became 23 on 1.20.2 onwards

worthy yarrow
#

Were interaction entities released the same version as the other display entities?

sick hinge
#

I am planning on supporting multiple versions and also fabric (but fabric will just render it in mc rather than hacking a block entity to do it so that'll be a lot easier)
for versions without block displays I probably just won't have a region preview

worthy yarrow
#

Perhaps that's where the numerical change came from 🤷‍♀️

sly topaz
#

they were all released in 1.19.4 yeah

sick hinge
#

if it gets painful enough I'll just switch to the "better" approach

worthy yarrow
#

Go have a look at decent holograms, all their stuff is packet based

sly topaz
#

if it is just a block hologram, you could use an invisble armor stand in older versions

sick hinge
#

yeah but I don't really feel like doing that

sly topaz
#

as long as you don't do any fancy transformations, it works

sick hinge
#

also I don't think that would work

#

because I am doing scaling

sly topaz
#

reminds me when people would just use entities of different sizes to do scaling of that kind

#

display entities were truly a godsend for server-side mods/plugins as well as vanilla

worthy yarrow
#

Yeah but interaction entities don't throw events for all types of player interactions D:

#

Only right clicks smh

sly topaz
#

they throw for both

#

damage for left click, interact for right click

worthy yarrow
#

I can't say for sure, I remember a couple of people having issues with them and their supposed thrown events

#

Yk I actually just made an event tracing system for debugging, I could test that rn

worthy yarrow
#

I'm speaking from other's experience so again I cannot say for sure

#

I just know I tried helping a couple times lol

sly topaz
#

people do get a bit confused when it doesn't trigger the interact event with left click given it is called an "interaction" entity and not a "hitbox"

worthy yarrow
#

Funny you say that because that was my fix.. adding a hitbox lol

#

But this only worked for intersecting entities, ex: shooting an arrow at it

#

I ended up breaking arrows with that actually

sly topaz
#

oh, I don't think it fires for interaction with anything other than players

#

so if that's where people are getting stumbled then it's more understandable

#

I think the packet fires regardless but I am not completely sure, the events definitely do not

worthy yarrow
#

I need to implement this filter better for the event tracer

#
String simpleName = event.getClass().getSimpleName();
        return !simpleName.equals("EntitiesLoadEvent")
                && !simpleName.equals("AsyncPlayerPreLoginEvent")
                && !simpleName.equals("PlayerPreLoginEvent")
                && !simpleName.equals("PlayerLoginEvent")
                && !simpleName.equals("ChunkLoadEvent")
                && !simpleName.equals("EntityAirChangeEvent")
                && !simpleName.equalsIgnoreCase("GenericGameEvent")
                && !simpleName.equalsIgnoreCase("BlockPhysicsEvent")
                && !simpleName.equalsIgnoreCase("ChunkUnloadEvent")
                && !simpleName.equalsIgnoreCase("PlayerMoveEvent");

Best way to filter right here kek

#

Also oddly enough, when AsyncPlayerPreLoginEvent is traced by this system, the player cannot log in

#

Doesn't get past encryption and just times out

drowsy helm
#

What the frick

#

Use a for loop bruh

worthy yarrow
#

Yeah duh

#

Was gonna have two kinds of filters -> filter in/out kinda thing

#

I still need to implement support for custom events

bold nebula
#

anyone know how to send this packet to the player?

worthy yarrow
pseudo hazel
#

reflection 💀

#

why are you filtering events like this

worthy yarrow
#

Bc bukkit doesn't expose a collection of events

pseudo hazel
#

but why would you need this

worthy yarrow
#

Debugging event driven systems

pseudo hazel
#

yeah but like, why not listen to the events

worthy yarrow
#

I mean I am... all of them

pseudo hazel
#

why, if you are hardcoding the if check for it, why not just listen to the ones you need

worthy yarrow
#

bc that was just annoying events being thrown when you load in, also it's fixed now anyway

#
public class TracedEventConfig {

    private final Set<String> enabled = ConcurrentHashMap.newKeySet();
    private final Object lock = new Object();

    public void enable(String name) {
        this.enabled.add(name);
    }

    public void disable(String name) {
        this.enabled.remove(name);
    }

    public boolean isEnabled(Event event) {
        return this.enabled.contains(event.getClass().getSimpleName());
    }

    public boolean isEnabled(String name) {
        return this.enabled.contains(name);
    }

    public Set<String> getEnabled() {
        synchronized (this.lock) {
            return new HashSet<>(this.enabled);
        }
    }

    public void toggle(String name) {
        synchronized (this.lock) {
            if (this.enabled.contains(name)) {
                this.enabled.remove(name);
            } else {
                this.enabled.add(name);
            }
        }
    }

    public void loadFromFile(Path path) throws IOException {
        synchronized (this.lock) {
            this.enabled.clear();
            if (!Files.exists(path)) return;
            try (Stream<String> lines = Files.lines(path)) {
                lines.map(String::trim)
                        .filter(s -> !s.isEmpty())
                        .forEach(this.enabled::add);
            }

        }
    }

    public void saveToFile(Path path) throws IOException {
        synchronized (this.lock) {
            Files.createDirectories(path.getParent());
            Files.write(path, this.enabled, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
        }
    }
}```
sudden plaza
#

I'm not very familiar with network programming or how a Minecraft server works, and I want to know if players can hack my server by obtaining an item from their inventory by simply sending a network packet to obtain the item.

eternal oxide
#

Sneaky buggers are hackers, but generally they exploit dupe bugs in plugins to obtain items

pseudo hazel
#

you cant cheat in items by just telling the server you have them, that only works in creative xD

sudden plaza
pseudo hazel
#

well, the server determines what the mob drops

#

the client cant really invent items or pull them out of thin air, as they would probably be ignored by the server and other players

#

atkeast I assume thats what happens in vanilla

worthy yarrow
#

If anything when an interaction occurs involving whatever they managed to get would just be removed by the server

#

The client doesn't handle lifecycles of items and what not so

pseudo hazel
#

yeah the server controls what items a player has

worthy yarrow
#

And that's assuming they were even able to "spawn" anything in with a packet

#

Which I don't think is even possible?

#

If so like steaf said it at least wouldn't be recognized by anything other than the client who sent the packet

sudden plaza
#

Does this mean that the server doesn't accept item acquisition packets from the client at all? Does the server calculate the drop itself and then send a network packet to the client?

pseudo hazel
#

yes

worthy yarrow
#

Yes

#

The server handles lifecycles of all in game objects you could say

pseudo hazel
#

the client is just able to display the state of the server essentially

worthy yarrow
#

Don't get me wrong the server trusts the client too much but not like that lol

pseudo hazel
#

and request changes

#

if the client could spawn in items with a packet, there would have been big problems already xD

worthy yarrow
#

That'd be what we in the biz call "f'ed in the a"

buoyant viper
sudden plaza
#

Are there any people here with Rostelecom wifi?

mortal vortex
sudden plaza
# mortal vortex Rotschild Wifi? yeahp

Rostelecom is russian provider. It's just that there are people from Russia with this provider. I wanted to ask them why the ports aren't opening if everything is done correctly

mortal vortex
#

yes i use rotschild wifi

sudden plaza
mortal vortex
#

ohh sorry

#

I use Rotschild Wfii

worldly ingot
grand flint
#

bedrock ah exploit

misty ingot
#
public Order getOrder(UUID orderID) {
        for (Order order : playerOrders) {
            if (order.getOrderID().equals(orderID)) {
                return order;
            }
        }
        return null;
    }

so i have this method that gives me an Order object from a list
Order myOrder = getOrder(orderID);

if i were to make changes to myOrder through methods i built into that object, would the changes reflect in the list or would i have to put the object with changes back into the list myself

thorn isle
#

if you get the object from the list and then change that object, then by definition the object you're changing and the object in the list are the same object

manic delta
#

Yes

thorn isle
#

and so any change you make on one object is reflected in the list because there is only one object

eternal oxide
#

Java is pass by reference not by value

fossil nacelle
#

Can someone help me, I just want to delete the starter kit that people in my server get from the Essentials Kit when the player drops the items or dies

misty ingot
#

either way, good to know

misty ingot
#

iirc you can also disable starter kit from the main essentials config

fossil nacelle
manic delta
#

Probably there is a option for that

fossil nacelle
#

I can’t figure out where

manic delta
#

Just control + f and type "kit"

#

Here is for plugin dev

fossil nacelle
#

Alright

#

Thanks

sudden plaza
young burrow
#

Hello, is there a way to remove the first person item bounce animation when changing its nbt? on 1.21.8

slender elbow
#

yeah there was some way using a resource pack

thorn isle
#

you can try suppressing the slot change packet if you didn't make any outwardly visible nbt changes

#

the client will update it when next interacting with it somehow, without the animation iirc

#

if you want to change like the name or something outwardly visible, dunno

young burrow
slender elbow
#

i can't remember

young burrow
#

Aww, thanks for the answers though

slender elbow
#

aha!

young burrow
#

Oooooh, thank you so much!

slender elbow
#

and you can use the specific item model on an itemstack with the item_model component

young burrow
#

Thx!

pastel axle
#

So, I'm trying to work around an 11 year old vanilla bug where if you Ctrl+Middle click a block, in this case a populated Chiseled Bookshelf, when you place it back down it temporarily (until modified) loses its blockstate data.

I've verified I can see the items that are "meant" to be in it in the ItemStack in the user's hand using getItemMeta().getAsComponentString(). What would be the right way to read the data? Or will I have to manually parse the string (with the expectation it will probably break every release)?

alpine solar
#

Is there a way to prevent arrows from getting stuck to an item frame?

eternal oxide
#

ProjectileHitEvent probably. Check if its an arrow and its hitting a frame, then cancel

#

are you canceling the hit event or removing the arrow?

alpine solar
#

oh wait

#

wrong channel

potent heron
#

How can I create a plugin that costs money? I don't want to do it, but I want to know.

echo basalt
#

release it as a premium plugin on spigot

#

few rules here and there

potent heron
#

i cant look

pastel axle
pastel axle
echo basalt
#

something like that yeah

pastel axle
#

that just returns an itemstack, which I have

kind hatch
undone axleBOT
echo basalt
#

Ah

#

Then yeah you can get the data off the meta

#

print out the itemmeta class and go from there

unreal sundial
#

can someone help me turn .jar file back to the src folders etc

alpine urchin
#

@unreal sundial welcome to reverse engineering

unreal sundial
#

😎

alpine urchin
#

which jar is it

unreal sundial
#

You want me to send it?

alpine urchin
#

no

#

what project is it

unreal sundial
#

Its a polish one you dont know it

alpine urchin
#

well

#

are you a dev

unreal sundial
#

no

alpine urchin
#

do you want to edit something

#

in the “source”

#

to make a new jar

unreal sundial
#

no why

#

Isn’t that just stealing

alpine urchin
#

whats the point of having source

#

if its not to modify something

unreal sundial
#

I haven’t ever made no plugins so I want to see inside of it

#

how the code looks and folders etc

#

Could be any plugin really

alpine urchin
#

then learn from open source plugins

#

i don’t think you should tackle reverse engineering and learning how to code

#

at the same time

unreal sundial
alpine urchin
#

it has a pretty long definition, but for your sake, they openly share the source code

#

with you

#

that’s one of the benefits of Open source software (OSS)

unreal sundial
#

so they’re free to use?

alpine urchin
#

usually yes

potent heron
#

what fails

alpine urchin
#

i suggest you also watch a series

#

to learn

#

some plugins can be a bit challenging to understand if you’re a beginner

pastel axle
alpine urchin
#

how can a problem be “dumb?”

pastel axle
pastel axle
alpine urchin
#

i was trolling

#

but

#

if you need help and i have time i can attend to yiu

#

thanks for the support matt, it means a lot

grand flint
#

have u seen the updated page

broken heron
#

Hi everybody

Regarding Dialogs,
I was wondering to what extent the Bukkit API has started implementing this system. I did some research in the Bukkit documentation, but aside from two methods — showDialog and clearDialog — I didn’t find much. In particular, I found no system for registering new dialogs from within a plugin, and to make things more uncertain, both methods are tagged as @experimental.

Should I assume that this feature is still under development and more support will be added soon?
Is it too optimistic to think that we’ll be able to easily create dialogs directly from a Java plugin in the near future?
Or did I possibly miss some methods/features in the documentation and it's already possible to do all this — I just overlooked the relevant information?

In the case that this isn’t currently possible — or might never be, for various reasons — Would it be possible to retrieve user input from a datapack-defined dialog inside our plugin code?
Conversely, could we send variables from the plugin to the dialog to dynamically adjust the content, even though the dialog itself is defined statically in the datapack?

thorn isle
#

i hear adventure fully supports dialogs already

chrome beacon
#

Adventure supports Dialogs yes

#

but so does Spigot

chrome beacon
thorn isle
#

bungee's implementation doesn't support items, or does it?

chrome beacon
#

Not sure

broken heron
#

thanks, so I need to have bungeecore in my plugin dependencies to use these features..
register Dialogs from bungeecore API and open/clear from Bukkit API ?

chrome beacon
#

That will be included when you depend on Spigot

#

There is no need to depend on it separately

thorn isle
# chrome beacon Not sure

i recall it being brought up here and i think it was an issue with bungee not having the bukkit classes like itemstack on the classpath/as a dependency, so it physically can't declare dialog api methods that do anything with itemstacks

chrome beacon
#

that is true

#

but there are item hover components, no?

broken heron
thorn isle
worldly ingot
#

The item hover events use raw item data strings

#

I had attempted to add an interface for BungeeCord to accept and have Bukkit ItemStacks implement it so you could pass them seamlessly, it just never went anywhere

raw haven
#

Hi is there any boilerplate project to create a plugin ?

thorn isle
#

there is an intellij addon that creates a plugin project with all the resource and maven boilerplate

chrome beacon
#

The Minecraft Development Plugin for Intellij comes with one. There are also plenty of maven archetypes (or you can make your own)

misty ingot
#
[20:08:20 INFO]: [org.mongodb.driver.cluster] Exception in monitor thread while connecting to server 37.27.174.75:15575
java.lang.IllegalStateException: zip file closed
        at java.base/java.util.zip.ZipFile.ensureOpen(ZipFile.java:846) ~[?:?]
        at java.base/java.util.zip.ZipFile.getEntry(ZipFile.java:338) ~[?:?]
        at java.base/java.util.jar.JarFile.getEntry(JarFile.java:517) ~[?:?]
        at java.base/java.util.jar.JarFile.getJarEntry(JarFile.java:472) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:209) ~[folia-api-1.21.4-R0.1-SNAPSHOT.jar:?]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:169) ~[folia-api-1.21.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[folia-api-1.21.4-R0.1-SNAPSHOT.jar:?]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
        at HypingOrders-1.0-BETA-all-1753898478979.jar/dev.siliqon.hypingorders.lib.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:234) ~[HypingOrders-1.0-BETA-all-1753898478979.jar:?]
        at HypingOrders-1.0-BETA-all-1753898478979.jar/dev.siliqon.hypingorders.lib.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:159) ~[HypingOrders-1.0-BETA-all-1753898478979.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

ehm.. what did i do wrong?

thorn isle
#

mongobongo went bonkers

misty ingot
#

so its not my fault?

thorn isle
#

did you reload something?

echo basalt
#

boys why the fuck is my VANILLA client yellow

alpine urchin
thorn isle
#

sometimes mine turns black

echo basalt
#

and it crashes once in a while

shy junco
#

I have this Velocity plugin code that sends a packet to my Fabric mod:

public void onLogin(LoginEvent event) {
    WrapperLoginServerPluginRequest request = new WrapperLoginServerPluginRequest(1, CHANNEL, new byte[0]);
    logger.info("Sending token request to player " + event.getPlayer().getUsername());
    
    PacketEvents.getAPI().getPlayerManager().sendPacket(event.getPlayer(), request);
}```

The mod receives it:

```ClientLoginNetworking.registerGlobalReceiver(HANDSHAKE_CHANNEL, this::handleHandshake);

private CompletableFuture<PacketByteBuf> handleHandshake(
        MinecraftClient client,
        ClientLoginNetworkHandler handler,
        PacketByteBuf buf,
        Consumer<ChannelFutureListener> responseSender) {
    
    try (FileReader reader = new FileReader(TOKEN_FILE)) {
        String token = readToken(reader);
        PacketByteBuf responseBuf = prepareTokenResponse(token);
        return CompletableFuture.completedFuture(responseBuf);
    } catch (IOException e) {
        LOGGER.error("Error reading token", e);
        return CompletableFuture.failedFuture(e);
    }
}```

But I don't understand how to receive the response from the client mod in my plugin.
chrome beacon
#

Sounds like a question for the Paper discord

#

Also why are you using PacketEvents for that? Velocity has api for sending them

#

(And recieving them)

shy junco
misty ingot
#
for (Order order : playerOrders) {
            plugin.getLogger().info(order.getOrderID().toString());
            if (order.getOrderID() == orderID) {
                plugin.getLogger().info("1");
                return true;
            }

the first getlogger line prints the same string as orderID.toString()
true is never returned

what.

#

(orderID is a UUID)

#

its equal but i am being told its not

thorn isle
#

don't use == on strings if that's what you're doing

#

== isn't equality, it's identity

#

.equals() is equality

misty ingot
#

mother-

thorn isle
#

IDE's should warn you about this

shy junco
slender elbow
#

PreLoginEvent I presume?

#

you might need to make use of the continuation/async event API is velocity to prevent the login process from continuing until your response packet arrives

young knoll