diff --git a/docs/docs/admin/configuration.md b/docs/docs/admin/configuration.md index 3b6f8eb..a1ebd0d 100644 --- a/docs/docs/admin/configuration.md +++ b/docs/docs/admin/configuration.md @@ -73,6 +73,9 @@ recipe, getting the output wool and getting the color from that. - ##### remove-vanilla-username-check - **default**: false - **description**: Removes vanilla username check, allowing to join the server with any characters in username + - ##### disable-moved-wrongly-threshold + - **default**: false + - **description**: Disable moved quickly/wrongly checks warns in console - #### region-format ##### linear - ###### flush-frequency diff --git a/gradle.properties b/gradle.properties index c85bbc5..de96045 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group = space.bxteam.divinemc mcVersion = 1.21 version = 1.21-R0.1-SNAPSHOT -purpurRef = b3709b1f4d64277182029b176e2c74bd7cfe3e23 +purpurRef = 5e70800f8078f30dcddf864dc565ac347653311f org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/server/0001-Divine-Branding.patch b/patches/server/0001-Divine-Branding.patch index 146e652..e34f746 100644 --- a/patches/server/0001-Divine-Branding.patch +++ b/patches/server/0001-Divine-Branding.patch @@ -210,10 +210,10 @@ index 710477ae27ebc5afdf0012ef0867d05efd293c24..972391f88d9a5fbf6e28ddbf853d610b public CrashReport(String message, Throwable cause) { io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(cause); // Paper diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e6a23507b69a128aabf4f811d6099281b24583fd..f516cf66635938a57cbe623112a38efbb4877286 100644 +index 7115c04cacfd373b2d9ce0e34460aa695bb65bcd..f2a099a3ff87789a2138cc1d6b7506d0f68bf628 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1031,7 +1031,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here -@@ -392,8 +390,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -769,8 +767,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl }); // CraftBukkit end this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings - this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); - this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); this.entityLookup = new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl.DefaultEntityLookup(this); // Paper - rewrite chunk system - 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 - } + // Paper start - optimise collisions + this.minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection(this); diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java index 0e6b697c6e8503beeed9412abddad2b512246b37..3ef20300c50bca5c1bc8a521fb1de53511d3a172 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java diff --git a/patches/server/0028-Delete-Timings.patch b/patches/server/0028-Delete-Timings.patch index 06760cd..5b44e9d 100644 --- a/patches/server/0028-Delete-Timings.patch +++ b/patches/server/0028-Delete-Timings.patch @@ -812,11 +812,11 @@ index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..35b00c139864dd7925d46a2d6a317d7e @Override diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -index 0c8fe5b2500480c3a9e9ab3285ad22e0e599d953..f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233 100644 +index 01efbc507b3d58f13f78ee286f93df40cdc3f0cb..1f7f68aad97ee73763c042837f239bdc7167db55 100644 --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java +++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -@@ -31,8 +31,7 @@ public class PacketUtils { - engine.executeIfPossible(() -> { +@@ -51,8 +51,7 @@ public class PacketUtils { + try { // Paper - detailed watchdog information if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players if (listener.shouldHandleMessage(packet)) { - co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings @@ -826,7 +826,7 @@ index 0c8fe5b2500480c3a9e9ab3285ad22e0e599d953..f7197f1347251a37dd0f6d9ffa2f09bc } catch (Exception exception) { if (exception instanceof ReportedException) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f516cf66635938a57cbe623112a38efbb4877286..3e5368dbf43e2cc7e01cfd376e0651f681d5d844 100644 +index f2a099a3ff87789a2138cc1d6b7506d0f68bf628..2deb7dc0e5f8337ead5c850729b15c811942040a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -3,7 +3,6 @@ package net.minecraft.server; @@ -846,7 +846,7 @@ index f516cf66635938a57cbe623112a38efbb4877286..3e5368dbf43e2cc7e01cfd376e0651f6 public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer { // Paper - rewrite chunk system private static MinecraftServer SERVER; // Paper -@@ -1047,7 +1044,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions -@@ -389,7 +388,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -766,7 +765,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {} }); // CraftBukkit end - this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings this.entityLookup = new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl.DefaultEntityLookup(this); // Paper - rewrite chunk system - 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 - } -@@ -1028,9 +1026,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + // Paper start - optimise collisions + this.minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection(this); +@@ -1409,9 +1407,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl } this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075 @@ -1092,10 +1099,10 @@ index 8f55d3d2163b56eeaec7462396acfcd36c279a36..b0577a051b079863e120c2d97ed24cf8 this.spigotConfig.currentPrimedTnt = 0; // Spigot } 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 daad0d67428bb49d7f0b37bec430ceb0d30564cf..df17fcc62049c2527ab31afbb14e582009f486c8 100644 +index 5c96e33326e395cb26c8cc51411fd34b20f3bbbc..7841feef56fc7179e5d6e6541baad5fb3e655ef0 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -106,13 +106,6 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -107,13 +107,6 @@ public class Block extends BlockBehaviour implements ItemLike { this != Blocks.STRUCTURE_BLOCK && this != Blocks.JIGSAW; } diff --git a/patches/server/0039-Suppress-errors-from-dirty-attributes.patch b/patches/server/0039-Suppress-errors-from-dirty-attributes.patch index 2f03581..f2c2014 100644 --- a/patches/server/0039-Suppress-errors-from-dirty-attributes.patch +++ b/patches/server/0039-Suppress-errors-from-dirty-attributes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Suppress errors from dirty attributes diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index b38207981751d96a7e769f7afb352a4540b18440..3117a5ea9ef02c523c9223252078cc40163e6ca4 100644 +index 3d4926e1d882bc41157f8402ae63cd96c4dc9c31..c03469cfa880344f6b06792cbc3a08341a9397e1 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -402,7 +402,10 @@ public class ServerEntity { +@@ -415,7 +415,10 @@ public class ServerEntity { } if (this.entity instanceof LivingEntity) { @@ -20,7 +20,7 @@ index b38207981751d96a7e769f7afb352a4540b18440..3117a5ea9ef02c523c9223252078cc40 if (!set.isEmpty()) { // CraftBukkit start - Send scaled max health -@@ -413,7 +416,7 @@ public class ServerEntity { +@@ -426,7 +429,7 @@ public class ServerEntity { this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set)); } diff --git a/patches/server/0047-Petal-Reduce-work-done-by-game-event-system.patch b/patches/server/0047-Petal-Reduce-work-done-by-game-event-system.patch index b2f03ca..b85918b 100644 --- a/patches/server/0047-Petal-Reduce-work-done-by-game-event-system.patch +++ b/patches/server/0047-Petal-Reduce-work-done-by-game-event-system.patch @@ -34,7 +34,7 @@ index a74732902c0494c67e6acf2fc04581ff9c46b832..42752cf9aa9668f4f813adc177b7ef97 LivingEntity entityliving1 = deadEntity.getLastHurtByMob(); diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 7238f28b7d4b40359a28970a7a53018c242af6e2..109ef6440af8f5611b4570bb647052cb0b19c08e 100644 +index 7411e3d132dddde4599c182384f317679de1f2bf..f8fce0fa89ab383050fc7dd373fa964242df2bcd 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -82,7 +82,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p @@ -66,7 +66,7 @@ index 7238f28b7d4b40359a28970a7a53018c242af6e2..109ef6440af8f5611b4570bb647052cb Heightmap.Types[] aheightmap_type = Heightmap.Types.values(); int j = aheightmap_type.length; -@@ -198,9 +209,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -220,9 +231,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p Level world = this.level; if (world instanceof ServerLevel worldserver) { @@ -93,7 +93,7 @@ index 7238f28b7d4b40359a28970a7a53018c242af6e2..109ef6440af8f5611b4570bb647052cb } else { return super.getListenerRegistry(ySectionCoord); } -@@ -589,7 +614,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -611,7 +636,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p } private void removeGameEventListenerRegistry(int ySectionCoord) { diff --git a/patches/server/0056-Option-to-disable-moved-wrongly-threshold.patch b/patches/server/0056-Option-to-disable-moved-wrongly-threshold.patch new file mode 100644 index 0000000..47815f9 --- /dev/null +++ b/patches/server/0056-Option-to-disable-moved-wrongly-threshold.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> +Date: Sat, 13 Jul 2024 01:44:48 +0300 +Subject: [PATCH] Option to disable moved wrongly threshold + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 5365ce5da2b78be0001e3dba39feb969801603e0..4621945946d1495b8f038c96891722a21067c0c5 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -585,7 +585,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + } + // Paper end - Prevent moving into unloaded chunks + +- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { ++ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // DivineMC - Option to disable moved wrongly threshold + // CraftBukkit end + ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); + this.send(new ClientboundMoveVehiclePacket(entity)); +@@ -620,7 +620,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + d10 = d6 * d6 + d7 * d7 + d8 * d8; + boolean flag2 = false; + +- if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot ++ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // DivineMC - Option to disable moved wrongly threshold + flag2 = true; + ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)}); + } +@@ -1438,7 +1438,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY, + toX, toY, toZ, toYaw, toPitch, true); + if (!event.isAllowed()) { +- if (event.getLogWarning()) ++ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && event.getLogWarning()) // DivineMC - Option to disable moved wrongly threshold + ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8}); + this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot()); + return; +@@ -1507,7 +1507,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + d10 = d6 * d6 + d7 * d7 + d8 * d8; + boolean movedWrongly = false; // Paper - Add fail move event; rename + +- if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot ++ if (!space.bxteam.divinemc.configuration.DivineConfig.disableMovedWronglyThreshold && !this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot // DivineMC - Option to disable moved wrongly threshold + // Paper start - Add fail move event + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY, + toX, toY, toZ, toYaw, toPitch, true); +diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java +index 2580a13c80f6a8f6bb35b4c82014628732660019..9d3d52e4798451ec4f30f735bcdef0ef4dde0cbf 100644 +--- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java ++++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java +@@ -155,9 +155,11 @@ public class DivineConfig { + + public static boolean disableNonEditableSignWarning = true; + public static boolean removeVanillaUsernameCheck = false; ++ public static boolean disableMovedWronglyThreshold = false; + private static void miscSettings() { + disableNonEditableSignWarning = getBoolean("settings.misc.disable-non-editable-sign-warning", disableNonEditableSignWarning); + removeVanillaUsernameCheck = getBoolean("settings.misc.remove-vanilla-username-check", removeVanillaUsernameCheck); ++ disableMovedWronglyThreshold = getBoolean("settings.misc.disable-moved-wrongly-threshold", disableMovedWronglyThreshold); + } + + public static boolean biomeManagerOptimization = true;