#help-development

1 messages · Page 644 of 1

hazy parrot
#

Or maybe not

#

I'm not sure

icy beacon
#

lemme see

#

yeah it takes vararg cfs

#

not sure how exactly to use it though?

hazy parrot
#

If this exists, you can just group all your cfs, and send embed on whenComplete

icy beacon
#
    CompletableFuture.allOf(
      mainApi.muteApi.loadMuteByDiscordId(id).thenAccept { mute = it },
      mainApi.banApi.loadBanByDiscordId(id).thenAccept { ban = it },
      mainApi.muteApi.getExpiredMutesByDiscordId(id).thenAccept { expiredMutes.addAll(it) },
      mainApi.banApi.getExpiredBansByDiscordId(id).thenAccept { expiredBans.addAll(it) }
    ).whenComplete {
      
    }
#

this is definitely better

hazy parrot
#

Cf.allOf(getBans, getMutes, getX).whenComplete(sendembed)

#

Smth like that

icy beacon
#

yep, thanks for your help a lot 🙂 i'll just finish it like this and then get into coroutines

#

i believe it'll prove to be beneficial in the future

hazy parrot
#

Gl, if you want I can send example of making CompletableFuture into suspendable await() coroutine

#

I used it as an extension to pterodactyl api wrapper

shadow night
#

What's a CompletableFuture? schnitzel

opaque scarab
#

If I send a packet to a client, setting the living entity’s meta data health to 0, will it appear the entity is killed to the client?

echo basalt
#

.

#

A completablefuture is basically a reference of an action that is running

#

You can then chain actions after using the return values

#

Like saying "fetch this from the database, once that's done check their name"

#

It's useful when dealing with paralelization and multithreading

#

Usually for stuff like database operations

#

Or processing something async

icy beacon
#

?di

undone axleBOT
icy beacon
#

np

icy beacon
#

happy reading

#

that's valid

#

xD

#

we need commands for all your articles

#

i think you just emerge from the ground when someone sends an article that you have a replacement for

opaque scarab
#

Though Kody Simpson’s other tutorials aren’t great

tender shard
#

there are two ways described in the article

#

neither of them is bad practice

icy beacon
#

wait static instance is not bad practice?

young knoll
#

Some people will fight you over the static getter

icy beacon
#

i think di is the "accepted" way for many devs

#

just use it

young knoll
#

Even though your plugin is a forced singleton anyway

icy beacon
#

and yeah a lot of people will die on the hill that static getter is bad

opaque scarab
#

What’s bad about the static instance?

tender shard
#

nothing

icy beacon
#

fair

young knoll
#

Something something testability

#

I believe it’s recommended to set the instance to null in onDisable to prevent memory leaks with /reload

#

Even if reload is bad

echo basalt
#

plugman disable**

icy beacon
#

if a server admin does /reload they are on their own now

#

i don't give a fuck

echo basalt
#

restarting the actual server

young knoll
#

Restart the server

icy beacon
#

a plugin should have a designated reload command

#

but generally yes

young knoll
#

That too

icy beacon
#

restart

opaque scarab
#

A friend of mine says /reload is great 💀

icy beacon
#

dump the friend

young knoll
#

Lol

#

The issue is that most plugins aren’t designed for it

tender shard
#

a friend of mine used to do crack cocaine and heroin

opaque scarab
#

Yep. It sucks

tall dragon
#

in production always restart

icy beacon
#

if you are 100% sure that your plugin is fine with reloading then you can reload, but don't account on other plugins continuing to function

#

but generally restarting should be the go to

tender shard
opaque scarab
#

Memory leaks

icy beacon
#

the plugin might break if some of its values for example are not emptied in onDisable and then filled in onEnable

#

that's a very basic example

hazy parrot
young knoll
#

Often the entire plugin instance itself will leak

icy beacon
#

well say it has a list

List<SomeData> data = new ArrayList<>();

@Override
public void onEnable() {
  data.add(...);
}

now if you reload, the list will have doubled values

young knoll
#

Hence why you should set it to null on disable when using a static getter

icy beacon
#

this is a super basic example

young knoll
#

No it won’t

icy beacon
#

plugins are generally more complicated than 1 list

#

actually?

opaque scarab
#

It's fine if you restart, but reloading may cause trouble if the event listener isn’t ended

young knoll
#

It will make a new instance of your main class

#

Which comes with a new list

icy beacon
#

ah, makes sense

#

well i failed with that example haha

opaque scarab
#

Not to mention, clearing everything onDisable is a pain if you have a large plugin

young knoll
#

You should only need to clear the static instance

#

So it can be GCed

opaque scarab
tender shard
#

There‘s a reason why /reload prints a red angry warning

young knoll
#

Well spigot handles most stuff

fervent ravine
#

Hi, I have a problem. I'm trying to use the "Commands" packet on bungeecord, with MessageToMessageDecoder<PacketWrapper>. The packet works, but the problem is that for some reason it disables the chat and the tab. I've been trying for days but I can't find the cause, does anyone know what caused it?

young knoll
#

It’ll unregister your listeners for example

tender shard
#

No need to worry about „memory leaks on disabling“ or anything

#

Just dont use /reload

young knoll
#

Smh if people just designed plugins properly we wouldn’t have this issue

tender shard
#

People would if /reload would be supported

icy beacon
tender shard
#

Why support something that the server itself doesnt support

young knoll
#

Well it was supported when it was made smh

#

But people didn’t support it back then

#

Yknow in the Stone Age

tender shard
#

Idk about that

#

I doubt it was ever supported, eg how would load: STARTUP work if the worlds are still loaded

young knoll
#

I doubt /reload had a warning when it was first implemented

#

Maybe it did idk

#

Alright new idea

#

supports-reload in plugin.yml

fervent ravine
icy beacon
#

but what would one do with it

#

like a plugin supports reload cool

#

now what?

#

would /reload just reload the plugins that support it?

#

or is there another idea

cinder abyss
young knoll
sterile breach
#

@tender shard i have one question. How/where your block data container libs store the data ? Use the same system of PDc?

young knoll
#

Uses coords as key

icy beacon
tender shard
sterile breach
#

Thanks

pseudo hazel
#

why suspend the fun

#

thats cruel

icy beacon
pseudo hazel
#

đŸ«„

shadow night
tender shard
shadow night
#

I had the idea of having overrides in JavaPlugin that would run on reload instead of onEnable() and onDisable() like the usual ones schnitzel

icy beacon
#

because otherwise /reload will stay a bad practice for server admins

#

and they just won't run it

#

only incompetent server admins will indulge

lilac dagger
#

my plugin reloads just fine

#

in fact my /plugin reload just does ondisable plugin.onenable

icy beacon
#

we're talking about /reload not /plugincommand reload

sullen canyon
#

I thought /reload calls onDisable and then onEnable again

shadow night
#

But it could be such a useful command if plugin devs could implement it themselves properly. Like, some plugins have /plugin reload and it would be cool if those could be ran on /reload schnitzel

lilac dagger
#

they are run i think

shadow night
icy beacon
#

still quite clunky

lilac dagger
#

just impl on disable propely

icy beacon
#

i'll continue not explicitly supporting /reload in my plugins unless a psa that "it's now fine and your plugins should do it" will be out by md_5

lilac dagger
#

not sure why /reload is such a bad practice

shadow night
icy beacon
shadow night
#

Yk how painful it is to restart the whole server with a ton of worlds and plugins to change one character in a config file schnitzel

icy beacon
#

that very plugin should have a /plugincomnand reload

tender shard
#

idk spigot takes 4 seconds for me to start

icy beacon
shadow night
icy beacon
icy beacon
shadow night
icy beacon
#

these 3 lines look menacing

#

ok i do not like this

#

what if a plugin takes more than 2.5 seconds

#

quote from a thread

There's more to it than non-persistent data - it's nothing a developer can "adapt" their code to rectify (i.e. by using onDisable), the fault is with the user for running /reload, not with the developer. A plugin that uses any kind of lower level methods (esp. reflection), such as injecting into the command map or injecting new enchantments, is likely to completely break and start spewing weird stacktraces. This isn't anything to do with lazy or sloppy coding, it's just how it is.

Also, you'll get memory leaks when you use /reload

#

i'll go on coding

#

cya all

shadow night
#

Weird code schnitzel

vast ledge
#

I created Docs for my entire Project schnitzel

#

I want to die schnitzel

shadow night
#

Get yourself a refreshing schnitzel schnitzel schnitzel

vast ledge
#

A single Function schnitzel

shadow night
#

I never knew that a constructor counts as a method that returns something schnitzel

vast ledge
#

It returns itself schnitzel

shadow night
#

It is basically just an initializator for an actual instance of the class, right? schnitzel

vast ledge
#

yes schnitzel

#

PlayerData playerData = new PlayerData(); schnitzel

shadow night
vast ledge
#

Lets just say, that was alot of documentation
schnitzel

shadow night
#

w
o
w
schnitzel

icy beacon
shadow night
#

Well, it's fun. Quite literally schnitzel

icy beacon
#

nah it's suspended

#

not really fun

vast ledge
#

IT WORKS schnitzel

#

I WANT TO CRY schnitzel

icy beacon
cinder abyss
#

cry

shadow night
#

I would make a javadoc for my api, but I have no api to make it for ._. schnitzel

icy beacon
#

i would make a javadoc for my api, but i'm making it in kotlin so i'd struggle with making javadocs a bit

warm mica
#

Whats going on with all these emojis

vast ledge
#

Just look at this beauty schnitzel

icy beacon
warm mica
#

Lol

shadow night
vast ledge
#

Its a plugin schnitzel

#

not an API schnitzel

icy beacon
shadow night
icy beacon
#

i'd be a bit happier in life

tender shard
#

well... but what if the sausage bursts tomorrow?

vast ledge
#

I just want to be able to look at my website, and search for, "PlayerData" schnitzel

#

and I can see schnitzel

#

PlayerData schnitzel

#

Heres the constructor schnitzel

#

heres the functions schnitzel

shadow night
#

I love well-documented shit, and tbh I even kinda like writing documentation schnitzel

vast ledge
#

I dont schnitzel

#

I want to die schnitzel

#

I wrote 400 Lines schnitzel

tender shard
#

the sausage will burst if you don't write javadocs

vast ledge
#

of documentation schnitzel

shadow night
vast ledge
shadow night
vast ledge
tender shard
#

i think my pig whistles

vast ledge
#

what the fuck schnitzel

shadow night
#

You got a pig? schnitzel

vast ledge
#

I need an explannation to how a you have a pig, and how its whisteling schnitzel

vast ledge
#

Then how is it whisteling schnitzel

tender shard
#

i used to have chickens though

#

and a few horses

vast ledge
#

Now... schnitzel

tender shard
vast ledge
#

You can image what they became schnitzel

brazen epoch
vast ledge
#

It was a lovely dinner schnitzel

vast ledge
shadow night
vast ledge
#

Yea schnitzel

#

not to sure who the pig is schnitzel

brazen epoch
#

:I

vast ledge
brazen epoch
#

I'm not insulting you

#

Just...

shadow night
#

And don't insult a follower of the great and holy schnitzel schnitzel schnitzel

brazen epoch
#

Ummm

tender shard
vast ledge
#

The schnitzel will win schnitzel

#

Imma go play some Modern Warfare 2 and let my anger out on some kids schnitzel

vast ledge
#

@tender shard Can i make a sub sub domain? schnitzel

tender shard
#

Yes

vast ledge
#

Like docs.carrythat.bedless.dev? schnitzel

#

Man now i have to add a website to apache schnitzel

chilly hearth
#

e

vast ledge
#

frick this i cant be bothered schnitzel

#

f schnitzel

chilly hearth
#

Wow

tender shard
chilly hearth
#

Hi Alex wass up

tender shard
#

hi, playing rdr2

#

and thinking about why the sausage burst

#

how could it happen

#

why

vast ledge
tender shard
#

were there no safety measurements taken place to prevent this

vast ledge
vast ledge
#

Im done I'm going to stop trying to type

vast ledge
vast ledge
novel pendant
#

Does anyone know any techniques to interpolate block displays from the center of the block?

ivory sleet
#

@shadow night you as well

tawdry echo
#

I want to make the progress of the bossbar show how far I am from the center of the region (if I am in the middle it will be full) I have absolutely no idea how to calculate it

pseudo hazel
#

just get the distance between you and the region center

#

you need a point from which the bar starts as well

#

and then the bar progress is just that distance over where you started to count from

wet breach
#

the easiest is just a straight line measurement

glossy venture
#

use pythagoras to get the distance

wet breach
#

but a straight line measurement actually ignores how many blocks if you wanted to measure in actual blocks

tender shard
#

why not just use Location.distance(anotherLocation)

glossy venture
#

true, might be able to closely estimate that though

wet breach
#

like if you are elevated, at an angle etc

#

I would probably use that just because I am lazy and don't really care about accuracy in terms of blocks

tender shard
#
double maxDistance = ...; // whatever is supposed to be the distance cut off
double currentDistance = currentPos.distance(centerLoc);
double distancePercentage = currentDistance / maxDistance;
if(distancePercentage > 1) distancePercentage = 1;
double bossBarValue = 1 - distancePercentage;
#

sth like that I guess

livid dove
#

Use distance squared

#

Don't make java cry

glossy venture
#

that doesnt work

tender shard
#

distanceSquared and distance are basically equally fast

tawdry echo
#

from a straight line I know how to calculate but I have no idea how to do it along a curved line (corner) because it is obviously longer than the radius from my configuration

eternal oxide
#

curved?

glossy venture
#

oh u want to pathfind it

opaque scarab
opaque scarab
wet breach
#

it can be higher as well

#

the range is server side not client. All the client cares about is what it spawned with

tender shard
# livid dove Don't make java cry

I know this is a shitty way to benchmark, but... i just wrote a tiny Location class with distance and distanceSquared, ran both 1 million times and the difference was 2ms vs 3ms (for calculating the differences one million times in total, not per calculation ofc)

opaque scarab
tender shard
#

doing it 100 million times, distance was even faster than distanceSquared (130 vs 90 ms)

opaque scarab
tender shard
glossy venture
tender shard
#

i figured that whatever I call first is a bit slower. if I move the distanceSquared stuff below the distance stuff, then it's other way around. in both cases, it's always about 130 vs 90 ms

eternal night
#

your CPU is

tender shard
eternal night
#

doing magic stuff

glossy venture
#

might be the gc

#

or smth

#

nah

#

idk

tender shard
#

as I said, it's a shitty benchmark. but good enough to show it's really not important whether it's squared or not

vital yacht
#

It's probably the JVM warming up

glossy venture
#

oh mb i thought it said the last one is slower

tender shard
#

tried again on windows / intel i7 9700K and here it's basically equally fast

#

the other screenshot was from a mac m2 max

livid dove
#

lmao

#

but legit fair cop

tender shard
glossy venture
#

thats a nanosecond

tender shard
#

lol

livid dove
#

0/10

glossy venture
#

a millisecond per operation would be horrible

tender shard
#

and idk if Location has any further improvements, I just used Math.pow and Math.sqrt

livid dove
#

Yeah jokes aside square hasnt been a problem for quite a few years now

#

newer cpus go brt

glossy venture
#

why math.pow

tender shard
#

also funny how my laptop is 7 times faster than the i7 9700K

livid dove
#

lol

#

Btw

tender shard
vast ledge
#

xD

livid dove
#

how bad would it be that, to get the materials in MC easily, I depend on spigot JUST for the material enum

shadow night
chilly hearth
wet breach
vast ledge
#

35Ghz

tender shard
river oracle
wet breach
lilac dagger
#

and here i was never having a normal distance

wet breach
#

first you need to identify if the JVM is actually making use of any CPU specific instructions for speed gains or not

#

other then you need to compare with warmed up JVM

tender shard
#

I now ran it in a loop over and over again to avoid "warm up" and on the m2 mac, Math.sqrt is basically free

wet breach
#

any cpu can do math regardless. However CPU specific instructions do exist to speed up such things

#

there like shortcuts

tender shard
#

while on windows / intel i7 squared is usually a tiny bit faster

livid dove
vast ledge
#

can you send test

#

i wanna know

#

if ryzen is faster

tender shard
#

i can run it on a ryzen 5 3600

vast ledge
#

I have a ryzen 9 5900X

wet breach
#

just saying your test is flawed is all and doesn't actually account for anything other then just the JVM. Using the JVM as the test bed for how fast a CPU, is not appropriate

tender shard
#

well I only have java installed in a VM on the ryzen and it's running at the limit, so I cannot currently test it on the ryzen (don't wanna install java on the proxmox host)

vast ledge
tender shard
tender shard
#

oh wait that's the old code

wet breach
#

I think the best way to test it would be for a minute or two warm up the JVM with some garbage data

#

then run the test afterwards

tender shard
#

you can just run it and wait as long as you want

wet breach
#

that isn't accurate

tender shard
#

it keeps switching between distance and distanceSquared

wet breach
#

the JVM optimizes code being ran continuously AKA the JIT, which further skews results depending on what you are actually trying to test

vast ledge
#

Do I need to compile it?

wet breach
tender shard
#

I know that it's not a "perfect benchmark" lol. the only purpose of that code is to show that it's totally irrelevant whether someone uses distance() or distanceSquared()

wet breach
#

oh

#

these days, given how good cpu's are the difference is miniscule I agree

tender shard
#

the note about the m2 taking only 100ms while the i7 took 700ms was just something I noticed on the side

#

still kinda amazing

vast ledge
#

Dayum

#

the m2 is fast

#

I mean i still have an old gen from ryzen

#

but still

#

100ms like cut my time in half

shadow night
#

I wish spamming schnitzels wasn't forbidden lol

vast ledge
#

😩

shadow night
#

like, it's our cult, our religion

vast ledge
#

we need the mods to join our religion

shadow night
#

yes

#

but not the sinners

#

the unschnitzeligers

#

"Diese unschnitzeligen"

vast ledge
#

@tender shard Can i change the default dir when i ssh into my server?

shadow night
#

like .bashrc?

vast ledge
#

nah

#

when i ssh 192.168.0.234

#

It puts me in the snap dir

#

its annoying

#

i have to cd ..

#

out of it everytime

shadow night
#

last time I've set default dir to load into I just put cd whatever in my .bashrc file

#

or what was it? idk

#

something like that basically

wet breach
#

yeah bashrc will work if you are using bash as the main terminal

vast ledge
#

echo "cd ~/Desktop/Java\ Files" >> ~/.bashrc

#

ayy

#

works

#

thanks

shadow night
#

I used that shit in termux lmao

vast ledge
#

Bruh where is the nginx config

#

why isnt it in

#

/var/www/nignx

#

nginx**

#

Theres a wiki

shadow night
#

why is there no "clean" here

vast ledge
#

What type of click

#

block place

shadow night
#

mc dev plugin is shit

vast ledge
#

If the click is in a and isnt an interact it wont get sent

#

All clicks are categorized

#

There is the open book packet

#

which when rightclcking a book opens it

#

Set camera packet

#

Chatmessage packet, when you clik on a clickable text

#

You need to tell me what the click is for

#

Ex is it ina contianer

#

then look at the Click Container packet

#

it detects clicks

#

Interact packet

#

Player Action packet

#

I dont think theres a packet for that

#

the wiki doesnt contain one

#

What are you tring to do

tender shard
#

why don't you just listen to PlayerInteractEvent

eternal oxide
#

some clicks don't generate events

vast ledge
#

Dont they?

eternal oxide
#

empty hand clicking air

vast ledge
#

with entity interact

eternal oxide
#

its not

#

or its fired canceled, I forget

eternal oxide
tender shard
#

iirc it's right-clicking air with an empty hand that's not detected

vast ledge
#

PlayerInteractEvent

#

detects

#

aswell as rightclick

tender shard
river oracle
#

Building my first javafx app 😭 new stuff is always so hard I forget

eternal oxide
#

Does not detect Empty hand clicking air

shadow night
vast ledge
#

The more you know

tender shard
#

there's also a few jira issues about that

vast ledge
#

Somebody should fix that

shadow night
#

why do my worlds save and load so long? restarting server is a pain

shadow night
tender shard
shadow night
#

11 secs for one world

#

why

tender shard
#

idk, mine starts up in 4 seconds including default world + nether + end

shadow night
#

last time I used some fancy fork it loaded in a second

vast ledge
#

What

#

it gets fired

#

Im left clicking in air

#

with empty hand

#

and its getting fired

#

So I wasnt that wrong with my assumption that it gets fired when clicking air with empty hand?

shadow night
#

for me it didn't

vast ledge
#

Welp idk it works

shadow night
#

try with vanilla maybe? idk

vast ledge
#

wdym vanilla

#

I have nothing that mods my packets

shadow night
#

you surely are using a modified version of the game

#

you can never know if some mod is changing something for any reason

vast ledge
#

I made the pack

#

Imma stream a fresh ver of the gama

#

game**

shadow night
#

well, schnitzel schnitzel

tender shard
shadow night
#

10 seconds is an awful loading time

#

and it saves about the same amount of time

#

and I also don't like the amount of 0%

#

and this has been happening since I installed the server for testing my plugins for 1.19.4+

#

even in the test run, with no plugins

vast ledge
#

fuggin stupid

quaint mantle
#

what is this FileConfigurations in bungeecord ?

tender shard
#

left click ofc sends a packet because you swing the hand

#

right click doesnt show any animation and doesnt do anything else and hence doesnt send any packet at all

vast ledge
#

rightclcik could be attempting to eat an item tho

tender shard
#

"empty hand"

shadow night
#

it might be possible I forgot the most important part of the schnitzel schnitzel lmao

vast ledge
#

But righclicking air witha furnace triggeres it, im not doing an action?

shadow night
#

you have an item in your hand

vast ledge
#

Yes, but its a block and im clicking on air?

#

So why would it send a packet

shadow night
#

but the server handles the place, not the client

vast ledge
#

Minecraft is racist against hands, if its empty and its right they dont trigger an event

shadow night
#

well, you reminded me of a joke

vast ledge
#

Thanks

#

ill take that as an insult

shadow night
#

"Warum schreiben Frauen mit der linken Hand? Weil sie keine Rechte haben!"

vast ledge
#

....

shadow night
#

well, sorry

vast ledge
#

Ich habe den witz schon so viele mal gehört, vielleicht haben sie ja bald rechte

#

MIT License (c)

#

get licensed

shadow night
vast ledge
#

bich

#

oh

#

ye

#

i was trying to fix my website

shadow night
#

ever wanted a schnitzel without the schnitzel lol

#

second post

#

of this image

vast ledge
#

Where do i find the apache2 config?

tender shard
#

/etc/apache2

vast ledge
#

thanks

#

my brain is to powerful

shadow night
#

linux is so cool, but way too much of a schnitzel

#

maybe it's great it is a schnitzel this much

#

a gift from the great and holy schnitzel

vast ledge
#

What the frig is the M-6 Hotkey

#

ive never had to copy stuff in a linux terminal

tender shard
#

M is your meta key

vast ledge
#

the fck is a meta key

#

alt ?

tender shard
#

in nano usually alt

#

might be useful if you'd mention that you're talking about nano

vast ledge
#

Ok

lilac dagger
#

i used nano for windows and ended up putting it in path

#

best editor ever

vast ledge
#

Now i gotta restart apache

shadow night
#

wait I didn't have that before

vast ledge
#

cant be bothered

#

imma jut restart the server

shadow night
vast ledge
#

Gotta love Lan DNS records

#

How do I copy data from my machine to the server

shadow night
#

what the heck is a RecipeChoice

vast ledge
#

I know how to do it in revesr

#

scp

vast ledge
shadow night
#

like what the heck

#

how do I

#

and it's obviously an Interface

tender shard
#

a recipe choice can be an ExactChoice (an itemstack) or a MaterialChoice (a material or a "group" of materials)

vast ledge
#
FurnaceRecipe furnaceRecipe = new FurnaceRecipe(namespacedKey,
                getItemStack(), new RecipeChoice.MaterialChoice(Material.POTION), 0, 20 * 4);
        setRecipe(furnaceRecipe);
#

There iis an example

shadow night
#

I have an ItemStack

#

well okay, I did new RecipeChoice.ExactChoice(myItemStack) and it worked

quaint mantle
#

how do i create my plugin folder with bungeecord ?

tender shard
#

how can you use mkdir() in your code without knowing what it is?

vast ledge
#

get path

#

im blind

#

holy

#

yea

quaint mantle
#

i changed

vast ledge
#

You know .mkdir is

quaint mantle
vast ledge
#

make directory

quaint mantle
tender shard
#

why are you using it then

vast ledge
#

Im not stupid

#

If you dont know what something is, why are you using it?

quaint mantle
#

i don't used

vast ledge
#

You did in the ss

quaint mantle
#

i used createnewfile

#

yes in ss true but i forget

vast ledge
#

then use .mkdir

#

it creates the directory

shadow night
#

I'm the greatest idiot in the world

vast ledge
#

like we all said

tender shard
#

to create a folder, you create a file object with the path and then call mkdir() on it

vast ledge
tender shard
#

also you are not supposed to hardcode / slashes

shadow night
vast ledge
#

Yea

#

File.seperator

tender shard
#

yeah or the nested File constructor

shadow night
#

all these weird file seperators

#

why can't everyone just agree to do /

vast ledge
#

no

#

i use

#

what I want

#

deal with it

#

im gna use + as file seperator

opaque scarab
#

I’m using the packet ClientboundUpdateAttributePacket. It takes two arguments: entityID, Collection<AttributeInstance> I’m guessing I should create a list of AttributeInstances, but how should I add an attribute to set max health?

vast ledge
#

Why do you need a packet for that

#

Just use the spigot API

#

It allows you to add attributes to players and entities

opaque scarab
#

I need a mount to appear it has less health than it really has

shadow night
#

Yoo I did it, I've made schnitzel in minecraft, now time to make a texturepack and I'm done

vast ledge
#

A packet sent from the server to the client, wouldnt that update theyre serverside health aswell

opaque scarab
#

I’m creating a plugin that makes the player sit on blocks

vast ledge
#

So you want them to ride an armourstand?

#

Does it accutally display hearts like horses?

opaque scarab
#

Yes

#

The sitting works

vast ledge
#

dayum

#

Didnt know that

opaque scarab
#

I just don’t want hearts

#

It sucks

#

I thought of using a non living entity, but I need to to be invisible

vast ledge
#

I guess, you could could create a new Attribute Instance for max health

tall dragon
#

shoulnt you be able to use an invisable boat/minecart instead?

#

those dont show health

opaque scarab
tall dragon
#

im fairly sure they can

opaque scarab
#

Let me check

vast ledge
#

yea

tall dragon
#

dont quote me on that though lmao

vast ledge
#

just add the effect

#

theyre an entity

#

thats how most sitting plugins work

#

Oh no

#

hypixel does arrows

#

Thats how they got around that

tall dragon
#

yea i guess u can even sit on stuff like an arrow

opaque scarab
quaint mantle
#

why i got this warnings ?

tall dragon
#

because you're not assigning the result of the method to a variable

tender shard
#

the warning tells you why

opaque scarab
tender shard
#

can't every entity be invisible?

tall dragon
#

thought so too

opaque scarab
#

As far as I know, only living entities

#

I’ve tried entities like snowballs, minecarts, boats, etc

#

There are no #setInvisible(boolean) methods for them

chrome beacon
#

setInvisible is only for living entities

tender shard
#

well just hide it manually then

vast ledge
#

Yea

tender shard
#
    @EventHandler
    public void onArrow(ProjectileLaunchEvent event) {
        for(Player player : Bukkit.getOnlinePlayers()) {
            player.hideEntity(this, event.getEntity());
        }
    }
vast ledge
#

Give them invis effect

#

right?

#

or that

opaque scarab
chrome beacon
#

What entity are you trying to hide?

vast ledge
#

Arrow

#

Or armorstand

opaque scarab
#

Yeah

tender shard
#

use Player#hideEntity

vast ledge
#

he wants to be able to sit

tender shard
#

yeah ofc, I sent a video that it works

chrome beacon
#

hideEntity probably wouldn't work if you want to ride the entity

shadow night
#

hideEntity like completely hides them by not sending packets iirc

chrome beacon
#

You can spawn an invisible armor stand or smth

vast ledge
#

Yes

opaque scarab
vast ledge
#

but that shows hearts

#

supposedly

#

still not sure why the armorstand shows health

chrome beacon
#

You'd need mods for that though đŸ€”

opaque scarab
vast ledge
#

Yea

tender shard
vast ledge
opaque scarab
vast ledge
opaque scarab
opaque scarab
vast ledge
#

You should be able to just apply invisibility to the arrow, that it still sends packets but its not visible

opaque scarab
#

Gtg rn though

vast ledge
#

Yep the arrow is visible

#

if you look at my crotch

#

That is one of the worst sentences ive said in a while

tall dragon
tender shard
#
player.getWorld().spawn(player.getLocation(), BlockDisplay.class, disp -> disp.addPassenger(player));

displays work just fine

#

not even needed to make them invisible or anything

vast ledge
#

perks of 1.19.4 +

#

im still on 1.19.2

#

I wanna make my plugin backwards compatible tho

#

so you can use it even in later versions

tender shard
#

nobody complaining about the fact that I used the ChatEvent to do this? lol

vast ledge
#

nah

#

thats fine

#

type in chat

#

sit

#

and you sit

#

xD

tender shard
#

yo that sounds like a stupid plugin idea

#

"i shoot" -> shoots arrow

vast ledge
#

it woudl be funny

tender shard
#

"i sit" -> sits down

vast ledge
#

i eat

#

eats

tender shard
#

"i break the block 2 to the left" -> ...

#

damn I will do that

vast ledge
#

i turn 90°

tender shard
#

I'll call it "Minecraft but the controls are overly verbose"

tall dragon
#

cli minecraft

tender shard
#

if anyone steals this idea, I will use this message to prove that it was my idea

tall dragon
#

"i look which block is in front of me"

chrome beacon
#

Don't forget speech to text

tender shard
vast ledge
#

yes

#

get the api

tall dragon
#

lmfao

tender shard
#

damn taht's gonna be amazing

vast ledge
#

from google

tender shard
#

gnoogle*

vast ledge
#

YES

#

Make a res pack

chrome beacon
#

There actually was a mod a long time ago that allowed you to player Minecraft through voice commands

vast ledge
#

that adds voice for the functions

chrome beacon
#

oh there is?

vast ledge
grim ice
#

plus different language can be used

#

so hard coding will be semi impossible

tall dragon
#

ai bigbrain

tender shard
#

"minecraft but the controls are overly verbose"

#

yikes

#

new try

#

failed to record

#

here it is "minecraft with overly verbose controls"

trim lake
#

Is there some limit of chars for YML.set method or why this happening?

kind hatch
# tender shard

Alex out here elevating twitch chat based streams to a whole new level.

tender shard
#

the pathfinding is a bit very slow, that's why it didnt start to walk to the first position

compact haven
trim lake
#

Im just getting that string from other file

#

Im just trying to to auto update from .yml files for my plugin

compact haven
trim lake
#

idk why this is happening xD

compact haven
#

can you sout oldConfigFile.get(path) along with oldConfigFile.get(path).replace("\n", "--- NL ---");

#

like I'm just curious

tender shard
trim lake
#

or this wtf

compact haven
trim lake
#

why is second(s) not in '

compact haven
#

because they don't need to be

tender shard
#

because it's not needed

compact haven
#

the others are because of the & and : special symbols

trim lake
#

interesting

tender shard
#

if you want it to be in quotes, you can get the YamlConfiguration's "yamlDumperOptions" through reflection and set its ScalarStyle to DOUBLE_QUOTED or SINGLE_QUOTED

#

either replace the existing ScalarStyle with reflection too, or create a new DumperOptions object and replace the original one

#

the default is PLAIN which means it only uses quotes when needed

vivid skiff
#

Is possible to get a player pipeline in bungeecord?

trim lake
tender shard
#

why are you replacing \n with --- NL ---?

#

if you want the string to contain a literal "\n" then you gotta replace it with \\\n

compact haven
#

Just curious if get was returning a string with new line

#

he would know if his own string had a literal \n

#

why you trying to find fault

#

Marek try opening in a new editor, can yours be force word-wrapping?

trim lake
#

at the end of the day, file is working fine but is looking like shit 😄

trim lake
#

VisualStudioCode too

compact haven
#

Check the javadocs for DumperOptions from snake yaml if there’s a setSplitLines

#

that should be the problem

trim lake
#

Looks like there is limit of chars for line, still gonna need to look at that DumperOptions 😄 I want all text to be in " " its looking better

quaint mantle
tender shard
#

nothing yet

#

right now you can only walk to coords (including jumping and trying to avoid obstacles), explode, and get drunk

tall dragon
#

ofc u can get drunk

quaint mantle
#

It's actually very interesting idea

#

I like it

#

You should make it work with NPCs too 😈

vast ledge
#

I did it

#

I added my site

#

im very bad at apache2 stuff

#

but it works 😄

#

The nginx still aint redirecting me tho

#

Its fine

#

Yay

#

Creating my own itnernal dns records is fun

#

😄

trim lake
#

I probably cannot use DumperOptions with YamlConfiguration in spigot api right? I will need use diferent yml mby?

hazy parrot
#

Yeah looks like you can't, u can use snakeyaml directly tho

#

What you want to do

trim lake
#

fix this

#

is not problem acctualy, but its looks bad

hazy parrot
#

How does it looks bad

#

You want to have double quotes?

trim lake
#

It supouse to be in one line like this:

trim lake
hazy parrot
#

Looks like Alex already responded to that

#

Changing dumper options is not exposed by api

trim lake
#

yep, that will be lot of work at least for me

#

I have only basic and jump into spigot API, not best idea probably xD Gonna need to learn some java stuff first

tender shard
# trim lake fix this

how did you even create this? FileConfiguration#save should not write that as it's not even valid yaml

#

oh wait, it is valid

#

yeah then you'll have to use the dumper options

#

oh there's an easier way I just found

#

YamlConfigurationOptions#width(Integer)

#
        YamlConfiguration myYaml = new YamlConfiguration();
        myYaml.options().width(Integer.MAX_VALUE);
        myYaml.set("something", "some long string");
        myYaml.save(new File(plugin.getDataFolder(), "test.yml"));

this will only add line breaks after like 2 billion characters @trim lake

young knoll
#

What if my string is longer than that :(

tender shard
#

if you wanna use it on JavaPlugin#getConfig() you btw also have to cast it to YamlConfiguration (or cast the options() to YamlConfigurationOptions)

tender shard
flint coyote
silver robin
#

is there an event that gets called when a player picks up an item from ground, but after the item has entered the inventory?
I'm currently facing the following problem: on EntityPickupItemEvent, if the player inventory is full and I modify the ItemStack in any way (lore, displayname, etc) in that event (so it's different than some item in the inventory where that item would get stacked) , the item gets lost

young knoll
#

You can cancel the event and add the item yourself

#

That way you can see if it fails to get added

quaint mantle
#

I couldn't do it

    public static void setup() throws IOException {
        File file = new File(ProxyServer.getInstance().getPluginsFolder() + "/mana-friends/player_data/test.yml");
        File path = new File(ProxyServer.getInstance().getPluginsFolder()+"/mana-friends/player_data");

        if (!file.exists()) {
            path.mkdir();
            file.createNewFile();
        }```
#

i got this warnings still

#

am i create boolean variable ?

young knoll
#

You don’t necessarily need to do anything

#

Warnings are just warnings

#

But essential those methods will return false if the creation of the file/directory fails

quaint mantle
#

can i ignore this warnings ?

young knoll
quaint mantle
#

actually my code works fine

#

i just wanna remove this warnings

#

if i can ignore i will do

young knoll
#

You can also just throw an IOException if they return false

#

Since your method already has throws IOException

quaint mantle
#

well i do

minor palm
#

Also I recommend doing mkdirs

#

Instead of mkdir

echo basalt
#

god why do people have to use guice to do dependency injection in plugins woeisme

#

Mfs out here making a full API and setting every method to private and using guice to auto-inject around

quaint mantle
rich geyser
#

quick question that i feel like has an easy way i'm missing: how can i make a recipe either
a) craft 2 instead of just 1
b) have an item that stays in the crafting table when crafted

#

think armor trim wise where you're just duplicating it so it spits out two (the one you duplicated + original) or in crafting table the original stays etc etc

young knoll
#

Crafting 2 is easy enough

#

Just pass a stack with size 2 as the result

rich geyser
#

ShapedRecipe esp = new ShapedRecipe(NamespacedKey.minecraft("essspirit"), item); this is what i've currently got, i'm assuming the ItemStack would be where i pass the 2?

young knoll
#

Yes

rich geyser
#

lil amateur ish when it comes to plugin dev, usually just spaghetti something together if i need it, so pardon my ignorance LMAO

#

thank you thank you

quaint mantle
#

what is this ?

#

am i create string builder ?

young knoll
#

Are you using paper api

quaint mantle
#

no

#

😄

young knoll
#

Ah wait bungee

quaint mantle
#

yes

#

i was writing

#

yes i got it

#

i need string builder

young knoll
#

?jd-bungee

#

?jd-b

#

I’m bad

#

?jd

quaint mantle
#

i mean i need TextComponent

#

like this

#

player.sendMessage(new TextComponent("blabla"));

young knoll
#

Yeah I guess bungee deprecated all the string methods

#

Wow bungee is paper confirmed

livid dove
quaint mantle
#

well i got this

rustic geyser
#

hello everyone

#

i want to create a nms plugin

#

so i install all i need for it (buildtools,maven plugin, etc...)

#

but nothing work

#

no issues

#
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>```
quaint mantle
#

can u send ur maven's picture ?

#

from dependency

river oracle
rustic geyser
#

i already saw this

#

<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmcspigot1.18.2-R0.1-SNAPSHOTđŸ«™remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmcspigot1.18.2-R0.1-SNAPSHOTđŸ«™remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>

#

this is mine maven plugin

#

its the same

river oracle
#

are you using the right jar file

#

are you building with maven

rustic geyser
#

yes

river oracle
#

then everything should work

rustic geyser
#

where i set the jar file

#

JAVA_HOME ?

quaint mantle
young knoll
#

Why is jar in there

golden turret
#

why does it not have color?

#

1.20.1

placid moss
#

i dont think console has color

river oracle
#

you'd need to make a console that is able to parse all the color codes minecraft has and redisplay the text

golden turret
#

but i think that 1.19.4 was fine

river oracle
#

in java this is as easy as just making a process to run the spigot server than redirecting the output stream and parsing the color codes to readable ansi color

river oracle
remote swallow
#

funky S

#

§

golden turret
#

it is a double s

#

double s = '§' hahahaha

umbral yarrow
#

Hello. I am currently working on a plugin where I need to send data from a frontend client (The java minecraft plugin) to a backend. I want to verify if a player is realy connected to the minecraft server. I saw https://sessionserver.mojang.com/session/minecraft/hasJoined and thought that may work but I was unable to get the server hash. Does anyone have any ideas or directions they could point me in?

quaint mantle
#

Do yall think it would be better to use nms mappings or protocollib im making an animations lib and npc lib for myself to use. I only have experience with nms mappings but I would like to make this project work on 1.16, 1.17 and up

sullen marlin
wet breach
#

either they are taking a long time to connect or they disconnected

#

there is a time out in how long it takes to connect

#

and disconnecting generally throws the quit event

#

depending how far along the connection they gotten

umbral yarrow
wet breach
#

just check the player list then

#

any server that doesn't have the player shouldn't do anything, not sure why they would be interested in doing something to begin with if the player isn't on that server lol

#

I think you are either over thinking this, or thinking it needs to be more complex then it really needs to be

umbral yarrow
wet breach
#

and how would they do that?

#

if you connected to my server how in the world are you from your MC client going to modify the plugin?

#

or manipulate the data on the server o.O

#

you got bigger issues if this is somehow possible

umbral yarrow
wet breach
#

and how are they going to do that from the client?

umbral yarrow
wet breach
#

they couldn't but ok

quaint mantle
#

Does anyone have a github project that has nms support with multiple versions

wet breach
#

you are obviously worrying about something that is in theory not really possible. Sending incorrect data via packets is possibe, but like it has to be packets the server understands first and if its incorrect in most cases the server will cat ch this

#

plugins and the data they hold are not directly interactable via the client

#

so whatever you are worried about is non-existent

#

the only thing I can imagine you are worried about would have to do with offline mode

#

and if that is the case we don't support offline mode here 🙂

umbral yarrow
#

I have the minecraft plugin which could be running on many different servers which each instance of the plugin will connect to my NodeJS server through a custom api.
If I don't have some way for the NodeJS server to verify that the players are acutally connected to that minecraft server A modified plugin could change the custom data of any player saved on the NodeJS server.

wet breach
#

this is why end to end encryption exists

spark lynx
#

how to lookup the start of an event in nms

wet breach
#

the NodeJS server doesn't need to know if a player is connected because the server should report that is where they are

#

only thing you have to concern yourself with, is protecting your endpoints from outside use, which you do by using encryption

#

this is why certs exist and things like https

sullen marlin
#

If they're your servers this is a non issue

wet breach
#

you can authenticate servers with certs as well

umbral yarrow
sullen marlin
#

If they're not your servers, then this problem can't be solved and a has joined wouldn't help since they could still just send garbage

umbral yarrow
wet breach
#

then you just have to anticipate garbage data, but the question is though, why would someone want to falsely report a player being somewhere they are not?

sullen marlin
#

Well your issue can't be solved then

#

Think of a way to trust your servers

wet breach
clever raft
#

Anyone has working vehicle plugin

umbral yarrow
umbral yarrow
wet breach
#

you wouldn't be able to use mojang servers to verify connections

sullen marlin
#

Still doesn't help

#

They could still send false data about a connected player

clever raft
umbral yarrow
wet breach
#

this is the only semi feasible thing I can think of to help ensure accuracy

umbral yarrow
umbral yarrow
sullen marlin
#

What does your plugin actually do anyway

umbral yarrow
umbral yarrow
sullen marlin
#

So a modified server could still make me say malicious things if I joined it

unborn sable
umbral yarrow
quaint mantle
#

Does protocollib support 1.20.1? It hasnt been updated since may 6

sullen marlin
#

Yes

quaint mantle
#

whats the github I can only find aadnk's

sullen marlin
#

1.20 anything is compatible with 1.20.1

#

Lots of links they're

#

There

quaint mantle
#

I see

umbral yarrow
vital ridge
#

How should I write the ConfigurationSerializable #serialize method that it makes me implement?

#

I'm creating a class that I'll use as a custompersistentdatatype

sullen marlin
#

Not sure it's possible you get a random players keys

sullen marlin
vital ridge
sullen marlin
#

yes

vital ridge
#

Gotchu, so I assume that the most logical think would be then to use the serialize method in my Custom PersistentDataType class under the #toPrimitive method right?

#

The thing is, under the #toPrimitive method in my custompersistentdatatype class, I have to return a byte[]. But my serialization method returns a Map<String, Object>

remote swallow
#

vault doesnt send messages iirc

#

how did you add the blanace to the player

#

thats an essentials command

#

essentials is sending that message

#

change the message properties

#

check the wiki

umbral yarrow
#

Does anyone know how to access the users public key and salt for "multiplayer secure chat signing" when they send a message?

quaint mantle
#
As of 1.20.1, the following feature flags are available:

    minecraft:vanilla - enables vanilla features
    minecraft:bundle - enables support for the bundle

What do these do?

#

is the bundle for forcing client to process a bunch of packets in same tick?