mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
[ci-skip] Use VitePress instead of Docusaurus (#7)
* [ci-skip] full rework of docs * [ci-skip] update index page * [ci-skip] fix logo * [ci-skip] fix logo 2
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -6,4 +6,9 @@ DivineMC-Server
|
||||
build
|
||||
.gradle
|
||||
run
|
||||
.idea
|
||||
.idea
|
||||
|
||||
# VitePress (docs)
|
||||
node_modules
|
||||
docs/.vitepress/cache
|
||||
docs/.vitepress/dist
|
||||
42
docs/.vitepress/config.ts
Normal file
42
docs/.vitepress/config.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
|
||||
export default defineConfig({
|
||||
head: [['link', { rel: 'icon', href: 'favicon.ico' }]],
|
||||
title: "DivineMC",
|
||||
cleanUrls: true,
|
||||
description: "DivineMC is the fork of Purpur compatible with Spigot plugins, offering the best performance for your server.",
|
||||
themeConfig: {
|
||||
logo: 'logo.png',
|
||||
nav: [
|
||||
{ text: 'Home', link: '/' },
|
||||
{ text: 'Documentation', link: '/docs/' }
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
{
|
||||
text: 'Documentation',
|
||||
items: [
|
||||
{ text: 'Overview', link: '/docs/' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Administration',
|
||||
items: [
|
||||
{ text: 'Getting Started', link: '/docs/admin/getting-started' },
|
||||
{ text: 'Configuration', link: '/docs/admin/configuration' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Development',
|
||||
items: [
|
||||
{ text: 'Contributing to DivineMC', link: '/docs/dev/contributing' }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/DivineMC/DivineMC' },
|
||||
{ icon: 'discord', link: 'https://discord.gg/p7cxhw7E2M' }
|
||||
]
|
||||
}
|
||||
})
|
||||
78
docs/docs/admin/configuration.md
Normal file
78
docs/docs/admin/configuration.md
Normal file
@@ -0,0 +1,78 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Configuration
|
||||
|
||||
This page details the various configuration settings exposed by Bukkit, Spigot and Paper.
|
||||
|
||||
If you want information on settings in **paper.yml**, **spigot.yml**, **bukkit.yml** and **server.properties** you should see their respective documentation pages.
|
||||
|
||||
- [Server Configuration (server.properties)](https://minecraft.fandom.com/wiki/Server.properties)
|
||||
|
||||
- [Bukkit Configuration (bukkit.yml)](https://bukkit.fandom.com/wiki/Bukkit.yml)
|
||||
|
||||
- [Spigot Configuration (spigot.yml)](https://www.spigotmc.org/wiki/spigot-configuration)
|
||||
|
||||
- [Paper Configuration (paper.yml)](https://docs.papermc.io/paper/reference/paper-global-configuration)
|
||||
|
||||
- [Pufferfish Configuration (pufferfish.yml)](https://docs.pufferfish.host/setup/pufferfish-fork-configuration)
|
||||
|
||||
- [Purpur Configuration (purpur.yml)](https://purpurmc.org/docs/Configuration)
|
||||
|
||||
::: warning
|
||||
|
||||
Configuration values change frequently at times. It is possible for the information here to be incomplete. If you cannot find what you’re looking for or think something may be wrong, Contact us through our [Discord](https://discord.gg/p7cxhw7E2M) server.
|
||||
|
||||
:::
|
||||
|
||||
## Global Settings
|
||||
|
||||
Global settings affect all worlds on the server as well as the core server functionality itself.
|
||||
|
||||
### verbose
|
||||
|
||||
- **default**: false
|
||||
- **description**: Sets whether the server should dump all configuration values to the server log on startup (this maybe not working)
|
||||
|
||||
### config-version
|
||||
|
||||
- **Do not change this for any reason!** DivineMC uses this internally to help automatically update your config
|
||||
|
||||
### settings
|
||||
|
||||
- #### player
|
||||
- ##### allow-any-username
|
||||
- **default**: false
|
||||
- **description**: Enables a feature to allow players to log in with any username
|
||||
|
||||
#### fallback-to-dimension-if-world-uuid-unknown
|
||||
|
||||
- **default**: true
|
||||
- **description**: Enables a feature to allow players to log in with any username
|
||||
|
||||
## world-settings
|
||||
|
||||
World settings are on a per-world basis. The child-node `default` is used for all worlds that do not have their own specific settings.
|
||||
|
||||
For a more clear explanation of the world settings section of the config, feel free to read through Paper's explanation here: https://docs.papermc.io/paper/per-world-configuration
|
||||
|
||||
### gameplay-mechanics
|
||||
|
||||
- #### mob
|
||||
|
||||
- ##### shulker
|
||||
- ##### despawn-bullets-on-player-death
|
||||
- **default**: true
|
||||
- **description**: If player is dead from shulker - bullets disappering for optimization
|
||||
|
||||
- #### boat
|
||||
|
||||
- ##### dont-eject-players-from-boat-underwater
|
||||
|
||||
- **default**: true
|
||||
- **description**: Players can't be ejected from boat underwater
|
||||
|
||||
- ##### always-allow-to-enter-the-boat
|
||||
- **default**: true
|
||||
- **description**: Player can enter the boat anywhere
|
||||
61
docs/docs/admin/getting-started.md
Normal file
61
docs/docs/admin/getting-started.md
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
|
||||
## Requirements
|
||||
|
||||
::: tip
|
||||
|
||||
With the release of Minecraft 1.18+, DivineMC requires **Java 17** to run.
|
||||
|
||||
:::
|
||||
|
||||
## Migrating to DivineMC
|
||||
|
||||
### From Vanilla
|
||||
|
||||
Migrating from Vanilla is easy, but there are some differences, namely in world saves. DivineMC (and
|
||||
CraftBukkit and Spigot) separate out each dimension of a world (nether, the end, etc.) into separate
|
||||
world folders.
|
||||
|
||||
DivineMC will handle this conversion for you automatically. No additional consideration is required.
|
||||
|
||||
### From Craftbukkit or Spigot
|
||||
|
||||
DivineMC is a drop in replacement for both CraftBukkit and Spigot, you don't need to make any changes.
|
||||
|
||||
## Downloading DivineMC
|
||||
|
||||
DivineMC provides runnable server jars directly from [releases tab](https://github.com/DivineMC/DivineMC/releases/latest) on GitHub or on home page website [here](https://divinemc.bxteam.gq/#download).
|
||||
|
||||
Click on the _DivineMC-paperclip-VERSION-reobf.jar_ to download a runnable paperclip jar.
|
||||
|
||||
## Running The Server
|
||||
|
||||
To run the server, simply start it up like any other Java application.
|
||||
|
||||
Open your terminal, navigate to the saved location, and then run
|
||||
`java -Xms2G -Xmx2G -jar divinemc.jar --nogui`. Ensure you replace `divinemc.jar` with the name of the jar
|
||||
you have downloaded. (or just rename downloaded jar to server.jar)
|
||||
|
||||
The amount of RAM can be set by changing the numbers in the `-Xms` and `-Xmx` arguments. `--nogui`
|
||||
disables Vanilla's GUI, so you don't get double interfaces when using the command line.
|
||||
|
||||
For more advanced Java tuning, see [Aikar's Flags](https://divinemc.bxteam.gq/blog/2022/12/30/Aikar-Flags) tutorial on our blog. Or you can read more [advanced Aikar's Flags](https://divinemc.bxteam.gq/blog/2023/01/20/Updated-Aikar-Flags) tutorial on our blog.
|
||||
|
||||
## List of all DivineMC versions
|
||||
|
||||
When you download the server jar, you will get the latest version of DivineMC. If you want to download an older version, you can do so from the releases tab or here.
|
||||
|
||||
Here is a list of all the versions of DivineMC:
|
||||
|
||||
| Name | Fork Of | Download |
|
||||
| :-------------: | :---------------: | :--------------------------------------------------------------------------------: |
|
||||
| DivineMC 1.20.1 | Purpur 1.20.1 | [Download latest](https://github.com/DivineMC/DivineMC/releases/tag/latest-1.20.1) |
|
||||
| DivineMC 1.20 | Purpur 1.20 | [Download latest](https://github.com/DivineMC/DivineMC/releases/tag/latest-1.20) |
|
||||
| DivineMC 1.19.4 | Purpur 1.19.4 | [Download latest](https://github.com/DivineMC/DivineMC/releases/tag/latest-1.19.4) |
|
||||
| DivineMC 1.19.4 | Pufferfish 1.19.4 | [Download latest](https://github.com/DivineMC/DivineMC/releases/tag/release-109) |
|
||||
| DivineMC 1.19.3 | Pufferfish 1.19.3 | [Download latest](https://github.com/DivineMC/DivineMC/releases/tag/latest-1.19.3) |
|
||||
| DivineMC 1.19.2 | Pufferfish 1.19.2 | [Download latest](https://github.com/DivineMC/DivineMC/releases/tag/latest-1.19.2) |
|
||||
445
docs/docs/dev/contributing.md
Normal file
445
docs/docs/dev/contributing.md
Normal file
@@ -0,0 +1,445 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Contributing to DivineMC
|
||||
|
||||
DivineMC is happy you're willing to contribute to our projects. We are usually
|
||||
very lenient with all submitted PRs, but there are still some guidelines you
|
||||
can follow to make the approval process go more smoothly.
|
||||
|
||||
## Use a Personal Fork and not Organization
|
||||
|
||||
DivineMC will routinely modify your PR, whether it's a quick rebase or to take care
|
||||
of any minor nitpicks we might have. Often, it's better for us to solve these
|
||||
problems for you than make you go back and forth trying to fix it yourself.
|
||||
|
||||
Unfortunately, if you use an organization for your PR, it prevents DivineMC from
|
||||
modifying it. This requires us to manually merge your PR, resulting in us
|
||||
closing the PR instead of marking it as merged.
|
||||
|
||||
We much prefer to have PRs show as merged, so please do not use repositories
|
||||
on organizations for PRs.
|
||||
|
||||
See <https://github.com/isaacs/github/issues/1681> for more information on the
|
||||
issue.
|
||||
|
||||
## Requirements
|
||||
|
||||
To get started with PRing changes, you'll need the following software, most of
|
||||
which can be obtained in (most) package managers such as `apt` (Debian / Ubuntu;
|
||||
you will most likely use this for WSL), `homebrew` (macOS / Linux), and more:
|
||||
|
||||
- `git` (package `git` everywhere);
|
||||
- A Java 17 or later JDK (packages vary, use Google/DuckDuckGo/etc.).
|
||||
- [Adoptium](https://adoptium.net/) has builds for most operating systems.
|
||||
- DivineMC requires JDK 17 to build, however makes use of Gradle's
|
||||
[Toolchains](https://docs.gradle.org/current/userguide/toolchains.html)
|
||||
feature to allow building with only JRE 8 or later installed. (Gradle will
|
||||
automatically provision JDK 17 for compilation if it cannot find an existing
|
||||
install).
|
||||
|
||||
If you're on Windows, check
|
||||
[the section on WSL](#patching-and-building-is-really-slow-what-can-i-do).
|
||||
|
||||
If you're compiling with Docker, you can use Adoptium's
|
||||
[`eclipse-temurin`](https://hub.docker.com/_/eclipse-temurin/) images like so:
|
||||
|
||||
```console
|
||||
# docker run -it -v "$(pwd)":/data --rm eclipse-temurin:16.0.2_7-jdk bash
|
||||
Pulling image...
|
||||
|
||||
root@abcdefg1234:/# javac -version
|
||||
javac 16.0.2
|
||||
```
|
||||
|
||||
## Understanding Patches
|
||||
|
||||
DivineMC is mostly patches and extensions to Paper/Spigot. These patches/extensions are
|
||||
split into different directories which target certain parts of the code. These
|
||||
directories are:
|
||||
|
||||
- `DivineMC-API` - Modifications to `Paper-API` and `Purpur-API`;
|
||||
- `DivineMC-Server` - Modifications to `Paper-Server` and `Purpur-Server`.
|
||||
|
||||
Because the entire structure is based on patches and git, a basic understanding
|
||||
of how to use git is required. A basic tutorial can be found here:
|
||||
<https://git-scm.com/docs/gittutorial>.
|
||||
|
||||
Assuming you have already forked the repository:
|
||||
|
||||
1. Clone your fork to your local machine;
|
||||
2. Type `./gradlew applyPatches` in a terminal to apply the changes from upstream.
|
||||
On Windows, leave out the `./` at the beginning for all `gradlew` commands;
|
||||
3. cd into `DivineMC-Server` for server changes, and `DivineMC-API` for API changes.
|
||||
|
||||
`DivineMC-Server` and `DivineMC-API` aren't git repositories in the traditional sense:
|
||||
|
||||
- `base` points to the unmodified source before DivineMC patches have been applied.
|
||||
- Each commit after `base` is a patch.
|
||||
|
||||
## Adding Patches
|
||||
|
||||
Adding patches to DivineMC is very simple:
|
||||
|
||||
1. Modify `DivineMC-Server` and/or `DivineMC-API` with the appropriate changes;
|
||||
1. Type `git add .` inside these directories to add your changes;
|
||||
1. Run `git commit` with the desired patch message;
|
||||
1. Run `./gradlew rebuildPatches` in the main directory to convert your commit into a new
|
||||
patch;
|
||||
1. PR the generated patch file(s) back to this repository.
|
||||
|
||||
Your commit will be converted into a patch that you can then PR into DivineMC.
|
||||
|
||||
> ❗ Please note that if you have some specific implementation detail you'd like
|
||||
> to document, you should do so in the patch message _or_ in comments.
|
||||
|
||||
## Modifying Patches
|
||||
|
||||
Modifying previous patches is a bit more complex:
|
||||
|
||||
### Method 1
|
||||
|
||||
This method works by temporarily resetting your `HEAD` to the desired commit to
|
||||
edit it using `git rebase`.
|
||||
|
||||
> ❗ While in the middle of an edit, you will not be able to compile unless you
|
||||
> _also_ reset the opposing module(s) to a related commit. In the API's case,
|
||||
> you must reset the Server, and reset the API if you're editing the Server.
|
||||
> Note also that either module _may_ not compile when doing so. This is not
|
||||
> ideal nor intentional, but it happens. Feel free to fix this in a PR to us!
|
||||
|
||||
1. If you have changes you are working on, type `git stash` to store them for
|
||||
later;
|
||||
- You can type `git stash pop` to get them back at any point.
|
||||
1. Type `git rebase -i base`;
|
||||
- It should show something like
|
||||
[this](https://gist.github.com/zachbr/21e92993cb99f62ffd7905d7b02f3159) in
|
||||
the text editor you get.
|
||||
- If your editor does not have a "menu" at the bottom, you're using `vim`.
|
||||
If you don't know how to use `vim` and don't want to
|
||||
learn, enter `:q!` and press enter. Before redoing this step, do
|
||||
`export EDITOR=nano` for an easier editor to use.
|
||||
1. Replace `pick` with `edit` for the commit/patch you want to modify, and
|
||||
"save" the changes;
|
||||
- Only do this for **one** commit at a time.
|
||||
1. Make the changes you want to make to the patch;
|
||||
1. Type `git add .` to add your changes;
|
||||
1. Type `git commit --amend` to commit;
|
||||
- **Make sure to add `--amend`** or else a new patch will be created.
|
||||
- You can also modify the commit message and author here.
|
||||
1. Type `git rebase --continue` to finish rebasing;
|
||||
1. Type `./gradlew rebuildPatches` in the root directory;
|
||||
- This will modify the appropriate patches based on your commits.
|
||||
1. PR your modified patch file(s) back to this repository.
|
||||
|
||||
### Method 2 - Fixup commits
|
||||
|
||||
If you are simply editing a more recent commit or your change is small, simply
|
||||
making the change at HEAD and then moving the commit after you have tested it
|
||||
may be easier.
|
||||
|
||||
This method has the benefit of being able to compile to test your change without
|
||||
messing with your HEADs.
|
||||
|
||||
#### Manual method
|
||||
|
||||
1. Make your change while at HEAD;
|
||||
1. Make a temporary commit. You don't need to make a message for this;
|
||||
1. Type `git rebase -i base`, move (cut) your temporary commit and
|
||||
move it under the line of the patch you wish to modify;
|
||||
1. Change the `pick` to the appropriate action:
|
||||
1. `f`/`fixup`: Merge your changes into the patch without touching the
|
||||
message.
|
||||
1. `s`/`squash`: Merge your changes into the patch and use your commit message
|
||||
and subject.
|
||||
1. Type `./gradlew rebuildPatches` in the root directory;
|
||||
- This will modify the appropriate patches based on your commits.
|
||||
1. PR your modified patch file(s) back to this repository.
|
||||
|
||||
#### Automatic method
|
||||
|
||||
1. Make your change while at HEAD;
|
||||
1. Make a fixup commit. `git commit -a --fixup <hashOfPatchToFix>`;
|
||||
- You can also use `--squash` instead of `--fixup` if you want the commit
|
||||
message to also be changed.
|
||||
- You can get the hash by looking at `git log` or `git blame`; your IDE can
|
||||
assist you too.
|
||||
- Alternatively, if you only know the name of the patch, you can do
|
||||
`git commit -a --fixup "Subject of Patch name"`.
|
||||
1. Rebase with autosquash: `git rebase --autosquash -i base`.
|
||||
This will automatically move your fixup commit to the right place, and you just
|
||||
need to "save" the changes.
|
||||
1. Type `./gradlew rebuildPatches` in the root directory;
|
||||
- This will modify the appropriate patches based on your commits.
|
||||
1. PR your modified patch file(s) back to this repository.
|
||||
|
||||
## Rebasing PRs
|
||||
|
||||
Steps to rebase a PR to include the latest changes from `master`.
|
||||
These steps assume the `origin` remote is your fork of this repository and `upstream` is the official DivineMC repository.
|
||||
|
||||
1. Pull the latest changes from upstreams master: `git checkout master && git pull upstream master`.
|
||||
1. Checkout feature/fix branch and rebase on master: `git checkout patch-branch && git rebase master`.
|
||||
1. Apply updated patches: `./gradlew applyPatches`.
|
||||
1. If there are conflicts, fix them.
|
||||
1. If your PR creates new patches instead of modifying exist ones, in both the `DivineMC-Server` and `DivineMC-API` directories, ensure your newly-created patch is the last commit by either:
|
||||
- Renaming the patch file with a large 4-digit number in front (e.g. 9999-Patch-to-add-some-new-stuff.patch), and re-applying patches.
|
||||
- Running `git rebase --interactive base` and moving the commits to the end.
|
||||
1. Rebuild patches: `./gradlew rebuildPatches`.
|
||||
1. Commit modified patches.
|
||||
1. Force push changes: `git push --force`.
|
||||
|
||||
## PR Policy
|
||||
|
||||
We'll accept changes that make sense. You should be able to justify their
|
||||
existence, along with any maintenance costs that come with them. Using
|
||||
[obfuscation helpers](#obfuscation-helpers) aids in the maintenance costs.
|
||||
Remember that these changes will affect everyone who runs DivineMC, not just you
|
||||
and your server.
|
||||
|
||||
While we will fix minor formatting issues, you should stick to the guide below
|
||||
when making and submitting changes.
|
||||
|
||||
## Formatting
|
||||
|
||||
All modifications to non-DivineMC files should be marked.
|
||||
|
||||
- Multi-line changes start with `// DivineMC start` and end with `// DivineMC end`;
|
||||
- You can put a comment with an explanation if it isn't obvious, like this:
|
||||
`// DivineMC start - reason`.
|
||||
- The comments should generally be about the reason the change was made, what
|
||||
it was before, or what the change is.
|
||||
- Multi-line messages should start with `// DivineMC start` and use `/* Multi
|
||||
line message here */` for the message itself.
|
||||
- One-line changes should have `// DivineMC` or `// DivineMC - reason`.
|
||||
|
||||
Here's an example of how to mark changes by DivineMC:
|
||||
|
||||
```java
|
||||
entity.getWorld().dontbeStupid(); // DivineMC - was beStupid() which is bad
|
||||
entity.getFriends().forEach(Entity::explode);
|
||||
entity.a();
|
||||
entity.b();
|
||||
// DivineMC start - use plugin-set spawn
|
||||
// entity.getWorld().explode(entity.getWorld().getSpawn());
|
||||
Location spawnLocation = ((CraftWorld)entity.getWorld()).getSpawnLocation();
|
||||
entity.getWorld().explode(new BlockPosition(spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ()));
|
||||
// DivineMC end
|
||||
```
|
||||
|
||||
We generally follow usual Java style (aka. Oracle style), or what is programmed
|
||||
into most IDEs and formatters by default. There are a few notes, however:
|
||||
|
||||
- It is fine to go over 80 lines as long as it doesn't hurt readability.
|
||||
There are exceptions, especially in Spigot-related files
|
||||
- When in doubt or the code around your change is in a clearly different style,
|
||||
use the same style as the surrounding code.
|
||||
|
||||
## Patch Notes
|
||||
|
||||
When submitting patches to DivineMC, we may ask you to add notes to the patch
|
||||
header. While we do not require it for all changes, you should add patch notes
|
||||
when the changes you're making are technical, complex, or require an explanation
|
||||
of some kind. It is very likely that your patch will remain long after we've all
|
||||
forgotten about the details of your PR; patch notes will help us maintain it
|
||||
without having to dig back through GitHub history looking for your PR.
|
||||
|
||||
These notes should express the intent of your patch, as well as any pertinent
|
||||
technical details we should keep in mind long-term. Ultimately, they exist to
|
||||
make it easier for us to maintain the patch across major version changes.
|
||||
|
||||
If you add a message to your commit in the `DivineMC-Server`/`DivineMC-API`
|
||||
directories, the rebuild patches script will handle these patch notes
|
||||
automatically as part of generating the patch file. If you are not
|
||||
extremely careful, you should always just `squash` or `amend` a patch (see the
|
||||
above sections on modifying patches) and rebuild.
|
||||
|
||||
Editing messages and patches by hand is possible, but you should patch and
|
||||
rebuild afterwards to make sure you did it correctly. This is slower than just
|
||||
modifying the patches properly after a few times, so you will not really gain
|
||||
anything but headaches from doing it by hand.
|
||||
|
||||
Underneath is an example patch header/note:
|
||||
|
||||
```patch
|
||||
From 02abc033533f70ef3165a97bfda3f5c2fa58633a Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sun, 15 Oct 2017 00:29:07 +0100
|
||||
Subject: [PATCH] revert serverside behavior of keepalives
|
||||
|
||||
This patch intends to bump up the time that a client has to reply to the
|
||||
server back to 30 seconds as per pre 1.12.2, which allowed clients
|
||||
more than enough time to reply, potentially allowing them to be less
|
||||
temperamental due to lag spikes on the network thread, e.g. that caused
|
||||
by plugins that are interacting with netty.
|
||||
|
||||
We also add a system property to allow people to tweak how long the server
|
||||
will wait for a reply. There is a compromise here between lower and higher
|
||||
values, lower values will mean that dead connections can be closed sooner,
|
||||
whereas higher values will make this less sensitive to issues such as spikes
|
||||
from networking or during connections flood of chunk packets on slower clients,
|
||||
at the cost of dead connections being kept open for longer.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index a92bf8967..d0ab87d0f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
```
|
||||
|
||||
## Obfuscation Helpers
|
||||
|
||||
While rarely needed, obfuscation helpers are sometimes useful when it comes
|
||||
to unmapped local variables, or poorly named method parameters. In an effort
|
||||
to make future updates easier on ourselves, DivineMC tries to use obfuscation
|
||||
helpers wherever it makes sense. The purpose of these helpers is to make the
|
||||
code more readable and maintainable. These helpers should be made easy to
|
||||
inline by the JVM wherever possible.
|
||||
|
||||
An example of an obfuscation helper for a local variable:
|
||||
|
||||
```java
|
||||
double d0 = entity.getX(); final double fromX = d0; // DivineMC - OBFHELPER
|
||||
// ...
|
||||
this.someMethod(fromX); // DivineMC
|
||||
```
|
||||
|
||||
While they may not always be done in exactly the same way, the general goal is
|
||||
always to improve readability and maintainability. Use your best judgment and do
|
||||
what fits best in your situation.
|
||||
|
||||
## Configuration files
|
||||
|
||||
To use a configurable value in your patch, add a new entry in either the
|
||||
`DivineConfig` or `DivineWorldConfig` classes. Use `DivineConfig` if a value
|
||||
must remain the same throughout all worlds, or the latter if it can change
|
||||
between worlds. World-specific configuration options are preferred whenever
|
||||
possible.
|
||||
|
||||
### DivineConfig example
|
||||
|
||||
```java
|
||||
public static boolean saveEmptyScoreboardTeams = false;
|
||||
private static void saveEmptyScoreboardTeams() {
|
||||
// This is called automatically!
|
||||
// The name also doesn't matter.
|
||||
saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false);
|
||||
}
|
||||
```
|
||||
|
||||
Notice that the field is always public, but the setter is always private. This
|
||||
is important to the way the configuration generation system works. To access
|
||||
this value, reference it as you would any other static value:
|
||||
|
||||
```java
|
||||
if (!DivineConfig.saveEmptyScoreboardTeams) {
|
||||
```
|
||||
|
||||
It is often preferred that you use the fully qualified name for the
|
||||
configuration class when accessing it, like so:
|
||||
`gq.bxteam.divinemc.configuration.DivineConfig.valueHere`.
|
||||
If this is not done, a developer for DivineMC might fix that for you before
|
||||
merging, but it's always nice if you make it a habit where you only need 1-2
|
||||
lines changed.
|
||||
|
||||
### DivineWorldConfig example
|
||||
|
||||
```java
|
||||
public boolean useInhabitedTime = true;
|
||||
private void useInhabitedTime() {
|
||||
// This is called automatically!
|
||||
// The name also doesn't matter.
|
||||
useInhabitedTime = getBoolean("use-chunk-inhabited-timer", true);
|
||||
}
|
||||
```
|
||||
|
||||
Again, notice that the field is always public, but the setter is always private.
|
||||
To access this value, you'll need an instance of the `net.minecraft.world.level.Level`
|
||||
object:
|
||||
|
||||
```java
|
||||
return this.level.divinemcConfig.useInhabitedTime ? this.inhabitedTime : 0;
|
||||
```
|
||||
|
||||
## Testing API changes
|
||||
|
||||
### Publishing to Maven local (use in external plugins)
|
||||
|
||||
To build and install the DivineMC APIs and Server to your local Maven repository, do the following:
|
||||
|
||||
- Run `./gradlew publishToMavenLocal` in the base directory.
|
||||
|
||||
If you use Gradle to build your plugin:
|
||||
|
||||
- Add `mavenLocal()` as a repository. Gradle checks repositories in the order they are declared,
|
||||
so if you also have the DivineMC repository added, put the local repository above DivineMC's.
|
||||
- Make sure to remove `mavenLocal()` when you are done testing, see the [Gradle docs](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven-local)
|
||||
for more details.
|
||||
|
||||
If you use Maven to build your plugin:
|
||||
|
||||
- If you later need to use the DivineMC-API, you might want to remove the jar
|
||||
from your local Maven repository.
|
||||
If you use Windows and don't usually build using WSL, you might not need to
|
||||
do this.
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### I can't find the NMS file I need!
|
||||
|
||||
By default, DivineMC (and upstream) only import files we make changes to. If you
|
||||
would like to make changes to a file that isn't present in `DivineMC-Server`'s
|
||||
source directory, you just need to add it to our import script ran during the
|
||||
patching process.
|
||||
|
||||
1. Save (rebuild) any patches you are in the middle of working on! Their
|
||||
progress will be lost if you do not;
|
||||
1. Identify the name(s) of the file(s) you want to import.
|
||||
- A complete list of all possible file names can be found at
|
||||
`./DivineMC-Server/.gradle/caches/paperweight/mc-dev-sources/net/minecraft/`. You might find
|
||||
[MiniMappingViewer] useful if you need to translate between Mojang and Spigot mapped names.
|
||||
1. Open the file at `./build-data/dev-imports.txt` and add the name of your file to
|
||||
the script. Follow the instructions there;
|
||||
1. Re-patch the server `./gradlew applyPatches`;
|
||||
1. Edit away!
|
||||
|
||||
> ❗ This change is temporary! **DO NOT COMMIT CHANGES TO THIS FILE!**
|
||||
> Once you have made your changes to the new file, and rebuilt patches, you may
|
||||
> undo your changes to `dev-imports.txt`.
|
||||
|
||||
Any file modified in a patch file gets automatically imported, so you only need
|
||||
this temporarily to import it to create the first patch.
|
||||
|
||||
To undo your changes to the file, type `git checkout build-data/dev-imports.txt`.
|
||||
|
||||
### My commit doesn't need a build, what do I do?
|
||||
|
||||
Well, quite simple: You add `[ci-skip]` to the start of your commit subject.
|
||||
|
||||
This case most often applies to changes to files like `README.md`, this very
|
||||
file (`CONTRIBUTING.md`), the `LICENSE.md` file, and so forth.
|
||||
|
||||
### Patching and building is _really_ slow, what can I do?
|
||||
|
||||
This only applies if you're running Windows. If you're running a prior Windows
|
||||
release, either update to Windows 10 or move to macOS/Linux/BSD.
|
||||
|
||||
In order to speed up patching process on Windows, it's recommended you get WSL. 2. This is available in Windows 10 v2004, build 19041 or higher. (You can check
|
||||
your version by running `winver` in the run window (Windows key + R)). If you're
|
||||
out of date, update your system with the
|
||||
[Windows Update Assistant](https://www.microsoft.com/en-us/software-download/windows10).
|
||||
|
||||
To set up WSL 2, follow the information here:
|
||||
<https://docs.microsoft.com/en-us/windows/wsl/install-win10>
|
||||
|
||||
You will most likely want to use the Ubuntu apps. Once it's set up, install the
|
||||
required tools with `sudo apt-get update && sudo apt-get install $TOOL_NAMES
|
||||
-y`. Replace `$TOOL_NAMES` with the packages found in the
|
||||
[requirements](#requirements). You can now clone the repository and do
|
||||
everything like usual.
|
||||
|
||||
> ❗ Do not use the `/mnt/` directory in WSL! Instead, mount the WSL directories
|
||||
> in Windows like described here:
|
||||
> <https://www.howtogeek.com/426749/how-to-access-your-linux-wsl-files-in-windows-10/>
|
||||
|
||||
[MiniMappingViewer]: https://minidigger.github.io/MiniMappingViewer/
|
||||
35
docs/docs/index.md
Normal file
35
docs/docs/index.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
outline: deep
|
||||
aside: false
|
||||
---
|
||||
|
||||
# Welcome to DivineMC wiki
|
||||
|
||||
DivineMC is the fork of Purpur compatible with Spigot plugins, offering the best performance for your server.
|
||||
|
||||
## Features
|
||||
|
||||
- **DivineMC is a fork of [Purpur](https://github.com/PurpurMC/Purpur)** designed for configurability, new fun and exciting gameplay features.
|
||||
- **Contains [Lithium](https://github.com/CaffeineMC/lithium-fabric) patches** that optimizing many areas in game.
|
||||
- **Contains** some PaperMC pull requests patches.
|
||||
- **Bug fixes** for several Minecraft issues.
|
||||
- **Plugin compatibility** with Spigot & Paper plugins.
|
||||
|
||||
## Downloads
|
||||
|
||||
In normal case, you can download the latest JAR file from releases tab [here](https://github.com/DivineMC/DivineMC/releases/latest)
|
||||
|
||||
**Please note:** Java >= 17 is required.
|
||||
|
||||
## Building
|
||||
In order to distribute and use this server software, you need a paperclip file:
|
||||
|
||||
```bash
|
||||
./gradlew applyPatches && ./gradlew createReobfPaperclipJar
|
||||
```
|
||||
|
||||
## License
|
||||
Patches are licensed under GPL-3.0.
|
||||
All other files are licensed under MIT.
|
||||
|
||||
###### [List of all forks](https://gist.github.com/SoSeDiK/1773ef2c239722f7083a25b2f78619ed)
|
||||
59
docs/index.md
Normal file
59
docs/index.md
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "DivineMC"
|
||||
tagline: "DivineMC is the fork of Purpur compatible with Spigot plugins, offering the best performance for your server."
|
||||
image:
|
||||
src: logo.png
|
||||
alt: DivineMC
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Download
|
||||
link: https://github.com/DivineMC/DivineMC/releases/latest
|
||||
- theme: alt
|
||||
text: Documentation
|
||||
link: /docs/
|
||||
|
||||
features:
|
||||
- icon: 🍴
|
||||
title: Fork of Purpur
|
||||
details: DivineMC is the fork of Purpur compatible with Spigot plugins, offering the best performance for your server.
|
||||
- icon: 📰
|
||||
title: Lithium patches
|
||||
details: DivineMC contains Lithium patches that optimizing many areas in game.
|
||||
- icon: 🆕
|
||||
title: New features
|
||||
details: DivineMC contains some PaperMC pull requests patches.
|
||||
- icon: 🐛
|
||||
title: Bug fixes
|
||||
details: DivineMC have patches that fixes bugs for several Minecraft issues.
|
||||
- icon: 🔌
|
||||
title: Plugin compatibility
|
||||
details: DivineMC have full compatibility with Spigot & Paper plugins.
|
||||
- icon: 🔃
|
||||
title: Always up-to date
|
||||
details: DivineMC always updated to latest version of Purpur
|
||||
---
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--vp-home-hero-name-color: transparent;
|
||||
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #ffa38a 30%, #310085);
|
||||
|
||||
--vp-home-hero-image-background-image: linear-gradient(-45deg, #ffa38a 50%, #310085 50%);
|
||||
--vp-home-hero-image-filter: blur(40px);
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
:root {
|
||||
--vp-home-hero-image-filter: blur(56px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
:root {
|
||||
--vp-home-hero-image-filter: blur(72px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
BIN
docs/public/favicon.ico
Normal file
BIN
docs/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
docs/public/logo.png
Normal file
BIN
docs/public/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
2039
package-lock.json
generated
Normal file
2039
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
package.json
Normal file
11
package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"vitepress": "^1.0.0-rc.7"
|
||||
},
|
||||
"scripts": {
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "vitepress build docs",
|
||||
"docs:preview": "vitepress preview docs"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user