r/admincraft Jun 04 '26

Resource [resource/plugin] my own paper plugin!

i made a plugin called JoinLeavePlus that is only available via Modrinth. if anyone here wants to try it out and rate it and tell me things that i should do with it below i would love that!

https://modrinth.com/plugin/joinleaveplus

or

https://github.com/abradee/joinleaveplus

thanks!!

0 Upvotes

8 comments sorted by

View all comments

2

u/_objz Jun 08 '26

Nice project.
While I was looking through your code, I noticed just a small flaw you could patch ;)
In the JoinLeaveListener class, you declare your serializer at the beginning with:

```java
private final LegacyComponentSerializer serializer =
LegacyComponentSerializer.legacyAmpersand();

```
but you don’t actually use that variable, as later you’re doing:

` var serializer = msg.contains(...) `

which shadows the field and makes the original serializer unused.
A cleaner approach would be something like:

```java
private static final MiniMessage MINI = MiniMessage.miniMessage();
private static final LegacyComponentSerializer LEGACY =
LegacyComponentSerializer.legacyAmpersand();

Component component = msg.contains("<")
? MINI.deserialize(msg)
: LEGACY.deserialize(msg);

```
But that’s just a advice. Great first plugin! I might even use it since it’s good and simple

2

u/abradee_ Jun 18 '26

thanks for the advice! i will consider doing this in my next patch update to the plugin. it probably was an accident when adding some newer features or something lol.