#development
1 messages Ā· Page 74 of 1
that way your core does not need to know about any other implementation details
it just provides the connection and everything stays easy to remove if need be
as for what you want to do, all you have to do is to have a main table with all the core data
with uuid as primary key
I still want to try doing what I was saying in that wall of text, even if it isn't the most efficient way I just really want to try it out lol I just like the idea of handling it like that
and side tables for other plugins
I know there is countless other ways to do it
I mean originally I was doing that
uuid as foreign key and you are set
I just wanted to try doing it that other way
for what you want to do, mongo might be the best if you are set on it
I don't think I got what I wanted to do across since it barely requires any SQL related stuff š„² it's oki I figured it was way too complicated to explain after I wrote 5 paragraphs haha
The database stuff I would look into later, now I am struggling Java wise
nah, i got what you want to do its just that sql is well structured
you want to delegate db stuff to your core plugin instead of letting each plugin do it for themselves
and what you want to do kinda goes against that
Yeah but also have all my plugins use that same PlayerData class too found in my core plugin
And that is what I am trying to do now
The database stuff I will do afterwards
if you're really stuck on having your generic player info map store, i'd recommend using a String,String instead of String,Object if possible
and maybe even consider using Redis for that
Yeah I had an AdditionalData object at some point
serializing you mean?
The issue though I am experiencing mainly is that
I want my smaller plugins to be able to call a registerAdditionalData() method to let my core plugin know "hey, plugin X is going to use the map to store String, Integer and String, Timestamp" or something
i dont see too much reason to hash a key object tbh, unless you are trying to align the database and make it ultra storage efficient
But I don't really know how to go about that
but tbh idk how much benefit hashing even gives you with that
i'd personally rather have a human readable name
Something like: each player data holds a map
that is hashed to a class type to - value
and you can hold column names in a seperate map if you need to
is there a reason to do this? what are you expecting will go wrong if you dont do it
and avoid the whole string fetch etc
Like, I'd want that map to be populated with a bunch of 'default values' through different implementations of that registerAdditionalMethod() by other plugins
I guess it's kind of a challenge for myself but also just a way to prevent duplicate data in the database due to typos or something
i dont think itll be easy to protect people from their own mistakes ngl
Yeah but there must be a way to turn this into some kind of registration system, where each plugin registers a set amount of additional data onto that map in their onEnable()
i think requiring a registration will make things a lot more complicated than it needs to be
i mean you could have the best of both worlds
and make your registration create a new table internally
however i do think being able to set defaults for a key is reasonable
I don't like the idea of having 20 smaller plugins with 20 different tables though in all honesty
that is what sql is made for
also allows you to avoid a lot of nullable columns as well
i mean are all the plugins doing different things?
I got 4 so far, I wouldn't know haha
another thing you need to keep in mind is that your plugins will need to query the whole table
each time
even when they might not need to store the data half the time
Not if the data is all stored inside of the core plugin
Whichever the solution is, I want all SQL related code only in my core plugin
yes you can do that
And Hikari
Anything to do with the database or SQL I really want to just keep in my core plugin
you can avoid all sql in dependent plugins while also not making an uber table
what you should do to achieve that imho is to have a data class per plugin
and make your core handle the sql from those data classes
Would it consist of serializing data files into jsons and creating a parser in my core plugin to store the serialized data into the database as separate columns?
i would do tables
No I meant like
all you have to do is to relate tables to each other with keys
and your other plugins just need to provide a data class - use fetch methods
that take a type variable
tbh separate tables per plugin are gonna be really annoying the more i think about it
imagine the pain when you have a plugin that wants to alter its schema
Right now I got two tables: PlayerData and PlayerSettings
And they're used by the four plugins
If 6 plugins have "settings" to tweak and "data", I feel like having two tables per plugin containing maybe 1-2 columns would get kinda tedious
with how you want to use sql
you really should look into mongo imho
its effectively json as a database
true, this seems like a pretty decent usecase for mongo
each player can have different settings set or just not have it
or different data set
no structure needed
you want to store very high variance data between your different plugins
and access it from one place
albeit you can provide it to make queries faster
with mongo you dont really do much
other than provide data classes
you can just have this for example
I think I just gotta look into this with fresh eyes tomorrow, I don't really think I will ever be able to explain what I am trying to achieve so I will just need to keep at it š„²
just serialize all settings as a map and dump it i guess lol
I just really liked the idea of my plugins registering their own data types which the core plugin would store in the PlayerData class to then be stored on the database
if he wants String,Object then it might get pretty lengthy
As much as it may be more complicated
depending on what plugins decide to store
compress and dump then 
The objects would just be integers and timestamps I'm pretty sure
I mean how much player data could there be lol
I just use LuckPerms meta for my player data needs
nickname, tag, etc.
Though again, the main thing I was struggling with is coming up with a "registration" system
just a map
inventory contents with nbt data
yeah just namespace the keys lol
wait this is like, a cross-server player inventory storage thing?
Yes but I also want to prevent additional objects to be inserted in the map once the server has fully loaded
idk, it sounds very generic so i didnt rule that out
Once all the plugins have loaded
do what papi does
- Core plugin loads, with the
PlayerDataclass and the emptyadditionalDatamap - Other plugins load, and populate the
additionalDatamap with their own pairings of keys and default values - Once the server has fully loaded and all plugins are too, this map should become immutable and only allow for existing values to be updated
I don't get what that would do
server starts ticking
The issue is adding to the map and then making it immutable later on
after plugin loading is done
you just wrap your map in a class
and close set access
Right
But then I wonder
This register method, would it be in my PlayerData class?
That feels like it would go against the single responsibility principle
no, single responsibility
what lol
register in the map wrapper class thing
whatever you name it
honestly you are just reinventing orms
Riight okay so I'd have to make a map wrapper class
way worse
you're thinking too ahrd about this lol
At least I don't need to sit down and learn them since I am writing them myself 
I am sure that when I try writing it tomorrow I will run into some other issue and realize I didn't explain myself properly
I think I just need to sleep lol
For database storage though, the idea was that once the server has loaded before actually loading data from the tables I'd be modifying the query based on what data the map found inside of PlayerData contains
I mean whenever a new plugin pops up or I add new functionalities to an existing one
i feel @dusty frost's dump everything into a map -> serialize and dump into db - deserialize is the laziest and fastest way to get what you want
Wdym
like your query wouldn't change
If my plugin suddently has a new setting, i'd need to add a new column to keep track of that new setting for all players no?
i think they want to dynamically select columns
you should not have a column per setting bro
depending on whats loaded
yeah i mean i get that but that's not very smart lol
What why not? How else can I have a "switch" setting
Something like show players on or off
giga settings map per player
^
Is that humanly readable though
never seen JSON? lmao
why are you reading dbs manually anyway
Idk it's kinda satisfying
yeah, you never seen JSON?
you just store JSON in the db column lmao
How will a Json fit in such a small space
what lol


wha
you could store it in bytes if you must, human readability matters nothing very little
I'm just going to sleep, I'm either getting a psychosis or what I am doing is beyond human comprehension in this instant
its psychosis
yea what lol
i think you have a fundamental misunderstanding of what a database is lol
you can just like, store a string in there
most DBs also have dedicated JSON types
not me getting a first in my database module last year
I know what you meant, I just don't like how a stored json would look like in a database interface
I am aware there is a million better ways to go about most of this stuff, and that what I want to do is not the most efficient or smartest, it's just a challenge I am setting myself
it would look pretty printed lol
And I was struggling to grasp how to implement a registration system for the map
like JSON does
JSON 𤢠, .txt with scanners š
when you read it
i challenge myself to jump off a bridge
i went and read why this is
might not be efficient but its a challenge
and sql stores bools as 8 bit? like why
How significant is that though
each bool takes 8x the size it needs to
effectively
does it matter for your use case? probably not
a byte each, I'd need like a million users to feel that
i mean yeah but just the overhead
having like a hundred columns and stuff is way worse
I know I could store the json but I just find it way cleaner to separate the data per column even if it occupies more space
a compact single-column serialization format for the supremely non-relational data you're storing is the way to go
i mean it's just not a smart way to do it lol
you're not storing relational data
in a relational database
i mean they are doing relational data
they just wanna put all of the data in one place for some reason
i mean singular settings aren't very relational lol
i wouldnt consider it relational yeah
the plugin partitioning is just organizational
where are the relations?!!
doesn't make it relational
It's not a singular place, i'd be splitting the data manually between tables based on their use instead of based on what plugin they come from
wtf lol
I give up
that is so not a good idea lol
I'll just try figuring it out myself and see what happens
i mean if you want some inspiration, look at how like GTA Online does it
they load like 500MB of JSON at startup for a bunch of stuff
if they can get away with it, you surely can lol
All this talk is just making me more confused
didnt they have like an issue where they were going through the whole file each time
causing 10 min load times
yea something like that lol
Why is it not a good idea to store data based on its use instead of where it came from, if it all goes through the same plugin anyway and is all stored in the same plugin roof
Too*
it's not a good idea to make a bunch of random tables lol
Theyāre not random though
then you have plugins that circularly depend on each other as well
the whole point of this "core" plugin is consolidation and centralization
They are in terms of the relational schema
I didn't either lol, but people seem to like em
I like the idea of keeping as much common code inside of a core plugin
i get putting all shared dependencies
nah I just use the Spigot library loader
I got a crap ton of util methods in there as well
gonna swap to the Paper library loader soon and use a locally hosted mirror and everything
Hence I want that core plugin to do all the database stuff and store all the data for all plugins too
I mean yeah you don't seem to have very relational data lol
like you just want a per-user map essentially it seems
mongo would be ideal honestly
which would be best served with yeah a non-relational databse
but if it must be MySQL or adjacent, then a JSON column would work wonders
i make a new database for each player 
9f7cf461-903f-4ef8-8a88-bdbc49806364.db goes hard 
Is it not relational cause itās too few tables that arenāt really related to each other other than the primary key?
It's not relational because that's not relational data lol
its not relational because its not relational
it's all just miscellaneous key-value pairs namespaced per user
You guys are really
Good at explaining
I mean like I don't know how else to describe it lol
(Forgot to turn off ping on my phone sorry)
like it just isn't the right kind of data to be stored in a relational database lol
It doesn't use the strengths of the design at all
The String in the maps would be the name of the column
And the value would be the value
Map*
But howās that different than a plugin having 10 different columns with values
I mean the point is the relations between the tables
Key-value user setting data is never going to be relational
it's not! relational would be more like making queries that stretch across multiple tables
I donāt get how 10 plugins having 10 separate tables with key value pairs would be more relational than 10 plugins using 5 tables all together
I mean it's not
I donāt really know what the application of that would be
lmao
In my plugins at least
yeah yet another MongoDB would be better
if you don't even know what relational data is then you probably shouldn't be using a relational database
I can see how it could be useful in other real world applications but for Minecraft plugins I donāt really get it
in your case what you gain is modularity
Like for instance, say you have a train network. You would have a table for Train, a table for Passenger, a table for Station, a table for TrainRide, etc.
arbitrarily bundling data is just a bad idea
and they all interconnect very well
Yeah I know how it can apply in the real world
I mean I've literally done that exact scenario lol
I just donāt get how it applies to a Minecraft server though
for a train plugin I wrote for fast travel
and then later I realized how overengineered it was, and just moved to yaml configuration and storing ride data in JSON blobs
again consider using redis instead of a relational db š or like etcd
I donāt want to rewrite half my stuff to switch to something else fml š„²
etcd š
I mean Mongo would literally be perfect for this lol
could easily dynamically add columns, etc.
Is that a bad thing? Using mongo?
I mean for this not really
Especially if it's just for your own stuff, then it's basically perfect
It feels like a downgrade
It's a major upgrade for the data you want to store lol
You wouldn't need to dynamically migrate new columns and shit
you literally just store JSON raw and it loves it
(I donāt want to store raw jsons⦠:,,,)
why not
{
"flag": true,
"username": "fjdklafjslk",
"otherFlag": false,
}``` etc,
Is Mongo a solution to my stubbornness or a solution to my server ecosystem
Thatās what I mean
a non-relational database is the best way to store non-relational data
and based on what you have been saying, it seems like you will not be having any relational data any time soon lol
Are non-relational databases looked down upon or something? I donāt wanna be at a point in a few months where I heavily regret using mongo and seeing people being like āomg he used mongo what an idiotā
(Itās happened in the modding community a lot, stuff like this)
I mean a little bit
But Mongo has grown a lot since the olden days
and like, I heavily abuse Redis for my server stuff
(Where Iād be told to use api X or library Y and then weeks later be told that it sucks etc)
I mean the kind of stuff you're storing doesn't benefit from the strict constraints of a relational database
if you want to do heavy queries over data = sql
so freeing yourself from that, either through a JSON column or through Mongo, would improve your life lol
otherwise stuff like mongo works fine
yeah like you're not going to be having millions of rows or anything
people will say this about what you use regardless of what it is
is the best way to store persistent data through restarts PersistentDataContainers or something else like config files?
Players, entities and some blocks have PDC
i wanted to store bounty amounts of players and top bounty claimers but i also wanna access it when theyre offline so i could either store that stuff on the world or use something else
Bounty amount could be stored PDC but for everything you want to access offline I would go with files or DB
alright
Online I am reading a lot of people shitting on MongoDB, are we sure that is really what I need to use
Nah never mind I'm not using MongoDB, too many people seem to say it's bad
Are you making a public plugin?
How is it bad
what you are currently doing is way worse than people claim mongo is lol
mongo is "bad" because people are lazy and cant be arsed to set up proper relational schemas
I think I will end up having a table per plugin
I have figured out how to set up a registry system for data types
I will simply have PlayerData in my core plugin store all player data for all plugins, and additionally my core plugin will create the tables for each plugin itself and also insert the data for each plugin
Is it safe to do JavaPlugin.equals(JavaPlugin)?
There should be only ever one instance of each JavaPlugin right?
The question is, why would you need that?
I mean sorry
it would be plugin1.equals(plugin2)
I have a list containing objects that use the plugin they come from and a string as an identifier
And to check for duplicates I check if the two objects come from the same plugin and have the same string
Should be enough to check the name, the server canāt load two plugins with the same name
Though with reloading, any aspect of that might break randomly
Yeah I know I can check the names, but I'm wondering if checking the objects themselves works too?
It should right as only one instance of each plugin can exist
how i can send a fake packet on tablist? (i could send a screenshot but cant)
Can always check source :))
you can compare object references without issue as long as they are the same object
Is deluxe-tags open source?
I was hoping to change the command from /tags to /titles, do some text changes, and add buffs to players when they have certain tags equipped.
I think the third one can be done with another plugin
- No
- For
/titlescommand, you can use the bukkit commands.yml file to create an alias and maybe block the/tagscommand. - What messages exactly? I thought all plugin messages are editable in DeluxeTags.
- Probably what you said.
Thanks I will look at it and I think your are right about 3. I will dive into the messages config.
Any idea which plugin would be able to do number 4?
no
would probably have to have a custom plugin for buffs
I see...thanks!
or write your own placeholder for the tag, that parses the current DT placeholder for the active tag and apply effects by using the returned value from DT 
I definitely think that would be the way to go XD
it would still be nice to be able to listen for the event though
How can I check database performance?
Before I figure out how to optimize my code I wanna make sure it is worth optimizing yk
Well, I mean, determine what are the worst case scenarios, and test them
Also wdym check dB performance? Like the query times?
check decibel performance
Are you having issues? That's what you should be asking, if there is no notable issues you probably don't need to optimize
Does anyone know about the Maven shade plugin? I have a problem that my relocations don't work. Does anyone have an idea what I could have done wrong here? The specified packages from my side have been created. Nbtapi and inventory framework are not relocating
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>de.tr7zw.2.12.2.nbtapi</pattern>
<shadedPattern>de.lightplugins.skyblock.nbtapi</shadedPattern>
</relocation>
<relocation>
<pattern>me.devnatan</pattern>
<shadedPattern>de.lightplugins.skyblock.invframework</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
What task are you running to build the jar?
i used the intellij builder
You are using maven you need to build with maven, run mvn clean package to shade
The jar should be put in the target folder
can i share here pictures throw links ?
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
https://prnt.sc/ZXzmtnPultWw
got the error Unsupported class file major version 60
Oh also I wanted to ask does DeluxeTags provide events that I can listen for?
I'm pretty sure it does not
it says that im using java 16 for no reason
i build it with java 17
You might need to update the shade and compile plugin to a version that supports java 16
Use a paste and send your entire pom
That looks incomplete
That's the end for me, it's missing more plugins, and even it's not closing the plugins and build blocks
lol, good job hastebin ... 
For some reason you don't have the compile plugin in there
Add this block to your plugins https://pastes.dev/jxRmeU1bJG
Oh wait
it does have it, ignore me lol
Update the version to 3.12.2
instead of 3.8.1
And shade plugin to 3.5.1
Cannot resolve plugin org.apache.maven.plugins:maven-compiler-plugin:3.12.2
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.2</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
Try 3.12.1
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.056 s
[INFO] Finished at: 2024-02-20T20:49:32+01:00
[INFO] ------------------------------------------------------------------------`
yes
Huge ;p
thanks Matt ā„
Dang that means ill have to set a timer that parses and updates the titles for buffs
rip
Make sure you're getting the right jar, I haven't used maven in a while but it might create 2 jars, take the bigger one
its now 5 mn, way to huge i guess
i see you're using 1.20; if inventory framework, hikaricp, mariadb, and slf4j are on maven central, you can use spigot libraries system
spigot downloads it automatically, so your plugin doesn't need to shade it
a super nice feature but not very well known
wasn't it like super bad when it came to different versions of the same library?
i think bc it separates the classloaders and stuff it should be fine? but idk
Does changing the name tag of a player require packets?
can't you change the player's displayname
death message? that'll probably involve a listener
for head name, yeah ig probably packets
I tried to do this recently, under @ Emilyās guidance I ended up settling on adding a TextDisplay as a passenger to the player
or something with scoreboard maybe?
I see so there isn't an easy way to do it
oh
No, I tried for quite awhile with the NMS route (I prefer nms for certain applications) but donāt remember what exactly the issue I ran into. Plus this method allows you to add multiple lines without much more hassle if you want
I see
There are some extra handlers youāll have to add for this application off the top of my head
- Add to player on load in
- Remove from player on exit
- Remove and re-add when a player tries to TP (you canāt teleport if you have passengers)
But one bright side, TextDisplays canāt be seen through walls (on Java)
how save and load a hashmap
public HashMap<Player, Integer> data = new HashMap<>();
I'm famous
Can I have your autograph?
Iād do..
public Map<Player, Integer> data = new HashMap();
š
chose a database you want to use and google how to save data to "x" database using java
and make sure to use async functions for database related stuff
no i need save hashmaps
save them where?
your hash map is saved only in memory. If you restart your server the list is empty
so just do it xd
he can just use FileConfiguration from bukkit
and how create a permanent database
first you must create your data.yml
https://www.spigotmc.org/wiki/save-load-data-files/
edit: oh this isn't a yml file
hold on i know theres a yml one
https://www.spigotmc.org/wiki/config-files/#using-custom-configurations
this one
and load this file on server start
What is easy treatment and the best database?
best database is still mysql
how create this with intelij?
you need the mariadb driver first, then you can use for example hikaricp
ummmm I wouldn't recommend that right now
I don't know how much experience he has with programming tbh, but i always recommend to use hikari as datasource
No final? š
if its finlal, he cant change the values inside
final just means you can't reassign the variable
oh you got right, i missreaded the last answer xd
The variable is final, the map is mutable, you can't reasign it, but you can still put/remove, etc
Good spot š«£
alright i tested the libaries from spigot.
InvFramework is working. But i cant figure out what librarie is for nbtapi
libraries:
- me.devnatan:inventory-framework-platform-paper:3.1.0-rc
- de.tr7zw:item-nbt-api-plugin:2.12.2
it only works if it's on maven central
which nbtapi isn't
maven central repo
basically, if it specifies a custom repository, it won't work
that's just the softdepend/depend stuff
so i must install nbtapi on the server ._.
if you want 𤷠or you can shade it like how you're doing rn
the other libraries mentioned here should work though
i think most, if not all of those are on maven central
alright, then i still shade nbtapi
btw what is changeme in <pattern>de.tr7zw.changeme.nbtapi</pattern> ? ill think maybe the version ?
it's just a reminder to change it
since you should relocate all the libraries you shade into its own package
scroll to the bottom here
yep, but i should changeme replace with the current version ?
nono keep it as changeme
thats confusing haha
In theory it is, Paper Plugin Loaders also provide this feature, but way better since you can add your own repos while still only downloading them on load.
triumph-guis
ohh maven central ._.
?
it has maven central repo
mhh last update 4 months ago
any other inv frameworks out there ?
th does that have to do with if a library is good or not lmao?
if theres no bugs then it doesn't need constant updating :)
^^
thats true
i found another one with an intellij plugin that show the live gui in the IDE
https://github.com/Simplix-Softworks/Cirrus
wouldn't that mean hardcoded menus tho š¤
that looks interresting
but thats cool
yesish
no you create a config and see the results in real time
ah
the main shitty thing is that it's all json
aka not that user friendly to the common minecraft
oh hell, yes ._.
but its cool anyways
I recall telling matt about this xD
meanwhile I am still debating my life if I should use PacketEvents or ProtocolLib
uii found another one https://github.com/NichtStudioCode/InvUI
protocolLib <.<
i think protocollib is already pretty well used
ngl ProtocolLib is in almost 50k servers, would assume most servers have it
theres also tinysomething
i think
but theres a lot of manual stuff that you have to do i think
yeah but my main concerns is that it requires to be installed (if the user doesn't have it already)
mhm
and well, they still haven't released a 1.20.4 build
only dev builds
texture packs
and packets
it opens a normal anvil and uses the player's inventory as a GUI
it looks nice tbh
šŖ
cant use even gifs ._.
wait a damn minute
i have no gif perms ._.
suppose that's a tier 6 or 7 thing
hehehehehehehehe
you get them at tier 3? if I am not mistaken
?roleperks
thats not fair :((
tier 2
Embed links in most channels
barry is judging me ā¹ļø
boosters get the most benefits
fair enough
either way
yeah I will just switch to ProtocolLib and use packetwrapper too lmao
ill think i buy some boosters for pay2win š¤”
both? š
my project has been waiting for a version in modrinth and hangar lmao
wdym?
^^
btw i wouldn't recommend using it directly since its outdated on some stuff
but u can use as reference
that's one of the things I fking love about packetevents
š
if it wasn't for that ONE single bug I have with packetevents
what bug is it?
š
I am too dumb to fix, my knowledge is very limited packetwise
so here we go again, but thit time with booster ._.
had hopes
think he answered cause I was complaining the other day
xd
oh lol
imagine you still don't get embed perms
xD
but yeah it's something about it being an NBT chat component and not json chat component?
its a scam :((
at least that's what I got told
Expected nbt type STRING, read INT
not a very specific error ā¹ļø
^^
idk
if we are talk about protocolLib, anyone has experienced with it ?
although that seems a bit odd
šāāļø
since this would imply ALL components are encoded with NBT
which doesn't explain the fact this only happens with /give
lmao
ok i have a challange for you
I mean, I was using it before switching to packetevents
i created a virtu sign for inputs throw protocolLib. But predefined lines are not written. The virtu sign is emty.
You know where the problem is ?
// Set the location of the sign
location = player.getLocation();
location.setY(location.getBlockY() - 4); // -4 offset because the sign should under the player
// Create and send the sign block change
player.sendBlockChange(location, Material.OAK_SIGN.createBlockData());
// Set the text for the sign
String[] signText = new String[4]; // maybe String[3] is working ?!
for (int i = 0; i < 3; i++) {
signText[i] = color(text.get(i)); // Assuming color method is defined elsewhere
}
player.sendSignChange(location, signText);
I mean, he already said this but I am too impatient lmao
why via packets?
yes
you can easily do that with the api
Oh
Sorry afk for a bit
unsure what that has todo with packets
easly haha then explain how i dot this. I tested it many hours with no success
:-:
public final class Menu {
private final List<String> text;
private BiPredicate<Player, String[]> response;
private boolean reopenIfFail;
private Location location;
private boolean forceClose;
Menu(List<String> text) {
this.text = text;
}
public Menu reopenIfFail(boolean value) {
this.reopenIfFail = value;
return this;
}
public Menu response(BiPredicate<Player, String[]> response) {
this.response = response;
return this;
}
/**
* Open the sign GUI for the player
*
* @param player the player to open the sign GUI for
*/
public void open(Player player) {
// Ensure player is not null
Objects.requireNonNull(player, "player");
// Return if the player is not online
if (!player.isOnline()) {
return;
}
// Set the location of the sign
location = player.getLocation();
location.setY(location.getBlockY() - 4); // -4 offset because the sign should under the player
// Create and send the sign block change
player.sendBlockChange(location, Material.OAK_SIGN.createBlockData());
// Set the text for the sign
String[] signText = new String[4]; // maybe String[3] is working ?!
for (int i = 0; i < 3; i++) {
signText[i] = color(text.get(i)); // Assuming color method is defined elsewhere
}
player.sendSignChange(location, signText);
// Create and send the packet to open the sign editor
PacketContainer openSign = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.OPEN_SIGN_EDITOR);
BlockPosition position = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ());
openSign.getBlockPositionModifier().write(0, position);
ProtocolLibrary.getProtocolManager().sendServerPacket(player, openSign);
// Add the player and this sign to the inputs map
inputs.put(player, this);
}
public void close(Player player, boolean force) {
this.forceClose = force;
if (player.isOnline()) {
player.closeInventory();
}
}
public void close(Player player) {
close(player, false);
}
private String color(String input) {
return Main.colorTranslation.hexTranslation(input);
}
}
here the current methode to create a "Menu" (virtu sign)
yep, the input etc is working all the way fine. But the predefined lines are not writing
I know that if you have a Sign object, there is a setLine method
so in theory you could place a random sign anywhere in the world, set the lines and open it to the player?
I read something about it, but the sign is physically there
I also read something about the fact that the sign is too far away and the text cannot be rendered
in the old versions its working fine. But the newest updates, where you can write both sides of signs are not working.
I figured out that whole database mess thingy I was talking about yesterday haha
I've created a monster
š
Star and Aki are gonna claw their eyes out
that reminds me that I gotta finish my SQL library
this is still happening to me š ping if reply
this is a screenshot of the database, everything appears to match up
what i dont understand is why there is both a TARGET and target column
The error with code 42103 is thrown when trying to query, modify or drop a table or view that does not exists in this schema and database but similar names were found

idk depends on how you initially defined the table
Anyone know how to prevent popups like this from happening?
ah reminds me of the classic "Destroy the tree" message
Some servers seem to have it disabled, so I assume that it can be done
Just not sure how
And oddly enough google yields like no results for it
what if you just give the player wood for one tick
lol
(you don't actually have to break it)
Well this one is different as you can see
I mean you must be able to control it somehow
Because it doesnāt happen at all on hypixel
And most large servers
u sure? š¤Ø
if u like make a backup of your .minecraft folder and launch with empty does it happen
bc the client could store the data based off server ip
Still happens
Does not pop up on hypixel
oh huh
maybe setup a protocollib packet listener or smth
still would be a bit surprised if it is server side tho
took me a bit to figure out for the first time but you can setup ProtocolLib to listen to all packets
and its data
PacketType.something.getInstance().values() or something
and i dont remember how to get & print its data š„² (but its possible)
Im just using my own packet injector
oh
Let me get all the data
Nothing helpful there
Change this in your spigot.yml
advancements:
disable-saving: true
disabled:
- '*'
hypixel use their own server software
for the recipes you must use packets https://wiki.vg/Protocol#Update_Recipe_Book
That didnt seem to fix it
For the advancements it worked, Iāll test it before few minutes. But the recipes you should manipulate the packets
Fixed it using
stats:
disable-saving: true
forced-stats:
achievement:
openInventory: 1```
Discrepancies might be because I'm running version 1.8
1.8 
lol
Say what you will, but itās still exponentially better for large scale networks with micro instances
If mojang got their shit together and optimized their newer server jars id be using them instead
hypixel has started to update from 1.8.8 to 1.20
Not through conventional means
Theyāre literally gutting the 1.20 server jar and adding features onto 1.8
One by one
of course their have a own server instance
My point is that for my use case, using 1.8 just makes a lot more sense
But youāre perfectly valid for not wanting to go out of your way to answer questions regarding it
And I apologize for not mentioning it up front
It doesn't matter, I was still looking for a solution especially for you
so no apologized needed for this :))
Thank you
Fr?
hey does, TAB have a method like "setScoreboard(player, scoreboardname)" ?
Check if there is a command for that and then see what it does š
Yep
yeah i know. but as shown in the screenshot, the database & table & column do exist
Hi guys if i switch from Holographidisplays to decent holograms
Can i still keep my folder of Holo?
I feel like this is something you can test faster than a response would take⦠but anyway no you canāt
thats not exactly an advancement
the name of the thing is "toast"
not sure whether you can disable those
apparently spigot and/or minecraft calls it advancement internally š¤·
already known this, but toasts are client side. But you can modify these with packets. But removing it is not possible i think
the tutorial toasts are (almost) entirely client sided and it's saved in the client options file
from the server you can skip it, for example by switching the player to a non-survival gamemode
oh god this is not very server controllable
yeah no this is basically client sided unless they complete any step in any non-survival gamemode
which is still fairly client sided
but at least you can control the gamemode
Hey. Just curious for Papi Townychat I downloaded from Ecloud a bulk of the placeholders are blank. (The server I am on has townychat and I have tried mutliple times to have the placeholder %townychat_channel_name% save to Tc, Nc, etc) I am considering making my own Papi expansion, but I wanted to check here if others had the same issue. I parsed though papi and the placeholders are 100% blank. If you need any more info let me know.
what do you mean by blank ?
did you already tried /papi parse YourName %the_placeholder% ?
Yep. I downloaded the placeholder and already loaded it into papi. I ran a command relating to the plug-in the placeholder is part of. For this case itās towny chat so I ran /tc. Then I went through a lot of the place holders. The only ones that had anything was town name and the default placeholder. Iām a bit confused why eCloud would have the placeholders and not use them hence why Iām assuming I did something wrong.
(I did run papi parse)
Hello, i'm having a problem creating a PlaceHolder expansion in one of my plugins
may someone help me please?
In the triumph API for commands, how do you handle an optional int parameter?
Make it Integer and annotate it with @Optional
Cool thank you
All my plugins keep giving me an error regarding Artifacts.getInstance() being null, though I don't really get why it would be?
I have a field private static Artifacts instance, which I assign in my onEnable() with instance = this
I do this exact thing in another plugin of mine, and it works
Providing code would be helpful. Make sure that you're not getting the instance from a static block which would be called before onEnable.
The section of code which throws that exception is way after the plugin is enabled
I'll give more context in a sec sorry
would recommend using Dependency Injection
Yeah I normally do that
then why aren't you now
Why arent you setting it in constructor
I need that instance inside of a static class
Which I would wanna avoid instantiating if possible
Yeah I'll do that
think the main question is why?
Well
This is a registry class which holds all references to custom items in my plugin
you can also still pass it through DI, even if it's a static class, so I don't see the issue
Each of these items requires an instance of this plugin's main class
Once I fix another issue with my database I will try replacing the getInstance() with DI I guess, but I remember there being multiple reasons to why I opted for that method instead of DI
I will get back to that once I figured out this other ongoing issue sorry
NamespacedKey key1 = new NamespacedKey("test", "value");
NamespacedKey key2 = new NamespacedKey("test", "value");
map.put(key1, someObject);
Object obj = map.get(key2);
```Will this succesfully get `someObject`?
I think it does right? Since NamespacedKey overrides equals()?
Reading how Map#get() works
if hashCode and equals is properly implemented for NamespacedKey and the map is a HashMap or a compatible subtype
(If map is e.g. IdentityHashMap, it won't work)
Listen for when a hopper is transferring items, have it message all staff members (Could also have text message implementations for the offline staff) and the staff tps to the hopper and manually transfers the items. Youāre welcome be sure to leave me a rating if my answer helped you š šÆ š¤Æ
Okay so: What if there is a static method inside of my main class, and in that I need to get the logger?
Should I just have an instance of my main class as a parameter
But what if this same method needs to be called by other plugins too, who don't have an instance of the plugin's main class?
That's where I feel like JavaPlugin.getInstance() makes sense
Huh
Nah what is going on actually
public Artifacts() {
System.out.println("New instance");
instance = this;
}``` I assign `instance` a value in the constructor, yet when I try using that variable in a static method in the same class later on it has a value of null?
This is the case only for that plugin
Another plugin instead has no issues with getInstance()
Am I going insane
public static final Map<NamespacedKey, ArtifactItem> ARTIFACTS = new HashMap<>(); I got this map which values I add from other mods too, and even though all those mods load after this one the map results empty?
I tried that too, same issue
or you could do the if instance == null instance = this return instance on the getInstance method
In general, my plugin's main class seems to be having issues since both my instance field is null and ARTIFACTS is empty though other plugins add to it
Like look at this
public static void registerArtifact(ArtifactItem item) {
Bukkit.getLogger().info("Registering artifact: " + item.getKey());
ARTIFACTS.put(item.getKey(), item);
}```
Yet when I check the contents of ARTIFACTS, it results empty?
Not sure I understand what you mean
It's as if my other plugins have access to a different copy of this plugin
Ah
What happens if in my pom.xml
<groupId>com.klyser8.github</groupId>
<artifactId>Artifacts</artifactId>
<version>1.0.0</version>```I did this, without the `<scope>provided</scope>` section?
Does it bundle the dependency into the plugin, resulting in effectively two copies of each class?
how are you checking if its empty or not?
also are you making sure that you depend/softdepend on your plugin?
This was the issue
So if I don't write the scope, the plugin automatically gets bundled in?
by default, the scope is compile which bundles in yeah
Yeah alright that was the problem then
How do servers create custom head textures without resource packs?
Do they just own an account which they set a skin to?
theres websites online where ppl add skins that they had (you can input a skin url too)
and then server owners add heads using that
i see
How would I go about adding a tab autocomplete/suggestion to a command, composed of a list of server names the player can teleport to (Waterfall)?
Is this command part of a proxy plugin or a backend plugin?
Then you have to figure out a way of getting the list of server names that exist on the proxy into the paper plugin
I'd imagine a bungeecord plugin which would check every so often what servers are available and sends that info to a paper plugin?
I mean either way you'd have to have something on the proxy to actually swap the people between the servers
So you might as well just have that command as part of the proxy plugin directly
then you can just access the list of servers directly from memory no communication required
I already have a command to switch between servers
not sure if that's significant
in a paper plugin?
yeah
how does that work
I registered an outgoing channel I guess
I did this like a year ago I honestly dont remember
I got a method saveDataAndSendPlayerToServer which saves the data of the player asynchronously and then sends them to the target server once the data has been stored on the DB
oh yeah you're doing the player data system
you should have a look at HuskSync
it's open source, it's what I use on my network for cross-server player data
uses Redis for super fast caching time and a DB to persist, super great
it also doesn't directly integrate with sending players, it just listens to PlayerLeave/PlayerJoin events so it works with everything
much less fragile
I just finished writing my player data system though
And it seems to work pretty well?
oh I mean yeah I guess
I would still recommend listening to PlayerLeave/PlayerJoin events
instead of having a specific send thing
Yeah that's what I do too
oh
The send thing is for a specific command
so what's the point of this method then
It just makes sure that the player's data is saved before they get sent to another server through the command
oh is your thing not fast enough to just save and load from the time between playerjoin/playerleave
It should be, I honestly don't remember why I wrote it a year ago
but I remember adding it as a failsafe
Yeah looking into it
Not completely sure how I'd use that tbh, as out.writeUTF("GetServers") doesn't return anything
i wonder if anyone made a bungee plugin messaging wrapper that supports callbacks š¤
edit: https://github.com/Flo0/BungeeCallback
but yeah you send it through the channel and then have to have a listener to receive the messages
I swear that is not how I did it for this other one I got :' )
I mean that's the Bungee plugin messaging lol
same as whatever this is
This is what was trying to do haha
Am I meant to write that code elsewhere, and then in there write the listener?
main suggestion: you should run this every x minutes in an async task and cache the value
also, #development message & #development message
other notes:
I'd recommend using try with resources (https://www.baeldung.com/java-try-with-resources)
and the error in the middle is probably due to not using 14+ (pattern matching smart casts)
Yeah well
It doesnt work as I am not returning a list
Changed it to try with resources, though yeah I think something is fundamentally wrong with how I am doing it rn haha
I just don't really know where I should be listening and sending the list of servers
you should probably have like an AtomicReference<List<String>> serverNames which you get from the task (atomic bc ur accessing from multiple threads)
oh and maybe update the list on player join if the serverNames is empty
What are those two you linked haha
But yeah alright I will do that tomorrow then, gotta sleep
Thanks for your course correction haha
its just message links from earlier in the convo
but alr, good night! š“ š“ šļø
Do you have any theory or should I make the relational placeholder.
:O itās been a bit.
it has
Okay guys, so I have a plugin I'm starting on, and I need some advice on setting up a database. I can't seem to figure out what columns and tables that I need to support the features that I'm looking for. I'll preface this by stating I've started a repository, with a readme that basically explains what the plugin is and how it functions. https://github.com/mkaulfers/hardcore-seasons/tree/main
I need to track user-created inventory content in a database, as well as any players that have joined, are surviving, or have been banned due to death. The goal is, at the end of the season, when all but one or all but X number of configured survivors are remaining and the season ends, they can redeem those resources on a separate server, eg. survival or skyblock. I need to be sure that I handle the case where a user survives, but doesn't immediately redeem their rewards. For example, if season 1 ends, and season 2 ends, a player from season 1 should be able to redeem their resource earnings at any time. In effect, I should be able to track multiple seasons simultaneously.
I started working out some of those details via pseudo-code in comments, which you can checkout here: https://github.com/mkaulfers/hardcore-seasons/blob/main/src/main/java/com/xtwistedx/storage/SQLHandler.java#L66
I also want it to be somewhat scalable for future features I have planned, so abstraction is somewhat important.
I dont know if this is the place for it.
But if I have a placeholder for %player% does the Plugin that its coded into auto download it or does the Server Owner have to?
If it comes down to the Server Owner has to; Is there a way to have the Plugin auto download the Library of PLAYER?
the plugin has to support %player% in its code
also:
Player placeholder not working? If you are using a plugin which supports PlaceholderAPI, and the %player% placeholder doesn't work, then change it to %player_name% and download the player expansion.
Commands:
/papi ecloud download player
/papi reload
if you mean %player_name%, then I think it just relies on the server owner; I don't think you can auto download
Well this is my first time using PAPI and I wanna start using Placeholder support in my configs n what not, just dont want there to be errors cause the Owner has to Download the eCloud of PLAYER
So if I direct %player% to the players display name / name then it should just work and nothing has to be downloaded?
yea
but I'd still add PAPI in case the user wants to do other placeholders as well
Nice
Sorry to hear man
org.bukkit.command.Command still exists in spigot 1.20.4?
Docs... my dude
When I try to put that version it tells me that that part of bukkit does not exist but in 1.20.1 it works for me
Im confused :/
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/command/Command.html looks like it my guy
Yup lol
what a strange problem
Truly puzzling
Can you be more specific about what led up to this problem? You're getting responses like this because it would appear, to readers, that you have not done any due diligence xD
That's all it tells me when compiling it tells me that this import cannot be found in spigot 1.20.4 SNAPSHOT R0-1 or something like that
Ahhh import cannot be found. So you have a misplaced import, or a missing dependency somewhere.
Or you have a dependency definition that says "This dependency is ONLY for XXXX version"
I use maven but I think this is not the problem
Share your dependency plz
If youāre on eclipse restart the IDE as well
intellij Idea won't let me compile
I can't share code 'cause I can't use my PC and it's 2 am
-.-

try to compile on PC obviously I'm not silly

Dude @digital temple do you exist in every MC discord in existence? lmao
maybe 
try invalidating caches and restart
I am so confused, why couldn't they share code because of how late it was
maybe not on pc
Ah I guess they turned off their computer and wrote from their phone
I've run into an interesting issue where HikariCP is throwing a NoClassDefFoundError exception. I'm fairly new to maven and I think this is probably something to do with the way I have setup my dependencies in the pom.xml. Could anyone direct me in the correct way to manage this?
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.1.0</version>
<scope>compile</scope>
</dependency>
Should be noted I've ensured that the <scope> is setup as compile
Make sure you build with maven and not with your IDE
You need to build the jar with mvn clean package to shade hikari into your jar, the jar will be in the target folder once the task is done, make sure to pick the right jar, it's the biggest one
@pulsar ferry so I've discovered the issue is to do with the way I have my dev environment setup. Currently I have a configuration that runs the server in the IDE for debugging purposes. In addition, I have an artifact that is a pre-run step for that configuration. I found the shade-plugin, but I would like to have it automatically place itself into the appropriate plugins folder. Are you aware of any dev setup environments where I can configure this? I feel like it should be pretty standard but I'm a newb to MCDev environments xD
Resources for setting it up properly**
you would probably have a way easier time just using gradle
instead of maven
write a task in gradle to move your jar wherever you want after its compiled and you are done
gradle > maven. always.
Been working on my own TP system for my server, the accept and deny are both clickable, is there an easy way to see if a bedrock receives it and not do the clicky buttons? Iirc they canāt click and go out to a link via ingame.
Only thought was check if the ign started with * but havenāt tested it, anyone else do smth similar?
Geyser API
Hmm fair, okay Iāll give it a shot.
Does it make sense to have a database table with a PRIMARY KEY of type INT NOT NULL AUTO_INCREMENT, or should I just have the UUID be the primary key
My dad who's done stuff with databases a lot for work told me it should be an auto incrementing ID and not the UUID so that it is less resource intensive
Realistically probably would be best to be an incriminating int, since ya. Generating a UUID each time would definitely use more data and shit for it.
Ya fair
Is it still better to have the auto incrementing ID and then the UUID just as a column?
you would then have to map the id to the uuid
defeating the purpose
uuid as primary key is fine, you are not the one generating it
Yeah true
Yeah I also thought that but he keeps saying that it would be more correct to have an auto incrementing int haha
Normally used to my code dynamically creating dbs for us. :(
he would be correct if you were the source of the uuids
but you will have to query for the uuid regardless
you SHOULD mark columns as unique etc if your data structure allows it
I suppose it's more about getting other tables data using the UUID which I guess would be slower?
he = who?
Than using an int
My dad haha
you have to query for the id anyway, it does not matter
if you do more than just a couple queries he is correct
you would query to get the internal id
In theory, there is nothing that changes in it lmao
then use that id to query for other data (and keep the id cached)
But even then I guess the difference in performance would be negligible
Especially if the database and the server run on the same machine
database location does not affect the performance
it affects the latency
even if you block a thread, other threads will use the core in the meanwhile if your block is not taking cpu cycles
SELECT * FROM table
WHERE uuid = "";
Is basically the same for both cases. The issue comes to updating data and having a virtually useless column since uuid is already unique.
performance is legit the same.
amount of storage used for the db would be very slightly bigger with ids
yes and no, querying against a unique int and a unique string are not exactly the same
in big databases it would be a bit more noticeable
also no, you have to keep uuid to internal id in another table regardless
its just not needed imho
yes but let me ask you, how would you know which id is for X user?
you would have to still somehow retrieve it
lol
wait scratch that i read it as it would be bigger
here ^ @worn jasper
you can't magically know which id is being used in the database for user X
My dad says that it is about "respecting the standards/norms" and "if you have to update a player's UUID for one reason or another, you'd have to manually do all of the tables"