#dev-general

1 messages ยท Page 29 of 1

cinder flare
#

just use Configurate

#

it's likely your best bet

pastel imp
#

don't understand much how configurate works tbh and dazzleconf looks better imo

#

but will see

#

doesn't configurate have annotation based configs like dazzleconf?

hard dagger
#

im gay

pastel imp
#

cool

sly sonnet
#

matts config >>>

#

clean + easy to use

distant sun
#

And most important, outdated

pastel imp
#

;-;

sly sonnet
#

it works anyway

pastel imp
#

if I go by that logic I prefer dazzleconf

sturdy zinc
#

was there any change on blocks broken in 1.20?

mental trench
#

wdym

pastel imp
#

what would be a good way of storing an armorstand persistently?

#

aka be able to get the armorstand object after restarts and modify it, etc.

cinder flare
#

don't

#

just store the details about it and recreate it when you restart

#

ideally also don't actually spawn an armorstand, just do it packet-wise

#

but that depends on your usecase

#

if you actually want to save one, you can get entities by location iirc

pastel imp
#

its for a top 3 leaderboard, each armorstand representing one position

mental trench
#

uuid?

inner umbra
pastel imp
#

not the point, I need to modify it, so suppose uuid would the best?

#

didn't think of that, ty Alonso

mental trench
#

I use uuid for my leaderboard plugin xd

#

issue is that in old version there is not getEntityByUUID or similar

#

so yeah, loop cat_cry

inner umbra
mental trench
#

mmm iirc since 1.12

#

yes, 1.12.2

#

(prob 1.12 too but no one uses that xd)

#

and method was getEntity(UUID), mb

inner umbra
#

Was gonna say I got entities with UUID can't check my code atm

ocean quartz
#

Packet are the easiest way to handle that, just spawn and despawn based on player being around or not based on a saved location, no need to worry about getting the right entity or removing/adding them on start/stop

#

Though, for this display entities would be better ;p

distant sun
#

I think he uses armor stands also for displaying the player that's on that position (e.g. use their skull) - not only for a hologram

pastel imp
#

exactly

cinder flare
mental trench
half harness
mental trench
#

what i meant was when to check, not how xD

#

global task, task per player, move event, other?

ocean quartz
ocean quartz
mental trench
#

so an async task per leaderboard checking near players using nearbyEntities or looping players in world and getting distance?

pastel imp
slate elk
slate elk
#

so u just send to nearby cubes the packetts..

#

and move players from cube to cube depending on some task that can be highly optimized.

ocean quartz
mental trench
brittle leaf
#

in the grand scheme of things doing 400 iterations isnt alot

rotund egret
#

If a plugin isn't improving the severs tickrate to 30tps then it's basically trash ๐Ÿ™„ ๐Ÿ˜’ ๐Ÿ˜ค

inner umbra
ocean quartz
#

It is not lol

slate elk
#

which is already way more then 400

slate elk
#

in a 1000x1000 world.

#

not sure really what nearbyEntities does maybe ill take a look into bukkit

#

it probably loops as well and checks distance

ocean quartz
#

It might check more things, you'll have more entities around than players for most of the time

slate elk
#
for (Entity entity : location.getWorld().getNearbyEntities(location, radius, radius, radius)) {
            if (entity instanceof Player) {
                Player player = (Player) entity;
                ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
            }
        }
#

i might write custom playerlocmanager so i can make a big difference in the chekcs

#

by splitting players into groups according to their location

#

oh i i cant send pics

half harness
#

?imgur

compact perchBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

slate elk
#

sec it requires to register ill just find free service instead

half harness
slate elk
ocean quartz
#

So you'll .. loop through players to separate them into groups .. to avoid .. looping through players?

slate elk
#

spatial indexing techniques.

#

i will loop less often

ocean quartz
#

Which will constantly need updating because players move

slate elk
#

way less often and change it upon some events

#

like teleport

#

players dont move that fast i either can write an faster check if player nears a border

ocean quartz
#

You're over complicating a problem that doesn't really exist, it's juat a few players lol

slate elk
#

we always aim from highest quality haha

inner umbra
#

You're probs better off checking on playermove then

slate elk
#

for small scale yeah its not good

#

playermove called too often

#

heavy event

inner umbra
#

If used wrong

ocean quartz
#

Premature optimizations aren't really highest quality

inner umbra
#

But you can capture the players new location and run the check you need async
Could also add a delay so it only captures every 5 seconds or something.

slate elk
#

you can do same with group things if player gets within from border short the check time

#

spatial indexing techniques were proven to be way more efficent in high scales

#

you can do math and write pre made numbers like caclulate how much time it can take a player to walk that distance

#

for example if player distance is above 100 20sec if below 25 then 4 sec

inner umbra
#

Could also only check the player not all entities.

slate elk
#

if u write own storage map you dont store entites in it

#

u dont send packets to entities no reason to store them there...

#

but it really depends on the goal

#

also guys an question related to bukkit api is there an event fired if player moves an itemstack inside his inventory?

#

i work on an update for my plugin and i cant really find an event in the docs

#

i dont want to loop constatly over players inventory (heavy task on high scale.)

pastel imp
#

inventory interact event?

slate elk
#

does it affects player inventory?

#

i have seen that event

#

but it dont work on client inventory

#

like self player inventory only on 3rd inventories

ocean quartz
#

It affects all inventories

forest pecan
#

How to show hearths above head players?

static zealot
forest pecan
#

Without seems better.

#

u know how to add it with scoreboard?

half harness
forest pecan
#

If i do Dark_Red

#

it doesn't work.

#

I see the colors not working XD

#

Has to do something with Placeholder API?

static zealot
#

also is there dark red? I thought &c is just RED

drifting aspen
half harness
#

its case-sensitive

distant sun
static zealot
#

ah right. I forgot that exists

forest pecan
half harness
#

dark_red

forest pecan
#

i know.

#

But the colors doesnt work

half harness
#

fixed

sturdy zinc
#

Back to figuring out why the new blocks are not being detect in Statz?

slate elk
#

like if the server software unable to fire the event then listen to thee packet the player sends when he breaks thee block ~

slate elk
#

maybe its also somehing on client side that causes no packet to be send from player but it no sense thing

#

if it dont fires you will have to write a class to connect server pipeline and do some tests to see the behavior also decompile mc to see maybe its client side thing , a cheap alternative if problem is not on server side and the client does not send the packet try to spoof the block to something else and retexture it ;p

wind patio
tight ore
distant sun
#

new github ui?

pastel imp
#

yeah

#

there is also file navigation etc

#

has been like that for a while for me though

hard dagger
#

Looks ew imo

sly sonnet
#

also, what exactly did change?

static zealot
static zealot
distant sun
#

the nav bar is different

queen saffron
#

Steam also updated their UI

#

The little icon on windows now pops this up for example

#

store aswell

static zealot
#

yeah. it's a bit weird

#

everything feels very block-y now

queen saffron
#

Yup

#

Minecraft

#

xD

#

Since when is this a thing???

long dagger
#

Steam has always had a sucky ui

#

It has never looked good in my opinion

crude cloud
#

steam has always had the most inconsistent of UIs, get don't really give a fuck lmao

quaint isle
#

Does anyone know a good Js/php library for putting text with shadow on an image?

distant sun
#

canvas?

quaint isle
#

You mean the html canvas thingy?

I wanna add text with soft shadow to images in bulk, I dont think canvas can do that

wind patio
#

No

#

Real canvas

lavish notch
pastel imp
#

anyone knows a good chat prompt library/api?

rotund egret
#

Adventure supports clickable components, unless you're specifically looking for a library that wraps a timer around it?

pastel imp
#

and it gets that input and executes X

drifting aspen
#

Isn't there something like Bukkit conversation API?

#

Iirc it covered this usecase

distant sun
#

oh I read that wrong, ups

#

yeah, the old af conversation api would do that

drifting aspen
#

Or i mean, you can just use the chat event

pastel imp
#

is there no other option?

#

would prefer an easy way to do it and pref. not the conversation api

distant sun
#

it is not that hard to use, it just takes a second to get the flow

#

you basically use the conversation factory class, add a prompt and then start the conversation

pastel imp
#

confusion

#

it's past midnight, my brain doesn't have enough processing power to figure that out

pastel imp
#

what are the main points that people use as argument on why mythic mobs sucks?

#

abuse packets?

forest pecan
#

Somebody knows how to put uclan v.6 clan name infront of name in chat.?

#

And im looking for a good anti x ray

half harness
#

here's a guide on how to configure it

#

all paper forks should also have it too

forest pecan
#

k k thanks!

urban sleet
#

It performs very well assuming you don't do something silly with it

half harness
#

when publishing to maven central

half harness
#

ill use :

#

ยฏ_(ใƒ„)_/ยฏ

forest pecan
#

man have u ever had to copy like 20 classes cuz an api is so dogshit and doesnt use interfaces lmao

rotund egret
#

Me

forest pecan
flint crow
#

any translation for english from the smart devs here? :/

wind patio
#

when does this occur

flint crow
#

when i join the server :/

#

it kicks me

wind patio
#

version?

flint crow
#

i updated from 1.19.4 to 1.20.1

pastel imp
#

paper?

flint crow
#

ye

pastel imp
#

maybe report it to them ?

half harness
wind patio
#

my best guess would be mismatch of the data sent/read (server => googoo gaga iduno what to do with ur data)

flint crow
#

ye

pastel imp
#

viaversion?

half harness
#

It could be a plugin incompatibility tho
Try removing as many plugins as you can while keeping the error

flint crow
solemn laurel
#

binary search plugin removal xD

flint crow
#

oh ye i found the issue and fixed it already ye it was caused by a plugin

flint crow
#

clientdetector

#

wasnt still updated for 1.20

hard dagger
#

Adapt their classes to ur interface

forest pecan
#

their classes use concrete implementations and dont use the interface version ๐Ÿ’€

#

idek why

#

so the only way is to manually copy the classes and replace the concrete implementations with the interface ones

hard dagger
#

whats the issue with them being concrete

forest pecan
#

the library doesnt expose some of the abstract classes/methods that its own implementations use

steel heart
#

ye technically adapter pattern solves it, but big yikes regarding that api or library w/e

#

cuz like, sounds a bit smelly if u have to resort to adapter

pastel imp
#

uhm are there alternatives to the bukkit scheduler?

hard dagger
slate elk
#
            ItemMeta meta  = item.getItemMeta();
            List<String> lore = meta.getLore();
            lore.set(lore.size() - 1,"Ammo: " +  (ammo - 1));
            meta.setLore(lore);
            item.setItemMeta(meta);
#

why does his update in super delay?

#

like other things afterwards it happen 2-3 times meanwhile this updates only once

#

ill debug to show behavior

pastel imp
#

The what and what with what now?

slate elk
#

dev general? isnt it correct place to ask?

#

question is about java

pastel imp
#

this is general dev chatting

slate elk
#

not asking for help

#

asking why its delayed

pastel imp
#

then what are you

slate elk
#

dont create xy problem right there

pastel imp
#

I would consider that asking for support but well

#

still don't understand what you are saying though

slate elk
#

im not asking for spoon feed or what ever asking a general question why an itemstack updates in delay via bukkit api

pastel imp
slate elk
#

other code executes 2-3 times meanwhile the itemstack only updates once

#

whatts the logic behind tha shit

pastel imp
#

it's where you ask questions and get answers but whatever, regarding the question

#

if I recall correctly it's a limitation on the bukkit api? I am not 100% sure

#

no wonder most gun plug-ins also have a delay on updating

slate elk
#

imma just stick to map i guess to store the weapon serial ID and ammo loaded kinda sucks i will have to add a table for it into the ammo values when i clear the cache

slate elk
pastel imp
#

me neither, but have seen them lol

pastel imp
slate elk
#

lore

#

i want users be able to see ammo amount

pastel imp
#

why don't you use โœจ PDC โœจ

slate elk
#

i can use nms also but wont be able to display it

#

pdc is?

pastel imp
#

PersistentDataContainer

slate elk
#

sorry im using dino version probably it does not exist

pastel imp
#

introduced in 1.14.4

slate elk
#

im on 1.6.4

pastel imp
#

What the actual Frick?

#

I though people using 1.8.8 was already bad and you are on 1.6.4?!?!

#

why?

slate elk
#

no reason ...

pastel imp
#

hell this gotta be rare, someone take a screenshot

slate elk
#

like 1.7.10 is fine toto

#

too*

pastel imp
#

then do yourself a favor and update to latest.

slate elk
#

nah i wont update above 1.8.8...

#

i love the new API

#

just what players prefer

pastel imp
#

what?

slate elk
#

i coded some commesions for newer versions

pastel imp
#

what the actual what

slate elk
#

rich api

pastel imp
#

your players want that low version?!

slate elk
pastel imp
#

1.7.10 is almost 9 years old

#

1.6.4 is more than that

#

how many players do you have and what type of server is it?

#

if I may ask

slate elk
#

its a gun survival server

#

not like minecraftt survival

#

simillar to rusttt

#

i use texturepack to change blocks and things

#

around 200 at pick

#

at the moment server undermaintaince

#

so i decided to rewrite gun system

#

there many servers on old versions

#

probably forge servers moded and etc

#

and by t is broken so sometimes it just outputs few times

#

laptop ;/

wind patio
#

classic 'we dont update cuz <insert-non-valid-reason>'

slate elk
#

11 ^

#

lol

#

nah i do understand big networks like hypixel

#

they are also stay in old versions

#

they also*

#

why are

#

fuck

pastel imp
#

I would HIGHLY suggest updating. It's not worth the hassle supporting that old versions and you won't get any support on them either from almost anyone. Make a poll asking your player base and ask for an upgrade.

slate elk
#

i ask java related questons more then the api =/

#

wait ill send u

#

what players think

pastel imp
#

also, Hypixel started on 1.8.8 so they still support it, but they have a full custom api, not spigot/paper.

slate elk
#

i want to update so badly because new versions allow multi textures over armor

pastel imp
#

and 1.6.4 to 1.8.8 is already a big difference

slate elk
pastel imp
#

๐Ÿ’€

slate elk
#

either i dont use spigot

#

itts bukkit ;O

#

but same thing + -

#

im not sure what they added when forked bukkit (spigot)

pastel imp
#

yeah I am going out of the convo, this is really triggering me, I can't handle people who refuse to update because X and Y.

#

You should do some research. That's what I suggest you doing.

slate elk
#

nah i want to update to 1.12 at least

#

because it allows to display multi textures

#

at one itemstack

#

like using durability

pastel imp
#

if you are going to update from 1.6.4 to something then update directly to latest

#

simple.

slate elk
#

more ram will be consumed

#

as well minecraft is single theard

#

server will blow up on 200 player on new version in single world of 1000x1000

#

but letts forget tthatt conversattion itts off ttopic

sturdy zinc
#

edit link missing on overview page on Spigot?

#

also all my resources the update button is this now

distant sun
#

do what it says lol

sturdy zinc
#

ok, so Spigot wants to confirm its me a better way?

#

now I need to wait to see if I did it right

blissful sluice
#

Has anyone ever had an issue with sqlite and an InstantiationError?
java.lang.InstantiationError: org.sqlite.jdbc4.JDBC4Connection
The stacktrace points to the JDBC4Connection line

final Path path = new File(plugin.getDataFolder(), "plugin.db").toPath();

...

final SQLiteConfig config = new SQLiteConfig();
config.enforceForeignKeys(true);
config.enableRecursiveTriggers(true);

// vvvv THIS LINE
return new JDBC4Connection("jdbc:sqlite:" + path, path.toString(), config.toProperties());
half harness
blissful sluice
#

There's nothing at all more to it and that's what's so damn confusing

half harness
#

Maybe u can find using where the stack trace came from

#

Like where in the sqlite code it came from

#

Idk

blissful sluice
#

Doesn't even give me that

half harness
#

Wdym

#

I mean like where the stack trace is coming from

#

Idk I havent used sqlite so I can't really identify if u coded it wrong

compact perchBOT
blissful sluice
#

fuck pasted wrong

#

the rest of the stacktrace is just standard loading the plugin from Paper/Spigot's side

#

ConnectionFactory.java:66 is the instantiation of the JDBC4Connection shown in the snippet

half harness
#

Oh

blissful sluice
#

Yeah there's like no information at all to go off of

half harness
#

So the class isn't loading at all

#

I think?

#

For some reason

#

I'm not sure

#

Since it's not pointing to any constructor or anything

blissful sluice
#

wdym

drifting aspen
#

From javadocs:

Thrown when an application tries to use the Java new construct to instantiate an abstract class or an interface.
blissful sluice
#

I've been playing around with gradle and shadow thinking it's an issue of either of those not including the files but i've checked, they're all there

#

But that'd error out at compile, and I get no compile errors

#

Not to mention, that class isn't abstract or an interface

#

it's the standard sqlite-jdbc library:

drifting aspen
#

How does ConnectionFactory:66 look?

half harness
#

R u relocating

blissful sluice
drifting aspen
#

You sure you should directly instantiate the connection like that?

blissful sluice
#

It's based off of how LuckPerms does it

drifting aspen
blissful sluice
#

https://github.com/LuckPerms/LuckPerms/blob/9f1e74fa7c5ce8226d92a9ab02aa383111c6c461/common/src/main/java/me/lucko/luckperms/common/storage/implementation/sql/connection/file/SqliteConnectionFactory.java#L58

They use reflection/class loading stuff because of how they handle loading dependencies at runtime, but unless I'm missing something it's otherwise identical

GitHub

A permissions plugin for Minecraft servers. Contribute to LuckPerms/LuckPerms development by creating an account on GitHub.

half harness
#

I'd go with kyngs ^

blissful sluice
#

I'll try the DriverManager version but I've used this method before and never had an issue so idk what the deal is now

drifting aspen
#

In my plugin I'm also loading dependencies at runtime, yet I'm using pretty much the same way as the tutorial I sent

ruby dew
half harness
#

Wha

#

What

ruby dew
#

what kyngs stand for?

drifting aspen
#

:(

half harness
#

Ask @drifting aspen ...

ruby dew
#

oh lol

#

oh hey

#

i guess i just cracked a very stupid joke there ignore pls

blissful sluice
#

ok somehow the DriverManager technique worked

half harness
#

So Mitch
Once you try that out
Let us know how it turns out

#

Oh ok

blissful sluice
#

I don't understand howtf but ok

half harness
#

I think that directly instantiating is like internal usage

#

And shouldn't be used unless for a specific reason

blissful sluice
#

I'd used that method before without issue too which is what's confusing

half harness
#

But it's just a guess

drifting aspen
half harness
#

Hey I mean

blissful sluice
half harness
#

It's lucko

#

He can do anything ๐Ÿ™ƒ

blissful sluice
#

only thing I can think of is maybe it has something to do with it not being pre-loaded in the class path?

#

or something weird

drifting aspen
#

You should use the DriverManager way with any JDBC connection

half harness
#

Might use some reflection

#

Or smtj

drifting aspen
blissful sluice
#

now let's see if i can turn on relocation and stuff

drifting aspen
#

I mean, I also use Hikari for SQLite

half harness
#

Btw why not use spigots libraries feature?

#

If ur on 1.17+

#

I think

blissful sluice
#

not on 1.17+

half harness
#

Oh ok

ruby dew
#

what exactly is modernpluginloadingstrategy btw

#

i see it everywhere on minehut servers

drifting aspen
#

Paper's way of loading plugins

ruby dew
#

kinda ruined it on minehut tho

half harness
ruby dew
#

sth i saw on minehut paper servers

half harness
#

Ik paper has paper-plugins but it's not called that

ruby dew
#

it keeps making plugman reloading impossible

half harness
#

Lol

blissful sluice
#

Ok seems to be working, now time to see if my plugin actually works outside of that xD

#

i need to workout what the thing is for hot-swapping in a dev environment, i've forgotten

half harness
#

It won't work in this case tho

#

It doesn't support adding new classes and methods last time I used it

#

Which was a while ago

blissful sluice
#

I'm testing the plugin itself now, not the sqlite thing; that seems to have resolved, for now anyway

half harness
#

Long while ago

drifting aspen
blissful sluice
#

I'm the weird sort of person to write basically an entire plugin without testing it once and then test it all at once

half harness
#

Not weird imo
Unless we both weird

blissful sluice
#

not impossible

half harness
#

Lol

drifting aspen
#

I categorically reject unit testing

half harness
#

I think I have 2 projects with unit testing

blissful sluice
#

i don't even understand how to unit test with MC

half harness
#

Oh I have unit testing in non mc libraries

#

But ig u could mock test

#

But difficult for medium to big plugins

#

Although there's things like MockBukkit to help although I haven't used it before so idk how well it works

pastel imp
lavish notch
pastel imp
#

๐Ÿ‘€

#

don't wanna use it as an actual db lol

#

more like CMS lol

cinder flare
#

just use a CMS lol

pastel imp
#

Yeah but here is the thing, it's supposed to be an open collaborative project

#

and it's hard to do that with a limited 2-3 user cms lol

cinder flare
#

2-3 user cms? just use any open source cms

#

completely free, as many users as you want, etc.

pastel imp
#

self hosted though I assume

#

and it's more the thing of having triage and the PR feature

#

etc

rotund egret
#

Github

#

Free, no user limit, issue triage, pr feature.

pastel imp
#

exactly

#

although, trying to figure out if that was sarcasm

rotund egret
#

Are you trying to find alternatives?

#

Oh you're currently on a cms. I think I'm just confused.

pastel imp
#

yeah I am on cosmicjs cms and probs going to github

pastel imp
#

is Fundamentals too big of a name for a plugin?

#

(Another Essentials Alternative)

blissful sluice
#

Anyone know any alternatives to Guava Table that supports concurrent maps?

inner umbra
pastel imp
blissful sluice
#

wot

glossy crane
#

How do you make the font larger

remote goblet
#

in what

#

microsoft word?

ruby dew
#

how has java changed for the past few years? like the major changes you guys deem useful?

agile galleon
#

Like literally 3 new versions or wdym

prisma wave
#

records & sealed classes go hard

#

Pattern matching (will) go hard

pastel imp
#

using records for configs sounds pog now that I think about it

cinder flare
#

oh yeah dude

#

that's what my favorite kotlin config library does, you just define a nested data class with a bunch of data classes in it and it converts em super nice

agile galleon
#

lmao i have no idea how i thought they meant minecraft java

drifting aspen
#

dw, I thought the same at first...

wind patio
potent nest
#

and miss all the good features

pastel imp
#

๐Ÿ™‚

sweet cipher
#

Does the PlayerMoveEvent not get called for every mouse movement?
The packet gets sent much more often than the PlayerMoveEvent

inner umbra
#

per second

sweet cipher
#

Rip thanks, guess I'll just have to use the packet

inner umbra
#

Also doesn't work if you're a passenger. Unless that has been fixed.

drifting aspen
sweet cipher
#

The packet is definitely sent more often

drifting aspen
#

Citing wiki.vg:

Vanilla clients will send Move Player Position once every 20 ticks even for a stationary player. 
#

It kinda doesn't make sense to send it multiple times per tick, considering the server process the changes each tick

sweet cipher
#

I donโ€™t need it multiple times per tick, itโ€™s just that the PlayerMoveEvent doesnโ€™t fire for small changes in the mouse

sweet cipher
pastel imp
#

confused do you want or not to check for rotation?

sweet cipher
#

Yes

hard dagger
#

you cant return to exit early in a switch expression

#

its rly annoying cuz in a lota cases u might wanna do like

var message = switch (result) {
    case Success -> { return; }
    case Error(var message) -> message;
}
#

or stuff like that

#

im also pretty sure cuz of weird scoping rules u cant use message

hard dagger
#

yeah not being able to just use return statements is rly annoying as well

wind patio
#

just enjoy the new feature instead of complainin it doesnt do x fingerguns

hard dagger
#

good solution

wind patio
#

feature doesnt exist => no complaints
feature gets added => nuuhhh itzz bad!

hard dagger
#

not as hard as i wouldve hoped

wind patio
#

Im just saying how generally people react to new stuff

rotund egret
#

Is that your new favorite gif or something?

rotund egret
#

Perfect for the jeep

hard dagger
#

how do i get rid of this new gh ui

#

its so ugly

#

nvm

#

i needed to click the disable button apparently

potent nest
#

and I'd say it makes sense to be rather conservative with adding new features like that, because it opens a large can of worms with limited benefit

quaint isle
#

I am this (๐Ÿค) close to reaching PAPI-level legend status ๐Ÿ˜Ž

#

What do I do with all this clout now, should I publish my own ebook?

pastel imp
#

bruh what

#

where is that

prisma wave
#

Sure kotlin can but statements bad anyway

ruby dew
#

is there a spigot update tracker of some sort?

mental trench
#

mmmm wdym

steel heart
#

(iirc @hard dagger )

distant sun
#

I think he meant to exit the method if you are using the expression to assign a value to a variable

#

E.g. if the value is invalid, instead of assigning null to the variable and then do a null check, you return directly

steel heart
#

That the expression is inside a function and u wanna return the function inside the expression?

wind patio
#

๐Ÿฅด

distant sun
#

Perhaps

steel heart
#

Else yield should work pretty much :3

distant sun
#

yield will probably only exit the expression, not the method

steel heart
#

If you wanna โ€œearly returnโ€ inside a case of a switch expression

#

Yep

#

It would

distant sun
#

Anyways isnt like I will use java 21 at work anytime soon kek

drifting aspen
#

you still at 8?

steel heart
drifting aspen
#

that's good

#

upgrading from 17 to 21 shouldn't be that hard

steel heart
#

Yeah I was just a bit disappointed

#

Thought we would get structured concurrency api fully delivered in 21

distant sun
#

Though we dont develop software so it is not relevant, we test software

wind patio
#

โš ๏ธ pooper old version user alert โš ๏ธ

#

imagine not hopping onto the latest software version exact moment it gets released

cinder flare
#

bro's on the bleeding edge

wind patio
#

โš ๏ธ bleeding edge or nothing at all โš ๏ธ

prisma wave
#

Itโ€™s a little annoying not being able to early return but also i reckon it might allow better performance

steel heart
#

is that a kt thing?

prisma wave
#

yes

steel heart
#

ah I c

prisma wave
#

but my theory here is that kt when has to just compile to if/else

#

whereas java switch can always be switch bytecode

steel heart
#

yea sounds reasonable

prisma wave
#

ok java switch with constants is just a lookup table yeah

#

if you use pattern matching it does some funky MethodHandle stuff like with lambdas, but it's still also a lookup table

#

kotlin is being annoying because it's actually optimising things

#

YES i was right

#
fun main(o: Any) {
    val x: String = when(o) {
        is Int -> o.toString()
        else -> "what"
    }
    println(x)
}
``` just compiles to if/else
#

though maybe thats for compatibility

#

yeah even with java 19, dunno if you can enable java preview things

ocean quartz
#

Compiles into a var that gets reasigned in the switch, for your case, if it's more than 3 I believe

prisma wave
#

are you sure

potent nest
#

it can only compile to one of the switch instructions if the value to switch on can be somehow mapped to ints

prisma wave
#

i guess kotlin could do the same too

tribal plinth
#

programmer humor forced to reopen? ๐Ÿซก

drifting aspen
#

indeed

pastel imp
#

uhm quick question, for instance, using Folia, when do I know if what I am executing should be ran at the location, at entity or whatever? I am a bit confused on each methods usage situations

crude cloud
#

if you're gonna do something on the entity, use the entity scheduler
if you're gonna do something at a specific location/block/chunk, use the region scheduler
if you're gonna do something that affects global stuff like, weather, time of day, etc, use the global region scheduler
if you're gonna do something async, use the async scheduler

#

although if you're certain what you're gonna do doesn't need scheduling (for example, changing a player's health in a player event), just do it

#

events will be dispatched on the region the action takes place, so for some cases you don't need to do any scheduling

half harness
#

#1113758470689263616 message
7+ years of development experience but started learning 5 years ago thonking
making minigames using like skript or smth for 2 years?

crude cloud
#

dkim

half harness
#

hi

crude cloud
#

hi

#

how's your day going?

half harness
#

It's going pretty well
Trying to learn android development

#

How's your day going Emily

#

๐Ÿฅฒ

#

Awesome

rotund egret
#

me when I wait 1 (one) single minute

half harness
#

how's your day going

rotund egret
#

Days going ok

half harness
#

Nice

rotund egret
#

My shelf is almost finished, I just need to stain the wood

half harness
#

ooooooooo

crude cloud
half harness
#

DIY shelf?

rotund egret
#

I used french cleats for the "hanger" part

crude cloud
rotund egret
#

Kinda

crude cloud
#

dkim are you okay

half harness
#

yes

#

I am okay

rotund egret
#

Did you look up the cleat?

half harness
#

mhm

rotund egret
#

They're nice ๐Ÿ˜Œ

#

Using an old pallet for it, so the stain should looks nice.

half harness
gusty glen
rotund egret
#

That looks like kotlin?

half harness
#

๐Ÿ’€

#

kotlin ftw

obtuse gale
#

Hi. Is there a plugin that can disabled the nether and end and then enable them if u buy something trying to make a gui

#

but idk a plugin that will work

#

@obtuse gale if u respond pls

#

ty

half harness
#

I don't think there's a public plugin for disabling the nether or end though because there's little use-case and the alternatives I mentioned already exist

#

but just wanted to point out deluxemenus in case you do find one

#

wait I misunderstood

#

buy something trying to make GUI?

#

wdym by that?

obtuse gale
#

I want the world to be disabled at first then if they buy the end/nether it will open for them but only them.

#

Until other people buy it

half harness
#

are these specific portals? or an smp-like server where ppl can make their own portals

obtuse gale
pastel imp
distant sun
#

is material theme broken for someone else? Some things have the accent color and they are not supposed to

#

this is how it looks if I switch to a random theme and back to the one I use

sly sonnet
#

make it a bit darker

distant sun
#

make what darker?

pastel imp
rotund egret
#

Skill issue

distant sun
fleet jewel
distant sun
#

Yeah

distant sun
#

No need to ping me twice, just wait

runic parcel
#

does it make anyone else feel icky when you do things like getServer() instead of this.getServer()

#

it just feels wrong

crude cloud
#

not really

remote goblet
#

yes

#

not doing this where possible makes me feel icky

wind patio
#

sometimes I use this. something I don't, I do not care cuz I am a big chad

fleet jewel
distant sun
#

stop tagging me wth

fleet jewel
#

oops, forgot to turn off reply ping ๐Ÿ˜ตโ€๐Ÿ’ซ

distant sun
drifting aspen
#

@lime gate how do you accomplish changing the size of the NPCs?

prisma wave
distant sun
#

I wonder if all you get is a txt file with the prompts ๐Ÿคฃ

prisma wave
#

Probably lmao

#

Thereโ€™s a whole market for prompts itโ€™s very weird

distant sun
#

๐Ÿคฃ

neon anvil
#

Prompt sir

#

im using google font

#

oh nvm you mean logo

#

I'm using Blockbench xD

#

yess

obtuse gale
#

I need a little help. I'm working on a rank gui to purchase ranks on my server. I want to make it so you have to be a certain rank in order to purchase the next rank (so players cant skip ranks and just purchase the highest rank) I'm using deluxemenus

flint crow
#

it ll check i the user has the rank mystic which is my first don rank

#

so the price for the rest goes down etc

obtuse gale
#

Okay thats what I had in mind I just needed to see a visual

#

thank you

flint crow
#

np :d

obtuse gale
#

left_click_commands:
- '[console] eco take %player_name% 135000'
- '[console] lp user %player_name% parent add master'
- '[message] &a(!) You have successfully purchased the &#8000ff&n[Master]
&r&arank!'
left_click_requirement:
expression: '%vault_eco_balance% > 135000'
filler_item:
material: GRAY_STAINED_GLASS_PANE
display_name: ' '
slots:
- 0-9
- 17-27

Im having an issue now with the filler not working in my gui. Did I write the filler right?

pastel imp
#

any ideas why the src is not showing?

prisma wave
#

remove and re-add the project in settings > project structure

pastel imp
prisma wave
#

probably

#

i usually just completely delete the .idea & remove and re-add the project when it fucks up

#

it's a bit of a pain to fix

half harness
#

Prob have to set source set

#

If that doesn't work then @pastel imp right click the java folder in src/main/Java and set source set or smth

#

Idk

pastel imp
#

deleting .idea kinda worked

#

but now it looks like this?

#

should be java icon

#

lol

prisma wave
#

yeah do what dkim said

pastel imp
#

there is no option to set source

prisma wave
#

Mark Directory As > Java source

#

something like that

pastel imp
#

Sources Root

#

yeah thx

drifting aspen
prisma wave
#

depends whats fucked up

#

but yeah that does fix it a lot of the time

pastel imp
#

Any ideas how paper plugins work? like bootstrapping and loaders, I read the docs but failed to see the use case...
Are these dependency things like checking if PAPI is in the server or what exactly? I am a bit confused overall. Do I need the onEnable method if I use loaders? etc.

prisma wave
#

i mean

#

the docs kinda say that bootstrappers & stuff dont do anything atm, theyre to support future things

#

but they give a good example of downloading dependencies before the plugin is initialised

cinder flare
#

and having isolated classloaders so that you don't have to relocate every dependency and shit

pastel imp
#

or what exactly?

#

and are these a replacement for the bukkit javaplugin or do I still need that one

obtuse gale
#

its for a ranks gui menu for deluxemenus

prisma wave
pastel imp
pastel imp
prisma wave
#

when i peaked as a developer

#

and then fell off

prisma wave
# pastel imp elaborate please?

i mean i dont know for sure but the fact that it still says JavaPlugin implies it'll still be the same JavaPlugin class, maybe with a few breaking changes

pastel imp
# prisma wave yes

wait wouldn't this make it a requirement to have access to internet? Making offline/local servers unable to use it?

prisma wave
#

possibly

#

i feel like you're misunderstanding me though

#

that's one of the potential uses, it's not like it's made specifically for that

#

but also dependency downloading is already a thing

#

there are various workarounds for offline usage

pastel imp
#

yeah true

distant sun
prisma wave
#

indeed

#

which hanger will (half) fix

distant sun
#

Wdym

crude cloud
#

isn't that a rule only for paid plugins regarding their DRM?

distant sun
prisma wave
# distant sun Wdym

it wont have the downloading rule afaik, but it also doesnt allow premium plugins

#

but tbh i wouldnt be surprised if spigot gets entirely phased out in the next few years

#

hangar for most, bbb/polymart/whatever for premiums

distant sun
distant sun
prisma wave
#

exactly

distant sun
prisma wave
#

yeah thats the workaround

distant sun
#

Although, the server itself doesnt need internet connection, but you do (???)

prisma wave
#

because it's not 100% offline, it's some weird rule which means that workaround can exist

crude cloud
#

@distant sun i don't know where you got that rule from but it is not a thing, there is no mention of "offline" or "internet" in the regular resource guidelines, and the only mentions in the paid resource guidelines are about DRM, DRMs requiring internet connection are straight up prohibited and code requiring access to an external server must be fail-safe and the plugin should continue working somehow

distant sun
#

Man I swear this is mentioned somewhere ugh

#

But yeah, looks like it is not on the resources guidelines, welp

pastel imp
distant sun
#

Yeah I know

#

I guess it was just a discussion ugh sorry

crude cloud
#

also that rule for paid plugins isn't so much about the mc server being offline, but the target server the plugin sends requests to being offline or failing in some other way

#

you have bigger problems than a paid plugin not working if your mc server doesn't have an internet connection lol

distant sun
#

Yeah ๐Ÿคฃ

hard dagger
pastel imp
#

who knows

#

or there is an internet outage where they live, and they wanna continue work?

#

there are a few occasions where this could be an issue

hard dagger
#

theyre cached

#

and paperclip also needs the internet

obtuse gale
#

I need help guys

oblique heath
#

ok

obtuse gale
#

im not getting any error in console its not loading at all

crude cloud
obtuse gale
#

thank you my apologies

timber oak
#

Which plugin version does the big prison servers use? Most have compatiblity from 1.13 or so to 1.20 but yeah

#

Does that mean they just use 1.20 api?

marble stream
#

Does anyone know how I can run code before the event happens?

prisma wave
#

what?

#

what event

crude cloud
#

what are you trying to work around?

prisma wave
#

and event handlers already do happen before

crude cloud
#

eh...

prisma wave
#

but yeah ^^ more appropriate question

marble stream
#

Im trying to make it so the players sounds stop before they teleport, then they are teleported

#

I have regional music that seems to overlap when they teleport

#
    @EventHandler
    public void onTeleportResetSound(PlayerTeleportEvent event) {
        Player player = event.getPlayer();
        if(event.getPlayer().getLocation().getWorld().getName().equals("Hub")) {
            Location from = event.getFrom();
            Location to = event.getTo();
            event.setCancelled(true);
            player.stopSound(SoundCategory.AMBIENT);
            player.teleport(to);
        }
    }```
I've tried this but I'm getting a Teleport is unsafe message from another plugin
#

(CMI)

crude cloud
#

don't teleport in the move/teleport event

#

call event.setTo instead of cancelling

#

wait what

#

you're just teleporting to the same target location?

#

what

marble stream
#

Yea im just trying to stop their sound right before they teleport to whatever

#

it seems to do it after which stops the song from playing when they enter the region

crude cloud
#

well, the teleport event is called before the actual teleport happens

#

i guess just, cancel and teleport 1 tick later

distant sun
#

simply cancelling the sound doesn't work?

distant sun
crude cloud
#

oh yeah lol

sweet cipher
#

You'll probably have to use packets

#

Wait does teleporting actually play a sound? I would assume it doesn't unless using an enderpearl

distant sun
#

probably other sounds, not caused by teleport

#

but no, it doesn't

crude cloud
#

i mean, stopSound does pretty much just send a packet

#

i suspect there's something with packet order processing on the client

distant sun
#

could delay that by a tick ig

crude cloud
#

well that's the thing, the sound has to be stopped first, that's why the suggested solution is to delay the teleport

ionic gust
#

i finally finished updating all 20 of my plugins (locally tho ๐Ÿ˜ญ)

#

now i have to update them on 5 platforms each ๐Ÿ™ƒ (100 updates total)

rotund egret
#

When I create my own problems:

ionic gust
#

HEY

rotund egret
#

Just calling it like I see it ๐Ÿ‘€

sturdy zinc
#

what does this mean? ยง$2

half harness
sturdy zinc
#

replaceAll("(&([a-z0-9]))", "ยง$2")

#

if that helps

half harness
#

ah it's getting the 2nd group I think

sturdy zinc
#

my guess it replaces all colors with dark green

half harness
#

from regex

#

matches &[color code] and replaces it with ยง[color code]

sturdy zinc
#

I think, it's in my code of a plugin I took over

half harness
#

here's an example usage

#

note that the $2 isn't any like special java feature or anything, it's regex-specific

#

$0 = whole match
$1 = first group
$2 = second group

sturdy zinc
#

code seems to work, even after I removed those lines

half harness
#

I mean you didn't send any lines but

#

sure

#

๐Ÿ‘

hard dagger
#

someone give me names for configuration library

pastel imp
inner umbra
pastel imp
hard dagger
hard dagger
hard dagger
inner umbra
pastel imp
#

although its probs in kotlin

#

so pain

hard dagger
hard dagger
#

also i havent got a link cuz i need a name first

pastel imp
#

can be...

#

๐Ÿค”

#

so.... are you?

hard dagger
#

i mean ive got like 200 wakatime hours of it

#

but no

#

i used it for a bit now i only use it for adding kotlin support to my java libraries and gradle build scripts

pastel imp
#

ah oki

#

Well no idea for a name... MyConfig? maybe a mix of "Storage" and "Spark"

hard dagger
#

imma just do spark config

pastel imp
#

you can change it afterwards anyways

#

but I am highly in need of a config library to use for my "essentials" remake

#

might just do my own simple one

#

lol

hard dagger
#

u still need one ๐Ÿ˜ญ

#

actually nvm imma do warp config (definitely didnt ask chat gpt for this)

pastel imp
#

might just read the config and store data in a record, that's how I will do my simple system

hard dagger
#

if u watch it u can get a noti when (or if) it releases

pastel imp
hard dagger
#

its gonna use interfaces and records

inner umbra
hard dagger
#

why would the application modify the configuration?

inner umbra
#

I mean that data is (should be) cached untill you set the file... So if you can't edit the cache...

pastel imp
hard dagger
# hard dagger its gonna use interfaces and records

hopefully itll be smth like this

// record
@Configuration
record EpicConfiguration(@Property("some.string") String someString) { 
// idk how imma do defaults for records yet
// wanna do an annotation but thatll be annoying when u have more complex types
}

// interface
@Configuration
interface EpicConfiguration {
    @Property("some.string")
    default String someString() {
        return "some default";
    }
}
distant sun
#

Records are just perfect wdym yapp

hard dagger
#

real

#

||records ๐Ÿ”› ๐Ÿ”||

pastel imp
#

I will never understand annotations so I will just not use them

#

well I still need to read the file.. might use snakeyaml? no idea

inner umbra
#

I mean if you're not gonna edit them obviously they would be fine. I was thinking more (cache -> edit -> set)

distant sun
#

Defaults for records is a bit eh, I couldn't figure out how to do it with configurate ๐Ÿคฃ

prisma wave
#

Interfaces are an interesting approach

distant sun
#

True thinkcat

#

I wonder if configurate has that, hmm

hard dagger
#

Thatll get messy tho with a massive this call

prisma wave
#

itโ€™s a shame thereโ€™s no real nice way of doing it

distant sun
#

Yea ugh

pastel imp
#

are you able to easily get all fields of an interface? without annotations perferably

prisma wave
#

Interfaces donโ€™t have fields

#

And when? At runtime?

distant sun
#

Whats wrong with annotations

pastel imp
prisma wave
#

My library does class generation at compile time which means you get a pretty clean interface imo, at the cost of a lot of silliness at build time ```java

@Config
@Source("database.yml")
@NamingPattern(NamingPattern.LOWER_KEBAB_CASE)
public class DatabaseConfigDTO {
String hostname;
String database;
String username;
String password;
int port = 3306;

@Nullable
String tablePrefix;

}

pastel imp
prisma wave
pastel imp
#

me who is not that familiar with reflection

prisma wave
#

what exactly are you familiar with then lol

#

Or rather, why are you asking this question

distant sun
#

Is probably as easy as Class#getDefinedFields

prisma wave
#

Pretty sure thereโ€™s a dedicated method for it

#

Record fields that is

pastel imp
#

getRecordComponents()

prisma wave
#

^^

distant sun
#

And annotations are used for more context, different path than the field name, default value, whatever

pastel imp
#

hmm so might be able to do it how I wanted.

Was thinking on creating a record and when loading the config I would get all the components and get the respective values and then create the record.

#

Would that make sense?

prisma wave
#

Uhh yes?

pastel imp
#

suppose it's a thing of how I execute it

prisma wave
#

Thatโ€™s how literally every library that does that works lol

pastel imp
#

oh

#

wait what libraries do this?

#

might save me work

#

lol

prisma wave
#

like, every other deserialisation library

#

Gson for instance

distant sun
#

Configurate is what I use most of the times

pastel imp
#

tried configurate and simply wasn't comfortable using it

distant sun
#

It is a bit verbose ig, but not that hard to use

pastel imp
#

not about difficulty, just not comfy to work with imo

distant sun
#

Fair

pastel imp
#

So a mix of records and something like snakeyaml would do the thing?

hard dagger
#

idl the fields tho

#

i dont think libraries should be modifying your fields directly

inner umbra
hard dagger
hard dagger
pastel imp
inner umbra
hard dagger
#

if it was "normal" you wouldnt be using nms for it

obtuse gale
inner umbra
hard dagger
#

does nms' nbt require reflection?

inner umbra
hard dagger
#

also what packets require reflection? theyre just pojos afaik

inner umbra
prisma wave
hard dagger
#

oh

#

yeah the apt api is terrible

obtuse gale
#

guys can you help me?

prisma wave
#

been using it in most of my plugins for quite a while so mostly production ready

#

though it's not super modular atm

#

you kinda have to use the full framework to use it lol

#

feel free to take / adjust code though

obtuse gale
prisma wave
hard dagger
inner umbra
#

A few packets I use don't have methods (atleast in past versions)

prisma wave
#

annotation processors cant modify existing classes

hard dagger
prisma wave
#

it only references it for the default values of fields

#

iirc

#

copying the default verbatim could cause compiler errors wrt access modifiers

#

that's what it produces

#

bit of a mess, but in theory quite fast

#

Object portFromMap = $data.getOrDefault("port", dao.port);

#

still needs a lot of work though

hard dagger
#

ok thats actually alr

#

thought it was gonna be like gson

prisma wave
#

nah thats another benefit of classgen

#

you can in theory get much faster loading

#

no reflection needed

hard dagger
#

not the nullability annotations in the method location (i hate this)

#

use type use location!!

prisma wave
#

what

#

public @Null#4113able String()?

hard dagger
#

ye

prisma wave
#

too tricky

hard dagger
#

๐Ÿ˜ญ

prisma wave
#

sorry

hard dagger
#

you should be.

#

jb annotations bad anyway

prisma wave
prisma wave
#

why

hard dagger
#
  1. they love backwards compatibility so the annotations mostly still have METHOD, FIELD, etc targets from java 7 even though java 8 has TYPE_USE
  2. I CBA TYPING @NotNull ON EVERY DECLARATION MAKE IT DEFAULT OR SMTH
  3. works terribly with generics
  4. they encourage you to use IllegalArgumentException if a parameter is null which we all know is wrong (obviously)
  5. CLASS retention
prisma wave
#

how is 4 wrong lol

hard dagger
#

because thats what java chose and i think its more important to be consistent than whatever the argument going for IAE is

#

its not like users should be catching NPE or IAEs anyway. theyre programmer errors.

prisma wave
#

sure, so why does it matter?

#

consistency, that is

hard dagger
#

i dont rly have a reason

#

i just think it is

#

makes stuff slightly (like very slightly) less confusing

#

thats it rly

prisma wave
#

if anything i think IAE is better, it's more obviously "an argument value was wrong", whereas NPE is just generic "something was null"

#

but this is very deep into bikeshedding territory

hard dagger
prisma wave
#

sure, it should

#

but by that logic we should just use RuntimeException for everything & specify details in the message

#

we have distinct types for a reason