#help-development

1 messages · Page 1280 of 1

round basin
#

Its loginsecurity

#

And via plugins

#

And chatsentry

#

He using

#

Bruh i dont want illegal stuff i just wanted to give their old password

round basin
mortal vortex
round basin
mortal vortex
#

Whats the purpose of needing to give someone their password? Have they forgotten it?

round basin
mortal vortex
#

Huh

#

Why do you want / need to see their password?

round basin
round basin
fathom dirge
# round basin Its loginsecurity

I just looked through their code and i can tell you with 100% certainty that the passwords aren't stored, only their hash value. So no way to get that old value unless you look through old logs where they logged in/ registered their password

mortal vortex
#

Did they forget their password?

fathom dirge
mortal vortex
#

If they forgot their password, then you can just change it for them?

round basin
mortal vortex
fathom dirge
round basin
fathom dirge
#

?

mortal vortex
#

You're completely making some bullshit up right now

#

there is no genuine excuse to need to retrieve someone's password

fathom dirge
#

Yeah true

mortal vortex
#

Has someone forgetten their password? you reset it.

#

You're clearly up to something if you cant provide a decent answer

round basin
#

@mortal vortex are you idiot

#

Some randoms guys come to say reset my password without confirmation that doesn't his account

mortal vortex
#

"idiot"

young knoll
#

Yo

#

Gimme your password

#

:D

round basin
#

Give him

mortal vortex
round basin
#

Or die tmr

glossy laurel
#

any good, free dependencies for making npcs in order to avoid nms?

sly topaz
#

if you just want NPCs that don't move, Lib's Disguises is usually a good option

glossy laurel
#

i want npcs that move

sly topaz
#

otherwise, you could meddle with Lib's Disguises + MobChipLite or Citizens

#

neither option is fun to work with

glossy laurel
#

😭

#

is nms easier?

grand flint
glossy laurel
grand flint
#

Mythicmobs + libs disguises is good

#

You can also use model engine for custom NPCs

#

Like custom models with texturepack npcs

glossy laurel
#

i just need players w skins

sly topaz
sly topaz
#

if so, how easy it is to move entities in comparison to say, MobChipLite

#

seems like they just wrap a ton of the pathfinding stuff as well

grand flint
#

idk i just know mythiccraft has the best plugins

#

i mean from their wiki alone

#

ull see the quality

thorn isle
#

mythic is trash

#

but libsdisguises is definitely a good fit

#

you can use mythic for the mob ai if you don't want to do anything complicated with it, like just have it wander or stand still

sly topaz
#

it isn't bad, but definitely could be in better shape

thorn isle
#

for anything more complicated you most likely want to control the entity yourself with the goals or pathfinder api

sly topaz
#

there's no pathfinder API in spigot 😛

#

gotta use MobChipLite

thorn isle
#

and this includes slimefun

#

almost everything is broken or finicky in some way and the api documentation is in chinese

chrome beacon
#

I recommend just using Citizens

sly topaz
#

Citizens API is just painful

chrome beacon
#

🤷‍♂️ Haven't found it that painful to work with

thorn isle
#

i've never used it because i begrudgingly use mythic for my npcs

#

since all they do is stand around

sly topaz
#

Inventivetalent's NPC API was nice

#

too bad they aren't around anymore 😔

thorn isle
#

one of these days i will switch to something else however because even at this mythic sucks ass; the npcs randomly duplicate as mythic loses track of them and spawns new ones

chrome beacon
#

Time for Citizens

#

which many servers already have installed

worthy yarrow
#

That’s their fallback?? Just spawn new ones

sly topaz
#

I can't blame them too much for it, dealing with NPCs is just annoying

thorn isle
#

well it's not exactly intended for npcs or half of the other things people use it for, but you can get something similar by creating a spawner with a spawn limit of 1

sly topaz
#

but I do understand the frustration

worthy yarrow
#

Interesting

thorn isle
#

unfortunately in the area it is meant for, that is custom mobs, it basically has a monopoly

#

i say unfortunately because it's ass to work with api wise

sly topaz
thorn isle
#

i've written a few addons and it's like having sex with a cheesegrater

worthy yarrow
#

Well now why do you know what that feels like o_O

thorn isle
#

obfuscated-nms tier "what does this do" "what is this" -> decompile and look around aimlessly until it starts making sense

worthy yarrow
#

I started working on wind mechanics for the frisbee physics, attached a vector to every chunk of the “arena” issue is that without a legit wind system, every chunk has a wildly different vector… should I just suck it up and make a proper system?

thorn isle
#

something something layered perlin noise

worthy yarrow
#

Eek

#

I was trying to avoid perlin for now until I felt like rewriting the generation

thorn isle
#

it's fairly simple in principle, you're already doing one layer of perlin noise (without interpolation) basically

#

what you do is you look at the 4 nearest chunks, get their random vectors, weigh them so the closest one has the highest weight, take a weighted average them

worthy yarrow
#

Ah yeah that would work

thorn isle
#

that gets you 1 layer of noise

#

you'll want to add a few more layers

worthy yarrow
#

I mean as far as I can tell, just a simple vector applies some nice looking wind effects

thorn isle
#

i.e. you add a second wind vector to say every 8th chunk. and then you take the nearest 4 of those, weigh them again, and add average with the 4 from the first layer

worthy yarrow
#

I need to do bounce mechanics too smh

#

Well “skip” mechanics

thorn isle
#

just averaging the nearby vectors doesn't solve the problem that adjacent chunks will have wildly different vectors, it just makes the transition smoother

#

adding more layers means that the vectors are more locally coherent, i.e. the vectors in adjacent chunks are more similar

worthy yarrow
#

As it stands right now, you can throw about 6-8 chunks max so that actually sounds perfect

thorn isle
#

mmm i guess it depends on how noticeable the wind is

#

if the wind has a large effect and every chunk the frisbee goes through tosses it wildly in random directions, hitting anything is probably going to be impossible

worthy yarrow
#

Well when I turn up the impact, the disc gets crazy to say the least lol

#

I found a nice number for the outcome of the effect, being like .2-.7 multiplied by the frisbees initial vector every tick

#

Well not multiplied, rather applied based on initial throw direction against the wind direction

#

Skip physics though… I have a couple parts to this, based on the hyzer (angle) of the disc you’ll have more chance of the disc skipping off the ground on its first impact, basically have to write something like

Angle X * Velocity = skip power
Skip power * impact vector = final skip power
ApplySkip(finalSkipPower)

#

Still have to implement the angle modifier in the throw mechanic though

pure dagger
#

uhm, im doing black holes but its kicking players because flying is not enabled, i disabled gravity for them, is there somethin i can do or does the user have to enable flying on the server?

worthy yarrow
#

Attach the player as a passenger to a display entity and then just move the display

thorn isle
#

iirc that's a vanilla server feature that can be disabled in server.props or something

worthy yarrow
#

I assume it’s intentionally disabled

thorn isle
#

all it does i think is check if the player is not grounded for x seconds and not falling and kicks them

#

i think quite a few servers have it disabled because proper anticheat plugins exist and it has had odd false positives of players getting kicked when they stand on beds

#

that said the proper anticheat plugins will also most likely kick the players for flying or at least rubberband them back

worthy yarrow
#

Then yeah just put the player on a display entity

thorn isle
#

this'll add a bit of latency to the player controls (and you'll have to listen to the player input event to move the display around) but i suppose that does work

worthy yarrow
#

Visually will probably be smoother as well

#

I figure if you’re in a black hole you’re not doing much moving anyway lol

thorn isle
#

mmm i'm not sure

#

you're not in it yet, you're just getting attracted to it

worthy yarrow
#

Guess it depends what black hole is to kmys

thorn isle
#

there's the option of uh adding the levitation effect, but you can't really control how fast the player ascends with all that much granularity

young knoll
#

How did you disable gravity

#

I don’t know if the normal setGravity method works for players

#

But the attribute does

pure dagger
#

it worked

#

oh

#

yeah it owrked

#

idk how to do the mob riding thing, seems complicatd

worthy yarrow
#

Given that the player could move, I guess you could just let them do what they can until a point where you then attach to a display to visually display them getting sucked in lol

worthy yarrow
#

Cuz it’d be the same thing just to a different entity

#

But the player is a passenger so they also are moved with it

young knoll
#

But then they can’t fight it

worthy yarrow
#

There’s probably a point where you can’t

pure dagger
#

yeah, using vectors is better cause player can move in the opposite way to slow it down

thorn isle
#

you can listen to player input and move the display accordingly manually

young knoll
#

True

thorn isle
#

but this adds a little bit of latency and has other issues, like disabling knockback

worthy yarrow
#

That would be the complex part

young knoll
#

But it probably wouldn’t feel as natural

worthy yarrow
#

You know what a natural black hole feels like jish?

thorn isle
#

i think slightly trudgy movements inside the field of a black hole is probably fine, but the knockback is an issue if the minigame includes pvp

young knoll
#

I visit them all the time

worthy yarrow
#

I’ll have to take your word for it lol

young knoll
#

Go decompile the old thaumcraft code and see what they did

#

Kek

thorn isle
#

alternatively, don't disable gravity but add the levitation effect with a level proportional to the Y component of the movement vector you want to add

pure dagger
#

also how to make entity unpushable?

#

do i have to use the event?

pure dagger
young knoll
#

Teams should work

pure dagger
#

oh.. i never used teams idk how that works

thorn isle
pure dagger
#

/team modify lalala collisionRule never
thsi thingy? what do i do

thorn isle
#

if you want the player to go up you apply a levitation effect to them

pure dagger
thorn isle
#

levitation

pure dagger
#

oh

thorn isle
#

as an alternative to setGravity(false)

pure dagger
#

can you add 0 levitation effect so player just levitates in place?

young knoll
#

I still recommend the attribute

thorn isle
#

i don't think so, but you can remove and add it every tick or every few ticks so the player approximately stays in place

young knoll
#

Assuming you are in modern version

thorn isle
#

that said the attribute/actually allowing flight for the player (with a slow movement speed) might be better at that point

#

that's basically zero-gravity and you can move in 3d

pure dagger
young knoll
#

I don't think the second one does anything

#

Idk though

pure dagger
#

but why doesnt the anti-fly system check if a player has gravity turned on

pure dagger
#

i can show you my code

young knoll
#

Maybe it checks the attribute

pure dagger
#

what about anti-cheat plugins

#

are they usually also 'bad'

#

and kick players when they gave gravity disabled

young knoll
#

One would hope not

pure dagger
#

ill test the attribute waittt

#
if (closestEntity == null) {
                onlinePlayer.setGravity(true);
            } else {
                Location entityLoc = closestEntity.getLocation();
                Vector vector = entityLoc.toVector().subtract(playerLoc.toVector());
                vector.normalize().multiply(0.1);

                onlinePlayer.setVelocity(vector);
                onlinePlayer.setGravity(false);
            }

also thats the code

#

it happens every 5 ticks

young knoll
#

Isn't that going to be the same strength regardless of distance

#

Because you normalize the vector

pure dagger
#

yeah

#

i guess thats what its supposted to be

thorn isle
#

i assume closestEntity only refers to the closest black hole rather than any arbitrary entity

pure dagger
#

yep

#

it only works if theres a black hole in 6 blocks distance

#

so its just sucking the same speed i guess

#

small black hole

pure dagger
young knoll
#

rip

pure dagger
#

so should i use the attribute over setGravity?

thorn isle
#

if it doesn't help, no

pure dagger
#

yay

thorn isle
#

you can try allowing and enabling flight for the player and setting their flight speed to something small

pure dagger
#

wait you could do that 😭?

pure dagger
slate tinsel
#

Is it normal that Bukkit#getEntity(uuid), returns null when doing that in the cosnumer that world#spawn() offers?

        return world.spawn(location, TextDisplay.class, textDisplay -> {
            textDisplay.setBillboard(Display.Billboard.CENTER);

            System.out.println("Is entity null? " + Bukkit.getEntity(textDisplay.getUniqueId()));
        });```
sly topaz
eternal oxide
#

the consumer runs before the entity is added to the world

sly topaz
#

why would you use Bukkit#getEntity there though

eternal oxide
#

its purpose is to allow modification before spawning the entity

thorn isle
#

its purpose is for me to throw an exception in it and then catch it with a try-catch wrapping the spawn call, as a hack by which I can instantiate an entity without adding it into the world, without depending on nms

#

this is what it was added for

slate tinsel
eternal oxide
#

lol

slate tinsel
#

no wait, the uuid

#

the method did then use Bukkit#getEntity

#

I hated that method

#

So I will change it, it just looks better also

eternal oxide
#

wilmer, your textDisplay IS the Entity which will be added to the world. Its not there yet so you can;t fetch it

sly topaz
thorn isle
#

it does

#

for now

#

just don't tell the paper nerds or they will patch it

sly topaz
#

someone should probably open a bug report about that lol

thorn isle
#

i will burn your house down

sly topaz
#

I couldn't care enough to open it myself, so you're safe

slate tinsel
sly topaz
#

that said, isn't it easier to just spawn the entity through nms, it should just be an addEntity call

thorn isle
#

if i'm already depending on nms, yeah

#

but that has its own baggage

slate tinsel
#

Thanks 🙂

thorn isle
young knoll
thorn isle
#

did that pr finally go through?

#

i remember the paper nerds fighting it super hard

young knoll
#

It went through a while ago

thorn isle
#

or is that the one that doesn't let me get an actual entity instance that i can modify and pass on to protocollib to send entity update packets

young knoll
#

You can

thorn isle
#

neat

scarlet shard
#

Hey, I'm trying to load a world with only certain biomes for a gamemode I'm developing, how would you do that? I also don't want to generate any oceans, but they are generated despite removing the ocean biomes.

pure dagger
young knoll
#

No

#

Only 1

pure dagger
#

doesnt seem a good aproach then

#

i just did vehicleMoveEvent

#

and teleported it bakc lol

pure dagger
#

can falling block chests contain items ?

#

saved

#

?

chrome beacon
#

yes

pure dagger
#

how

chrome beacon
#

No that doesn't contain the state

pure dagger
#

Location location = block.getLocation();
World world = block.getWorld();
BlockData blockData = block.getBlockData();
block.breakNaturally();
world.spawnFallingBlock(location, blockData);

#

i did this

#

doesnt work

chrome beacon
#

You might need to use NMS

pure dagger
#

oh

chrome beacon
#

I don't really see an API method for it

pure dagger
#

then i dont want

#

then

#

how to break it exacly like in creative, so the items from chest drop, but the chest itself doesnt?

sly topaz
chrome beacon
#

Looks like Paper has a method to set the block state though

#

Spigot does not

sly topaz
chrome beacon
#

Yeah

#

you can do that

smoky anchor
#

just do /summon smh

smoky anchor
#

tfw commands can sometimes do more than the API

chrome beacon
#

it does?

#

oh well 🤷‍♂️

pure dagger
#

yeah it just destroys it like in survival

#

i dont want to dupe the chest so it has not to drop

#

has to not drop

smoky anchor
#

I believe you could store the broken block pos temporarily in some set and then listen to the block drop event thing
there may be better way

pure dagger
#

i think ignoring it and just breaking entire chest will be better (not spawning the fallin block) cause the falling chest blocks are invisilble anyway

#

thatll be easiest

chrome beacon
#

falling chest blocks weren't invisible last I checked

smoky anchor
#

ye that was fixed I believe

chrome beacon
#

could be wrong though

pure dagger
#

i dont see it lol

#

im on 1.21

smoky anchor
#

wait, version ?

sly topaz
sly topaz
#

Ah, on the falling block

#

I was looking at the BlockData

chrome beacon
pure dagger
#

yes

chrome beacon
#

or what version exactly

pure dagger
#

oh

chrome beacon
#

but why would you be on .0 💀

pure dagger
#

the server is on 1.21.5

#

but plugin is for 1.21

pure dagger
#

is there a list of blocks that can contain some items inside ?

chrome beacon
#

if it's a client rendering issue the client version matters

pure dagger
#

then 21.5

chrome beacon
pure dagger
#

oh thats an interface

pure dagger
chrome beacon
#

yeah

#

Do note that getState can be a bit intensive to run since it has to copy a bunch of data

pure dagger
#

so what

#

i shouldnt do taht?

#

or shouldnt i do that a lot

chrome beacon
pure dagger
#

why do you send sad octopus emote

#

💀

chrome beacon
pure dagger
#

okay

#

does getBlockData return a clone?

sly topaz
pure dagger
#

why

sly topaz
#

BlockData is kind of a Block snapshot

gentle inlet
#

how can I cancel the book and quil gui opening when clicking a book as I did canceled the interaction event but it didnt work? I found closing the inventory worked but then there was a flash of the book gui

chrome beacon
#

You cannot

#

as you've been told before that menu is clientside

gentle inlet
chrome beacon
#

The client accepts the close inventory packet for all inventoryies and menus

#

even the pause menu

gentle inlet
smoky anchor
#

if you don't want openable book & quill then you can use the item_model component on some useless item
assuming you're on some latest version

smoky anchor
#

I don't see any actual use case besides malicious

gentle inlet
hidden wolf
#

Does anyone use paper here?

gentle inlet
#

this is a spigot discord server if you want to talk about paper join the paper discord server

hidden wolf
#

Didn't know they had one 💀 thanks

gentle inlet
dusky rivet
#

How can I disable players from hitting if they have a bow in their hand? They can still shoot the arrow, they just can't hit a player with a bow in their hand.

mortal hare
#

did i broke type checking in intellij or smth

#

im using guava's loading cache and i want to cache null values also so i use Optional<> wrapper around objects just to cache null values, but i dont want to fire up cache loading mechanism for the first check since there might be already cached value

remote swallow
#

is the optional null or its contents null

mortal hare
#

optional

#

getIfPresent returns @Nullable T and T is Optional<Password>

#

this sounds counter intuitive from optional perspective to return null instead of empty optional

#

but its just how guava is laid out

#

basically i want to fire up cache loading mechanism only and only when optional doesnt even exist, otherwise read the value from the cache

#

if the cached optional is empty i want to invalidate the cache key to refetch the value

#

i want:

  • Invalidate Optional.empty() (of typeOptional<Password>) if cache.getIfPresent(id) is not null
  • If cache.getIfPresent(id) is null, fetch that value.
  • If cache.getIfPresent(id) is notnull and fetched value is not Optional.empty() use that cached value in the method instead
#

i guess i can evade this warning by calling calling cache.get(), instead of cache.getIfPresent() twice by praying that implementation is not dumb enough to not notice reoccurring calls

#

but i guess it wouldnt work because if i call it twice i need to invalidate the cache somehow and that would call back the database twice for the same null value, if for the first time values wasn't cached

#

performance

buoyant viper
# mortal hare

i think the issue is ur checking if the optional is null, which should always be false

#

u need if optional.isPresent

#

or ifPresent whatever

mortal hare
#

no you dont get it the returned value from cache.getIfPresent is nullable, and i've set the cache's generic parameter as optional

#

intellij just freaks out because it looks weird to do comparison with optional

#

but its completely legal in this case since i need to check whether optional object itself is null, i.e if the cache even held any value before

buoyant viper
#

ah

#

seems a bit odd to use an optional here instead of the actual type, but if u see the vision go ahead

mortal hare
#
    @Override
    public boolean login(UUID id, String password) {
        Optional<Password> optional;
        try {
            optional = cache.getIfPresent(id);

            // This is needed since Optional itself is nullable from cache.
            //noinspection OptionalAssignedToNull
            if (optional == null) {
                optional = cache.get(id);
            } else if (optional.isEmpty()) {
                cache.invalidate(id);
                optional = cache.get(id);
            }
        } catch (ExecutionException exception) {
            throw new AuthenticationException("Failed to check existence of authentication entry with id: " + id, exception);
        }

        Password validator = optional.orElseThrow(() -> new AuthenticationDoesNotExistException(id));
        return validator.validate(password);
    }

this seems to do what i need i guess

#

i love caches

#

right now

#

until i won't

#

🥲

#

but do i even actually need these checks? i mean login is not an write operation it shouldnt invalidate cache

#

cache.get() is more than enough imho

slender elbow
#

what even is the purpose of using an optional here

mortal hare
#

to represent non existant user authentication state

#

i lazy load whole user object on isRegistered() method call via the guava's cache

#

and then i reuse that cached object inside login method

#

saves sql bandwidth

slender elbow
#

i fail to see the usefulness of an optional here, you aren't really considering optional being a valid value so, why make it one in the first place?

#

or the usefulness of using getIfPresent either

mortal hare
#

look, i do have isRegistered() method which checks inside the database if user is registered or not by grabbing whole user object and putting it into cache, then inside login() i dont need to call database again since the object which was retreived via isRegistered() is already in the memory, thus i use Optional<> here. isRegistered() might result in empty optional if the user is not registered

plush sluice
#

hey. im pretty new to NMS and im getting that error when compiling, does anyone have answer to this? "cannot access net.minecraft.network.protocol.", im using

<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.21.5-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>
slender elbow
#

but in either case, if it isn't in the cache or if it's empty, you're just recalculating the value, and if that returns empty, you're throwing an exception

#

i am not asking what isRegistered does or how it works for optimization purposes, i'm just questioning the use of an optional in a cache

mortal hare
# slender elbow but in either case, if it isn't in the cache or if it's empty, you're just recal...

that code example i've provided is kinda incorrect i've simplified it in to this:

    @Override
    public boolean login(UUID id, String password) {
        Optional<Password> optional;
        try {
            optional = cache.get(id);
        } catch (ExecutionException exception) {
            throw new AuthenticationException("Failed to check existence of authentication entry with id: " + id, exception);
        }

        Password validator = optional.orElseThrow(() -> new AuthenticationDoesNotExistException(id));
        return validator.validate(password);
    }
#

since login is readonly operation it shouldnt invalidate cache for no reason

#

cache is guava's LoadingCache

slender elbow
#

that looks slightly better, although I would throw the exception in the cacheloader and simply return the Password value when it's valid

mortal hare
slender elbow
#

what i'm saying is that you can make the CacheLoader for that specific cache throw the exception

mortal hare
#

yes but then it wraps into UncheckedExecutionException

slender elbow
#

unwrap it?

mortal hare
#

i want to maintain initial exception type for interface contract

mortal hare
# slender elbow unwrap it?

why tho, that might incur instanceof checks for getCause() for no reason you can just place it outside cache scope

slender elbow
#

sure

#

you do it that way i suppose

#

i just wouldn't

#

if i know only one kind of unchecked exception can be thrown, then it's gonna be that

#

i don't see the benefit in using an optional

#

but if it tickles your braincells, go ahead

mortal hare
#

👀

pure dagger
#

can i just do this
Entity entity = world.spawnEntity(location, EntityType.FALLING_BLOCK);

instead of world.spawnFalling block?

#

like whats the difference

#

oh cause the falling block can have some data

#

, material

#

??

pure dagger
#

can i make furnace minecart invisible ?

sly topaz
#

Not sure, try it

pure dagger
#

but how

#

it not living entity

sly topaz
#

You can definitely hide it with the hide/show entity api

pure dagger
#

what is that

sly topaz
#

Player#hideEntity

winter jungle
#

Is there a way to change the title of a player's inventory?

echo basalt
#

also your gui's a pixel off

winter jungle
#

yee i know xd

echo basalt
#

Set it to " "

#

lang.container.title or something

sly topaz
winter jungle
#

well its obvious xd

echo basalt
#

it's so noticeable fym

winter jungle
#

much better

sly topaz
#

I thought it was just a rounded corner from the preview

young knoll
#

Actually it was 2 pixels off

sly topaz
#

sorry had to do it

chilly swallow
#

When I open a chests inventory manually (using block state) it triggers the animation- is there any way to open inventory (not a snapshot!) without the animation?

sly topaz
young knoll
#

Isn’t that what they just said they did

chilly swallow
#

yeah it triggers the animation for some reason

sly topaz
#

didn't think that would trigger the animation

#

does just calling Lidded#close cause the animation to bug out?

#

I don't think there's any way to open the inventory without triggering the animation other than cloning the inventory view or something

chilly swallow
sly topaz
#

what about a tick after

chilly swallow
#

I will give it a shot

#

Would the only other way be to intercept packets?

sly topaz
#

that's one way to do it, but if you're willing to intercept packets then maybe there's a NMS method you could call for it

chilly swallow
pastel nova
#

Guys how do I set up worldguard properly? It seems like a bunch of plugins do the same thing and I cant figure out how to assign people in each plugin etc… i use LuckPerms for perms, WorldGuard for spawn protection and essentialX for commands

mortal vortex
#

You mean with the API?

pastel nova
#

nono

#

i mean I have to set up the permissions for each group but it seems like every plugin overlaps with each other someway

mortal vortex
pastel nova
#

plus luckperms doesnt allow me to remove minecraft vanilla commands

remote swallow
#

if you want to remove a default allowed command give them the permission set to false

pastel nova
#

so i need to go to help-server

pastel nova
#

but that doesnt work, i set permission minecraft: false which logically should set all childs to false

remote swallow
#

thats not how permissions are formatted

pastel nova
#

but i still can use /tellraw, and vanilla commands

remote swallow
#

you would want minecraft.command and set the field to false next to it not using a colon

pastel nova
remote swallow
#

there is also a chance that minecraft perms dont get auto expanded with a star

#

ex it should look like this on the gui

pastel nova
#

yeah i know, i tried both minecraft.* and minecraft

remote swallow
#

and make sure you saved/applied it too

pastel nova
#

mh lemme try again then

#

yeah that too, since im w bungee i had to set up a mysql container to share permissions, i though that was a problem but the connection worka

#

And i am part of the default group

remote swallow
#

do you have op by chance

pastel nova
#

yeah that was gonna be my next question

#

if op overrides any of this

remote swallow
#

in most cases op will override it

pastel nova
#

would it be "smart" to remove op from everyone and handle everything through lp?

paper viper
#

Everyone has op??

pastel nova
#

ye sorry ill move there

pastel nova
buoyant viper
#

ie. no one should have more permission than they will need, u can always modify it later of needed

pastel nova
buoyant viper
#

intellij im gonna be honest i dont give a shit that im for (int i = 0; i < list.size(); i++)-ing instead of for (Type name : collection)-ing

remote swallow
#

im too kotlin'd

#

that java just looks weird to me now

buoyant viper
remote swallow
#

maven smh

buoyant viper
#

i am workin on the shittiest algorithm known to man rn

buoyant viper
remote swallow
buoyant viper
#

yeah i couldnt get workingDir to work

#

tried executableDir

remote swallow
#

smh

buoyant viper
#

didnt seem to launch in the right spot still

mortal vortex
#

About to start a game design project for class, before I pick libGDX, does anyone have any personal issues with it? Like reasons I should avoid it?

#

Dont want to jump ships after I'm hours deep into it, would prefer to know of any issues it has before getting started

buoyant viper
#

do it from scratch

#

write your game in C++ and OpenGL 🙏🏻

mortal vortex
empty heart
#

I'm trying to disable logging of two of my plugin's commands. The command is logged in the console... {PLAYER} issued server command: /{COMMAND}.

I tried setting up a filter in the plugin's logger, but the command gets logged anyway. I want to disable it ONLY for my plugin, ONLY for '/register' and '/login' commands.

My current attempt:

private void setupCommandLoggingFilter() {
        getLogger().setFilter(new Filter() {
            @Override
            public boolean isLoggable(LogRecord record) {
                String message = record.getMessage();
                return !message.contains("issued server command: /register") ||
                        !message.contains("issued server command: /login");
            }
        });
    }
sullen marlin
#

Youd need to filter the whole server log4j logger

empty heart
#

Bukkit.getLogger()

'getLogger()' is marked unstable with @ApiStatus. Internal

I'll try this

warm mica
vital sandal
#

I got this error when running Build tool

#

seemed that it cannot accthat the maven installation :l

#

although mvn already exit

sullen marlin
#

Looks like they deleted old maven from the server

#

I'll change the url, but you can set M2_HOME

vital sandal
#

I wonder why you just get the latest version automatically 🤔
LATEST_VERSION=$(curl -s https://maven.apache.org/download.cgi | grep -oP 'apache-maven-\K[0-9]+\.[0-9]+\.[0-9]+' | head -1) echo "Latest Maven version: $LATEST_VERSION"

chilly swallow
wet breach
chilly swallow
#

Thank you 🙏

wet breach
#

would need to send that packet and set the number to 0

#

and then every 4-5 ticks

#

you would need to listen for that packet going out

#

and just modify it

#

as long as it is 0 the animation will not happen

#

the number represents the number of players looking in the chest

chilly swallow
#

Ahhhh okay

#

thanks so much

wet breach
#

np

fallow storm
#

So PersistentDataContainers you get directly from PersistentDataHolders can hold PersistentDataContainers. Is there a way for me to instantiate one of these containers? The actual PDC class is an interface and I don't know how to find what proper class the one I'm looking for is.

#

I want to store a new sub-container on an existing one

fallow storm
#

Big thanks!

sly topaz
#

if you're making a PersistentDataType, you can use the adapter context from the method params of the fromPrimitive/toComplex methods

#

if not, then you can just take it from an existing PersistentDataContainer, however I'd encourage to make a custom PersistentDataType if you're trying to represent a class as a PDC

#

@fallow storm ^

#

reason is that a custom PDT encapsulates the serialization logic into a single class, which makes it easier to handle

torn shuttle
#

I get 4 support tickets

#

damn

mortal hare
#

oh wow intellij's terminal rendering had improved in recent versions

#

no more flickerry mess

#

nice

#

its as fast as native conhost

#

wow

#

now that i think off. isnt shading like a bad practice in terms of java development. i mean you can just load the libraries externally, by supplying .jar files and executing jar file by using runtime class path flag inside CLI: java -cp "libraries/* -jar app.jar

#

paper imho already does something like this where you declare dependencies inside plugin.yml and then it'll autodownload the dependency for you and put it inside libraries folder, that way you can reuse the same lib across different plugins, not sure if spigot does it

#

kinda cool

young knoll
#

You can do it with spigot

#

If it’s on maven central

mortal hare
#

why do people shade libs then?!

young knoll
#

Not everything is on maven central

#

Also some plugins like to work on versions before 1.17

mortal hare
#

does spigot itself allow to specify custom maven repos?

young knoll
#

No

mortal hare
#

🤔

torn shuttle
#

or that it will be in there with the version you want

#

shading guarantees you have the things you depend on in there in your own terms, unmodified

mortal hare
#

you dont even need to have headache with launch scripts gradle autogenerates that for you

true cosmos
#

windows

mortal hare
#

i've tried to not use it

#

i cant escape it

#

sharex is too good

paper viper
#

Jars are meant to be portable and I don’t know if having to download a separate libs folder is really easy

mortal hare
#

you just .zip it

#

what's so special about it

paper viper
#

And then what would you do if it’s like a plugin

mortal hare
#

let the server software load the dependencies from repository online

#

just like spigot does

paper viper
#

If anything, downloading and loading dependencies is an anti pattern

mortal hare
#

how is that anti pattern

paper viper
#

Not only is it discouraged, but it’s actually against Maven TOS

sly topaz
mortal hare
#

you can reuse the same lib across different plugins

sly topaz
#

it is just a form of distribution, the more well-known term is fat jars or uber jars

mortal hare
#

shading is kind of waste of space

paper viper
#

What do you do

sly topaz
#

that's the static vs dynamic linking dilemma

paper viper
#

Yeah

mortal hare
#

you specify specific version

paper viper
#

And then… what?

mortal hare
#

i'tll load that specific version if it didnt had it it will fetch it

sly topaz
#

now, that is an anti-pattern

paper viper
#

yeah lmao

mortal hare
#

if two plugins use same version apache commons why does it have to shade the same shit

paper viper
#

the issue isn't that... it's if they are different versions

#

you should never ever be loading deps at runtime if anything

sly topaz
#

well, never say ever

mortal hare
paper viper
sly topaz
#

it is discouraged however people do it since it is convenient enough for the end user that one can deem it worth the hassle

paper viper
#

Yeah

sly topaz
#

the reason runtime dependency resolution is frowned upon is simply because it obscures what is required for your program to actually run at its full capabilities

mortal hare
sly topaz
#

declaring them at the build level isn't runtime dependency resolution anymore

mortal hare
#

this discussion tbh is worthless, there wont be any definite answer anyways. it it was we wouldnt have .exe installers, different package managers on linux and .AppImages or snaps or flatpaks

sly topaz
#

unless you do something like gremlin does which makes uses of the build script to declare them, but even that is more or less questionable design-wise

mortal hare
#

.dll/.so vs .lib/.a debate

sly topaz
#

I personally don't see worth on trying to save space just for the sake of it, nowadays it is free so unless you are in a constrained space or a dumb runtime that will attempt to load everything at initialization, it isn't worth the hassle

young knoll
#

Well you are constrained on space with spigotmc

sly topaz
#

I mean, define constrained

#

isn't the plugin size limit like 20mbs

paper viper
#

you arent constrained by spigotmc

#

just dont host it on there

#

or provide your own url

young knoll
#

No it’s like

#

4

young knoll
#

But shh

sly topaz
#

wow they really upped the bar for that huh

paper viper
#

or just like

#

host the releases on GitHub releases

#

lol

sly topaz
#

ig that's partly why md introduced the libraries block

sly topaz
#

most end-users don't know how to use github

paper viper
#

i have an actions that autobuilds so i'd prefer if ppl just downloaded there

sly topaz
#

even if you direct them to the releases page, they get confused as to why there's a zip on the download options

paper viper
#

i hate uploading JARs

mortal hare
#

unless they're private

young knoll
#

Can’t you link the download directly

paper viper
#

you can't, i've tried

#

Even if you get the link to the direct JAR

#

It just redirects to the release page of that JAR

#

some proxy things

sly topaz
#

anyone hosting a server seriously starts from somewhere, not necessarily by knowing how to use github

paper viper
#

you don't need any GitHub experience to host a server

sly topaz
mortal hare
#

i wonder what file format should i use for my custom minestom server

#

im thinking of toml

#

but yaml and json seems fine too

paper viper
#

that's really useful lol

sly topaz
#

it's better than trying to find the artifact on the actions tab, if anything

#

I know how to use github and I get lost myself there lol

paper viper
#

Actaully i cant use nightly link because I don't use upload-artifact in my workflow

sly topaz
#

well, use it 😛

#

otherwise your actions won't have any linked artifacts

#

I've seen some setups which use semantic-release-bot instead which is fine if you want all your builds to be permanent but it kind of clutters the release tab if you don't do semantic commit messages properly

paper viper
#

i just checked the repo and its unmaintained lmao

sly topaz
paper viper
#

Yeah

sly topaz
#

well, it at least doesn't clutter the releases tab by allowing you to just make all your releases the latest one

#

hey, as people say, if it works ¯_(ツ)_/¯

paper viper
#

thing is it doesnt provide a direct link

#

maybe i should just use a separate ci platform

#

to do everything lol

#

ive used circleci in the past but its ass

#

i should selfhost a jenkins instance

sly topaz
#

just use github actions upload-artifact + nightly.link

fluid goblet
#

i require help

#

;-; idk y but the setPermission no work

sly topaz
young knoll
#

Now that’s a godclass

sly topaz
#

I can't imagine writting that much code without trying to abstract it out

#

not that they wrote it all, but still

#

anyhow, if you want to check for permissions, you have to check if the player has the permission at the call site

#

in this case, you'd have to listen to the item craft event and check if the player has the permission for your recipe, if they don't then you can just cancel it

#

Does not having a recipe discovered disallow you from being able to craft it? If so you could listen to the recipe discover event and then cancel that instead. However I am unsure of whether that's actually the case

sly topaz
#

ah yes, hardcoding data in source code, so fun

#

what is SlimeFun even about

#

I know it has some kind of custom storage format which is a bit lighter than the normal one for minigames but that's about as far as my knowledge of it goes

thorn isle
#

you're thinking about the slime world format which is unrelated

echo basalt
thorn isle
#

slimefun is more like an attempt at replicating some popular tech modpacks as a bukkit plugin

echo basalt
#

iirc they used armorstands to store data and it'd corrupt every othre day

thorn isle
#

to varying degrees of success

echo basalt
#

and it's all hardcoded

sly topaz
#

it isn't too bad that it is hardcoded to be honest

echo basalt
#

unacceptable

sly topaz
#

it means that it can be machine processed if someone gets annoyed enough about it

#

like, you could just parse the java code and convert it to a file format and then just modify the code to read that file instead, wouldn't be particularly hard to write a tool for

#

I assume that after you get all the hardcoded data out of the way, the rest of the code is way more digestable, though I haven't really looked at it

thorn isle
#

personally i don't mind the recipes being hardcoded since doing them in a non-source file wouldn't benefit for linting or autocomplete or anything else nice

#

but imo the recipes shouldn't all be hardcoded into the same class

sly topaz
#

I mean, you can defintely get all those benefits with the right format, but you'd have to create a scheme and the such so yeah, I get it

sly topaz
thorn isle
#

it definitely matters, locality is important

sly topaz
#

they could use some help of indentation and comments to make separation clearer, but other than that

torn shuttle
#

if you have a finite amount of recipes it doesn't matter

sly topaz
#

also having it as a format allows one to keep adding them fast as well, while having them in code means recompiling which can be annoying for something so huge

thorn isle
#

currently the item definition, i.e. the recipe, item stack, and behavior are spread in three different places; this class, the SlimefunItems god class, and then the SlimefunItem subclass for that item, respectively

#

this is ass

#

if it were up to me, it'd all be in the latter

sly topaz
#

Ig that's where locality would indeed matter, the fact that the class is so huge means that the code takes longer to compile lol

thorn isle
#

not just compile but to find or do anything with it

torn shuttle
#

if it were me it wouldn't be anywhere because it'd be getting anonymously initialized from config files but that's just down to how you want to scope things

echo basalt
#

not a fan of god classes

sly topaz
#

all of this said, I can't really shit on it

thorn isle
#

i can and i will and i have done so and will continue to do so

torn shuttle
#

they're fine if you have a finite project that does X thing and will never need to do anything more

sly topaz
#

it is very straight-forward code, even if not up to my standards

true cosmos
#

some1 mentioned god code and im piqued

sly topaz
#

I prefer straight-forward code rather than heavily abstracted code that takes me making diagrams on paper to understand

torn shuttle
#

I have some AI projects that just do one very linear task, basically a glorified script

#

it's just a dump with a single java class doing the entire thing

sly topaz
#

this would probably be a case where AI could help massively, though I doubt any current model has big enough context window to handle it lol

torn shuttle
#

gemini has a context size of 2 millin

#

more than enough for most spigot plugins

echo basalt
#

I remember seeing rumors that siri would be able to take user inputs and make shortcuts out of it

ivory sleet
thorn isle
#

more input tokens means more money spent

echo basalt
#

effectively vibe coding

#

this feels like that

torn shuttle
#

and boy

sly topaz
torn shuttle
#

I just get the biggest smile on my face every time I make a 1 mil token request to google

#

I love spending their money

sly topaz
#

I will never understand the obsession with that pattern

thorn isle
#

i'm a bit doubtful as to how long these free services will last but we'll see

torn shuttle
#

oh I'm sure they won't

thorn isle
#

doesn't seem like a very good business model

torn shuttle
#

I'm maximizing their costs as much as I can right now

true cosmos
#

local llms dont seem fast enough to code yet

thorn isle
#

throw more gpus at them and they'll become faster

torn shuttle
#

tbf though

#

give is what

#

20 years?

#

and everyone might have a top of the line model enterprise gpu in their desktop

thorn isle
#

but at that point you're better off just leasing compute

true cosmos
#

less accessible to low end computer use of like students and stuff who really deserve the ai

torn shuttle
#

plus 20 years of ai improvements

thorn isle
#

i'm looking forward to the asic's

true cosmos
#

On a desktop local is doable 96GB or 128GB RAM

torn shuttle
#

imo, fast forward 10 years and a lot of people will be able to run claude 4.0 thinking on their desktop

#

which would already be enough for a lot of things

thorn isle
#

prooobably

torn shuttle
#

(i'm talking in terms of equivalencies)

young knoll
#

Do not mention slimefun around me ever again

#

I will have an aneurism

torn shuttle
#

no joke claude 4.0 is already smart enough to make for some really interesting games if you just had free tokens

thorn isle
#

har har har

torn shuttle
#

but it's also insanely expensive

#

I think I have over $100 in api costs using it over the past 3 or so months

thorn isle
#

you've just got to optimize your usage and not send it 1 million token requests

torn shuttle
#

already have

thorn isle
#

not enough

young knoll
#

Optimize your usage to 0

torn shuttle
#

sure, judge something you know nothing about

thorn isle
#

try harder

torn shuttle
#

that seems reasonable

true cosmos
#

Idk how to get my agent to do a task for x time

torn shuttle
#

that's not how LLMs work, you give it a query and it replies, one time

#

you can make it chain in on itself if you want to

true cosmos
#

ive got it to chain enough to make a README of a codebase

torn shuttle
#

but that's just basically getting it to talk to itself and then putting an arbitrary end point

thorn isle
#

that's one thing i think inference providers should work on more, better integration of function/tool calls

true cosmos
#

it was accurate but pretty short

thorn isle
#

i think the openai realtime models did something like this but they were far too expensive at base for it to be useful

torn shuttle
#

most models only get 8k output tokens

#

even gemini which has 2 mil in

#

which is a major weakness

#

for a lot of stuff it simply is not enough

true cosmos
#

Yeah individual files never seem to get up to production size from prompting

thorn isle
#

i think this is mostly a limitation of the infrastructure the models run on rather than the models themselves

torn shuttle
#

I think it's both, models don't like it when they can talk for too long

#

that said some frontends clearly have workarounds for this already

#

claude can write 5 full classes of code with each more than 8k tokens in a single reply while the api can't

true cosmos
#

you're referring to claude code?

torn shuttle
#

claude 4.0 sonnet or opus

#

or 3.7 thinking

thorn isle
torn shuttle
#

sure, mildly

thorn isle
#

take for example an openai function call

#

all it really does is append some new tokens at the end of the context and then resume inference

torn shuttle
#

there's the disadvantage that if it goes in the wrong direction you're just going to waste more time

#

but that's about it

#

I mean it's basically how deep research works and that's usually kinda fine

#

I wouldn't say it's faster at finding what I was looking for than I am, but I can just be working on something else while it's digging

#

also reminder we might already be in one of the best eras of AI because we don't have built-in ads in them yet

#

that's going to be something else when every platform has built in ads and you AI girlfriend really wants you to go out and buy a verification can of dr pepper

true cosmos
#

can't wait for NPCs

#

i noticed copilot has an npc vibe

worthy yarrow
#

💀

true cosmos
#

watching an npc just cleaning up streets

#

watching an npc play video games

torn shuttle
#

I mean

#

autonomous street cleaners already exist

#

and you can watch gemini, claude and uh

#

grok?

#

playing pokemon right now

true cosmos
#

yeah super fascinating to me

torn shuttle
#

o3 not grok

#

who knows maybe grok is also doing it somewhere

true cosmos
#

my test for them is to see which chemical compound is their favorite

#

chatgpt is the only one which wasnt a duplicate of the others but anyway the cool thing is them making creative decisions

flat lark
#

What would be the best way to receive one way inputs from a player. I was thinking of using conversations as all I need may be a input, int or such like that? but unsure of how retrieving the information after the conversation ended or timedout

true cosmos
#

i guess they're mostly utilitarian

thorn isle
#

what's your favorite chemical compound

true cosmos
#

myrcene

thorn isle
#

personally i'm quite partial to water

torn shuttle
#

caffeine

true cosmos
#

i would have said that 5 years ago

#

caffeine probably 4 y ago

thorn isle
#

after all i'm 80% water

true cosmos
#

today myrcene, tomorrow morphine

thorn isle
#

and i'm the best thing i know

true cosmos
#

i know them all i love chemistry

thorn isle
#

so water is at least 80% good

torn shuttle
#

you like chemical compounds? name every chemical compound

true cosmos
#

gotem

#
#!/bin/bash
cd chems && ls *
flat lark
#
    public Prompt createIntConversation(String question) {
        return new StringPrompt() {
            @Override
            public String getPromptText(ConversationContext context) {
                return question;
            }

            @Override
            public Prompt acceptInput(ConversationContext context, String input) {
                
            }
        };
    }
sly topaz
#

sounds a lot like the Bukkit conversation API

#

too bad that doesn't work anymore

flat lark
#

Yes it is

#

IT DOESNT

#

Well dam.

young knoll
#

Since when?

flat lark
#

I'm using a GUI libary its just a lot of passing classes back and fourth and its a lot more work rather just asking for a simple int or input.

sly topaz
young knoll
#

I swear I’ve used it post 1.19

sly topaz
#

or that's what I've heard to be fair, I haven't actually tested whether it actually works or not, maybe it just implodes under certain conditions

young knoll
#

Idk maybe I just made my own

#

Pretty easy to do

sly topaz
#

yeah, not particularly hard to be honest, it is one of these novel APIs from Bukkit which just didn't receive much love with the time

sly topaz
#

most GUI libraries expect you to make an immutable GUI, so once it goes out of that then you're shit out of luck

#

if you want just text input, anvil GUIs usually are fine

young knoll
#

Or just wait for 1.21.6

#

Any day now

sly topaz
#

would also have to wait for spigot release

#

Sign GUIs too but they're kinda annoying in that they have to be within range of the player otherwise the sign GUI doesn't show

flat lark
young knoll
#

Don’t quote me on that when it isn’t though

flat lark
sly topaz
#

I mean, just listen to the chat event

young knoll
#

^

sly topaz
#

then build up your abstractions as you see fit

young knoll
#

I basically just use a map

#

UUID -> Conversation instance or whatever you want

sly topaz
#

the issue with using chat for input is that it breaks the chat chain so ideally you'd use commands but welp

young knoll
#

Chat chain?

paper viper
#

Oh yeah that…

#

Sends an error

sly topaz
#

it is a thing internally, whenever you report a message it sends the whole chat chain

young knoll
#

Ah

sly topaz
#

then again, I think that stuff doesn't work quite well on spigot? Or so I've heard so it is more or less a non-issue, for better or worse

young knoll
#

Idk I’ve never seen any issues in my test server

#

I don’t even know if anything is signed

sly topaz
#

you could indeed

flat lark
#

to trigger it

sly topaz
#

/reply whatever you may desire

flat lark
#

When they click on the GUI item it uses /triggerinput Int then have it use a timer to receieve an int input

sly topaz
#

usually going from GUI to chat is quite unergonomic

#

choose one or the other

#

what is it that you're actually trying to do anyway, we're discussing the solution without knowing the problem

#

what is that you have to input

flat lark
#

Stuff like name, interger related information, etc. I only need and input and int as the anvil gui for this library is not made very well and the creator documentation is a big vague on how to use it

sly topaz
#

couldn't you just use Spigot's API for the anvil gui

#

nowadays it just works with MenuType API I believe

thorn isle
#

i don't recall having issues with the conversation api, though i'm on paper and in offline mode

paper viper
#

You probably shouldn’t use the conversation API either way

thorn isle
#

is there something wrong with it?

sly topaz
#

I remember helping people having issues with it, however I don't remember what the issue actually was so it might just have been people using it wrong or whatever

#

it's been a while since anyone has asked anything about it

sly topaz
sly topaz
#

i.e. you can't really parse components with it and the like

#

but for basic stuff it is fine

thorn isle
#

it is a bit awkward to use but it's still marginally better than listening to the chat event or something manually

#

can the client even send components in chat?

#

i thought it was a plaintext string in the protocol

sly topaz
#

they can't send components directly, but usually people allow that by parsing format

thorn isle
#

i can just toss it into the minimessage parser or whatever if i need to, i think i already do that for player-placeable holograms

#

or no i think i use books for those

sly topaz
#

the one way they're allowed to send components is via tellraw but that is just awful for users lol

thorn isle
#

mmmm

fluid goblet
#

seems like set group works

fluid goblet
mortal hare
#

im thinking rn. aren't plugin config files with sensitive database credentials are kind of security hazard?

#

sure you can say nobody will reach plugins directory and steal that info

#

but you're storing passwords and other connection details in plain sight, hoping that some plugin exploit wouldnt allow you to read specific text files

#

one exploit to the plugins folder and bam your server data is completely leaked

thorn isle
#

filesystem access isn't any less difficult to get than e.g. being able to get the environment variables/system properties

#

you could maybe serve credentials from a microservice or something but all that really adds is security by obscurity

sly topaz
echo basalt
#

if you can access the plugins folder you pretty much have an RCE waiting to happen

mortal hare
echo basalt
#

ppl can upload a plugin and load it

#

then access the credentials in memory

#

or make a heapdump and upload to some server for later analysis

thorn isle
#

i guess you could set up a tunnel or a virtual private network in addition to the database credentials, and/or set up the firewall on the machine running the database so that only the minecraft server/plugin can connect to it

#

making the credentials useless

#

but yeah, by the time you get someone with filesystem access you are already fucked

echo basalt
#

even if you use environment variables nothing's stopping someone from loading maliious code and reading those

#

there's legit nothing you can do if someone acesses your file system

thorn isle
#

to be fair there is a difference between read and write access

#

read access could be much easier to get through some exploit in a plugin

sly topaz
#

I mean, just serve credentials through ephemeral methods then encrypt it like any authentication service would do

thorn isle
#

but my gut tells me it'd be just as easy to get read access to system properties

sly topaz
#

Ephemeral methods as in commands or console input if you can manage to do that in spigot console

echo basalt
#

only alternative is to run everything in memory straight off a image and dispose the VM after execution

#

still vulnerable to heapdump analysis

sly topaz
#

Heapdump analysis would be useless since it’d be encrypted

echo basalt
#

ppl are gonna reverse the encryption at some point

thorn isle
#

i mean ideally the credentials aren't the only line of defence to the database; you'd have a private network, or have it on the same physical machine with all ports closed, and a firewall

sly topaz
echo basalt
#

smh

#

just do the AWS approach

thorn isle
#

muh quantum computers

sly topaz
#

Otherwise we’d be all fucked with all the database leaks that have happened over the years

echo basalt
#

crazy ass firewall and user management system

sly topaz
#

I believe following the standards web sets for auth is good enough

echo basalt
#

even if you have S3 creds you'll likely get blocked because it isn't coming from a specific IP

#

or domain or whatever app

sly topaz
#

Makes me wonder if one could make something like Clerk or Auth0 work with Minecraft plugins

#

Without having to interface it through some bs middleware REST API or something along these lines

#

Though I guess all these services offer is in fact just a glorified REST API with their SDKs so no way around that

mortal hare
flat lark
#

Is there a way to do an instant callback with a method?

sly topaz
#

what does that mean

#

callback into what

mortal hare
#

maybe he wants CompletableFuture which is completed instantly

sly topaz
#

a completablefuture is completed instantly if you do it in the same thread

#

though at that point you just want a Consumer

mortal hare
#

CompletableFuture#completedFuture(U value)

#

sometimes you need glue code for async calls

sly topaz
#

fair enough

flat lark
sly topaz
#

I was extremely confused by your naming convention by the way

flat lark
#

Yeah, I was about to change it lol.

mortal hare
#

i bet he's c# dev lol 😄

flat lark
#

Lowercase methods drive me nuts

inner mulch
#

not really about minecraft, but what frameworks do modern java applications use for their ui?

mortal hare
#

D:

#

if i see pascal case i know its class/interface/record

#

in c# you have no idea

mortal hare
#

afaik Intellij uses Swing

#

JavaFX is kind of a bootleg react MVC but with OOP approach

sly topaz
#

@flat lark I feel like you're just recreating Brigadier

mortal hare
#

AWT -> Swing -> JavaFX. AWT is the most low level lib which Swing builds on top, and JavaFX build on swing on top

#

iirc

inner mulch
sly topaz
#

is there a reason you couldn't just use commands, I feel like you could wrap the conversation around commands so you could take advantage of brigadier validation

#

although you couldn't take advantage of the client-side auto-completion that way but alas

mortal hare
#

AWT is basically "return me native UI, pls" kind of low level lib in java, meanwhile swing exploits that lib to render its own controls to make it look in OS independent way

sly topaz
flat lark
sly topaz
#

not for the most part, anyway

#

it is supposed to be a replacement for Swing

mortal hare
sly topaz
#

there's some parts of it that has compatibility with Swing but that's about it

#

reason is that people were too used to Swing at the time so they had to provide some level of "backwards compatibility"

mortal hare
#

i guess you're right gpt tells me it wraps around AWT and not swing

#

nope

#

still wrong

#

found correct info on oracle site

sly topaz
#

@flat lark this is just a way to do it, so you don't necessarily have to do it this way but it keeps it simple enough:

public <T> void createConversation(
        Player player,
        String question,
        Function<String, T> parser,
        Consumer<T> action
    ) {
        UUID uuid = player.getUniqueId();

        if (awaitingInput.containsKey(uuid)) {
            awaitingInput.remove(uuid);
            player.sendMessage(ChatColor.RED + "You had an unfinished input, it has been cancelled.");
        }

        player.sendMessage(ChatColor.WHITE + question);

        awaitingInput.put(uuid, input -> {
            try {
                T value = parser.apply(input);
                action.accept(value);
            } catch (Exception e) {
                player.sendMessage(ChatColor.RED + "Invalid input. Please try again.");
            } finally {
                awaitingInput.remove(uuid);
            }
        });
    }

then you can do:

createConversation(
    player,
    "Enter a number:",
    Integer::parseInt,
    number -> {
        player.sendMessage("You entered: " + number);
    }
);
mortal hare
#

javafx has its own abstraction layer for OS controls called Glass

#

it doesnt use AWT for low level stuff

#

basically just shade javafx if you need to render stuff

sly topaz
#

java

mortal hare
#

java

flat lark
#

I was so confused by the :: making me seem to diff to me

mortal hare
#

its just static method reference

#

like passing function delegate through parameter in c#

sly topaz
#

method reference, stuff java 8 introduced to make the language a bit more functional

#

the other one is a lambda, but you probably already know that

flat lark
#

yeah

flat lark
sly topaz
#

weird, it should be able to infer there

mortal hare
#

just do (String input) -> {}

sly topaz
#

try replacing the input parameter with String input

#

yeah

flat lark
#

(uuid, String input -> {})

#

?

sly topaz
#

no, uuid, (String input) -> {})

#

probably doesn't need the parenthesis around the parameter but eh

#
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event) {
    var player = event.getPlayer();
    var uuid = player.getUniqueId();

    var callback = manager.getCallback(uuid);
    if (callback != null) {
        event.setCancelled(true);
        // Run on main thread
        Bukkit.getScheduler().runTask(plugin, () -> callback.accept(event.getMessage()));
    }
}

this is how you'd integrate it to the chat event, you'd have to make a getCallback method in the ConversationManager which is just a getter for the map

#

you may also want to add a parameter to that method for timeouts and what not

mortal hare
#

i wonder if there's any attempt to try to provide bukkit api support in minestom lol