#help-development

1 messages · Page 1174 of 1

timid berry
#

maybe its

#

addItem(0, icon);

quaint mantle
#

you meant the position in invernetory?

#

when asking for help you need to clarify the issue properly

timid berry
#

yah i got it this was it

#

addItem(0, icon);

pure dagger
#

@chrome beacon ?

chrome beacon
pure dagger
#

but i didnt use it, u Just did save default config method at the on enable

#

but then i tried to acces something which i deleted and there was the value

blazing ocean
pure dagger
#

maybe i missed something?

pure dagger
quaint mantle
chrome beacon
#

Though it's been quite a while since I last used that part of the api

timid berry
#

how come it does not teleport or respawn me where i want it to

blazing ocean
timid berry
burnt sentinel
#

there's a respawn event

timid berry
#

but it doesn;t work

#

player.teleport(mark) works

#

but event.getplayer().setrespawnlocation(mark);

#

does not work

pure dagger
#

even though i deleted all contents in config

slender elbow
chrome beacon
#

You can just define your own config

#

instead of using the builtin getConfig

#

?configs

undone axleBOT
timid berry
#

like this?/

#

or should i just teleport them

worldly ingot
#

Well, yeah, use the event's setRespawnLocation(), not the player's

#

event.setSpawnLocation(whatever)

glass mauve
#

why does the BuildTools download PortableGit even though I have git installed?

sullen marlin
#

Git might not be in your path so it can't find it

glass mauve
#

it should be, I can use it in my console just fine đŸ€”

#

is that even the correct spot it should point to?

worldly ingot
#

I think it actually downloads PortableGit for me as well even though I very much have git installed

#

Lemme rerun BT to double check that. I just assumed it always used PG

#

Nah seems fine. Didn't download. The PG folder I had in the BT directory was from 2022 so maybe it just always downloaded in an older version. Seems to be using my Git for Windows version now

glass mauve
#

hm thats weird, I always noticed that it downloads pg even though I have git
never bothered until today, after downloading BuildTools again

glass mauve
#

its closed source right?

worldly ingot
#

It looks on your Path. Though I'm not sure why your path is set to Git\cmd. Mine is set to Git\bin

#

I guess ultimately it doesn't matter. There are git programs in both directories

#

?stash And no, BuildTools is open source on the stash as well

undone axleBOT
glass mauve
pure dagger
# chrome beacon alright then

but why there is no information, no where, about for example the reload method, that you have to reload to like, get the config from file to jar, then edit it and save to file again, is it obvious? because i dont get these things and cant learn

worldly ingot
#

Not sure I understand. Are you wanting to add your own reloadConfig() method?

#

Because all that does is call YamlConfiguration#loadConfig() again

glass mauve
#

well

#

this is weird

#

it doesnt have sh which is indeed in the Git\bin directory but not in Git\cmd

#

no idea if this might be unintended

frozen dust
#

Hi, can someone help me? I Have plugin named brewery And i want to sell these items. Is there any way to put these items into ShopGUIplus?

#

Like Custom items with Custom nbt tags

worldly ingot
#

That sounds like a question you should be asking the ShopGUIPlus developers about

#

I'm sure they have a support Discord or something to that effect

#

cc @frozen dust because it's been a few hours

echo tangle
#

i'm setting up an ssl certificate for a websocket to connect to a website, and i'm getting this error that a tag number over 30 is not supported. i'm honestly not sure what this is referring to. can anyone help?
error: https://paste.md-5.net/ukisomomux.md (my keystore is in the jks format)

sly topaz
sly topaz
# timid berry

sorry, what are you trying to do here? the whole convo seems to be cut up into various discussions lol

timid berry
#

(trying to set it to the hub at the start but when i die i end up somewhere on top of it)

sly topaz
#

though if it is obstructed by something (like the carpet, for example), it may refuse to respawn there

timid berry
echo tangle
sly topaz
#

did you try open it with kleopatra or something

sly topaz
echo tangle
#

i just looked at the data via terminal

sly topaz
echo tangle
sly topaz
#

try generating your keystore with keytool instead, which will directly generate the JKS keystore

#

whatever format you've converted from doesn't seem to be well-supported within the Java Keystore API

echo tangle
sly topaz
#

didn't use websockets because it'd have required a library but essentially the same deal

echo tangle
#

ahh it worked, thank you so much!!

#

i think it's because i didn't do the second -exportcert

sly topaz
#

but if it worked, then all is good

echo tangle
#

o

#

then maybe not

#

i have no clue why it didn't work the first time then, odd

#

but if it works it works

sly topaz
#

that cert you're supposed to import wherever you are supposed to accept the websockets so that they can trust your TLS connection

sly topaz
#

keytool -importcert -file websocket.crt -alias mycert -keystore "$JAVA_HOME/lib/security/cacerts" -storepass whatever for reference

#

you can also do it programatically but it is easier this way

timid berry
hybrid spoke
#

also dont set the respawn location, just directly teleport them

timid berry
fading drift
#

I have a friend accept command

#

but I want it to be able to work network wide

#

so how should I get a uuid from a player network wide

#

either get all players on every server and find the player and then get uuid

#

or do I save the name to the friend requests database

#

or do I lookup the uuid from the name every time using api

sly topaz
#

or was it another person who was doing that

#

if you don't, you can use plugin messages for that kind of thing

#

if you want it work even when players are offline then it'll be trickier though

fading drift
#

yeah I do but its so fucking annoying

#

like I dont want to write up a whole

#

get player packet

#

and handler

#

and all this shit

#

so I just decided to save the player's name to the database when the request is sent

#

also whats with this 15 more shit I cant even see the error

marsh lichen
#

I noticed when compiling a plugin with 1.21.3, I get this in older versions now. Any way of reflecting for older versions?

java.lang.IncompatibleClassChangeError: Method 'org.bukkit.Sound org.bukkit.Sound.valueOf(java.lang.String)' must be Methodref constant
river oracle
#

No exceptions

#

Otherwise going forward you'll be using so much reflection you might as well just class for name everything kekw

marsh lichen
#

useful as some servers are still stuck on 1.21.1

#

plus figured it out

#

this works i guess if someone else runs into the issue 😭

public static Sound valueOf(String soundName) {
    Method method = Sound.class.getMethod("valueOf", String.class);
    return (Sound) method.invoke(null, soundName);
}
timid berry
#

how can i throw an exploding tnt

#

on command

#

world.spawnEntity(Location,EntityType.PRIMED_TNT)

#

this spawns it

#

but how can i give it a velocity?

#

player.getWorld().spawnEntity(player.getLocation(), EntityType.PRIMED_TNT);

#

i mean this spawns tnt

#

but how do i set the tnt velocity

#

like if the player runs the command

#

a tnt should shoot out

sand marsh
#

is there a good wiki where I can find all the stuff like event listeners etc in one place?

#

having trouble finding an equivalent to the fabric wiki

timid berry
#

this ?

sand marsh
#

a javadoc is very helpful, but is there a more traditional wiki with steps anywhere?

#

stuff like how to make a command etc

echo basalt
#

?wiki

undone axleBOT
sand marsh
#

WOAH

#

thanks!

timid berry
#

player.launchProjectile(Snowball.class).setVelocity(new Vector(1,1,1));

#

chat i cant figure out anything like explodingtnt.class

pliant topaz
timid berry
#

TNTPrimed tnt = (TNTPrimed) player.getWorld().spawn(player.getLocation(), TNTPrimed.class);
tnt.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(4));

pliant topaz
#

so you can easily set it's velocity like you would for any other entity

timid berry
#

i see

#

is there a way to get the velocity of an arrow that a player shoots out from a bow?

timid berry
shadow night
timid berry
#

Do you know if it’s possible to give the item an enchanted look without giving it a real enchantment?

#

Like I wanna give it the look but I don’t want players to seee the enchant

shadow night
#

On newer versions there is a component that does that, on older versions you would give it something that doesn't affect it (e.g. aqua affinity to a sword) and hide it using the hide enchants iten flag

quaint mantle
#

does any1 know how do i make the kb/pvp of my spigot srvr like bedrock plz

proud badge
quaint mantle
mellow edge
glossy laurel
#

I want to make a Consumer, save it into a file somehow, then load the consumer from the file in my plugin and execute the code in it. How?

remote swallow
#

I'm getting xy

#

?xy

undone axleBOT
glossy laurel
pseudo hazel
#

you should use a format that the animation can be saved in

#

also wth is a win animation

#

do you have examples of consumers you would want to save?

slender elbow
#

Fortnite dances

glossy laurel
#

Imagine block schockwave

pseudo hazel
#

okay

#

any code examples?

#

like ideally for this kind of thing you would have to make your own format or reuse someone elses and then save the data to json or whatever

glossy laurel
#

imagine a one liner that shows particles

glossy laurel
pseudo hazel
#

i cant imagine

young knoll
#

Load them from blockbench animations

glossy laurel
dry fiber
#

i made enchanted item for my crate and I no longer have access to the reward menu

glossy laurel
pseudo hazel
#

well if its one line you can write the parameters in a json file

#

how is that limiting

glossy laurel
young knoll
#

You can’t really serialize code and load it later

glossy laurel
#

Now imagine you wanna make the player ride an ender dragon

young knoll
#

Well you can but it’s complicated

glossy laurel
young knoll
#

You need to make some sort of scripting system for your win animations

glossy laurel
glossy laurel
eternal oxide
#

Code resides in classes and to access a class it has to be loaded into your classpath, so saving and loading classes at runtime is not simple

pseudo hazel
#

you dont serailize code you serialize data to replicate the same behavior of the code

glossy laurel
pseudo hazel
#

its what I am trying to suggest

young knoll
#

Huh you can actually serialize lambdas

#

Wack

pseudo hazel
#

create a format that can store any way you can make those animations and then load them from the file when you wanna play it

eternal oxide
glossy laurel
pseudo hazel
#

whats the use of having custom animations if you have to hardcode them in

#

like what is the point of saving a consumer

glossy laurel
pseudo hazel
#

that consumer is just code thats written by you already, no need to save anything

#

okay then it would be a good idea to start thinking about how you do wanna program the animations then

#

because serializing consumers to a file sounds like hardcoding to me

young knoll
#

Blockbench won’t be enough if you want fancy stuff like riding an enderdragon

#

You’ll need a custom scripting system

pseudo hazel
#

sounds like they just want a particle system

remote swallow
#

Did some one say action config lib

glossy laurel
pseudo hazel
#

oh

#

well design the system for the most complex example

#

what would that be

eternal oxide
#

implement lua

young knoll
#

Skript

#

Kek

pseudo hazel
#

right now noone here knows what your usecase even is

glossy laurel
young knoll
#

Technically yes

glossy laurel
pseudo hazel
#

that defeats the point of serializing it

glossy laurel
glossy laurel
pseudo hazel
#

why serialize code you have already written

young knoll
#

You could rely on lambda serialization, tho it seems janky at best

glossy laurel
young knoll
#

Or do some wacky ASM stuff to inject single classes into the classloader

pseudo hazel
#

like whats the point of serializing a lambda thats been hardcoded anyways

#

the code is already part of the plugin

glossy laurel
pseudo hazel
#

since you wrote it for the plugin

glossy laurel
young knoll
#

“Generally speaking, the Java documents strongly discourage us from serializing a lambda expression. That’s because the lambda expression will generate synthetic constructs. And, these synthetic constructs suffer several potential problems: no corresponding construct in the source code, variation among different Java compiler implementations, and compatibility issues with a different JRE implementation.”

glossy laurel
#

Just fork Skript and hardcode the scripts into the source

pseudo hazel
#

for server owners to program server interactions

young knoll
#

Do you want the server owners to code their own animations?

pseudo hazel
#

but since you wanna serialize actual java code, only you would be writing that code

young knoll
#

Because if that’s the case just have them make an addon plugin?

pseudo hazel
#

so then why not just write it into the plugin itself

glossy laurel
pseudo hazel
#

well you would be the only one who writes your plugin I assume

remote swallow
#

Its not hard to just make a data file of a particle/effect

pseudo hazel
#

so who else would benefit from serializing a lambda

young knoll
#

Seems they also want stuff like riding entities

pseudo hazel
#

they would have to write the lambda themselves and then let it be serialized

#

so that your plugin can then read it again

remote swallow
#

You just make a json file that you parse to a class and store it in a registry

young knoll
#

Before too long scope creep turns it into libreforge

pseudo hazel
#

lmao

glossy laurel
remote swallow
glossy laurel
remote swallow
#

Gson adapters

glossy laurel
#

Wait, class, not object right

remote swallow
#

Gson will even do some internal stuff without adapters

remote swallow
pseudo hazel
#

its the same as a configuration

glossy laurel
young knoll
#

You just parse data into objects that you can use

remote swallow
#

Gson.toJson(dataClass)
Gson.fromJson(input, DataClass.class)

glossy laurel
#

So I can create an instance of a class and save it into json?

remote swallow
#

Yeah

pseudo hazel
#

you have a specific format for an object, and then json written in that format will be parsed as an instance of that onject in the code

young knoll
#

IE

type: DRIP_WATER
count: 5
interval: 2
glossy laurel
remote swallow
#

No

young knoll
#

No

pseudo hazel
#

no

glossy laurel
#

No

young knoll
#

You save variables, not code

pseudo hazel
#

you define how to parse it

#

you can at best have a few types of animations I guess and then pick a function that it will use

glossy laurel
#

And what if I have a class with a consumer field for example

pseudo hazel
#

but that means you already prewrote those functions

young knoll
#

No

#

Gson will just explode trying to serialize a consumer

glossy laurel
#

:D

#

Okay but I saw one plugin that accepted jars and allowed abilities

#

How did that work

young knoll
#

That’s just an addon system

slender elbow
#

in the same way you can add jars in the plugins folder and they'll be loaded as bukkit plugins

young knoll
#

You can easily allow other plugins to register a consumer for your system

#

IE: addWinEffect(name, Consumer<whatever> action)

glossy laurel
#

How hard is supporting addons?

remote swallow
#

i love server owners having to make a full plugin to register 1 effect instead of being able to make it with a data class/file

young knoll
#

Libreforge when

remote swallow
#

nah

#

action config lib>>

glossy laurel
young knoll
#

Shut

remote swallow
young knoll
#

It’s Eco’s system of data driven content

remote swallow
#

bring a competitor

sly topaz
young knoll
#

Idk how good it is tbh, I just know it exists

sly topaz
#

too flexible and you ultimately want a language for the effects, if it is not as flexible then it's fine to make in some kind of declarative/data-driven way

glossy laurel
young knoll
#

Wait

remote swallow
young knoll
#

Found it

remote swallow
#

this looks great

#

love me a good map list

sly topaz
glossy laurel
#

Javascript is better than java ong

sly topaz
#

I'd rather use a full-blown programming language rather than pseudo-effect yaml

glossy laurel
#

You can interpret code with it

#

Cuz as I understand serializing lambdas serializes the compiled code?

pseudo hazel
#

serializing lambda sounds like witchcraft

pseudo hazel
#

i imagine it would also have to serialize the context

#

which means it might read data from stuff that might not exist anymore

young knoll
sly topaz
#

Skript is the better choice when it comes to something like this

#

at least it is turing complete

pseudo hazel
#

I believe in the right tool for the job, for me it really depends what a configuration looks like

young knoll
#

It’s also an abomination

sly topaz
#

ideally I'd go for python but that isn't easy to just yoink inside a plugin

pseudo hazel
#

right now im working ona web editor so users can still quickly create the stuff they need without complex scripts

remote swallow
pseudo hazel
#

and I can save it as complex as I need it to be

glossy laurel
#

Java interpeter, how

sly topaz
#

concept-wise it is fine, it has some rough edges in the implementation but what can one expect from a plugin really

young knoll
#

They want too far to making it English-like

remote swallow
#

javaskript when

glossy laurel
glossy laurel
#

Okay

#

New plan

#

No more serializing lambdas

#

Ill just hardcode them in

#

F server owners

pseudo hazel
#

just make 100 effects

glossy laurel
pseudo hazel
#

or

#

have some kind of command that gets sent and configured so users can play their own effects from other plugins that do bother to have this customization

glossy laurel
#

Overrated

blazing ocean
#

You know

#

I'm working on integrating Kotlin scripting

#

into Bukkit

#

#general message

young knoll
#

Is that just java code

#

But compiled at runtime

blazing ocean
young knoll
#

Yeah but like

#

Is Kotlin script just java code compiled at runtime

#

Or I guess

#

Kotlin code compiled at runtime

blazing ocean
young knoll
#

Shame it isn't java code

#

Then it would be

#

Java Script

remote swallow
#

java skirpt

young knoll
#

I wonder how hard that would be to make

#

With ASM

blazing ocean
#

Why ASM

slender elbow
#

jshell moment

remote swallow
#

kshell when

blazing ocean
#

Kotlin REPL exists

young knoll
#

Idk what a jshell is

#

or a kotlin REPL

remote swallow
#

you dont know what jshell is?!?

young knoll
#

Do I look like a programmer to you

remote swallow
shadow night
young knoll
#

So it's just

#

Python java

#

kek

worldly ingot
#

It's a REPL for Java lol

remote swallow
worldly ingot
#

It was added in Java 9. Keep up, Coll

young knoll
#

And ur banned

remote swallow
#

dont tell nuclear

shadow night
#

How does that work internally

worldly ingot
#

Magic

slender elbow
#

yeah that isn't an easy question to unpack

#

fortunately for you jdk is open source

shadow night
remote swallow
#

@young knoll

young knoll
#

Okay but can I use it as a scripting system

slender elbow
#

sure, it has an api

shadow night
#

Damn

worldly ingot
#

Em, please use Java 22 docs. The sidebar makes me upset

slender elbow
#

it's amazing, what are you talking about

worldly ingot
#

Yes amazing

#

30% of my screen just gone

slender elbow
#

there is a solution to this it's called super ultra wide

worldly ingot
#

That was my nickname in high school :(

shadow night
slender elbow
#

I thought you were Canadian, not American

worldly ingot
#

oof

#

I've lived in the US for 3 months and have an apartment there

#

Does that count?

slender elbow
#

sure

worldly ingot
#

YEAHHHH

#

I'M 'MURICAN!

slender elbow
#

meter

grave kayak
#

I have made a custom placeholderapi placeholder %sakuratags_tag%, but i cant get it to work in essentials chat. I've registered the placeholder via PlaceholderAPI, and it works in chat with /papi parse, but EssentialsChat still displays it as plain text. Any advice appreciated!

slender elbow
#

pretty sure EssentialsChat doesn't support PAPI

#

last time I checked they have their own fixed set of placeholders you can use in their config and that's it; it might have changed since then but I doubt it

remote swallow
quaint mantle
worldly ingot
#

I have to hide it each time I open the docs

remote swallow
#

dam

sly topaz
fading drift
#

please anyone with prior experience with jedis pub/sub I have been trying to deal with this absolutely atonishing bug for almost 3 hours

sly topaz
#

could make an userscript that sets the default state to hidden, but I don't like userscripts

undone axleBOT
#

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

remote swallow
fading drift
#

I have this in my matches plugin

#
        redisManager.subscribe(new RequestEnabledMapsHandler(), "requestEnabledMaps");
        redisManager.subscribe(new RequestLoadedMapsHandler(), "requestLoadedMaps");
        redisManager.subscribe(new SetupMatchPlayerHandler(), "setupMatchPlayer");
        redisManager.subscribe(new RequestMatchHandler(), "requestMatch");```
#

and then I get

#

first of all I don't know why it says RequestEnabledMapsHandler received the message because I sent the message to the setupMatchPlayer channel

#

second of all this error provides me with absolutely no information

#

I have no idea what is wrong

#

but it should be executing this code:

#
    @Override
    public void onMessage(String channel, String message) {
        JsonObject jsonObject = gson.fromJson(message, JsonObject.class);
        if (jsonObject.get("request").getAsString().equals("setupMatchPlayer")) {
            handleSetupMatchPlayerPacket(message);
        }
    }

    private void handleSetupMatchPlayerPacket(String message) {
        JsonObject jsonObject = gson.fromJson(message, JsonObject.class);
        JsonObject dataReceived = jsonObject.get("data").getAsJsonObject();

        SetupMatchPlayerPacket packet = new SetupMatchPlayerPacket(dataReceived.get("matchId").getAsInt(),
                UUID.fromString(dataReceived.get("player").getAsString()));

        Bukkit.getScheduler().runTask(XinCraftMatches.get(), () -> {
            XinCraftMatches.getMatchManager().getSpawnLocationHandler()
                    .awaitingJoin.put(packet.getPlayer(), packet.getMatchId());

            JsonObject json = new JsonObject();
            json.addProperty("response", "setupMatchPlayer");
            JsonObject data = new JsonObject();
            data.addProperty("successful", true);
            json.add("data", data);

            // Publish the response to a Redis channel
            XinCraftMatches.get().getRedisManager().publish("successfullySetupMatchPlayer", json.toString());
        });
    }```
#

and then sending a json response with value true on successfullySetupMatchPlayer channel

#

this is code from my lobby

#
    public CompletableFuture<Boolean> setupPlayer(int matchId, UUID player) {
        SetupMatchPlayerPacket packet = new SetupMatchPlayerPacket(matchId, player);
        CompletableFuture<Boolean> future = new CompletableFuture<>();

        // Subscribe to the response channel
        JedisPubSub jedisPubSub = new JedisPubSub() {
            @Override
            public void onMessage(String channel, String message) {
                System.out.println("Received message during setupMatchPlayer: " + message);

                JsonObject json = gson.fromJson(message, JsonObject.class);
                if (json.get("response").getAsString().equals("setupMatchPlayer")) {
                    JsonObject data = json.get("data").getAsJsonObject();
                    future.complete(data.get("successful").getAsBoolean());

                    this.unsubscribe("successfullySetupMatchPlayer");
                }
            }
        };
        redisManager.subscribe(jedisPubSub, "successfullySetupMatchPlayer");

        // Publish the request
        packet.publish(redisManager);

        // Handle exceptions
        future.exceptionally(e -> {
            XinCraftLobby.get().getLogger().severe("Exception during setupPlayer: " + e.getMessage());
            return null;
        });

        return future;
    }```
#

System.out.println("Received message during setupMatchPlayer: " + message); and this doesn't even print

sly topaz
fading drift
#

I know but like its so difficult because even with all the context I cant figure it out

sly topaz
#

or even better, creating a MRE but you'd need to understand the bug itself to do that so it is eh, do your best lol

fading drift
#

really I am just looking for prior code I can try and compare and see what im doing wrong

sly topaz
fading drift
#

I think I figured it out but it just doesnt make sense

lilac dagger
#

jedis has a time out limit which i assume drops in the middle of reading

fading drift
#

I combined all my pub sub classes into one and just used a big if else chain

#

and it seems to be working fine

sly topaz
#

from a higher level perspective, it just looks like a data race

#

however that doesn't tell you much

fading drift
#

seconds

lilac dagger
#

the read time out

fading drift
#

the issue was that it was somehow registering pub subs to different channels than what I literally asked it to

lilac dagger
#

i see

#

yeah, that could be an issue

sly topaz
#

that doesn't make sense lol

fading drift
#

I know

#

its fucking killing me

sly topaz
#

was it solved tho

lilac dagger
#

may i ask, why do you use jedis instead of java sockets?

fading drift
#

half

sly topaz
fading drift
#

sockets wasnt working properly

#

couldnt figure out jedis origianlly

#

netty wasnt connecting properly

lilac dagger
#

sockets work for me just fine

sly topaz
#

that's really bad, if you start with one thing you should stick with it, otherwise you'll end up just rewriting your code a lot

fading drift
#

web sockets couldnt reconnect properly

#

or the library I used was garbage idk

#

and now jedis has issues

sly topaz
#

I mean, jedis is battle-tested software, so the most likely case is that you're using it wrong

fading drift
#

I've rewritten this code 5 times and its fucking pissing me off how I cant just get a consistently good approach to cross server communiucation

lilac dagger
#

all solutions must've worked for sure

sly topaz
#

did you take the time to take the redis university courses before delving into it, or did you just go straight ahead into the code?

fading drift
#

I went straight ahead with reading jedis docs

sly topaz
#

to use jedis you need it is important to understand redis itself, so that won't quite do if you don't have experience with these things

fading drift
#

still doesnt change the fact that I would run redisManager.subscribe(onesub, onechannel) and redisManager.subscribe(twosub, twochannel) it would go onesub recieved message from twochannel

sly topaz
#

I recommend slowing down and taking your time to get it right

sly topaz
#

nor have I used jedis to know if this is a normal pattern, I'm sure they got a discord server somewhere so it's probably better if you ask them what they think of your jedis usage

inner mulch
lilac dagger
#

redis should work as well tho :d

#

plus as javier said, better stick to one platform

floral drum
#

I love redisson

sly topaz
#

not related to the issue, but I got to add: if you're trying out some new framework/platform or any decently complex library, you are much better off trying it out in a separate, clean slate project

fading drift
fading drift
inner mulch
sly topaz
# fading drift yeah I probaly should but usually things work fine

issue is that there's many layers of learning when it comes to platforms like redis, you have to understand not only redis but the library that interacts with it in the given language, as well as adapting your design to whatever redis might be, which is just a lot of mental overhead when you're realistically only trying to do the last thing

lilac dagger
#

wow, you can send whole objects?

inner mulch
#

thats why its so good

lilac dagger
#

i mean, i don't mind using json myself

#

plus you can pretty much send any object with json

pure dagger
#

why is new NameSpaceKey(String, String) deprecated

spiral light
#

look at the note ^^

pure dagger
#

there is nothign about it being deprecated, but there is some api note

chrome beacon
pure dagger
#

so should i use it

spiral light
#

"API Note:
Should never be used by plugins, for internal use only!!"

or @internal

pure dagger
#

with NamespacedKey.MINECRAFT

chrome beacon
#

For what purpose

#

no

river oracle
#

Invalidated the entire goal!!

chrome beacon
#

NamespacedKey.minecraft() is a method

#

Use that

#

(I know the constant exists too)

chrome beacon
#

I was thinking of fromString instead of the constructor ngl

river oracle
#

I use that method though

#

It's way better

worldly ingot
#

Use the constructor so you don't have to parse a string lol wat

remote swallow
#

fromString supremacy

rough drift
#

Identifier.combine("namespace", "key")

blazing ocean
#

combine??

#

I still cant believe this is what mojank came up with

rough drift
#

idk I should use join or whatever

pure dagger
#

is
meta.getLore() != null
the same as
meta.hasLore()
?

rough drift
#

should be

pure dagger
#

oh

#

so its different i guess

#

because it cant be empty

#

idk

#

can you make a listener for all events possible?

spiral light
#

why should you do that ?

pure dagger
#

im curious

blazing ocean
#

I always wondered whether the event param could just be of type Event

quaint mantle
pure dagger
quaint mantle
paper viper
#

You don’t need that

#

Use ClassPath from guava

#

Built in

pure dagger
#

a

paper viper
#

Get current class loader, put it into ClassPath

quaint mantle
#

It's up to bro but doing that is extremely slow

paper viper
#

I mean it’s on load up probably so it doesn’t really matter

hazy parrot
#

As they don't have the handler list

blazing ocean
#

makes sense

rough drift
deft summit
#

Is there any docs on NMS packets? Like what packets there are and what they do? Cuz im trying to make a fake player spawn and I can't seem to find the right packets

blazing ocean
#

that's all prettym uch

deft summit
#

Perfect, thanks very much :3

slender elbow
#

is md5 a furry

river oracle
#

I'm sorry what

slender elbow
#

(courtesy of Emilia)

deft summit
#

huh xD

chrome beacon
#

EmilyGPT has begun hallucinating

quaint mantle
river oracle
orchid brook
#

Hi im making a backpack plugin,
Would a task that runs every minute, which retrieves each player’s inventory, checks if each item can be placed in the backpack, and, if so, removes the item from the inventory and adds it to the backpack, be very resource-intensive? Specifically, I’m concerned about whether iterating through every item in every connected player’s inventory would pose a performance issue.

river oracle
#

the world is basically ending after that

chrome beacon
#

If you're worried about performance that is a task that can be split

#

?workdistro

chrome beacon
#

Probably overkill though

slender elbow
#

as a player I wouldn't want that to happen tbh

orchid brook
#

I will take a look anyway thx 🙂

slender elbow
#

not me placing blocks and them just randomly disappearing from my hotbar

orchid brook
pure dagger
#

can File represent a folder?

river oracle
#

yes

pure dagger
#

thanks

orchid brook
pure dagger
#

so File.getParentFile always returns a folder

#

?

river oracle
#

yes

pure dagger
#

thak

#

thx

river oracle
#

I think

river oracle
# pure dagger so File.getParentFile always returns a folder
Returns the abstract pathname of this abstract pathname's parent, or null if this pathname does not name a parent directory.

The parent of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last. If the name sequence is empty then the pathname does not name a parent directory.```
chrome beacon
#

Consider using the NIO API instead if possible

river oracle
#

^ this too

#

nio is like 50x better imho

pure dagger
#

thanks

#

what does abstract mean in this case.. ;c

river oracle
# pure dagger what does abstract mean in this case.. ;c

I'm pretty sure it'd be like
if your file path specificed is "file.yml" or "folder/file.yml" in the first case even if they both under the folder "folder" only in the second case will "folder" be returned from getParentFile

deft summit
#

Guys, I'm having trouble making a ClientboundPlayerInfoUpdatePacket. This is my code:

private void createNPC(String name, Location location) {
        ServerLevel serverLevel = ((CraftWorld) location.getWorld()).getHandle();
        MinecraftServer minecraftServer = ((CraftServer) Bukkit.getServer()).getServer();
        GameProfile gameProfile = new GameProfile(id, name);

        ClientInformation clientInformation = new ClientInformation("de-DE", 0, ChatVisiblity.FULL, false, 0,
                HumanoidArm.RIGHT, false, true, ParticleStatus.ALL);

        ServerPlayer serverPlayer = new ServerPlayer(minecraftServer, serverLevel, gameProfile, clientInformation);

        serverPlayer.setPos(location.getX(), location.getY(), location.getZ());

        ServerEntity serverEntity = new ServerEntity(serverLevel, serverPlayer, 0,
                false, packet -> {}, Set.of());

        this.serverPlayer = serverPlayer;
        this.serverEntity = serverEntity;
    }

public void spawn() {
  ClientboundPlayerInfoUpdatePacket playerInfoUpdatePacket = new ClientboundPlayerInfoUpdatePacket(Action.ADD_PLAYER, serverPlayer); // THIS LINE ERRORS

  for (Player player : Bukkit.getOnlinePlayers()) {
                  ((CraftPlayer) player).getHandle().connection.send(packet);
  }
}

I'm a bit confused since its not even the sending of the packet that causes an issue, but rather just creating it...
Stacktrace:
https://paste.md-5.net/emududutuy.sql

blazing ocean
#

you're never assigning a connection

#

you need a dummy connection impl

#

e.g. ```java
private static final Connection DUMMY_CONNECTION = new Connection(PacketFlow.SERVERBOUND) {};

deft summit
#

huh, alright then, I'll try that, thanks

blazing ocean
#

oh wait actually

#
public class DummyConnection extends ServerGamePacketListenerImpl {

    private static final Connection DUMMY_CONNECTION = new Connection(PacketFlow.SERVERBOUND) {};

    public DummyConnection(ServerPlayer player, Profile profile) {
        super(MinecraftServer.getServer(), DUMMY_CONNECTION, player, CommonListenerCookie.createInitial(profile, false));
    }
}
#

I didn't understand my own code for a sec

#

just set the serverplayer's connection to that

deft summit
#

well now it doesnt error anymore... but the NPC still doesnt show up lmao

spiral light
#

i think you need to spawn the player or set the position / send position packet idk

deft summit
#

Figured it out, it was actually the order of packets

blazing ocean
#

yeah you need the info packet first

deft summit
#

I need to send the InfoUpdate before the AddEntity

pure dagger
#
customConfigFile = new File(getDataFolder(), "custom.yml");
        if (!customConfigFile.exists()) {
            customConfigFile.getParentFile().mkdirs();
            saveResource("custom.yml", false);
         } ```
#

does mkdirs just creates the folder?

blazing ocean
#

yes

pure dagger
#

is it necesarry before doing "saveResource"?

remote swallow
#

afaik you dont need to

worldly ingot
#

It will make the directories for you

pure dagger
#

so can i remove the line above saveresource?

pure dagger
#

not local

vagrant stratus
#

Is there a good way to handle configurable items? I'd use YAML loading/saving but that's honestly shit for customization purposes.
I already have my own registering and stuff, but if there's an even better way lol

lilac dagger
#

yaml is perfect for it

pure dagger
vagrant stratus
pure dagger
#

configs are annoying and so hard 😭

lilac dagger
#

you can create a custom serializer if you think the default is ugly

quaint mantle
vagrant stratus
#

yea, which is more or less what I did ig w/ json in a cleaner format

lilac dagger
#

most likely you want amount enchants tags and type

pure dagger
#

nou

lilac dagger
#

and some others i might not think atm

vagrant stratus
#

Yea, I implemented the important bits in the first pass of the json item parser. I'll likely support the rest later

pure dagger
vagrant stratus
#

This is ew customization wise though lol

ants={minecraft:sharpness=10000}}}```
#

much nicer, parser's shit though KEK

lilac dagger
#

you could do this for yml as well

#

it will look mostly the same

#

heck, you could even deplatform saving and let the user choose its poison

worldly ingot
pure dagger
#

i need to reload probably

#

to get data

vagrant stratus
#
material: STONE_SWORD
amount: 1
meta:
  name: Basic Item
  enchantments:
    sharpness: 1
  lore:
    - "This is"
    - "example lore"

I mean, yea I could do it in yaml but it makes no real difference parsing wise so I don't think it matters toooooo much lol
At least unless enough people complain, then I can just rewrite it & make a converter lol

remote swallow
vagrant stratus
#

Yea, you kina just load it again

#

I treat a reload method as both load & reload lol

lilac dagger
#

true

remote swallow
#

re-load

pure dagger
#

umm with this line YamlConfiguration.loadConfiguration(file); ?

remote swallow
#

yeah

lilac dagger
#

i like yml more because users have more experience with it than json

pure dagger
#

sorry i dont get this code

chrome beacon
lilac dagger
#

plus json adds up a level of complexity like closing the brackets commas

vagrant stratus
#

Yea, fair. We'll see what happens. The JSON format's simple enough to memorize at least

#

There'll be a wiki anyways 😎

#

also there's sanity checks & shit

pure dagger
vagrant stratus
#

check if the key exists or not

pure dagger
pure dagger
chrome beacon
#

give the user a warning and move on

lilac dagger
#

i really like my annotation config system that if a value is null it just uses the default

vagrant stratus
#

for json it'll be

JsonObject jsonObject = //
if (jsonObject.has("material")) {
   material = Material.valueOf(jsonObject.get("material").getAsString());
} else {
   throw new IllegalArgumentException("The material '" + jsonObject.get("material").getAsString() + "' is not a valid material");
}
#

At least for my stuff, because you can't do shit w/o a valid material

#

I default amount to 1
int amount = jsonObject.has("amount") ? jsonObject.get("amount").getAsInt() : 1;

pure dagger
vagrant stratus
#

Depends on the situation

#

it could be a System.err, System.out, or do what I do and throw an IllegalArgumentException

chrome beacon
#

Use your plugin logger 🙏

vagrant stratus
#

Fuck the plugin logger

pure dagger
#

xd

vagrant stratus
#

sout ftw

#

Don't gotta pass the logger instance eveywhere

#

or use a static plugin or logger instance

#

fuck the logger

#

sout & ctrl+space+enter ftw

rare ridge
#

hi, are there any examples of creating your own gui?

worthy yarrow
#

?gui

vagrant stratus
#

but yea, in my case for verification I have

    @Override
    public void parseObject(JsonObject object) {
        assertField(object, "material");
        // Parse the base ItemStack
        Material material = (Material) getEnumValue(Material.class, object.get("material").getAsString());
        if (!material.isItem()) {
            throw new IllegalArgumentException("Material '" + material + "' is not an obtainable item");
        }
        int amount = 1 = object.has("amount") ? object.get("amount").getAsInt() : 1;
        itemStack = new ItemStack(material, amount);
        // Rest of code here
#

note: assertField & getEnumValue are custom util methods lol

rare ridge
worthy yarrow
#

Sure

vagrant stratus
#

albeit that can be cleaned up

    private Material getMaterial(JsonObject baseObject) {
        assertField(baseObject, "material");
        Material material = (Material) getEnumValue(Material.class, baseObject.get("material").getAsString());
        if (!material.isItem()) {
            throw new IllegalArgumentException("Material '" + material + "' is not an obtainable item");
        }
        return material;
    }

    @Override
    public void parseObject(JsonObject baseObject) {
        Material material = getMaterial(baseObject);
        int amount = baseObject.has("amount") ? baseObject.get("amount").getAsInt() : 1;
        itemStack = new ItemStack(material, amount);
        
        // Rest of parsing code here
    }
lilac dagger
#

the next step is to make something like this 😄

#

it's my favorite way to make configs currently

vagrant stratus
#

Yea, probably won't do that

lilac dagger
#

why?

vagrant stratus
#

Eh, no reason for me to honestly.

#

for items they get parsed into an ItemStack, don't need that there

#

and if I want a specific slot or something, well the parsing code's there. Might as well just add a field & getter

lilac dagger
#

yeah, i guess it's not needed in your case

#

but i really like annotation config, makes my life so much easier

vagrant stratus
#

If I wanted to implement a kit system annotation config would probably still be overkill

pure dagger
# remote swallow yeah

but if i use YamlConfiguration.loadConfiguration(customConfigFile) instea of the try catch, then "customCConfig" variable is always just new YamlConfiguration(); and its not edited

remote swallow
#

Use = loadConfig

#

Iirc

pure dagger
#

what

pure dagger
river oracle
#

If I remember correctly

timid berry
#

is there a guide on making leaderboards

#

like the thing on the right side

pure dagger
#

what does use = loadConfig mean

pure dagger
timid berry
#

yah]

#

scoreboard

pure dagger
#

đŸ˜”â€đŸ’«

#

ill use the try catch for now i dont get all that

#

i dont get all that how to understand it ..

vagrant stratus
#

I don't even remember how to use the yaml API lmao

#

Been doing too much JSON stuff recently kek

echo basalt
#

we use toml at work

#

but I made a nifty little toml -> configurationsection adapter thing

vagrant stratus
#

nice

timid berry
#

would the health under the players name update automatically?

#

and since it runs on enable

#

will it show to players that join?

lilac dagger
#

unless you use dummy, in that case you'll have to update it manually

remote swallow
timid berry
#

does that mean i need to add it as a library?

pure dagger
lilac dagger
lilac dagger
#

the scoreboard doesn't really need packet events to work

#

unless you're stubborn

timid berry
#

how can i just write text

#

i dont want a score yet

#

like what if i want it to display

#

"hello!"

#

and not

#

hello: 1

lilac dagger
#

set a score entry to a chat color and register a team to that chat color and use prefix and suffix to edit the text

#

you still need a score if you use the api

#

on 1.20.4 you have the option to hide the score entirely which is nice

#

but it's done via nms

timid berry
#

ohhhh i see

#

thats why servers

#

have random numbers

lilac dagger
#

it's not random

timid berry
#

i mean

#

ykwim

lilac dagger
#

the numbers must follow an order

#

the numbers keep the order of the scoreboard 😄

timid berry
#

is this global or per player?

lilac dagger
#

global

chrome beacon
#

Well it's per scoreboard objective

lilac dagger
#

the only way to make it per player is to assign a scoreboard per player

#

and copy all the health and such on each scoreboard

timid berry
#

so on player join add them, but this would add them to the global scoreboard, how can i make a scoarboard per player?

#

Team team = board.registerNewTeam("teamname");

#

oh this

#

ill make a team under their uuid?

lilac dagger
#

not uuid

#

chat color

#

teams used in scoreboard are fictive

#

no need to use real player uuids

#

this one is pretty cool tho

#

i never used it

#

i'll have to test it to see if it does what i want it to

timid berry
#

every player has their own team name

#

right

#

if i dont want a global scoreboard

lilac dagger
#

Bukkit.getScoreboard getNewScoreboard for each player

#

and set it accordingly

timid berry
#

what about this

#

is that global

#

or on player join

lilac dagger
#

on join and have it cached

#

and if you want to change something that player see edit their own scoreboard

timid berry
#

chat where is it

lilac dagger
#

did you player setscoreboard board?

worldly ingot
#

Doesn't look like it. You're missing Player#setScoreboard() on the scoreboard you created

proper cobalt
#

hey guys im tryna do custom pdc stuff and i was using @tender shard more persistent data types and had it like this

DataType.asEnumMap(CompStorageType.class, DataType.FLOAT));

but the structure has changed, its now Enum, Class, so

StorageComponent.CompStorageType, StorageDataType

what do i pass in for the DataType?

chrome beacon
pure dagger
#

can you make your own class so you can create instance of it like of Integer class?
Integer integer = 1

#

for example make my class

MyClass myClass = 5 or "erwme"

chrome beacon
#

No

#

but not sure why'd you need that

pure dagger
#

im curious how is it made

#

so its Just built in and its only for these clases

chrome beacon
#

yes

pure dagger
#

the same with string

pure dagger
ivory sleet
slender elbow
#

new 💀

pure dagger
#

whaat

chrome beacon
pure dagger
#

yeah but i mean that its not possivle to do with other clases

chrome beacon
#

but it's not exactly builtin

ivory sleet
#

Maybe in kotlin kmys lol

pure dagger
#

what

#

no, java

ivory sleet
#

but in Java, to create an instance of ur class, somewhere you’ll find the new keyword being used

vagrant stratus
ivory sleet
#

often times its hidden behind a static factory method though

chrome beacon
#

You don't really need to fork java

#

Like a preprocessor

vagrant stratus
#

true

ivory sleet
pure dagger
#

why every one often uses ints and not for example bytes or shorts when they know that its gonna be small value for sure?

vagrant stratus
chrome beacon
#

manifold is cursed

#

but it does have some useful stuff like the preprocessor

ivory sleet
young knoll
vagrant stratus
#

no reason to use byte or short unless actually needed either lol

pure dagger
#

idk what you mean i always use boolean[]

young knoll
#

If only we had a shortcut for byte and short like we do for float long and double

vagrant stratus
#

int i = 1;
short i = 1;
byte i = 1;

same thing, really.

ivory sleet
vagrant stratus
#

short -32,768 to 32,767
byte -128 to 127
int -2147483648 to 2147483647

#

no real reason to use short or byte

young knoll
vagrant stratus
#

yea so fuck short & byte and use int 😎

#

or BigInteger if you have too

#

or whatever tf it's called

ivory sleet
#

yuh

young knoll
#

Idk what the short forms would be

#

Is s used?

vagrant stratus
#

no idea

ivory sleet
#

i think we just cast it?

#

“Cast”

vagrant stratus
young knoll
#

Yeah but I’m saying if they were to add new shorthand’s

vagrant stratus
#

Eh who cares, use int

#

It's got the range

chrome beacon
pure dagger
vagrant stratus
#

lombok's cursed

chrome beacon
#

yeah lombok is also a compiler hack

proper cobalt
young knoll
#

I think s would work for short

proper cobalt
#

ffs

chrome beacon
#

I did try to play around with the lombok source for a bit

#

bad time

young knoll
#

Can’t use b for byte because Boolean

pure dagger
vagrant stratus
#

If you want to micro-optimize then yea, you pay attention to what you use

pure dagger
#

okay but it does : )

vagrant stratus
#

Not really

young knoll
#

This is why optic doesn’t program embedded systems

pure dagger
#

Yes really

slender elbow
#

you will save like 40 bytes in the entire plugin

chrome beacon
vagrant stratus
#

We're not in the NES or PS2 era lol

proper cobalt
vagrant stratus
#

40 bytes is nothing nowadays lol

slender elbow
#

but also the JVM still inflates them to ints to operate on them

#

so your efforts are useless

vagrant stratus
#

I'm running this stuff on drives with 100s of GB KEK

young knoll
#

Something something 32 bit word size

pure dagger
chrome beacon
#

but yes the system needs to know what to store in the pdc

ivory sleet
chrome beacon
#

so you need to write the appropriate adapters

young knoll
#

That’s why Mojang uses varint

vagrant stratus
#

micro-optimizing really only makes sense for C, C++, Assembly. Low level languages

#

but even then not always

#

nowadays you don't need to micro-optimize the fuck out of programs lol

#

10 KB difference in size doesn't make a difference unless you're running on very specific hardware

proper cobalt
#

because a boolean is 1 byte

young knoll
#

wtf is an unsigned int

proper cobalt
#

but it only stores 1 bit

young knoll
#

This is java

#

We don’t do unsigned

vagrant stratus
#

If you wanted to actually micro-optimize, you wouldn't even be using Java lol

proper cobalt
#

ah i see i was referring to cpp

#

why do booleans hold 1 byte tho

#

thats bad design

young knoll
#

Because computers like to work either entire bytes

proper cobalt
chrome beacon
#

^^

young knoll
#

If you wanted to be efficient there is bitset

chrome beacon
worldly ingot
#

Wow coll said something smart

young knoll
#

Choco

proper cobalt
young knoll
#

I hope you get demoted to the skyblock team

worldly ingot
#

Wow

proper cobalt
#

but anyway evil bit hack is the way to go

ivory sleet
young knoll
#

Then whenever an update happens I can tell people to direct their whining towards you

vagrant stratus
#

but people hate other people so they say Fuck you, use Java

young knoll
#

Java didn’t get us to the moon!

vagrant stratus
#

but for spigot?

#

You're running ~80 MB jars on 100 GB+ computers or servers

proper cobalt
#

14kb of ram did

vagrant stratus
#

10 KB is nothing

young knoll
#

That’s still more RAM than an NES

proper cobalt
young knoll
#

Therefor we couldn’t use an NES to go to the moon

proper cobalt
#

sure if you attach thousands of dollars worth of other equipment

vagrant stratus
sonic goblet
#

Ya but you’re not thinking about the most edge case of edge cases

proper cobalt
#

my plugin hits 1.7gig after 24 hrs, its a rtp plugin

#

idk why it does that

#

joking btw

slender elbow
#

your code stinks

proper cobalt
#

aight Emily

paper viper
#

How is your plugin 1.7 gigabytes

proper cobalt
#

it just is bro

#

i shaded in bukkit

sonic goblet
paper viper
#

Do you shade prn in your plugin or something

#

/s

young knoll
#

I thought we were talking about ram

proper cobalt
#

and the whole google java suite is shaded

young knoll
#

Are we compiling for 24 hours now?

ivory sleet
proper cobalt
#

nah its cached

vagrant stratus
#

even ram isn't much of a concern nowadays tbh @young knoll

young knoll
ivory sleet
#

wom then >:c

vagrant stratus
#

not that your micro-optimizations are fixing java's, spigot's, bukkit's, and minecraft's overhead

young knoll
#

Is wom a thing

barren peak
#

how do you define a bukkit vector using magnitude and direction (pitch & yaw) instead of x,y,z?

young knoll
#

What would you ever use that for

proper cobalt
#

how useful!

paper viper
proper cobalt
#

i mean you can store.... bytes? and then... dump them?

paper viper
#

“What if you do 100 null checks per second or a 1000?!?!”

young knoll
#

ncps

vagrant stratus
young knoll
#

Null checks per second, new performance metric

#

When will spark show it???

proper cobalt
#

spark? whats that

#

i just get the used memory by the jvm and perform some calculations

#

people always do too much these days

vagrant stratus
#

but realistically? There's only so much you can do Java wise before you just straight up don't have anything to optimize, and even then you'll still have a fuck ton of overhead lol

proper cobalt
#

whats overhead (serious)

vagrant stratus
#

Minecraft alone takes like a gig of ram lol

proper cobalt
#

ah ic

young knoll
#

This just in

#

Storing an entire editable world of cubes takes a bit of ram

slender elbow
#

a single bit?

#

damn

#

that's impressive

vagrant stratus
young knoll
#

I mean

#

The palette system is pretty good

dire maple
#

Hello. I am looking into how I could use the Stripe API for detecting when a player purchases a rank from my Stripe link for it. I do not have any use for CraftingStore/plugins similar as I only offer 1 rank, and do not plan on offering other premium services in-game at all. What would be my best bet for detecting a payment on the server-end with the Stripe API?

pure dagger
#

oh i started a conversation

slender elbow
#

I always find it funny a lot of people complain that Minecraft is bad and when they try to do their own server impl it runs worse without all the mechanisms the vanilla game has

vagrant stratus
#

also, just don't use a gig of ram kek

chrome beacon
vagrant stratus
dire maple
# chrome beacon Have you checked the Stripe docs?

I have. I understand how to make the request and all of that, but I am wondering how I could implement that into my plugin as a single-time Event

i.e;
Stripe payment "detected" by routine checking:

  • ONE TIME StripeCheckoutEvent runs
vagrant stratus
#

still waiting for Minecraft as an OS 😔

inner mulch
chrome beacon
#

What do you actually need help with

#

How to make a (spigot/bukkit) event?

young knoll
paper viper
#

Issue

slender elbow
dire maple
# chrome beacon How to make a (spigot/bukkit) event?

No. I know how to make an event, I'm wondering how to exactly get the information from the purchase.

Unless I have it wrong,

  • I'll need to use a runnable to scan payments (similar to how CraftingStore does it afaik)
  • How can I turn that runnable into an Event that runs only once..? I'm trying to make it as dynamic as possible so that I do not need to change the code in future projects/plugins.
chrome beacon
#

Stripe has webhook apis you can use instead of polling

#

Also you can just store what events you've processed and not call the events for them?

dire maple
chrome beacon
#

It's part of the api docs

#

Not the java specific ones

#

I haven't read those

dire maple
#

I saw it briefly, but I never saw the Java-specific help

#

I can't attach images, but the Java-specific help has a much better example haha

timid berry
dire maple
chrome beacon
#

A webhook is basically just an endpoint. Instead of you checking the data if anythings changed they will send you the data when changed

vagrant stratus
#

fancy event/listener basically

dire maple
#

(Say external API)

vagrant stratus
#

Minecraft but it's just webhooks KEK

chrome beacon
#

You can just load Javalin and setup a very basic endpoint to recieve data on

#

Shouldn't be more than 30 lines or so

#

You can load it via Spigots library loader if you're on a version above 1.17(.1?)

#

if not just shade it

dire maple
chrome beacon
#

Do note it requires an extra port to run on

dire maple
#

oh

chrome beacon
#

If you don't want that I do have a project that's still W.I.P to solve that