#help-development

1 messages Β· Page 1035 of 1

full stump
#

check it

prisma jolt
#

I do not need links to other peoples code

full stump
#

ok

dusty totem
#

Hey, so version 1.20.6 is now supporting forward client as we mentioned some time ago?

chrome beacon
#

At least if you're refering to the transfer packet

#

Which I assume you are

dusty totem
#

yeah I want to rewrite Bungeecord plugin to force a client to reconnect to another IP/Domain address

green prism
#

Hello there. Can you please help me with this error that occurs while registering a listener?

        // GuiListener
        this.getServer().getPluginManager().registerEvents( // Error line
                new GuiCloseListener(this),
                this
        );
org.bukkit.plugin.IllegalPluginAccessException: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "o" is null
#

Yeah, please, remove this config file from here

#

Thank you! πŸ™‚

sullen marlin
wet breach
pseudo hazel
#

I have a question about shading plugin libraries, Right now I am shading packetevents, but lets say the admin also wanted to add another plugin that uses packetevents as hard dependency (i.e. just a jar in the plugins folder), does that mean that packetevents will essentially be running twice?

sullen marlin
#

Depends if you relocate it or not. But it you don't relocate it then things could get messy

pseudo hazel
#

right

#

so I have relocated it to be under by namespace

#

does it just use the plugin twice?

#

I mean I guess I can try by putting the jar in the plugins folder..

#

but then I think there would be no way to change that

#

like say if the plugin folder does have packetevents, then use that instead of the one I shaded

full stump
#

any can help me with anything?

quaint mantle
#
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources (default-resources) on project paper: filtering ...\src\main\resources\translations\es.properties to ...\target\classes\translations\es.properties failed with MalformedInputException: Input length = 1 -> [Help 1]

Someone knows how to fix this or what is happening?

pseudo hazel
undone vapor
#

what happened to the org.bukkit.Tag.ITEMS_MUSIC_DISCS field in 1.21?

#

I need to check if an item is a music disc, but I can't do Tag.ITEMS_MUSIC_DISCS.isTagged(type) anymore

slender elbow
#

idk if there is API for it in ItemMeta, check the javadoc

flat belfry
#

guys

#

hello

#

wait I cannot uploaed screens here?

slender elbow
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

flat belfry
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

flat belfry
#

!verify Zedgo

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

quaint mantle
sullen belfry
#

!paste

#

?paste

undone axleBOT
sullen belfry
#

anyone able to help me with a problem im having, im trying to make it so i can apply a custom lore to an item basted on the item i am holding in my inventory and when i click on a helmet TL:DR A custom enchant plugin, but it doesn't seem to work and i don't get any errors.

https://paste.md-5.net/peyuliliva.cs

echo basalt
#

yikes checking meta instead of pdc

sullen belfry
#

pdc?

quasi gulch
#

persistentDataContainer

sullen belfry
#

looking it up now

#

not sure it will solve my issue but does seem interesting

#

i was looking for a way other than meta and item names or lore looks like i've found one

quaint mantle
real lagoon
sullen belfry
sullen marlin
sleek estuary
#

Does bungeecord have better performance than velocity?

river oracle
sullen marlin
sullen belfry
sullen marlin
real lagoon
real lagoon
sullen belfry
#

i got a new version working but it keeps deleting the items and i don't understand why

#

?paste

undone axleBOT
sullen belfry
real lagoon
#

Anyway

#

Check my code and add invEvent.setCancelled(true) at the end

#

(After it passes all the checks)

sullen belfry
#

added invEvent.setCancelled(true) and it doesn't delete the item now

#

no idea why

#

i honestly don't understand that but thanks

real lagoon
#

Wait a second

#

I don't understand, but it works now?

sullen belfry
#

yeah

#

i don't understand how but it does

#

i added the cancel thing to my code and it worked

#

after all the checks like you said

real lagoon
sullen belfry
real lagoon
#

Nice

#

I recommend you to clean up your code, take a look at the one i sent

#

Most checks are useless

mellow snow
sullen marlin
#

sounds like a query for the plugin author

twin venture
#

hi , is this good ? and can i improve it further in terms of performance and consistnsy :

#

this is a load method , it load kits from a specfic mode

#

for example solo kits

#

this will load all solo kits

#

it works πŸ™‚ , but can i improve it further?

floral drum
real lagoon
#

Quick question: is it possible to run a world async?

real lagoon
#

Why? Two worlds don't need to be synced

floral drum
#

?paste

undone axleBOT
floral drum
#

and send it here

river oracle
twin venture
#

here ya go purple

real lagoon
floral drum
#

Having that many fields defined can make your code look unclean and hard to read

twin venture
#

i see πŸ™‚ i forgot about that

#

yeah i think now its better thanks for the help πŸ™‚

#

also what do you think about this save?

floral drum
#

That looks fine, just the same goes with the try-with-resources how two fields can be in the same try block

twin venture
#

someone told me its varnuable to sql injections?

floral drum
#

Since it's a preparedstatement, if used correctly - they aren't exactly vulnerable to sql injection, your code looks fine and it uses the prepared statement well

twin venture
#

good to know πŸ™‚

worldly ingot
#

If you're using Java 17 or above, you should use text blocks Steve_Dab

#

IJ has a feature for it

twin venture
#

welp i want to get rid of it xD

#

we are not the same hahaha xDD

#

yeah

#

lets say i edit 1 thing in lobby server (both servers connected into the same database) will it change directly or i need to restart ot do smth?

worldly ingot
#

I mean the database will update, but your other server would have to read from it again if it has a cached value

twin venture
drowsy helm
#

Completely depends on what that thing is and how it’s fetched

river oracle
#

Inventory PR step 2 commences!

#

great things are ahead I feel it in the air

#

was going to go to bed but the inventory PR beckons me

kind hatch
#

I feel that

river oracle
quaint mantle
river oracle
#

kekw just getting the ball rolling now finally tho

river oracle
#

why tf is this client sided

#

that's so aggrovating

#

okay ig its not I'm just not updating with the right packet internally ig

sterile breach
#

Hi, When a player got mooved (to another server) , the on join event is called before the leave event on the last server. But is it a question of time? Or is it once the join event has finished?

sullen marlin
#

It will always be after

#

On bungee

river oracle
halcyon hemlock
#

did it work?

halcyon hemlock
wet breach
sterile breach
sullen marlin
#

I dont know

sterile breach
#

is allways after join or prelogin event because the proxy wait one of these event to disconnecnt to the last server or it's not waiting for the event, just a matter of time?

wet breach
#

since they are already logged in o.O

#

I could be wrong, but it wouldn't make sense to have a login event on a server move

sterile breach
vital sandal
#

whyy inteliJ

halcyon hemlock
#

why u importin same thing 2 times

vital sandal
#

I mean

#

they are the same text right :l

halcyon hemlock
#

intellij smokes crack

vital sandal
#

the only correct one is the above

#

the below is wrong ...

winter zenith
#

PlayerConnection needs to not use hardcoded reach values for the raytrace

#

when calling PlayerInteractEvent

#

someone forgot to account for the fact that minecraft added reach attributes

#

these shouldn’t be based off a ternary anymore

alpine urchin
#

based on*

winter zenith
#

meh

#

based off flows better

chrome beacon
#

?jira

undone axleBOT
winter zenith
#

i’m not making an account

quaint mantle
#
public class PlayerStepHandler implements Listener {
    @EventHandler
    public void onMove(PlayerMoveEvent e) {
        Location l = e.getPlayer().getLocation();
        l.setY(l.getBlockY() - 1);
        World w = e.getPlayer().getWorld();
        Block b = w.getBlockAt(l.getBlockX(), l.getBlockY(), l.getBlockZ());
        PlayerStepEvent ev = new PlayerStepEvent(e.getPlayer(), e.getPlayer().isOnGround(), b, w, b.isEmpty() || b.getType() == Material.AIR);

        Bukkit.getServer().getPluginManager().callEvent(ev);
    }
}
@Override
    public void onEnable() {
        // Plugin startup logic
        creatingUtils();

        JerryWeapon.setup();
        NewbieWeapon.setup();

        DungeonPig.setup();

        new DungeonPig().run();

        createShopSetup();

        pm.registerEvents(new PlayerJoinHandler(), this);
        pm.registerEvents(new FarmShop(), this);
        pm.registerEvents(new WeaponShop(), this);
        pm.registerEvents(new DungeonPig(), this);
        pm.registerEvents(new NPCIdChecker(), this);
        pm.registerEvents(new DamageSystemHandler(), this);
        pm.registerEvents(new PlayerStepHandler(), this);
        pm.registerEvents(new PlayerWarpHandler(), this);
    }
public class PlayerWarpHandler implements Listener {
    @EventHandler
    public void onStep(PlayerStepEvent e) {
        e.getPlayer().sendMessage(e.getWorld().getName());
        if (e.getWorld().getName().contains("dungeon")) {
            if (e.getBlock().getType() == Material.SMOOTH_QUARTZ) {
                e.getPlayer().sendMessage(Plugin.INSTANCE.TELEPORT_MESSAGE.createTeleportMessage("λ‘œλΉ„"));
                Plugin.INSTANCE.MULTIVERSE_CORE.teleportPlayer(Bukkit.getConsoleSender(), e.getPlayer(), Plugin.INSTANCE.MULTIVERSE_CORE.getMVWorldManager()
                        .getMVWorld(Worlds.WORLD_LOBBY.getWorld()).getSpawnLocation());
            }
        }
    }
}

It doesn't work

#

how to fix it?

worthy yarrow
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

winter zenith
#

press alt and f4

quaint mantle
#

do yourself

winter zenith
#

don’t use player move event

#

it’s jank

quaint mantle
#

non junk

winter zenith
#

make a runnable instead

eternal oxide
quaint mantle
#

I am making warp

eternal oxide
#

um, what exactly are you trying to do?

quaint mantle
#

step smooth quartz -> teleport to lobby

eternal oxide
#

if they step on smooth quarts, teleport?

quaint mantle
#

yes

#

event doesn't called

#

Bukkit.getServer().getPluginManager().callEvent(ev); not worked

eternal oxide
#
if (event.getTo().getBlock() == event.getFrom().getBlock()) return;
if event.getTo().getBlock().getRelative(BlockFace.DOWN).getType() == QUARTZ) teleport;```
quaint mantle
#

STEP

#

STEP

#

NO SAME LOCATION

winter zenith
#

damn

eternal oxide
#

that code will only teleport them IF they moved onto a new block and it's quarts

quaint mantle
#

really?

lost matrix
#

Alternatively you could do arithmetics checks instead of calling getBlock() to prevent a CraftBlock instance being created.
But probably not that much of a difference

eternal oxide
#

oh I missed one thing. I'll fixc it

lost matrix
#

Probably getRelative

quaint mantle
#

ye. it doesn't work

eternal oxide
#

yes it does

lost matrix
#

Show your code and tell us what happens.

eternal oxide
#

I fixed it, added teh getRelative

quaint mantle
#

THANKS YOU SO MUCH!

lost matrix
#

What even is a "PlayerStepEven"?

eternal oxide
#

I assumed his own event

quaint mantle
#

but it doesn't called

#

^_^

#

?

alpine urchin
#

wrong channel

misty ingot
#

is there a way to get the resource id as i am uploading my plugin so i dont have to then put out another version for my update checker

eternal oxide
#

I just check the version against teh current release on Github

#

Your resource id should not change with an update. Only when you first post

young knoll
#

Yes but you need the id for the update checker

#

So you need to post, then add the id and release an update

misty ingot
#

so theres no way to do that

#

alright

summer scroll
#

I'm trying to create a currency plugin that sync between servers in real-time, basically I want to do this:

  • Server A reduce Player A balance -> sends notification to all servers
  • Server B receive notification -> reduce the Player A balance

What would be the easiest solution for this?

blazing ocean
#

a db?

#

and some realtime thing

summer scroll
blazing ocean
#

supabase has a good postgres based database + they have realtime stuff

eternal oxide
#

caching and cross server is a royal pain

blazing ocean
#

it's what I use

#

it's just some channels you send JSON messages in

summer scroll
#

I was thinking about using bungeecord plugin messaging but it requires an online player.

misty ingot
#

just save the data in a db and then when the player joins the second server THEN load their data into cache and then unload it when they leave

#

when they join second server, first server unloads from cache

blazing ocean
eternal oxide
#

leave/join is too fast for teh db to update between connections using bungee

blazing ocean
#

it's what i use for realtime stat updating

summer scroll
#

That works accross servers.

smoky anchor
#

Hi ppl, can someone please direct me to the mappings website, I never seem to remember it.

blazing ocean
#

?mappings

undone axleBOT
tardy delta
#

screaming sandals or smth?

smoky anchor
#

ty πŸ’š

misty ingot
#

make it a bungee command

tardy delta
#

uhh

misty ingot
#

when a player leaves, save their cached data to a more permanent db and then unload their data from cache to save resources

#

when they join, load it

summer scroll
#

I've never created bungee plugin but I could try yeah.

misty ingot
#

its a lot easier than whatever you were thinking of doing

icy beacon
#

i mean

#

not outdated

#

but there's a new prefereed site

tardy delta
#

who even makes sandals scream?

icy beacon
#

some interested individuals

summer scroll
misty ingot
#

PMC

#

or make an admin command for /currency take <player> <amount> and give perms for it to admins but then the spigot plugin can also just use that command

blazing ocean
#

you can make db updates automatically send a channel message iirc

summer scroll
misty ingot
#

once again, PMC

#

just make one request to deduct the balance from the player, and that returns one of 2 enums, either INSUFFICIENT_FUNDS or SUCCESS

#

put an if condition in your spigot plugin

summer scroll
#

Alright, I'll try to do that, thanks!

misty ingot
#

you'll probably have to give each request an ID of some sort because its not like a promise its more of like your plugin will just run a diff function when it gets a reply

#

so with the id you know which purchase is being talked about

wet breach
misty ingot
#

sure

blazing ocean
wet breach
#

I am aware

#

an old joke you know

ocean hollow
#

why is all unresolved reference?

patent quarry
#

Hello, I saw that in 1.21 org.spigotmc.event.entity.EntityMountEvent has been relocated to org.bukkit.event.entity.EntityMountEvent.

What is the best way, to have my listener working with both for 1.21- and 1.21+. I think using reflection can work, but for this case I have no idea how to use it :/ Someone have an idea ?

import org.spigotmc.event.entity.EntityMountEvent;

public class PlayerMountEvent implements Listener {


    @EventHandler
    public void entityMountEvent(EntityMountEvent e) {
        if (e.getEntity() instanceof Player) {
            EventInfo eInfo = new EventInfo(e);
            eInfo.setPlayer(Optional.of((Player) e.getEntity()));
            eInfo.setTargetEntity(Optional.of(e.getMount()));
            EventsManager.getInstance().activeOption(Option.PLAYER_MOUNT, eInfo, new ArrayList<>());
        }
    }
}```
civic sluice
#

Build against 1.20.6 and let commodore in spigot handle it itself.

#

Or register different event listeners based on the version + use multiple modules.

patent quarry
#

I prefer build in 1.21 to have the 1.21 features

civic sluice
patent quarry
#

Yeah but that is not a problem for 1.21 features, I can handle these features with just a if, I dont need reflection

wispy abyss
#

Hey, I'm working on plugin that has some basic lucky block functionallity and one lucky block should spawn a sign that says "Look up!" and then spawns 3x3 anvils above the player.
That all works fine but I'm really struggling with facing the sign in the direction of the player, has anyone ever done something similar:
https://paste.md-5.net/uquruxoziv.java
Is there a way to spawn the sign diagonally? When I place a regular sign in game, that works but there seems to be no way in code, only facing it North, Sout, etc.
If anyone could take a look that would be great!

eternal oxide
#

Don;t spawn a sign, spawn a TextDisplay

young knoll
#

There are block faces for the diagonals

#

Like NORTH_EAST

twin venture
#

Hi iam getting a problem with something , hope anyone can help me :
so if i use this SOLO , it load the solo kits :
and it works just fine

#

but if i do

#

it does not load them

#

they are already in the database

#

and the kit_mode for the kits are solo

#

what iam missing?

tardy delta
#

"does not load them" what does that even mean

#

"solo" or "SOLO"

robust ginkgo
#

If I extend JavaPlugin, I won't have issues with casting it to Plugin, right? I committed oopsie daisies on a function parameter, nevermind.

twin venture
#

empty

#

if it does not load it will not send any list here

tardy delta
#

so empty, it throws an illegal arg?

twin venture
#

no nothing

#

it just does not load the mode

#

i tried both

tardy delta
#

youre not handling the exception of the completable future

#

so thenAccept will never run as the future completed exceptionally

#

you get it?

twin venture
#

yeah

#

like so?

tardy delta
#

could do that, or whenComplete, which is one method but looks ass when putting an if inside

twin venture
#

alright πŸ™‚

tardy delta
#

i think its time for me to start writing plugins again

#

was thinking of a custom items plugin

twin venture
#

nice

#

well there are allot of custom items plugin πŸ™‚

#

maybe do something (Timed items) ?

#

and in lore it will have expired time

tardy delta
#

timed items?

pseudo hazel
#

I guess they mean cooldowns?

twin venture
#

yes

#

timed items or cooldowns

tardy delta
#

ah

quaint mantle
#

Hi, my scoreboard (tablist) is like overwriten by the scoreboard on the sidebar but I'm using the .getMainScoreboard() fot tablist. And .getNewScoreboard() for the sidebar one. Its the same scoreboard then?

pseudo hazel
#

a player can only have one scoreboard

#

the main scoreboard is the one vanilla uses when you use commands

quaint mantle
#

but then how its possible to set tablist and sidebar score

pseudo hazel
#

and any new scoreboard is one you have to set to pthe player manually

#

you add another objective

quaint mantle
#

ohh okay

pseudo hazel
#

each objective has the display property

#

this allows you to reuse the teams and stuff that are on that scoreboard across multiple displays

#

which is good for scores but terrible for anything else πŸ˜›

quaint mantle
#

hahdha

#

let me try

#

thanks mate

#

works fine thanks

hearty sparrow
#

I need some ideas. I want to create some custom entity event like EntityExtinguishEvent. I got a packet listener and got all the logic working. The only problem i am having it that if there are multi players around of course the packet will be send to every player so the event will also be ran mutliple times. Any idea how to fix this issue? A list of all the packet that have been done i think will work but doesn't sound as a great idea.

pseudo hazel
#

depends on what the event is actually doing

hearty sparrow
#

EntityExtinguishEvent, EntityMoveEvent and prod more later

drowsy helm
#

What packet are you listening to

hearty sparrow
#

ClientboundSetEntityDataPacket

drowsy helm
#

You should only really be listening to server bound packets if it’s an event thing

hearty sparrow
#

and ClientbounadMoveEntityPacket

drowsy helm
#

Well for one it will solve the issue you’re having, and it follows SRP

twin venture
#

hi, how would i make it so if i click on an item in a gui , it will listen to the chat async event and it will close the inv , and if i type for example rare , it will take that word only , and use it in the code

drowsy helm
#

albeit an abstract interpretation, but still SRP

twin venture
#

i am doing that , but for some reason the inventory is not closing

hearty sparrow
twin venture
#

iam already registered it

drowsy helm
#

Serverbound gets sent once no matter how many players there are

hearty sparrow
#

plus i kanda need the ClientboundSetEntityDataPacket for the EntityExtingushEvent

drowsy helm
#

You shouldnt be relying on the fact that there are players online for it to work

twin venture
#

nothing happens when i click on it :

drowsy helm
#

In a hypothetical situation where there are no players online, it should still be invoked

drowsy helm
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.

twin venture
drowsy helm
#

Mb

twin venture
#

this is the code πŸ™‚

#

its oky

hearty sparrow
twin venture
#

it should :

  • close inv
  • listen for chat
  • take the word from the chat i type for example (iam editing the rarity of the kit) so i type RARE
  • it set it RARE to the rartity of the kit
drowsy helm
twin venture
#

yes

drowsy helm
#

See no reason why it wouldnt close

twin venture
#

bcz when i click on the item , and type cancel

#

it send in chat Canceled

drowsy helm
drowsy helm
#

In a runnable

hearty sparrow
drowsy helm
#

You should only need one

#

If theres something you have to check per player, iterate over a map

#

More listeners is just more hoops the packet needs to jump through, could cause lag

hearty sparrow
#

This is my current setup. It work with player event only but i want to make some into entity event

#

So i will still need the multi packet listeners for the player events

quaint mantle
twin venture
fluid river
#

hi guys

#

i have a function

ternaryOperator(condition, resultIfTrue, resultIfFalse);```
#

which is used in this scenario:

drowsy helm
#

Uuuuh

#

Why

blazing ocean
fluid river
#
public static void main(String[] args) {
    Predicate<Object> condition = Objects::isNull;
    Function<Object, Integer> resultIfTrue = obj -> 0;
    Function<List<Integer>, Integer> resultIfFalse = List::size;
    Function<List<Integer>, Integer> safeListSize = ternaryOperator(condition, resultIfTrue, resultIfFalse);
    List<Integer> list = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5));
    System.out.println(safeListSize.apply(list) + ", " + safeListSize.apply(null));
}```
#

i need to write this functions code: it should return resultIfTrue if condition is true and resultIfFalse if condition returns false

tardy delta
blazing ocean
#

not talking about the fun signature

fluid river
#
private static Function<List<Integer>, Integer> ternaryOperator(Predicate<Object> condition, Function<Object, Integer> resultIfTrue, Function<List<Integer>, Integer> resultIfFalse) {
    // code
}```
drowsy helm
#

Pls use generics

blazing ocean
#

this is such a java moment

fluid river
#

kind of test

blazing ocean
tardy delta
#

forgot the params of registerEvent

hearty sparrow
# blazing ocean what's that `event` dsl πŸ‘€

custom with kotlin

inline fun <reified T : Event> event(
    priority: EventPriority = EventPriority.NORMAL,
    ignoreCancelled: Boolean = false,
    crossinline callback: T.() -> Unit
): UndefinedListener = UndefinedListener().apply{
    API.plugin.server.pluginManager.registerEvent(
        T::class.java,
        this,
        priority,
        { _, event ->
            if (event is T) callback(event)

        },
        API.plugin,
        ignoreCancelled
    )
}
blazing ocean
#

and i thought reified needed to be inlined

#

yea ty!

fluid river
#

if somebody can help me with this shit i will at least understand what i'm asked to do xD

fluid river
fluid river
drowsy helm
#

I dont get what you’re having an issue with

ivory sleet
fluid river
#

idk what's going on and why i need fucntion/predicate

drowsy helm
#

Return condition ? resultIfTrue : resultIfFalse

sacred mountain
#

hi is it possible to add placeholderapi support to existing plugins that are on bungeecord?

tardy delta
#

why are you even writing that shit

ivory sleet
#

i mean u’d just use a boolean parameter and not a predicate since the boolean parameter is evaluated every time anyways

fluid river
sacred mountain
#

I'm using the TAB plugin, with TAB-Bridge, and i've created my own placeholders for my server core, but they will work on the standalone server but won't display on a message sent through the proxy

drowsy helm
#

Well you need an instance of Object to test predicate with

fluid river
fluid river
sacred mountain
drowsy helm
#

You cant lol

tardy delta
#
Predicate<List<?>> p = bool ? ifTrue : ifFalse
var res = p.test(obj)

?

fluid river
ivory sleet
#

Nukerfall you can parameterize Object tho

#

to T

fluid river
ivory sleet
#

why?

#

It expects exactly Function<Object,R>?

fluid river
#
public static void main(String[] args) {
        
        Predicate<Object> condition = Objects::isNull;
        Function<Object, Integer> resultIfTrue = obj -> 0;
        Function<List<Integer>, Integer> resultIfFalse = List::size;
        Function<List<Integer>, Integer> safeListSize = ternaryOperator(condition, resultIfTrue, resultIfFalse);
        
        List<Integer> list = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5));
        
        System.out.println(safeListSize.apply(list) + ", " + safeListSize.apply(null)); // should return "5, 0"
    }

private static Function<List<Integer>, Integer> ternaryOperator(Predicate<Object> condition, Function<Object, Integer> resultIfTrue, Function<List<Integer>, Integer> resultIfFalse) {
    // code
}```
#

i am only allowed to change code of the function

ivory sleet
#

that’s dumb, but alright

twin venture
#

hi iam working on a kit system for now :

  • kit are stored in database
  • kit are loaded from database
    ...
    in this case i have made a editing menu for the kit, so i can edit it in 1 server , and it should save the editing and push it to all servers connected to same database
fluid river
twin venture
#

is there a better way?

fluid river
drowsy helm
twin venture
#

i mean the other server need to restart?

#

or it will auto get the updates?

drowsy helm
#

Just update the other servers cache

ivory sleet
twin venture
#

oh how i can do that?

fluid river
#

so other servers update their current kit set

twin venture
#

and use redis maybe?

ivory sleet
#

redis is one way, I mean do you wanna centralize around redis?

drowsy helm
#

Redis is a bit overkill

twin venture
#

i don't want too ..

ivory sleet
#

What database ru using?

twin venture
#

i just want it to be editable in lobby , and in game servers it will auto get updates

#

mysql for now

ivory sleet
#

yk u can write a really duct taped pubsub with mysql

#

I think luckperms does that for instance

twin venture
#

How so?

ivory sleet
#

if you wanna communicate across different servers instead of relying on redis

drowsy helm
#

Mypubmysub

twin venture
#

yeah i want that

#

if i decided to use redis , will it be overkill?

#

or is it alright?

#

for performance ?

sacred mountain
#

isn't redis for synchronisation

twin venture
#

it will only push updates when i edit the kit

sacred mountain
#

of data

drowsy helm
#

Performance is good

sacred mountain
#

across servers

twin venture
drowsy helm
#

But sorta overkill for the usecase

sacred mountain
#

a lot of my plugins have used it before.

ivory sleet
#

I mean I only use redis if I need its caching capabilities, but like, I hate having to depend on multiple cache layers, it always make the application so complex due to the nature of caching

drowsy helm
#

Like how often are you gonna be editiing kits?

sacred mountain
#

Very overkill though for a 3 server network with mongodb and redis lol

twin venture
#

often lets say

drowsy helm
#

Well if you see yourself using it in the future go for it

twin venture
worldly ingot
#

Just feels like something you could definitely put in a YAML file or something. Or even defined in source. You'd just have to reboot your servers when games are done :p

drowsy helm
#

Can always reuse the redis server for pther purposes

twin venture
#

for arena updates push

twin venture
#

or game servers

#

and copy paste the .yml files

worldly ingot
#

Well that'd be why you have a proper deployment system

#

One that copies files from a git repository or something

twin venture
#

well its not a privite plugin , it will be public maybe ..

#

that's why i need to make it configurable and easy for the end user

worldly ingot
#

Then YAML is definitely the way to go - but the way another user sets up their server is up to them

twin venture
#

and keep in mind performance

worldly ingot
#

Storing kits in databases is probably less performant than just reading from disk. Doesn't require an internet connection

ivory sleet
twin venture
#

yeah i thought about it , bcz when ever a game server is started it will connect to database and it load kits from there ..

#

that will be really overkill if for example i have 64 game servers running

#

(skywars games) ..

drowsy helm
#

Maybe host an AWS ec2 instance to run a kit manager which stores kit data on a bucket

twin venture
#

as i said its public plugin in the future that would not do it ..

tardy delta
#

money 😿

drowsy helm
#

Then proxy with clpud tunnel, using graphql

sacred mountain
#

It allows me to use most data storage

twin venture
sacred mountain
#

i thank my past self for doing that because i would never have the motivation today

ivory sleet
#

but Killer, if this is a public software application, you’re gonna have to demand customers and clients to use proper service tools like a proper database service and a proper message broker service etc if they’re gonna have 64 servers running concurrently

sacred mountain
#

i think it supports like almost every file format i can think of

#

and even custom syntax for custom file formats lmfao

#

idk what i did with my life back then

drowsy helm
#

Just fucking with you lol

ivory sleet
#

I mean for configurations, look what choco said

#

that’s an elegant solution

worldly ingot
#

There's a reason we call them configuration files :p They're for configuration. To configure the plugin

ivory sleet
#

else I mean there’s plenty of people that shove their configs in a database, altho I wouldn’t personally recommend that

worldly ingot
#

Databases are persistent storage, not for configuration

#

Reconfiguring a database table just seems like a massive pain in the ass

ivory sleet
#

yea lol

twin venture
#

so :

  • database for configuration= bad
  • config file for confiugration = good
worldly ingot
#

Basically yes :p

twin venture
#

ah thats really painful to edit the system again πŸ™‚

tardy delta
#

i believe rad puts configs in a db

worldly ingot
#

I can't get into specifics for obvious reasons but if it's any reassurance, Hypixel has text-based configuration files that we can deploy to all the servers - the servers just reboot

icy beacon
#

that's only valid if you are doing some extreme kubernetes shit or something

twin venture
#

so from what i understand , when ever a game server restart it will get the new confguration files from the deploy system?

worldly ingot
#

Yeah. That's not an uncommon setup. Pretty much every large server I've worked for has had a similar setup

drowsy helm
#

Deployment systems are a whole other bucket of worms

twin venture
#

can i use Redis to do the Deployment part?

#

or what service i should use?

worldly ingot
#

One server I worked on just had a script that did git pull every 30 seconds or so and the server startup scripts did a copy/paste from that dir into the server dir

drowsy helm
#

I would recommend staying away from redis for public plugins

worldly ingot
#

It was a bit janky but it had the same concept

#

Could have definitely been improved with web hooks and an actual CI/CD setup lol

twin venture
#

oh so i should not use redis ..

#

then how would i do it ..

worldly ingot
#

I mean if you need Redis you can use Redis.

#

But it's just one more thing your prospective users would require to use your plugin

drowsy helm
#

It’s hard enough getting users to setup a database

misty ingot
#

guys guys real question

#

spaces or tabs

twin venture
#

any alternative?

tardy delta
#

spaces

icy beacon
tardy delta
#

people that use 8 spaces for a tab have to die

worldly ingot
#

Well like I said, if you need to use a message broker, you can use Redis. It depends on what you're doing though. You're just making a SkyWars plugin or something right? Or Kit PvP? What's the goal?

drowsy helm
#

Born to use tabs, forced to use spaces

fluid river
#

alr i got an updated version

misty ingot
#

i use tabs always

fluid river
#
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Predicate;

public class Main {

    public static void main(String[] args) {
        Predicate<Object> condition = Objects::isNull;
        Function<Object, Integer> resultIfTrue = obj -> 0;
        Function<List<Integer>, Integer> resultIfFalse = List::size;
        Function<List<Integer>, Integer> safeListSize = ternaryOperator(condition, resultIfTrue, resultIfFalse);
        List<Integer> list = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5));
        System.out.println(safeListSize.apply(list) + ", " + safeListSize.apply(null)); // should return "5, 0"
    }

    static <T, U>Function<T, U> ternaryOperator(Predicate<? super T> condition,
            Function<? super T, ? extends U> ifTrue, Function<? super T, ? extends U> ifFalse) {
        // code which should return ifTrue if condition returns true and isFasle when condition returns false
    }
    
}```
misty ingot
#

except if its yaml then i use spaces for some reason

twin venture
fluid river
#

how tho

twin venture
#

its hard , and sometimes i feel its impossible .. but i try to do my best ..

worldly ingot
#

I guess you're wanting to add a way to transfer people from server to server via command, sign, or NPC or something? That's your justification for Redis?

drowsy helm
#

Nuker that function cant be complete

worldly ingot
#

Or what's the reason for Redis?

drowsy helm
#

It needs an object instance

#

Or not to be static

pseudo hazel
twin venture
#

to send users from game-server to lobby

worldly ingot
#

Okay, so what if a server doesn't use Redis to transfer players between their servers? πŸ‘€

twin venture
#

and also send arena game updates to the lobby server

worldly ingot
#

^ That's at least somewhat reasonable

fluid river
tardy delta
#
return in -> condition.test(in) ? ifTrue : ifFalse```
#

or smth

twin venture
icy beacon
drowsy helm
twin venture
icy beacon
#

?pmc

worldly ingot
#

A Redis server is a fine dependency then, but what if your users don't really have Redis or don't even want to know that sort of information. What if they're using something else to distribute their players? What if they just use BungeeCord messaging (which is a suitable way to transfer players).

fluid river
#

not like it's going to change anything, i'm just trying to figure ot how to solve this

icy beacon
twin venture
worldly ingot
icy beacon
#

you can send arbitrary data between servers and bungeecord via PMC

tardy delta
#

dont use bounds

twin venture
#

alright thanks , this was really helpful πŸ™‚ iam gonna make a second system for that

icy beacon
drowsy helm
#

Has tilo return ? Extends T

#

And u

icy beacon
tardy delta
icy beacon
#

there's a predicate but nothing to invoke it on

#

unless i'm blind

tardy delta
#

look at the return type of the method

icy beacon
#

ohh

tender stump
#

anyone help me I want spigot server.jar I need help

fluid river
#

maybe that's what i should test on idk

icy beacon
#

?bt

undone axleBOT
icy beacon
#

here are the instructions

icy beacon
drowsy helm
#

Wait thats stupid

#

Who is writing this code

tardy delta
#

||nothing is illegal if you dont get caught||

tender stump
icy beacon
icy beacon
fluid river
#

no clue

icy beacon
#

all you need is java installed on your pc

drowsy helm
icy beacon
tardy delta
#

@fluid river my solution without the generic bounds?

sacred mountain
#

God i'm so confused right now.
I'm using placeholderAPI and TAB as dependencies for my plugin. (The placeholder expansions above show my plugin (vlands) to be loaded)

The command works for placeholderapi (try #1)

Then I try with TAB (bungeecord install), and it doesn't work (shown in ss)

THEN i simply just retype the command and it works...?? (also screenshotted)

no clue whats up, and my messages in the config file don't replace either.

#

Like it only works second try

#

and i have no clue why

oh and furthermore: it will only work on the second try with the EXACT same placeholder, if i change a letter, it won't work till i rerun the command again

icy beacon
tender stump
icy beacon
#

cmd.exe

#

or powershell

#

or whatever floats your boat

#

maybe you're using linux

#

you'e rnot

tardy delta
#

probably works fine on wsl too

icy beacon
#

dude is not using wsl

tardy delta
#

but imagine being a windows user

icy beacon
#

nuh uh

fluid river
#

return in -> condition.test(in)? ifTrue.apply(in) : ifFalse.apply(in);

#

that's the answer

#

xD

drowsy helm
#

You’e r

icy beacon
#

as you acn sees here

tardy delta
drowsy helm
#

Nah new english

#

I like it

icy beacon
fluid river
icy beacon
#

ghix is wnhasy i gedt

#

"this is what i get"

fluid river
#

returned 5, 0 somehow

tardy delta
#

ah wait

#

its in the lambda

fluid river
#

yez

tardy delta
#

yea that works

drowsy helm
#

It’s like a coding riddle

tender stump
tardy delta
#

install it

pseudo hazel
#

im sorry but wtf am i looking at

tender stump
#

I think git means git file

tardy delta
#

git is a program

drowsy helm
#

Syntax so cursed it’s like it’s another language

tender stump
icy beacon
#

java -jar BuildTools.jar --rev 1.21 iirc from memory

#

that's literally it

tardy delta
#

lemme run buildtools again after two years uwu

#

?bt

undone axleBOT
drowsy helm
pseudo hazel
#

yeah usually I let paper run it for me 😎

icy beacon
pseudo hazel
#

xD

sacred mountain
#

i'll get the code rq

tardy delta
#

someone broke the #linux link?

pseudo hazel
#

I mean I like spigot and paper both but for different reasons

tender stump
tardy delta
#

πŸ’€ πŸ’€

#

can we all guess what he asked?

icy beacon
#

send screenie

sacred mountain
icy beacon
#

stop bothering with the cli

sacred mountain
#

it's just a placeholderapi expansion, nothing special

pseudo hazel
#

"how to git gud"

icy beacon
tender stump
#

it runs buildtool

drowsy helm
#

Phone formatting 🧌

tender stump
#

now what

icy beacon
sacred mountain
icy beacon
#

after it finishes running you'll have a spigot jar

#

in the directory that you ran buildtools in

river oracle
icy beacon
river oracle
#

You select your version

#

You click build

pseudo hazel
#

wasnt there an issue with th gui build they did?

tender stump
icy beacon
sacred mountain
icy beacon
#

you requested a spigot jar

#

buildtools creates a spigot jar

#

what the fuck do you want

sacred mountain
#

I truncated it to only include the ones i showed in the screenshots

#

Basically the placeholder works with placeholderapi etc, but when i try use TAB's parse command it doesnt work the first time, but does the second lol

pseudo hazel
icy beacon
#

it LITERALLY tells you what to do

tardy delta
#

dunno what people fine difficult

pseudo hazel
#

so yeah, its the button labeled compile

icy beacon
#

imma build spigot 1.11.1 rq

drowsy helm
sacred mountain
icy beacon
#

nvm it fails gonna build 1.18 then

blazing ocean
drowsy helm
#

Code looks fine unless getCeneteredMessage is doing something funky

sacred mountain
blazing ocean
#

ls -l mentioned 🀒

sacred mountain
#

i tried a raw message of literally just returning a hardcoded string

blazing ocean
#

eza better

sacred mountain
#

and it still would only return it on the second try

drowsy helm
#

Can you show the method

sacred mountain
#

it's doing my head in

tender stump
sacred mountain
tardy delta
#

2min 25seconds, wondering if that went fast or not

blazing ocean
#

(all secrets are encrypted :))

pseudo hazel
#

you;re a secret

blazing ocean
#

real

pseudo hazel
#

now get encrypted

tardy delta
#

whatz eza

blazing ocean
#

ls alternative

#

icons and shit

tardy delta
#

who even needs icons

#

only nerds do

blazing ocean
#

they look hot

tardy delta
#

no

drowsy helm
blazing ocean
#

it has a eza --tree

icy beacon
tardy delta
#

i have tree

blazing ocean
#

normal tree sucks

sacred mountain
#

I copied it from a thread a while back, cba to make my own

#

It works though.

#

Never had a problem using it, and it works using the /papi parse command so I don't think it's my method

tardy delta
#

i only need tree and fzf

blazing ocean
#

fzf mentioned

tardy delta
#

whats bad about this

blazing ocean
#

i mean if you already use zoxide might as well use eza

sacred mountain
#

ChatColor is deprecated so i could try change that from

message = ChatColor.translateAlternateColorCodes('&', message);```
```java
message = LegacyComponentSerializer.legacySection().serialize(Component.text(message))```
blazing ocean
tardy delta
#

nerd

blazing ocean
#

show neofetch

tardy delta
#

uh oh

icy beacon
#

do you happen to be using paper

robust ginkgo
#

Are Player objects still accessible after a player left?

blazing ocean
#

also what is that prompt smh

sacred mountain
sacred mountain
#

This isn't completed, it's my testing plugin

tardy delta
#

pop os moment

blazing ocean
#

what colour scheme is that

#

gruvbox

blazing ocean
#

paper deprecates chat colours

sacred mountain
#

yes i know

#

But it works that's not the problem

#

It works apart from when it's sent the first time which is kind of an issue

#

the only thing i can think of is something is like caching these placeholders idk

twin venture
#

so , i think iam gonna go with .yml configuration file and when i edit or save the kit i will use redis to push the updated kit to the other servers

sacred mountain
#

I might just like make my own tab plugin at this point

#

I'd rather have optimal compatibility than flashy hex colours

tardy delta
#

just wondering, i dont see any links above, they are below?

sacred mountain
#

yup it works no problem on the paper server :(

tardy delta
#

might not have fully read it

blazing ocean
#

?bt

undone axleBOT
blazing ocean
#

fuck you cf

#

i'm a human

tardy delta
#

where that

blazing ocean
#

sir are you blind

tardy delta
#

i mean i just look for a curl link and off i am

#

ah there, thought that was the bug tracker

blazing ocean
tardy delta
#

i sound like a rookie now

blazing ocean
tardy delta
#

it says to keep a watch on it for bug fixes and updates, sounds like a bug tracker to me lol

blazing ocean
#

😭

tardy delta
#

idk that site too long to read 🀣

blazing ocean
#

"i ain't reading allat" vibes

tardy delta
#

too much yapping, get me a damn url 🀣

blazing ocean
#

bud right click and copy link

sacred mountain
#

can anyone hop in vc and i'll show them what's happening lmao

#

Actually after i eat lunch

#

i'm famished

tardy delta
#

lol

icy beacon
#

just added 3 unsafe casts to my code

#

i'm a naughty boy

sacred mountain
#

my main api has like hundreds of warnings

icy beacon
#

lmao

#

surprisingly my plugin has almost no warnings in like 16k lines

#

except for some "unused" files (which i do in fact use), some deprecations, and now unchecked casts

tardy delta
#

as it should

icy beacon
#

yup

shadow shale
#

Heyho, I am developing a plugin right now using the AnvilGui API. I am using johnrengelman shadow plugin. But I just cant get it to run properly does somebody have an idea? (Gradle Kotlin)

my gradle has the id for the shadow plugin
id("com.github.johnrengelman.shadow") version "8.1.1"
the maven repo for AnvilGui

maven("https://repo.codemc.io/repository/maven-snapshots/") {
    name = "codemc-snapshots"
}

and the dependency

implementation("net.wesjd:anvilgui:1.9.4-SNAPSHOT")

I first executed the shadowJar gradle, then I build it.

If I reload my server now I get this exception in the Listener class which uses AnvilGui

[15:09:25 ERROR]: [QuestSystem] Failed to register events for class com.schotzgoblin.listener.EditQuestListener because net/wesjd/anvilgui/AnvilGUI$StateSnapshot does not exist.

grim hound
#

Does anyone know how I could create a virtual server on Bungeecord?

#

It'd just need to be an empty, limbo server

sacred mountain
#

ight im back

#

anyone willing to help me sort my problem

quasi gulch
#

show your code

robust ginkgo
#

I'm not familiar with the yaml structure.
Could someone give me an idea of how I could access the username and message of every player that's currently in the elections section?

elections:
  uuid1:
    username: this_is_a_username
    message: "Making the world a better place!"
  uuid2:
    username: this_is_another_username
    message: "this_is_a_username sucks"
#

I thought yaml would be as simple as json.

quasi gulch
#

or so on

robust ginkgo
pseudo hazel
#

or just getConfig.getString("elections.uuid1.username")

young knoll
#
ConfigSection section = config.getSection("elections")

for each string key in section.getKeys(false)
 String username = section.getString(key + ".username")
 String message= section.getString(key + ".message")
robust ginkgo
#

Alright, I think I understand what's going on there! Thanks!

sacred mountain
#

I've admitted defeat and I am coding my own plugins from now on,

#

Talk about trying to get other people's code to work

lunar mica
#

1.21 Material deprecated?

#

Cannot resolve symbol "Material"

tardy delta
# robust ginkgo I'm not familiar with the yaml structure. Could someone give me an idea of how I...
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

young knoll
lunar mica
#

When I go to Check for updates and download latest version it shows "Current version of InteliiJ IDEA is installed. Do you wish to continue?"

pseudo hazel
#

what version do you have

lunar mica
#

2024.1.3 if this is what you mean

pseudo hazel
#

hmm

#

and is the minecraft plugin up to date?

#

like minecraft development

lunar mica
#

How can I check that? I just switch maven import from 1.20 to 1.21 and compiler throw some errors

pseudo hazel
#

try invalidating caches then maybe

blazing ocean
#

make sure you're using java 21

pseudo hazel
#

File -> Invalidate Cache

lunar mica
#

Yea its working, thanks guys @pseudo hazel @blazing ocean ❀️

#

Also @young knoll (sorry ping) πŸ˜„

shadow night
#

Like minestom or something

grim hound
#

nah

#

like you create a fake server on the proxy itself

shadow night
#

Sounds like something doable with minestom

grim hound
river oracle
#

What minestom is excruciatingly lightweight

#

It's definitely not insane

grim hound
#

as performant as possible

#

but since they don't use netty I have no idea how to optimize my packet hackery

river oracle
#

Go in their discord and ask around

grim hound
#

like sending a lot of packets

river oracle
#

Never to late to learn something new

grim hound
#

yeah I know

#

but another thing is that i'm worried about version translation

#

since ViaVersion doesn't support Minestom yet

river oracle
pseudo hazel
grim hound
river oracle
grim hound
#

but on Via's discord they said to not use it because translation accuracy is lesser

#

and if they use ViaBungee, they can't use other Vias on other spigot servers

#

another thing is that while minestom is fast af, it's packets still need to go through bungeecord

#

as a mediocre

#

so I thought it'd be better to just create a fake server on bungeecord itself

grim hound
#

to inform the minestom server how to handle the player

#

@river oracle what do you think?

quaint mantle
#

builder

grim hound
grim hound
#

minestom

#

how

#

to

#

do

blazing ocean
#

minestom
gg

lethal coral
#

How far are you trying to support

grim hound
lethal coral
#

Could try vialoader in a proxy plugin

#

Someone in the minestom discord implemented it before

grim hound
#

so you think creating an actual minestom server is better than a fake server on bungee?

lethal coral
#

What're you trying to do

grim hound
#

a limbo server

#

a waiting server

lethal coral
#

Hmmm

grim hound
#

for my antibot

#

so needs to be performant

#

cuz the spigot version is great

lethal coral
#

I think it'd be more worth your time than creating a fake server on bungee

grim hound
#

where can I test this stuff for free?

#

do I make a bungee on my pc somehow?

lethal coral
#

You could setup a little localhost neteork

grim hound
lethal coral
#

Just how you would any other localhost

dawn flower
#

what's a good way to make block displays not die

robust ginkgo
#

If I call getDefaultSection on a configurationsection, will it turn back to the same section from the default config?

blazing ocean
#

they cannot die

dawn flower
#

despawning, Entity#remove, etc

blazing ocean
#

and wdym not die

dawn flower
#

just.. not die

ripe falcon
#

I have a problem with the lastest version of spigot 1.21 (it worked yesterday...):
Caused by: java.lang.IncompatibleClassChangeError: Found class org.bukkit.inventory.InventoryView, but interface was expected

#

do someone know why ?

blazing ocean
dawn flower
#

just not die

#

Entity#remove wont work on it

blazing ocean
#

WDYM 😭

#

so you want it to not be able to get removed

dawn flower
#

yes

blazing ocean
#

so Entity#remove won't work

dawn flower
#

pretty much

#

yes

blazing ocean
#

there's an event

echo basalt
#

Any idea how to make an entity not persist? I call setPersistent(false) and override shouldBeSaved on NMS but it's still saving

dawn flower
#

that isn't cancellable

blazing ocean
#

fork spigot ig

dawn flower
#

:-:

blazing ocean
ripe falcon
# kind hatch

yes but what do I need to change in my code as I'm just using InventoryClickEvent#getView()#getTitle()
(and I am not importing InventoryView anywhere with "import")

dawn flower
#

if you make a custom entity in nms, can you override the way it gets despawned or deleted

slender elbow
echo basalt
#

nuking the entity during Chunk unloads causes nasty exceptions too x)

#

Anything I can do by overriding save?

echo basalt
dawn flower
#

ok

lone jacinth
robust ginkgo
#

What's the best unit of time to store? Seconds or ticks?

kind hatch
#

Seconds

chrome beacon
#

Depends on the usecase

twin venture
#

how i can create InstanceCreator ?

twin venture
#

its abstract class..

tardy delta
#

instantiate your KitImpl?

twin venture
tardy delta
#

ig gson simply needs to create an instance and it then sets the fields

#

i forgot how it works

twin venture
#

that's the actual error

tardy delta
#

just register an instance creator that returns a SkywarsKitImpl with default values?

twin venture
#

can i do that?

tardy delta
#

i dont know if it will be able to set final fields

#

i mean you can try, i usually deserialize all that stuff manually as reflection always breaks

twin venture
#

alright thanks

tardy delta
#

oo more streaming

twin venture
#

fixed it πŸ™‚

tardy delta
#

couldnt you also like add a JsonDeserializer<SkyWarsKit> and JsonSerializer and call registerTypeAdapter?

#

that one does have the value of the object, and the received json object

blazing ocean
#

ktx.serial + kaml ❀️

acoustic pendant
#

Hey, i'm trying to get if a player is connected to a proxy via messaging, but it didn't work...

Could someone tell me what am i doing wrong?

#

sending code 1s

#

Then i'm requesting it like this:

twin venture
#

What do you think is the best way to do it ?
add another value called :
kit_mode: solo

or keep the current system?

tardy delta
#

add that value

#

acts like a union discriminator

blazing ocean
#

me when the union gets discriminated

slender elbow
#

discriminated unions πŸ™

tardy delta
#

if only java had those

slender elbow
#

it does

#

it's called sealed classes

tardy delta
#

its just inheritance

#

was more thinking about value types

slender elbow
#

and a superclass with a restricted set of subclasses is a union type of any of those subclasses

#

record JsonObject
record JsonArray
record JsonNumber
record JsonNull
record JsonBoolean
record JsonString

sealed JsonElement permits ...

vs type JsonElement = (.. | .. | ..)

#

it is quite literally the same result, you still need to pattern match on the actual type, etc

#

the only difference is that the creator of those classes is the one providing the union type rather than you defining some typealias or w/e

versed canyon
#

I'm playing around with some of the new 1.21 blocks and was curious if there were any way to access the list of players that had looted a vault. I'm not seeing any way to access the player list, only to change the state of the vault.

silk mirage
#

What are some good GUI Library/Framework?

slender elbow
#

IF, triumph-gui, interfaces, your own

icy beacon
#

i love triumph-gui ❀️

upper hazel
#

i change java version to 16 in models, compiler why i getting this error records not supported in -source 14

chrome beacon
#

Take a look or make your own PR to the API if you want to help out

#

?stash

undone axleBOT
chrome beacon
#

?contribute

chrome beacon
remote swallow
misty ingot
#

🍌

blazing ocean
#

@icy beacon you should try it

blazing egret
#

Hi all! I'm trying to create a plugin for exploding arrows, but for some reason the arrows don't explode, I'm attaching the code below. version 1.12.2
https://pastebin.com/CUrxKBPk

icy beacon
blazing ocean
dawn flower
#

'org.bukkit.event.entity.EntityRemoveEvent' is deprecated and marked for removal what do i do?

dawn flower
chrome beacon
#

And also you're never adding the metadata which is why it's not working

blazing egret
chrome beacon
#

Use PDC

#

?pdc

blazing egret
#

thanks

chrome beacon
river oracle