#help-development

1 messages · Page 674 of 1

echo basalt
#

welp time to multi-platformize my yml shit

quaint mantle
#

hey

#

so my friend is installed every build tool from the repo

#

is it normal each take a few minutes

echo basalt
#

yea

quaint mantle
#

oh okay

#

just asked so he dont do it all in vain

#

we are in the right path

#

thanks illusion

copper lake
#

@echo basalt ight so installed everything that it would let me (java versions yk)

echo basalt
#

You'll need all that's there

#

unless you're feeling like changing code

copper lake
#

i cant install more cuz im using java 17 not 8

echo basalt
#

Then switch to java 8 or whatever

#

or just nuke half the modules

copper lake
#

sure

#

ill get rid of everything below 1.17

#

i just delete the folder correct

young knoll
#

Inb4 they are all hard referenced in the code

echo basalt
#

it's barely referenced

#

just a huge if check

copper lake
#

ight i got rid of them

#

whats next

echo basalt
#

try to build it

copper lake
#

k

echo basalt
#

It'll toss errors but at least you'll know where

copper lake
#

same error

echo basalt
#

uhh no

#

I wonder if I can just pull and build

#

I think I already did this before wait

echo basalt
#

lmao I patched this plugin a few years ago

#

yeah it had a memory leak

copper lake
#

uh

#

so i cant do it or

echo basalt
#

you can

young knoll
#

Problem solved

echo basalt
#

yeah you're not doing it right

#

gradlew shadowjar

#

and whatever

#

wait it's 4am?

copper lake
#

wtf

#

i typed gradlew build

#

send me your build.gradle

echo basalt
#

it's exactly the same

#

I just pulled, cleaned and shadowjar'd

copper lake
#

tf man i keep gettin the same error

echo basalt
#

you're simply inferior ¯_(ツ)_/¯

young knoll
copper lake
echo basalt
copper lake
#

tysm

echo basalt
#

don't ever bother us again

copper lake
#

💀

echo basalt
#

and quit wasting 10 hours trying to build something

#

you'd earn more at mcdonalds

quaint mantle
#

just want to say huge thanks for everyone who helped us

echo basalt
#

oh god this is getting icky I just merged the profile system with the player stuff

#

this class has over 100 lines, it's too big

#

end result is clean though

topaz panther
#

Will it make diffirence if i use spigot api on PaperMC?

opal carbon
#

it generally shouldnt

topaz panther
#

thanks

drowsy helm
echo basalt
#

7.5k lines of database code

#

time to write a multi-platform command manager now

vapid grove
#

So ive been noticing this alot with my guis, but if I shit click on an item and press E or escape at just the right time, the canceel event doesnt work and the item gets added to my inventory. How do I fix this?

#

It happens with all my guis*

eternal oxide
#

cancel drag too

#

its not the keypresses, it's micro movements of the mouse

vapid grove
echo basalt
#

InventoryDragEvent

vapid grove
#

Gotcha, ill cancel them

vapid grove
#

Why would that be an issue in the first place

echo basalt
#

if you move your mouse 1px while grabbing an item it counts as a drag

vapid grove
#

Ah I see

#

Still seems to happen.

#

Infact, it seems that there is also a duplication glitch as well.
If a user places an item, and swaps it and immediately presses esc and e, the item gets duped.

#

Does creative mode or having op affect any of this

echo basalt
#

creative likes to mess with you

vapid grove
#

Yep, turns out the dude finding the issue was in creative.

vital yacht
vapid grove
#

When testing the dupe in survival, ceases to function.

wet breach
vapid grove
#

Only creative, which I had no idea had an affect on UIs

wet breach
#

Yes and there is some creative mode specific events too

vapid grove
#

Huh

wet breach
#

However even so you have to do more checks for creative due to how that works still

#

Ops has an effect if your checks are flawed and just let them do whatever lol

vapid grove
#

:/

echo basalt
#

creative mode is a shitshow

#

want perfect checks? run a task every tick

wet breach
#

Not usually an issue with ops because well they are op

vapid grove
#

Yeah

#

And nobody except ops in my server are actually

#

Supposed to have creative so

#

It shouldnt be a major issue

wet breach
#

Instead you should check for perms and not just op or treat op differently from normal perms because realistically people shouldnt just be opped lol

vapid grove
wet breach
#

Sure

#

I have a class you can use too

vapid grove
#

Oh awesome

echo basalt
#

oh yeah frosty

#

I ditched the player system for non-server platforms

#

and nuked the generic type

wet breach
#

You would have to still implement the whole making perms system this class just lets you check dynamic and static perms easily

echo basalt
#

I figured proxies shouldn't track player data individually because well.. that's a point of failure

wet breach
echo basalt
#

that's just a player.hasPermission

#

but yeah

wet breach
#

Well yes but no

echo basalt
#

now I'm working on actually converting all the spigot-specific code to be a lot more generic

wet breach
#

Haspermission doesnt let you check dynamic perms

echo basalt
#

so.. hasPermission with a concat string

wet breach
#

Replace

echo basalt
#

single responsibility principle isn't applied here I see

#

why tf is this mesage being sent on a permissions class

wet breach
echo basalt
#

Well I usually just have a boolean field on an abstract command class for that kind of stuff

wet breach
#

Well my command class for that peoject wasnt setup that way lmao

echo basalt
#

still need to convert to generic

wet breach
#

So instead of duplicating that check i moved it there instead lol

echo basalt
#

but that involves making an entire abstract command system

#

and I just can't bother tonight

wet breach
#

Lol

echo basalt
#

I love writing classes that have no code

vapid grove
#

Is it bad that ive been just looping thru packages using reflections to load stuff like commands and items events

echo basalt
#

yes

vapid grove
#

ah

vapid grove
echo basalt
#

11 abstract classes, 24 interfaces out of 119 classes

drowsy helm
#

if its only onenable its not that bad

echo basalt
#

still not a 50% abstract ratio

wet breach
#

It is possible to load a class via reflection without invoking the constructor and this would be bad lol

echo basalt
#

I always thought that Reflections project was black magic

#

but now that I'm no longer 100% an idiot I know that the only black magic out there is ASM

vapid grove
#

Heres my random issue with reflections

if(!cls.getName().contains("$2") && !cls.getName().contains("$1")) {

Half the time ill get duplicated classes with these at the end, and it messes with my stuff

#

And it confuses the hell outta me, had to add a check to only let regular ones in

#

Never been able to fix it

echo basalt
#

they're anonymous classes

wet breach
#

Those numbers refer to inlined classes

echo basalt
#

aka lambdas n shit

vapid grove
#

Ah

echo basalt
#

And discord just crashed for no reason istg

#

crashes every da

wet breach
#

Yeah my browser will sometimes do that. Crash the discord app all because javascript

echo basalt
#

crashes all the time when I'm playing apex

#

or writing a search index post

wet breach
#

Yeah probably because only one javascript engine can be used more so of they are the same but differing versions

echo basalt
#

a "fix" for it is turning off hardware acceleration

wet breach
#

Yep because of the issue i stated

echo basalt
#

but that fix is awful and causes crashes when doing other things

#

And I can't watch Undercover Boss™️ with my homie on call because it's a solid 2fps

wet breach
#

Lmao

slender elbow
topaz panther
#

what does the message on top of the Hotbar called?

#

nvm its dialogues

eternal oxide
#

ActionBar

dusty herald
#

Weird question, so I'm registering some ConfigurationSerialization classes, and was wondering if someone were to reload my plugin, would those classes stay registered? Or would I need to unregister them to prevent memory leaks?

public final class OfflineCommands extends JavaPlugin {

    static {
        ConfigurationSerialization.registerClass(UserStorage.class);
        ConfigurationSerialization.registerClass(CommandStorage.class);
        ConfigurationSerialization.registerClass(SoundStorage.class);
    }
// more code
echo basalt
#

Ugh I got no clue how static variables behave with classloaders

dusty herald
#

I've done some debugging and apparently they are

#

for now I'm going to unregister them onDisable, hopefully nothing will break 😏

#

people just shouldn't reload anyways lol

lilac dagger
dusty herald
#

Between restarts?

lilac dagger
#

you'd have to have something like ConfigurationSerialization.unregisterAll

#

or use proper objects

#

to store your serializations

ivory sleet
#

Doesnt plugin manager invoke that after all onDisable calls?

lilac dagger
#

sorry, i meant reload

dusty herald
#

🤷 This is what my onDisable looks like now lol



    @Override
    public void onDisable() {
        this.userConfigData = null;
        HandlerList.unregisterAll(this);
        Bukkit.getScheduler().cancelTasks(this);

        ConfigurationSerialization.unregisterClass(UserStorage.class);
        ConfigurationSerialization.unregisterClass(CommandStorage.class);
        ConfigurationSerialization.unregisterClass(SoundStorage.class);

    }```
ivory sleet
#

plugin manager deregisters ur listeners and cancels all ur scheduler tasks

#

so no need to call that

lilac dagger
#

i'd still suggest using a non static class system

ivory sleet
#

Unsure if plugin manager does that for serializables also

#

Its the bukkit api

dusty herald
#

Yeah I have to use statics or the bukkit api flips out

#

It would otherwise claim those files don't exist (sad)

ivory sleet
#

well u dont rly use static

#

Its the api that is designed that way dumb enough

lilac dagger
#

wait, is ConfigurationSerialization. a bukkit class?

ivory sleet
#

Yes

lilac dagger
#

oh wow

ivory sleet
#

It’s essentially an IdentityHashMap<Class<? extends ConfigurationSerializable>,ConfigurationSerializable>

ivory sleet
#

Lmao pls

dusty herald
#

why not

ivory sleet
#

You know what, it does deserve an update

dusty herald
#

oh my god the code is worse than i remembered

#

"//make all IDEs stfu
@SuppressWarnings("all")"

#

i never looked at the coude becasue my browser would die

#

it's

#

art.

lilac dagger
#

all least no warnings

dusty herald
#

honestly this deserves all the awrnings

#

make this a premium plugin omg

ivory sleet
#

Lmao

smoky anchor
dusty herald
#

as does it

sweet sonnet
#

folia support?

storm granite
storm granite
#

sometime i’ll show you the plug-in I made

sweet sonnet
#

my o3c has almost arrived

wet breach
lilac dagger
#

is there a reason why mojang has a random per living entity?

#

i mean using a single one should give the same randomness or am i wrong?

wet breach
#

O.o

eternal oxide
#

you use a random per object when you want a "random" but repeatable result

#

ie a world seed will always generate the same terrain, even though it's "random"

#

If multiple objects pull from a single random the result will be random but unrepeatable, unless you perfectly preserve the sequence

smoky anchor
#

which is what 1.20 is doing now I think?

quaint mantle
#

am i get ProxiedPlayer's ip adress ?

lilac dagger
#

oh i see

cunning osprey
#

why does this say?

that runtasklater cannot be applied to my main class as the whole plugin is in my main class

            } else if (this == LIGHTNING) {
                // Make thunderstorm by right clicking 
                player.getWorld().setStorm(true);
                player.getWorld().setThundering(true);
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        player.getWorld().setStorm(false);
                        player.getWorld().setThundering(false);
                    }
                **}.runTaskLater(this,  2400);**```
undone axleBOT
drowsy helm
cunning osprey
drowsy helm
#

show the whole class

#

looks like this inst refering to JavaPlugin

smoky anchor
#

Pass the plugins main class, not your Power class

drowsy helm
#

also is that a nested class

#

or just bad naming convention

smoky anchor
#

oh is that what you mean by "the whole plugin is in my main class "

clear panther
#

whats usage of setLastDamage();

#

i tried player.setLastDamage(646);

#

but it doesnt even work

robust helm
#

maybe 646D?

clear panther
#

i mean

#

its

#

int

#

player.setLastDamage(int)

#

nvm

#

and it didnt work ofc

robust helm
#

its double in the docs

clear panther
#

idk then

robust helm
#

Can u send code?

drowsy helm
#

are you sure you are setting it in the right timeframe

clear panther
#

player.setLastDamage(6354D);?

robust helm
#

with context

clear panther
drowsy helm
#

"Sets the damage dealt within the current no damage ticks time period."

clear panther
#
@EventHandler
    public void onDamagePlayer4(EntityDamageByEntityEvent e) {
        Entity attacker = e.getDamager();
        if (!(attacker instanceof Player player)) return;
        if (Objects.requireNonNull(player.getItemInHand().getItemMeta()).getDisplayName().equals(ChatColor.BLUE + "Emerald Katana")) {
            ItemStack emerald = new ItemStack((Material.EMERALD));
            if (player.getInventory().contains(emerald)) {
                player.sendMessage("a");
                player.setLastDamage(6354D);
            }
        }
    }
}```
drowsy helm
#

use the events method

clear panther
#

wha

#

i mean

#

ig it wont work

#

without

#

EntityDamageByEntityEvent

drowsy helm
#

and pls use pdc

clear panther
quaint mantle
# drowsy helm and pls use pdc

hi bro can u give me idea for connect minecraft account to discord account
i was think this ip minecraft member ip adress equals discord member ip
send connect request to discord member in dm is this good?

clear panther
#

i have no clue what are u trying to say

robust helm
#

hes just asking if its smart to compare ips to see if the discord account and mc account user is the same

tender shard
#

that's not smart

#

the usual way is to send a verification code (e.g. a 5 digit number) to either the discord user that they have to enter in minecraft, or vice versa

#

basically just like !verify works here

robust helm
#

Is there a feature in the essentialsDiscord api for that?

clear panther
#

i gotta say that u may link minecraft account to discord using bot with console stuff

#

but it doesnt look smart anyways

wet breach
#

You can use microsofts verification system

quaint mantle
wet breach
#

Microsoft has api end points to verify accounts

quaint mantle
#

will work in my server ?

wet breach
#

No. At that point not even sure why you are trying when you cant guarantee accounts

clear panther
#

^

robust helm
quaint mantle
#

forgot to say i have bot

tender shard
pseudo hazel
#

kindly ask them 😄

quaint mantle
#

i mean get ip address

#

yes can't

pseudo hazel
#

wait you have an offline server?

quaint mantle
#

yes send this

wet breach
#

At this point it is useless to continue with trying to resolve the issue because they only way you can do this is making people register an account. Doing this however is considered circumventing drm and thus puts you at high risk of being in mojangs and microsofts crossair

#

And since spigot doesnt support piracy nor myself you are at the mercy of no support.

pseudo hazel
#

yeah offline mode is not supported also due to the lack of things you can actually do without a proper account

#

like this kinda stuff

quaint mantle
#

md5 is support offline ?

wet breach
#

Md5 does not support offline mode

quaint mantle
#

he doesnt develop bungeecord ?

eternal oxide
#

bungee runs online

quaint mantle
#

why he did this ?

pseudo hazel
#

I have not heard of anyone supporting offline mode if tehy arent using it themselves xD

wet breach
#

Mojang is the one that put offline mode in their game to support organizations that are ran offline such as lan parties or families that want to run servers not connected to the internet

pseudo hazel
#

thats minecraft

quaint mantle
#

oh

#

so

#

md5 do offline

#

for this

pseudo hazel
#

offline mode was never intended to be used for illegitimate accounts

wet breach
#

Md5 does not remove vanilla features and does what he can to keep such things intact

pseudo hazel
#

its not called illegal mode for a reason

tranquil ferry
#

hey can we add like this on our plugin page

for other payment methods
- polymart 
- kofi shop
- bbb
wet breach
#

However that doesnt mean he supports such features either

tranquil ferry
wet breach
#

But that is something best to ask support however

#

?support

undone axleBOT
tranquil ferry
#

shd i mail?

quaint mantle
#

So what would you do if you were in my place?

example
customers likes melon ice cream but you insist that you will produce strawberry ice cream

#

You are right not to help with my questions for offline

pseudo hazel
#

wait for customers that want strawberry icecream

#

or jump on the melon train

quaint mantle
#

but it's stupid to judge me on other issues because of that

pseudo hazel
#

well its just that those issues heavily depend on you having an account

wet breach
wet breach
#

I already told you what would be required and told you the possible risk you run

quaint mantle
#

yes i know

#

ty

near mason
#

when i generate the terraing the server freezzes for 5-7 seconds is there a way to prevent the freeze?

undone axleBOT
wet breach
#

Other then that link better hardware or better hosting provider

smoky anchor
#

do it over several ticks

near mason
tender shard
quaint mantle
#

i ask chatgpt

pseudo hazel
#

chatgpt, the all-knowing

#

but in this case its right I guess

eternal oxide
#

you want to get the ProxyPlayers IP? get from his connection in bungee

pseudo hazel
#

he was talking about your discord ip

eternal oxide
#

ah ok, he was talkign about ProxyPlayer before so I assumed

grim oak
#

is there a way i can make a gui icons texture invisible

#

so the player can see the name and the lore when they hover over the slot but they just dont see the item

smoky anchor
#

yes, a resourcepack

grim oak
#

Are there any player head textures that show up as nothing?

smoky anchor
#

not that I know of, no

#

The closest to nothing you can get is light gray stained glass pane
or the other gray idk

grim oak
#

im using a custom gui so that wouldnt look right

#

ill just add something to the resource pack

smoky anchor
#

You probably know this but, you can use customModelData to not have to replace an item model

grim oak
#

yeah

#

yeah ill just add a texture. ty

harsh totem
#

How do I ban players forever?
It does not let me put null as the date of the ProfileBanList#addBan

#

my IDE is telling me to fix it by puting (Date) null in there. is that the right way to do it?

harsh totem
tender shard
#

why not? works fine

#

which error message do you get when trying to use null?

torn shuttle
#

@echo basalt I can smell your jealousy from here

#

if only you could write code like this

smoky anchor
#

3D-String-indexed object ?
Also, please new HashMap<>();

#

Your ide is crying about it

quaint mantle
#

bungeecord have schedulers ?

lilac dagger
#

they should

dense hollow
#

Yo everyone, quick question. I have a loop in my code, and when I run the metohod for calculate some data, server is freezing for some secounds. I was try use Taksers from okaeri and bukkit async but not help. Whats can by best solution for it?

lilac dagger
#

show us the code

#

i want to see your time complexity

undone axleBOT
dense hollow
#

From line 50 to 60

dense hollow
#

and the method with for loop is in findSafeRandomLocation

quaint mantle
#

i mean like this

smoky anchor
dense hollow
#

When the position is searching server is freezing(losing ticks)

outer river
#

Hello, simple question, is this;

public class Category {
    
    YamlConfiguration file;
    String name = file.getString("Name");
    Double multip = file.getDouble("Multiplier");
    String perm = file.getString("Permission");
    
    public Category(YamlConfiguration file) {
        this.file = file;
    }

better than this? :

public class Category {
    
    YamlConfiguration file;
    String name;
    Double multip;
    String perm;
    
    public Category(YamlConfiguration file) {
        this.file = file;
        this.name = file.getString("Name");
        this.multip = file.getDouble("Multiplier");
        this.perm = file.getString("Permission");
    }
smoky anchor
quaint mantle
#

u don't need get path ? for file

tender shard
outer river
quaint mantle
outer river
quaint mantle
#

ah aight

dense hollow
smoky anchor
#

Idk what that is but the scheduled tasks might not get cleared when the server reloads.
So bukkit scheduler is safer in this manner.

dense hollow
#

okey I will try bukkit scheduler

smoky anchor
#

Also, I think you can't load chunks async
(Or it is version dependant)

torn shuttle
#

ah yes

#

my treasure config file is ready to be filled in with treasure

real halo
#

my silkspawners plugin don't work, when i destroy spawner with silk touch pickaxe spawner just destory and i don't get any spawner item

torn shuttle
#

it does not have loot yet

#

it's already 2159 lines long

#

what a great config file

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

scenic valve
valid basin
#

does someone know how to stop players from turning off candles and enlightened blocks

tall dragon
#

by cancelling the interactevent upon those blocks

tender shard
#

you can also tell players that you're disappointed in them if they put out candles

#

"Listen, I am not angry, I'm just disappointed"

scenic valve
#

Or when they right click it, create an explosion, that'll make em scared

knotty shell
#

spawners are a restricted item?

tender shard
#

or play the creeper ignite sound

tender shard
scenic valve
knotty shell
#

like worldguard saying NO.

scenic valve
#

can't break you mean or what?

knotty shell
#

dont matter they prob left

teal kindle
#

How does the speed effect work internally? Does it modify the walk speed attribute?

scenic valve
#

I imagine so considering you can modify attributes

knotty shell
#

use a potion see if it gets changed?

clever lantern
scenic valve
#

Ah yes, that's correct

tender shard
#

also where the hell is your messages file?

clever lantern
#

in resources folder

wet breach
#

if I remember right default walk speed is a velocity of 0.2 or 0.3

#

the client when you walk sends coordinates, not directions of where you are going

#

the server uses this to calculate your velocity

#

as well as the client

hot panther
#

Hey guys, I'm planning a larger project soon, in which moderation tools as well as mini-game components and events will be installed. Now my question is, does it make more sense to pack the individual areas into their own plugin or should I do everything in one plugin

wet breach
#

separate it out

scenic valve
#

I can second this

tender shard
clever lantern
#

|-- main
| |-- java
| | |-- xd
| | |-- command
| | |-- utils
| | |-- MessageConfig.java
| |
| |-- resources
| |-- messages.yml
where?

tender shard
#

that's the path included in your .jar

#

you get that using JavaPlugin#getResource("messages.yml")

#

or maybe JavaPlugin#getResource("/messages.yml")

#

but definitely not using a File object

#

a File object represents an actual file that's saved in the file system, not something included in your .jar

clever lantern
#

ok ty

wet breach
tender shard
#

what's the purpose of doing it that complicated, one can read a file using JavaPlugin#getResource, or get is as Reader with getTextResource, or directly save it into the datafolder using #saveResource

wet breach
#

its better then what getResource does

tender shard
#

how

wet breach
#

the fact this uses the NIO java package and not the IO package

tender shard
#

but how is that better if saveResource works totally fine and it's just one line

wet breach
#

I never said it didn't work fine, I just said it was better

lilac dagger
#

There are so many things that you can do with the input stream

tender shard
#

maybe it'd be helpful if the person who originally asked this question would tell us what they're actually trying to do

wet breach
#

but, you can just create a filesystem though to pluck your magical file from as well

lilac dagger
#

All io is error prone

wet breach
#

IO if you need blocking or more compatiblity I suppose

shadow night
#

I wonder how late my train comes today

wet breach
#

It will arrive before tomorrow

tender shard
#

if all they wanna do is to load the included messages.yml then all that's needed is this:

    public YamlConfiguration getMessageConfig() {
        return YamlConfiguration.loadConfiguration(getTextResource("/messages.yml"));
    }
wet breach
#

again you missed the point

shadow night
wet breach
#

all you see is 1 line missing the fact there is an entire implementation behind that

tender shard
#

?

#

no clue what you#re trying to say

wet breach
#

do you intentionally pretend to not understand?

tender shard
#

no, I#m just trying to tell the person how to load their yaml file

shadow night
#

So, actually, how would I make a system where the player can right click on mobs to morph into them? I thought of how I could do that but I got no idea

wet breach
#

sometimes you make it seem that way and ignoring facts

wet breach
shadow night
#

That's what I mean

#

Hard to explain

wet breach
#

set them to spectator to get the effect of them morphing into them, then reset them back with a disguise

#

you would need to use a lot of packet manipulation

shadow night
#

I thought of like just manipulating packets to make the player look like the entity but that sounds like a shit idea

#

As I have to implement all the mob abilities

wet breach
#

you don't need to do that

shadow night
#

Idk how

wet breach
#

I mean you would need to have some methods or whatever but you don't actually have to implement anything in the methods

#

you can just use a throws unsupported exception

#

for anything you don't use

torn shuttle
#

how do I get a material by key?

#

is there a way to do it?

eternal night
#

matchMaterial ?

torn shuttle
#

err

#

maybe?

#

guess I'll try

wet breach
#

worse that happens is you come back

native bramble
#

Im trying to setResourcePack to a player, but have msg:
Server resource pack couldn`t be applied. Any functionality that requiers custom resources might not work as expected
here is code - https://pastebin.com/Ugig9Rbm

#

resource pack is working if i load it from client

#

server is 1.19.4

torn shuttle
#

how do I get an enchantment by key when the enchantment is a normal minecraft enchantment?

#

getbykey requires an actual key

tender shard
#

you need to create the hash of the actual file

eternal night
native bramble
#

so i need to download file from link?

torn shuttle
#

huh been using these for ages and I never even realized that existed for mc, thanks

tender shard
eternal night
#

Yea, just make sure to never use the minecraft namespace

#

for anything in your plugin

tender shard
#

but yeah if you DO send a hash, you have to hash the actual file

eternal night
#

beyond accessing vanilla stuff

tender shard
#

cough enchantment plugins often use NamespacedKey.minecraft for their custom enchantments

eternal night
#

and they can suck it KEKW

tender shard
#

yeah... it was either EcoEnchants or AdvancedEnchantments that did this

#

like wtf, that's exactly the reason NamespacedKeys exist lol

shadow night
#

What is the texturepack hash even for?

tender shard
#

so clients can check whether they should re-download the file

#

same hash = unchanged file

shadow night
#

Makes sense

#

Didn't think of that

slender elbow
faint swift
#

Can someone help me with packets ?

upper hazel
#

I’ll ask java professionals where did you get information on java at the beginning of training (1-2 years) so that you know all the subtleties, etc.

native bramble
#

how can i use .env with spigot?

wet breach
#

last I checked, in fact it isn't even defined and left to whatever implementation decides

tender shard
slender elbow
#

as of hotspot openjdk 20.0.2 🤓

native bramble
#

i have classes in my plugin which relate to JDA and i need to store bot token

wet breach
#

it doesn't

slender elbow
#

it does

wet breach
#

alright prove that it does then

tender shard
slender elbow
#

once Files.copy finishes the file exists and has the contents, to get there it has to block

#

literally look at the implementation, it reads the file whole, it writes the bytes whole

native bramble
#

okay

upper hazel
#

what books?

wet breach
#

during the copy it doesn't block

tender shard
tender shard
#

"Java ist auch eine Insel"

wet breach
#

exception however if there is some kind of weird error or something pulls the stream out from under it

slender elbow
wet breach
#

I will believe you if you can demonstrate it

tall dragon
slender elbow
#

the FileChannel for the zip file does not configure blocking(false), and neither is the fc for the target file

wet breach
#

this is because there is no zip objects

#

its a filesystem object

slender elbow
#

which reads from a zip file

#

not talking about a java ZipFile

wet breach
#

do you know how filesystem is implementated?

slender elbow
#

do you?

wet breach
#

yes

slender elbow
#

clearly not

wet breach
#

so demonstrate using the FileSystem API that it blocks as you claim

slender elbow
#

the filechannel used to read from the zip file is not configured to be used non-blocking

#

given that, you know, FileChannel doesn't even implement SelectableChannel which is the base for multiplexed non-blocking IO

#

surely you must know that

wet breach
#

Filechannel isn't used here

slender elbow
#

how else does it read from the jar file

#

oh wait, via a FileChannel

wet breach
#

no

slender elbow
#

yes

wet breach
#

Filechannel is not the only way

#

and isn't what is used by the Files API

slender elbow
#

it is

wet breach
#

show the source

slender elbow
#

github dot com slash openjdk slash jdk

wet breach
#

so you can't got it

slender elbow
#

FileChannel is literally accessible only via FileSystem

#

or rather, the source of them

wet breach
#

FileSystem is what may produce FileChannels, but FileChannels is not what is exclusively used in the FileSystem Object

eternal night
wet breach
#

There is Directory-Streams which is not a channel

#

but neither of them are what is used in the implementation for what FileSystem does

#

anyways, time for bed for me

slender elbow
# wet breach no

https://github.com/openjdk/jdk/blob/9ded86821b01d6d790850e9b49eedfc597c0c9a2/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java#L177
given that the zfpath is a Path from the default filesystem, it will be a regular FileChannel
and since copying between two different filesystems uses a regular newInputStream transferTo newOutputStream, it read from that FileChannel, which does not implement non-blocking IO because it is not a selectable channel which is the jdk's way of doing nio

#

check the ZipFileSystem source xx

outer river
#

Hello, is it possible te get file from yamlconfiguration ?

eternal oxide
#

no

tender shard
#

ofc yo ucan just extend YamlConfiguration and add a File field

outer river
wet breach
slender elbow
#

FileSystems.newFileSystem(myFunnyJarFile) will use the ZipFileSystem

#

because it's the only registered provider for that file type

tender shard
#

maybe you both could open a thread for your useful "discussion" about filesystem stuff lol

slender elbow
#

just admit that you're wrong, it's okay

ivory sleet
#

I think the javadoc would even say non blocking if Files::copy would be non blocking to any degree per say

cinder abyss
#

Hello, do a lot of spawners (who do not makes mob spawn) but with a mob defined inside can make the server lag ?

quaint mantle
#

Bungeecord have a scheduler methods ?

worldly ingot
#

Yes Bungee has a scheduler. ProxyServer#getScheduler()

wet breach
#

which means it depends on the implementation and if it chooses to block or not

slender elbow
#

it isn't

#

there is literally no way to do file-based IO in a non-blocking way

ivory sleet
#

It says that if the input stream is closed asynchronously, then it may be specific to the file system provider how that is handled

#

But thats it (async != non-blocking, and its for closing or interrupting only)

wet breach
#

The behavior for the case that the output stream is asynchronously closed or the thread interrupted during the copy is highly output stream and file system provider specific and therefore not specified.

#

its left undefined

slender elbow
#

output, output, output

#

not input

#

file io is blocking

wet breach
#

input is reading and reading doesn't inherently block

slender elbow
#

get that in your pea sized brain

#

it does

wet breach
#

it doesn't

#

I can have many things read the same file

slender elbow
#

that doesn't mean it isn't blocking

wet breach
#

if that weren't true, memory mapping files wouldn't be a thing

slender elbow
#

are you gonna close the FileSystem before the copy is finished?

#

because if it truly is non blocking then Files.copy will exit before the copying finishes

wet breach
#

which it technically could

#

the api even says as such

slender elbow
#

no it doesn't lmao??

ivory sleet
#

It says in case of that the stream closed asynchronously or the thread u run it on is interrupted then yeah unspecified and handled by the file system provider

wet breach
#

there is nothing in the source you gave nor in the api that states that the methods involved block or prevent anything from continuing. Reading doens't block and the writing doesn't block either. Blocking means that nothing can move forward and only those things must be done before anything else could ever happen

slender elbow
#

are you stupid?

#

genuine question

wet breach
#

could ask you the same question

slender elbow
#

just because it's inside java.nio doesn't mean it doesn't block

wet breach
#

have you been able to demonstrate the blocking behavior yet?

slender elbow
#

do you understand how file io works, do you understand how jdk filechannel works, do you understand how zipfilesystem works

#

you have given no proof that it doesn't block

#

so go ahead and provide source

slender elbow
wet breach
#

no you didn't demonstrate it

slender elbow
#

you haven't deminstrated your point either

wet breach
#

I don't need to because I am not the one contesting what I have said

#

you were the one that did

slender elbow
#

again, zipfilesystem uses a filechannel to read from the file, file io is blocking

#

filechannel literally cannot operate in non-blocking

wet breach
#

well it can

slender elbow
#

it literally cannot

wet breach
#

that means it can't be halted?

#

other things can't be done while it is also doing that?

slender elbow
#

the thread reading from/writing to the filechannel will halt until the read/write is finished, doesn't mean other threads will or can't use the fc

carmine mica
#

The FileChannel javadocs seem to support ^

eternal oxide
#

java.io is Blocking. java.nio is not

wet breach
slender elbow
#

that is not what it's about lmfao

neat mesa
#

now prove it

carmine mica
#

am I reading this right? From the FileChannel javadocs

eternal oxide
wet breach
#

but according to emily, File IO is syncronized for everything

slender elbow
#

i literally never said it's synchronized "for everything"

#

when did i say that

neat mesa
#

in my dream

eternal oxide
#

You are probably arguing about completely different things. This happened between Frost and myself in the past.

wet breach
ivory sleet
#

synchronized != blocking same as asynchronous != non blocking

wet breach
#

Other operations can be done other then writing at the same time

slender elbow
#

you cannot do non-blocking IO on FileChannels

carmine mica
wet breach
#

no

#

you can read all you want

#

regardless of the writing

carmine mica
#

channel's position is reading right?

slender elbow
#

That is literally not at all what I was saying anyway

#

i am saying the IO operations themselves have to halt the current thread

slender elbow
#

that is what non-blocking is all about, not blocking the current thread for the IO ops, which FileChannel cannot do

carmine mica
#

oh yeah ok, even I read that wrong.

slender elbow
# wet breach I don't need to because I am not the one contesting what I have said

and again you have given absolutely no proof that the thing actually is non-blocking, SelectableChannels can be configured to be non-blocking to be used with a Selector for multiplexed NIO, FileChannels are not selectable channels, using a FileSystem to read from a jar/zip file will use a FileChannel as I have literally pointed to in the source code, but even if that was implementation detail, Files.copy has to block given that "On return, the input stream will be at end of stream", that can only happen if all bytes have been read by that point, which can only be the case if the current thread is blocked, it also uses InputStream.transferTo which says the same, and it also says that it may block indefinitely to consume the input stream (and writing to the output stream)

now please provide proof of your claims that it actually is non-blocking, just how i showed it is blocking, because all you have said until now is "it is non blocking" and nothing more

#

i have never seen someone who is more confidently wrong about anything than you

#

and that is quite the achievement

ivory sleet
#

Yeah both copy methods that do take an input or output stream return the amount of bytes read/written, wouldn’t make sense if it now were non blocking or async for that part such that the functions return earlier than when the io ops complete

wet breach
#

you could technically have Java report it completed something before it actually did complete something lol

slender elbow
#

it's not atomic with respect to other processes doing IO on the same file (unless you pass the option)

#

but that has nothing to do with what i'm talking about

wet breach
#

But there is no set standard in regards to the OS and FS in relation to when an operation completes and is released

#

hence why the events can appear in an order you weren't expecting

slender elbow
#

ok?

wet breach
#

in other words when Files.copy says its done and you check you can get filenotfound exception, consequently you can also just get a partial of the file instead

slender elbow
#

partial copy != non-blocking

wet breach
#

well OS and FS doesn't block

slender elbow
#

do you understand what non blocking even is

wet breach
#

if it did you would be using an 80's computer

#

with them tape drives and what not

clear panther
#
@EventHandler
    public void onDamagePlayer4(EntityDamageByEntityEvent e) {
        Entity attacker = e.getDamager();
        if (!(attacker instanceof Player player)) return;
        if (Objects.requireNonNull(player.getItemInHand().getItemMeta()).getDisplayName().equals(ChatColor.BLUE + "Emerald Katana")) {
            ItemStack emerald = new ItemStack((Material.EMERALD_BLOCK));
            if (player.getInventory().contains(emerald, 10)) {
                player.sendMessage(ChatColor.GRAY + "Spent " + emerald.getAmount() + " Emerald block, Dealt " + emerald.getAmount() + " Damage.");
                player.getInventory().remove(emerald);
                int damage = (int) (emerald.getAmount() * 0.2);
                player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 30, damage));
            }else{
                player.sendMessage(ChatColor.RED + "You don't have emerald...");
            }
        }
    }
}```
help it didnt work even i have 10 emerald block in inventory i still dont get effect and only got prints out "You don't have emerald"
north nova
#

what is this

clear panther
#

kantna

#

i mean its like emerald blade

#

in hypixel skyblock

chrome beacon
#

Don't detect items by their name

#

use pdc

#

?pdc

ivory sleet
# wet breach Files.copy doesn't block

Yeah frost its def not atomic, you’re correct there, that would make it absurdly unoptimized I’d imagine, but I think Emily was arguing about that you asserted it doesn’t block which we concluded it does

scenic valve
clear panther
#

idk if it works with 1.18.2

scenic valve
remote swallow
clear panther
#

k

#

btw why dont use name to detect item

scenic valve
#

Many reasons, I believe comparings strings are typically slower, using data is uniqe and more reliable, etc

wet breach
#

XD

ivory sleet
#

Myeah it could be interesting

#

Maybe u should get a demonstration of that :>

wet breach
#

I don't have a quantum computer

clear panther
wet breach
#

only way I can think of where you could have two things happen at the same time that would be opposing since you know super positions

scenic valve
clear panther
#

anyways can someone help me with

@EventHandler
    public void onDamagePlayer4(EntityDamageByEntityEvent e) {
        Entity attacker = e.getDamager();
        if (!(attacker instanceof Player player)) return;
        if (Objects.requireNonNull(player.getItemInHand().getItemMeta()).getDisplayName().equals(ChatColor.BLUE + "Emerald Katana")) {
            ItemStack emerald = new ItemStack((Material.EMERALD_BLOCK));
            if (player.getInventory().contains(emerald, 10)) {
                player.sendMessage(ChatColor.GRAY + "Spent " + emerald.getAmount() + " Emerald block, Dealt " + emerald.getAmount() + " Damage.");
                player.getInventory().remove(emerald);
                int damage = (int) (emerald.getAmount() * 0.2);
                player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 30, damage));
            }else{
                player.sendMessage(ChatColor.RED + "You don't have emerald...");
            }
        }
    }
}```
help it didnt work even i have 10 emerald block in inventory i still dont get effect and only got prints out "You don't have emerald"
this
wet breach
scenic valve
#

True beans

clear panther
chrome beacon
wet breach
#

if you use .equals() its super quick as it isn't comparing the string literally

#

rather just that its contents match

scenic valve
#

yep

clear panther
#

💀

echo basalt
#

Objects.requireNonNull zany_face_1

scenic valve
#

intellij be like ^

clear panther
#

i mean i can just cancel every anvil event tho smh

wet breach
ivory sleet
echo basalt
scenic valve
clear panther
#

what thing

#

emerald katana?

scenic valve
#

yes, the code you pasted

clear panther
#

yea not workin

#

it does work but it wont allow me to get more then one emerald block

scenic valve
clear panther
#

uh

#

i mean

#
@EventHandler
    public void onDamagePlayer4(EntityDamageByEntityEvent e) {
        Entity attacker = e.getDamager();
        if (!(attacker instanceof Player player)) return;
        if (Objects.requireNonNull(player.getItemInHand().getItemMeta()).getDisplayName().equals(ChatColor.BLUE + "Emerald Katana")) {
            ItemStack emerald = new ItemStack((Material.EMERALD_BLOCK));
            if (player.getInventory().contains(emerald)) {
                player.sendMessage(ChatColor.GRAY + "Spent " + emerald.getAmount() + " Emerald block, Dealt " + emerald.getAmount() + " Damage.");
                player.getInventory().remove(emerald);
                int damage = (int) (emerald.getAmount() * 0.2);
                player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 30, damage));
            }else{
                player.sendMessage(ChatColor.RED + "You don't have emerald...");
            }
        }
    }
}```
look at this
#

the ability works

#

but if i have more then one emerald block

#

boom player.sendMessage(ChatColor.RED + "You don't have emerald...");

#

i dont have emerald

#

bruh

scenic valve
#

Don't you need 10 when it checks the inventory?

clear panther
#

oh

#

wait

#

now

ivory sleet
#

lol

clear panther
ivory sleet
#

the four at the end is just vibing there?

clear panther
#

vibing?

#

why it sounds a little bit sus

scenic valve
#

4 is a party, 3 is a an awkward duo

clear panther
#

i say disco u say party

#

disco disco

scenic valve
#

Try adding a check to see if the inventory has more than 1 emerald

clear panther
#

oof + emotional damage

#

okay

scenic valve
#

oh, lol , party party.
If I remember correctly, you need to specify the amount when it comes to inventory stuff

clear panther
#

revives
🫡

hybrid spoke
#

dies of cringe

clear panther
slender elbow
#

among us

clear panther
#

or smh

clear panther
#

not a child anymore

slender elbow
#

don't remind me 🥲

scenic valve
clear panther
#

then how do i check if player's inventory have emerald

scenic valve
#

I believe you were on the right track, you just need to make a seperate if statement involving the amount of emeralds

clear panther
#

wha

#

sorry my english is suck

#

i have no clue what are u trying to say

scenic valve
#

.contains() returns an ItemStack, which you already specified.
Now you need to check the amount of the emeralds which you already pointed out by using .getAmount()

hybrid spoke
scenic valve
#

^

clear panther
#

bro

#

i didnt verifed

#

💀

shadow night
#

"I didn't verify"*

#

Or "I'm not verified"*

clear panther
#

...

#

Stop it, get some help.

hybrid spoke
#

or "I have not undergone the verification process."

clear panther
#

gotta love how people is ready to be second mee6 when i type something wrong

shadow night
#

Well, we are correcting you so you don't make those mistakes again

#

Otherwise you will continue writing it that way and be wrong

clear panther
#

This type of english correcting is over used

#

and starting to be a roast

#

many people just correcting english for fun and having beef

clear panther
scenic valve
#

I don't think you want a negative emerald amount right?

clear panther
#

oh

#

uhh

#

typo 😄

scenic valve
#

You're good

primal goblet
#

Hey, i'm trying to prevent the tab complete and make a custom one to handle it by myself.
but when i try to press tab there's some bungee commands appears with it, how can i prevent this? and that's the code using protocollib

manager.addPacketListener(
                new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.TAB_COMPLETE) {
                    public void onPacketReceiving(PacketEvent event) {
                        if (!event.getPacketType().equals(PacketType.Play.Client.TAB_COMPLETE))
                            return;
                        event.setCancelled(true);

                        String[] x = new String[] {
                                "hiu", "meow", "xd"
                        };
                        PacketContainer container = manager.createPacket(PacketType.Play.Server.TAB_COMPLETE);
                        container.getStringArrays().write(0, x);

                        manager.sendServerPacket(event.getPlayer(), container);
                    }
                });
#

that's what appears

#

oh i'm using bungee btw

tender shard
#

won't that crash the server as you keep cancelling the event, then send a new packet, cancel that again, etc ...

pliant pulsar
#

Is it possible to check if the server is in a bungee network? I want to register commands only if there is no proxy infront, otherwise I want to let Bungee handle it

primal goblet
tender shard
#

create a field "ignoreNextPacket" and set that to true before you send your own packet, then set it to false again after sending it, and at the top of the listener, return immediately if taht field is true

lilac dagger
#

You could try to edit the packet if possible

tender shard
#

also TAB_COMPLETE is sent when a player presses tab inside a command, you seem to want to change the command list instead

primal goblet
primal goblet
tender shard
#

what do you not understand?

primal goblet
#

ignoreNextPacket

#

is that a setting on protocollib or smth

chrome beacon
#

No it's a field alex just told you to create

primal goblet
#

wait can i handle this from bungee?

tender shard
#
private boolean ignoreNextPacket = false;

// Event handler
public void onPacketSend(PacketEvent event) {
  if(ignoreNextPacket) return;

  // ...
  ignoreNextPacket = true;
  // send packet
  ignoreNextPacket = false;
}
tender shard
#

otherwise you listen to your own outgoing packet

primal goblet
#

i guess it will loop cuz i recieving a packet and making the same so it fires again and again

tender shard
#

also you have to listen to this packet instead

#

it contains the list of all commands

primal goblet
#

@tender shard but there's bungee commands too, so should the bungee handle this?

tender shard
#

ofc, you must do that from bungee

#

or you simply don't give permissions for those commands, then they won't show up

primal goblet
#

xD

tender shard
#

?

primal goblet
#

and if i register them, still i need to handle the tab commands for another things too

tender shard
#

no clue what you're talking about

primal goblet
tender shard
#

the list of commands is completed client-side

primal goblet
#

the event TabCompleteEvent will work if i put any command like /anything

#

?

tender shard
#

the top-level command names are sent to players right after they joined, and it will only include commands the player has permissions to

primal goblet
#

uhmmm

#

i can overwrite this with bungee right?

tender shard
#

probably only with protocollib. in spigot there is PlayerCommandSendEvent but it won't include the bungee commands

primal goblet
#

i'll try the bungee event hopefully it work :3

primal goblet
echo basalt
primal goblet
echo basalt
#

It won't be sent to the client

#

but it's available for listeners yeah

primal goblet
echo basalt
primal goblet
#

give me an example please 🥺

primal goblet
tender shard
echo basalt
#

autocasting or something

tender shard
#

wdym?

echo basalt
#

getMeta could autocast your stuff

#

no clue about setMeta but maybe to look better than just passing any object

tender shard
#

how would it know which type something is

echo basalt
#

just unsafely casts

tender shard
#

it'll always be Object

echo basalt
#

it's an optional

primal goblet
echo basalt
#

Optional<String> asd = packet.getMeta("asd")

#

works

primal goblet
#

i used #orElse

#

to cast the boolean

tender shard
#

yeah well but still

echo basalt
#

it'll throw cast errors in runtime

tender shard
#

exactly

primal goblet
tender shard
#

and for the set method, the T is completely useless, isnt it?

echo basalt
#

it is

tender shard
#

I know how optionals work, I'm just here to say the type parameter is useless

echo basalt
#

tbf if you look at the impl

#

it's a static map

primal goblet
#

and uhmm it works for me, but still i locating the bungeecord commands, how can i remove them?

echo basalt
#

you'll need to make a bungee plugin

tender shard
#

should be PacketType.Play.Server.COMMANDS

#

if Server means Clientbound, that is

echo basalt
#

it is

primal goblet
echo basalt
#

bungeecord injects its own commands on top

#

so you'll have to look for them in bungee and not in spigot

opal carbon
#

you cant remove bungeecord commands with a backend server plugin

primal goblet
echo basalt
#

As I said

primal goblet
echo basalt
#

The backend server doesn't have context of what's on bungee

tender shard
#

i already said 15 minutes ago that you need to use protocollib on bungeecord

echo basalt
#

doubt plib supports bungee

tender shard
#

it doesn't?

primal goblet
echo basalt
#

it's tied to spigot

#

you pass JavaPlugin on listeners and whatever

tender shard
#

that is weird

#

i thought it would be multi-platform

echo basalt
#

it isn't

primal goblet
#

can someone give me a quick example

echo basalt
#

multi-platform code is icky to make

tender shard
#

one more reason not to ever touch protocollib

echo basalt
#

takes 19 years

#

you gotta make interfaces and abstract classes for everything

#

and plib is hacky

#

it's literally just an nms reflection thing

#

with wrappers

primal goblet
#

nah i'm not gonna do anything with plib thank you xd

opal carbon
#

i dont really like using protocollib ngl

#

would rather not depend on a hacky system updating

echo basalt
#

well

tender shard
#

protocollib is quite garbage imho

echo basalt
#

plib isn't super hacky

quaint mantle
echo basalt
#

it's just a huge wrapper

tender shard
opal carbon
primal goblet
#

i got an idea

#

i will cancel the tab complete event from bungee and send a tab complete from spigot

tender shard
#

TabComplete is still not what you‘re looking for

#

But the command list

primal goblet
tender shard
#

Just dont assign permissions to players for commands they shall not see

primal goblet
#

nah i'm just built diff

#

i disabled the commands on bungee and it works

strong parcel
#

Does the crops tag only include stuff on farmland? I am running a test right now to prevent crops tagged blocks from being destroyed, and it works on seeds but not sugarcane.

remote swallow
#

seeds are seeds wheat is the crop

#

sugarcane isnt a crop

strong parcel
#

Is there a tag for stuff like sugarcane, cactus, cocoa, etc?

tender shard
#

these are all crops

echo basalt
#

pitcher_crop

#

the fuck

remote swallow
#

sniffer 1.20

green plaza
#

?paste

undone axleBOT
upper hazel
#

who has ideas how to check your code for quality and optimization

gleaming grove
upper hazel
#

oh

#

this be long

echo basalt
#

use your eyes

strong parcel
#

Is it possible to get the pushed block in a piston extend event, or should I find it by using the direction of the piston?

tender shard
#

getBlocks()

strong parcel
#

Thanks!

#

So would getBlock() be the piston block?

#

The singular

tender shard
#

getBlock() is the piston, getBlocks() is the list of pushed blocks

strong parcel
#

Oh, I was looking at the BlockPistonEvent

tender shard
#

that's an abstract class, you cannot even listen to that directly

upper hazel
#

is there a "vanilla" way in the bukkit api to bind the compass to the player so that the arrow points in his direction (and does not freak out in hell if he is also there)

chrome beacon
#

In modern versions yes

upper hazel
#

i need use task?

round finch
#

what is a good api for jframe?

#

to design more easily without the pain

sterile breach
#

hello, with redis to avoid update problems (for example, if a piece of data is supposed to no longer exist but the request hasn't arrived yet and the db is being queried on another server, this can lead to duplication bugs). That's why I came up with the idea of making a boolean so that when a request is made, we wait for it to be false and then synchronize it on each of the servers using a borker message system to inform us that the database is in use (it's a kind of multi-server redis lock system). The only small problem/risk: if 2 servers make a request at the same time, the var cannot be acted upon. Is it a good system?

tender shard
lilac dagger
#

i used jframes myself and it's not that bad

#

tho i haven't made anything too complex

round finch
#

i'm looking for design api

ivory sleet
lilac dagger
#

unless you don't mean by jframes swing

round finch
#

Not sure monkahmm

#

just wanna make my java gui prettier

tender shard
#

just throw in FlatLaf

#

with and without flatlaf

round finch
#

UUHH

#

another person who recommended it too

tranquil prairie
#

Hey currently I have an armor stand I created with packets but it follows the player as a nametag but it prevents players from placing and hitting things because the hitbox is in the way

#

How do I prevent that

tender shard
# round finch UUHH

Its great, it includes a few different themes and you basically only need one line of code to use it

round finch
tranquil prairie
tender shard
#

They have a smaller hitbox (or none at all?) iirc

sterile breach
tranquil prairie
#

thanks @tender shard

ivory sleet
#

Well there are certain algorithmic designs one can use, and other so called principles such as being disciplined in the way ur data exchanges work

#

For instance consider a tree

#
- SQL (Persistence cache)
  - Redis (In memory, fast cache)
    - Server1
      - World37
      - World_Nether
    - Server2 
      - Overworld
#

On read u only go up in principle (sometimes u might have to cache respective layers if said entry isn’t already there)

#

On write you’d have to invalidate all layers that have to be written to, that is for all layers x, for all parent layers y of x, if x does end up being written from then y needs to be written from too as well

echo basalt
#

redis has like 5x less write latency than sql

#

but they're not that far apart in read speed

ivory sleet
#

and then you make sure that either:
concurrent writes are doable, this by maybe comparing time or if the writes can be done in any order, for instance lets say I’m adding money to a bank account twice , the order in which the operations actually take place can happen two ways, as long as I still know which one was initiated first (which we can sorta do by using time sortable snowflakes or just timestamps)

or u make it so that if one write happens it makes sure all other writes that may have tried to take place approximately the same time are discarded and have to be re written

sterile breach
#

yes redis lock

#

with redisson

ivory sleet
#

This mode requires discipline and ensuring high durability, availability and isolation along with atomicity is hard

sterile breach
#

but even then, if the request is sent a few ms before the lock is activated^^.

ivory sleet
#

Redis lock is just an exclusive lock tho

#

No?

#

I mean locks are great just fucking slow

#

Take ReentrantLock in java

#

Good shit but slow

#

StampedLocks, mye somewhat better since they don’t need that reentrant implementation but they’re still slow

#

Hence why if you can get an atomic design, then that may sometimes be quite rewarding

sterile breach
#

but I guess StampedLocks only work on one server?