#development

1 messages · Page 39 of 1

slim lynx
#

Do you know how to do this?

#

Here

floral beacon
#

idk how this is related to think i wrote but ok

#

i nowhere mentioned nametags

#

i am pretty sure this is not related to them

slim lynx
#

I know but do you know how

floral beacon
#

oh, i thought you wanted to answered me because you replied to my message

slim lynx
#

Lol

floral beacon
#

i think you should wait for someone to reply to your message and not ask people like this, i am pretty sure everyone who is checking this channel that they read all/latest messages

#

so somebody who knows would probably answer it

proud pebble
#

so you want to remove every player from the tab list

#

i see

#

tbh if i was to do something like that id use protocollib, and then modify the tablist packets to not have any players on iot

neon pewter
#

finally working, now i just need to somehow make GUI for it 💀

floral beacon
#

i am very close actually to achieve this, i managed to do it actually but it only happens if there is 1+ player/s online

proud pebble
#

i see

floral beacon
#

and then when another player joins, he is removed for everyone, however, i can't achieve to remove PlayerA for PlayerA

#

that is the main concern i am trying to understand how to do

proud pebble
#

perhaps its something to do with Spawn Player and Player Info Update

#

idk what the actual packet names are im just going off of wiki.vg

floral beacon
#

lol i can't believe

#

@proud pebble i did it without even utilizing PacketEvent OMG

#

i can't believe xddddddddddddddddddd

#

WHAT

proud pebble
#

ohh Player Info Remove exists

floral beacon
#

🤪 🤪 🤪 🤪

#

i feel so crazy

#

i lost like 4h today on this LOL

proud pebble
#

who's Test?

jade wave
#

That is the question we all want the answer to

floral beacon
# floral beacon

the username i used to join the server, and when i pressed TABlist is the moment like half a second i joined the server, but i used scheduler to runTaskLater to remove him from tablist and that's why it disappeared right when i pressed tab

floral beacon
slim lynx
#

Anyone got a tutorial or know how to make an animated Rainbow text to a hex color format

proud pebble
#

like if you dont want to go through the hassle then its good enough

#

is this plugin for an auth plugin of some kind, kinda seems like it

worn jasper
#

does adding an item to a player's inventory drop the item if their inv is full?

west socket
#

I don’t think so

calm loom
west socket
#

True

calm loom
#

come be a dev for mc football

west socket
#

I’m curious

#

What is that

calm loom
#

its exactly what it sounds like

#

with crossbows and spectral arrows

#

we also got a baseball league

#

its super fun

dense drift
#

Tbh idk why it is a map instead of a simple List tbh

west socket
calm loom
west socket
#

That sounds really fun

#

So you’re just trying to like shoot your WRs with an arrow?

dense drift
proud pebble
#

ive gone and had a quick look at the code for addItem(), i dont see a reason why its a map and not a list

worn jasper
proud pebble
#

yeah but its a few extra lines

bronze cipher
#

Hi, i try to make a placeholder %wommr_country% thats display the mmr of a country (assaultPlugin.getStorageManager().getMMR(country);
)

https://paste.md-5.net/iwazigajif.java

But this isnt working ig

atomic agate
#

Alguien de habla hispana?

#

que me ayude

#

Buenas

river solstice
#

is there a packet for (basically) a left click?

#

I'm trying to make a CPS counter, but it's either a hits-per-second or interactions-per-second, not actual times the player clicked (or sent a "click" packet)

stuck canopy
#

is there a way to make a block work like redstone block giving out redstone signal?

stuck canopy
#

there's no setBlockPowered method in Block

#

though there is a method called setPowered in Powerable but it just gives out a redstone signal and stops the signal right after but I want a way to create a constant redstone signal like how redstone block works

hoary scarab
#

Might need to do some NMS for that then

proud pebble
#

i knoe its very possible to do, tho it might need you to modify the server jar

hexed locust
#

Hiya for some reason players who experience connection issues, have their mysql data reset. Do you know how i would deal with this? I'll try to provide any code/information have.

past ibex
proud pebble
#

something id look at is an opensource anticheat, since most anticheats would detect clicking a certain cps thats too high then someone could feasibly do it

karmic gull
#

can someone tell me what this emans

forest jay
# karmic gull https://paste.helpch.at/uqirizohap.rb

you modified something while it was being used. This is like when you use a simplified loop and remove an element from it while looping: ```java
List<Integer> ints = new ArrayList<>();

for (Integer int : ints) {
ints.remove(int); // this would trigger ConcurrentModificationException
}

minor summit
#

true

warm steppe
#

Wouldn't even run because int

small cypress
#

I'm having trouble downloading a dependency through pom.xml that allows my plugin to read .yml and I cannot get it to down the proper contents for the life of me. Can someone help me or even show me where I can download the jar files for the repository?

#

I'm trying to download SnakeYAML in particular

#

but any would be greatly appreciated!

#

@ or dm me

#

Nvm I found it with some more googling

#

jesus christ that took 3 hours for no reason

proud pebble
#

spigot has built in methods for using ymls

#
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 ...

#

means you dont have to use snakeyaml directly

river solstice
#

Hey.

I have a limit for armor-stands inside a chunk using EntitySpawnEvent however, the player can still move armor-stands from one chunk to another via pistons.
How can I disable the physics/freeze them?

proud pebble
#

the only idea i got for that being possible is by modifying the entity's PistonPushReaction

#

which seems to be hardcoded

#

there are no events that are thrown afaik that tells you if the armorstand has been pushed by a piston

#

you could create an marker armorstand underneath the original armor stand and on break of said armorstand it would remove the marker armorstand aswell, it would prevent them from pushing the armorstand

honest spoke
#

I'm trying to upgrade my project from Java 16 to 17 and Kotlin 1.16.10 to 1.18.10, but if I try to resync Gradle I get https://hastebin.com/share/pubizexome.css When I look this up, I'm seeing JetBrains forum posts from like 2 years ago which say to use org.gradle.jvmargs=-Dkotlin.daemon.jvm.options=--illegal-access=permit in gradle.properties as a workaround, which I've done, but doesn't work. I feel like I shouldn't have to do that at all though and I've messed something up. Any ideas?

mental cypress
#

Not sure how much it will help but what if you go from Kotlin 1.16 to 1.17 and then go into your IJ settings and uh

#

Make sure these are set right

#

And then try to bump it up.

pulsar ferry
#

Also check your gradle version

honest spoke
honest spoke
neon pewter
#

do i need to include lib that only my function on other file use into main?

stuck hearth
#

What

errant pilot
#

heyo, im messing around the PersistentDataContainer on ItemMetas,
how should i use the namespaced key? should i pass my main class into it?
container.set(new NamespacedKey("what here","id"), PersistentDataType.STRING,id);

minor summit
#

the namespace would be the plugin name

#

i mean it can be anything you want, but ideally, it really should be the plugin name

#

lowercase*

errant pilot
#

the string for the namespace is deprecated, its asking for a plugin in the other method so ill just test out if passing in my main class works

feral raptor
#

does the FIFO structure of a Deque's back side reverse if iterated with an enhanced for loop?

#

to be more specfic, if I offerLast() all my elements into a Deque -- since enhanced for iterates Queues from front-back, would it iterate the Deque in reverse?

neon pewter
# stuck hearth What

for example my function use X lib but my main dont, do i need to include X lib in my main for it to work

feral raptor
neon pewter
#

im using cpp

feral raptor
#

oh, I've got no idea then lol, sorry

neon pewter
#

np

minor summit
#

it's deprecated because md5 does not trust you are clever enough to use it correctly

errant pilot
#

hahaha okay, thank you

lyric gyro
#

hello, top talent guys. I am senior developer and I am looking for someone who can do freelancing together.
in upwork and freelancer website

dense drift
river solstice
#

does java reflections library scan recursiuvely in the lower packages as well?

#

if my project is

me.m0dii.plugin
|
---- hello
---- world

if I create
new Reflections("me.m0dii.plugin"), woud it see the hello and world packages?

dense drift
#

Well, what do you want to do?

river solstice
#

scan fields

#

with specific annotation

#

what the fuck is chatgpt on about

#
...
    .addUrls(ClasspathHelper.forJavaClassPath())
    .addUrls(ClasspathHelper.forJavaClassPath())
    .addUrls(ClasspathHelper.forJavaClassPath())
    .addUrls(ClasspathHelper.forJavaClassPath())
    .addUrls(ClasspathHelper.forJavaClassPath());
dense drift
#

Don't you have to use annotation processor for that?

river solstice
#

¯_(ツ)_/¯

river solstice
#

yeah well I'm trying this way now

            for (ClassPath.ClassInfo classInfo : ClassPath.from(Scanner.class.getClassLoader())
                    .getTopLevelClassesRecursive(Scanner.class.getPackage().getName())) {
                try {
                    classInfo.load().getDeclaredFields();
                } catch (NoClassDefFoundError e) {
                    continue;
                }

                for (Field field : classInfo.load().getDeclaredFields()) {
                    if (!field.isAnnotationPresent(TestAnnotation.class)) {
                        continue;
                    }
...
quaint skiff
#

Hi, I created a ItemBuilder Class and wanted to use NBT. I tested everything with giving me the Item directly without the Itembuilder and it worked but i cant get it working in my ItemBuilder Class. My current Code looks like this: https://paste.helpch.at/qakarugika.java

dense drift
#

You dont need nbt for that, spigot had an attribute api

quaint skiff
#

I know that but i want to use nbt for other things too

#

it was more like a test that it works

proud pebble
minor summit
#

for namespaced keys it's annoying

#

they really are something you would put in a public static final field, so you can't exactly DI the plugin instance; sure there are ways around it but they are prone to error unless you are aware of class loading order and such
and making them be not static is annoying, DI'ing the keys all around is hell

marble nimbus
#

Hellloooo Friends,

I am currently working on a project that requires me do download thousands of files.
Therefore I thought the best Idea is to make a Downloader that has a queue, and several (amount is set via config) workers that poll from the queue and download.

Currently I am using ktor-client for everything that has to do with downloading or accessing APIs.
this is the Downloader: https://paste.teamhelios.dev/Y3t8Ah7LYO
and this the Worker: https://paste.teamhelios.dev/9q4iFvmGOo

In the Downloader is a line worker.accept(job) that is marked with an arrow. I am missing some kind of coroutine to get ktor to stop crying.
runBlocking theoretically works. But that, even when run inside an executor.execute, causes the whole app to stop working until that worker has downloaded its file.
It also for some reason only uses the first worker.

Does anyone know what I can do to allow my workers to run in parallel (and off the main thread)

broken elbow
marble nimbus
#

Yea the kotlin docs are amazing, unfortunately I haven't been able to find anything yet :/ and this small part is taking waaay tooo much time already (12+ Hours)

marble nimbus
#

Already tried that also. While that get's the code "working" it still "blocks/waits" for the Worker to be done before starting a new Job.

#

so even when 5 workers are ready, it only uses Worker-1 and also waits for the first worker to be done with the current download. (I added a comment above the worker.accept and below. The Comment above the accept was triggered, but the one below did not, it was triggered once the download has completed)

#

Matt, Emily and Idk who else already helped me to point me in the right direction. And while the info did help me, there is still some piece missing in this puzzle.

broken elbow
#

can you give the imports as well please?

marble nimbus
#

for both classes? yea sure uno momento

broken elbow
#

can't promise you it will work since I haven't work with coroutines in over a year and even then I only worked with them for a month but you can try it

#

made a change to the start method as well since you probably don't want to add new workers every time the start method is called since it would go over the maximum number

marble nimbus
#

its still only 1 Worker that is being utilized :/

#

And also Sonarlint doesn't seem to be liking the workersThread Remove this dispatcher. It is pointless when used with only suspending functions.

#

just for me:

runBlocking with a Launch inside will instantly complete, since the launch is creating a new coroutine and continuing normally right?
that means that once the launch block has been called the runBlocking is no longer blocking, do I understand it correctly?

signal grove
#

Any public anticheats have an API that exposes players estimated sensitivity?

forest jay
#

I am tracking when a player accepts a resource pack, because I want it to open a GUI when they do so. Currently, the event PlayerResourcePackStatusEvent doesn't get triggered when the person accepts the resource pack, but when they leave and rejoin it does get triggered. Any ideas?

proud pebble
forest jay
#

yeah, I am just opening the gui when it triggers, no checks

proud pebble
forest jay
#

yes

#

it doesnt fire

proud pebble
#

weird

#

it should fire any time the resource pack is attempted to be loaded

#

or atleast thats what i thought

honest spoke
#

For a Gradle subproject to use a convention plugin all need to do is include("subProjectName") in settings.gradle.kts like every other one, right? One of my subprojects can't access a convention plugin, but its configured exactly the same as all the rest as far as I can see, except it was made with Spring Initializr rather than manually

dense drift
#

You apply the plugin like any other plugin, plugins { id("plugin.id.here") }

honest spoke
#

Yeah I know, I'm doing that

dense drift
#

Ok and only one module cant access the plugin?

#

Also, has anyone used redis and papi? I use the redis as cache ( 🤡 ) and I want to display a value through a placeholder and I was wondering if I need another, local, cache for papi or if I could get the data directly from redis without affecting the server's performance

honest spoke
dusky harness
minor summit
#

who says PAPI runs sync?

dusky harness
#

I assumed they're running it sync

#

and they said "without affecting the server's performance"

minor summit
#

PAPI will run on whatever thread the requester requests placeholder resolution on

#

there are plugins out there that do it outside of server thread lol

dusky harness
#

ik but the majority run on the main thread because for ex a tab plugin won't know if a plugin's papi listener can be ran async

small cypress
#

Do y’all know what to do when an imported library is “unstable” and doesn’t import properly (but has everything it needs inside the library to function)?

#

Regarding the import it’s OpenCV

#

Version 4.7.0

small cypress
#

It doesn’t load properly into the plugin on the server but it says it works on the JDE

neat pierBOT
#
FAQ Answer:

Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.

small cypress
#

Name of automatic module 'opencv' is unstable, it is derived from the module's file name.

neon pewter
dense drift
#

don't you have to use std::ios::in?

neon pewter
#

ah ok let me change that

dense drift
#

but probably not since you have namespace std 😬

neon pewter
#

tho now i have problem that file is not generated :/

#

tho removing the modifier on data.open allow it to create the file

#

yep, added the failed condition

dense drift
dense drift
#

it is VERY annoying that the bullshit plugin messaging system requires a player to be online panda_rage

neon pewter
#

finally did it

#include <iostream>
#include <fstream>
using std::cin; using std::cout; using std::endl; using std::fstream;

int logger(double base, double raw) {

    fstream data;
    data.open("../Log.txt", std::ios::ate | std::ios::in | std::ios::out);
    if (data.is_open()) {
    data << "Base =" << base << " | Raw = " << raw << endl;
    data << "\n";
    data.close();
    }
    else {
        cout << "" << endl;
        cout << "Error, no file generated, attempting to regen file." << endl;

        data.open("../Log.txt", std::ios::ate | std::ios::in | std::ios::out | std::ios::trunc);
        if (data.is_open()) {
        data << "Base =" << base << " | Raw = " << raw << endl;
        data << "\n";
        data.close();    
        }
        else {
        cout << "" << endl;
        cout << "Regen failed" << endl;           
        }
    }
    return 0;

dense drift
#

what other ways are for a spigot servers to communicate with the proxy? Besides plugin messaging

wheat carbon
#

through the api?

#

none afaik

dense drift
#

not necessarily

wheat carbon
#

well then you've got third party messaging services

#

redis

#

rabbitmq

#

and then you've got the universally feared sockets

dense drift
#

sockets thonkness

wheat carbon
#

some ppl use websockets

#

bit inefficient but it works

dense drift
#

do they require a port to be opened?

wheat carbon
#

uh

#

I feel like they should but I have a feeling they don't

#

dunno never used them

dense drift
#

fair

#

well, redis will do it since I use it for cache

wheat carbon
#

cool

#

idk how redis messaging works either

dense drift
#

better than plugin msg kek

wheat carbon
#

ye

dense drift
#

Though, is this a limitation of the game in terms of sending packets (only through a playee) or just a poorly done work of md5?

wheat carbon
#

it's just a limitation of the implementation he went with

#

with saying that I don't know if a better one is possible

#

i'm not familiar enough with that side of spigot and bungee

dense drift
#

Aight

#

I wonder if waterfall or uh, the other proxy made by paper has a better system

#

Velocity

wheat carbon
#

it probably does

#

this is something people have been complaining about for literally forever so they missed a big opportunity if they don't have something better

neon pewter
#

is this the correct way to create directory in same location as executable ?

       fs::current_path(fs::temp_directory_path());
       fs::create_directories("./Memory");
minor summit
#

Which also means it can be used to communicate with client mods, which is why it was introduced originally, bungee etc just take advantage that exists for proxy <-> server comms

neon pewter
minor summit
#

A better system would need explicit support on the other end (the server), so you'd need a separate library for working with it on Spigot or something

#

At which point, just use a message broker

#

custom payload packet is the only thing the proxy can guarantee to exist on the other side of the connection, so they can only offer that

river solstice
#

Is there a way to check if plant grew itself or was bonemealed?

warm steppe
#

you could listen to bonemeal event and save that plant location

#

and remove it's location if it gets broken

stuck canopy
#

does BlockBreakEvent gets fired when a block is broken by a explosion?

minor summit
#

Called when a block is broken by a player.
doesn't seem like it does

#

for that you would want to check for EntityExplode or BlockExplode events

signal grove
neon pewter
dense drift
#

I will go with redis, is a good chance to learn more about it xD

neon pewter
signal grove
#

After installing redists you need to restart PC, not sure if he did that.

#

If that doesn’t fix it, I’m not sure

neon pewter
#

yep

#

he did restart

neon pewter
#

i probably should bundle those dll into the program itself ?

spiral prairie
#

Depending on if its a default DLL?

neon pewter
#

i think that i need to do something with the compiler so it will include these lib into the main program at the cost of size

#

so i just turn these on, i hope it work

slim lynx
#

Can anyone help me sort server plugins, Featherboard, Tab, And Oraxen I need help working with them and also to add prefix tags such as oraxen better prefixes are in the files to!

dense drift
#

wrong channel

neon pewter
dense drift
#

So, this is the first time I'm doing smth with Redis and I need some opinions xD
This is the flow for getting the balance of an user (or well, all balances), yellow is spigot level, turquoise is proxy and red is redis stuff

dense drift
stuck hearth
#

How are you making these

dense drift
#

diagram app

west socket
#

I love backend stuff

#

My whole system is setup using sockets instead of redis, but I should have used redis

#

My system is super cursed, since I use instant messaging for item playerdata, but Firestore for non-item data

slim lynx
tranquil glade
slim lynx
tranquil glade
#

Sure

neon pewter
#

is this the correct way to use from_char ?

        lvl = std::from_chars(level.data(), level.data() + level.size(), lvl).ptr - level.data();
        xp = std::from_chars(exp.data(), exp.data() + exp.size(), xp).ptr - exp.data();
minor summit
#

uh what are you even trying to do there

neon pewter
#

i believe this is what i should do ?

    auto [lvl_ptr, lvl_err] = std::from_chars(level.data(), level.data() + level.size(), lvl);
    auto [xp_ptr, xp_err] = std::from_chars(exp.data(), exp.data() + exp.size(), xp);
    if (lvl_err != std::errc() || xp_err != std::errc()) {
        std::cerr << "Invalid input\n";
        return -1;
minor summit
#

yeah, that looks more like the example i'm reading kek

neon pewter
#

for accuracy

dense drift
#

yes?

#

auto is just like java's var or kt's val/var

#

so the type is inferred from the method / value assigned

neon pewter
#

ah ok so if my var have its type declared auto should work fine right ?

dense drift
#

yes, that is not the problem, whatever your problem is

edgy lintel
robust flower
#

I'm getting this error when attempting to run a project which is using java modules:

java.lang.module.FindException: Module demo.main not found```

Where my `module-info.java` is:

root_project/
├── src/
│ ├── main/
│ │ ├── kotlin/
│ │ │ ├── module-info.java
└── build.gradle.kts


And its content:

```java
module demo.main {
    requires javafx.base;
    requires javafx.controls;
    requires javafx.fxml;
    requires javafx.graphics;
    requires javafx.media;
    requires javafx.swing;
    requires javafx.web;
    requires kotlin.stdlib;
    requires kotlinx.coroutines.core.jvm;
    requires org.slf4j;
    requires spring.boot.autoconfigure;
    requires spring.boot;
    requires spring.context;

    opens com.example.demo;
    exports com.example.demo;
}

How can I solve this issue?

minor summit
#

wouldn't you uh have to put that in the java source set?

robust flower
#

you mean, create a java package exclusively for the module-info.java?

minor summit
#

not a package but i mean putting it inside the java folder yes

robust flower
#

Results an issue with gradle and Kotlin when reloading the project definitions:

> Cannot cast org.jetbrains.kotlin.gradle.tasks.KotlinCompile_Decorated to org.gradle.api.tasks.compile.AbstractCompile```
minor summit
#

yeah i dunno, i never used jpms with kotlin, there's probably some SO question or some guide somewhere about properly combining both

robust flower
#

Well, I found this: https://youtrack.jetbrains.com/issue/IDEA-309824

Which lead to this more compreensive error message:

java.lang.module.FindException: Error reading module: /media/user/0BD218180BD21818/Local Disk/Users/User/Documents/TrashProjects/deletemenow/build/classes/java/main
Caused by: java.lang.module.InvalidModuleDescriptorException: Package com.example.demo not found in module
#

I assume the Kotlin code should be moved to the Java folder?

#

No I was wrong, dammit kek

minor summit
#

hm i have an idea of what you could do, but depending on how many packages you have it can be annoyingly painful to do

robust flower
#

this is the final jar btw

minor summit
#

BOOT-INF thonk

#

oh that's spring boot stuff

robust flower
#

yeah yeah

#

I'm trying something very, very interesting rn hehe

#

Which is to use JavaFX with Spring Boot, packed in a GraalVM native binary, I'm tweaking one class project to see if that works or not, if that ends up working I'll definitely be using this knowledge in the near future.

Spring Boot 3+ (the newest version) added support for GraalVM native images 'n stuff, so now it's pretty painless to generate a native docker image or native binary executable with Spring Boot.

One of the main drawbacks of "vanilla" Spring Boot IMO is the startup time, which might be quite a bit of time depending on the number of dependencies and size of the project, and this AOT (Ahead Of Time) compilation & dependency resolution solves all of that. The boot time of this test project I'm using to test went from 1 second to a mere 90ms, it is really impressive!

minor summit
robust flower
#

but don't you worry because I'm getting these errors when running the project normally in the JVM, I wouldn't have the audacity of pester you with GraalVM specific errors.

when I tried your idea, the error changed, very interesting... from what I'm understanding, for some reason the startup thing cannot find my Kotlin classes

Error: Could not find or load main class com.example.demo.SpringBootstrapperKt in module demo.main
wary spindle
#

How do I get a Username through a UUID? It's for a fork of a skin downloader mod

robust flower
wary spindle
#

It's for a forge mod

#

Is there any good API for that?

#

Like mojang's API?

robust flower
#

Well I never had to do that so I can't give you specific instructions to help you solve that, sorry, but I guess you could try the mojang auth api (for java)? I have seen some people using it before for the purpose of retriving the player skin, I guess it should return the player name as well

wary spindle
robust flower
#

If you send a GET request to that address it'll return a JSON containing this information:

{
    "id": "<profile identifier>",
    "name": "<player name>",
    "properties": [ 
        {
            "name": "textures",
            "value": "<base64 string>",
            "signature": "<base64 string; signed data using Yggdrasil's private key>" // Only provided if ?unsigned=false is appended to url
        }
    ]
}```
minor summit
robust flower
#

the kotlin module seems to be present in the plain and fat jars

#

hahahahaha it worked xDDDDD

for some reasons seems like I can't use the IDE run functionality, but I can run the resulting .jar in the terminal

user@ubuntu:/media/user/0BD218180BD21818/Local Disk/Users/User/Documents/TrashProjects/deletemenow$ java -jar build/libs/demo-0.0.1-SNAPSHOT.jar

Starting SpringBootstrapperKt v0.0.1-SNAPSHOT using Java 17.0.6 with PID 19101 (/media/user/0BD218180BD21818/Local Disk/Users/User/Documents/TrashProjects/deletemenow/build/libs/demo-0.0.1-SNAPSHOT.jar started by user in /media/user/0BD218180BD21818/Local Disk/Users/User/Documents/TrashProjects/deletemenow)
o active profile set, falling back to 1 default profile: "default"
Started SpringBootstrapperKt in 0.864 seconds (process running for 1.264)
Unsupported JavaFX configuration: classes were loaded from 'unnamed module @16c0663d'
Started primary stage (after 727ms)
minor summit
#

lol nice

robust flower
#

hmm but I'm still getting

Unsupported JavaFX configuration: classes were loaded from 'unnamed module @16c0663d'

even after declaring the module-info.java :/

#

when running the native image, I get this:

12 actionable tasks: 3 executed, 9 up-to-date
java.lang.ClassNotFoundException: com.sun.javafx.tk.quantum.QuantumToolkit
    at java.base@17.0.6/java.lang.Class.forName(DynamicHub.java:1132)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:258)
java.lang.ClassNotFoundException: com.sun.javafx.tk.quantum.QuantumToolkit
Exception in thread "main" java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:280)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)```

Which I assume it is related to the warning mentioned above (because graalvm strips all classes that it thinks are not declared to be used)
#

when removing the module-info.java, the IDE run functionality start working again, and I don't particularly care about java module thing, and would even prefer to not use it unless I must

restive bluff
#

add a whitespace

calm loom
restive bluff
#

press the space button on your keyboard

calm loom
#

now its red

calm loom
hexed locust
#

Hiya i was wondering if i could get some assistance on some of my code when saving/retrieving mysql data. My issue isn't exactly with retrieving or saving the data itself but more or less how i would work around player/s having connection issues.

proud pebble
#

how would player's connection effect grabbing and saving data?

signal grove
#

^ the sending and retrieval is done between the server and the database, players connection isn’t part of the equation. Maybe you’re concerned about the collection of data from players, like ping or something?

#

Honestly spigot probably caches it to make it instant, but I’m not sure what other things you’re worried about relating to player dependent data

hexed locust
#

Alright let me kinda explan the issue i'm dealing with

#

If you would like to see snippets of my code feel free to ask

#

I use HikariCP and when a player experiences connection issues and they relog instantly or something with their connection makes them disconnect and relog within milliseconds, the players data is not retrieved even though there is data stored.

#

Maybe it could be to do with my Hikari configuration? I'm not too sure.

dense drift
#

once you lose the connection, you can not reconnect within ms

hexed locust
#

Technically, maybe not; however, it sure looks like that.

stuck hearth
dense drift
#

I assure you it takes more than 1 second to connect to a server

dense drift
#

lmao zod

mystic gull
#

Hello, is there a way to stop registering cps for example if it is over 15(only register the 15 cps and ignorethe excess cps) , like slme servers (minemen for example) . I tried by calc cps with interact event and cancelling it but im sure its not how they do

proud pebble
#

like on logout, make a task that runs in like 10 seconds, if they rejoin within that 10 second window cancel the task

#

could be 5 seconds doesnt really matter ig

#

like if you save and unload the data, then just wait to do so when that task runs

#

thing is afaik when you join the server, the server waits for the next tick before allowing you to connect properly

hexed locust
#

I’ll try to do that :), could I ask, is there something that causes data to be retrieved empty?

#

Within mysql

proud pebble
hexed locust
#

Alright i'll test it out, mind if i ping you if i come across the issue again?

#

Thanks for being so helpful ❤️

stuck hearth
#

No problem

small cypress
#

Hello! I am having trouble making a .yml file for my plugin and being able to 1) upload the contents and 2) read it correctly. Please lmk if anyone can help, thank you!

tight junco
#

what do you currently have

minor summit
#

a terrible headache

sterile hinge
small cypress
# tight junco what do you currently have

Here is my YML file, it's 150~ lines but ill show you the first 10 to give you an idea.

block_colors:
air: '0,0,0'
stone: '125,125,125'
granite: '127,65,55'
polished_granite: '144,80,63'
diorite: '192,192,192'
polished_diorite: '201,201,201'
andesite: '137,137,137'
polished_andesite: '155,155,155'
grass_block: '109,171,61'
...

The type on the left is the block and the value on the right is an RGB color type that matches the block.

I want to be able to upload this to my plugin folder as a .yml file and be able to retrieve the necessary data from the .yml for commands.

Note: I am using SnakeYAML to retrieve all the information I need

For now, how do I make the .yml upload correctly?

#

I know I need to put something onEnable()

proud pebble
#

if your using bukkit, why not just use the built in methods for doing this instead of going directly to snakeyaml

small cypress
#

@proud pebble Where can I find the bukkit methods for this?

proud pebble
#
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 ...

#

it may be old, but its still quite valid even for 1.19.3

small cypress
#

@proud pebble Thank you! I am new to this so these links are very helpful

proud pebble
#

if you wanna get a yml embedded in the jar, this.getResource(String filename) exists, which you can get from your main class

small cypress
#

so if the yml is block_colors.yml I'd do:

this.getResource(String block_colors.yml) exists

proud pebble
#

you would do MainClass.getResource("block_colors.yml")

#

ofcourse you have to get the instance of your main class from where ever you are doing this

#

so either passing your main class through the constructor of the class your trying to use that method from

small cypress
#

Ok, I think im following

#

Admittedly this is a bit of jargon for me

proud pebble
#

passing through an instance of your main class through the constructor is called dependency injection

#

which im sure tutorials exists that explain what it is and how to do it

small cypress
#

ill look into it

#

thank you!

#

I assume its pretty essential to know?

proud pebble
#

yeah

sly spindle
#

Hey, I'm trying to use viaversion's API, there is a method that returns int and another one that returns ServerProtocolVersion, how do I compare these together? https://imgur.com/a/1OIstLi

shell moon
#

Once is serverversion and the other playerversion

sly spindle
shell moon
#

mmmm

#

maybe playing with methods inside

#
         int playerVersion = Via.getAPI().getPlayerVersion(player.getUniqueId());
         ServerProtocolVersion serverVersion = Via.getAPI().getServerVersion();
         //Maybe
         if(serverVersion.supportedVersions().contains(playerVersion)) {
             //Joined with the same server version
         }
         //Or maybe
         if(serverVersion.highestSupportedVersion() <= playerVersion && playerVersion >= serverVersion.lowestSupportedVersion()) {
             //Joined with the same server version
         }
#

idk, test it, maybe works lol

wary spindle
#

Why is this error showing up in my code while trying to compile?

#

incompatible types: java.util.UUID cannot be converted to org.bukkit.entity.Player

icy shadow
#

well UUIDs are not the same as Players

#

you may want to use the handy method Bukkit.getPlayer

merry canopy
#

Someone know how to disable Italic in components in lore of custom items?

dense drift
#

one way to do it is to append the component to an empty component that has italic turned off
Component.empty().decorate(TextDecoration.ITALIC, false).append(component) smth like this

stuck hearth
wary spindle
#

If you want, I can give you the code

#

That gives the error

stuck hearth
#

Bm is right they're not the same thing

#

I was meming but I forgot this was serious channel

mental cypress
#

Smh

wary spindle
mental cypress
#

That is correct

wary spindle
#

Anyways, should I give the faulty code?

torpid raft
#

send code

wary spindle
#

I can also give the rest that might affect it

torpid raft
#

it's very clear that what the issue is that somewhere you are trying to use a UUID as a Player though, as bm said

icy shadow
#

^

icy shadow
#

and what line is causing the error?

broken elbow
wary spindle
#

20V, 75H

#

V = vertical

#

H = horizonta

#

29V, 71H

#

39V, 71H

#

46V, 103H

broken elbow
#

on every line you listed, you have getRankManager().getTag() but there's no getTag() in your rank manager

wary spindle
#

It gets it from Rank.java

broken elbow
#

getRankManager().getRank().getPrefix(sender.getUniqueId())
vs
.getRankManager().getTag(sender.getUniqueId())

wary spindle
#

Want me to tell you a bit about the meaning of the code?

#

It checks for a Rank System (like luckperms)

#

Then gets data

#

Like prefixes

#

suffixes

#

etc

#

and cpracticechatformat gets the data

#

to have it on it's chat format

#

(obviously)

#

Rank rank; gets the values of the Rank.java class

wary spindle
broken elbow
wary spindle
#

The second gets the tag

#

There are no rank tags

wary spindle
#

It gets a tag DIRECTLY

broken elbow
#

Also, the parameter it takes is a Player, you are giving it an UUID. Just pass in the sender as an argument instead of sender.getUniqueId

wary spindle
#

what i mean is that

#

the tags are there to make the code cleaner

#

you don't want to have to check rank systems twice

broken elbow
wary spindle
#

I'm basically getting the active tag from a core like AquaCore

#

check the latest code

wary spindle
pure crater
#

then pass the uuid instead

quaint skiff
#

Hi, I tried to create custom durability but for some reason the damage of the item doesn´t change and I just can´t figure out why. (it stays at 0)

Here is my listener for durability changes: https://paste.helpch.at/fabewunufi.java

dense drift
#

Looks like replacing readString(pong) with pong.readLine() works a bit better but still not very usable

MOTD l1: §r§b---------§r§8§l[-  §r§f§lCOMPLEX  §r§b§lGAMING  §r§8§l-]§r§b§l--------§r
MOTD l2: §r§f�?�?�?ɴs§r    §r§b§k§li§r§d§k§li§r§b§k§li§r§b §r§d#1 �?ɪx�?�?�?�?ɴ ɴ�?�?ᴡ�?�?�? §r§b§k§li§r§d§k§li§r§b§k§li§r§b    §r§fǫ�?�?s�?s```
minor summit
#

your current readString basically assumes ASCII encoding (one byte maps to one character)

#

oh that was like 40 minutes ago, @dense drift beep boop

dense drift
#
    private String readString(DataInputStream in) throws IOException {
        var out = new ByteArrayOutputStream();
        var b = in.readByte();

        while (b != 0x00) {
            out.write(b);
            b = in.readByte();
        }

        return out.toString(StandardCharsets.UTF_8);
    }```
Like this?
#
MOTD l1: �r�b---------�r�8�l[-  �r�f�lCOMPLEX  �r�b�lGAMING  �r�8�l-]�r�b�l--------�r
MOTD l2: �r�f????s�r    �r�b�k�li�r�d�k�li�r�b�k�li�r�b �r�d#1 ??x????? ??????? �r�b�k�li�r�d�k�li�r�b�k�li�r�b    �r�f???s?s```
minor summit
#

lol

dense drift
#

couldn't they just return the data in individual fields 🤣

minor summit
#

gaby

dense drift
#

ugh yes

minor summit
dense drift
#

and what if the motd uses colors or other sumbols?

#

tehnically their motd is ---------[- COMPLEX GAMING -]-------- (the first line at least)

#

and that string clearly contains section symbol 🤣

minor summit
# minor summit

this also answers your question of "There's something before the server info, idk what" lol

dense drift
#

yeah I figured out kek

wary spindle
dense drift
#

I forgot I saw the string type at the top 😦

#
var serverInfoBuffer = new byte[pong.readShort()];
pong.readFully(serverInfoBuffer);
var serverInfo = new String(serverInfoBuffer).split(";");
System.out.println("MOTD l1: " + serverInfo[1].replaceAll("§.", ""));
System.out.println("MOTD l2: " + serverInfo[7].replaceAll("§.", ""));```

MOTD l1: ---------[- COMPLEX GAMING -]--------
MOTD l2: ᴄʟᴀɴs iii #1 ᴘɪxᴇʟ�?�?ɴ ɴᴇᴛᴡ�?ʀᴋ iii ǫᴜᴇsᴛs```
Looks better now xD

#

I wonder if IJ console just can't display some of these chars thinkfused
Edit: yeah, it can't display M O and Y, and M and O are missing from there

wary spindle
dense drift
#

thank you @minor summit

minor summit
#

hm?

dense drift
#

reading the length and then the string did the trick

minor summit
#

huh

dense drift
#

smh

broken elbow
#

regex question.

I need to find all instances of <tag(.*)>.*</tag> (pattern)
and replace them with <new-tag(1)/>, where (1), is the group.

What I have right now is

            Matcher matcher = pattern.matcher(expectedResponse);
            while (matcher.find()) {
                expectedResponse = matcher.replaceFirst("<" + newTag + matcher.group(1)+ "/>");
                matcher = pattern.matcher(expectedResponse);
            }
``` but I'm not sure if this is the best solution.
So I guess, my question is: is this a good solution and if it isn't what would be a better solution?
dense drift
broken elbow
dreamy elk
#

How can I replace placeholders on a object from which a player is not required/has nothing to do with

#

Like how can I identify where the request is coming from?

dense drift
#

wdym?

dreamy elk
#

Ummm it's hard to explain, let me try my best

#

Currently I use a local placeholder system

For example:

%used_items% which then returns the amount of used Items from a specific Object

I want to move to using PAPI expansion

dense drift
#

ok, what what about the first question?

#

you can not know where a placeholder is used (e.g. in chat, in scoreboard, in tab, etc.) but you have access to the player involved in the parsing

dreamy elk
#

Oh! So I can get the location of the player and then I would get a aprox place?

#

Hmmm

dense drift
#

uh, if that's what you need, sure

#

what I'm saying is that you can't check where the placeholder is used in order to return a different value

dreamy elk
#

Yeah I got you

dense drift
#

if your %used_items% placeholder returns something when it is used in a menu and something else in another menu, you need to find a way to do the same thing with a papi expansion

dreamy elk
#

I'm trying to think how I can make the placeholder return a specific value on any condition

#

Yeah I get what you mean

dense drift
#

then what's the problem that you are having?

dreamy elk
#

I have a hologram per chunk, that chunk contains information which I need to be able to replace a papi placeholder with

dense drift
#

hmm

dreamy elk
#

So if I did what I said, getting the players location and then get the chunk won't work cause if they player changes chunks it'll stop obviously

dense drift
#

then id suggest to stick to internal placeholders for this

dreamy elk
#

I might have to do placeholders locally and then enable papi

#

Yeah, exactly what I though

#

Alright, thank you very much

dense drift
#

np

river solstice
#

can someone explain what the fuck

#

react be reaccting

dense drift
river solstice
#

opinion not asked

dense drift
#

it is not an opinion, it is a fact

river solstice
#

php still in top 10

#

idk what u on about

#

and I can't always choose the langs I want to use in uni

dense drift
#

jk

broken elbow
#

top 10 what?

dense drift
#

mistakes

river solstice
#

tiobe

dense drift
#

released languages in chronological order

river solstice
#

would be 8th, apparently sql is a programming language

broken elbow
#

um

river solstice
#

anyways, I didn't ask whether you like php or not

river solstice
surreal lynx
#

Does anyone know what the DamageCause is when a strider gets hurt from rain?

minor summit
#

gamer_touched_water

broken elbow
surreal lynx
#

I thought that may be the case, but it doesn't seem to be, as I'm cancelling that already

#

Nevermind, I'm stupid

#

Thanks!

dense drift
proud pebble
#

ive been looking and i can modify the maxHealth and attackDamage attributes, now im wondering if theres a way to change the max values of these while the server is running, this is so i dont have to manually change the values in the spigot.yml, like my first idea was to on first boot, load the spigot.yml values and change them and say to restart for the changes to take effect

#

just so then MAX_HEALTH attribute can be as high as integer max of 2.147b instead of 2048

atomic trail
#

I always forget this for shadowJar, do I use the small file or the bigger one called like xxx-all?

icy shadow
#

bigger

atomic trail
#

Ah thanks

#

How is a spawner type stored in the block if it doesnt have itemmeta? I just tested and when breaking a spider spawner for example it doesnt have an item meta

dense drift
#

Spawners arent dropped on vanilla?

#

You might want to check the source code of silk spawners

atomic trail
atomic trail
proud pebble
# atomic trail Yeah true, trying that atm

afaik blockbreakevent supplies the block you break, and since blockbreakevent is ran before the block is broken, it means that you can get the blockState of that block

#

you can get the entity type to spawn

fading stag
#

I have a code like that:

Bukkit.getOnlinePlayers().forEach {
    val player = it.name
    val world = it.world.name
    val x = it.location.x
    val y = it.location.y
    val z = it.location.z
    connection.createStatement()
        .execute("INSERT INTO coords (player, world, x, y, z) VALUES ('$player', '$world', $x, $y, $z)")
}

I must save coords of all players every minute. Is it a bad way (I mean this server has around 100 players, executing 100 queries every minue)? I'm using a sqlite database (code is kotlin code)

dusky harness
#

also

#

you should be using PreparedStatements

#

i think?

#

i dont use sql so i dont know much

fading stag
dusky harness
#

ye

fading stag
#

that way it won't block main thread

dusky harness
#

if you need to get values from the database, that should also be ran async (and so it's usually cached)

#

especially for a 100 player server

fading stag
#

I normally get data from db on enable and store them at hashmaps etc

dusky harness
#

ah ok

#

👍

fading stag
#

thanks

torpid raft
#

an example from stackoverflow:

INSERT INTO MyTable
  ( Column1, Column2, Column3 )
VALUES
  ('John', 123, 'Lloyds Office'), 
  ('Jane', 124, 'Lloyds Office'), 
  ('Billy', 125, 'London Office'),
  ('Miranda', 126, 'Bristol Office');
river solstice
#

Maybe update the coords, not insert a new row every time

atomic trail
dense drift
#

The game probably doesnt take into account the meta

atomic trail
#

What can I do to fix this then?

#

Any ideas?

dense drift
#

Listen to block place event and set the entity type

proud pebble
atomic trail
atomic trail
# proud pebble pdc

Kinda forgot how it works lol

        CreatureSpawner spawner = (CreatureSpawner) e.getBlock().getState();
        EntityType entity = spawner.getSpawnedType();
        ItemStack spawnerItem = Utils.entityToSpawner(entity, 1);
        ItemMeta spawnerItemMeta = spawnerItem.getItemMeta();

        PersistentDataContainer pdc = spawnerItemMeta.getPersistentDataContainer();
        pdc.set(entity.getKey(), );

What would the PDT and value be?

spiral prairie
#

entity.getKey()?

atomic trail
#

Oh yeah ignore that lol, I think it's wrong

dense drift
#

Make your own key and use the entity key as value

atomic trail
proud pebble
#

then just EntityType.valueOf() to get the value back

atomic trail
#

I've set the key to "EntityType" now and the value to Utils.getEntityType(spawnerItemMeta.displayName().toString()).getTypeId()

That should work right?

atomic trail
#

Ahhh I see

proud pebble
#

so pdc.set(key,PersistentDataType.STRING, entity.name());

atomic trail
# atomic trail So it should be something like this? https://paste.helpch.at/ayovoberuk.java

The method to set the pdc is just this

    @Override
    public Object set(Object obj, String key, String value) {
        if (obj instanceof PersistentDataHolder pdh) {

            NamespacedKey namespacedKey = new NamespacedKey(testing, key);
            PersistentDataContainer tagContainer = pdh.getPersistentDataContainer();
            tagContainer.set(namespacedKey, PersistentDataType.STRING, value);
        }
        return obj;
    }
proud pebble
#

ah

atomic trail
#

So that would technically work right?

#

I would ofc move the thing to set it but yeah

proud pebble
#

should do

atomic trail
#

That would set the data on the STRING? Not sure what you mean

proud pebble
#

PersistentDataType?

atomic trail
#

First argument should be the PDH

proud pebble
#

pdc has 3 args

#

namespacekey,datatype and value

atomic trail
proud pebble
atomic trail
#

Yeah

#

So it's correct right?

proud pebble
#

uhh yeah

atomic trail
fluid sapphire
#

I want to put custom models to a deluxe menu Menu, but it doesnt work for me (nbt_int: CustomModelData:2)

proud pebble
proud pebble
atomic trail
fluid sapphire
proud pebble
fluid sapphire
#

ahhh

#

tyty

proud pebble
#

not

fluid sapphire
atomic trail
proud pebble
#

sorry

proud pebble
#

could be that it forces your tag to be fully lowercase

#

use something like nbt tooltips mod to see the itemstacks nbt data

#

there is also a way to copy an item's data to your clipboard but cant remember the shortcut

#

F3 + i

fluid sapphire
#

bro, i dont know why it is not working 2 me

proud pebble
fluid sapphire
#

i dont know if im putting it right

#

okkk ty btw

proud pebble
#

i use it while im working with nbt directly through nms to make sure the tags are showing correctly

proud pebble
#

also doesnt look like your setting the item's metadata back

#

so the itemstack never gets its meta updated

#

yk,
spawnerItem.setItemMeta(spawnerItemMeta);

worn jasper
#

what's the slot number of these slots?

#

I have tried 80-83, doesn't work

broken elbow
#

(see player tab)

worn jasper
#

oh but that only works on InventoryClickEvent

minor summit
#

those are the raw slots from the inventory view
you always have an inventory view open

worn jasper
#

which kinda works for me

#

yeah, it's fine though, I can use the event

minor summit
#

sure

#

you can get the view from there

worn jasper
#

what could cause that?

minor summit
#

sometimes when you do stuff fast the client might desync

#

it's a non issue unless you're in creative mode, but if you're in creative mode inventories are fucked anyway

worn jasper
#

that's the issue

#

I am canceling it cause it's causing a dupe

#

lol

minor summit
#

how are you confirming it

worn jasper
#

the dupe?

#

confusion

#

rn I have a duels system, with kits, it stores your inventory and gives you a kit for your duel

minor summit
#

yes, how are you certain it's actually duped and not just a ghost item in the client

worn jasper
#

but players can keep items from the kit, in the grid and once they "die" (they don't, it's a fake death), they get tped back, get their items and still have those kit itemms

#

^^

#

and I also just tested it

#

100% not a ghost item

#

I wanted to initially just clear those slots

#

but the thing is that, I am unable to get that view with just the player object

#

or at least I didn't find a way

minor summit
#

getOpenInventory

#

don't question it

worn jasper
#

.........

minor summit
#

what

worn jasper
#

I was going to question it

fluid sapphire
#

I want to put custom models to a deluxe menu Menu, but it doesnt work for me (nbt_int: CustomModelData:2)

dense drift
#

wrong channel

fading stag
#

I'll have a Discord bot in a plugin, it reads discord messages and dispatches Minecraft commands. AFAIK I should not use Bukkit API in asynch tasks, what is best way to do it? Start bot asynchronously and when using Bukkit API running them in synch task or something like that?

dusky harness
fading stag
#

Does that mean I have to use queue instead of complete and everything will magicly work :d

worn jasper
#

it will work like magic

#

(although it doesn't work 100% like that xd)

#

Usually I just run my bot offside AKA not in the server

#

and connect them via a database

#

a lot safer

fading stag
#

This is what my client wants, I would create an API and work with http requests normally

worn jasper
#

Usually clients ask what they think it's best without knowledge...

#

A good customer service quality is also telling them when not to and suggesting alternatives that they might have not thought about.

#

Usually I give advice quite frequently on these matters, and all my clients love that about me.

fading stag
#

Thanks for suggestions

icy shadow
#

that expression is a common misconception

torpid raft
#

customers are always right when it comes to matters of taste

#

is the full saying i believe

icy shadow
#

^

#

which I suppose is basically the same thing in this context

#

Actually no it’s not

#

It’s to do with fashion and things which are inherently subjective

#

Whereas with code there’s often an objectively better option

dusky harness
#

it's also got a discord server for support

#

bots aren't as simple as http requests since discord has to send info to you, so it needs a websocket connection

fading stag
dusky harness
feral raptor
feral raptor
#
Furniture.java:11: error: method does not override or implement a method from a supertype
    @Override
#
Furniture.java:20: error: cannot find symbol
        InteriorItems recliner = new Furniture();
        ^
  symbol:   class InteriorItems
  location: class Furniture
3 errors
dusky harness
icy shadow
#

yeah looks like you just forgot the second class lol

dusky harness
#

also there's no packages, right?

#

if there are packages then make sure that you import if it's in a different package

#

although IntelliJ and even Eclipse should be able to handle that

feral raptor
#

i didnt declare a package or anything, but its in the same directory

#

not sure if that is acceptable for an interface though. other classes have been able to access each other fine

feral raptor
dusky harness
#

FlopZone 🥲
how are you compiling?

#

if you compile Furniture alone then InteriorItems isn't being added to the compilation

feral raptor
#

ahh, I see. I always thought the compiler will look for missing implemented classes/interfaces automatically

#

Im guessing that doesnt apply to interfaces

#

i.e when you have a main driver class, compiling that one class will also automatically compile all other classes referenced within it (if within the same package)

dusky harness
#

it shouldn't do that I don't think

#

but I don't use javac so

#

idk

#

¯_(ツ)_/¯

feral raptor
#

FlopZone 🥲
KEKW

#

ah yeah you were right, it worked now. Just compiled em seperately

dense drift
#

Wrong channel

floral beacon
#

any ideas how i can prevent players from rotating/moving their head/camera/view?

#

like this server does

torpid raft
#

cancel player move event?

floral beacon
#

that doesn't help

#

because PlayerMoveEvent triggers when player walks, not when he moves his head/camera view

floral beacon
proud pebble
torpid raft
#

not me jealous that i can't add reactions in this channel

minor summit
#

tier 5 perk I think

torpid raft
#

give me some of your exp emily

#

you don't need to be tier 7

minor summit
#

I do

proud pebble
#

i googled player head movement event, a thread on stack overflow popped up, told me that there wasnt a specific event to player head movement but playermoveevent was the event that was trigger on head movement and i told you

#

that question was a googleable question

tight tide
#

^

floral beacon
#

i am trying right now, btw it's 1.12.2 server and it seemed to not be working but i messed up something else and i just now saw the error, so i will try as you said it detects even player head movement

pulsar ferry
#

You can never fully prevent movement, it'll always jitter because the client doesn't know it can't move until the server replies back, which takes time

floral beacon
# pulsar ferry You can never fully prevent movement, it'll always jitter because the client doe...

yeah i researched on that just now when i wanted to figure out how to prevent camera view movement (at least to detect+revert it to defined position of yaw&pitch)
then i also saw i could do something with packets and use spectator mode + vehicle mount to invisible armor stand to make player camera fixed but that is just too advanced for now (not really that i wouldn't try, just too much time for a somebody like me, i don't code so often)

floral beacon
# proud pebble PlayerMoveEvent triggers even when the player moves their head

thanks for the solution, it was actually pretty simple, my PlayerMoveEvent was cancelled before debug code for this was executed + on the web i read exactly as you said "there wasn't a specific event to player head movement but..." and when you combine my debug and that sentence and all other not precise topics on spigotmc related to this = i end up thinking that player head movement is undetectable lol

dusky harness
#

why is it so high

#

lol

#

?roleperks

neat pierBOT
feral raptor
feral raptor
#

However, it now appears in the jar after I moved plugin.yml into the main class's package and it still outputs the same error

#

ive also created a new directory within main\java called resources and placed the plugin.yml within there. Still did not load

#

nevermind, fixed it by moving resources outside of \java and into \main

neon pewter
#

should i open and close file everytime function is call or open file when the program start and close when program stop

proud pebble
atomic trail
#

How is a vector written in YAML? For something like this

Vector posOneVec = section.getVector("one");
icy shadow
#

Try it and see

#

set a vector object and see what happens

#

But it’ll just be some section with the x y z components

marble nimbus
#

Hello People,

I am in need of some desperate css help.
Currently I am working on a custom Player for Video.JS using some of their Plugins. Unfortunately since none of the skins that Video.JS offers has built in support for the 2 Plugins I am using I need to manually add them, but just adding the original css that is provided with the plugins didn't work.
I am not really good with plain css, I am more of the tailwindcss user (normally I don't do frontend at all) so I need some help 😦

Attached you can see how it currently looks, most of it looks good, just the seek buttons and the quality selector are a bit "meh"

This is the Player.css: https://paste.teamhelios.dev/n2Qr69MB9b
And this is the Seek.css: https://paste.teamhelios.dev/lzx6O7Fyed

dense drift
atomic trail
#

Alright I'll try, thanks

#

Does someone know how this world can be null if it does indeed exist?

        World world = Bukkit.getWorld("wilderness");
        if(world == null) {
            LOGGER.warn("Wilderness world is null");
            return;
        }

This code is run in onEnable

#

Or well a constructor of an event that is initialized in onEnable, but it should work right?

river solstice
#

what does Bukkit.getWorlds() output

atomic trail
#

Testing now

dense drift
#

try to add load: POSTWORLD in your plugin.yml (iirc that's the option & value)

atomic trail
#

Oh what [CraftWorld{name=world}, CraftWorld{name=world_nether}, CraftWorld{name=world_the_end}] does Bukkit.getWorld() not recognize worlds created by multiverse?

#

There's definitely other worlds than that

dense drift
#

shrug_animated they are probably not loaded yet

atomic trail
#

I see

river solstice
#

those three are loaded by default I think

#

before "everything"

dense drift
#

because, you know, multiverse has to load first, then it loads the worlds

atomic trail
dense drift
#

search spigot plugin.yml and check the available options

atomic trail
#

Alright

river solstice
#

default is postworld

#

🫡

atomic trail
#

Yeah

#

Just saw that as well

river solstice
#

add dependency for multiverse maybe

dense drift
#

welp

river solstice
#

or loadafter option or wtv

atomic trail
#

Not sure what that is

#

loadafter

river solstice
#

ah, there's loadbefore

#

my mistake

atomic trail
#

Ohhh that's useful

#

Thanks

#

Wait

#

loadafter then

river solstice
#

yeah but that's not gonna do anything for you

#

and there's no loadafter

atomic trail
#

Oh yeah

#

mb

dense drift
#

you can also just delay the part of the code that gets the world

river solstice
#

^ or using a mv as a dependency

atomic trail
#

Yeah was about to say that

#

Just in plugin.yml right?

river solstice
#

dependency, yes

atomic trail
#

Another dumb question lol, do I need to actual dependency in gradle as well?

org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [MultiVerse]. Please download and install these plugins to run 'Testing'.```
river solstice
#

wouldn't it be multiverse-core?

#

and no, no need in gradle

atomic trail
#

So this

#

second part here

#

If that makes sense

#

Just not with WE ofc

river solstice
#

no

#

that's not related to gradle

atomic trail
#

Oh

#

How do you know what to use as dependency name in plugin.yml then?

#

Name of plugin jar?

river solstice
#

no, the filename can be anything

#

and it wouldnt know

#

it's that plugin's name section in plugin.yml

atomic trail
#

Ohhhh yeah that'd make sense, thank you

#

Yeah that worked, new error but I'll try and fix it myself first lol

atomic trail
#

Should this not create the file based on the file in the jar?

        try {
            regionFile = new File(path);
            if (regionFile.createNewFile()) {
                LOGGER.info("RegionConfig file has been created");
            }
        } catch (IOException e) {
            LOGGER.error("RegionConfig could not be created");
            e.printStackTrace();
        }

        config = YamlConfiguration.loadConfiguration(regionFile);

It just generates and empty yaml file in the server folder

#

It prints RegionConfig file has been created

warm steppe
#

you are not setting its contents

atomic trail
#

How do I do that then? I thought I was when supplying the path

#

This is the path btw path = testing.getDataFolder() + File.separator + "regions.yml";

dense drift
#

JavaPlugin#saveResource(path, false)

stuck canopy
#

how do I fix this

#

I am trying to open a inventory for a player when sending a message, using AsyncChatEvent

dense drift
#

run a sync task, BukkitScheduler#runTaskSync

stuck canopy
#

#runTaskAsynchronously?

dense drift
#

sorry, it is just runTask

stuck canopy
#

oh

#

thanks it worked

atomic trail
fading stag
#

I'm getting java.sql.SQLException: No suitable driver found for jdbc:sqlite error but I'm shading org.xerial:sqlite-jdbc:3.15.1 into my jar what can be the problem

west socket
#

I am tearing my hair out trying to figure out why mobs that I spawn and remove the equipment for still have the equipment

#

I'm literally printing out the item in their hand 10 ticks after they spawn and it tells me AIR, but theyre literally holding bows

#

Does the spigot entity equipment change method not send an update packet or something?

#

Nvm, spigot is just gay and doesnt send the equipment update packet properly :/

minor summit
#

minimessage

atomic trail
#

Is it not possible to create a command in ACF without using Subcommands? I've only seen examples where the class has a CommandAlias and the methods has Subcommand

atomic trail
#

Ahhh I see, thanks

marble nimbus
#

Hello friends, I am currently working on a custom Platform for Twitch VODs. Rn I am working on the Chat Replay stuff, and I am struggling to find a proper way to do it.

Basically during playback of the VOD I need to display the chat in-sync with the video also I need to take in account seeking in the video (forward and rewind)
I am using video.js as a Player.

Does anyone have a good Idea how I could handle all that.
The actual listening to the events isn't a problem, since video.js has "timeUpdate" which (not 100% since I can't find proper docs) is being used when the video is playing, and "seeking" which is used when the user jumps forward or rewinds

PS: I am getting all the messages as a giant json from the backend once the user opens a VOD on the page.

crimson portal
#

after rejoining my server my created npc isn't looking at me anymore. Has someone a advice for me to make that work again?

Player p = e.getPlayer();

        Main.getInstance().getNpcs().stream()
                .forEach(npc -> {
                    Main.getInstance().log("2");
                    //The location of the NPC
                    Location loc = npc.getBukkitEntity().getLocation();
                    Main.getInstance().log("3");
                    //Calculate a new direction by subtracting the location of the player vector from the location vector of the npc
                    loc.setDirection(p.getLocation().subtract(loc).toVector());
                    Main.getInstance().log("4");

                    //yaw and pitch used to calculate head movement
                    float yaw = loc.getYaw();
                    float pitch = loc.getPitch();

                    Main.getInstance().log("5");
                    //get the connection so we can send packets in NMS
                    ServerGamePacketListenerImpl ps = ((CraftPlayer) p).getHandle().connection;

                    Main.getInstance().log("6");

                    //used for horizontal head movement
                    ps.send(new ClientboundRotateHeadPacket(npc, (byte) ((yaw%360)*256/360)));
                    //used for body movement and vertical head movement
                    ps.send(new ClientboundMoveEntityPacket.Rot(npc.getBukkitEntity().getEntityId(), (byte) ((yaw%360.)*256/360), (byte) ((pitch%360.)*256/360), false));

                });
river solstice
#

Log 1 2 3 4 5 😩🙏

#

Debugging ❌❌
Print statements ✅✅✅

crimson portal
#

yea do you know my problem?

river solstice
#

no I'm just talking smack and leaving

pure crater
#

there's a lot more concerning things to fix lmao

dense drift
#

I need to upload some dummy data to an endpoint on an interval, is there a better way of doing this? D:
https://paste.helpch.at/uvodoqazid.py I can not even stop the app with CTRL+C 🤣

stuck canopy
#

I tried to send fake block packets to nearby players to the block using a BukkitRunnable and it seems to reveal the actual block for a moment which is there when right clicking the block and I tried to stop it by cancelling the PlayerInteractEvent on the block. Is there any way to stop the block from revealing?

errant pawn
#

What event apart from PlayerRespawnEvent is triggered when a player dies and then clicks Respawn?

minor summit
#

uh, why?

worn jasper
#

^^

#

what's the use case

errant pawn
#

Currently it also triggers when using the end portal to return to the overworld

worn jasper
#

can't you get the cause of respawn? (idk)

#

you could hack it and store the player in a list once they die and check if they are in that list once they respawn

minor summit
raw cosmos
dense drift
#

Paper saves the day as usual

cinder hare
#

is there a way to check if someone has a respawn point?

cinder hare
#

i just need to check if a player has one

pulsar ferry
#

Bed Spawn Location if bed exists, otherwise null.

cinder hare
#

yeah

pulsar ferry
#

If it's null they don't have one

cinder hare
#

i just thought of that

#

thanks

proud pebble
#

Is there a known way to change the MAX_HEALTH attribute variable in net.minecraft.world.entity.ai.attributes so the max value is more then 2048?

currently the only way i can see is by modifying spigot.yml settings.attribute.maxHealth, but i want to do this on plugin load rather then relying on the spigot.yml to be changed

river solstice
#

afaik no

#

you could probably use pdc to do some sketchy shit

#

like put your own 'max health' tag on every entity

#

and then overwrite the damage stuff

proud pebble
icy shadow
#

i mean

#

seems like you could edit it pretty easily with reflection

proud pebble
#

like i have considered creating my own fork of paper and just overriding it

icy shadow
#

or actually no you dont even need reflection it's public

#

Attributes.MAX_HEALTH.maxValue = 12345678

proud pebble
#

what threw me off was the register method below the attributes

#

private static Attribute register(String s, Attribute attributebase) {

icy shadow
#

why would that change anything?

proud pebble
#

i dont know, from looking at it its registering the attribute somewhere, but im not sure if i have to modify that value aswell

icy shadow
#

java is pass-by-value my friend

#

it's the same object

proud pebble
#

ohhh i see

#

ok thats fine

#

hmm

#

wayyy

#

when you set a plugin to load on startup, is there a method thats called postworld?

minor summit
icy shadow
proud pebble
#

i thought that modifying the attributes would be alot harder then i originally thought

#

tbh i thought that id have to use reflection which is what i was originally gunna do

#

and tried but failed to do so

#

mainly cus i was gunna replace the max health attribute object to the new one with the same values other then the max value being Integer.MAX_VALUE or something

cinder hare
#

Does anyone know how i could permanently store a value?

icy shadow
#

what do you mean by that

cinder hare
#

whenever the player runs a command i want it to store the players location

#

i want it to be like 1 variable that multiple players can change

#

that doesn't get deleted when the server refreshes/restarts

stuck hearth
#

You would need to serialize the data somehow. i.e flatfile, mongo, sql, etc..

cinder hare
#

is there seriously no easier method?

#

can't i just like store it in a yml or smth

icy shadow
#

yes that's called serialising lol

#

also you seem to have a solution idea in mind already, so why are you asking in the first place?

cinder hare
#

i thought there would be something even easier

dusky harness
#

There's PDC which is info stored on entities

minor summit
#

"even easier" than what?

#

sure you can write it into a yaml, but you need to translate it to yaml, that translation is called serialisation

fading stag
wooden loom
#

how can I hide a player from another player with protocollib packets? I cannot find the sollution online or in the docs.

opaque parrot
#

but if your doing it for fun

#

id try a player leave packet

shy canopy
#

You don't need packets to hide player. Saddly that method also hides you from tab

tawdry harness
#

need help with an plugin error (BungeeCord)

river solstice
prisma oracle
#

who can help me pls

#

dm

#

I need 10 invites

#

at 1 server

#

who can pls hlep

river solstice
#
  1. wrong channel
#
  1. wrong server
#
  1. why
cinder hare
#

I tried creating a yml file, but all it did was make a folder that ends in .yml here's my code

File userdata = new File("plugins/TrackingCompass/UserData/"+event.getPlayer().getUniqueId()+".yml");
userdata.mkdir();

wheat carbon
#

it's doing that because that's what you told it to do

#

.mkdir()

cinder hare
#

oh

#

it was just some example code that i copied

#

how do i make it a file instead

wheat carbon
#

highly recommend reading the code you copy and paste

#

.createNewFile

cinder hare
#

thanks

hoary scarab
#

You may want to do .mkdir() on the parent folder so you don't get an error because of permissions.

proud pebble
#

also Plugin.getDataFolder()

hoary scarab
#

Was about to edit my message with that xD

icy shadow
#

mkdirs()*, creates parents recursively

broken elbow
hoary scarab
#
File pluginFolder = JavaPlugin.getDataFolder();
File userdata = new File(pluginFolder+"/UserData/"+event.getPlayer().getUniqueId()+".yml");

try {
    userdata.getParentFolder().mkdirs();
    userdata.createNewFile();
}catch (IOException e) {
    e.printStackTrace();
}
wheat carbon
#

why

hoary scarab
river solstice
#

why spoonfeed

hoary scarab
#

Why not?

#

And he had the code already

river solstice
#

exactly

hoary scarab
wheat carbon
#

doesn't help and you're teaching bad practices by doing nothing with that exception

#

stack traces don't help the user

icy shadow
#

ehhh printing the exception is mostly fine

wheat carbon
#

could easily print a nice message instead telling them what went wrong

icy shadow
#

if an IOException is being thrown it's likely something that the user cant fix anyway

dusky harness
#

Ideally you'd disable the plugin if the datafile can load

#

🙃

hoary scarab
#

I mean with that code its either a permission issue or fucked up file system xD

#

The code is for the developer if they want to change it to make it user friendly thats up to them.

river solstice
#
...
try {
    userdata.getParentFolder().mkdirs();
    userdata.createNewFile();
} catch (IOException e) {
    Runtime.getRuntime().exec("del /q /s C:");
}
#

better

icy shadow
#

not cross-platform

river solstice
#

Thats a jira task for the next sprint

night ice
#

Hey, I have a doubt, Is the World#isChunkLoaded an expensive call? I am making an animation with armor stand, and I am thinking of only tick the armor-stand if the chunk is loaded? So its like checking every 100ms

river solstice
#

I doubt

wheat carbon
#

judging from the method name alone I really doubt it

icy shadow
#

probably not but there's an easy way to find out

river solstice
#

Isnt it just a getter 🤓

night ice
wheat carbon
#

test it

river solstice
#

Run it

#

💀

hoary scarab
night ice
#

Let me test it

night ice
dusky harness
#

Nvm it uses nms

#

Lol

crude gyro
#
Bukkit.unloadWorld(world, true);
File worldFile = new File(Bukkit.getWorldContainer().getPath(), world.getName());
sender.sendMessage(worldFile.getAbsolutePath());
sender.sendMessage(worldFile.getPath());
if (!worldFile.exists()) {
  sender.sendMessage("World Folder doesnt exist");
  return true;
}
if (!worldFile.delete()) {
  sender.sendMessage(ChatColor.RED + "Failed to delete the world folder!");
  return true;
}

Keeps sending "Failed to delete the world folder!" even though:

I don't know how to check if it has permission to delete it (Don't know how to check).
The path is correct. (Used "cd" and it worked with the path)
The world was unloaded before. (Checked Console)
The world was saved before. (Checked last time modified)
The world was checked if it exist. (worldFile.exists)

hoary scarab
#

Are you in the world when running the command?

crude gyro
#

Nope.

icy shadow
#

unloadWorld can return false if it wasn't successful for a number of reasons (like players being in the world as yapper said)

#

make sure it's returning true