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

Updated Upstream (Purpur)

Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@ed1e0ec Updated Upstream (Paper)
This commit is contained in:
NONPLAYT
2024-05-23 15:48:52 +03:00
parent 81554648fd
commit d80347acb9
5 changed files with 95 additions and 6 deletions

View File

@@ -50,9 +50,12 @@ Global settings affect all worlds on the server as well as the core server funct
- **default**: 60 - **default**: 60
- **description**: The time during which inactive threads will remain in the pool until they are completed after downtime, specified in seconds. - **description**: The time during which inactive threads will remain in the pool until they are completed after downtime, specified in seconds.
- #### optimizations - #### optimizations
- ##### recipe-manager-optimization - ##### optimized-dragon-respawn
- **default**: true - **default**: true
- **description**: Enables or disables optimization of recipe manager from the CarpetFixes mod. Optimized by taking out streams & doing extra early checks to quickly remove unrelated recipes - **description**: Enables or disables optimization of better dragon respawn (from Carpet-AMS-Addition mod)
- ##### optimize-noise-generation
- **default**: true
- **description**: Enables or disables optimization of better perlin noise generation
- ##### biome-manager-optimization - ##### biome-manager-optimization
- **default**: true - **default**: true
- **description**: Enables or disables optimization of biomes from the CarpetFixes mod. Makes getBiome() method faster by 25% - 75% - **description**: Enables or disables optimization of biomes from the CarpetFixes mod. Makes getBiome() method faster by 25% - 75%
@@ -60,10 +63,16 @@ Global settings affect all worlds on the server as well as the core server funct
- **default**: true - **default**: true
- **description**: Enables or disables optimization of sheep color choosing from the CarpetFixes mod. The game determines the child sheep's color by getting a wool block from the parents, putting them in a crafting - **description**: Enables or disables optimization of sheep color choosing from the CarpetFixes mod. The game determines the child sheep's color by getting a wool block from the parents, putting them in a crafting
recipe, getting the output wool and getting the color from that. recipe, getting the output wool and getting the color from that.
- ##### recipe-manager-optimization
- **default**: true
- **description**: Enables or disables optimization of recipe manager from the CarpetFixes mod. Optimized by taking out streams & doing extra early checks to quickly remove unrelated recipes
- #### misc - #### misc
- ##### use-secure-seed - ##### use-secure-seed
- **default**: false - **default**: false
- **description**: Enabling this, default 64-bit seed will be changed to a 1024-bit seed, making it almost impossible to crack the seed. - **description**: Enabling this, default 64-bit seed will be changed to a 1024-bit seed, making it almost impossible to crack the seed.
- ##### disable-non-editable-sign-warning
- **default**: true
- **description**: This setting disables warning when player tries to change the non-editable sign
- #### region-format - #### region-format
##### linear ##### linear
- ###### flush-frequency - ###### flush-frequency

View File

@@ -2,7 +2,7 @@ group = space.bxteam.divinemc
mcVersion = 1.20.6 mcVersion = 1.20.6
version = 1.20.6-R0.1-SNAPSHOT version = 1.20.6-R0.1-SNAPSHOT
purpurRef = 248ba175af2e1e472aff4eb6bcaa7ea0f7741dd5 purpurRef = ed1e0ec889ff251ee0b5946d52d21ab5cd96e468
org.gradle.caching = true org.gradle.caching = true
org.gradle.parallel = true org.gradle.parallel = true

View File

@@ -572,7 +572,7 @@ index 82b4bd669c57b18fb0b443bcd94495023cd5a528..4cf13d10f24be20b2f9c8b0338b6af3d
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9d3d7118bae9315b08291e3f5a2052e2100c0037..d91ba94cfda7458531ec5b5046d13351f9f82899 100644 index 318cc15ec0a1a70d32e2637b08c48677d38d14a3..8d22256ad0d7a5f00af600179ef91d9bef704d34 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -265,6 +265,8 @@ import javax.annotation.Nonnull; // Paper @@ -265,6 +265,8 @@ import javax.annotation.Nonnull; // Paper
@@ -594,7 +594,7 @@ index 9d3d7118bae9315b08291e3f5a2052e2100c0037..d91ba94cfda7458531ec5b5046d13351
DedicatedServerProperties.WorldDimensionData properties = new DedicatedServerProperties.WorldDimensionData(GsonHelper.parse((creator.generatorSettings().isEmpty()) ? "{}" : creator.generatorSettings()), creator.type().name().toLowerCase(Locale.ROOT)); DedicatedServerProperties.WorldDimensionData properties = new DedicatedServerProperties.WorldDimensionData(GsonHelper.parse((creator.generatorSettings().isEmpty()) ? "{}" : creator.generatorSettings()), creator.type().name().toLowerCase(Locale.ROOT));
diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
index 1934e6c1282c33f4f8e183a97fc67f2016593eb3..228703c008c1fd549c33af935c9b29e5587961f6 100644 index 1934e6c1282c33f4f8e183a97fc67f2016593eb3..289361efbb049d9672974ac4f97b2b2b45e05ace 100644
--- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java --- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java +++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
@@ -194,4 +194,9 @@ public class DivineConfig { @@ -194,4 +194,9 @@ public class DivineConfig {
@@ -603,7 +603,7 @@ index 1934e6c1282c33f4f8e183a97fc67f2016593eb3..228703c008c1fd549c33af935c9b29e5
} }
+ +
+ public static boolean useSecureSeed = false; + public static boolean useSecureSeed = false;
+ private static void secureSeedFeature() { + private static void miscSettings() {
+ useSecureSeed = getBoolean("settings.misc.use-secure-seed", useSecureSeed); + useSecureSeed = getBoolean("settings.misc.use-secure-seed", useSecureSeed);
+ } + }
} }

View File

@@ -0,0 +1,47 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Thu, 23 May 2024 02:06:30 +0300
Subject: [PATCH] Block Log4Shell exploit
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0c3768bb183451e9dfe94bbc9b203bd79e474b99..1b760cf89327b82284d7528d87f4e3543f4c9154 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2409,6 +2409,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
private void tryHandleChat(String s, Runnable runnable, boolean sync) { // CraftBukkit
+ if (ServerGamePacketListenerImpl.isLog4ShellExploit(s)) return; // DivineMC - Block Log4Shell exploit
if (ServerGamePacketListenerImpl.isChatMessageIllegal(s)) {
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
@@ -2439,6 +2440,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return optional;
}
}
+
+ // DivineMC start - Block Log4Shell exploit
+ public static boolean isLog4ShellExploit(String message) {
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile(".*\\$\\{[^}]*}.*");
+ java.util.regex.Matcher matcher = pattern.matcher(message);
+
+ return matcher.find();
+ }
+ // DivineMC end
public static boolean isChatMessageIllegal(String message) {
for (int i = 0; i < message.length(); ++i) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 241340a6d66f17f2a31fb03ff0dfab121b856368..dc4bde8f94ee7a8b5a2ae8348c5796f1d803bd8e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -749,6 +749,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(msg != null, "msg cannot be null");
if (this.getHandle().connection == null) return;
+
+ if (ServerGamePacketListenerImpl.isLog4ShellExploit(msg)) return; // DivineMC - Block Log4Shell exploit
// Paper start - Improve chat handling
if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) {

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Thu, 23 May 2024 15:39:18 +0300
Subject: [PATCH] Option to disable non editable sign warning
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 8cd812a25b1cc05ea14675658bf9c1503ebebd51..5cdfd35218c424ffb7a900ef66f9b1cfe1ff4293 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -189,7 +189,7 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
this.setAllowedPlayerEditor((UUID) null);
this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3);
} else {
- SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString());
+ if (!space.bxteam.divinemc.configuration.DivineConfig.disableNonEditableSignWarning) SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString()); // DivineMC - Option to disable warning
if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < 32 * 32) // Paper - Dont send far away sign update
((ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit
}
diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
index 08c69524814f8581faa6dcf227f18500d4370e13..e40f472da48a10b2ca2bc0e9b976e15305bd7016 100644
--- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
@@ -200,7 +200,9 @@ public class DivineConfig {
}
public static boolean useSecureSeed = false;
+ public static boolean disableNonEditableSignWarning = true;
private static void miscSettings() {
useSecureSeed = getBoolean("settings.misc.use-secure-seed", useSecureSeed);
+ disableNonEditableSignWarning = getBoolean("settings.misc.disable-non-editable-sign-warning", disableNonEditableSignWarning);
}
}