9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-30 12:19:13 +00:00

Merge rework in default branch

DivineMC rework completed, merging...
This commit is contained in:
Artem Ostrasev
2023-04-12 11:17:57 +03:00
committed by GitHub
102 changed files with 3839 additions and 252 deletions

View File

@@ -1,40 +1,26 @@
<img src="https://api.bxteam.gq/v3/resources/divinemc-logo.png" height="240" alt="DivineMC Face" align="right">
<div align="center">
<img src="https://api.bxteam.gq/v3/resources/divinemc-logo.png" height="240" alt="DivineMC Face">
<h1>DivineMC</h1>
<h2>Fork of Paper compatible with Spigot plugins, offering the best performance for your server.</h3>
<h4>DivineMC is ❗ under heavy development ❗ and contributions are welcome!</h4>
<h3>Fork of Purpur compatible with Spigot plugins, offering the best performance for your server.</h3>
<br>
[![License](https://img.shields.io/github/license/DivineMC/DivineMC?style=for-the-badge&logo=github)](PATCHES-LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/DivineMC/DivineMC/build.yml?branch=ver%2F1.19.3&event=workflow_dispatch&logo=GoogleAnalytics&style=for-the-badge&logoColor=ffffff)](https://github.com/DivineMC/DivineMC/actions)
[![Discord](https://img.shields.io/discord/931595732752953375?color=%235865F2&label=Discord&logo=discord&style=for-the-badge&logoColor=ffffff)](https://discord.gg/p7cxhw7E2M)
![MC Version](https://img.shields.io/badge/MC-1.19.4-6047ff?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAW9yTlQBz6J3mgAAAAFzUkdCAK7OHOkAAAm2SURBVFjDrZd7qOXXVcc/+/F7nHN+53HPvXdmMq8ktaNUWp9UxVZBkIKooShV22goxcFimxDER00h1YoaUPtHTbUhta3VUobSplBrrFRLKlEaJ4/CJJPJzJ3M3Mk87z3nnsfvuX/74R9niGCwNZL97957rc9ee63F+gpe5Xr8xY/Q1f3kpeXWOxtX31N7e0GK5I9+87G/ePrffuGzvOnQna/Knvi/HvyXrb/kJ48cF194/gNv1pL3x1LdsWyroQueWMZnl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CXFWkSI6TGi4iyqrHWkaYx3U5CY1pAiJerII41WknXmqa9tihJ4wjvPNemOeMsxcuYeDzi1nXP2Uu7DLqrF2zfmBOkomlaqqYlLys6aUI3Tch6KbWPaIyjMavy8z5QNwZrHbWxxtTl6gvS3pDxxr4bXqjfPri59vVjRzZcGmuuT5YUTQuuIVQLducl1nvKpmU87NFNY1rr0FoDkCYxo0HGeNTHuYCtc0yxB0Cvk66iIsQsIB50nk/WrfvvkSyEwFMP3cOiCft2JtNfuj6dv3/76vR7lJR0Ek1ZG4QQJJFmUTYc2FxDDA+ye/lFnj6/g/OBONJEkUZJiRBQlDVKKVprsc61Wbf7j2maPDgab37DNI35zCP/9Mqh9NGHP8xdx+/nzz/4rjdcvjb99TrdvMtMXto4up5iWs+yatidF4yHPUj6bF++zoVJsZoXxKqjhhAIYWVvPBpQNc1TxvoHx2trjyzzfPboN07+77rgZ47fzw5QRhunb/v+t/xu/9Dr3zEc9D6f9dIm68a0zhNrTZZEHM4Cw46mbS3OenwINKZlWdQYEoKQl533fzAcDH+xyWef+uEf/fFXOP+Oyujh3/sVhIwzb/Kfm83zexrT/lgIQYz7HcaDLlf3Cv7hyYuYdlVeSkry2uadjdtOJHb20M+/7a0nnz1zIXz0Uyf+/9Ls1GNf4qEHPsTR224/VOTLX+3E8jdC8Lf30phJYXj8+evUpqWfdV0Sx//auvDRwYFjX3OmqE988UuvnTj9mz+8h8N3fJjLJ977A3VVHp/Ni3dO8mbt1OU5URyfWhsOPu48J4xpdj//1cdfO3H6P9cn7ns34/EoPvnkMz97aXd577wV54JQH/ny17/57Mf+5IO8774/flX2/gtnEWFB1FDO/wAAAABJRU5ErkJggg==&style=for-the-badge&logoColor=ffffff)
[![Download](https://img.shields.io/github/downloads/DivineMC/DivineMC/total?&style=for-the-badge&logoColor=ffffff)](https://github.com/DivineMC/DivineMC/releases/tag/latest-1.19.3)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/DivineMC/DivineMC/build.yml?logo=GoogleAnalytics&logoColor=ffffff&style=for-the-badge)](https://github.com/DivineMC/DivineMC/actions)
[![Discord](https://img.shields.io/discord/931595732752953375?color=5865F2&label=discord&style=for-the-badge)](https://discord.gg/p7cxhw7E2M)
[![Download](https://img.shields.io/github/downloads/DivineMC/DivineMC/total?&style=for-the-badge&logoColor=ffffff)](https://github.com/DivineMC/DivineMC/releases/latest)
</div>
## Features
- **DivineMC is a fork of [Pufferfish](https://github.com/pufferfish-gg/Pufferfish)** which a the best performance Minecraft core.
- **Contains [Lithium](https://github.com/CaffeineMC/lithium-fabric) patches** which is optimize many areas in game.
- **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.
- **Contains** PaperMC pull requests patches.
- **Faster process** for Vanilla methods.
- **Dynamic mine-carts speed**
- **Plugin compatibility** with Spigot & Paper plugins.
## We use patches from the following projects
* **[Paper](https://github.com/PaperMC/Paper)**
* **[Purpur](https://github.com/PurpurMC/Purpur)**
* **[Kiterino](https://github.com/SoSeDiKs-Universe/Kiterino)**
* **[Mirai](https://github.com/etil2jz/Mirai)**
* **NOTE: We also borrow some patches from [Yatopia](https://github.com/YatopiaMC/Yatopia).**
## Downloads
In normal case, you can download latest JAR file from releases tab [here](https://github.com/DivineMC/DivineMC/releases/latest)
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.
@@ -49,4 +35,4 @@ In order to distribute and use this server software, you need a paperclip file:
Patches are licensed under GPL-3.0.
All other files are licensed under MIT.
###### And we don't steal logo from YatopiaMC!!!
###### And we don't steal logo from YatopiaMC! [List of all forks](https://gist.github.com/SoSeDiK/1773ef2c239722f7083a25b2f78619ed)

View File

@@ -8,5 +8,3 @@
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
minecraft net.minecraft.network.protocol.status.ServerStatus.java

View File

@@ -1,12 +1,19 @@
import io.papermc.paperweight.util.constants.PAPERCLIP_CONFIG
plugins {
java
id("com.github.johnrengelman.shadow") version "8.1.0" apply false
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.patcher") version "1.5.3"
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://papermc.io/repo/repository/maven-public/") {
content {
onlyForConfigurations(PAPERCLIP_CONFIG)
}
}
}
dependencies {
@@ -18,13 +25,32 @@ dependencies {
subprojects {
apply(plugin = "java")
java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } }
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
}
subprojects {
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(17)
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test> {
minHeapSize = "2g"
maxHeapSize = "2g"
}
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
@@ -33,8 +59,8 @@ subprojects {
maven("https://repo.aikar.co/content/groups/aikar")
maven("https://repo.md-5.net/content/repositories/releases/")
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://jitpack.io")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
}
}
@@ -44,19 +70,18 @@ paperweight {
remapRepo.set("https://maven.fabricmc.net/")
decompileRepo.set("https://files.minecraftforge.net/maven/")
useStandardUpstream("pufferfish") {
url.set(github("pufferfish-gg", "Pufferfish"))
ref.set(providers.gradleProperty("pufferfishRef"))
useStandardUpstream("purpur") {
url.set(github("PurpurMC", "Purpur"))
ref.set(providers.gradleProperty("purpurRef"))
withStandardPatcher {
apiSourceDirPath.set("pufferfish-api")
serverSourceDirPath.set("pufferfish-server")
baseName("Purpur")
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
apiOutputDir.set(layout.projectDirectory.dir("DivineMC-API"))
apiOutputDir.set(layout.projectDirectory.dir("divinemc-api"))
serverOutputDir.set(layout.projectDirectory.dir("divinemc-server"))
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("DivineMC-Server"))
}
}
}

View File

@@ -1,11 +1,9 @@
group=gq.bxteam.divinemc
version=1.19.4-R0.1-SNAPSHOT
mcVersion=1.19.4
pufferfishRef=751dfb0338e2c09519313ffaca04084dc3140b80
purpurRef=f952106e1ba20e799dbe0e67c1d241e3f286b5f4
org.gradle.jvmargs=-Xmx2G
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.parallel.threads=8
org.gradle.daemon=true
org.gradle.caching = true
org.gradle.parallel = true
org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx2G

Binary file not shown.

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists

12
gradlew vendored
View File

@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac

1
gradlew.bat vendored
View File

@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

View File

@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Mon, 27 Mar 2023 17:50:05 +0300
Subject: [PATCH] Divine Configuration
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 730caafaf9629664ba125f3884559da76616f655..060a14fdbb25faa671ada919344c086f7ec43c20 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1980,6 +1980,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Purpur end
+ // DivineMC start
+ @NotNull
+ public org.bukkit.configuration.file.YamlConfiguration getDivineConfig() {
+ throw new UnsupportedOperationException("Not supported yet");
+ }
+ // DivineMC end
+
/**
* Sends the component to the player
*

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 00:39:40 +0300
Subject: [PATCH] Bump Bungeecord Chat API to 1.19-R0.1-SNAPSHOT
diff --git a/build.gradle.kts b/build.gradle.kts
index b5835fa536f90b7f88a5ee4df78733cf43e1cb23..09dba66ae6989a318f44f7bb1f57f529951b2058 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -25,7 +25,7 @@ dependencies {
// api dependencies are listed transitively to API consumers
api("com.google.guava:guava:31.1-jre")
api("com.google.code.gson:gson:2.10")
- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper
+ api("net.md-5:bungeecord-chat:1.19-R0.1-SNAPSHOT") // Paper // DivineMC
api("org.yaml:snakeyaml:1.33")
api("org.joml:joml:1.10.5")
// Paper start

View File

@@ -0,0 +1,84 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 23:38:43 +0300
Subject: [PATCH] Rework Spigot Deprecations
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index 3578ab0c3a413d56bc39af43b5d3201d20d7d13a..29ac48445c3b6d14b1b549d856c350df6712ccac 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -160,9 +160,11 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* UTC.
*
* @return Date of last log-in for this player, or 0
- * @deprecated The API contract is ambiguous and the implementation may or may not return the correct value given this API ambiguity. It is instead recommended use {@link #getLastLogin()} or {@link #getLastSeen()} depending on your needs.
+ * @see #hasPlayedBefore()
+ * @see #getLastLogin()
+ * @see #getLastSeen()
*/
- @Deprecated
+ // @Deprecated // DivineMC - remove deprecated
public long getLastPlayed();
/**
diff --git a/src/main/java/org/bukkit/entity/Damageable.java b/src/main/java/org/bukkit/entity/Damageable.java
index fc4d3bcd9b16097086fef7975274d825b65adb10..e485975dbb6973d2b21259c4e4d5d75191bacb60 100644
--- a/src/main/java/org/bukkit/entity/Damageable.java
+++ b/src/main/java/org/bukkit/entity/Damageable.java
@@ -60,9 +60,9 @@ public interface Damageable extends Entity {
* Gets the maximum health this entity has.
*
* @return Maximum health
- * @deprecated use {@link Attribute#GENERIC_MAX_HEALTH}.
+ * @see Attribute#GENERIC_MAX_HEALTH
*/
- @Deprecated
+ // @Deprecated // DivineMC
double getMaxHealth();
/**
@@ -75,15 +75,15 @@ public interface Damageable extends Entity {
* {@link Wither}, etc...} will have their bar scaled accordingly.
*
* @param health amount of health to set the maximum to
- * @deprecated use {@link Attribute#GENERIC_MAX_HEALTH}.
+ * @see Attribute#GENERIC_MAX_HEALTH
*/
- @Deprecated
+ // @Deprecated // DivineMC
void setMaxHealth(double health);
/**
* Resets the max health to the original amount.
- * @deprecated use {@link Attribute#GENERIC_MAX_HEALTH}.
+ * @see Attribute#GENERIC_MAX_HEALTH
*/
- @Deprecated
+ // @Deprecated // DivineMC
void resetMaxHealth();
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 43cef54d355c8a1b6a8cd6be89a6a805e9f88566..457facce52256c42c3c249ec7f4b3ed4f0269618 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -279,14 +279,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Returns true if the entity is supported by a block.
*
* This value is a state updated by the client after each movement.
- *
- * @return True if entity is on ground.
- * @deprecated This value is controlled only by the client and is therefore
+ * <p>
+ * Note: This value is controlled only by the client and is therefore
* unreliable and vulnerable to spoofing and/or desync depending on the
* context/time which it is accessed
+ *
+ * @return True if entity is on ground.
*/
@Override
- @Deprecated
+ // @Deprecated // DivineMC
public boolean isOnGround();
/**

View File

@@ -0,0 +1,55 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Sat, 11 Dec 2021 12:18:47 -0500
Subject: [PATCH] Paper PR - Add Movement Direction API
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 654dc0c6d98b29cf45d3826aece374726e3e9802..a1dfe9e1509a1b852e991e29c720fdfad596a2f8 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1149,6 +1149,44 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @see Location#setYaw(float)
*/
void setBodyYaw(float bodyYaw);
+
+ /**
+ * This number represents how much the entity is trying to move sideways.
+ * <p>
+ * This number is ranges from -1 to 1,
+ * where positive 1 represents the left and -1 represents the right.
+ * <p>
+ * Note that for {@link Player} entities only update this value when riding an entity, which may cause it
+ * to be inaccurate when dismounted.
+ *
+ * @return direction repesented as -1 to 1
+ */
+ float getSidewaysMotion();
+
+ /**
+ * This number represents how much the entity is trying to move
+ * in the upwards direction.
+ * <p>
+ * This number is ranges from -1 to 1,
+ * where positive 1 represents the up and -1 represents the down.
+ * <p>
+ * Note that for {@link Player} entities this value is never updated.
+ *
+ * @return direction repesented as -1 to 1
+ */
+ float getUpwardsMotion();
+
+ /**
+ * This number represents how much the entity is trying to move forward.
+ * <p>
+ * This number is ranges from -1 to 1,
+ * where positive 1 represents the up and -1 represents the down.
+ * <p>
+ * Note that for {@link Player} entities only update this value when riding an entity, so it may be inaccurate when dismounted.
+ *
+ * @return direction repesented as -1 to 1
+ */
+ float getForwardMotion();
// Paper end
// Purpur start

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Sun, 17 Oct 2021 14:53:28 -0400
Subject: [PATCH] Paper PR - BoneMeal API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index cf8b93aa5787e96f54e2ffe2a0f157b0e53e2c5c..5bbab861056ff3277f2778c3cb2eb9367cdab012 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4157,4 +4157,20 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
}
}
+
+ // Paper start
+ /**
+ * Applies bonemeal at a specific location
+ * <p>
+ * Modifications done in the predicate are respected
+ * and will not be applied if false is returned.
+ *
+ * @param location Location to apply
+ * @param face Blockface to apply as
+ * @param showParticles If particles should be shown on success
+ * @param predicate blockstate predicate
+ * @return true if the bonemeal was applied, false if not
+ */
+ boolean applyBoneMeal(@NotNull Location location, @NotNull org.bukkit.block.BlockFace face, boolean showParticles, @Nullable Predicate<org.bukkit.block.BlockState> predicate);
+ // Paper end
}

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nopjar <code.nopjar@gmail.com>
Date: Mon, 13 Jun 2022 11:29:42 +0200
Subject: [PATCH] Paper PR - Add sendTitleUpdate for inventories
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
index daca40b63e95ea33178bcb54ad45911da591ca54..957e2d091e40ecc283343b7b07b813406d75e852 100644
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
@@ -468,4 +468,16 @@ public abstract class InventoryView {
@Deprecated // Paper
@NotNull
public abstract String getTitle();
+
+ // Paper start
+ /**
+ * Sends a packet to the client to open a new inventory with the new title.
+ * <p>
+ * The ID of the inventory and the contents stay the same. This does not affect the title on the
+ * server. Methods like {@link #title()} will still return the old title.
+ *
+ * @param title the new title
+ */
+ public abstract void sendTitleUpdate(@NotNull net.kyori.adventure.text.Component title);
+ // Paper end
}

View File

@@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 1 Apr 2023 00:31:15 +0300
Subject: [PATCH] Additional pathfinding API
diff --git a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
index 43f062257472a06e9e64c2feef6c3b1012aee00e..d3f12a2edeb5c0c548cfa1a13e93dbd1774b83a3 100644
--- a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
+++ b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
@@ -208,5 +208,14 @@ public interface Pathfinder {
* @return The closest point the path can get to the target location
*/
@Nullable Location getFinalPoint();
+
+ // DivineMC start
+ /**
+ * Checks whether the final point if this path can be reached
+ *
+ * @return whether the final point if this path can be reached
+ */
+ boolean canReachFinalPoint();
+ // DivineMC end
}
}

View File

@@ -0,0 +1,101 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bjarne Koll <lynxplay101@gmail.com>
Date: Thu, 9 Dec 2021 01:53:30 +0100
Subject: [PATCH] Optimize spigot event bus
This patch contains a lot of small optimizations to the spigot event bus
to improve its speed as much as possible, allowing for a large amount of
events to be published by the server without impacting the overall
performance too much.
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..caae79275802bc5e5a5385d6a11903dfa84325d1 100644
--- a/src/main/java/org/bukkit/event/Event.java
+++ b/src/main/java/org/bukkit/event/Event.java
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
*/
public abstract class Event {
private String name;
- private final boolean async;
+ private final net.kyori.adventure.util.TriState async; // KTP - optimize spigot event bus
/**
* The default constructor is defined for cleaner code. This constructor
@@ -32,9 +32,35 @@ public abstract class Event {
* by default from default constructor
*/
public Event(boolean isAsync) {
+ // KTP start - optimize spigot event bus
+ this(net.kyori.adventure.util.TriState.byBoolean(isAsync));
+ }
+
+ /**
+ * This constructor is used to explicitly declare an event as synchronous
+ * or asynchronous or potentially unset.
+ *
+ * @param isAsync true indicates the event will fire asynchronously, false
+ * by default from default constructor, unset indicates that the event may be called on either the server thread or off the server
+ * thread.
+ */
+ public Event(@NotNull final net.kyori.adventure.util.TriState isAsync) {
this.async = isAsync;
}
+ /**
+ * Returns a tristate that, when resolving to true or false, has the exact indications defined by {@link #isAsynchronous()}.
+ * <p>
+ * If the tristate resolves to NOT_SET, the event may or may not have been fired off the main thread, meaning a plugin would have
+ * to validate what thread the spigot event bus was called on.
+ *
+ * @return the tristate enum.
+ */
+ public final @NotNull net.kyori.adventure.util.TriState asynchronous() {
+ return this.async;
+ }
+ // KTP end - optimize spigot event bus
+
// Paper start
/**
* Calls the event and tests if cancelled.
@@ -92,7 +118,7 @@ public abstract class Event {
* @return false by default, true if the event fires asynchronously
*/
public final boolean isAsynchronous() {
- return async;
+ return this.async == net.kyori.adventure.util.TriState.TRUE; // KTP - optimize spigot event bus
}
public enum Result {
diff --git a/src/main/java/org/bukkit/plugin/RegisteredListener.java b/src/main/java/org/bukkit/plugin/RegisteredListener.java
index 3b3d9642a8d63798dc28f2f8df77f0466451cbff..2dad4a19f4ec6f7463d749465189acfb206e58e3 100644
--- a/src/main/java/org/bukkit/plugin/RegisteredListener.java
+++ b/src/main/java/org/bukkit/plugin/RegisteredListener.java
@@ -62,8 +62,10 @@ public class RegisteredListener {
* @throws EventException If an event handler throws an exception.
*/
public void callEvent(@NotNull final Event event) throws EventException {
- if (event instanceof Cancellable) {
- if (((Cancellable) event).isCancelled() && isIgnoringCancelled()) {
+ // KTP start - optimize spigot event bus
+ if (isIgnoringCancelled()) {
+ if (event instanceof Cancellable cancellable && cancellable.isCancelled()) {
+ // KTP end - optimize spigot event bus
return;
}
}
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index fe21d31b463317eb90d58cbca5f098958ca93938..8a38e9c18d44f3593953d910b75c184abc78c880 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -310,4 +310,11 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
}
// Paper end
+
+ // KTP start - expose addURL
+ @Override
+ public void addURL(final URL url) {
+ super.addURL(url);
+ }
+ // KTP end - expose addURL
}

View File

@@ -0,0 +1,671 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 4 Nov 2022 17:00:07 +0300
Subject: [PATCH] Divine Branding
diff --git a/build.gradle.kts b/build.gradle.kts
index 3c8293f002f11b430083502362fdc801f44aa138..506456fd003dda0d544c9800301b1210a5d18457 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,7 +7,7 @@ plugins {
}
dependencies {
- implementation(project(":pufferfish-api")) // Pufferfish // Paper
+ implementation(project(":divinemc-api")) // DivineMC // Pufferfish // Paper
// Pufferfish start
implementation("io.papermc.paper:paper-mojangapi:1.19.2-R0.1-SNAPSHOT") {
exclude("io.papermc.paper", "paper-api")
@@ -82,7 +82,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
- "Implementation-Version" to "git-Pufferfish-$implementationVersion", // Pufferfish
+ "Implementation-Version" to "git-DivineMC-$implementationVersion", // DivineMC // Pufferfish
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 692c962193cf9fcc6801fc93f3220bdc673d527b..2bf46834536d3702fa2ae49ce276a163a5cd1456 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Pufferfish", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish
+ Metrics metrics = new Metrics("DivineMC", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // DivineMC
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..05478a1ea04ec0396bc8c97090edef4a2aced2a9 100644
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
@Override
protected LineReader buildReader(LineReaderBuilder builder) {
builder
- .appName("Paper")
+ .appName("DivineMC") // DivineMC
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/gq/bxteam/divinemc/DivineVersionFetcher.java b/src/main/java/gq/bxteam/divinemc/DivineVersionFetcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..0dc13e363448d7a0f20993e0576af625b5ca334a
--- /dev/null
+++ b/src/main/java/gq/bxteam/divinemc/DivineVersionFetcher.java
@@ -0,0 +1,137 @@
+package gq.bxteam.divinemc;
+
+import com.destroystokyo.paper.VersionHistoryManager;
+import com.destroystokyo.paper.util.VersionFetcher;
+import com.google.gson.Gson;
+import com.google.gson.JsonObject;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.JoinConfiguration;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextDecoration;
+import org.bukkit.craftbukkit.CraftServer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.nio.charset.StandardCharsets;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static net.kyori.adventure.text.Component.text;
+import static net.kyori.adventure.text.format.NamedTextColor.GREEN;
+import static net.kyori.adventure.text.format.NamedTextColor.RED;
+
+public class DivineVersionFetcher implements VersionFetcher {
+ private static final Logger LOGGER = Logger.getLogger("DivineVersionFetcher");
+ private static final HttpClient client = HttpClient.newHttpClient();
+
+ private static final URI JENKINS_URI = URI.create("https://raw.githubusercontent.com/DivineMC/Website/dev/latestBuild");
+ private static final String GITHUB_FORMAT = "https://api.github.com/repos/DivineMC/DivineMC/compare/ver/1.19.3...%s";
+
+ private static final HttpResponse.BodyHandler<JsonObject> JSON_OBJECT_BODY_HANDLER = responseInfo -> HttpResponse.BodySubscribers.mapping(
+ HttpResponse.BodySubscribers.ofString(StandardCharsets.UTF_8),
+ string -> new Gson().fromJson(string, JsonObject.class)
+ );
+
+ @Override
+ public long getCacheTime() {
+ return TimeUnit.MINUTES.toMillis(30);
+ }
+
+ @Override
+ public @NotNull Component getVersionMessage(final @NotNull String serverVersion) {
+ final String[] parts = CraftServer.class.getPackage().getImplementationVersion().split("-");
+ @NotNull Component component;
+
+ if (parts.length != 3) {
+ component = text("Unknown server version.", RED);
+ } else {
+ final String versionString = parts[2];
+
+ try {
+ component = this.fetchJenkinsVersion(Integer.parseInt(versionString));
+ } catch (NumberFormatException e) {
+ component = this.fetchGithubVersion(versionString.substring(1, versionString.length() - 1));
+ }
+ }
+
+ final @Nullable Component history = this.getHistory();
+ return history != null ? Component.join(JoinConfiguration.noSeparators(), component, Component.newline(), this.getHistory()) : component;
+ }
+
+ private @NotNull
+ Component fetchJenkinsVersion(final int versionNumber) {
+ final HttpRequest request = HttpRequest.newBuilder(JENKINS_URI).build();
+ try {
+ final HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+ if (response.statusCode() != 200) {
+ return text("Received invalid status code (" + response.statusCode() + ") from server.", RED);
+ }
+
+ int latestVersionNumber;
+ try {
+ latestVersionNumber = Integer.parseInt(response.body());
+ } catch (NumberFormatException e) {
+ LOGGER.log(Level.WARNING, "Received invalid response from Jenkins \"" + response.body() + "\".");
+ return text("Received invalid response from server.", RED);
+ }
+
+ final int versionDiff = latestVersionNumber - versionNumber;
+ return this.getResponseMessage(versionDiff);
+ } catch (IOException | InterruptedException e) {
+ LOGGER.log(Level.WARNING, "Failed to look up version from Jenkins", e);
+ return text("Failed to retrieve version from server.", RED);
+ }
+ }
+
+ // Based off code contributed by Techcable <Techcable@outlook.com> in Paper/GH-65
+ private @NotNull
+ Component fetchGithubVersion(final @NotNull String hash) {
+ final URI uri = URI.create(String.format(GITHUB_FORMAT, hash));
+ final HttpRequest request = HttpRequest.newBuilder(uri).build();
+ try {
+ final HttpResponse<JsonObject> response = client.send(request, JSON_OBJECT_BODY_HANDLER);
+ if (response.statusCode() != 200) {
+ return text("Received invalid status code (" + response.statusCode() + ") from server.", RED);
+ }
+
+ final JsonObject obj = response.body();
+ final int versionDiff = obj.get("behind_by").getAsInt();
+
+ return this.getResponseMessage(versionDiff);
+ } catch (IOException | InterruptedException e) {
+ LOGGER.log(Level.WARNING, "Failed to look up version from GitHub", e);
+ return text("Failed to retrieve version from server.", RED);
+ }
+ }
+
+ private @NotNull
+ Component getResponseMessage(final int versionDiff) {
+ return switch (Math.max(-1, Math.min(1, versionDiff))) {
+ case -1 -> text("You are running an unsupported version of DivineMC.", RED);
+ case 0 -> text("You are on the latest version!", GREEN);
+ default -> text("You are running " + versionDiff + " version" + (versionDiff == 1 ? "" : "s") + " beyond. " +
+ "Please update your server when possible to maintain stability, security, and receive the latest optimizations.", RED);
+ };
+ }
+
+ private @Nullable
+ Component getHistory() {
+ final VersionHistoryManager.VersionData data = VersionHistoryManager.INSTANCE.getVersionData();
+ if (data == null) {
+ return null;
+ }
+
+ final String oldVersion = data.getOldVersion();
+ if (oldVersion == null) {
+ return null;
+ }
+
+ return text("Previous version: " + oldVersion, NamedTextColor.GRAY, TextDecoration.ITALIC);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6d5e9400892b86562519a893349ca55e566bfb24..9945d6efac1e1ea0d22d6fdfe8aa5d2805c615b2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1683,7 +1683,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
- return "Pufferfish"; // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "DivineMC"; // DivineMC - DivineMC > // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b2d94582037c091bd6a04451bf62b3f9c4923d19..efc137a8a9f1da4a7ffff6028af368cc7f90d20a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -256,7 +256,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
- private final String serverName = "Pufferfish"; // Paper // Pufferfish
+ private final String serverName = "DivineMC"; // Paper // Pufferfish // DivineMC
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 4966a1e3dd35357a8ea6a7d2944c84c9c3e9058e..5b4d42fd74a32e4e97690f0cd9a33c66dc1ae141 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -285,7 +285,7 @@ public class Main {
if (buildDate.before(deadline.getTime())) {
// Paper start - This is some stupid bullshit
System.err.println("*** Warning, you've not updated in a while! ***");
- System.err.println("*** Please download a new build as per instructions from https://papermc.io/downloads ***"); // Paper
+ System.err.println("*** Please download a new build from https://github.com/DivineMC/DivineMC/releases/latest ***"); // DivineMC
//System.err.println("*** Server will start in 20 seconds ***");
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
// Paper End
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index d4f62940504e3ef7a70e13b1f4a7726f23b4c637..bd21dd728b6d47d354aeb879b083394e186d6a5c 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -464,7 +464,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
- return new gg.pufferfish.pufferfish.PufferfishVersionFetcher(); // Pufferfish
+ return new gq.bxteam.divinemc.DivineVersionFetcher(); // DivineMC
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 80553face9c70c2a3d897681e7761df85b22d464..60ac52c6e12ee346133930394e9de8bf74e77ee6 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ public final class Versioning {
public static String getBukkitVersion() {
String result = "Unknown-Version";
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.pufferfish.pufferfish/pufferfish-api/pom.properties"); // Pufferfish
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gq.bxteam.divinemc/divinemc-api/pom.properties"); // DivineMC
Properties properties = new Properties();
if (stream != null) {
diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png
index a7d785f60c884ee4ee487cc364402d66c3dc2ecc..f54753531b3bf2e8b5377f342465e727c7da98f2 100644
GIT binary patch
literal 6677
zcmZ`ecT^MIvk65y(vr|S0wD$n1T=z3m0m+wF=$9cr3j%}P!W;dMd>0)Cy6mZP(Xpu
z`KXEn5Jf2hLO#R>ih{iOJMX-A-XCxG+?_jjX7=vRopyIq-Cd813CjzEKp-&(dmB#>
z2#omK1bMk5u9dOJxq$DSrHds9#LO1i@#p8_sw8_)7Z51s00<P900RBu4#j;0fuapS
zpfv&rgee4pVB~wP9%fvEpSv^GmJ5#<8XD;69=ACTcmtS27%K}a$75Db_D&i~$_6?*
zP$_9`HFae<c}-<yj44JRp>J<zZ;CcWYU}7D^$~CcQb*Us$V5{^^C;%1uC}hZv5Atb
z+yPa!y}iA0#xqIo1mGx7S1-`9<>|A35u(#^8|4ULRXr{u5ar-vE3hmqE3r=>bw!l>
zCLnNFgew+2R&lAAi)cmJ0#RrDqXICbhyX4Cp$t%{gN6nNQN~z96O4fg24$*eV1O|&
z`24~m`2Pr82s;ya_R9Y+a5FP`iYwq7063g=aRI@(eL)aESPJx4yI}4K0?UK`s+8LU
zIf51br|${Y`EMQ`5Qs<mfBCt5e-C?Z`z!MwsN(s<7zC0<JJ?uaFVC#cu3Aws5}-NG
z#qSfoFTDOGUf-K~9^g=jE=q7;L)~b+>-kkkt%z@DqvQS0OciO<6(B~X-Ttj8^Ly;I
zo6TV6_jdf1w>dz}4f>(bF>w9Nl+(tmyuNjboV5a{jFW#sdhZ3z{C6FC!V#*o?@AZ*
z6@#2M7W4S(D=_e$&8q=XmdM!qgOR%?ntYTjPFBys6aK5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=J-yp9z?qe)it6gq-wl@I
z0D-_I{|T<5kwD9uH3yf1GWXp5*8eOgJf*q0IRoK|+r{}Fug&0WpNDKMTC@(Xc)9K8
zy`lByMn!1fnY)1KYP(0Je1)c~WilUuh<&Q8^OE?L9Q^xK*Y@M$`6D6TDCZ^@l8{|}
zxmmNw)mng$hYBii+&ZqedxWT0<Y>dnV#LG4zC%+kzcK+-??vEHT>Q-T8zu<!_QuSc
WX&3$!%>|s_1IbA#OV)^+1pg1OmmZn`

View File

@@ -0,0 +1,249 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 8 Jan 2023 09:57:55 +0300
Subject: [PATCH] Divine Configuration
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 2cc44fbf8e5bd436b6d4e19f6c06b351e750cb31..d432f5e58508da9691861fa0f057a30be562697b 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -242,7 +242,8 @@ public class TimingsExport extends Thread {
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Pufferfish
- pair("pufferfish", mapAsJSON(gg.pufferfish.pufferfish.PufferfishConfig.getConfigCopy(), null)) // Pufferfish
+ pair("pufferfish", mapAsJSON(gg.pufferfish.pufferfish.PufferfishConfig.getConfigCopy(), null)), // Pufferfish // DivineMC
+ pair("divinemc", mapAsJSON(gq.bxteam.divinemc.DivineConfig.getConfigCopy(), null)) // DivineMC
));
new TimingsExport(listeners, parent, history).start();
diff --git a/src/main/java/gq/bxteam/divinemc/DivineCommand.java b/src/main/java/gq/bxteam/divinemc/DivineCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..8bdd69d8712ac160b8dba2750b920f27231b3893
--- /dev/null
+++ b/src/main/java/gq/bxteam/divinemc/DivineCommand.java
@@ -0,0 +1,68 @@
+package gq.bxteam.divinemc;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.md_5.bungee.api.ChatColor;
+import net.minecraft.server.MinecraftServer;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+
+public class DivineCommand extends Command {
+
+ public DivineCommand() {
+ super("divinemc");
+ this.description = "DivineMC related commands";
+ this.usageMessage = "/divinemc [reload | version]";
+ this.setPermission("bukkit.command.divinemc");
+ }
+
+ public static void init() {
+ MinecraftServer.getServer().server.getCommandMap().register("divinemc", "DivineMC", new DivineCommand());
+ }
+
+ @Override
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
+ if (args.length == 1) {
+ return Stream.of("reload", "version")
+ .filter(arg -> arg.startsWith(args[0].toLowerCase()))
+ .collect(Collectors.toList());
+ }
+ return Collections.emptyList();
+ }
+
+ @Override
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
+ if (!testPermission(sender)) return true;
+ String prefix = ChatColor.of("#12fff6") + "" + ChatColor.BOLD + "DivineMC » " + ChatColor.of("#e8f9f9");
+
+ if (args.length != 1) {
+ sender.sendMessage(prefix + "Usage: " + usageMessage);
+ args = new String[]{"version"};
+ }
+
+ if (args[0].equalsIgnoreCase("reload")) {
+ MinecraftServer console = MinecraftServer.getServer();
+ try {
+ DivineConfig.load();
+ } catch (IOException e) {
+ sender.sendMessage(Component.text("Failed to reload.", NamedTextColor.RED));
+ e.printStackTrace();
+ return true;
+ }
+ console.server.reloadCount++;
+
+ Command.broadcastCommandMessage(sender, prefix + "DivineMC configuration has been reloaded.");
+ } else if (args[0].equalsIgnoreCase("version")) {
+ Command.broadcastCommandMessage(sender, prefix + "This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")");
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/gq/bxteam/divinemc/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/DivineConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..541acfc832fe4caa13b5fb46bc455fc6a7294af8
--- /dev/null
+++ b/src/main/java/gq/bxteam/divinemc/DivineConfig.java
@@ -0,0 +1,134 @@
+package gq.bxteam.divinemc;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.List;
+import net.minecraft.server.MinecraftServer;
+import org.apache.logging.log4j.Level;
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.configuration.MemoryConfiguration;
+import org.jetbrains.annotations.Nullable;
+import org.simpleyaml.configuration.comments.CommentType;
+import org.simpleyaml.configuration.file.YamlFile;
+import org.simpleyaml.exceptions.InvalidConfigurationException;
+
+public class DivineConfig {
+
+ private static final YamlFile config = new YamlFile();
+ private static int updates = 0;
+
+ private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) {
+ ConfigurationSection newSection = new MemoryConfiguration();
+ for (String key : section.getKeys(false)) {
+ if (section.isConfigurationSection(key)) {
+ newSection.set(key, convertToBukkit(section.getConfigurationSection(key)));
+ } else {
+ newSection.set(key, section.get(key));
+ }
+ }
+ return newSection;
+ }
+
+ public static ConfigurationSection getConfigCopy() {
+ return convertToBukkit(config);
+ }
+
+ public static int getUpdates() {
+ return updates;
+ }
+
+ public static void load() throws IOException {
+ File configFile = new File("divinemc.yml");
+
+ if (configFile.exists()) {
+ try {
+ config.load(configFile);
+ } catch (InvalidConfigurationException e) {
+ throw new IOException(e);
+ }
+ }
+
+ getString("info.version", "1.0");
+ setComment("info",
+ "DivineMC Configuration",
+ "Join our Discord at https://discord.gg/p7cxhw7E2M",
+ "Download new builds at https://github.com/DivineMC/DivineMC/releases/latest");
+
+ for (Method method : DivineConfig.class.getDeclaredMethods()) {
+ if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers()) && method.getParameterCount() == 0 &&
+ method.getReturnType() == Void.TYPE && !method.getName().startsWith("lambda")) {
+ method.setAccessible(true);
+ try {
+ method.invoke(null);
+ } catch (Throwable t) {
+ MinecraftServer.LOGGER.warn("Failed to load configuration option from " + method.getName(), t);
+ }
+ }
+ }
+
+ updates++;
+
+ config.save(configFile);
+ }
+
+ private static void setComment(String key, String... comment) {
+ if (config.contains(key)) {
+ config.setComment(key, String.join("\n", comment), CommentType.BLOCK);
+ }
+ }
+
+ private static void ensureDefault(String key, Object defaultValue, String... comment) {
+ if (!config.contains(key)) {
+ config.set(key, defaultValue);
+ config.setComment(key, String.join("\n", comment), CommentType.BLOCK);
+ }
+ }
+
+ private static boolean getBoolean(String key, boolean defaultValue, String... comment) {
+ return getBoolean(key, null, defaultValue, comment);
+ }
+
+ private static boolean getBoolean(String key, @Nullable String oldKey, boolean defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getBoolean(key, defaultValue);
+ }
+
+ private static int getInt(String key, int defaultValue, String... comment) {
+ return getInt(key, null, defaultValue, comment);
+ }
+
+ private static int getInt(String key, @Nullable String oldKey, int defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getInt(key, defaultValue);
+ }
+
+ private static double getDouble(String key, double defaultValue, String... comment) {
+ return getDouble(key, null, defaultValue, comment);
+ }
+
+ private static double getDouble(String key, @Nullable String oldKey, double defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getDouble(key, defaultValue);
+ }
+
+ private static String getString(String key, String defaultValue, String... comment) {
+ return getOldString(key, null, defaultValue, comment);
+ }
+
+ private static String getOldString(String key, @Nullable String oldKey, String defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getString(key, defaultValue);
+ }
+
+ private static List<String> getStringList(String key, List<String> defaultValue, String... comment) {
+ return getStringList(key, null, defaultValue, comment);
+ }
+
+ private static List<String> getStringList(String key, @Nullable String oldKey, List<String> defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getStringList(key);
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 673fb3955291407be37dc78be4eec9bf2018128b..f7934ce8a62404d7eaee2d334317d894e7c9ad05 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -223,6 +223,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// Paper end
gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish
gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish
+ gq.bxteam.divinemc.DivineConfig.load(); // DivineMC
+ gq.bxteam.divinemc.DivineCommand.init(); // DivineMC
this.setPvpAllowed(dedicatedserverproperties.pvp);
this.setFlightAllowed(dedicatedserverproperties.allowFlight);

View File

@@ -5,56 +5,56 @@ Subject: [PATCH] Divine Branding
diff --git a/build.gradle.kts b/build.gradle.kts
index 3c8293f002f11b430083502362fdc801f44aa138..506456fd003dda0d544c9800301b1210a5d18457 100644
index 22470f0ab8354a9f31a0f195f3fe80f2f5ee2f0e..be5d1d43fb3924fc1e48d9bb64aafdd237995f83 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,7 +7,7 @@ plugins {
}
dependencies {
- implementation(project(":pufferfish-api")) // Pufferfish // Paper
+ implementation(project(":divinemc-api")) // DivineMC // Pufferfish // Paper
// Pufferfish start
implementation("io.papermc.paper:paper-mojangapi:1.19.2-R0.1-SNAPSHOT") {
exclude("io.papermc.paper", "paper-api")
@@ -82,7 +82,7 @@ tasks.jar {
- implementation(project(":purpur-api")) // Purpur
+ implementation(project(":divinemc-api")) // DivineMC
implementation("io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT") // Purpur
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
@@ -81,7 +81,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
- "Implementation-Version" to "git-Pufferfish-$implementationVersion", // Pufferfish
+ "Implementation-Version" to "git-DivineMC-$implementationVersion", // DivineMC // Pufferfish
- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
+ "Implementation-Version" to "git-DivineMC-$implementationVersion", // Pufferfish // Purpur // DivineMC
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 692c962193cf9fcc6801fc93f3220bdc673d527b..2bf46834536d3702fa2ae49ce276a163a5cd1456 100644
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..ad62e0b7deb141d22be4f19ea30f61440b192af2 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Pufferfish", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish
+ Metrics metrics = new Metrics("DivineMC", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // DivineMC
- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur
+ Metrics metrics = new Metrics("DivineMC", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // DivineMC
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..05478a1ea04ec0396bc8c97090edef4a2aced2a9 100644
index 3cb56595822799926a8141e60a42f5d1edfc6de5..05478a1ea04ec0396bc8c97090edef4a2aced2a9 100644
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
@Override
protected LineReader buildReader(LineReaderBuilder builder) {
builder
- .appName("Paper")
- .appName("Purpur") // Purpur
+ .appName("DivineMC") // DivineMC
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/gq/bxteam/divinemc/DivineVersionFetcher.java b/src/main/java/gq/bxteam/divinemc/DivineVersionFetcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..0dc13e363448d7a0f20993e0576af625b5ca334a
index 0000000000000000000000000000000000000000..953451b808fc134b047dcf7b3b1379bc5aba4399
--- /dev/null
+++ b/src/main/java/gq/bxteam/divinemc/DivineVersionFetcher.java
@@ -0,0 +1,137 @@
@@ -91,7 +91,7 @@ index 0000000000000000000000000000000000000000..0dc13e363448d7a0f20993e0576af625
+ private static final HttpClient client = HttpClient.newHttpClient();
+
+ private static final URI JENKINS_URI = URI.create("https://raw.githubusercontent.com/DivineMC/Website/dev/latestBuild");
+ private static final String GITHUB_FORMAT = "https://api.github.com/repos/DivineMC/DivineMC/compare/ver/1.19.3...%s";
+ private static final String GITHUB_FORMAT = "https://api.github.com/repos/DivineMC/DivineMC/compare/ver/1.19.4...%s";
+
+ private static final HttpResponse.BodyHandler<JsonObject> JSON_OBJECT_BODY_HANDLER = responseInfo -> HttpResponse.BodySubscribers.mapping(
+ HttpResponse.BodySubscribers.ofString(StandardCharsets.UTF_8),
@@ -195,71 +195,80 @@ index 0000000000000000000000000000000000000000..0dc13e363448d7a0f20993e0576af625
+ return text("Previous version: " + oldVersion, NamedTextColor.GRAY, TextDecoration.ITALIC);
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6d5e9400892b86562519a893349ca55e566bfb24..9945d6efac1e1ea0d22d6fdfe8aa5d2805c615b2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1683,7 +1683,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
- return "Pufferfish"; // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "DivineMC"; // DivineMC - DivineMC > // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b2d94582037c091bd6a04451bf62b3f9c4923d19..efc137a8a9f1da4a7ffff6028af368cc7f90d20a 100644
index bc1a2df0a7ddaf030917e4723994464d77e55d02..2caf9913a22dbc895aca060e89c53b8ec21a85d4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -256,7 +256,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
- private final String serverName = "Pufferfish"; // Paper // Pufferfish
+ private final String serverName = "DivineMC"; // Paper // Pufferfish // DivineMC
- private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
+ private final String serverName = "DivineMC"; // Paper // Pufferfish // Purpur // DivineMC
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 4966a1e3dd35357a8ea6a7d2944c84c9c3e9058e..5b4d42fd74a32e4e97690f0cd9a33c66dc1ae141 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -285,7 +285,7 @@ public class Main {
if (buildDate.before(deadline.getTime())) {
// Paper start - This is some stupid bullshit
System.err.println("*** Warning, you've not updated in a while! ***");
- System.err.println("*** Please download a new build as per instructions from https://papermc.io/downloads ***"); // Paper
+ System.err.println("*** Please download a new build from https://github.com/DivineMC/DivineMC/releases/latest ***"); // DivineMC
//System.err.println("*** Server will start in 20 seconds ***");
//Thread.sleep(TimeUnit.SECONDS.toMillis(20));
// Paper End
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index d4f62940504e3ef7a70e13b1f4a7726f23b4c637..bd21dd728b6d47d354aeb879b083394e186d6a5c 100644
index 1dd7f923dd6adb41eafc3ea0c063e3aae6670124..bd21dd728b6d47d354aeb879b083394e186d6a5c 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -464,7 +464,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
- return new gg.pufferfish.pufferfish.PufferfishVersionFetcher(); // Pufferfish
- return new com.destroystokyo.paper.PaperVersionFetcher(); // Purpur
+ return new gq.bxteam.divinemc.DivineVersionFetcher(); // DivineMC
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 80553face9c70c2a3d897681e7761df85b22d464..60ac52c6e12ee346133930394e9de8bf74e77ee6 100644
index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..b79b9f27c5cf09dfcf4cb0bdf7a3aa507db2b0c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ public final class Versioning {
public static String getBukkitVersion() {
String result = "Unknown-Version";
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.pufferfish.pufferfish/pufferfish-api/pom.properties"); // Pufferfish
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gq.bxteam.divinemc/divinemc-api/pom.properties"); // DivineMC
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gq.bxteam.divinemc/divinemc-api/pom.properties"); // Pufferfish // Purpur // DivineMC
Properties properties = new Properties();
if (stream != null) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 0bcbe1f07ff8e552d2abd6e432af5710005acc04..cfcf5334a801b8ba90d3a1f55d3e3ede49c4befc 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -227,7 +227,7 @@ public class PurpurConfig {
deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
}
- public static String serverModName = "Purpur";
+ public static String serverModName = "DivineMC"; // DivineMC
private static void serverModName() {
serverModName = getString("settings.server-mod-name", serverModName);
}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index a810bfd3b8d6bd4d8f2ef8797e4281ae4fe8a67f..9d2e47bcc1aa258a1797a6816c0ac59524cd7af3 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -185,7 +185,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
// Paper end
} else
{
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO DIVINEMC - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // DivineMC
log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump");
}
// Paper end - Different message for short timeout
@@ -206,7 +206,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
WatchdogThread.dumpThread( thread, log );
}
} else {
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO DIVINEMC - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // DivineMC
}
log.log( Level.SEVERE, "------------------------------" );
diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png
index a7d785f60c884ee4ee487cc364402d66c3dc2ecc..f54753531b3bf2e8b5377f342465e727c7da98f2 100644
GIT binary patch

View File

@@ -1,64 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 8 Jan 2023 09:57:55 +0300
Date: Mon, 27 Mar 2023 13:16:41 +0300
Subject: [PATCH] Divine Configuration
This is modified config file by PurpurMC
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 2cc44fbf8e5bd436b6d4e19f6c06b351e750cb31..d432f5e58508da9691861fa0f057a30be562697b 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -242,7 +242,8 @@ public class TimingsExport extends Thread {
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Pufferfish
- pair("pufferfish", mapAsJSON(gg.pufferfish.pufferfish.PufferfishConfig.getConfigCopy(), null)) // Pufferfish
+ pair("pufferfish", mapAsJSON(gg.pufferfish.pufferfish.PufferfishConfig.getConfigCopy(), null)), // Pufferfish // DivineMC
+ pair("divinemc", mapAsJSON(gq.bxteam.divinemc.DivineConfig.getConfigCopy(), null)) // DivineMC
));
new TimingsExport(listeners, parent, history).start();
diff --git a/src/main/java/gq/bxteam/divinemc/DivineCommand.java b/src/main/java/gq/bxteam/divinemc/DivineCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..8bdd69d8712ac160b8dba2750b920f27231b3893
index 0000000000000000000000000000000000000000..6ab4a0ae2a0f63e4dfdb36a561ccda2ad183caab
--- /dev/null
+++ b/src/main/java/gq/bxteam/divinemc/DivineCommand.java
@@ -0,0 +1,68 @@
@@ -0,0 +1,66 @@
+package gq.bxteam.divinemc;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.md_5.bungee.api.ChatColor;
+import net.minecraft.server.MinecraftServer;
+import org.bukkit.Bukkit;
+import net.minecraft.server.level.ServerLevel;
+import gq.bxteam.divinemc.configuration.DivineConfig;
+import org.bukkit.ChatColor;
+import org.bukkit.Location;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+
+public class DivineCommand extends Command {
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+ public DivineCommand() {
+ super("divinemc");
+public class DivineCommand extends Command {
+ public DivineCommand(String name) {
+ super(name);
+ this.description = "DivineMC related commands";
+ this.usageMessage = "/divinemc [reload | version]";
+ this.setPermission("bukkit.command.divinemc");
+ }
+
+ public static void init() {
+ MinecraftServer.getServer().server.getCommandMap().register("divinemc", "DivineMC", new DivineCommand());
+ }
+
+ @Override
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
+ if (args.length == 1) {
+ return Stream.of("reload", "version")
+ .filter(arg -> arg.startsWith(args[0].toLowerCase()))
+ .collect(Collectors.toList());
+ .filter(arg -> arg.startsWith(args[0].toLowerCase()))
+ .collect(Collectors.toList());
+ }
+ return Collections.emptyList();
+ }
@@ -66,184 +48,399 @@ index 0000000000000000000000000000000000000000..8bdd69d8712ac160b8dba2750b920f27
+ @Override
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
+ if (!testPermission(sender)) return true;
+ String prefix = ChatColor.of("#12fff6") + "" + ChatColor.BOLD + "DivineMC » " + ChatColor.of("#e8f9f9");
+
+ if (args.length != 1) {
+ sender.sendMessage(prefix + "Usage: " + usageMessage);
+ args = new String[]{"version"};
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
+ return false;
+ }
+
+ if (args[0].equalsIgnoreCase("reload")) {
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
+
+ MinecraftServer console = MinecraftServer.getServer();
+ try {
+ DivineConfig.load();
+ } catch (IOException e) {
+ sender.sendMessage(Component.text("Failed to reload.", NamedTextColor.RED));
+ e.printStackTrace();
+ return true;
+ DivineConfig.init((File) console.options.valueOf("divinemc-settings"));
+ for (ServerLevel level : console.getAllLevels()) {
+ level.divinemcConfig.init();
+ level.resetBreedingCooldowns();
+ }
+ console.server.reloadCount++;
+
+ Command.broadcastCommandMessage(sender, prefix + "DivineMC configuration has been reloaded.");
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "DivineMC config reload complete.");
+ } else if (args[0].equalsIgnoreCase("version")) {
+ Command.broadcastCommandMessage(sender, prefix + "This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")");
+ Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
+ if (verCmd != null) {
+ return verCmd.execute(sender, commandLabel, new String[0]);
+ }
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/gq/bxteam/divinemc/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/DivineConfig.java
diff --git a/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..541acfc832fe4caa13b5fb46bc455fc6a7294af8
index 0000000000000000000000000000000000000000..0a8baeb94ae553c4759b065eafd9e242153cf991
--- /dev/null
+++ b/src/main/java/gq/bxteam/divinemc/DivineConfig.java
@@ -0,0 +1,134 @@
+package gq.bxteam.divinemc;
+++ b/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
@@ -0,0 +1,155 @@
+package gq.bxteam.divinemc.configuration;
+
+import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableMap;
+import gq.bxteam.divinemc.DivineCommand;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.world.level.block.Blocks;
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.configuration.InvalidConfigurationException;
+import org.bukkit.configuration.file.YamlConfiguration;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.List;
+import net.minecraft.server.MinecraftServer;
+import org.apache.logging.log4j.Level;
+import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.configuration.MemoryConfiguration;
+import org.jetbrains.annotations.Nullable;
+import org.simpleyaml.configuration.comments.CommentType;
+import org.simpleyaml.configuration.file.YamlFile;
+import org.simpleyaml.exceptions.InvalidConfigurationException;
+import java.util.Map;
+import java.util.logging.Level;
+
+@SuppressWarnings("unused")
+public class DivineConfig {
+ private static final String HEADER = "This is the main configuration file for DivineMC.\n"
+ + "If you need help with the configuration or have any questions related to DivineMC,\n"
+ + "join us in our Discord server.\n"
+ + "\n"
+ + "Discord: https://discord.gg/p7cxhw7E2M \n"
+ + "Docs: https://divinemc.bxteam.gq/docs \n"
+ + "New builds: https://github.com/DivineMC/DivineMC/releases/latest";
+ private static File CONFIG_FILE;
+ public static YamlConfiguration config;
+
+ private static final YamlFile config = new YamlFile();
+ private static int updates = 0;
+ private static Map<String, Command> commands;
+
+ private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) {
+ ConfigurationSection newSection = new MemoryConfiguration();
+ for (String key : section.getKeys(false)) {
+ if (section.isConfigurationSection(key)) {
+ newSection.set(key, convertToBukkit(section.getConfigurationSection(key)));
+ } else {
+ newSection.set(key, section.get(key));
+ }
+ public static int version;
+ static boolean verbose;
+
+ public static void init(File configFile) {
+ CONFIG_FILE = configFile;
+ config = new YamlConfiguration();
+ try {
+ config.load(CONFIG_FILE);
+ } catch (IOException ignore) {
+ } catch (InvalidConfigurationException ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Could not load divinemc.yml, please correct your syntax errors", ex);
+ throw Throwables.propagate(ex);
+ }
+ return newSection;
+ config.options().header(HEADER);
+ config.options().copyDefaults(true);
+ verbose = getBoolean("verbose", false);
+
+ commands = new HashMap<>();
+ commands.put("divinemc", new DivineCommand("divinemc"));
+
+ version = getInt("config-version", 2);
+ set("config-version", 2);
+
+ readConfig(DivineConfig.class, null);
+
+ Blocks.rebuildCache();
+ }
+
+ public static ConfigurationSection getConfigCopy() {
+ return convertToBukkit(config);
+ }
+
+ public static int getUpdates() {
+ return updates;
+ }
+
+ public static void load() throws IOException {
+ File configFile = new File("divinemc.yml");
+
+ if (configFile.exists()) {
+ try {
+ config.load(configFile);
+ } catch (InvalidConfigurationException e) {
+ throw new IOException(e);
+ }
+ protected static void log(String s) {
+ if (verbose) {
+ log(Level.INFO, s);
+ }
+ }
+
+ getString("info.version", "1.0");
+ setComment("info",
+ "DivineMC Configuration",
+ "Join our Discord at https://discord.gg/p7cxhw7E2M",
+ "Download new builds at https://github.com/DivineMC/DivineMC/releases/latest");
+ protected static void log(Level level, String s) {
+ Bukkit.getLogger().log(level, s);
+ }
+
+ for (Method method : DivineConfig.class.getDeclaredMethods()) {
+ if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers()) && method.getParameterCount() == 0 &&
+ method.getReturnType() == Void.TYPE && !method.getName().startsWith("lambda")) {
+ method.setAccessible(true);
+ try {
+ method.invoke(null);
+ } catch (Throwable t) {
+ MinecraftServer.LOGGER.warn("Failed to load configuration option from " + method.getName(), t);
+ public static void registerCommands() {
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "DivineMC", entry.getValue());
+ }
+ }
+
+ static void readConfig(Class<?> clazz, Object instance) {
+ for (Method method : clazz.getDeclaredMethods()) {
+ if (Modifier.isPrivate(method.getModifiers())) {
+ if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
+ try {
+ method.setAccessible(true);
+ method.invoke(instance);
+ } catch (InvocationTargetException ex) {
+ throw Throwables.propagate(ex.getCause());
+ } catch (Exception ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
+ }
+ }
+ }
+ }
+
+ updates++;
+
+ config.save(configFile);
+ }
+
+ private static void setComment(String key, String... comment) {
+ if (config.contains(key)) {
+ config.setComment(key, String.join("\n", comment), CommentType.BLOCK);
+ try {
+ config.save(CONFIG_FILE);
+ } catch (IOException ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex);
+ }
+ }
+
+ private static void ensureDefault(String key, Object defaultValue, String... comment) {
+ if (!config.contains(key)) {
+ config.set(key, defaultValue);
+ config.setComment(key, String.join("\n", comment), CommentType.BLOCK);
+ private static void set(String path, Object val) {
+ config.addDefault(path, val);
+ config.set(path, val);
+ }
+
+ private static String getString(String path, String def) {
+ config.addDefault(path, def);
+ return config.getString(path, config.getString(path));
+ }
+
+ private static boolean getBoolean(String path, boolean def) {
+ config.addDefault(path, def);
+ return config.getBoolean(path, config.getBoolean(path));
+ }
+
+ private static double getDouble(String path, double def) {
+ config.addDefault(path, def);
+ return config.getDouble(path, config.getDouble(path));
+ }
+
+ private static int getInt(String path, int def) {
+ config.addDefault(path, def);
+ return config.getInt(path, config.getInt(path));
+ }
+
+ private static <T> List getList(String path, T def) {
+ config.addDefault(path, def);
+ return config.getList(path, config.getList(path));
+ }
+
+ static Map<String, Object> getMap(String path, Map<String, Object> def) {
+ if (def != null && config.getConfigurationSection(path) == null) {
+ config.addDefault(path, def);
+ return def;
+ }
+ return toMap(config.getConfigurationSection(path));
+ }
+
+ private static Map<String, Object> toMap(ConfigurationSection section) {
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
+ if (section != null) {
+ for (String key : section.getKeys(false)) {
+ Object obj = section.get(key);
+ if (obj != null) {
+ builder.put(key, obj instanceof ConfigurationSection val ? toMap(val) : obj);
+ }
+ }
+ }
+ return builder.build();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..5d16d2250bae9c982a0af9ad2580a63532b140f7
--- /dev/null
+++ b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
@@ -0,0 +1,80 @@
+package gq.bxteam.divinemc.configuration;
+
+import org.apache.commons.lang.BooleanUtils;
+import org.bukkit.World;
+import org.bukkit.configuration.ConfigurationSection;
+
+import java.util.List;
+import java.util.Map;
+import java.util.function.Predicate;
+
+import static gq.bxteam.divinemc.configuration.DivineConfig.log;
+
+@SuppressWarnings("unused")
+public class DivineWorldConfig {
+
+ private final String worldName;
+ private final World.Environment environment;
+
+ public DivineWorldConfig(String worldName, World.Environment environment) {
+ this.worldName = worldName;
+ this.environment = environment;
+ init();
+ }
+
+ public void init() {
+ log("-------- World Settings For [" + worldName + "] --------");
+ DivineConfig.readConfig(DivineWorldConfig.class, this);
+ }
+
+ private void set(String path, Object val) {
+ DivineConfig.config.addDefault("world-settings.default." + path, val);
+ DivineConfig.config.set("world-settings.default." + path, val);
+ if (DivineConfig.config.get("world-settings." + worldName + "." + path) != null) {
+ DivineConfig.config.addDefault("world-settings." + worldName + "." + path, val);
+ DivineConfig.config.set("world-settings." + worldName + "." + path, val);
+ }
+ }
+
+ private static boolean getBoolean(String key, boolean defaultValue, String... comment) {
+ return getBoolean(key, null, defaultValue, comment);
+ private ConfigurationSection getConfigurationSection(String path) {
+ ConfigurationSection section = DivineConfig.config.getConfigurationSection("world-settings." + worldName + "." + path);
+ return section != null ? section : DivineConfig.config.getConfigurationSection("world-settings.default." + path);
+ }
+
+ private static boolean getBoolean(String key, @Nullable String oldKey, boolean defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getBoolean(key, defaultValue);
+ private String getString(String path, String def) {
+ DivineConfig.config.addDefault("world-settings.default." + path, def);
+ return DivineConfig.config.getString("world-settings." + worldName + "." + path, DivineConfig.config.getString("world-settings.default." + path));
+ }
+
+ private static int getInt(String key, int defaultValue, String... comment) {
+ return getInt(key, null, defaultValue, comment);
+ private boolean getBoolean(String path, boolean def) {
+ DivineConfig.config.addDefault("world-settings.default." + path, def);
+ return DivineConfig.config.getBoolean("world-settings." + worldName + "." + path, DivineConfig.config.getBoolean("world-settings.default." + path));
+ }
+
+ private static int getInt(String key, @Nullable String oldKey, int defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getInt(key, defaultValue);
+ private boolean getBoolean(String path, Predicate<Boolean> predicate) {
+ String val = getString(path, "default").toLowerCase();
+ Boolean bool = BooleanUtils.toBooleanObject(val, "true", "false", "default");
+ return predicate.test(bool);
+ }
+
+ private static double getDouble(String key, double defaultValue, String... comment) {
+ return getDouble(key, null, defaultValue, comment);
+ private double getDouble(String path, double def) {
+ DivineConfig.config.addDefault("world-settings.default." + path, def);
+ return DivineConfig.config.getDouble("world-settings." + worldName + "." + path, DivineConfig.config.getDouble("world-settings.default." + path));
+ }
+
+ private static double getDouble(String key, @Nullable String oldKey, double defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getDouble(key, defaultValue);
+ private int getInt(String path, int def) {
+ DivineConfig.config.addDefault("world-settings.default." + path, def);
+ return DivineConfig.config.getInt("world-settings." + worldName + "." + path, DivineConfig.config.getInt("world-settings.default." + path));
+ }
+
+ private static String getString(String key, String defaultValue, String... comment) {
+ return getOldString(key, null, defaultValue, comment);
+ private <T> List<?> getList(String path, T def) {
+ DivineConfig.config.addDefault("world-settings.default." + path, def);
+ return DivineConfig.config.getList("world-settings." + worldName + "." + path, DivineConfig.config.getList("world-settings.default." + path));
+ }
+
+ private static String getOldString(String key, @Nullable String oldKey, String defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getString(key, defaultValue);
+ private Map<String, Object> getMap(String path, Map<String, Object> def) {
+ final Map<String, Object> fallback = DivineConfig.getMap("world-settings.default." + path, def);
+ final Map<String, Object> value = DivineConfig.getMap("world-settings." + worldName + "." + path, null);
+ return value.isEmpty() ? fallback : value;
+ }
+
+ private static List<String> getStringList(String key, List<String> defaultValue, String... comment) {
+ return getStringList(key, null, defaultValue, comment);
+ }
+
+ private static List<String> getStringList(String key, @Nullable String oldKey, List<String> defaultValue, String... comment) {
+ ensureDefault(key, defaultValue, comment);
+ return config.getStringList(key);
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 673fb3955291407be37dc78be4eec9bf2018128b..f7934ce8a62404d7eaee2d334317d894e7c9ad05 100644
index 582467e3419c23446b20d3076fbfce22115250a8..6a12c93b730838a06af7ac8801433a394064e2bc 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -223,6 +223,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// Paper end
@@ -233,6 +233,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
gg.pufferfish.pufferfish.PufferfishConfig.pufferfishFile = (java.io.File) options.valueOf("pufferfish-settings"); // Purpur
gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish
gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish
+ gq.bxteam.divinemc.DivineConfig.load(); // DivineMC
+ gq.bxteam.divinemc.DivineCommand.init(); // DivineMC
+ // DivineMC start
+ try {
+ gq.bxteam.divinemc.configuration.DivineConfig.init((java.io.File) options.valueOf("divinemc-settings"));
+ } catch (Exception e) {
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
+ return false;
+ }
+ gq.bxteam.divinemc.configuration.DivineConfig.registerCommands();
+ // DivineMC end
this.setPvpAllowed(dedicatedserverproperties.pvp);
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b8001bca2a33ec1e60566948a651400418a6e9e7..e39b3c7a67de82dd5165f9276f374cd89ecf96c9 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -15,6 +15,8 @@ import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.Supplier;
import javax.annotation.Nullable;
+
+import gq.bxteam.divinemc.configuration.DivineWorldConfig;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.ReportedException;
@@ -178,6 +180,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
+ public final gq.bxteam.divinemc.configuration.DivineWorldConfig divinemcConfig; // DivineMC
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
@@ -333,6 +336,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
+ this.divinemcConfig = new DivineWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // DivineMC
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
this.generator = gen;
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0a7dbd25be18be8b5b2ab495a0c624e018089115..321e7216c479c77edf508c2096d127e95e8d109c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -15,6 +15,7 @@ import com.mojang.brigadier.tree.LiteralCommandNode;
import com.mojang.datafixers.util.Pair;
import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle;
+import gq.bxteam.divinemc.configuration.DivineConfig;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
@@ -971,6 +972,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console);
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
+ gq.bxteam.divinemc.configuration.DivineConfig.init((File) console.options.valueOf("divinemc-settings")); // DivineMC
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -987,6 +989,7 @@ public final class CraftServer implements Server {
}
world.spigotConfig.init(); // Spigot
world.purpurConfig.init(); // Purpur
+ world.divinemcConfig.init(); // DivineMC
}
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -1003,6 +1006,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur
+ gq.bxteam.divinemc.configuration.DivineConfig.registerCommands(); // DivineMC
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2828,6 +2832,13 @@ public final class CraftServer implements Server {
}
// Purpur end
+ // DivineMC start
+ @Override
+ public YamlConfiguration getDivineConfig() {
+ return DivineConfig.config;
+ }
+ // DivineMC end
+
@Override
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index ab05f4151e6ec7404a85ddb3a141ed39d9ed86d7..525c1458043392359c0cc720eebf7638c459119e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -187,6 +187,14 @@ public class Main {
.describedAs("Yml file");
// Purpur end
+ // DivineMC start
+ acceptsAll(asList("divinemc", "divinemc-settings"), "File for divinemc settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("divinemc.yml"))
+ .describedAs("Yml file");
+ // DivineMC end
+
// Paper start
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Mon, 27 Mar 2023 13:16:41 +0300
Subject: [PATCH] Accept EULA
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index c6fa6bcd66d61359124a8426b919493c6ec43f06..a1d2ff316f052adc831408c8bc8667bfe3e63180 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -165,6 +165,20 @@ public class Main {
System.err.println( "If you do not agree to the above EULA please stop your server and remove this flag immediately." );
}
// Spigot End
+
+ // DivineMC start - Accept EULA by default
+ if (!eula.hasAgreedToEULA()) {
+ Main.LOGGER.warn("Automatically accepting Mojang's EULA. Please, stop using this Software immediately if you do not agree with this.");
+ Main.LOGGER.warn("Note: this is a persistent change and will be stored in eula.txt from now on.");
+ try (java.io.OutputStream outputStream = java.nio.file.Files.newOutputStream(path1)) {
+ var properties = new java.util.Properties();
+ properties.setProperty("eula", "true");
+ properties.store(outputStream, null);
+ }
+ eulaAgreed = true;
+ }
+ // DivineMC end
+
if (!eula.hasAgreedToEULA() && !eulaAgreed) { // Spigot
Main.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info.");
return;

View File

@@ -0,0 +1,383 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Mon, 27 Mar 2023 13:16:41 +0300
Subject: [PATCH] Optimize default values for configs
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 47e77541e558e18758ae0fcc2aa4e47261e928b6..00b61ee9ea84e270df52af68e622a1c42dec3c54 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -211,7 +211,7 @@ public class PufferfishConfig {
public static int maxProjectileLoadsPerTick;
public static int maxProjectileLoadsPerProjectile;
private static void projectileLoading() {
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
setComment("projectile", "Optimizes projectile settings");
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 8d442c5a498ecf288a0cc0c54889c6e2fda849ce..fc60346bc7db6fba62dfa38bbc3d7d1280e7a892 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -52,7 +52,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Timings extends ConfigurationPart.Post {
public boolean enabled = true;
public boolean verbose = true;
- public String url = "https://timings.aikar.co/";
+ public String url = "https://timin.gs/"; // DivineMC - optimize default values for configs
public boolean serverNamePrivacy = false;
public List<String> hiddenConfigEntries = List.of(
"database",
@@ -280,9 +280,9 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean fixEntityPositionDesync = true;
public boolean loadPermissionsYmlBeforePlugins = true;
@Constraints.Min(4)
- public int regionFileCacheSize = 256;
+ public int regionFileCacheSize = 512; // DivineMC - optimize default values for configs
@Comment("See https://luckformula.emc.gs")
- public boolean useAlternativeLuckFormula = false;
+ public boolean useAlternativeLuckFormula = true; // DivineMC - optimize default values for configs
public boolean lagCompensateBlockBreaking = true;
public boolean useDimensionTypeForCustomSpawners = false;
public boolean strictAdvancementDimensionCheck = false;
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index ee430563b99e48cd722c2897e4729936457d3017..2453b32ddcbd1cd3615621fda4a92b13c675d454 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -115,9 +115,9 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands;
- public class ArmorStands extends ConfigurationPart {
- public boolean doCollisionEntityLookups = true;
- public boolean tick = true;
+ public class ArmorStands extends ConfigurationPart { // DivineMC - optimize default values for configs
+ public boolean doCollisionEntityLookups = false;
+ public boolean tick = false;
}
public Markers markers;
@@ -207,8 +207,8 @@ public class WorldConfiguration extends ConfigurationPart {
public Behavior behavior;
public class Behavior extends ConfigurationPart {
- public boolean disableChestCatDetection = false;
- public boolean spawnerNerfedMobsShouldJump = false;
+ public boolean disableChestCatDetection = true; // DivineMC - optimize default values for configs
+ public boolean spawnerNerfedMobsShouldJump = true; // DivineMC - optimize default values for configs
public int experienceMergeMaxValue = -1;
public boolean shouldRemoveDragon = false;
public boolean zombiesTargetTurtleEggs = true;
@@ -255,7 +255,7 @@ public class WorldConfiguration extends ConfigurationPart {
public int playerInsomniaStartTicks = 72000;
public int phantomsSpawnAttemptMinSeconds = 60;
public int phantomsSpawnAttemptMaxSeconds = 119;
- public boolean parrotsAreUnaffectedByPlayerMovement = false;
+ public boolean parrotsAreUnaffectedByPlayerMovement = true; // DivineMC - optimize default values for configs
public double zombieVillagerInfectionChance = -1.0;
public MobsCanAlwaysPickUpLoot mobsCanAlwaysPickUpLoot;
@@ -265,7 +265,7 @@ public class WorldConfiguration extends ConfigurationPart {
}
public boolean disablePlayerCrits = false;
- public boolean nerfPigmenFromNetherPortals = false;
+ public boolean nerfPigmenFromNetherPortals = true; // DivineMC - optimize default values for configs
public PillagerPatrols pillagerPatrols;
public class PillagerPatrols extends ConfigurationPart {
@@ -323,7 +323,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Environment extends ConfigurationPart {
public boolean disableThunder = false;
public boolean disableIceAndSnow = false;
- public boolean optimizeExplosions = false;
+ public boolean optimizeExplosions = true; // DivineMC - optimize default values for configs
public boolean disableExplosionKnockback = false;
public boolean generateFlatBedrock = false;
public FrostedIce frostedIce;
@@ -369,7 +369,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Maps extends ConfigurationPart {
public int itemFrameCursorLimit = 128;
- public int itemFrameCursorUpdateInterval = 10;
+ public int itemFrameCursorUpdateInterval = 20; // DivineMC - optimize default values for configs
}
public Fixes fixes;
@@ -395,7 +395,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Hopper extends ConfigurationPart {
public boolean cooldownWhenFull = true;
public boolean disableMoveEvent = false;
- public boolean ignoreOccludingBlocks = false;
+ public boolean ignoreOccludingBlocks = true; // DivineMC - optimize default values for configs
}
public Collisions collisions;
@@ -403,9 +403,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Collisions extends ConfigurationPart {
public boolean onlyPlayersCollide = false;
public boolean allowVehicleCollisions = true;
- public boolean fixClimbingBypassingCrammingRule = false;
+ public boolean fixClimbingBypassingCrammingRule = true; // DivineMC - optimize default values for configs
@RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class)
- public int maxEntityCollisions = 8;
+ public int maxEntityCollisions = 2; // DivineMC - optimize default values for configs
public boolean allowPlayerCrammingDamage = false;
}
@@ -413,18 +413,31 @@ public class WorldConfiguration extends ConfigurationPart {
public class Chunks extends ConfigurationPart {
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
- public int maxAutoSaveChunksPerTick = 24;
+ public int maxAutoSaveChunksPerTick = 12;
public int fixedChunkInhabitedTime = -1;
- public boolean preventMovingIntoUnloadedChunks = false;
- public Duration delayChunkUnloadsBy = Duration.of("10s");
+ public boolean preventMovingIntoUnloadedChunks = true; // DivineMC - optimize default values for configs
+ public Duration delayChunkUnloadsBy = Duration.of("5s"); // DivineMC - optimize default values for configs
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> {
- map.defaultReturnValue(-1);
- map.put(EntityType.EXPERIENCE_ORB, -1);
- map.put(EntityType.SNOWBALL, -1);
- map.put(EntityType.ENDER_PEARL, -1);
- map.put(EntityType.ARROW, -1);
- map.put(EntityType.FIREBALL, -1);
- map.put(EntityType.SMALL_FIREBALL, -1);
+ // DivineMC start - optimize default values for configs
+ map.put(EntityType.EXPERIENCE_ORB, 16);
+ map.put(EntityType.SNOWBALL, 8);
+ map.put(EntityType.ENDER_PEARL, 8);
+ map.put(EntityType.ARROW, 16);
+ map.put(EntityType.FIREBALL, 8);
+ map.put(EntityType.SMALL_FIREBALL, 8);
+ map.put(EntityType.DRAGON_FIREBALL, 3);
+ map.put(EntityType.EGG, 8);
+ map.put(EntityType.EYE_OF_ENDER, 8);
+ map.put(EntityType.FIREWORK_ROCKET, 8);
+ map.put(EntityType.POTION, 8);
+ map.put(EntityType.LLAMA_SPIT, 3);
+ map.put(EntityType.SHULKER_BULLET, 8);
+ map.put(EntityType.SPECTRAL_ARROW, 16);
+ map.put(EntityType.EXPERIENCE_BOTTLE, 3);
+ map.put(EntityType.TRIDENT, 16);
+ map.put(EntityType.WITHER_SKULL, 4);
+ map.put(EntityType.AREA_EFFECT_CLOUD, 8);
+ // DivineMC end
});
}
@@ -438,11 +451,22 @@ public class WorldConfiguration extends ConfigurationPart {
public TickRates tickRates;
public class TickRates extends ConfigurationPart {
- public int grassSpread = 1;
- public int containerUpdate = 1;
- public int mobSpawner = 1;
- public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
- public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1));
+ // DivineMC start - optimize default values for configs
+ public int grassSpread = 4;
+ public int containerUpdate = 3;
+ public int mobSpawner = 2;
+ public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> {
+ table.put(EntityType.VILLAGER, "secondarypoisensor", 80);
+ table.put(EntityType.VILLAGER, "nearestbedsensor", 80);
+ table.put(EntityType.VILLAGER, "villagerbabiessensor", 40);
+ table.put(EntityType.VILLAGER, "playersensor", 40);
+ table.put(EntityType.VILLAGER, "nearestlivingentitysensor", 40);
+ });
+ public Table<EntityType<?>, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> {
+ table.put(EntityType.VILLAGER, "validatenearbypoi", 60);
+ table.put(EntityType.VILLAGER, "acquirepoi", 120);
+ });
+ // DivineMC end
}
@Setting(FeatureSeedsGeneration.FEATURE_SEEDS_KEY)
@@ -450,7 +474,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class FeatureSeeds extends ConfigurationPart.Post {
@Setting(FeatureSeedsGeneration.GENERATE_KEY)
- public boolean generateRandomSeedsForAll = false;
+ public boolean generateRandomSeedsForAll = true; // DivineMC - optimize default values for configs
@Setting(FeatureSeedsGeneration.FEATURES_KEY)
public Reference2LongMap<Holder<ConfiguredFeature<?, ?>>> features = new Reference2LongOpenHashMap<>();
@@ -464,9 +488,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Misc extends ConfigurationPart {
public int lightQueueSize = 20;
- public boolean updatePathfindingOnBlockUpdate = true;
+ public boolean updatePathfindingOnBlockUpdate = false; // DivineMC - optimize default values for configs
public boolean showSignClickCommandFailureMsgsToPlayer = false;
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
+ public RedstoneImplementation redstoneImplementation = RedstoneImplementation.ALTERNATE_CURRENT; // DivineMC - optimize default values for configs
public boolean disableEndCredits = false;
public float maxLeashDistance = 10f;
public boolean disableSprintInterruptionOnAttack = false;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 5503ad6a93d331771a0e92c0da6adedf2ac81aff..69fb6ac082bb7b77051c5824923a7c1ae222dd73 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -146,14 +146,14 @@ public class SpigotWorldConfig
public double itemMerge;
private void itemMerge()
{
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
+ this.itemMerge = this.getDouble("merge-radius.item", 3.5 ); // DivineMC - optimize default values for configs
this.log( "Item Merge Radius: " + this.itemMerge );
}
public double expMerge;
private void expMerge()
{
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
+ this.expMerge = this.getDouble("merge-radius.exp", 4.0 ); // DivineMC - optimize default values for configs
this.log( "Experience Merge Radius: " + this.expMerge );
}
@@ -192,7 +192,7 @@ public class SpigotWorldConfig
public byte mobSpawnRange;
private void mobSpawnRange()
{
- this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 8 ); // Paper - Vanilla
+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 2 ); // Paper - Vanilla // DivineMC - optimize default values for configs
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
}
@@ -203,14 +203,14 @@ public class SpigotWorldConfig
this.log( "Item Despawn Rate: " + this.itemDespawnRate );
}
- public int animalActivationRange = 32;
- public int monsterActivationRange = 32;
+ public int animalActivationRange = 16; // DivineMC - optimize default values for configs
+ public int monsterActivationRange = 24; // DivineMC - optimize default values for configs
public int raiderActivationRange = 48;
- public int miscActivationRange = 16;
+ public int miscActivationRange = 8; // DivineMC - optimize default values for configs
// Paper start
public int flyingMonsterActivationRange = 32;
- public int waterActivationRange = 16;
- public int villagerActivationRange = 32;
+ public int waterActivationRange = 8; // DivineMC - optimize default values for configs
+ public int villagerActivationRange = 16; // DivineMC - optimize default values for configs
public int wakeUpInactiveAnimals = 4;
public int wakeUpInactiveAnimalsEvery = 60*20;
public int wakeUpInactiveAnimalsFor = 5*20;
@@ -227,7 +227,7 @@ public class SpigotWorldConfig
public int villagersWorkImmunityFor = 20;
public boolean villagersActiveForPanic = true;
// Paper end
- public boolean tickInactiveVillagers = true;
+ public boolean tickInactiveVillagers = false; // DivineMC - optimize default values for configs
public boolean ignoreSpectatorActivation = false;
private void activationRange()
{
@@ -293,7 +293,7 @@ public class SpigotWorldConfig
{
this.set( "ticks-per.hopper-check", 1 );
}
- this.hopperCheck = this.getInt( "ticks-per.hopper-check", 1 );
+ this.hopperCheck = this.getInt( "ticks-per.hopper-check", 8 ); // DivineMC - optimize default values for configs
this.hopperAmount = this.getInt( "hopper-amount", 1 );
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
@@ -303,7 +303,7 @@ public class SpigotWorldConfig
public int tridentDespawnRate;
private void arrowDespawnRate()
{
- this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 1200 );
+ this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 300 ); // DivineMC - optimize default values for configs
this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate );
this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate );
}
@@ -318,14 +318,14 @@ public class SpigotWorldConfig
public boolean nerfSpawnerMobs;
private void nerfSpawnerMobs()
{
- this.nerfSpawnerMobs = this.getBoolean( "nerf-spawner-mobs", false );
+ this.nerfSpawnerMobs = this.getBoolean( "nerf-spawner-mobs", true ); // DivineMC - optimize default values for configs
this.log( "Nerfing mobs spawned from spawners: " + this.nerfSpawnerMobs );
}
public boolean enableZombiePigmenPortalSpawns;
private void enableZombiePigmenPortalSpawns()
{
- this.enableZombiePigmenPortalSpawns = this.getBoolean( "enable-zombie-pigmen-portal-spawns", true );
+ this.enableZombiePigmenPortalSpawns = this.getBoolean( "enable-zombie-pigmen-portal-spawns", false ); // DivineMC - optimize default values for configs
this.log( "Allow Zombie Pigmen to spawn from portal blocks: " + this.enableZombiePigmenPortalSpawns );
}
@@ -439,7 +439,7 @@ public class SpigotWorldConfig
public int hangingTickFrequency;
private void hangingTickFrequency()
{
- this.hangingTickFrequency = this.getInt( "hanging-tick-frequency", 100 );
+ this.hangingTickFrequency = this.getInt( "hanging-tick-frequency", 200 ); // DivineMC - optimize default values for configs
}
public int tileMaxTickTime;
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index eef7c125b2689f29cae5464659eacdf33f5695b2..8dbcf5f20dd99dba5d21ec6cd293a7534652c328 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -18,28 +18,28 @@ settings:
update-folder: update
plugin-profiling: false
connection-throttle: 4000
- query-plugins: true
+ query-plugins: false
deprecated-verbose: default
shutdown-message: Server closed
minimum-api: none
use-map-color-cache: true
spawn-limits:
- monsters: 70
- animals: 10
- water-animals: 5
- water-ambient: 20
- water-underground-creature: 5
- axolotls: 5
- ambient: 15
+ monsters: 20
+ animals: 5
+ water-animals: 2
+ water-ambient: 2
+ water-underground-creature: 3
+ axolotls: 3
+ ambient: 1
chunk-gc:
- period-in-ticks: 600
+ period-in-ticks: 400
ticks-per:
animal-spawns: 400
- monster-spawns: 1
- water-spawns: 1
- water-ambient-spawns: 1
- water-underground-creature-spawns: 1
- axolotl-spawns: 1
- ambient-spawns: 1
+ monster-spawns: 10
+ water-spawns: 400
+ water-ambient-spawns: 400
+ water-underground-creature-spawns: 400
+ axolotl-spawns: 400
+ ambient-spawns: 400
autosave: 6000
-aliases: now-in-commands.yml
+aliases: now-in-commands.yml
\ No newline at end of file
diff --git a/src/main/resources/configurations/commands.yml b/src/main/resources/configurations/commands.yml
index 18f54571200e2eca09a39b88f170fe7b99d8618f..1b57d51d92c5c69286800d10baeaa936fa208cae 100644
--- a/src/main/resources/configurations/commands.yml
+++ b/src/main/resources/configurations/commands.yml
@@ -12,5 +12,3 @@
command-block-overrides: []
ignore-vanilla-permissions: false
aliases:
- icanhasbukkit:
- - "version $1-"

View File

@@ -0,0 +1,335 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 00:39:40 +0300
Subject: [PATCH] Add missing purpur config options
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index e95540122ae6a486ce12a5f50fb4d2d073239554..5d8a3abe7293d71097f4bb9c850284156f235e8e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -154,6 +154,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier {
}
// Purpur end
+ // DivineMC start - Add missing purpur config options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level.purpurConfig.allayTakeDamageFromWater;
+ }
+
+ @Override
+ public boolean isAlwaysExperienceDropper() {
+ return level.purpurConfig.allayAlwaysDropExp;
+ }
+
+ @Override
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.allayMaxHealth);
+ }
+ // DivineMC end
+
@Override
protected Brain.Provider<Allay> brainProvider() {
return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES);
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 31922ac1139f34e0da61a719e3645c1aaa188890..7283e8b20ac28cf93622fcffcc884e6e55b84db9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -90,6 +90,23 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
}
// Purpur end
+ // DivineMC start - Add missing purpur config options
+ @Override
+ public boolean dismountsUnderwater() {
+ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.camelRidableInWater;
+ }
+
+ @Override
+ public boolean isSensitiveToWater() {
+ return level.purpurConfig.camelTakeDamageFromWater;
+ }
+
+ @Override
+ public boolean isAlwaysExperienceDropper() {
+ return level.purpurConfig.camelAlwaysDropExp;
+ }
+ // DivineMC end
+
@Override
public void addAdditionalSaveData(CompoundTag nbt) {
super.addAdditionalSaveData(nbt);
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
index c355aaed76663d37a5da8b2f49f9808828b4ef9b..d1412b818ef4963e89060c5476f06cd29c05d10f 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
@@ -145,6 +145,24 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
}
// Purpur end
+ // DivineMC start - Add missing purpur config options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level.purpurConfig.frogTakeDamageFromWater;
+ }
+
+ @Override
+ public boolean isAlwaysExperienceDropper() {
+ return level.purpurConfig.frogAlwaysDropExp;
+ }
+
+ @Override
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.frogMaxHealth);
+ }
+ // DivineMC end
+
+
@Override
protected Brain.Provider<Frog> brainProvider() {
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
index aadc6743deb195ac3368548a75be641ffd3da404..a2c082e0a9a46ffc16e2790b803728920c394e87 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -89,6 +89,23 @@ public class Tadpole extends AbstractFish {
}
// Purpur end
+ // DivineMC start - Add missing purpur config options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level.purpurConfig.tadpoleTakeDamageFromWater;
+ }
+
+ @Override
+ public boolean isAlwaysExperienceDropper() {
+ return level.purpurConfig.tadpoleAlwaysDropExp;
+ }
+
+ @Override
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.tadpoleMaxHealth);
+ }
+ // DivineMC end
+
@Override
protected PathNavigation createNavigation(Level world) {
return new WaterBoundPathNavigation(this, world);
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 6e7c0e95b27c41bf12da1beb3458830ce27c6029..9d19c57cefa6b1ed1a90b8e4bacad55590315b19 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -108,6 +108,18 @@ public class Sniffer extends Animal {
}
// Purpur end
+ // DivineMC start - Add missing purpur config options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level.purpurConfig.snifferTakeDamageFromWater;
+ }
+
+ @Override
+ public boolean isAlwaysExperienceDropper() {
+ return level.purpurConfig.snifferAlwaysDropExp;
+ }
+ // DivineMC end
+
// CraftBukkit start - SPIGOT-7295: moved from constructor to appropriate location
@Override
protected void defineSynchedData() {
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index 69e5b4b6c8d5725bc2fb7cd819219e4ff9df45bd..0a60d514dae5c22e7523eb64a9d7c76ce40c6d9f 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -146,6 +146,23 @@ public class Warden extends Monster implements VibrationListener.VibrationListen
}
// Purpur end
+ // DivineMC start - Add missing purpur config options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level.purpurConfig.wardenTakeDamageFromWater;
+ }
+
+ @Override
+ public boolean isAlwaysExperienceDropper() {
+ return level.purpurConfig.wardenAlwaysDropExp;
+ }
+
+ @Override
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level.purpurConfig.wardenMaxHealth);
+ }
+ // DivineMC end
+
@Override
public Packet<ClientGamePacketListener> getAddEntityPacket() {
return new ClientboundAddEntityPacket(this, this.hasPose(Pose.EMERGING) ? 1 : 0);
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
index 3a720375c3daa961a34363f78c2c51d301c3fa06..cf5203fb60b7cc27da3a7607abe571b77c8b86e4 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
@@ -29,6 +29,7 @@ import org.bukkit.Location;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
+import org.purpurmc.purpur.PurpurConfig;
// CraftBukkit end
public class ChestBoat extends Boat implements HasCustomInventoryScreen, ContainerEntity {
@@ -41,7 +42,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
public ChestBoat(EntityType<? extends Boat> type, Level world) {
super(type, world);
- this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
+ this.itemStacks = NonNullList.withSize(PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // DivineMC start - Add missing purpur config options
}
public ChestBoat(Level world, double d0, double d1, double d2) {
@@ -160,7 +161,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
@Override
public int getContainerSize() {
- return 27;
+ return PurpurConfig.chestBoatRows * 9; // DivineMC start - Add missing purpur config options
}
@Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index cfcf5334a801b8ba90d3a1f55d3e3ede49c4befc..5ae0e57f59b122daef4f30cbc2a63c0b0b5ec884 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -324,6 +324,7 @@ public class PurpurConfig {
}
public static int barrelRows = 3;
+ public static int chestBoatRows = 3; // DivineMC - Add missing purpur config options
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;
public static boolean cryingObsidianValidForPortalFrame = false;
@@ -364,6 +365,7 @@ public class PurpurConfig {
case 1 -> 9;
default -> 27;
});
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // DivineMC - Add missing purpur config options
enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index d3f2002759ac4788feca1e62c90c2e64596eb2f2..19376e57fbefbcc06ef8768918612eed65eaa4a9 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1084,7 +1084,17 @@ public class PurpurWorldConfig {
public boolean allayRidableInWater = true;
public boolean allayControllable = true;
public List<String> allayRespectNBT = new ArrayList<>();
+ // DivineMC start - Add missing purpur config options
+ public double allayMaxHealth = 20.0D;
+ public boolean allayTakeDamageFromWater = false;
+ public boolean allayAlwaysDropExp = false;
+ // DivineMC end
private void allaySettings() {
+ // DivineMC start - Add missing purpur config options
+ allayMaxHealth = getDouble("mobs.allay.max-health", allayMaxHealth);
+ allayTakeDamageFromWater = getBoolean("mobs.allay.take-damage-from-water", allayTakeDamageFromWater);
+ allayAlwaysDropExp = getBoolean("mobs.allay.always-drop-exp", allayAlwaysDropExp);
+ // DivineMC end
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
@@ -1195,7 +1205,18 @@ public class PurpurWorldConfig {
public double camelJumpStrengthMax = 0.42D;
public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D;
+ // DivineMC start - Add missing purpur config options
+ public boolean camelRidableInWater = false;
+ public boolean camelTakeDamageFromWater = false;
+ public boolean camelAlwaysDropExp = false;
+ // DivineMC end
+
private void camelSettings() {
+ // DivineMC start - Add missing purpur config options
+ camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
+ camelTakeDamageFromWater = getBoolean("mobs.camel.takes-damage-from-water", camelTakeDamageFromWater);
+ camelAlwaysDropExp = getBoolean("mobs.camel.always-drop-exp", camelAlwaysDropExp);
+ // DivineMC end
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
camelJumpStrengthMin = getDouble("mobs.camel.attributes.jump_strength.min", camelJumpStrengthMin);
@@ -1622,7 +1643,18 @@ public class PurpurWorldConfig {
public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000;
+ // DivineMC start - Add missing purpur config options
+ public double frogMaxHealth = 10.0D;
+ public boolean frogTakeDamageFromWater = false;
+ public boolean frogAlwaysDropExp = false;
+ // DivineMC end
+
private void frogSettings() {
+ // DivineMC start - Add missing purpur config options
+ frogMaxHealth = getDouble("mobs.frog.attributes.max_health", frogMaxHealth);
+ frogTakeDamageFromWater = getBoolean("mobs.frog.takes-damage-from-water", frogTakeDamageFromWater);
+ frogAlwaysDropExp = getBoolean("mobs.frog.always-drop-exp", frogAlwaysDropExp);
+ // DivineMC end
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
@@ -2573,7 +2605,16 @@ public class PurpurWorldConfig {
public boolean snifferControllable = true;
public double snifferMaxHealth = 14.0D;
public int snifferBreedingTicks = 6000;
+ // DivineMC start - Add missing purpur config options
+ public boolean snifferTakeDamageFromWater = false;
+ public boolean snifferAlwaysDropExp = false;
+ // DivineMC end
+
private void snifferSettings() {
+ // DivineMC start - Add missing purpur config options
+ snifferTakeDamageFromWater = getBoolean("mobs.sniffer.takes-damage-from-water", snifferTakeDamageFromWater);
+ snifferAlwaysDropExp = getBoolean("mobs.sniffer.always-drop-exp", snifferAlwaysDropExp);
+ // DivineMC end
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
@@ -2672,7 +2713,18 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true;
+ // DivineMC start - Add missing purpur config options
+ public double tadpoleMaxHealth = 10.0D;
+ public boolean tadpoleTakeDamageFromWater = false;
+ public boolean tadpoleAlwaysDropExp = false;
+ // DivineMC end
+
private void tadpoleSettings() {
+ // DivineMC start - Add missing purpur config options
+ tadpoleMaxHealth = getDouble("mobs.tadpole.attributes.max_health", tadpoleMaxHealth);
+ tadpoleTakeDamageFromWater = getBoolean("mobs.tadpole.takes-damage-from-water", tadpoleTakeDamageFromWater);
+ tadpoleAlwaysDropExp = getBoolean("mobs.tadpole.always-drop-exp", tadpoleAlwaysDropExp);
+ // DivineMC end
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
@@ -2882,7 +2934,18 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = true;
public boolean wardenControllable = true;
+ // DivineMC start - Add missing purpur config options
+ public double wardenMaxHealth = 500.0D;
+ public boolean wardenTakeDamageFromWater = false;
+ public boolean wardenAlwaysDropExp = false;
+ // DivineMC end
+
private void wardenSettings() {
+ // DivineMC start - Add missing purpur config options
+ wardenMaxHealth = getDouble("mobs.warden.attributes.max_health", wardenMaxHealth);
+ wardenTakeDamageFromWater = getBoolean("mobs.warden.takes-damage-from-water", wardenTakeDamageFromWater);
+ wardenAlwaysDropExp = getBoolean("mobs.warden.always-drop-exp", wardenAlwaysDropExp);
+ // DivineMC end
wardenRidable = getBoolean("mobs.warden.ridable", wardenRidable);
wardenRidableInWater = getBoolean("mobs.warden.ridable-in-water", wardenRidableInWater);
wardenControllable = getBoolean("mobs.warden.controllable", wardenControllable);

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 00:39:40 +0300
Subject: [PATCH] Fix MC-98160 and MC-105103
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
index 33de7cca8063618466fe47417e700a5b15c8dc70..49660b0b9ee24de96006441a46bf6efa95873db3 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -906,7 +906,7 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
if (!this.isPassenger()) {
if (onGround) {
if (this.fallDistance > 3.0F) {
- if (this.status != Boat.Status.ON_LAND) {
+ if (this.status != Boat.Status.ON_LAND && this.status != Status.IN_AIR) { // DivineMC - Fix MC-98160 and MC-105103
this.resetFallDistance();
return;
}

View File

@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 00:39:40 +0300
Subject: [PATCH] Fix MC-93826
diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java
index 2ac88f06ebb79e515cd9934ac1e3e2c8003d9e3c..22aa2dbbd5da1b0e4c76756fe960876ec46019bf 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Animal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java
@@ -70,7 +70,11 @@ public abstract class Animal extends AgeableMob {
double d1 = this.random.nextGaussian() * 0.02D;
double d2 = this.random.nextGaussian() * 0.02D;
- this.level.addParticle(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), d0, d1, d2);
+ // DivineMC start - Fix MC-93826
+ if (this.level instanceof ServerLevel serverLevel) {
+ serverLevel.sendParticles(ParticleTypes.HEART, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 1, d0, d1, d2, 0);
+ }
+ // DivineMC end
}
}

View File

@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 00:39:40 +0300
Subject: [PATCH] Fix entity serialization
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3c10c719f6172161a2dcc6592a0a1492e9b3d7c1..d839a6d7be3fb2a9b14fbad1e3e48d0b88a1c6eb 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2182,15 +2182,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
}
- // Paper start - Entity serialization api
- public boolean serializeEntity(CompoundTag compound) {
- List<Entity> pass = new java.util.ArrayList<>(this.getPassengers());
- this.passengers = ImmutableList.of();
- boolean result = save(compound);
- this.passengers = ImmutableList.copyOf(pass);
- return result;
- }
- // Paper end
public boolean save(CompoundTag nbt) {
return this.isPassenger() ? false : this.saveAsPassenger(nbt);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index bd21dd728b6d47d354aeb879b083394e186d6a5c..a006dea11313f2cbd33d652fcddd171f1dd7355b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -490,8 +490,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
Preconditions.checkNotNull(entity, "null cannot be serialized");
Preconditions.checkArgument(entity instanceof org.bukkit.craftbukkit.entity.CraftEntity, "only CraftEntities can be serialized");
+ net.minecraft.world.entity.Entity nmsEntity = ((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle();
CompoundTag compound = new CompoundTag();
- ((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandle().serializeEntity(compound);
+ compound.putString("id", net.minecraft.world.entity.EntityType.getKey(nmsEntity.getType()).toString());
+ List<net.minecraft.world.entity.Entity> pass = new java.util.ArrayList<>(nmsEntity.getPassengers());
+ nmsEntity.passengers = com.google.common.collect.ImmutableList.of();
+ nmsEntity.saveWithoutId(compound);
+ nmsEntity.passengers = com.google.common.collect.ImmutableList.copyOf(pass);
return serializeNbtToBytes(compound);
}

View File

@@ -0,0 +1,77 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 2 Apr 2023 22:02:28 +0300
Subject: [PATCH] Boat Settings
diff --git a/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
index 5d16d2250bae9c982a0af9ad2580a63532b140f7..9eede8eb7fefc414f3a1207cd3ca2b33deb5ea13 100644
--- a/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
+++ b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
@@ -77,4 +77,11 @@ public class DivineWorldConfig {
final Map<String, Object> value = DivineConfig.getMap("world-settings." + worldName + "." + path, null);
return value.isEmpty() ? fallback : value;
}
+
+ public boolean dontEjectPlayerFromBoatUnderwater = true;
+ public boolean alwaysAllowToEnterTheBoat = true;
+ private void boatFeatures() {
+ dontEjectPlayerFromBoatUnderwater = getBoolean("gameplay-mechanics.boat.dont-eject-players-from-boat-underwater", dontEjectPlayerFromBoatUnderwater);
+ alwaysAllowToEnterTheBoat = getBoolean("gameplay-mechanics.boat.always-allow-to-enter-the-boat", alwaysAllowToEnterTheBoat);
+ }
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
index 49660b0b9ee24de96006441a46bf6efa95873db3..ebd35ca6833aa5cfb913be96ca0c8c13cef45872 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -356,7 +356,18 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
}
if (!this.level.isClientSide && this.outOfControlTicks >= 60.0F) {
- this.ejectPassengers();
+ // DivineMC start - Don't eject players
+ if (this.level.divinemcConfig.dontEjectPlayerFromBoatUnderwater) {
+ for (int i = this.passengers.size() - 1; i >= 0; --i) {
+ Entity passenger = this.passengers.get(i);
+ if (!(passenger instanceof Player)) {
+ passenger.stopRiding();
+ }
+ }
+ } else {
+ this.ejectPassengers();
+ }
+ // DivineMC end
}
if (this.getHurtTime() > 0) {
@@ -897,7 +908,13 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
- return player.isSecondaryUseActive() ? InteractionResult.PASS : (this.outOfControlTicks < 60.0F ? (!this.level.isClientSide ? (player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS) : InteractionResult.SUCCESS) : InteractionResult.PASS);
+ // DivineMC start - always allow to enter the boat
+ if (this.level.divinemcConfig.alwaysAllowToEnterTheBoat) {
+ return player.isSecondaryUseActive() ? InteractionResult.PASS : (true || this.outOfControlTicks < 60.0F ? (!this.level.isClientSide ? (player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS) : InteractionResult.SUCCESS) : InteractionResult.PASS);
+ } else {
+ return player.isSecondaryUseActive() ? InteractionResult.PASS : (this.outOfControlTicks < 60.0F ? (!this.level.isClientSide ? (player.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS) : InteractionResult.SUCCESS) : InteractionResult.PASS);
+ }
+ // DivineMC end
}
@Override
@@ -993,7 +1010,13 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
@Override
protected boolean canAddPassenger(Entity passenger) {
- return this.getPassengers().size() < this.getMaxPassengers() && !this.isEyeInFluid(FluidTags.WATER);
+ // DivineMC start - always allow to enter the boat
+ if (this.level.divinemcConfig.alwaysAllowToEnterTheBoat) {
+ return this.getPassengers().size() < this.getMaxPassengers()/* && !this.isEyeInFluid(FluidTags.WATER)*/;
+ } else {
+ return this.getPassengers().size() < this.getMaxPassengers() && !this.isEyeInFluid(FluidTags.WATER);
+ }
+ // DivineMC end
}
protected int getMaxPassengers() {

View File

@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 22:47:12 +0300
Subject: [PATCH] Use unused ghast sound
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ghast.java b/src/main/java/net/minecraft/world/entity/monster/Ghast.java
index 77dcae6ecd87fade2b529386ba1360836363593a..20f6a52a635dded35e780c8e73604abfe5820068 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Ghast.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Ghast.java
@@ -164,6 +164,7 @@ public class Ghast extends FlyingMob implements Enemy {
@Override
protected SoundEvent getAmbientSound() {
+ if (!level.dimensionType().ultraWarm() && random.nextInt(8) == 0) return SoundEvents.GHAST_SCREAM; // DivineMC
return SoundEvents.GHAST_AMBIENT;
}

View File

@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 22:47:12 +0300
Subject: [PATCH] Don't save Fireworks
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
index fca27f98989bf106060ba08196255fe32f850df5..d76c9090a1cd860cc73735a86beb637e2378df47 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
@@ -357,4 +357,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
public boolean isAttackable() {
return false;
}
+
+ // DivineMC start - Don't save Fireworks
+ @Override
+ public boolean shouldBeSaved() {
+ return false;
+ }
+ // DivineMC end
}

View File

@@ -0,0 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 23:05:12 +0300
Subject: [PATCH] Remove Spigot tick limiter
Original code by Titaniumtown, modified by NONPLAYT
You can find the original code on https://gitlab.com/Titaniumtown/JettPack
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e39b3c7a67de82dd5165f9276f374cd89ecf96c9..4bacba49a3e462e21b25f388293f255406ffb9b5 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -183,8 +183,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final gq.bxteam.divinemc.configuration.DivineWorldConfig divinemcConfig; // DivineMC
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot
- private org.spigotmc.TickLimiter entityLimiter;
- private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
@@ -426,8 +424,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper
- this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
- this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 69fb6ac082bb7b77051c5824923a7c1ae222dd73..30b82d352726072f6ae144e1ab8e9bfb434a4774 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -442,6 +442,7 @@ public class SpigotWorldConfig
this.hangingTickFrequency = this.getInt( "hanging-tick-frequency", 200 ); // DivineMC - optimize default values for configs
}
+ /* DivineMC - remove tick limiter
public int tileMaxTickTime;
public int entityMaxTickTime;
private void maxTickTimes()
@@ -450,6 +451,7 @@ public class SpigotWorldConfig
this.entityMaxTickTime = this.getInt("max-tick-time.entity", 50);
this.log("Tile Max Tick Time: " + this.tileMaxTickTime + "ms Entity max Tick Time: " + this.entityMaxTickTime + "ms");
}
+ */
public int thunderChance;
private void thunderChance()
diff --git a/src/main/java/org/spigotmc/TickLimiter.java b/src/main/java/org/spigotmc/TickLimiter.java
deleted file mode 100644
index 4074538ea6090bf99d8ab04b1e98c2832a0e9a98..0000000000000000000000000000000000000000
--- a/src/main/java/org/spigotmc/TickLimiter.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.spigotmc;
-
-public class TickLimiter {
-
- private final int maxTime;
- private long startTime;
-
- public TickLimiter(int maxtime) {
- this.maxTime = maxtime;
- }
-
- public void initTick() {
- this.startTime = System.currentTimeMillis();
- }
-
- public boolean shouldContinue() {
- long remaining = System.currentTimeMillis() - this.startTime;
- return remaining < this.maxTime;
- }
-}

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Sat, 11 Dec 2021 12:18:42 -0500
Subject: [PATCH] Paper PR - Add Movement Direction API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 7ef5980f7321662aa7034a74c2f6926846425db9..d26fb49a39880d650a82b59925d40b8d09fbc84b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -980,6 +980,24 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
}
+ // Paper start - Movement Direction API
+ @Override
+ public float getSidewaysMotion() {
+ return this.getHandle().xxa;
+ }
+
+ @Override
+ public float getUpwardsMotion() {
+ return this.getHandle().yya;
+ }
+
+ @Override
+ public float getForwardMotion() {
+ return this.getHandle().zza;
+ }
+ // Paper end - Movement Direction API
+
+
public static MobType fromBukkitEntityCategory(EntityCategory entityCategory) {
switch (entityCategory) {
case NONE:

View File

@@ -0,0 +1,87 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Sun, 17 Oct 2021 14:53:35 -0400
Subject: [PATCH] Paper PR - BoneMeal API
diff --git a/src/main/java/net/minecraft/world/item/BoneMealItem.java b/src/main/java/net/minecraft/world/item/BoneMealItem.java
index c26665bc59c18c4da467fb6ae33e51a65ecf1de6..bf65490f0239fc6d9d9c101ebce5845dd278ee48 100644
--- a/src/main/java/net/minecraft/world/item/BoneMealItem.java
+++ b/src/main/java/net/minecraft/world/item/BoneMealItem.java
@@ -37,14 +37,16 @@ public class BoneMealItem extends Item {
return BoneMealItem.applyBonemeal(context);
}
- public static InteractionResult applyBonemeal(UseOnContext itemactioncontext) {
- // CraftBukkit end
+ // Paper start - BoneMeal API
+ public static InteractionResult applyBonemeal(UseOnContext itemactioncontext) { return applyBonemeal(itemactioncontext, true); }
+ public static InteractionResult applyBonemeal(UseOnContext itemactioncontext, boolean showParticles) {
+ // Paper end - BoneMeal API
Level world = itemactioncontext.getLevel();
BlockPos blockposition = itemactioncontext.getClickedPos();
BlockPos blockposition1 = blockposition.relative(itemactioncontext.getClickedFace());
if (BoneMealItem.growCrop(itemactioncontext.getItemInHand(), world, blockposition)) {
- if (!world.isClientSide) {
+ if (showParticles && !world.isClientSide) { // Paper - BoneMeal API
world.levelEvent(1505, blockposition, 0);
}
@@ -54,7 +56,7 @@ public class BoneMealItem extends Item {
boolean flag = iblockdata.isFaceSturdy(world, blockposition, itemactioncontext.getClickedFace());
if (flag && BoneMealItem.growWaterPlant(itemactioncontext.getItemInHand(), world, blockposition1, itemactioncontext.getClickedFace())) {
- if (!world.isClientSide) {
+ if (showParticles && !world.isClientSide) { // Paper - BoneMeal API
world.levelEvent(1505, blockposition1, 0);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index b5415f0c65db728f4a935b87b54fa14b68d31bc4..4d0c69c0d2aa7eb625a949a9e6c6c1a5d7a25057 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2446,5 +2446,43 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return this.adventure$pointers;
}
+
+ @Override
+ public boolean applyBoneMeal(@org.jetbrains.annotations.NotNull Location location, org.bukkit.block.BlockFace face, boolean showParticles, @org.jetbrains.annotations.Nullable Predicate<BlockState> predicate) {
+ BlockPos pos = new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ());
+ net.minecraft.world.item.context.UseOnContext context = new net.minecraft.world.item.context.UseOnContext(this.getHandle(), null, net.minecraft.world.InteractionHand.MAIN_HAND, net.minecraft.world.item.Items.BONE_MEAL.getDefaultInstance(), new net.minecraft.world.phys.BlockHitResult(Vec3.ZERO, CraftBlock.blockFaceToNotch(face), pos, false));
+
+ // Save old capturing state
+ boolean wasCapturingTrees = world.captureTreeGeneration;
+ boolean wasCapturingBlockStates = world.captureBlockStates;
+
+ Map<BlockPos, org.bukkit.craftbukkit.block.CraftBlockState> capturedBlocks = world.capturedBlockStates;
+ Map<BlockPos, net.minecraft.world.level.block.entity.BlockEntity> capturedTileEntities = world.capturedTileEntities;
+
+ // Create new state, capture everything
+ world.capturedBlockStates = new java.util.LinkedHashMap<>();
+ world.capturedTileEntities = new java.util.LinkedHashMap<>();
+
+ world.captureTreeGeneration = true;
+ world.captureBlockStates = true;
+
+ net.minecraft.world.InteractionResult result = net.minecraft.world.item.BoneMealItem.applyBonemeal(context, showParticles);
+
+ // Revert back booleans
+ world.captureTreeGeneration = wasCapturingTrees;
+ world.captureBlockStates = wasCapturingBlockStates;
+
+ for (BlockState blockState : world.capturedBlockStates.values()) {
+ if (predicate != null && predicate.test(blockState)) {
+ blockState.update(true);
+ }
+ }
+
+ // Revertback maps
+ world.capturedBlockStates = capturedBlocks;
+ world.capturedTileEntities = capturedTileEntities;
+
+ return result == net.minecraft.world.InteractionResult.CONSUME;
+ }
// Paper end
}

View File

@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nopjar <code.nopjar@gmail.com>
Date: Mon, 13 Jun 2022 11:29:42 +0200
Subject: [PATCH] Paper PR - Add sendTitleUpdate for inventories
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
index 76e26542448d18750ce33d53d54c2a77c0590554..2ae43194ffb670f9145ffcc137fea29addec4e51 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
@@ -79,6 +79,16 @@ public class CraftContainer extends AbstractContainerMenu {
public String getTitle() {
return inventory instanceof CraftInventoryCustom custom ? custom.getTitle() : inventory.getType().getDefaultTitle(); // Paper
}
+
+ // Paper start
+ @Override
+ public void sendTitleUpdate(@org.jetbrains.annotations.NotNull net.kyori.adventure.text.Component title) {
+ AbstractContainerMenu menu = ((org.bukkit.craftbukkit.entity.CraftHumanEntity) getPlayer()).getHandle().containerMenu;
+ var packet = new net.minecraft.network.protocol.game.ClientboundOpenScreenPacket(menu.containerId, menu.getType(), io.papermc.paper.adventure.PaperAdventure.asVanilla(title));
+ ((net.minecraft.server.level.ServerPlayer) player).connection.send(packet);
+ menu.sendAllDataToRemote();
+ }
+ // Paper end
}, player, id);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
index 7d6b5fdb00a5c1614849735634262a36a4efbd66..68e11a13120d81eff511f2e6c6c08aeef4fd50ae 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java
@@ -83,4 +83,13 @@ public class CraftInventoryView extends InventoryView {
public AbstractContainerMenu getHandle() {
return this.container;
}
+
+ // Paper start
+ @Override
+ public void sendTitleUpdate(@org.jetbrains.annotations.NotNull net.kyori.adventure.text.Component title) {
+ var packet = new net.minecraft.network.protocol.game.ClientboundOpenScreenPacket(this.container.containerId, this.container.getType(), io.papermc.paper.adventure.PaperAdventure.asVanilla(title));
+ ((org.bukkit.craftbukkit.entity.CraftPlayer) getPlayer()).getHandle().connection.send(packet);
+ container.sendAllDataToRemote();
+ }
+ // Paper end
}

View File

@@ -0,0 +1,74 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 1 Apr 2023 00:13:31 +0300
Subject: [PATCH] Paper PR - Fire ServerListPingEvent for secondary motd send
diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java
index 6b0bdc266109cdfb874f08bf74323603921d2260..a355470f6b0e8286a178ad279ad93bcaf931cb51 100644
--- a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java
+++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java
@@ -75,13 +75,24 @@ public final class StandardPaperServerListPingEventImpl extends PaperServerListP
}
public static void processRequest(MinecraftServer server, Connection networkManager) {
+ ServerStatus ping = getEventResponse(server, networkManager);
+
+ if (ping == null) {
+ networkManager.disconnect(null);
+ return;
+ }
+
+ // Send response
+ networkManager.send(new ClientboundStatusResponsePacket(ping));
+ }
+
+ public static ServerStatus getEventResponse(MinecraftServer server, Connection networkManager) {
StandardPaperServerListPingEventImpl event = new StandardPaperServerListPingEventImpl(server, networkManager, server.getStatus());
server.server.getPluginManager().callEvent(event);
// Close connection immediately if event is cancelled
if (event.isCancelled()) {
- networkManager.disconnect(null);
- return;
+ return null;
}
// Setup response
@@ -107,10 +118,6 @@ public final class StandardPaperServerListPingEventImpl extends PaperServerListP
} else {
favicon = Optional.empty();
}
- final ServerStatus ping = new ServerStatus(description, players, Optional.of(version), favicon, server.enforceSecureProfile());
-
- // Send response
- networkManager.send(new ClientboundStatusResponsePacket(ping));
+ return new ServerStatus(description, players, Optional.of(version), favicon, server.enforceSecureProfile());
}
-
-}
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 33d4c1af86382cc3343d5db42283b27f69f52374..9679cce1a836add4aee343087370a2fc4d2d132e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -302,11 +302,13 @@ public abstract class PlayerList {
Component joinMessage = ichatmutablecomponent; // Paper - Adventure
playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
- ServerStatus serverping = this.server.getStatus();
-
- if (serverping != null) {
- player.sendServerStatus(serverping);
- }
+ // Paper start - fire ServerListPingEvent
+ io.papermc.paper.util.MCUtil.scheduleAsyncTask(() -> {
+ if (player.hasDisconnected()) return;
+ net.minecraft.network.protocol.status.ServerStatus status = com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.getEventResponse(this.server, player.connection.connection);
+ if (status != null) player.sendServerStatus(status);
+ });
+ // Paper end
// player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // Paper
this.players.add(player);

View File

@@ -0,0 +1,126 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 1 Apr 2023 00:35:19 +0300
Subject: [PATCH] Additional pathfinding API
diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
index 2d799fec40afe7dade649a294761d272c83157f0..81753d128d71bc6495d84358e861e919f731f4d0 100644
--- a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
@@ -135,6 +135,13 @@ public class PaperPathfinder implements com.destroystokyo.paper.entity.Pathfinde
}
return toLoc(path.nodes.get(path.getNextNodeIndex()));
}
+
+ // DivineMC start
+ @Override
+ public boolean canReachFinalPoint() {
+ return path.canReach();
+ }
+ // DivineMC end
}
private Location toLoc(Node point) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
index 3395bc1d9140ab5496ad998343a963ae12f630d6..43fbc659d1f789510d6aba3ea9b465e3ccde5a70 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
@@ -595,7 +595,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
}
}
- private static class RabbitPanicGoal extends PanicGoal {
+ public static class RabbitPanicGoal extends PanicGoal {
private final Rabbit rabbit;
@@ -611,7 +611,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
}
}
- private static class RabbitAvoidEntityGoal<T extends LivingEntity> extends AvoidEntityGoal<T> {
+ public static class RabbitAvoidEntityGoal<T extends LivingEntity> extends AvoidEntityGoal<T> {
private final Rabbit rabbit;
@@ -626,7 +626,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
}
}
- private static class RaidGardenGoal extends MoveToBlockGoal {
+ public static class RaidGardenGoal extends MoveToBlockGoal {
private final Rabbit rabbit;
private boolean wantsToRaid;
@@ -744,7 +744,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
}
}
- private static class EvilRabbitAttackGoal extends MeleeAttackGoal {
+ public static class EvilRabbitAttackGoal extends MeleeAttackGoal {
public EvilRabbitAttackGoal(Rabbit rabbit) {
super(rabbit, 1.4D, true);
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index 89978fcb14362af2527693f3e6ec57e169080c9f..e1d591a33ee544011effaebd56bf5ade7681c899 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -554,7 +554,7 @@ public class Slime extends Mob implements Enemy {
}
}
- private static class SlimeFloatGoal extends Goal {
+ public static class SlimeFloatGoal extends Goal {
private final Slime slime;
@@ -591,7 +591,7 @@ public class Slime extends Mob implements Enemy {
}
}
- private static class SlimeAttackGoal extends Goal {
+ public static class SlimeAttackGoal extends Goal {
private final Slime slime;
private int growTiredTimer;
@@ -668,7 +668,7 @@ public class Slime extends Mob implements Enemy {
// Paper end
}
- private static class SlimeRandomDirectionGoal extends Goal {
+ public static class SlimeRandomDirectionGoal extends Goal {
private final Slime slime;
private float chosenDegrees;
@@ -707,7 +707,7 @@ public class Slime extends Mob implements Enemy {
}
}
- private static class SlimeKeepOnJumpingGoal extends Goal {
+ public static class SlimeKeepOnJumpingGoal extends Goal {
private final Slime slime;
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
index 8e071a0922164970e033029c12058db9e8da261a..c5464e61d1ae6abb6a44bcdae292e8d763f47bdd 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
@@ -226,7 +226,7 @@ public class Spider extends Monster {
return 0.65F;
}
- private static class SpiderAttackGoal extends MeleeAttackGoal {
+ public static class SpiderAttackGoal extends MeleeAttackGoal {
public SpiderAttackGoal(Spider spider) {
super(spider, 1.0D, true);
@@ -255,7 +255,7 @@ public class Spider extends Monster {
}
}
- private static class SpiderTargetGoal<T extends LivingEntity> extends NearestAttackableTargetGoal<T> {
+ public static class SpiderTargetGoal<T extends LivingEntity> extends NearestAttackableTargetGoal<T> {
public SpiderTargetGoal(Spider spider, Class<T> targetEntityClass) {
super(spider, targetEntityClass, true);

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 17 Jun 2018 22:16:25 -0400
Subject: [PATCH] EMC - Allow negative Amplifier values
diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
index 745e792482f61c571e2efbd4200dd1bdaef6e474..b8451c4b4d4038ffb6eea65a33d645d85101562b 100644
--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
+++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
@@ -369,7 +369,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
optional = Optional.empty();
}
- return new MobEffectInstance(type, j, Math.max(i, 0), bl, bl2, bl3, mobEffectInstance, optional, key); // Purpur - add key
+ return new MobEffectInstance(type, j, i, bl, bl2, bl3, mobEffectInstance, optional, key); // Purpur - add key // EMC - always use Amplifier, don't check > 0
}
@Override

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 1 Apr 2023 00:41:04 +0300
Subject: [PATCH] Fix MC-110386
See https://bugs.mojang.com/browse/MC-110386
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java
index 39ea15c7577af186d93d4ad9a48034d746a86fc8..51724ad62cf218531bb7e08e3055963f79f1f9c6 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java
@@ -114,6 +114,7 @@ public class HurtByTargetGoal extends TargetGoal {
}
protected void alertOther(Mob mob, LivingEntity target) {
+ if (mob == target) return; // DivineMC - Fix MC-110386
mob.setTarget(target, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY, true); // CraftBukkit - reason
}
}

View File

@@ -0,0 +1,49 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 2 Apr 2023 21:27:33 +0300
Subject: [PATCH] Fallback to Dimension if World UUID is unknown
diff --git a/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
index 0a8baeb94ae553c4759b065eafd9e242153cf991..abf8ddccce6ec9d893038d1fafdca617ce0eae4d 100644
--- a/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
+++ b/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
@@ -152,4 +152,9 @@ public class DivineConfig {
}
return builder.build();
}
+
+ public static boolean fallbackToDimensionIfWorldUUIDUnknown = true;
+ private static void fallbackToDimensionIfWorldUUIDUnknown() {
+ fallbackToDimensionIfWorldUUIDUnknown = getBoolean("settings.fallback-to-dimension-if-world-uuid-unknown", fallbackToDimensionIfWorldUUIDUnknown);
+ }
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9679cce1a836add4aee343087370a2fc4d2d132e..10d48bc54da61c3fefac177006daf9c0bc4c4687 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -102,6 +102,7 @@ import net.minecraft.world.scores.PlayerTeam;
import net.minecraft.world.scores.Scoreboard; // Paper
import net.minecraft.world.scores.Team;
import org.slf4j.Logger;
+import gq.bxteam.divinemc.configuration.DivineConfig;
// CraftBukkit start
import java.util.stream.Collectors;
@@ -211,7 +212,14 @@ public abstract class PlayerList {
if (bWorld != null) {
resourcekey = ((CraftWorld) bWorld).getHandle().dimension();
} else {
- resourcekey = Level.OVERWORLD;
+ // DivineMC start - Fallback to Dimension if World UUID is unknown
+ if (DivineConfig.fallbackToDimensionIfWorldUUIDUnknown) {
+ DataResult<ResourceKey<Level>> dataResult = Level.RESOURCE_KEY_CODEC.parse(new Dynamic<>(NbtOps.INSTANCE, nbttagcompound.get("Dimension")));
+ resourcekey = dataResult.result().orElse(Level.OVERWORLD);
+ } else {
+ resourcekey = Level.OVERWORLD;
+ }
+ // DivineMC end
}
} else if (nbttagcompound != null) {
// Vanilla migration support

View File

@@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Mon, 3 Apr 2023 23:52:44 +0300
Subject: [PATCH] Allow any username
diff --git a/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
index abf8ddccce6ec9d893038d1fafdca617ce0eae4d..2744315c62f99b48cb689dd90fdfffac405b1bcc 100644
--- a/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
+++ b/src/main/java/gq/bxteam/divinemc/configuration/DivineConfig.java
@@ -157,4 +157,9 @@ public class DivineConfig {
private static void fallbackToDimensionIfWorldUUIDUnknown() {
fallbackToDimensionIfWorldUUIDUnknown = getBoolean("settings.fallback-to-dimension-if-world-uuid-unknown", fallbackToDimensionIfWorldUUIDUnknown);
}
+
+ public static boolean allowAnyUsername = false;
+ private static void allowAnyUsername() {
+ allowAnyUsername = getBoolean("settings.player.allow-any-username", allowAnyUsername);
+ }
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index f719f8aafe7c75e2ef8fcb05f556a8d6bd94b9a0..66dd73064e515986bebf57c6d293aa74cef88693 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -14,6 +14,8 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Nullable;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
+
+import gq.bxteam.divinemc.configuration.DivineConfig;
import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.core.UUIDUtil;
import net.minecraft.network.Connection;
@@ -239,7 +241,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleHello(ServerboundHelloPacket packet) {
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
- Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]);
+ if (!DivineConfig.allowAnyUsername) Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]); // DivineMC - Allow any username
// Paper start - validate usernames
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) {

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Tue, 4 Apr 2023 00:01:34 +0300
Subject: [PATCH] Fix memory leak
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..064b6340c67b0680763ed70e0d6dd51d16ed5529 100644
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
@@ -67,7 +67,7 @@ public final class Biome {
private final MobSpawnSettings mobSettings;
private final BiomeSpecialEffects specialEffects;
// Pufferfish start - use our cache
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> {
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // DivineMC - fix memory leak
return Util.make(() -> {
/*
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
@@ -125,7 +125,7 @@ public final class Biome {
public float getTemperature(BlockPos blockPos) {
long l = blockPos.asLong();
// Pufferfish start
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // DivineMC - fix memory leak
float f = cache.getValue(l);
if (!Float.isNaN(f)) {
return f;

View File

@@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bjarne Koll <lynxplay101@gmail.com>
Date: Sun, 19 Feb 2023 16:14:28 +0100
Subject: [PATCH] Optimize spigot event bus
This patch contains a lot of small optimizations to the spigot event bus
to improve its speed as much as possible, allowing for a large amount of
events to be published by the server without impacting the overall
performance too much.
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..40226500e36b3b545003ed2c27bc6a096e7f4079 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
@@ -36,11 +36,17 @@ class PaperEventManager {
// SimplePluginManager
public void callEvent(@NotNull Event event) {
- if (event.isAsynchronous() && this.server.isPrimaryThread()) {
- throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
- } else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
- throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
+ // KTP start - Optimise spigot event bus
+ if (event.asynchronous() != net.kyori.adventure.util.TriState.NOT_SET) {
+ final boolean onPrimaryThread = this.server.isPrimaryThread();
+ final boolean isAsync = event.isAsynchronous();
+ if (isAsync && onPrimaryThread) {
+ throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
+ } else if (!isAsync && !onPrimaryThread && !this.server.isStopping()) {
+ throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
+ }
}
+ // KTP stop - Optimise spigot event bus
HandlerList handlers = event.getHandlers();
RegisteredListener[] listeners = handlers.getRegisteredListeners();

View File

@@ -0,0 +1,81 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Tue, 4 Apr 2023 22:30:19 +0300
Subject: [PATCH] Better Impaling
diff --git a/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
index 9eede8eb7fefc414f3a1207cd3ca2b33deb5ea13..ee19959e3401ac1e4cf859114f927d2521e48fd0 100644
--- a/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
+++ b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
@@ -84,4 +84,9 @@ public class DivineWorldConfig {
dontEjectPlayerFromBoatUnderwater = getBoolean("gameplay-mechanics.boat.dont-eject-players-from-boat-underwater", dontEjectPlayerFromBoatUnderwater);
alwaysAllowToEnterTheBoat = getBoolean("gameplay-mechanics.boat.always-allow-to-enter-the-boat", alwaysAllowToEnterTheBoat);
}
+
+ public boolean enableBetterImpaling = true;
+ private void enableBetterImpaling() {
+ enableBetterImpaling = getBoolean("gameplay-mechanics.tools.trident.better-impaling", enableBetterImpaling);
+ }
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 8e2274f7dce34e0997356205cf96e46f8d41cca1..9775895f9d3d254422645449cfca097a89c8692d 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1686,6 +1686,15 @@ public abstract class Mob extends LivingEntity implements Targeting {
if (target instanceof LivingEntity) {
f += EnchantmentHelper.getDamageBonus(this.getMainHandItem(), ((LivingEntity) target).getMobType());
+ // DivineMC start - Better Impaling
+ if (this.level.divinemcConfig.enableBetterImpaling) {
+ if (((LivingEntity) target).getMobType() != net.minecraft.world.entity.MobType.WATER && target.isInWaterRainOrBubble()) {
+ int impalingLevel = EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.IMPALING, getMainHandItem());
+ if (impalingLevel > 0)
+ f += net.minecraft.world.item.enchantment.Enchantments.IMPALING.getDamageBonus(impalingLevel, net.minecraft.world.entity.MobType.WATER);
+ }
+ }
+ // DivineMC end
f1 += (float) EnchantmentHelper.getKnockbackBonus(this);
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index d055cfc257cc7282170ba67c848af3e6c5f2ec1f..71c22dfc5d6b86b812a6b2be1cd7fe2338471734 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1295,6 +1295,15 @@ public abstract class Player extends LivingEntity {
if (target instanceof LivingEntity) {
f1 = EnchantmentHelper.getDamageBonus(this.getMainHandItem(), ((LivingEntity) target).getMobType());
+ // DivineMC start - Better Impaling
+ if (this.level.divinemcConfig.enableBetterImpaling) {
+ if (((LivingEntity) target).getMobType() != MobType.WATER && target.isInWaterRainOrBubble()) {
+ int impalingLevel = EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.IMPALING, getMainHandItem());
+ if (impalingLevel > 0)
+ f += net.minecraft.world.item.enchantment.Enchantments.IMPALING.getDamageBonus(impalingLevel, MobType.WATER);
+ }
+ }
+ // DivineMC end
} else {
f1 = EnchantmentHelper.getDamageBonus(this.getMainHandItem(), MobType.UNDEFINED);
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
index fb10fc5a5aa3b6d6220694041778bfd39ffa1cb8..af3bb7c2dbc6d3558f064c4a8c7b202802210754 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
@@ -134,6 +134,15 @@ public class ThrownTrident extends AbstractArrow {
LivingEntity entityliving = (LivingEntity) entity;
f += EnchantmentHelper.getDamageBonus(this.tridentItem, entityliving.getMobType());
+ // DivineMC start - Better Impaling
+ if (this.level.divinemcConfig.enableBetterImpaling) {
+ if (entityliving.getMobType() != net.minecraft.world.entity.MobType.WATER && entityliving.isInWaterRainOrBubble()) {
+ int impalingLevel = EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.IMPALING, tridentItem);
+ if (impalingLevel > 0)
+ f += net.minecraft.world.item.enchantment.Enchantments.IMPALING.getDamageBonus(impalingLevel, net.minecraft.world.entity.MobType.WATER);
+ }
+ }
+ // DivineMC end
}
Entity entity1 = this.getOwner();

View File

@@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Tue, 4 Apr 2023 22:40:31 +0300
Subject: [PATCH] Despawn shulker bullets on owner death
diff --git a/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
index ee19959e3401ac1e4cf859114f927d2521e48fd0..7328d7daa1e411ce492ffedc4e22162b0a4b2253 100644
--- a/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
+++ b/src/main/java/gq/bxteam/divinemc/configuration/DivineWorldConfig.java
@@ -89,4 +89,9 @@ public class DivineWorldConfig {
private void enableBetterImpaling() {
enableBetterImpaling = getBoolean("gameplay-mechanics.tools.trident.better-impaling", enableBetterImpaling);
}
+
+ public boolean despawnShulkerBulletsOnOwnerDeath = true;
+ private void despawnShulkerBulletsOnOwnerDeath() {
+ despawnShulkerBulletsOnOwnerDeath = getBoolean("gameplay-mechanics.mob.shulker.despawn-bullets-on-player-death", despawnShulkerBulletsOnOwnerDeath);
+ }
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java b/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java
index 113ab29ba7adbb40f61eb0cfbda23ada7ef1305d..0f2bc9f977895c5d75b8dd6f625e49472b2d3ce7 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ShulkerBullet.java
@@ -218,6 +218,17 @@ public class ShulkerBullet extends Projectile {
Vec3 vec3d;
if (!this.level.isClientSide) {
+ // DivineMC start - despawn shulker bullets on owner death
+ if (this.level.divinemcConfig.despawnShulkerBulletsOnOwnerDeath) {
+ if (!isInvulnerable()) {
+ var owner = getOwner();
+ if (owner == null || !owner.isAlive()) {
+ discard();
+ return;
+ }
+ }
+ }
+ // DivineMC end
if (this.finalTarget == null && this.targetId != null) {
this.finalTarget = ((ServerLevel) this.level).getEntity(this.targetId);
if (this.finalTarget == null) {

View File

@@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:13:16 +0300
Subject: [PATCH] Fix MC-31819
The food saturation value is depleted on peaceful, even though the displayed hunger bar never goes down.
Hunger (or any related value, including saturation) should not go down on peaceful.
Original bug on Mojira: https://bugs.mojang.com/browse/MC-31819
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 71c22dfc5d6b86b812a6b2be1cd7fe2338471734..61a69dff027875afae4d54c52a098de05e64d19a 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1951,6 +1951,11 @@ public abstract class Player extends LivingEntity {
}
public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {
+ // DivineMC start - Fix MC-31819
+ if (this.level.getDifficulty() == Difficulty.PEACEFUL) {
+ return;
+ }
+ // DivineMC end
// CraftBukkit end
if (!this.abilities.invulnerable) {
if (!this.level.isClientSide) {

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:22:35 +0300
Subject: [PATCH] lithium: collections.goals
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index 02978315bc2b828cc603ce7478408f3f82c249c2..d8ee71cb3afc0f63669d26c4160f7cd7ed2fd453 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -13,6 +13,7 @@ import java.util.function.Supplier;
import java.util.stream.Stream;
import net.minecraft.util.profiling.ProfilerFiller;
import org.slf4j.Logger;
+import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
public class GoalSelector {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -28,7 +29,7 @@ public class GoalSelector {
}
};
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
- private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
+ private final Set<WrappedGoal> availableGoals = new ObjectLinkedOpenHashSet<>(); // DivineMC - lithium: collections.goals
private final Supplier<ProfilerFiller> profiler;
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:28:01 +0300
Subject: [PATCH] lithium: collections.gamerules
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 6fa00d9239546aa82b9e92e25a33103868084c38..d91f1c58d8176036737ed2ad7914d27c3d684d6c 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -27,6 +27,7 @@ import net.minecraft.network.protocol.game.ClientboundGameEventPacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import org.slf4j.Logger;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
public class GameRules {
@@ -127,7 +128,7 @@ public class GameRules {
}
private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules) {
- this.rules = rules;
+ this.rules = new Object2ObjectOpenHashMap<>(rules); // DivineMC - lithium: collections.gamerules
// Paper start
int arraySize = rules.keySet().stream().mapToInt(key -> key.gameRuleIndex).max().orElse(-1) + 1;

View File

@@ -0,0 +1,37 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:40:11 +0300
Subject: [PATCH] lithium: collections.attributes
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 210a0bee1227e4671909dd553ab22027cfc868fb..083621765f9936df869ec1f90133198cf882e7fa 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -1,8 +1,6 @@
package net.minecraft.world.entity.ai.attributes;
-import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
import com.mojang.logging.LogUtils;
import java.util.Collection;
import java.util.Map;
@@ -17,11 +15,15 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.resources.ResourceLocation;
import org.slf4j.Logger;
+import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
+import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
public class AttributeMap {
private static final Logger LOGGER = LogUtils.getLogger();
- private final Map<Attribute, AttributeInstance> attributes = Maps.newHashMap();
- private final Set<AttributeInstance> dirtyAttributes = Sets.newHashSet();
+ // DivineMC start - lithium: collections.attributes
+ private final Map<Attribute, AttributeInstance> attributes = new Reference2ReferenceOpenHashMap<>(0);
+ private final Set<AttributeInstance> dirtyAttributes = new ReferenceOpenHashSet<>(0);
+ // DivineMC end
private final AttributeSupplier supplier;
private final java.util.function.Function<Attribute, AttributeInstance> createInstance; // Pufferfish
private final net.minecraft.world.entity.LivingEntity entity; // Purpur

View File

@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:40:11 +0300
Subject: [PATCH] lithium: cached_hashcode
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 773162c3456945605fb664114508622f7d2fcec8..cc4a2bafc319fb54e8d1168cba85746c5dfafbc2 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -663,11 +663,18 @@ public class Block extends BlockBehaviour implements ItemLike {
private final BlockState first;
private final BlockState second;
private final Direction direction;
+ private final int hash; // DivineMC - lithium: cached_hashcode
public BlockStatePairKey(BlockState self, BlockState other, Direction facing) {
this.first = self;
this.second = other;
this.direction = facing;
+ // DivineMC start - lithium: cached_hashcode
+ int hash = this.first.hashCode();
+ hash = 31 * hash + this.second.hashCode();
+ hash = 31 * hash + this.direction.hashCode();
+ this.hash = hash;
+ // DivineMC end
}
public boolean equals(Object object) {
@@ -683,11 +690,7 @@ public class Block extends BlockBehaviour implements ItemLike {
}
public int hashCode() {
- int i = this.first.hashCode();
-
- i = 31 * i + this.second.hashCode();
- i = 31 * i + this.direction.hashCode();
- return i;
+ return this.hash; // DivineMC - lithium: cached_hashcode
}
}
}

View File

@@ -0,0 +1,52 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 23:45:11 +0300
Subject: [PATCH] lithium: ai.raid
This patch is based on the following mixin:
"me/jellysquid/mods/lithium/mixin/ai/raid/RaidMixin.java"
By: Angeline <jellysquid3@users.noreply.github.com>
As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
index 879c3bb661e24b9682b654def57c2800f4f8ca92..99f0b75ac2b1a8ac5fe8c525c72235847e6aa27f 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -107,6 +107,7 @@ public class Raid {
private Raid.RaidStatus status;
private int celebrationTicks;
private Optional<BlockPos> waveSpawnPos;
+ private boolean isBarDirty; // DivineMC - lithium: ai.raid
public Raid(int id, ServerLevel world, BlockPos pos) {
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
@@ -271,6 +272,12 @@ public class Raid {
public void tick() {
if (!this.isStopped()) {
+ // DivineMC start - lithium: ai.raid
+ if (this.isBarDirty) {
+ this.updateBossbarInternal();
+ this.isBarDirty = false;
+ }
+ // DivineMC end
if (this.status == Raid.RaidStatus.ONGOING) {
boolean flag = this.active;
@@ -637,9 +644,15 @@ public class Raid {
}
+ // DivineMC start - lithium: ai.raid
public void updateBossbar() {
+ this.isBarDirty = true;
+ }
+
+ private void updateBossbarInternal() {
this.raidEvent.setProgress(Mth.clamp(this.getHealthOfLivingRaiders() / this.totalHealth, 0.0F, 1.0F));
}
+ // DivineMC end
public float getHealthOfLivingRaiders() {
float f = 0.0F;

View File

@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 8 Apr 2023 23:55:01 +0300
Subject: [PATCH] lithium: gen.cached_generator_settings
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
index 0d8fd4eaf912eb4d40bb9f600dd2a8d5c21ab572..cf4db1a610a2bfb8f6ce4ed0d502d180b5b67f3b 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -62,12 +62,17 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
private static final BlockState AIR = Blocks.AIR.defaultBlockState();
public final Holder<NoiseGeneratorSettings> settings;
private final Supplier<Aquifer.FluidPicker> globalFluidPicker;
+ private int cachedSeaLevel; // DivineMC - lithium: gen.cached_generator_settings
public NoiseBasedChunkGenerator(BiomeSource biomeSource, Holder<NoiseGeneratorSettings> settings) {
super(biomeSource);
this.settings = settings;
this.globalFluidPicker = Suppliers.memoize(() -> {
- return NoiseBasedChunkGenerator.createFluidPicker((NoiseGeneratorSettings) settings.value());
+ // DivineMC start - lithium: gen.cached_generator_settings
+ var fluidPicker = NoiseBasedChunkGenerator.createFluidPicker((NoiseGeneratorSettings) settings.value());
+ this.cachedSeaLevel = settings.value().seaLevel();
+ return fluidPicker;
+ // DivineMC end
});
}
@@ -397,7 +402,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
@Override
public int getSeaLevel() {
- return ((NoiseGeneratorSettings) this.settings.value()).seaLevel();
+ return this.cachedSeaLevel; // DivineMC - lithium: gen.cached_generator_settings
}
@Override

Some files were not shown because too many files have changed in this diff Show More