#help-development

1 messages · Page 1279 of 1

sly topaz
#

I am not saying it isn't intimidating for a teen/young adult to sign a CLA, but I honestly don't believe that's the biggest struggle people have while contributing to Spigot

wet breach
#

and if they are allowed, at least in the US anyways, they can nullify a contract at anytime and the other party can't do anything about it

sly topaz
#

I doubt md accepts the CLA from anyone under 18

thorn isle
#

i will get a hobo off the street to sign the cla on my behalf

sly topaz
#

I am addicted to contributing, I NEED TO PLEASE LET ME

#

reminds me I should actually update my PR lol

mint nova
#

how i can reload configuration? I just make like fast command to test it. I changed value in config.yaml clicked ctril + s and do /reloadcmd but the value didnt change

    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {

        SMPSettings.getInstance().reloadConfig();

        return false;
    }
    public void reloadConfig() {
        save();
        SMPCore.getInstance().reloadConfig();
    }
rotund ravine
#

Where do you use the value?

lost matrix
mint nova
# lost matrix How did you check your value?

    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {

        Player player = (Player) commandSender;

        player.sendMessage(Colorize.toColor((String) SMPSettings.getInstance().get("test-text")));

        return false;
    }
mint nova
rotund ravine
#

Why are u saving and then trying to reload config anyway

lost matrix
#

Was thinking the same. But he has SMPSettings and SMPCore

rotund ravine
#

Ph

#

Oh

mint nova
rotund ravine
mint nova
#

i just save the changes and then reload

lost matrix
#

Show your SMPSettings class pls. Im guessing your arent creating a new FileConfiguration and still using the old one in memory.

mint nova
rotund ravine
#

?paste

undone axleBOT
mint nova
#

oh sr

rotund ravine
#

Yikws

#

Why are you handling most of that urself? U do know JavaPlugin handles most of that

mint nova
#

what?

lost matrix
#

Calling SMPCore.getInstance().reloadConfig() does nothing in this code.
You are using a YamlConfiguration that doesnt change unless you write some code that actually changes it.

rotund ravine
mint nova
rotund ravine
#

Fair

#

Well as smile said almost basically just run ur load() again to reload 🤷🏽‍♂️

mint nova
#

oh ok

lost matrix
#

Honestly, i think the entire SMPSettings class could be removed. Your JavaPlugin instance should do exactly the same.

rotund ravine
#

I’m guessing he’s using it for config.yaml and the core for config.yml idk why tho

mint nova
#

so like transport methods from SMPSettings to SMPCore right?

rotund ravine
#

They should already be there

rotund ravine
#

Ah

#

Well the core has getConfig and reloadConfig cause JavaPlugin

mint nova
#

i like the way to sepparate this config from main

lost matrix
mint nova
#

oh

rotund ravine
#

Just rename ur file to config.yml instead of config.yaml

#

then u can run saveDefaultConfig on enable

#

And otherwise just use getConfig / reloadConfig / saveConfig as u need

mint nova
#

ok

rotund ravine
pure dagger
#
public static boolean givePlayerItems(Player player, ItemStack... items) {
        Location location = player.getLocation();
        World world = player.getWorld();
        for (int i = 0; i<items.length; i++) {
            if (items[i] == null) {
                items[i] = new ItemStack(Material.AIR);
            }
        }

        Map<Integer, ItemStack> leftOvers = player.getInventory().addItem(items);
        for (Map.Entry<Integer, ItemStack> entry : leftOvers.entrySet()) {
            world.dropItemNaturally(location, entry.getValue());
        }
        return !leftOvers.isEmpty();
    }
#

better way to do it ?

#

maybe i should just iterate once and have a different leftOver Map for every itemstack?

#

so i dont have to iterate 2 times

sly topaz
#

iterating two times is fine

pure dagger
#

but look

#

i just finished

#
public static boolean givePlayerItems(Player player, ItemStack... items) {
        Location location = player.getLocation();
        World world = player.getWorld();
        boolean anyLeftOvers = false;
        for (ItemStack item : items) {
            if (item == null) continue;
            if (!player.getInventory().addItem(item).isEmpty()) {
                world.dropItemNaturally(location, item);
                anyLeftOvers = true;
            }
        }
        return anyLeftOvers;
    }
sly topaz
#

if anything, you could use nullability annotations so that the array never contains nulls

pure dagger
#

why isnt it better

pure dagger
pure dagger
sly topaz
pure dagger
#

ok, so the first version or should i change anything ?

sly topaz
#

the first version is fine

pure dagger
#

okay

sly topaz
#

though you might want to return leftOvers.isEmpty() without negating

pure dagger
#

oh

#

yea

#

😅

#

i didnt even use it

#

anyway

#

in the plugin

#

but yea

sly topaz
#

it's kinda pointless tbh

pure dagger
#

why

#

yeah maybe

#

but i like it

#

no its not pointles

sly topaz
#

I mean, you aren't removing the elements from the map so it's always going to be false

pure dagger
#

you might wanna tell player their inventory was full

sly topaz
#

ah, that makes sense, yeah

pure dagger
#

but the map will be empty if all items fit

sly topaz
#

I was thinking you were trying to check if all the items were dropped successfully

pure dagger
#

nope

#

thats

#

like

#

it always drops successfully??

sly topaz
#

hopefully lol

#

you might have to add another loop though nevermind

pure dagger
#

; )

#

should i create 1 Random instance for my class instance?

#

like in CommandExecutor class

#

or use 1 per plugin

#

i guess its not safe to create it often

paper viper
#

What’s the random for

pure dagger
#

uhm for generating random numbers

#

😨

paper viper
#

No but like

pure dagger
#

lets say its a flip a coin game

paper viper
#

What are you using the random number for

#

In this context

pure dagger
#

or some other prize-generating method

#

i think its safe to do it once at the onEnable, or in the constructors

#

i dont really know how exacly its unsafe to do it often

paper viper
#

Just keep a static singleton of it

#

And then invoke it when you need to use it

pure dagger
#

someone before said that using static might not be safe, but i still dont understand in which cases, do you know ?

paper viper
#

Static might not be safe what does that mean?

#

Like for random?

pure dagger
#

no, generally

#

for methods, fields

paper viper
#

No, there is noting wrong with static

#

It’s just people use it incorrectly

pure dagger
#

when

#

they use it incorrectly

paper viper
#

Example. Let’s say you have an arena and you make that static. It doesn’t make sense for it to be static because you could be making many arenas at once

#

Very general example

pure dagger
#

uhm

paper viper
#

Having static on a field is different from static on a method by the way

pure dagger
#

so just using static when it doesnt make sense?

#

no, they say using static is a beginner habit

paper viper
#

It’s really not

#

It’s just easier to slap static on something without fully understanding what you’re doing

pure dagger
#

oh they joking about it

#

but i use DI now

pure dagger
#

oh ohi

echo basalt
#
public static void give(Player player, ItemStack item) {
        PlayerInventory inv = player.getInventory();

        for (Map.Entry<Integer, ItemStack> entry : inv.addItem(item).entrySet()) {
            ItemStack copy = entry.getValue().clone();
            item.setAmount(entry.getKey());
            player.getWorld().dropItemNaturally(player.getLocation(), copy);
        }
    }
paper viper
pure dagger
#

oh hi*

echo basalt
#

you can just loop over it

#

dropping the entire stack when only part of it got consumed can cause dupes

weak wasp
#

There is nothing wrong with making a singleton like that, some people just like to whine about it

paper viper
#

It’s honestly debated for plugin instances

paper viper
#

I don’t think anyone will kill you for either

echo basalt
#

Avoid it if possible but it can make large projects cleaner in general

#

look this up and you have 2 explanations of static

#

mine's better imo

paper viper
pure dagger
#

what about the dupes

#

why does it happen

#

why NOT to do this

#

is it just cause its unnecesary ???

#

@echo basalt (idk if i can ping)

echo basalt
#

It's because you're abusing the concept of static

#

The idea is that the static keyword is used for constants that should never change

pure dagger
#

yepp okay

#

sooooo why dont i use it for my plugin instance ?

echo basalt
#

If you're using it everywhere it kinda breaks the point

pure dagger
#

i can pass it but its a lot of passing

echo basalt
#

You can use it for your plugin instance but it's a debatable topic

pure dagger
#

uhm

echo basalt
#

I personally avoid it for projects under ~15k lines of code because there just is no point

#

You can pass it with DI which is the more proper approach

pure dagger
#

uhm okay yeah

#

but my constructors look like this

weak wasp
#

If you have a one and only Circus, it should be set up that way, but you probably want to instance multiple Circus at once making it impossible

echo basalt
#

you know you can just pass your main class

#

and have getters on it

pure dagger
pure dagger
#

probably thats better

#

i was thinking about makin external class, but idk how i didnt think of this

#

lol

blazing ocean
echo basalt
#

DI framework

#

go fuck yourself

blazing ocean
#

no u

echo basalt
#

that's the solution

blazing ocean
#

koin is actually good

remote swallow
#

was literally about to say koin

echo basalt
#

crazy 80% of koin's sponsors are casinos

pure dagger
#

what even is that 😭 xd

remote swallow
#

omg @floral drum

#

gambling sponser kotlin di framework go support

umbral ridge
rotund ravine
#

App development for casinos

echo basalt
#

yeah but exclusively casinos?

rotund ravine
#

They got the money to spare i guess 😅

echo basalt
#

I feel like they're all using some lib / provider that forces them to sponsor koin

#

Like some high profile dev / company in the casino biz that has it in their TOS they gotta sponsor every FOSS project they use

blazing ocean
#

if so that's kinda ridiculous

remote swallow
#

CasinoCore

echo basalt
#

or a licensing term

young knoll
#

Oops! All gambling

echo basalt
#

@blazing ocean I might need some insights again

#

😔

#

We're tackling the problem with gui text rendering funky

blazing ocean
echo basalt
#

We took a look at it with a fresh set of eyes and individually counted pixels

#

the algorithm I stole calculated a length of 147 while the text was actually 151 pixels long

#

That's 4 pixels off, and we happen to also have 4 spaces in our text

#

This is the text

#

There are 26 characters, 4 spaces

young knoll
#

How big is a space

echo basalt
#

a space is 4 pixels wide

#

there is a pixel after every character

#

And our characters themselves are 109 pixels long

young knoll
#

Is that including the pixel after each character

echo basalt
#

no

#

Total length = 109 + 4*4 + 26

#

Which is 151

#

But rad's funny little algorithm only counted 147 and I dunno why

young knoll
#

Wait why does the size matter

echo basalt
#

If I take all the spaces out of the equation it works out fine

young knoll
#

Isn’t this item lore

echo basalt
#

No

#

It's being rendered in the side of a GUI with ~20 fonts

young knoll
#

Ah

echo basalt
#

Now, this doesn't happen when the color is always the same

#

I'm thinking that changing the colors adds a child component or something

thorn isle
#

isn't there an utility under java graphics that calculates the width of a string from a font face

echo basalt
#

fonts are from a bitmap and I know the length of every character

young knoll
#

I’m pretty sure each colour does add a child component yeah

echo basalt
#

we did a separate test where we rendered every character and make sure it all aligned

young knoll
#

Does that add another pixel?

echo basalt
#

I don't think it adds another pixel

#

I think rad's algorithm is off

young knoll
#

Ah

#

Let’s shame him

#

If it only happens with colours though how could the algorithm be the issue

echo basalt
#

Because it's his algorithm

young knoll
#

Does the algorithm even look at colours though

#

Those aren’t part of the text

echo basalt
#

No but it looks through component children

#

This still isn't breaking

#

hm

#

lemme do the math as if I was the algo

young knoll
#

Ah it calculates the size with the component

#

Not raw text

echo basalt
#

Hm

#

Adding all the numbers together does give me 147

#

so the algorithm sums them fine

#

Why would doing the math separately not result in the same

#

It actually calculates 151 fine I just forgot about the space at the start

#

unless rad's algo is also forgetting

blazing ocean
echo basalt
#

yeah I don't get it

#

It gets the right alignment my command's just fucked smh

remote swallow
#

the funny little german man made a funny little pixel calc algorithm?

echo basalt
mint nova
#

i was touching some grass

#

but in the command i dont need to do reloadConfig() but just load()

echo basalt
#

genuinely confused

mint nova
#

and it works perfectly fine

echo basalt
#

Could this be related to a font change?

young knoll
#

Rad? More like radle

echo basalt
#

Could it also be that I have an empty text component that's just a color

#

unless I don't

#

watch me have to account for the pixel between my shifts

#

Removing the space at the beginning of every line fixes it

#

😭 what the actual fuck

#

So <gray> <color:#aabbcc>Whatever</color> breaks it

#

but <shift:4><color:#aabbcc>Whatever</color> works

#

crazy shit

#

@blazing ocean is this on your end or do I blame mojang

orchid gazelle
#

bro's boutta get in trouble

echo basalt
#

I charged my boys like 100$ to figure this out they're not too happy

#

genuinely took 4-5 hours

echo basalt
#

@remote swallow you're fired

#

there's no way to make text transparent right?

#

maybe w a font even then I'm not making 20 fonts for each shade

remote swallow
#

no

#

blame it on the little german man

echo basalt
#

@blazing ocean I blame the femboy

wise mesa
#

Is there a way to change how long it takes for minecarts to accelerate to full speed?

blazing ocean
young knoll
#

Don’t be mean to femboy

echo basalt
#

Is that friendly advice or as a threat from a chat mod?

young knoll
#

Yes

blazing ocean
mortal vortex
blazing ocean
#

peak AI hallucinations

mortal vortex
#

you know the numbers on the scoreboard? you could disable it using shaders, i swear using protocol lib I had disabled it once.

#

but lowkey ,cant rmemeber how

young knoll
#

You can disable them without shaders now

blazing ocean
#

probably by setting the number format

young knoll
#

Mhm

chilly swallow
#

i'm trying to make it possible to open chests without the animation- I've tried using Lidded#close() on an interact event but that didn't work, I also added a slight tick delay, that also didn't work.
Is it something to do with the order of events, perhaps the block doesn't update when the interact event is fired?

thorn isle
#

try cancelling the interact/open event and opening the inventory manually

chilly swallow
#

yeah i thought about that but i want to keep the live updating nature of opening chests naturally

thorn isle
#

that should still work, unless you are opening an inventory snapshot or something

chilly swallow
thorn isle
#

actually on spigot i'm not sure if you can even get a non-snapshot inventory

#

on paper you pass false for Block::getState to get a live view of the state rather than a snapshot

chrome beacon
#

Yeah I made the mistake of thinking that before

#

Calling getInventory on the block state returns the live inventory

#

Even if the state is copied

young knoll
#

There’s a getSnapshotInventory

chrome beacon
#

Yeah

chilly swallow
#

So if I would like the live inventory I would obtain it from the block state ?

young knoll
#

Yes

chilly swallow
#

Perfect, thanks guys I will give it a try in the morning

winter jungle
#

I want to save the inventory of a player in the database, and I want to serialize the inventory. What is the best way to take the item stacks with each attribute, i.e. Durability, Name, Lore, Enchantments, etc.?

eternal night
#

on spigot, the BukkitObjectOuputStream and Base64

#

|| on paper, ItemStack has some to byte[] methods for ItemStack and ItemStack[] ||

winter jungle
#

Which of the two do you recommend?

rotund ravine
#

Depends on what u want to code for

#

If for both use the spigot things

winter jungle
#

Alright, thank you!

dawn flower
#

easiest way to make a duels system without accidently wiping a player or giving them items?
dueling a player teleports them to another world and gives them a kit
after the duel is done your kit is gone and whatever you had you get back

but there are many edge cases like server crashing, player leaving, somehow i cant retrieve their items back

young knoll
#

Restore inventory when player leaves

#

Restore inventory on shutdown

#

Restore inventory on startup

#

Obviously you’d need to track what players need inventory restored

#

I guess having one saved in the database is one way to determine that

dawn flower
#

what if the server crashes

young knoll
#

That’s why you restore it on startup

dawn flower
#

k

young knoll
#

If a database write fails you obviously don’t clear their inventory

#

The only real issue would be if reading the saved inventory fails

fluid goblet
cunning mountain
silver apex
#

also note:
You can hover over that red in your IDE and it'll tell you the issue

fluid goblet
#

to fix the code that i had originally

fluid goblet
sly topaz
#

I mean, you do whatever makes it easier for you

fluid goblet
#

yea ig

cunning mountain
fluid goblet
#

nah just the fixed parts

proper cobalt
#

hello guys

Im making a crates plugin

and lets say i have custom items with pdc i want to put in the crate

how can i store these in like a crate.yml

like rewards

rewards:
  item:
    type: golden_apple
    amount: 1
  item-2:
    type: special item with pdc here
    amount: 1

like how does it work so they can keep their pdc etc

cunning mountain
# proper cobalt hello guys Im making a crates plugin and lets say i have custom items with pdc...

you can’t store custom items with PDC in plain YAML like that, it won’t keep the data.
you gotta serialize the whole item (with meta + PDC) into a Base64 string and store that in the config.

when the crate opens, you just deserialize it back into an ItemStack and give it to the player.

you can write a small util for that or use existing libs, just make sure you’re not trying to write the item directly as type: diamond_sword if it has custom data.

proper cobalt
#

kk ty

sly topaz
proper cobalt
#

its fine ill just do the whole stack and have it a ingame editor

sly topaz
#

if you're going to store items regardless, make sure to store them with the data version

proper cobalt
#

how so

sly topaz
#

otherwise they're gonna break on updates

proper cobalt
#

oh its fine only targetting 1 version

#

also anyone know the equivalent of PDC in 1.7.10

sly topaz
#

you'd just use raw nbt

#

PDC is just a wrapper around NBT after all

proper cobalt
#

ah alright

#

thx

sly topaz
#

if you're lucky, whatever fork is still maintaing that version will have ported over the PDC API

proper cobalt
#

na im on craftbukkit

sly topaz
#

why not spigot

proper cobalt
#

wanna support any 1.7 software

paper viper
#

bro dont use craftbukkit 💀

proper cobalt
#

also couldnt find a download

proper cobalt
sly topaz
#

there's also nPaper which is the 1.7.10 paper fork

proper cobalt
#

is that hardforked

sly topaz
#

(even though paper didn't exist in 1.7.10, I assume they just ported patches over) apparently it did, the more you know

rotund ravine
proper cobalt
#

someone might

#

idm its just the api

paper viper
#

no one uses 1.7 for plugins to begin with

sly topaz
#

I just know it exists

proper cobalt
sly topaz
proper cobalt
#

nice

sly topaz
#

it's still actively maintained, surprisingly enough

proper cobalt
#

damn thats perfect actually

#

think ima just switch to that

#

u reckon it has PDC

#

na it doesnt all good tho

sly topaz
#

doesn't look like it

#

but you could make an issue request about it

#

PDC isn't that hard of a patch to port over

proper cobalt
#

sure why not

#

ive never made an issue so idk what to write really lol

sly topaz
#

well, just ask them if it'd be possible for them to port over the PersistentDataContainer API, at least for items

proper cobalt
#

kk done ty

#

its the protocolhack version aswell

#

thats great

sly topaz
#

ah, that one with 1.7.10-1.8 support

#

I forgot that was a thing

#

most people just moved over to ProtocolSupport when it became an option since nobody wanted to maintain the protocol hack directly on the server platform

proper cobalt
#

feel like its better on the server

sly topaz
#

everything is better on the server, since you don't have to inject code or deal with reflection, you just modify the server directly and that's less of an overhead

#

it is just harder to maintain as new versions come, however that isn't an issue for anyone staying on older versions anyway

proper cobalt
#

yeah im kinda surprised theyre supporting it thats great tho

#

they replied to the issue

sly topaz
#

that was fast

sly topaz
#

it redirects to issue search for some reason

proper cobalt
#

thx fixed it

#

he said use NBT tags

#

now what lol

#

whats a good counter argument

#

i need ur help here @sly topaz 😭

sly topaz
proper cobalt
#

yesss thank u

#

W reply

sly topaz
proper cobalt
#

how is it tho lol

#

PDC is just so much better

proper cobalt
#

nah im surprised he didndt veen know what PDC is

#

maybe if he tried it he would change his mind

left axle
#

Can anyone develop me minecraft plugin for free

sly topaz
marble tundra
sly topaz
#

if you want to add things to your portofolio then just make public plugins lol

chilly swallow
#

I'm trying to silently open chests (open the inventory, no container animation), yesterday I asked here they suggested to open the block's inventory from the block's state.

I tried that this morning, and it actually just triggers the animation when I open the inventory

proper cobalt
#

whats a good command framework/api for 1.7.10

nova notch
#

1.7 in 2025 is wild shit

smoky anchor
#

?howoldis 1.7.10

#

?howold 1.7.10

undone axleBOT
smoky anchor
sly topaz
#

without it, it is pretty much pointless

smoky anchor
#

They're on 1.7.10
The best that can do is maybe tab complete
You don't need client anything for that, brigadier is enough on the server

sly topaz
#

if that's all they need then brigadier is plain overkill for it

smoky anchor
#

Ye, as I said, it's silly :D

sly topaz
#

commands weren't all that complex back then

#

you could probably fork ACF and fix the errors that come up

pseudo hazel
#

or a switch statement

clever zephyr
thorn isle
#

although come to think of it, switch statements were quite a bit more bothersome back in java 8

#

sucks to write for a version that sucks basically

pseudo hazel
#

yeah well, still better than using a bloated api

sly topaz
lean pumice
#

some of u know invui?

sly topaz
#

?ask

undone axleBOT
#

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

lean pumice
#

u know how to register a gui bottom gui listener (of the player) when a Gui of InvUI is open? there is outside click event but it is outside all the gui that the player see

sly topaz
#

do you want a button on the player's inventory?

#

InvUI seems to support the concept of merged and split windows which makes you able to use the player inventory as part of the window so, it'd just be matter of setting up one of those and then adding an item to it

lean pumice
sly topaz
sly topaz
#

what I would do is just take the player's inventory contents and make ControlItem out of them so that you can use them as content of a Gui, and set the gui of the item in its handleClick behavior accordingly, from that then use Window#split to handle both Guis, the top one and the "player"'s one. Then just add a close handler which takes the changes made to the fake player gui and applies it to the player's inventory accordingly

#

another way I could see of doing it is creating a ReferencingInventory out of the player's inventory, then iterate from 0 to Inventory#getSize and create InventorySlotElements out of the slots, which then you can use to create a Gui which should reflect any changes to it to the player's inventory, if all you want is for them to be able to drop items on your upper Gui

#

though I guess it wouldn't work since creating a split window won't allow clicking and dragging events to happen

#

I am surprised they don't have more utilities for GUIs which interact with the player's inventory tbh

lean pumice
lean pumice
sly topaz
#

that does mean that in the case of a crash, a player could lose their inventory if they have a split/merged Gui open

#

but then again, if your server is crashing you have bigger issues lol

smoky anchor
#

let me whereami you

#

:(

pure dagger
#
public class BlackWandCooldownManager {

    private final Map<UUID, Long> players;
    private final long COOLDOWN;

    public BlackWandCooldownManager(long cooldownMS) {
        this.players = new HashMap<>();
        this.COOLDOWN = cooldownMS;
    }

    public void setCooldown(Player player) {
        players.put(player.getUniqueId(), System.currentTimeMillis() + COOLDOWN);
    }

    public void removeCooldown(Player player) {
        players.remove(player.getUniqueId());
    }

    public long getRemainingMS(Player player) {
        long expiration = players.get(player.getUniqueId());
        long remaining = expiration-System.currentTimeMillis();
        if (remaining <= 0) {
            players.remove(player.getUniqueId());
            return 0;
        }
        return remaining;
    }
    
    public boolean hasCooldown(Player player) {
        return getRemainingMS(player) > 0;
    }

}
```how to call this class
#

Manager ???

pure dagger
#

name of the class

#

its called BlackWandCooldownManager

quaint mantle
#

new BlackBlahBlah();

pure dagger
#

: (

#

should i call this BlackWandCooldownManagerUtilsProviderHandler

quaint mantle
dapper ocean
#

Does anyone have any idea on how to keep track of player's armor changes? There should be an easy solution, right 😅? I've googled a little and didn't find a solution that works for me. The closest I got was by using this repo: https://github.com/Unp1xelt/ArmorChangeEvent. But it fails to notify me of the hotswapped armor pieces as well as the ones I shift click inside my inventory. Any tips or should I create it from scratch by myself?

thorn isle
#

paper has an event for it, though i think it's implemented by trivially comparing each armor slot against the item that was known to be in it the previous tick, every tick

worthy yarrow
#

You could add the checks for all click types to the change event/rewrite it yourself

remote swallow
#

alex also forked it

worthy yarrow
#

Oh then use his

thorn isle
#

apart from inventory click types there's also other ways to change your armor, like right clicking with the item in your hand or having a dispenser dispense it on you

worthy yarrow
#

Does the dispenser actually equip it though? I thought it just pops into your inventory like regular

dapper ocean
#

Well the plugin claimed to fix all this:

The events handle when a player

    Equip or unequip item in opened inventory through
        Click
        Double click (collect to cursor)
        Shift-click
        Drop item (Q)
        Hotswap with hotbar(1-9) or with second hand(F)
        Dragged item
    Equip item through hotbar right-click
    Equip item by Dispenser
    Unequip when Player dies
    Unequip when armor item breaks
#

But it might have broke with updates tho, since it's not maintained for 2 years.

dapper ocean
pure dagger
#

can i make an entity completely unkillable

#

?

#

invulnerable means its only damageable from players on creative mode

worthy yarrow
#

@remote swallow you have it by chance? I cannot find it

remote swallow
worthy yarrow
#

Idk why it's not popping up in his repos for me lol

remote swallow
#

were you searching his account or jeff media org

worthy yarrow
#

His account

remote swallow
#

oh weird

worthy yarrow
#

honestly it's probably my internet

#

Got like 1mbs rn :/

remote swallow
#

dam

manic delta
dapper ocean
#

Managed to work it out, thanks @worthy yarrow & @remote swallow for the help !

pure dagger
#

cant you remove items from map while iterating through entrySet?

paper viper
pure dagger
#

hash

paper viper
#

then yes, but are you using Iterator?

pure dagger
#

no

paper viper
#

you can't write a for loop

#

and then remove

pure dagger
#

but i thought its a EntrySet

#

so its not iterating throguht the map

#

but

paper viper
#

doesnt matter

pure dagger
#

oh

#

you cant even iterate tjhrough map

wet breach
#

o.O

paper viper
#

what

#

You use an iterator from the entrySet

pure dagger
#

what if class has a method returning a collection, and a method for deleting an item? how do i iterate and remove items?
it would look like this

for (Item item : Clazz.getCollection) {
  Clazz.removeItem(item);   
}
paper viper
#

can't you just do .clear()?

pure dagger
#

like i cant use iterator cause im callin the method to remove

paper viper
#

in that case

pure dagger
#

clear what

#

i could do a copy and iterate throuht it

paper viper
#

In this example you listed, (which won't work), it appears you are trying to remove all objects from the collection

#

which is effectively the same as the clear method

pure dagger
#

yeah doesnt matter, i wanted to explain it

#

lets say there is some condition

#

and you dont just remove it directly from the collection, you remove it throuh the method in Clazz

wet breach
pure dagger
#

so not
Clazz.getCollection().remove()
but
Clazz.removeItem()

paper viper
#

You don't even need that

#

Just use removeIf

paper viper
pure dagger
#

you dont understand ;c

#

i guess thats ... uhm

#

dumb

paper viper
#

could you give me a code snippet?

pure dagger
#

i dont think so

wet breach
pure dagger
#

yes ;-; thanks that was so simple to say

paper viper
#

Oh I see

pure dagger
#

sorry for

#

not saying that

wet breach
#

its fine

#

some of us have memory loss and know how it is when you can't express what you want to say in words because your brain is like nope not cooperating right now

pure dagger
#

so what would i do

#

if i didnt have the direct acccess

paper viper
#

It depends on whats inside Clazz.removeItem

pure dagger
#

why

#

its just something + removin the item from collection

paper viper
#

But i'm confused, can't you just use Clazz.getCollection.iterator()?

#

and then use the remove function from iterator?

pure dagger
#

yeah lets say i cant

#

cause there is more logic

#

in the method

paper viper
#

I see

#

In the method then, you would have to use the iterator

pure dagger
#

oh

#

how

pseudo hazel
#

idk

#

do you have code?

paper viper
#

Take a look at the Java iterators

pure dagger
#

;c not really , im just trying to write it ..

paper viper
#

You use it from Collection

pure dagger
#

but

paper viper
#

then when you look at the current entry

pseudo hazel
#

show what you have so far

#

you must have access to the collection to remove something from it

paper viper
#
import java.util.ArrayList;
import java.util.Iterator;

public class Main {
  public static void main(String[] args) {
    ArrayList<Integer> numbers = new ArrayList<Integer>();
    numbers.add(12);
    numbers.add(8);
    numbers.add(2);
    numbers.add(23);
    Iterator<Integer> it = numbers.iterator();
    while(it.hasNext()) {
      Integer i = it.next();
      if(i < 10) {
        it.remove();
      }
    }
    System.out.println(numbers);
  }
}

example for removing integers less than 10

paper viper
pseudo hazel
#

so whats the issue there

paper viper
#

there's none, just explaining

pure dagger
# pseudo hazel so whats the issue there

the issue was that in 1 method im iterating, and callin method 2 which removes the item + does some logic, and i cant use iterator.remove cause i need to call the method

#

idk

paper viper
#

Why don't you separate the other "removeItem" logic to a new method

#

like for example, if you're original methopd is

pseudo hazel
#

call the method before you remove it?

paper viper
#

Yeah exactly

#

That way you don't have to double loop

urban cloak
paper viper
pure dagger
#

hah

urban cloak
#

i dont care tho

pure dagger
#

yeha im sleepy

paper viper
#

That wouldn't work at all

pure dagger
#

ill look at this tomorrow i bet itll make more sensse

#

im she

#

oh

#

😅

#

i need to add my pronouns

#

wait does iterator edit the map ?

paper viper
pure dagger
#

like when i call Iterator.remove does it remove it instantly from the actual map

paper viper
#

Yes

pure dagger
pure dagger
# paper viper Yes

oh so i can just iterator.remove, then when i would call the 'custom remove method' it would remove nothing , so no exception

paper viper
#

Yes

pure dagger
#

but its like

#

unclean

paper viper
#

No like the custom remove method wont remove anything itself

#

but it handles any other custom thing you want to do with the removed thing

pure dagger
#

okhay

paper viper
#

So basically, you use the iterator to find the object to remove. Then you call the custom method on the object you are about to remove

#

And then you make the iterator remove it

pseudo hazel
#

iterator.get().cleanup();
iterator.remove()

#

or whatever the methods are called

pure dagger
#

okay i have another thing. i have like a set of black holes, and whenevera player gets close to it it should like suck it, i just iterated through every player and every black hole every like 5 ticks, and then added vectors and disabled gravity,also when player is not close to any black hole i gave them gravity back, but is it really inefficient ?

paper viper
#

That's fine

#

Not inefficient, it's the only way

pure dagger
#

so its better to do hole loop in player loop, than player looop in hole loop cause its easier to check if a player is close to any hole right?

pseudo hazel
#

that will depend on what your datastructure is like

#

but its micro optimization unless there are a billion black holes or players

pure dagger
#

oh..

pseudo hazel
#

it wont matter unless you break early from the inner loop

pure dagger
#

so even if its 2000 players, 200 black holes, and im checking every tick is it still not so unefficient?

pseudo hazel
#

well its 2000*200 iterations (unless you break early) regardless of which way you loop

pure dagger
#

yeah

#

but you said million so

#

whaattt

pseudo hazel
#

wdym

#

you said 2000 and 200

#

it depends on what you need to do to determine the velocity

#

in this case it would make sense to loop over every player, and get the commulative velocity that all the blackholes are putting onto the player

pure dagger
#

ohh

pseudo hazel
#

like the distance from a player and then you have some curve with fall off and whatever, and its like "how far is the player from every blackhole", and so how much force does every black hole puton the player, and then add those forces together and apply it to the player

#

this would make sense if player.setVelocity was very expensive

#

but it probably isnt

#

so then it goes back to it not mattering

pure dagger
#

uhmm

#

could i just put the velocity 2 times

#

like in 2 directions

pseudo hazel
#

essentially, with nested for loops, you want to minimize the calls to the most expensive functions

#

everything else order wise doesnt matter

pure dagger
#

wait so what should i do if there are 2 black holes nearby

#

apply 2 vectors or 1 sum vector

#

will that work ?

#

i think it would be the best to apply the closest anywayy

pseudo hazel
#

if you onyl want to aply the hole thats closest its a different thing

pure dagger
#

yeah i know

pseudo hazel
#

because then your first order of business is deciding how far each black hole is from the player

#

which would be harder to do

pure dagger
#

why is it harder

#

ok im going to sleep my brain doesnt work bye bye

thorn isle
#

throw an octree at it

#

totally necessary for sure

true cosmos
#

mm octals

young knoll
#

Mm trees

paper viper
#

rtree

#

spatial data structure

thorn isle
#

when i did something similar, spawner activation range, for my spawners plugin (which is a little different because my players do have billions of spawners) i grouped the spawners into buckets and then only looked for spawners to activate within any buckets that a player was within or adjacent to

#

faster than an octree and kind of easier to implement

young knoll
#

What’s the difference between a bucket and a tree

paper viper
#

this is a bucket

#

🪣

#

this is a tree

#

🌲

young knoll
#

This is a hammer

#

🔨

paper viper
#

💀

pure dagger
#

is bucket some

#

data structure

young knoll
#

Not that I know of

#

I mean hashmaps have buckets but I don’t think that’s what they meant

paper viper
#

bucket is more like just a concept

#

its not an actual data structure or anything

#

like think about many buckets on a farm

#

and then each bucket has their own water

#

instead of having just one huge barrel of water

young knoll
#

Yeah but what the heck does it mean in this context :p

thorn isle
#

essentially the difference between hashmap and treemap, with hashmap being a table of "buckets"

#

e.g. a chunk is a kind of a bucket

#

with an octree/treemap to get the value for a key, or in the case of the octree, the region encompassing the coordinates, you need to recursively traverse deeper into the tree structure in O(log n)

#

but with buckets you just perform some arithmetic on the coordinates and then query a hashmap with them in O(1)

young knoll
#

I believe @ivory sleet mentioned chunk coordinates weren’t the best for hashmap keys

buoyant viper
#

just store everything in one big array

#

what could go wrong

ivory sleet
#

for what are we talking?

thorn isle
#

depends on what you're doing

ivory sleet
buoyant viper
#

nah just one big array

#

nothing can go wrong

thorn isle
#

it's a fairly convenient type in that it can be represented with a long primitive

#

block used to be too but then mojang made worlds taller and we can't fit it in 64 bits any longer

ivory sleet
thorn isle
#

i don't even know what we're talking about now

ivory sleet
#

ye im lost as well x)

thorn isle
#

the original topic was searching for things near a given location

#

specifically black holes near a player

young knoll
#

You can still fit blocks in 64 bits iirc

buoyant viper
ivory sleet
#

i know wg uses pr trees

thorn isle
#

you can, if the server admin doesn't crank up the world height to 1000

#

i dislike worldguard's data structure because every query into it allocates memory

#

beyond that i have no opinion on it

buoyant viper
#

Humans had no reason to increase the block height

#

256 is more than enough...

young knoll
#

26 bits for X
12 bits for Y
26 bits for Z

thorn isle
#

suuure but someone can always increase it past 12 bits

young knoll
#

You can’t

ivory sleet
thorn isle
#

making it not allocate memory for reads will be a better data structure

buoyant viper
#

@/me4502 wg mentioned

young knoll
#

The max Y with custom height is 2032 and the min is -2032

#

That just fits into 12 bits

thorn isle
#

did they actually set a cap on it?

young knoll
#

Yes

thorn isle
#

i recall it being unbounded, is that new

young knoll
#

Don’t think so

thorn isle
#

maybe i just misremember

young knoll
#

Chunk sections are indexed with a byte, so you can only have 256 of them

ivory sleet
thorn isle
#

coincidental but convenient

#

though isn't the index added on top of a "lowest section index" which is an int

#

the functional height of the world is still 4096 blocks regardless but two worlds might occupy different height ranges such that you can't use the same bit mapping for both

#

granted that is pretty contrived

young knoll
#

All blocks still fall between -2048 and +2048

#

Actually it appears you can go to +- 65536 but anything past +-2048 won’t be saved

buoyant viper
#

loses my 65536 block high dirt tower

thorn isle
#

i don't see anything about bytes or structural limits in LevelChunk or similar

#

if the limits are related to saving i'll take your word for it, i'm not touching that shit

young knoll
#

I don’t see why anyone would have a world that contains un-saveable blocks unless they were making a hyper specific minigame

#

In which case they can deal with not being able to address them in 64 bits

thorn isle
#

yeah it's probably not a practical concern

young knoll
#

When do we get 96 bit integers

thorn isle
#

though by the same reasoning we could probably cut the x and z coordinates down to 20 bits as well, i think the game is already almost unbearable that far out because of all the floating point precision nonsense

young knoll
paper viper
#

theres 128bit integers

thorn isle
#

just vectorize your things and you can have 512 bit integers

buoyant viper
#

when do we get 128 bit integers

buoyant viper
paper viper
#

__int128

#

gcc supports it

buoyant viper
#

im going to find a reason to compute using BigInteger in my plugins

thorn isle
#

though i don't think avx implements actual 512 bit wide multiplication or other full-width operations

ivory sleet
#

does it not?

#

thought 512 was the max it goes

thorn isle
#

i mean that's the register width but i think the operations themselves operate on its contents as vector lanes up to 128 or 64 bits or something

#

the bigger the parameters get, the more transistors you need for e.g. multiplication

#

it's something like n^2

ivory sleet
#

I havent touched AVX explictly, but when I studied SIMDs it was sth about 512 being max, but thats fair

thorn isle
#

yeah you can have e.g. 8 lanes of 64 bits each

#

but doing multiply between two of those is going to treat the lane values as individual longs

#

to get back to the block long shit, what we really need isn't a 128 bit integer but value based classes so we can stop having to bit twiddle shit into primitives that aren't supposed to go into primitives

young knoll
ivory sleet
#

even you?

young knoll
#

You might need a lot of them

#

But sure you could shove someone’s DNA into primitives

buoyant viper
sly topaz
#

Around 42 minutes into the talk

buoyant viper
#

Nerds

young knoll
#

The human genome is about 3.1 billion base pairs, there are 4 possible pairs (A-T, T-A, C-G and G-C) so you can store them using 2 bits

2 bits * 3.1 billion pairs is 6.2 billion bits or 775 million bytes

So you can store the human genome in about 775mb

ivory sleet
#

what if we use qubits!!?

remote swallow
#

or whatever it was they started using

mortal hare
#

is marking method with throwing exception really that bad in java? i mean if im building a static factory method which does sql connection using jdbc i cant just expect to handle the errors by the static factory method itself, i feel that should be delegated to the factory class which returns an instance of generic database connection wrapper interface

young knoll
#

You could make that a lot smaller by removing useless pairs

#

And also compression

ivory sleet
mortal hare
#

SQLException specifically

remote swallow
ivory sleet
remote swallow
#

another thing says one gram of dna can store 215 petabytes

ivory sleet
#

usually you can formalize ur own exceptions tho like

#

DatabaseOperationException, DatabaseConnectException etc

#

and then wrap around etc

#

but i like throwing exceptions in java- obv errors as value is nice, but it works out fine w/o in Java

sly topaz
#

The way it is done in Java allows for both models to work

young knoll
#

Genius!

mortal hare
#

so its more of a utility method in this case

sly topaz
#

If you want the “errors as values” feel then you can add throws clause to every method so the caller has no choice but to handle it

remote swallow
sly topaz
#

If not, then you can choose to silently handle it inside of a try

remote swallow
ivory sleet
sly topaz
#

Of course, exceptions aren’t as cheap as actual error values but the concept is the same and the difference negligible for most programs

young knoll
#

twr -> catch SQLException -> crash the server

ivory sleet
#

errors as values has the advantage of that u can subtype an error type on some type which contracts a non error subtype

remote swallow
#

if you have 1 gram of dna you can store 277 419 355 copies of the human genome

ivory sleet
#

the good thing w exceptions is that u can enforce consumer to handle it, but control flow can become messy

sly topaz
#

Me asf making a try(Consumer<Optional<Throwable>>) 🤑

ivory sleet
buoyant viper
sly topaz
#

Tbf if value types were a thing, it’d be a non-issue for the most part

young knoll
#

We have try catch at home
try catch at home:

ivory sleet
paper viper
sly topaz
ivory sleet
#

Consumer is kinda not that functional at core

sly topaz
#

They change the name every 5 seconds

ivory sleet
#

lmao

#

idk

#

value something something

#

and then identity right?

#

or whatever they call it

sly topaz
#

Null-restricted types and value based objects iirc

mortal hare
#

basically im wondering to do something like this

public class PostgreSQLRepository implements Repository {
    ...


    public static PostgreSQLRepository connect(string hostname, int port, string database) throws SqlException {
      ...
    }
}

and factory method

public class RepositoryFactory {
  private final DatabaseConfiguration config;  

  @Nullable Repository get() {
    try {
      return PostgreSQLRepository.connect(config.hostname(), config.port(), config.database());
    } catch (SQLException exception) {
      logger.log(Level.ERROR, "Failed to connect to the database: " + exception.getMessage());
      return null;
    }
  }
}
#

that way repository factory would be the last layer to handle the exceptions and to log them

ivory sleet
#

I mean sure why not

#

and Repostory#connect throws generic Exception then?

mortal hare
#

no i forgot that's its a static factory method for each implementation

sly topaz
#

Not being able to connect to the database sounds like a fallible operation to me, I’d crash the program given retries don’t work out

#

Ig you just do that by checking whether Repository returned null

young knoll
#

I believe you are supposed to gracefully fail

ivory sleet
young knoll
#

But a good old putInt(0,0) is more fun

ivory sleet
#

but yea check null prob is fine

ancient lintel
#

I'm looking for a fix plugin for crystal PvP.
I want certain blocks to automatically regenerate when end crystals or respawn anchors explode.
Is there any plugin that can do this, or someone who can explain the logic behind how I could make it work?

sly topaz
sly topaz
mortal hare
#

i guess i can wrap exception to something like RepositoryInitializationException with message that was logged inside logger

#

and throw it

#

instead of returning null

ivory sleet
#

you mean that u can pass some sort of cause object along w the result if fail? (javier)

mortal hare
#

i hate errors

ivory sleet
#

i mean yea we all do

mortal hare
#

they always ass to debug

sly topaz
# ivory sleet how so?

Checking for null doesn’t make it immediately clear to the user or developer why it failed, meanwhile a named exception will contain relevant context information for the user and developer to debug the issue

sly topaz
#

Just returning null ignores the context, yeah

ivory sleet
#

ye then we're on the same page

mortal hare
#

what's that lib which has null safety that's standardised across different ides again

#

annotation library i forgot

ivory sleet
#

checkerqual

paper viper
#

oh boy

#

@SuppressWarning("all")

ivory sleet
#

whoever said lombok flushed_eyes

mortal hare
#

nah something else

ivory sleet
ancient lintel
#

won't anyone help?

mortal hare
#

its like very lightweight

#

couple annotations

paper viper
#

jspecify?

#

idk

mortal hare
#

thanks

#

i love that thing

ivory sleet
#

it must be jspecify they mean

paper viper
#

i still dont quite understand checker

mortal hare
#

im getting back to java after a while

paper viper
#

after using it for a while

mortal hare
#

i've been using .net for like half a year

sly topaz
#

NullAway?

paper viper
#

like the polynull stuff

sly topaz
#

Oh they already answered

ivory sleet
#

ye polynull is fkd tho

mortal hare
#

i still feel like java has better syntax than c#

paper viper
#

its so bad

mortal hare
#

c# is like kotlinized java

#

but worse

ivory sleet
#

lol

sly topaz
#

C# is enterprise kotlin

remote swallow
#

i just saw that java and was like what the fuck then realised the type is the start not the end

sly topaz
#

You have all the language features you want, but we still have BeanFactoryFactoryProvider

remote swallow
#

the kotlin has taken over

ivory sleet
#

holy shit, dont even get me started

paper viper
#

It's terrible

young knoll
#

Umm aktually

#

C# came before Kotlin

paper viper
#

do you use like some from all of them

ivory sleet
#

all modules from checkers or do u mean annot lib?

paper viper
#

annot lib

#

use some from checker

#

jetbrains

ivory sleet
#

oh I use checker + jspecify + jetbrains kek

paper viper
#

o lol

mortal hare
#

i just use jspecify, its more than enough for me

#

also standardized

paper viper
#
  @UnknownKeyFor
   @NonNull
   @Initialized
   private static final Logger LOGGER = LoggerFactory.getLogger(MCAV.class);
   @UnknownKeyFor
   @NonNull
   @Initialized
   private final EnumSet<Capability> capabilities = EnumSet.allOf(Capability.class);
   @UnknownKeyFor
   @NonNull
   @Initialized
   private final AtomicBoolean loaded = new AtomicBoolean(false);
#

💀

ivory sleet
#

i do like checkers framework

#

for like

#

invariant validation

#

"compile time"

ivory sleet
paper viper
#

after type system

#

decompiled

ivory sleet
#

I mean yea thats fair

young knoll
#

Why not use all the nullability annotations

#

Oh wait that’s just DeluxeAsyncJoinLeaveMessages

ivory sleet
#

runs

young knoll
#

Tbf there are probably more nullability annotations these days

#

Needs an update

mortal hare
#

dbeaver is such a gigachad software for databases

#

i love it it supports every goddamn sql database you might need

#

and its free

ivory sleet
mortal hare
#

i wonder if im developing a suite of plugins for a private server should i develop database in monolithic approach where many plugins might connnect to the same database and schema or is it better to make separate users with certain permissions for each plugin and do 1:1 relationships between tables instead

ivory sleet
#

PolyNull NonNull UnknownNullability NotNull NullMarked NullUnmarked MonotonicNonNull, EnsuresNonNull AssertsNonNullIf

#

@young knoll

#

like its crazy

paper viper
#

Gotta add them all

#

Make sure that the IDE knows

ivory sleet
#

fr :,)

#

and then there's the fucking initalization framework that nullness depends on

#

drowns

ancient lintel
#

I'm looking for a fix plugin for crystal PvP.
I want certain blocks to automatically regenerate when end crystals or respawn anchors explode.
Is there any plugin that can do this, or someone who can explain the logic behind how I could make it work?

paper viper
#

Bro

#

The @UnderInitialization

mortal hare
paper viper
#

That fucks me up so much

buoyant viper
paper viper
#

I don’t even understand the purpose of @UnderInitialization

#

I spend more time trying to fix the error than like make it work lol

dusty herald
#

i fucking hate NMS

ivory sleet
#

iirc has to do with like idiotic stuff like what can happen in a super constructor, or when u initialize two objects together, or if u by mistake publish an object before fully initalizing it (concurrency wise)

dusty herald
#

that's it

mortal hare
dusty herald
#

😭

paper viper
dusty herald
#

🤷‍♀️ I've never really messed with NMS before

ivory sleet
#

id say monolithic is fine in the domain of minecraft

dusty herald
#

I'm trying to update a plugin to use a more recent version of the API but the methods have changed

paper viper
#

Is it just random A’s and b’a

ivory sleet
#

for most part

dusty herald
remote swallow
#

no wonder you hate it

dusty herald
remote swallow
#

use mappings

paper viper
#

No wonder why it’s horrible lol

remote swallow
#

?nms

paper viper
#

It’s obfuscated

mortal hare
ivory sleet
#

yea well dovidas

#

startups tend to go with monolithic

paper viper
#

I remember using control F to try and find the method that’s obfuscated…

ivory sleet
#

or like a microservice w a very small set of services

#

but then as u grow and scale, u need to redesign it more and more to be less monolithic

#

for stuff like reliability, regionality and scalability etc

mortal hare
#

but different users provide more security

#

and you can revoke permissions for data that plugin shouldnt read

#

less attack surface

#

but who tf cares

ivory sleet
#

attack surface?

#

who is assaulting you

mortal hare
#

im talking about sql injection stuff

#

or other vulnerabilities

#

that might expose the db

ivory sleet
#

oh yea I mean sure if we talk strictly about authentication and authorization etc

#

or do u mean like cyber security?

#

but I dont think it matters whether u modularized ur monolithic architecture into a set of modules

#

from an attackers pov

#

not signficantly at least? (im not a cyber security expert but just assuming))

mortal hare
#

well it doesnt matter much since if attacker is already in the system you're already kinda done

#

but its just another obstacle

#

before complete pwnage

ivory sleet
#

lol ye i guess thats true

mortal hare
#

the main point is that if you did lots of 1:1 relationships you can separate what plugin reads and writes strictly within a database and if somehow one plugin has vulnerability that exposes db to the attacker, it cannot read anything besides plugin's data

#

since you can just revoke permissions to read particular tables from that user

dusty herald
mortal hare
#

something like unix users already do with packages by creating app specific users to read write only specific directories within system directories

#

for example on linux whenever you install postgresql, user named postgresql gets created on the system to give the permissions to read and write only specific parts of the system instead of giving it root access just for the sake of security

ivory sleet
#

yea

pastel nova
#

hello guys, i would need help w setting up bungeecord + luckperms

#

I cannot do commands such as /send in my hub (1 of 3 servers attached to the proxy)

#

if anyone can help me just reply/dm

fluid goblet
fluid goblet
#

nvm fixed it

cursive kite
#

I am trying to do true damage ignoring armor except my player is dying twice

        event.setDamage(0);```
cursive kite
#

I looked thru that

drifting halo
round basin
fathom dirge
#

If you don't know what hashing is. It's a way to map a value to a different value without the possiblity to do a reverse mapping: hash(x) = y, but unhash(y) = ???

#

So you can only check if the user's password is correct, but you can't check what the actual value is

#

What you could do tho is logging user commands to store their password in that way

#

With the PlayerCommandPreprocessEvent for example

round basin
#

@fathom dirge its out of my brain

mortal vortex
#

There is no valid reason... They forgot it? Reset it

round basin
fathom dirge
#

Thats not possible

round basin
#

He got password of people

#

In his server

fathom dirge
#

With the same plugin?

mortal vortex
#

What you're asking is probably not even genuine, you're probably looking to do something nefarious, and you wont get help for that here.

round basin