NOTE: This repository is no longer maintained, development has moved to PGMDev/PGM.
ProjectAres is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
A copy of the GNU Affero General Public License is included in the file LICENSE.txt, and can also be found at https://www.gnu.org/licenses/agpl-3.0.en.html
The AGPL license is quite restrictive, please make sure you understand it. If you run a modified version of this software as a network service, anyone who can use that service must also have access to the modified source code.
These plugins were converted from an internal project to open source in a rush, so they are not yet well adapted for third party use. Improving this adaptation is a top development priority, specifically:
You may find some help on the PGM Discord, in these channels:
#help Help with running a ProjectAres server
#contributing Discussion about contributing to ProjectAres
Please keep in mind that this help is provided by volunteers and other users, out of the kindness of their golden hearts, and not as an obligation to you.
You will need a recent version of JDK 8. Old JDK versions do have bugs that will prevent the code from compiling. You will also need Maven.
To build everything, just run mvn clean package
.
This should download all dependencies from our repository and create several .jar files in the target
directories of each module.
If the build fails, please report it in Discord.
You can also download builds from our Jenkins server.
The plugins in this repo work only with SportBukkit and our custom fork of BungeeCord. They will not work with standard CraftBukkit or BungeeCord.
Appropriate SportBukkit settings are provided in bukkit.yml.sample
in this folder.
Of particular interest are these:
settings.bungeecord: true
This is required in order to connect through Bungeesettings.legacy-knockback: true
Emulate knockback mechanics from older versions of Minecraftsettings.water-pushes-tnt: false
Disable water pushing TNT, a newer Minecraft feature that we don't use.On any PGM or Lobby server, these external plugins can/must be loaded:
As well as these plugins from this repo:
API/bukkit/target/api-bukkit-#-SNAPSHOT.jar
)Commons/bukkit/target/commons-bukkit-#-SNAPSHOT.jar
)For a PGM server, you also need:
PGM/target/PGM-#-SNAPSHOT.jar
)For tournament support on PGM, you also need:
Tourney/target/Tourney-#-SNAPSHOT.jar
)And for a Lobby server, you just need:
Lobby/target/Lobby-#-SNAPSHOT.jar
)For a Bungee proxy, you just need these two:
API/bungee/target/api-bungee-#-SNAPSHOT.jar
)Commons/bungee/target/commons-bungee-#-SNAPSHOT.jar
)Util
Utility code library (not a plugin) used by everything
core
Utils independent of Bukkit or Bungeebukkit
Bukkit utilsbungee
Bungee utilsAPI
Client
api
Data models and services, not related to Minecraftminecraft
Code specific to Minecraft, including standalone service implementationsbukkit
Bukkit pluginbungee
Bungee pluginocn
Hybrid plugin implementing OCN's HTTP and AMQP servicesCommons
Functionality common to all servers e.g. friends, nicknames, etc.
core
Code that is common to Bukkit and Bungee pluginsbukkit
Bukkit pluginbungee
Bungee pluginPGM
Primary Bukkit plugin on match serversLobby
Main Bukkit plugin on lobby serversTourney
Bukkit plugin that extends PGM with tournament-related functionalityDirect dependencies between the Bukkit plugins:
API
-> Raven
Commons
-> API
, BukkitSettings
, Channels
PGM
-> Commons
, API
, BukkitSettings
, Channels
Tourney
-> PGM
, Commons
, API
The API plugin is used by all the other plugins to interact with the data model. It is split into interface and implementation layers, allowing different backends to be used. There is a built-in default backend that implements minimal functionality for running a standalone server. The api-ocn plugin is the backend implementation for the former Overcast Network.
java.util.Optional
over null
, generally speaking.@Nullable
wherever nulls are allowed. Place it before the type, if possible.@Nonnull
. Assume anything (in our own code) without @Nullable
is never null.checkNotNull
on constructor arguments for manually created objects. Don't check @Inject
ed values, they cannot be null.final
fields, and create immutable data types, wherever possible.ThreadLocal
s).get
, but they can if you think it's important.org.bukkit.plugin.Plugin
inside its private module.Plugin
will need to be bound in some plugin's private module.Plugin
directly. There are specific bindings for most Bukkit service types (e.g. Configuration
)
and several interfaces of our own that wrap small parts of the Bukkit API (e.g. BukkitEventBus
).Plugin
, always inject the base interface, never a specific plugin's class. This makes it easy to move things between plugins.@Singleton
bound in a private environment (e.g. a plugin's private environment) will only be unique within that environment,
not the entire process, so be careful not to accidentally duplicate a singleton in multiple private environments.IllegalArgumentException
, because it's hard to be certain where they come from.
If you need to catch them, keep the code inside the try
block as small as possible.tc.oc.commons.core.exception.ExceptionHandler
and pass it the exceptions.MapdevLogger
.LoggingExceptionHandler
or some system logger.
You can tell the user about the error so they know what's going on, but don't expect them to deal with it.Event
s (except AsyncEvent
s) and scheduled tasks (except async tasks) run on the main thread.ListenableFuture
s and FutureCallback
s to handle API results.MainThreadExecutor
or SyncExecutor
to get back on the main thread from a background thread..properties
files in Commons.TranslatableComponent
to display the localized message. However, it must pass through the ComponentRenderContext
before being
sent to the player. That will apply the server-side translations.crowdin-cli upload sources
in the Commons folder.
This should be done after the new code is deployed to production.