#help-development
1 messages · Page 466 of 1
If you're doing a contains check with a remove doesn't remove return a boolean so you can just do a remove check instead?
yes
Imagine using snake_case in java
You did not
How can I actually show you the map though?
show the code
Show me how you define "cooldown" not "haveCooldown"
@EventHandler
public void on(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location to = event.getTo();
if(to == null) return;
if(to.getY() <= minYLevel) {
// Do something
}
}
``` @twin venture
oh sorry i got the wrong line :/
HashMap<String, String> cooldown = new HashMap<String, String>();
Instead of teleporting use setTo btw @twin venture
if (!(cooldown.containsKey(p.getName()))) { cooldown.put(p.getName(), String.valueOf(System.currentTimeMillis())); p.sendMessage("§cAdded to cooldown" + cooldown.get(p.getName())); }
Why are you
use uuids
Turning the timestamp into a string
Make the key a UUID, and just use p.getUniqueId()
also for the value you can just use a Long or an Instant
I mean at the least use a long
hell even a LocalTime
How'd I do that? Would I just add <UUID>?
Map<UUID, Long> instead
ok
or Map<UUID, Instant>
and use cooldown.put(p.getUniqueId(), System.currentTimeMillis());
Fair
Also, @tawny pine, don't run another .get operation
just do
wdym? why would i do that?
long now = System.currentTimeMillis();
cooldown.put(p.getUniqueId(), now);
p.sendMessage("§cAdded to cooldown" + now);
instead of using .get(p.getUniqueId()) in the message
just store the value beforehand
I guess yeah
also, @tawny pine, you don't need to add () around cooldown.containsKey(p.getUniqueId()), you can just do !cooldown.containsKey(p.getUniqueId())
If I wanted to make a custom API so I could implement something like YAMLConfiguration but... better
What should I need to know?
oh ok ty 🙂
I assume I can look at YAMLConfiguration from stash and get ideas from there
Yeah
?stash
I don't know what you're going for
I want to make a better File Serializer
Ah
I think I'm going down the correct path
is there a way i can change the luckyperms font?
Wdym?
It's not that refined, but here is a simple cooldownmanager courtesy of bing:
Here's an example implementation of a CooldownManager class in Java that uses UUID and Instant:
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class CooldownManager {
private final Map<UUID, Instant> cooldowns = new HashMap<>();
private final long cooldownMillis;
public CooldownManager(long cooldownMillis) {
this.cooldownMillis = cooldownMillis;
}
public boolean isOnCooldown(UUID uuid) {
Instant lastUse = cooldowns.get(uuid);
if (lastUse == null) {
return false;
}
return lastUse.plusMillis(cooldownMillis).isAfter(Instant.now());
}
public void putOnCooldown(UUID uuid) {
cooldowns.put(uuid, Instant.now());
}
}
This implementation uses a Map<UUID, Instant> to store the last time a UUID was used. The isOnCooldown method checks if the UUID is currently on cooldown by comparing the last use time with the current time. The putOnCooldown method adds the UUID to the map with the current time.
I hope this helps! Let me know if you have any other questions.
Source: Conversation with Bing, 12/04/2023(1) Guide to UUID in Java | Baeldung. https://www.baeldung.com/java-uuid Accessed 12/04/2023.
(2) Java cooldown system - Stack Overflow. https://stackoverflow.com/questions/44971042/java-cooldown-system Accessed 12/04/2023.
(3) LabAide/CooldownManager.java at master · arcadelabs/LabAide. https://github.com/arcadelabs/LabAide/blob/master/src/main/java/in/arcadelabs/labaide/cooldown/CooldownManager.java Accessed 12/04/2023.
(4) random - Create a GUID / UUID in Java - Stack Overflow. https://stackoverflow.com/questions/2982748/create-a-guid-uuid-in-java Accessed 12/04/2023.
(5) CooldownManager/CooldownManager.java at main - Github. https://github.com/PrinceBunBun981/CooldownManager/blob/main/CooldownManager.java Accessed 12/04/2023.
Jan
wow
Without bing
What? If i can get bing to do why bother doing it myself.
If I wanted to make a better implementation of FileConfiguration/Serializable
What do you think would be a good place to start
Bing 💀
can anyone tell me if theres a way to change the luckyperms rank font?
?commands last one
I bet bing scrapes code from random repos
?cooldowns
And ignores licenses
What is wrong with current implementation of file configuration
Not necessarily fileConfiguration but serializable
why
oh he asked
what do you want to serialize to?
Exactly
I want to be able to include in my lib
And If I want to serialize something
I can add support for it
So, anything
Should it be human readable and editable?
Make it implement ConfigurationSerializable?
Yes and no
I know I can do stuff like
Set.toArray
But what if I want to natively support Set
And internally do it
Is it even worth?
Implement your own serializer for the TOML config type.
for non-human readable you can have some fun with binary.
Well anything can be efficient. Reading and writing binary files can be done efficiently easily.
I'm just trying to think of some better ways to store data in multiple plugins
Cause SQL
idk I feel like the structure can change too much between plugins
You can’t get any smaller than binary
Files, are a bit annoying to set up
Nice ty, I'll try and implement some of that into my code 🙂
Like... for example
Lets say essentials
They store PlayerData in individual files
What are the alternatives to that
SQL
...
PDC
json
could use an online mongodb db
json is still storing individual files
free cluster
Individual files not the same as 1 big file
Yeah a database is basically one big file
1 file per playerdata not the same as 1 file for all playerdata
Currently my preference is 1 file per data/datagroup or in this example, PlayerData
Just to ask though, why does this code not work:
HashMap<UUID, Long> cooldown = new HashMap<UUID, Long>(); if (!(cooldown.containsKey(p.getUniqueId()))) { long now = System.currentTimeMillis(); cooldown.put(p.getUniqueId(), now); p.sendMessage("§cAdded to cooldown" + cooldown.get(p.getUniqueId())); }
After the if statement has run, when it looks for the players unique id it should find it and not run the second time, but it still does.
Why is that?
If you are going with files I’d stick to one per player
that is inefficient for most datatypes
Instead of a giant one
Exactly
multiple files is better imo cuz you can just load what you want instead of going to search to a whole big file
Yes
Do I use HTTP to send data from one plugin to another (In different servers), or is there a better way?
I have a good cache system to read individual files
?
But then, the only alternative of the ones we talked
Is SQL
What if I want to write a object to SQL, how do I do that? Field by field and populate a table?
I personally like SQLite
Wait sorry lemme try something :/
This is the same as what one does for a individual file system
serialize every field in a column, then cry about normalisation
You can technically serialize the entire object with gson and then shove that in the database
But like
Maybe don’t
But like
No
That's terrible
What's the point of a database if i'm gonna json string and then save that into the database xd
someone in here asked to store json in his db
Can you explain this a bit more
It didn't work because I was defining the Hashmap every time, and it needed to be outside of the event handler 🙂
What's the issue with this
Hey it makes the json available cross server!!!111
I found a few database types that use one file per database. Here are some of them:
- SQLite
- Microsoft Access
- Microsoft Azure SQL Database
- MySQL (when using MyISAM storage engine)
- PostgreSQL (when using plain files)
- Oracle (when using raw devices)
¹²⁵
Is there anything else I can help you with?
Source: Conversation with Bing, 12/04/2023(1) Database Types Explained - Knowledge Base by phoenixNAP. https://phoenixnap.com/kb/database-types Accessed 12/04/2023.
(2) The Different Types of Databases - Overview with Examples. https://www.prisma.io/dataguide/intro/comparing-database-types Accessed 12/04/2023.
(3) Can MySQL have one file per database? - Stack Overflow. https://stackoverflow.com/questions/11488140/can-mysql-have-one-file-per-database Accessed 12/04/2023.
(4) Database Files and Filegroups - SQL Server | Microsoft Learn. https://learn.microsoft.com/en-us/sql/relational-databases/databases/database-files-and-filegroups?view=sql-server-ver16 Accessed 12/04/2023.
(5) Database Files - Sql Server Backup Academy. https://sqlbak.com/academy/database-files Accessed 12/04/2023.
Why you don't just use nosql like mongo
If you don't want to bother normalisation
It was an alternative
Do you think nosql would be better than a per/file system with a good cache?
I need it to be versatile
I need to be able to adapt this structure we're talking about into many different scenarios
Anything is good.
Exactly how every major data storage system is designed
Example:
CustomPlayer.class
UUID uuid;
String name;
int loginCounter;
List<CustomPlayer.class> friends;
Set<Houses.class> houses;
chatgpt moment
Ye
Lets say you have that and you want to store it in a database of ANY sort
Yes?
What would your aproach be. What's your current aproach
oh god im getting flashbacks to sql classes
Ignore sql
I'd look at my userbase.
first off, it does not look like it is that big and does not look like it needs any database for the majority of cases + it also does not look like you want some yaml format for easy editing. So json is perfectly fine.
i would personally use some kind of sql database, because i got used to it much
you would be storing a list<uuid> instead of the whole player object anyways
postgresql and sqlite probably
Yes that is correct, i actually do that I just wrote it on the fly accidentally
Alright now
Just pull a luckperms and implement all of them
How do you deal with saving data like the above into your databases
Example:
CustomPlayer.class
UUID uuid;
String name;
int loginCounter;
List<UUID> friends; //CustomPlayer.class UUID field
Set<UUID> houses; //Houses.class UUID field
That's a loaded question haha.
Well not really, but it can involve a fair bit of code + caching etc.
I don't need the code rn I just care about the theory behind it, behind people that have a lot of experience like you guys
I want to learn
probably 3 tables. 1 Player other House third table where player-house relation would be stored. This is just quick looktrough
Alright so you split the data into tables that, well, make sense
^^
What was the name of the event when you jump onto a crop and it breaks?
Does this mean that
You never bother storing something like a object directly
Instead you store a List<UUID> which is supported by sql
?jd-s
Instead of List<CustomPlayer.class>
BlockBreakEvent?
So you try to have a UUID for each object you need to store so then you don't need to store the object but just the UUID and the data
there is not really list in sql
there are kind of relations
one-one, one-many, many - many
Yes yes I miss-said that
No its not the blockbreakevent
ik that because its already cannceld
It’s PlayerInteractEvent
So then you're telling me in this example:
UUID uuid;
String name;
int loginCounter;
List<UUID> friends; //CustomPlayer.class UUID field
Set<UUID> houses; //Houses.class UUID field
all your doing to save the data is a insert and then do name.getName() and so on field by field and correctly distribute it
sec
Specifically with Action.PHYSICAL
more or less, when adding one customplayer, you would have to add data to multiple tables
Thanks
Yes of course
Do you have a library of choice/ your own implementation to make the process easier
The fact that it’s called clicked block even though you don’t always click it hurts
:(
I want to see something that most people consider a good SQL implementation without it being 1231312313% complex
Do not recommend luckperms please
i once tried to create a reflective pojo mapper but it went brr https://gist.github.com/FourteenBrush/43bf9fe001e6bb697fa0e1823e9c31bc
well you would have to learn statements, but i most often just do method and inside of that prepare query
mmh
So you don't have a actual implementation?
You just make a SQLManager class with some basic methods?
yap, i have common interface for data storage, and then just simple sql impl
Is your data storage interface private or may I see it?
kotlin :(
You do kotlin?
Interesting
yeah, but you should get idea from it, its similar
Yes of course
I care more about the logic not the code
looks pretty clean doesnt it
yes
That is clean
ill probably do smth with annotations next time and write a compile time annotation processor
i believe some kind of connection wrapper so i could use a try with resources on it without actually closing it in every case
When will we be able to natively add UUID
ik
I like what you did
Seems really efficient
idk got some ideas from 7smile
Well I like it too lmao
Is his implementation public too?
Damn I really like this brush
So looking at your code
I can't tell when you save the data
If it's per user or every X time
Oh yeah
Quit
That is slick
All fun and games until the server crashes
Could just implement a 600sec async task that autosaves to database
Is it possible to make a multi-module project in IntelliJ but that the projects are independant for the most part? Especially separate jars?
Smh if you only save on leave you could lose hours of data in a crash
just dont crash you noob
Just to make sure I'm asking the same thing:
I need to make 3-4 small plugins but they are unrelated. I will however use the same libs/dependencies on almost all of them, I want to be able to export them separately and not depend on eachother, but I want to stop needing to make a project for each one.
How do I do so
and i was the only player on the server so uhh 💀
taps forehead
A kingdom of 1
im now thinking about a runtime hook that saves the data to the database in case of an unexpected crash
never finished that plugin 💀
You can create them as usual and open their combined parent folder in intellij? You'd just have to navigate to each project. But obviously they won't know about each other and all of them need a full pom
How is the event called when i destroy a painting?
And name it TheEverything?
project X
Isn't that just a entity damage by entity event? There might be a more specific one
I dont think so
@EventHandler
public void onHit(EntityDamageByEntityEvent event)
{
if(event.getEntityType() == EntityType.PLAYER)
{
if(!Storage.getInstance().getEventPlayer((Player) event.getEntity()).ableToFight)
{
event.setCancelled(true);
}
}
if(event.getDamager().getType() == EntityType.PLAYER)
{
if(!Storage.getInstance().getEventPlayer((Player) event.getDamager()).ableToFight)
{
event.setCancelled(true);
}
}
}
it would get canceld
ever heard of &&?
btw they are not able to fight
Is it registered? It works for me
Prolly
me?
declaration: package: org.bukkit.event.hanging, class: HangingBreakByEntityEvent
no my imaginary friend
what should i &&
your nested ifs
or guard clauses
oh that sure
I was thinking more of a parent pom but without the combine into 1 jar thing
Thanks a lot
So I can export them and use them individually
Oh so you can build them all at once
you can have separate modules that each give you a jar
just have a parent pom with all the shared dependencies
its pretty much self explanatory in ij
Ninja birb
Should methods that return Collection return a defensive copy or a variation of Collections.unmodifiableX?
I'm in favour of returning a defensive copy in order to avoid wrapping the list if it needs to be changed, but my friend thinks otherwise...
Just uploaded my first plugin 🙂
https://www.spigotmc.org/resources/ezrename.109242/
It depends entirely on the context of your collection
If you want it mutable, make it mutable. If you don't, return a view
¯_(ツ)_/¯
There's no one answer to that question
same but like a month ago :3 https://www.spigotmc.org/resources/serversettings.108605/ i think i uploaded a broken version on accident tho lmao, noticed it last night when i was refactoring and testing
same i just uploaded a broken version
loll
Smh
it worked the first time i swear!
i stress over how im gonna describe what im uploading
This doesn't help, I don't know what I want... what if it's an API other people will use?
oh
and will spend 6 years making the README for a project that took me 1 afternoon
i have a plugin ready to upload that im just polishing up
announcer plugin #394838
literally
me
me but with logos
I need an ai to make my resource pages
just enter the prompt into @tender shard
I don’t think Alex is an api
https://github.com/winnpixie/megaphone grrr i havent started the README for it yet
also need to make an icon for it

craiyon ai, make me a flat 16x16 megaphone icon
Who still uses craiyon
idfk
Then you need to figure out how you want your API to work
We have both mutable and immutable collections in Bukkit
I thought stable diffusion was the new meta
You're the one designing it so it's ultimately your decision. There's no right or wrong. If you want people to be able to add or remove things from your collection, you have the choice of making it mutable or adding mutator methods
How would you use your API? That's the question you need to ask before you write the API
I have an object that does some actions and then documents them in a List<SomeHistoryObject> and a method to get the history - what would you return?
will editing that list have any internal impact or its just for viewing history objects according to some criteria or whatever
Yes, the list should not be modified by any external object
I want a reliable history, otherwise it's conceptually not history 🤷
then return immutable view
Yeah, you pretty much answered your own question
why not a defensive copy?
Not sure what you mean
Idk either
Just wrapping it in another collection?
Because again, you're coming right down to personal preference again lol
How you encapsulate your data is preferential
ImmutableList.of() easy
Well I think he's proposing instead new ArrayList<>(internalList);
Well sure. They might be confused without proper javadocs if they can modify it
That's why we have @Unmodifiable, @UnmodifiableView, and Javadoc comments to state what precisely is returned
When will spigot get those annotations :p
Did i got it right that boat collision is client sided?
Eh?
You're welcome to PR that 👀
What part of it rotz?
the boat
Hi spigot, I switched to Mojang Mappings and got a little problem with a packet.
This packet should open a enderchest for a client:
ClientboundBlockEventPacket packet = new ClientboundBlockEventPacket(new BlockPos(getLoc().getBlockX(),
getLoc().getBlockY(),
getLoc().getBlockZ()),
new net.minecraft.world.level.block.Block(BlockBehaviour.Properties.of(Material.DECORATION)),
1,
1);```
With spigot mappings, it was:
PacketPlayOutBlockAction packet = new PacketPlayOutBlockAction(new BlockPosition(getLoc().getBlockX(),
getLoc().getBlockY(),
getLoc().getBlockZ()),
Blocks.ex,
1,
1);
java.lang.IllegalStateException: This registry can't create intrusive holders
at net.minecraft.core.MappedRegistry.createIntrusiveHolder(MappedRegistry.java:369) ~[?:?]
at net.minecraft.world.level.block.Block.<init>(Block.java:207) ~[paper-1.19.4.jar:git-Paper-510]
at blablabla.......VoteCaseBlock$2.run(VoteCaseBlock.java:157) ~[votecase-1.0.jar:?]```
What did I do wrong here? Is DECORATION the wrong property?
Have you tried to listen for entity collisions?
Hasnt worked for other people so i dont even tried https://www.spigotmc.org/threads/how-to-disable-boat-collision.417649/
You can't create a new registerable type at runtime after the registries have been frozen
Blocks.ex is a block constant
I assume it’s the ender chest constant
would i use PlayerInteractEntityEvent to make a lisner if a player palced a armourstand
Nah
nah to me?\
🤔
Yes
Obfuscation is wonderful
PlayerUnleashEntityEvent?
Why would that be it
Well the api is on 1.19.4.
But I switched to Mojang mappings from spigot mappings.
So the net.minecraft.world.level.material should be what?
BLACK_STAINED_GLASS doesnt exists there
I don’t think there is an event for when the player causes an entity to spawn
But there is always the PlayerInteractEvent and the EntitySpawnEvent
Blocks is the same in Spigot and Mojang mappings
You went from an existing block constant to creating your own block
Oh noo
So whatever it was your were trying to send with ex is mapped to some existing block constant, and according to the mappings, it should be black stained glass
what would be the best way to detect if a player palces one?
Yknow, i am curious if PlayerItemConsumeEvent or CreatureSpawnEgg runs
They don’t state it
But yah
declaration: package: org.bukkit.event.entity, class: CreatureSpawnEvent
This one*
that counts for armourstands?
Since armorstands are technically living entities
Mojank moment
This worked for me 🙂
ClientboundBlockEventPacket packet = new ClientboundBlockEventPacket(new BlockPos(getLoc().getBlockX(),
getLoc().getBlockY(),
getLoc().getBlockZ()),
Blocks.ENDER_CHEST,
1,
1);```
Thanks, it was just a simple problem and I broke my head for this xd
Yeah, was the ex from a version prior to 1.19.4?
Because the client would break if it weren't synchronized properly lol
It shouldn't be mutable after the pallet has been initialized and synchronized
It’d be funny if two players got different palettes
No from 1.19-R0.1-SNAPSHOT, it worked with that 😄
Yeah, 1.19 isn't 1.19.4. New blocks were added to that class since then so the constants have changed ;p
It being ENDER_CHEST instead of BLACK_STAINED_GLASS makes more sense now
if (!event.getEntityType().equals(EntityType.ARMOR_STAND)) {
ArmorStand armorStand = (ArmorStand) event.getEntity();
event.getEntity().getWorld().getPlayers().forEach(player -> player.sendMessage("You placed an armor stand at " + armorStand.getLocation().toString()));
return;
}
```?
i feel like im overlooking something
Ah that exists
ive been told like 4 things what is the best way lol
to track who a player places a armourstand
This
You want to listen for an armour stand being placed by a player. That's the EntityPlaceEvent
Couldn’t find it on my phone
event.getEntity() will be your armor stand, event.getPlayer() will be the player that placed it
ok let me try agian lol
@obsidian plinth are you a bottom?
switch
Huh?
I was just gonna show you this tweet i saw https://twitter.com/veryWicca/status/1644474346713530368
Ahahhaa
i love you
How can I use hover/click events in an AsyncPlayerChatEvent?
I am replacing certain stuff in messages and formats with others, but I need a click AND a hover event, and I can't figure out how to do that in the format, unless I just don't see the candidate for that.
Optionally with Kyori would be good, but anything works because I don't care about RGB or HEX
lmao
people have told me like 5 differnt docs today for it
We have no way to use components in chat events. On my todo list
Ah yes
Cancel and send yourself 🤷🏽♂️
You would have to cancel the chat event and broadcast a new message, but that breaks chat signatures
naw make armourstands count as a blockpalce
so i dont have to rework stuff
but they're entities, not blocks
It’s not that hard
i have to edit my move interface
I assume that would be synchronous? And I am running a lot of stuff in the chat event
than make a hashmap for it
Well it would be async in the async event listener ;p
Fun
Sending chat messages are fine async
MD should add some generic waiting music to applyPatches and makePatches
Add it yourself
You mean something in the bukkit API is safe to be run async?
Shocker right
fr
Sending chat messages async is generally safe.
kk ty
Btw, is Bukkit#broadcast a smarter way to send the message to everyone?
Or is it just looping through players?
Name?
It does support components. Bukkit#broadcast(BaseComponent...) should exist
At least I'm 90% sure it does
He seems to be using paper too
Oh at that point just use Adventure lol
Yeah it does, but I will take all the Ws I can get with kyori
Oh no I'm using 1.12.2
Ah i see
It exists
Maybe in the paper api it is
Look in the spigot interface
Ur using the paper api
declaration: package: org.bukkit, interface: Server, class: Spigot
I mean
Ah I see
Maybe it was added in an earlier version in paper ig
To be fair though Choco is still wrong then :p
They moved everything
Btw there's a method literally called Bukkit#getServerName()
Yes
Tbf i expected this to be like 90% of programming communities
I'm surprised there is no toxicity involved, thank you for basically being you
We are toxic
I knew it existed because I saw it when adding component methods to the server interface, but wasn't sure if it was under a Spigot subclass or not
Spigot subclass still makes me sadge :c
Don't really have a choice
Sadly yeah
😭
The only thee options are:
getXComponent()- Grossx()- Gross, and steps on Paper's toes (less important but still a bit of a dick move tbh)- Spigot subclasses
- Make a custom fork of Java that can understand methods with identical names but different return types
Don't question it
Jsut make a cooler language
Just make a new compiler
- say screw you and just change the return type anyways
Sad
Component name = player.getName(:Component);
String name = player.getName(:String);```

no ty I'll just cancel the message and send a message using kyori
Manually configured kyori that is
Kotlin spotted
keeps people on their toes
MD would not approve
Tbh I can't tell if sarcasm
It's like 60% sarcasm
As if
I definitely PR's a scorched earth change for materials a few years ago
Which worked, might I add!
You guys made an extra legacy layer lel
Best use of ASM ngl
BUT BREAKING THINGS IS HALF THE FUN
That would be so many since tags to write
We wouldn't have to use @since tags if people would just fucking update and write against the latest version of the API, jfc
?1.8 moment
Too old! (Click the link to get the exact time)
I will add @Since tags to every single method if you PayPal me $100
(Real)
For legal reasons that's a joke
The worst part would be finding when something was added
Although there is that one website
What was it
Honestly not too difficult since you'd just need to start with 1.8 and work upwards
What about stuff from before then :p
Helpchat has all the previous javadocs hosted
Nah there was an even better one that actually compares versions
Anyone who uses pre 1.8 can be considered deprecated
I think you mean pre 1.19
Ah I found it
Tools for the Bukkit & Spigot API javadoc.
sadly it stops at 1.17
That's it?
We wouldn't have to use @since tags if people would just fucking update and write against the latest version of the API
If md_5 said yes I'd do it for free
They probably wouldn't get approved lol
If I got the go ahead 
since tags would imply that we support older server versions which we don't
Not to mention that it would probably be a multi-thousand change PR which would probably conflict a lot of pending PRs lol
We tend to avoid sweeping changes like that unless there's actual benefit
So in other words you should ban the disgusting 1.8 users
I'm not saying no 👀
Based?
this is like the easiest part. just look at the git blame
or the git history for a selection. ide's have really nice tools for this. At least good IDEs like IntelliJ 😜
Shh I forgot about git blame
Eclipse definitely has a Git blame as well lol
Yes I'm using light mode. Eat my butt
Does anyone have a tutorial for Sending packets with entity metadata (Using protocollib) For 1.19.3?
Wtf
ok
in theory
could I theoretically
open up a webserver that points to my local maven repo
and use that as a maven repository
theoretically
nexus seems like a pain to install
Can't tell if saying wtf to the light theme, or if you weren't aware of the git blame feature
The light theme
🤣
Before I asked if it was posible for me to group unrelated and separate plugins into 1 intelliJ project
To be able to generate separate jars but not need to create a new project each time
Am I able to push each module to a separate GitHub repo?
Can you? Yeah definitely. Not entirely sure why you would want to do that though
how could i change the fong on lucky perms ranks?
for one moment i think was BlueJ xd
typo, i meant font
i dont think it has to do with that but okay
it is about a plugin so technically
yea
also theres no font implemented so i have to script it
¯_(ツ)_/¯
hi why does this return CraftPlayer{name=richyoungkid} killed an ender dragon i need it to return just the playername
@EventHandler
public void onDeath(EntityDeathEvent e) {
if (e.getEntityType() == EntityType.ENDER_DRAGON) {
String killer = e.getEntity().getKiller().toString();
Bukkit.getLogger().log(Level.INFO, killer + " killed an ender dragon");
}
}
do i need to cast it or what
.getName on the killer
ah yes thank you
Rather than toString
makes sense
do you know any event which occurs when the player respawns the dragon with 4 crystals
like a dragonrespawnevent or smth
I don’t think there is a specific event for that
But the normal spawn event should still fire
how about this
when the player places a block
check for
DragonBattle#RespawnPhase
if you delay it by a few ticks it might
yeah its 4am ill try it tomorrow
fuck me I need to migrate all of these
yeah got it
whats this
this channel is for help with developing plugins
#help-server is for help with server management
so that includes plugins that other people made
this channel is for helping people make plugins
so the way menus are done internally at work is a bit yicky
and I'm standardizing stuff with even more interfaces
so that when I update data, all the menus that are rendering such data update network-wide
what app are you creating
uhh google why not
?
yes
well it's a bit big
there is no singular goal like
we're at 1mb right now and we aren't even ready for alpha
and we have some classes
oh god these menus are idiotically made
Cool
All that for a Minecraft plug-in?
yes
it has some features
if you're allowed to say lol
It’s actually a join and leave message plugin
oh of course
like a custom scripting language, in-game script editor
that makes a lot of sense
custom npc stuff
oh shit
join and leave message plugin using enterprise java practices
Exactly
it can associate a cloudflare subdomain to an email
so that when you join through a specific subdomain and play, that e-mail address gets associated with you
gotta have your SingletonManagerBuilderFactory
woah
and joining through development.mydomain.com
and playing n shit
sends emails to development@example.com
Is that the best way to associate an email address
It's meant for groups and events
I see
So that the host only needs to do basic setup
and the other players just need to join through an ip instead of actually typing something in chat
So it’s not to associate a single email address to a single player
yeah it creates a group and associates an email and subdomain to that group
Neat
other stuff is like
automatic skin overlays
where we have this skin .png that automatically gets parsed and color matched
and overlayed on top of your skin
so you can apply suits n shit
and it like precompiles skins and wipes the skin cache when you change your skin
other stuff is like
graphs
I have
so I have this
I remember when wynncraft used skins to apply custom armor
It was neat but it worked maybe 5% of the time
and this
pretty
and i thought I had a lot of code
wait wait its more than it looks there
you have to click on it
still not alot
oh while im here
okay i have a class called resourceapi
er rather an interface
and its a stupid name
it just lets you get all the managers
but idk what to call it
but having Api in the name makes me feel dumb
lmao
i hate how intellij complains about no usages for something that's meant to be a public api
also a big gripe of mine with intellij
but you can disable it I think
I remember someone mentioning it
like I understand it
would make sense if this was some internal code
but this is public facing
first menu done, like 20 others to go
@SuppressWarnings("unused")
It's a menu that wasn't really that well coded
and it had some weird concurrency stuff going on
and I had to separate all the logic
ehh I charge hourly rates
Hey if it works who cares how good the code is
The world runs on duct tape and prayers
I mean yes but instead of updating a temp variable or something
the idiot that wrote this decided to put it all on a map
and instead of using negative values to say unlimited, for example
the idiot does a check every time the value changes
I basically need to convert method params to constructor params and replace every single mutable call with an atomic reference
and then strip the logic into a "setup" and "update"
Hey
Lets say I want to do configurable ChatComponents
Like from config.yml be able to change hover actions, colors, text, everything
I can't seem to think of a good way to do it that isn't hard to figure out
Well, you could also abstract it away and store it in yml
Or you could use minimessage
Parse json from config to component
Minimessage I looked at it a bit
Seems interesting
So if I did minimessage all I would need in the config is just 1 line for the message
And then the entire thing is customizable
Yes
That is interesting
Then you parse that into an adventure component
Which you can then serialize into a bungee component
Kinda cool
adventure parsing minimessage is surprisingly easy
It’s one line
yes
Mhm
it's also a shithole 
What do you mean
it tries to be all multiplatform and all
messages:
join_message:
components:
- text: "Welcome to the server, "
color: "dark_aqua"
- text: "%player%"
color: [200, 160, 134]
hover:
text: "Click to view %player%'s profile"
click:
action: "/show_profile %player%"
- text: "!"
color: "dark_aqua"
Thats what i just made up.
I think you can translate this into components pretty easily
but you gotta shade it unless you want to force everyone to use paper
This means you need that entire thing for each message
I mean what other choice would they have
and if you're using paper, it literally deprecates everything that's not adventure
I see what you mean
To be fair spigot is kind of a black sheep
this'll be fun
Paper, sponge, and fabric can all handle adventure
I think minimessage is fantastic
Even includes Score and NBT support which is kinda crazy
Yeah minimessage is pretty neat when it comes to single String input
At least shading isn’t really an issue now
You can just use the libraries feature
reminds me of the tf2 source code comments
why does spigot do bungee components instead of adopting adventure I've always wondered
just easier I assume
Bungee components were around much earlier
Eh for placeholders i would honestly use PlaceholderAPI (If thats what you mean)
Spigot has barely had changes
Oh it's the same
Yeah definately would just use PAPI
ahh prob too much work to switch then
I do wonder what part of the message you send to papi
makes sense I suppose
I assume it's the first thing you do
Get string from config -> Parse into PAPI -> Adventure
I mean it would be fully possible to switch since only a few things support bungee components still
But I don’t think MD is interested
Well, yes and no
There hasn't been a major change in too long
Spigot is designed to maintain as much backwards compatibility as possible
They just add compatibility for next version and call it a day
hopefully material enum gets an overhaul soonish hear
Just overload methods if you want to keep backwards compat too
For the longest time, 1.8 simply held back development of newer features.
Because backwards compatability screwed up quite a bit of the design
But they just don't do anything really
Thats also why i hate 1.8 so much
I do feel like spigot is heavily understaffed
1.8 sucks
We always welcome more
And only MD can commit actual changes
I hope to be more active of a contributor just tryna take it one step at a time rn
thanks copilot
Honestly idk, mixed opinions about spigot, website is 2006 at most
Feels like only a few people do stuff
F. My copilot gives me a ton of garbage pretty often.
I hope thone learns with time.
The website is a separate issue
Forums are just xnferno
it learns over time
MD doesn’t know PHP to make xenforo addons
I just happen to not turn off my pc for weeks
unfortunately I gotta turn it off tomorrow
as I'm catching a train to 40km away to grab my replacement water cooler
and my new power supply also arrived
Im trying to work through old issues and feature requests
You can always jump in there and change it as well 😄
It's easy to say it like that
For example: Non-blocking world loading.
fully multithreaded block support
Yet you are aware that those type of changes would most likely not get accepted
That’s not true
Cause it's a big change, and spigot doesn't do big changes
guys I had a really cool idea
This sounds like you have a lot of experience with PRs on Spigot.
Yeah
I read the commits for a few hours
Clearly
what if we deprecated all strings and we just forced everyone to use adventure
On it

I hate that so much
md will personally ban you from every spigot relating site
Nope too late it’s already done
nah bro it's intended behavior
i wonder how i can randomly generate a nice? math question
player.sendMessage(Component.text("debug 1"))
When migrating i had 3 lines of code getting bloated into 1 new util method and 1 new builder method with >20 lines each
Two of the big tasks atm are adding component support to more stuff
And replacing various enums
guys I just had this idea
what if we added component support to action bar messages
so that you can like
hover over them and click then to run a command or maybe some malware
"click it" (lol)
Can you even do that lol
Pay no mind to the fact that action bars already have component support
no
No
Tell me when you got your cursor on the action bar XD
send the words "Raw Chicken" but localized in your language 
bc my current way just ends up it always being a multiple of 10, and that isnt the best
True
Make a plugin that forces english for the client
if I wanted translation I would have opened duolingo
Malware to force language
Generate a nice?
math question
I prefer my overly complex translation system with configs
that isnt trailing hundreds of decimals
Does it handle every item in minecraft
guys
pretty much generate a math question that doesnt have decimals but isnt easy as balls
component support in mfing zombie nametags
What is a "nice" (in math)
something that doesnt have decimals
I assume he doesn’t want 100 / 3
would you like to be solving 94*68-284 + 9
Holograms with TextComponents
Oh you want to generate a "nice math question" XDDD
Why you want to install malware to my pc through zombies now
Because that’s not a nice answer
yeah
Hologram minimessages
x / 9 becomes 0.xxxxx
You need to define what a nice math question is first
Probably like 125 + 28
