#development
1 messages · Page 39 of 1
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
I know but do you know how
oh, i thought you wanted to answered me because you replied to my message
Lol
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
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
finally working, now i just need to somehow make GUI for it 💀
i am in process of doing that, will post here what i've done if somebody ever needs this
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
i see
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
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
lol i can't believe
@proud pebble i did it without even utilizing PacketEvent OMG
i can't believe xddddddddddddddddddd
WHAT
ohh Player Info Remove exists
who's Test?
That is the question we all want the answer to
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
i actually wanted to reply to this, but needed to note gif i sent
Anyone got a tutorial or know how to make an animated Rainbow text to a hex color format
you might beable to intercept the spawn player and player list and stop them from being set to the player so that you dont have to wait a tick for it to be updated, would mean there is no players shown even on the first tick of them being on the server
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
does adding an item to a player's inventory drop the item if their inv is full?
I don’t think so
yo its the pit guy
True
come be a dev for mc football
its exactly what it sounds like
with crossbows and spectral arrows
we also got a baseball league
its super fun
No, add item returns a Map<Integer, ItemStack> which represents the leftovers
Tbh idk why it is a map instead of a simple List tbh
US football or normal football
us
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
so I would have to implement the dropping if inv is full myself I suppose
yeah but its a few extra lines
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
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)
is there a way to make a block work like redstone block giving out redstone signal?
setBlockPowered I think
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
Might need to do some NMS for that then
i knoe its very possible to do, tho it might need you to modify the server jar
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.
animation packet, although the player sends 20 animations/second when digging
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
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
}
true
Wouldn't even run because int
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
spigot has built in methods for using ymls
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
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
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?
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
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?
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.
Also check your gradle version
Those are set correctly
I just upgraded my Gradle to v8.0.1 and I'm getting the same error
Whoops, meant to uncheck the ping option, mb
do i need to include lib that only my function on other file use into main?
What
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);
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*
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
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?
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
Are your functions members of the same class?
im using cpp
oh, I've got no idea then lol, sorry
np
it's fine you can use it just fine
it's deprecated because md5 does not trust you are clever enough to use it correctly
hahaha okay, thank you
hello, top talent guys. I am senior developer and I am looking for someone who can do freelancing together.
in upwork and freelancer website
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?
Well, what do you want to do?
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());
Don't you have to use annotation processor for that?
¯_(ツ)_/¯
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;
}
...
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
You dont need nbt for that, spigot had an attribute api
I know that but i want to use nbt for other things too
it was more like a test that it works
you should be passing your main class to anything that has Plugin as a type
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
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)
I know you probably want a direct solution, but I don't have it. I can however get you started. This is a great resource for Coroutines: https://kotlinlang.org/docs/coroutines-overview.html.
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)
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.
can you give the imports as well please?
for both classes? yea sure uno momento
Downloader: https://paste.teamhelios.dev/JiR42rygfy
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
also text-compare.com if you want to see the differences.
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
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?
Any public anticheats have an API that exposes players estimated sensitivity?
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?
your not checking the status right?
yeah, I am just opening the gui when it triggers, no checks
are you checking if it fires with a message to console or anything like that?
weird
it should fire any time the resource pack is attempted to be loaded
or atleast thats what i thought
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
You apply the plugin like any other plugin, plugins { id("plugin.id.here") }
Yeah I know, I'm doing that
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
Yeah, its weird. As I say, its configuration looks identical to the rest, but it can't access any of my convention plugins
Likely local as PAPI is running sync and will probably be called often, and you probably don't want to run a network call every time
who says PAPI runs sync?
I assumed they're running it sync
and they said "without affecting the server's performance"
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
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
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
wdym by "unstable"?
It doesn’t load properly into the plugin on the server but it says it works on the JDE
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.
Name of automatic module 'opencv' is unstable, it is derived from the module's file name.
it saying ios not declared. but on https://cplusplus.com/doc/tutorial/files/ they use it ?
don't you have to use std::ios::in?
ah ok let me change that
but probably not since you have namespace std 😬
i change it to namespace std cause it keep screaming the error but it work now thanks
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
it was more of a general question, but I guess I have to make a local cache for cases when it is used async 😭
it is VERY annoying that the bullshit plugin messaging system requires a player to be online 
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;
what other ways are for a spigot servers to communicate with the proxy? Besides plugin messaging
not necessarily
well then you've got third party messaging services
redis
rabbitmq
and then you've got the universally feared sockets
sockets 
do they require a port to be opened?
better than plugin msg 
ye
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?
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
Aight
I wonder if waterfall or uh, the other proxy made by paper has a better system
Velocity
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
is this the correct way to create directory in same location as executable ?
fs::current_path(fs::temp_directory_path());
fs::create_directories("./Memory");
plugin msg is a façade for the custom payload packet inside Minecraft, it isn't much of a limitation as it is literally injecting a MC packet into the packet stream, which is why it uses the player connection to begin with
CC @dense drift
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
so i sent my program to a friend to try it out and this pop up, idk what i need to do, here is the code i pup on github (idk how to use it 💀 , pls spare me)
https://github.com/baole444/Calculate-EXP/releases/tag/v.1.0
Calculate Minecraft Exp using C++
Full Changelog: https://github.com/baole444/Calculate-EXP/commits/v.1.0
Yeah thats what i meant
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
Is there a way to check if plant grew itself or was bonemealed?
you could listen to bonemeal event and save that plant location
and remove it's location if it gets broken
declaration: package: org.bukkit.event.block, class: BlockFertilizeEvent
does BlockBreakEvent gets fired when a block is broken by a explosion?
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
declaration: package: org.bukkit.event.block, class: BlockExplodeEvent
If it works on your computer and not your friends, he needs to install c++ redistributables
oh.... lol totally forgot that u need it
yeah, that's fair
I will go with redis, is a good chance to learn more about it xD
sorry for second ping but he just install it and the program still missing dll :/
After installing redists you need to restart PC, not sure if he did that.
If that doesn’t fix it, I’m not sure
Depending on if its a default DLL?
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
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!
wrong channel
its finally work!!!
thanks
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
How are you making these
diagram app
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
Sure
Great thanks!
But tomorrow, hmu and i help
Thanks could we talk in DMs real quick?
Sure
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();
uh what are you even trying to do there
convert string to int and double
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;
yeah, that looks more like the example i'm reading 
instead of auto can i force data type ?
for accuracy
yes?
auto is just like java's var or kt's val/var
so the type is inferred from the method / value assigned
ah ok so if my var have its type declared auto should work fine right ?
yes, that is not the problem, whatever your problem is
no huge problem
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?
wouldn't you uh have to put that in the java source set?
you mean, create a java package exclusively for the module-info.java?
not a package but i mean putting it inside the java folder yes
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```
yeah i dunno, i never used jpms with kotlin, there's probably some SO question or some guide somewhere about properly combining both
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
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
this is the final jar btw
basically, for each package in the kt sources, create a mirror package in the java sources with some dummy class in it
BOOT-INF 
oh that's spring boot stuff
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!

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
How do I get a Username through a UUID? It's for a fork of a skin downloader mod
I guess you could use the server method to retrieve offlineplayer, and attempt to get the username from there I guess?
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
How do I like get the JSON value? (I'm sorry for being a little annoying, I'm just starting out with simple Java stuff)
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
}
]
}```
they're being moved into boot-inf, i don't know if and how spring manages all that, but it doesn't seem to be kotlin specific?
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)
lol nice
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
add a whitespace
how i do dat
press the space button on your keyboard
now its red
its red now
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.
you would just do the same thing
how would player's connection effect grabbing and saving data?
^ 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
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.
once you lose the connection, you can not reconnect within ms
Technically, maybe not; however, it sure looks like that.
Do you promise 🥺
I assure you it takes more than 1 second to connect to a server
Thank you King
lmao zod
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
you could wait to save their data
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
I’ll try to do that :), could I ask, is there something that causes data to be retrieved empty?
Within mysql
if your retrieving the data async, it could have not finished before you attempt to use the data
Alright i'll test it out, mind if i ping you if i come across the issue again?
Thanks for being so helpful ❤️
No problem
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!
what do you currently have
a terrible headache
sad :(
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()
if your using bukkit, why not just use the built in methods for doing this instead of going directly to snakeyaml
@proud pebble Where can I find the bukkit methods for this?
declaration: package: org.bukkit.configuration.file, class: FileConfiguration
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
@proud pebble Thank you! I am new to this so these links are very helpful
if you wanna get a yml embedded in the jar, this.getResource(String filename) exists, which you can get from your main class
so if the yml is block_colors.yml I'd do:
this.getResource(String block_colors.yml) exists
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
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
yeah
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
Once is serverversion and the other playerversion
yes, I want to compare if the player has connected via the server version
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
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
well UUIDs are not the same as Players
you may want to use the handy method Bukkit.getPlayer
Someone know how to disable Italic in components in lore of custom items?
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
Wym they're literally the same thing
Bm is right they're not the same thing
I was meming but I forgot this was serious channel
Smh
I think that UUIDs are like permanent identifiers, since you can change the name, but you can't change the UUID
That is correct
Anyways, should I give the faulty code?
send code
I can also give the rest that might affect it
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
they are, but a UUID is still not the same as a Player
^
and what line is causing the error?
one problem I can almost instantly see is that you don't have a getTag method in your RankManager https://github.com/MinemenFree/Practice/blob/c371cccf77d70091f6c15fcfa22780fa97a7c68e/src/main/java/rip/crystal/practice/essentials/chat/cPracticeChatFormat.java#L19
yeah. I meant to link line 20 here.
on every line you listed, you have getRankManager().getTag() but there's no getTag() in your rank manager
There is also no getPrefix
It gets it from Rank.java
getRankManager().getRank().getPrefix(sender.getUniqueId())
vs
.getRankManager().getTag(sender.getUniqueId())
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
That's what I said
Do you not see the difference in the 2?
The first gets the suffix from the rank it got
The second gets the tag
There are no rank tags
It gets a tag DIRECTLY
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
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
ty
Is that something that lombok lets you do? or what? I'm very confused.
I'm a beginner, plus I corrected my statement
I'm basically getting the active tag from a core like AquaCore
check the latest code
That creates «incompatible types: org.bukkit.entity.Player cannot be converted to java.util.UUID»
then pass the uuid instead
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
I'm trying to ping a bedrock server to get its info, but I can't figure out how to read the data as UTF-8 so MOTD is displayed right, any ideas?
Code: https://paste.helpch.at/tukerexobu.java
Result: https://paste.helpch.at/ozeyuguqeh.log
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```
collect all the bytes until you reach 0x00 into a BAOS and then use this https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/io/ByteArrayOutputStream.html#toString(java.nio.charset.Charset)
your current readString basically assumes ASCII encoding (one byte maps to one character)
oh that was like 40 minutes ago, @dense drift beep boop
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```
lol
couldn't they just return the data in individual fields 🤣
https://wiki.vg/Raknet_Protocol#Unconnected_Pong one fucking line smh
gaby
yes
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 🤣
this also answers your question of "There's something before the server info, idk what" lol
yeah I figured out 
Also creates an error LMAO
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 
Edit: yeah, it can't display M O and Y, and M and O are missing from there
You're right
thank you @minor summit
hm?
reading the length and then the string did the trick
huh
smh
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?
also, uh, any idea why when I add -Dfile.encoding=UTF-8 the section symbol is no longer removed? D:
Found out I can simplify this to just
final Matcher matcher = pattern.matcher(expectedResponse);
expectedRespose = matcher.replaceAll("<" + newTag + "$1/>");
Also had to modify the pattern from using .* to using .*? bcz I had issues with greediness.
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?
wdym?
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
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
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
Yeah I got you
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
I'm trying to think how I can make the placeholder return a specific value on any condition
Yeah I get what you mean
then what's the problem that you are having?
I have a hologram per chunk, that chunk contains information which I need to be able to replace a papi placeholder with
hmm
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
then id suggest to stick to internal placeholders for this
I might have to do placeholders locally and then enable papi
Yeah, exactly what I though
Alright, thank you very much
np

it is not an opinion, it is a fact
php still in top 10
idk what u on about
and I can't always choose the langs I want to use in uni
jk
top 10 what?
mistakes
tiobe
released languages in chronological order
would be 8th, apparently sql is a programming language
um
anyways, I didn't ask whether you like php or not
issue ^^^
Does anyone know what the DamageCause is when a strider gets hurt from rain?
gamer_touched_water
I assume you came here for a concrete answer and don't want to test it yourself, but I don't know for sure, I just have a recollection of it being SUFFOCATION.
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!
you should try that 
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
I always forget this for shadowJar, do I use the small file or the bigger one called like xxx-all?
bigger
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
Spawners arent dropped on vanilla?
You might want to check the source code of silk spawners
Yeah exactly, I'm creating a silk spawner plugin
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
declaration: package: org.bukkit.block, interface: CreatureSpawner
you can get the entity type to spawn
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)
you shouldn't be running network calls (so SQL stuff in this case) on the main thread
also
you should be using PreparedStatements
i think?
i dont use sql so i dont know much
does that mean I have to run them async?
ye
that way it won't block main thread
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
I normally get data from db on enable and store them at hashmaps etc
thanks
if you're running this for a lot of players you should probably do a single insert statement for all of them
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');
Maybe update the coords, not insert a new row every time
Yeah so I got something like that, but when I place the spawner again it's just a pig spawner https://paste.helpch.at/emobivirow.java
The game probably doesnt take into account the meta
Listen to block place event and set the entity type
you should store the entity type on the spawner itemstack, then on blockplace read the entity type and change the spawner's type
Oh yeah I didn't actually store the entity type, any idea how to do this?
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?
entity.getKey()?
Oh yeah ignore that lol, I think it's wrong
Make your own key and use the entity key as value
Ohhh yeah that'd make sense, what would the PDT be tho? pdc.set(key, PersistentDataType.BYTE, entity.getKey()); (2nd arg)
id use string
then just EntityType.valueOf() to get the value back
That's not a PDT tho, which is the issue
I've set the key to "EntityType" now and the value to Utils.getEntityType(spawnerItemMeta.displayName().toString()).getTypeId()
That should work right?
EntityType#name()
Ahhh I see
So it should be something like this? https://paste.helpch.at/ayovoberuk.java
so pdc.set(key,PersistentDataType.STRING, entity.name());
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;
}
ah
So that would technically work right?
I would ofc move the thing to set it but yeah
That would set the data on the STRING? Not sure what you mean
PersistentDataType?
You mean this for the 3 args for the pdc setter method right?
First argument should be the PDH
Yeah but I'm not using it like that, I use this instead of the normal setter
pdh,"entitytype",entityType.name()
uhh yeah
It didn't really work, it cannot find the "EntityType" key https://paste.helpch.at/tegoyivagi.java
So it prints Datacontainer doesnt have EntityType
I want to put custom models to a deluxe menu Menu, but it doesnt work for me (nbt_int: CustomModelData:2)
where is dataContainer defined?
CustomDataModel is now its own value
also #general-plugins
In the main class, passed through the constructor
what does that mean?
CustomDataModel: <value>
why are you using pdh and now pdc
not
why its still dont working, wtf
pdh is just any object that can have a pdc
model_data not CustomDataModel
sorry
ic
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
bro, i dont know why it is not working 2 me
no idea go to #general-plugins
https://www.curseforge.com/minecraft/mc-mods/nbt-tooltip use this to find out if the itemstack actually had the nbt tag or not
i use it while im working with nbt directly through nms to make sure the tags are showing correctly
if the block is spawner, clear the drops and spawn a new item entity of a spawner with the correct pdc
also doesnt look like your setting the item's metadata back
so the itemstack never gets its meta updated
yk,
spawnerItem.setItemMeta(spawnerItemMeta);
1-4
at least according to this https://www.spigotmc.org/wiki/raw-slot-ids/
(see player tab)
oh but that only works on InventoryClickEvent
those are the raw slots from the inventory view
you always have an inventory view open
weird, I canceled the click event if the raw slots were < 5 aka crafting slots, it does cancel it most of the time, but if I spam click at one point it lets it trough...
what could cause that?
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
how are you confirming it
the dupe?
confusion
rn I have a duels system, with kits, it stores your inventory and gives you a kit for your duel
yes, how are you certain it's actually duped and not just a ghost item in the client
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
.........
what
I was going to question it
I want to put custom models to a deluxe menu Menu, but it doesnt work for me (nbt_int: CustomModelData:2)
wrong channel
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?
assuming you're using JDA, start bot in onEnable and use #queue (vs #complete which blocks the thread), JDA handles the async in queue
Does that mean I have to use queue instead of complete and everything will magicly work :d
everywhere where it needs, yes
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
This is what my client wants, I would create an API and work with http requests normally
have suggested that?
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.
I was thinking like "Customers are always right" :d I'll suggest that
Thanks for suggestions
that expression is a common misconception
customers are always right when it comes to matters of taste
is the full saying i believe
^
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
well you wouldn't want to make a full discord library
I recommend https://jda.wiki
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
I meant I would have a Discord bot (prob handled with NodeJS) and whenever I get a discord command I would send a message to plugin
ohhhhh ok
just make sure you're running the http requests async then
I thought you were gonna make a whole discord library 💀 💀 💀 💀
Does anyone know why this code generates a compile-time error stating that a method isn't being implemented correctly? https://gist.github.com/BitCashMC/198d0b486b5cc2bf034ded4ba8be3c1a
what is the error exactly?
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
the error means that it can't find the interface, so as a result, it can't find the method
can you show your project structure?
yeah looks like you just forgot the second class lol
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
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
show project structure plz
FlopZone 🥲
how are you compiling?
if you compile Furniture alone then InteriorItems isn't being added to the compilation
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)
Wrong channel
any ideas how i can prevent players from rotating/moving their head/camera/view?
like this server does
cancel player move event?
that doesn't help
because PlayerMoveEvent triggers when player walks, not when he moves his head/camera view
the main concern here is:
- how to detect player head movement
PlayerMoveEvent triggers even when the player moves their head
not me jealous that i can't add reactions in this channel
tier 5 perk I think
I do
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
^
i googled 10+ pages of spigotmc forums and other (including the exact one you mentioned), tested stuff, then came here and asked
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
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
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)
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
wait seriously
why is it so high
lol
?roleperks
Any idea what's causing my plugin to not load due to an invalid plugin.yml? Error/plugin.yml/screenshot of my project path below
I did realize upon opening the compiled jar however that there was no plugin.yml to be seen inside of it, unsure as to why
https://gist.github.com/BitCashMC/644e0964292481d686dec1cc8ddd29dc
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
should i open and close file everytime function is call or open file when the program start and close when program stop
player head movement is always detectable, even if an event cant currently detect it due to the cpient sending packets on headmove otherwise its not possible for the head to show up
How is a vector written in YAML? For something like this
Vector posOneVec = section.getVector("one");
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
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
yeah, and the path to the class
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?
what does Bukkit.getWorlds() output
Testing now
try to add load: POSTWORLD in your plugin.yml (iirc that's the option & value)
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
probably this
they are probably not loaded yet
I see
because, you know, multiverse has to load first, then it loads the worlds
So I copy paste this? I dont change the "POSTWORLD"?
search spigot plugin.yml and check the available options
Alright
add dependency for multiverse maybe
welp
or loadafter option or wtv
Would this make the worlds load first?
Ohhh that's useful
Thanks
Wait
loadafter then
you can also just delay the part of the code that gets the world
^ or using a mv as a dependency
dependency, yes
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'.```
Oh yeah that might be true, how can you check btw? Is it the dependency name?
So this
second part here
If that makes sense
Just not with WE ofc
Oh
How do you know what to use as dependency name in plugin.yml then?
Name of plugin jar?
no, the filename can be anything
and it wouldnt know
it's that plugin's name section in plugin.yml
Ohhhh yeah that'd make sense, thank you
Yeah that worked, new error but I'll try and fix it myself first lol
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
you are not setting its contents
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";
JavaPlugin#saveResource(path, false)
how do I fix this
I am trying to open a inventory for a player when sending a message, using AsyncChatEvent
run a sync task, BukkitScheduler#runTaskSync
#runTaskAsynchronously?
sorry, it is just runTask
That worked yeah, ty
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
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 :/
minimessage
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
use the @Default annotation
Ahhh I see, thanks
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.
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));
});
yea do you know my problem?
there's a lot more concerning things to fix lmao
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 🤣
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?
What event apart from PlayerRespawnEvent is triggered when a player dies and then clicks Respawn?
uh, why?
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
you can check this https://jd.papermc.io/paper/1.19/org/bukkit/event/player/PlayerRespawnEvent.html#getRespawnFlags() and see if it contains the RespawnFlag.END_PORTAL
Does anyone know how to setup spigotmc beacon for port forwarding on ubuntu server?
https://www.spigotmc.org/wiki/port-forwarding/#troubleshooting
Paper saves the day as usual
is there a way to check if someone has a respawn point?
i just need to check if a player has one
Bed Spawn Location if bed exists, otherwise null.
yeah
If it's null they don't have one
any possible solutions?
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
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
the problem with that is i cant even do LivingEntity.setHealth() with a value higher then 2048
like i have considered creating my own fork of paper and just overriding it
or actually no you dont even need reflection it's public
Attributes.MAX_HEALTH.maxValue = 12345678
what threw me off was the register method below the attributes
private static Attribute register(String s, Attribute attributebase) {
why would that change anything?
i dont know, from looking at it its registering the attribute somewhere, but im not sure if i have to modify that value aswell
ohhh i see
ok thats fine
hmm
wayyy
when you set a plugin to load on startup, is there a method thats called postworld?
what the hell lol
ServerLoadEvent
¯_(ツ)_/¯
thanks
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
Does anyone know how i could permanently store a value?
what do you mean by that
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
You would need to serialize the data somehow. i.e flatfile, mongo, sql, etc..
that is part of etc.
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?
i thought there would be something even easier
There's PDC which is info stored on entities
"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
if you know sql you can use sqlite I believe it is the easiest method, I've used yaml file to store data before but I think it was a lot harder to create that architecture (not sure about is that true word) for me
how can I hide a player from another player with protocollib packets? I cannot find the sollution online or in the docs.
you could just use supervanish
but if your doing it for fun
id try a player leave packet
need help with an plugin error (BungeeCord)
Cool, you already posted it on #off-topic
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();
thanks
You may want to do .mkdir() on the parent folder so you don't get an error because of permissions.
also Plugin.getDataFolder()
Was about to edit my message with that xD
mkdirs()*, creates parents recursively
yourmom()*, gave birth to you
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();
}
why
Why what?
why spoonfeed
exactly
...
doesn't help and you're teaching bad practices by doing nothing with that exception
stack traces don't help the user
ehhh printing the exception is mostly fine
could easily print a nice message instead telling them what went wrong
if an IOException is being thrown it's likely something that the user cant fix anyway
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.
...
try {
userdata.getParentFolder().mkdirs();
userdata.createNewFile();
} catch (IOException e) {
Runtime.getRuntime().exec("del /q /s C:");
}
better
not cross-platform
Thats a jira task for the next sprint
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
I doubt
judging from the method name alone I really doubt it
probably not but there's an easy way to find out
Isnt it just a getter 🤓
Oo.. what is it?
test it
Not "expensive" and is async safe 😉
Let me test it
Oo..really...
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)
Are you in the world when running the command?
Nope.
