Plugin development: Difference between revisions

From RetroMC
Jump to navigation Jump to search
(first draft)
m (Noggisoggi moved page Plugin Development for the Server to Plugin development: Name shortening)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Creating Plugins for the Server ==
[[Category:Server internals]] [[Category:Guides]]
{{Notice|This is currently a draft, and may contain inaccurate or incomplete information.}}
In the context of a Minecraft server, plugins are [https://en.wikipedia.org/wiki/JAR_(file_format) Java archives] that extend the functionality of a server. They can add new commands, modify gameplay elements and whatnot; creating plugins is a great way to introduce fun features to players.</br>
<hr>
Please note that this guide will '''not''' cover how to make plugins and assumes you have a baseline understanding of [https://en.wikipedia.org/wiki/Java_(programming_language) Java] and.<br>
It will however cover what requirement plugins need to satisfy to be added to the server; see  [[Developing for the Server|developing for the server]] for a more general overview.
== General requirements ==
These are generally good practices to follow when developing.<br>
Because the infrastructure team will have to review your code, it is vital to <b>keep code readable from a glance</b> to not waste their time.</br>
This can be done by using descriptive variables and methods (method "<code>SPSM</code>" -> "<code>sendPlayerScoreMessage</code>" and player "<code>a1</code>" -> "<code>player</code>".</br>
Consider wrapping a line of code to the next line if it gets too long, so that the reviewer doesn't have to constantly scroll left and right.</br>
These practices allow other developers to modify your project easily.</br>


=== Overview ===
<b>Reliability</b> is also another vital point - when making a plugin, look for any stack traces that print to the console and resolve them as not to spam the console and alongside that, make sure your plugin doesn't break any existing systems, cause lag, overuse available memory, perform any malicious action, or crash the server.</br>
Plugins are custom jar's that extend the functionality of the server. They can add new commands, modify gameplay, ect. Creating plugins is a great way to get changes and new and fun features to players.</br>
This guide will ''not'' cover how to make plugins an assumes you have a baseline understanding of ''Java'' needed to make said plugins. It will however cover what plugins should generally have to be added to the server.</br>
For a general overview of developing for the server you can check out, [[Developing for the Server]].


=== General Requirements ===
=== RetroMC specific requirements ===
 
* When handling player data you should always utilize UUID's from [https://github.com/search?q=repo%3Aretromcorg%2FProject-Poseidon%20uuid&type=code Project Poseidon] to enable player data persistence between name changes.
Generally, Plugins must be Readable & Reliable.</br></br>
 
Readability is a huge thing because Infrastructure will have to review your code, as to not waste their time it is key to keep code readable from a glance.</br>
Generally this can be done by using descriptive variables and methods. Instead of calling your method "SPSM" use "sendPlayerScoreMessage" or instead of defining a player as "a1" use "player".</br>
When a line of code gets long consider wrapping the text to the next line so the reviewer doesn't have to constantly scroll left and right.</br>
These are simple good coding practices that keep your code easily readable when being approved along with allowing other developers to add to your project easily.</br></br>
 
Reliability is also another key thing, when making a plugin look for any stacktraces that print to the console and resolve them as not to spam the console. Along with that make sure your plugin doesn't break any existing systems, cause lag, or crash the server.</br></br>
 
=== RetroMC Specific Requirements ===
When handling player data you should, at all times utilize UUID's from Project Poseidon[https://github.com/search?q=repo%3Aretromcorg%2FProject-Poseidon%20uuid&type=code]. This is to persist player data between name changes.

Latest revision as of 06:37, 22 October 2025

ℹ️ Notice: This is currently a draft, and may contain inaccurate or incomplete information.

In the context of a Minecraft server, plugins are Java archives that extend the functionality of a server. They can add new commands, modify gameplay elements and whatnot; creating plugins is a great way to introduce fun features to players.


Please note that this guide will not cover how to make plugins and assumes you have a baseline understanding of Java and.
It will however cover what requirement plugins need to satisfy to be added to the server; see developing for the server for a more general overview.

General requirements

These are generally good practices to follow when developing.
Because the infrastructure team will have to review your code, it is vital to keep code readable from a glance to not waste their time.
This can be done by using descriptive variables and methods (method "SPSM" -> "sendPlayerScoreMessage" and player "a1" -> "player".
Consider wrapping a line of code to the next line if it gets too long, so that the reviewer doesn't have to constantly scroll left and right.

These practices allow other developers to modify your project easily.

Reliability is also another vital point - when making a plugin, look for any stack traces that print to the console and resolve them as not to spam the console and alongside that, make sure your plugin doesn't break any existing systems, cause lag, overuse available memory, perform any malicious action, or crash the server.

RetroMC specific requirements

  • When handling player data you should always utilize UUID's from Project Poseidon to enable player data persistence between name changes.