From d7e1b3a6bbf990e11480a7d20e3a19a7676ea2a5 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Mon, 4 May 2026 00:20:54 +0800 Subject: [PATCH] more patches - stage 8/44 --- ...-to-enable-cross-region-damage-trace.patch | 32 +++++++++---------- ...dd-config-to-enable-function-command.patch | 4 +-- ...-config-to-enable-scoreboard-command.patch | 8 ++--- .../modules/experiment/CommandConfig.java | 20 ++++++------ .../EntityDamageSourceTraceConfig.java | 0 5 files changed, 32 insertions(+), 32 deletions(-) rename 1todos/server/minecraft-patches/features/0002-Add-config-to-enable-cross-region-damage-trace.patch => lophine-server/minecraft-patches/features/0006-Add-config-to-enable-cross-region-damage-trace.patch (79%) rename 1todos/server/minecraft-patches/features/0004-Add-config-to-enable-function-command.patch => lophine-server/minecraft-patches/features/0007-Add-config-to-enable-function-command.patch (87%) rename 1todos/server/minecraft-patches/features/0006-Add-config-to-enable-scoreboard-command.patch => lophine-server/minecraft-patches/features/0008-Add-config-to-enable-scoreboard-command.patch (74%) rename {1todos/server/config-files => lophine-server/src/main/java/fun/bm/lophine/config/modules}/experiment/EntityDamageSourceTraceConfig.java (100%) diff --git a/1todos/server/minecraft-patches/features/0002-Add-config-to-enable-cross-region-damage-trace.patch b/lophine-server/minecraft-patches/features/0006-Add-config-to-enable-cross-region-damage-trace.patch similarity index 79% rename from 1todos/server/minecraft-patches/features/0002-Add-config-to-enable-cross-region-damage-trace.patch rename to lophine-server/minecraft-patches/features/0006-Add-config-to-enable-cross-region-damage-trace.patch index 7582a16..c538b82 100644 --- a/1todos/server/minecraft-patches/features/0002-Add-config-to-enable-cross-region-damage-trace.patch +++ b/lophine-server/minecraft-patches/features/0006-Add-config-to-enable-cross-region-damage-trace.patch @@ -5,26 +5,26 @@ Subject: [PATCH] Add config to enable cross region damage trace diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 607ce65a719e333ce2275346a356032327d00ccf..dcdb01fe5333d407a10f9872d09992c7b438ddeb 100644 +index 23149683dfa72f0f8243c08b0f3925bf572de101..4fe7841720e059f2dfc0984a37b3200804875d22 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -1445,6 +1445,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc - this.awardStat(Stats.ENTITY_KILLED_BY.get(killCredit.getType())); - killCredit.awardKillScore(this, damageSource); - this.createWitherRose(killCredit); +@@ -1464,6 +1464,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc + this.awardStat(Stats.ENTITY_KILLED_BY.get(killer.getType())); + killer.awardKillScore(this, source); + this.createWitherRose(killer); + // Luminol Start - Cross Region Damage trace + } else if (fun.bm.lophine.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) { + final LivingEntity entitylivingnew = this.getKillCreditOrigin(); + if (entitylivingnew != null) { -+ this.damageTransferToAsync(entitylivingnew, cause); ++ this.damageTransferToAsync(entitylivingnew, source); + } -+ // Luminol End - Cross Region Damage trace ++ // Luminol End - Cross Region Damage trace } this.level().broadcastEntityEvent(this, EntityEvent.DEATH); -@@ -1468,6 +1475,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1478,6 +1485,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc + this.connection.markClientUnloadedAfterDeath(); } - // Leaves end - exp fix + // Luminol Start - Cross Region Damage trace + private void damageTransferToAsync(LivingEntity entity, DamageSource cause) { @@ -48,24 +48,24 @@ index 607ce65a719e333ce2275346a356032327d00ccf..dcdb01fe5333d407a10f9872d09992c7 AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0); this.level() diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 7a63f52efca133d9d1a773da2443333009d87113..5bae274f5ee869e540e4330e03af671b6b18313d 100644 +index 5a4ac3406232cecc034f79915642fa2e9f317e1b..6c13c4081b411a6c4d3db01b12d4c4f4c8897960 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -1975,6 +1975,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -1959,6 +1959,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin final LivingEntity killer = this.getKillCredit(); if (killer != null) { - killer.awardKillScore(this, damageSource); + killer.awardKillScore(this, source); + // Luminol Start - Cross Region Damage trace + } else if (fun.bm.lophine.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) { + final LivingEntity killernew = this.getKillCreditOrigin(); + if (killernew != null) { -+ this.damageTransferToAsync(killernew, damageSource); ++ this.damageTransferToAsync(killernew, source); + } + // Luminol End - Cross Region Damage trace } }); // Paper end this.postDeathDropItems(deathEvent); // Paper -@@ -1985,6 +1992,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -1969,6 +1976,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin return deathEvent; // Paper } @@ -81,10 +81,10 @@ index 7a63f52efca133d9d1a773da2443333009d87113..5bae274f5ee869e540e4330e03af671b + } + // Luminol End - Cross Region Damage trace + - protected void dropEquipment(ServerLevel level) { + protected void dropEquipment(final ServerLevel level) { } protected void postDeathDropItems(org.bukkit.event.entity.EntityDeathEvent event) {} // Paper - method for post death logic that cannot be ran before the event is potentially cancelled -@@ -2612,6 +2631,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -2638,6 +2657,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin } } diff --git a/1todos/server/minecraft-patches/features/0004-Add-config-to-enable-function-command.patch b/lophine-server/minecraft-patches/features/0007-Add-config-to-enable-function-command.patch similarity index 87% rename from 1todos/server/minecraft-patches/features/0004-Add-config-to-enable-function-command.patch rename to lophine-server/minecraft-patches/features/0007-Add-config-to-enable-function-command.patch index b9a1806..af232f8 100644 --- a/1todos/server/minecraft-patches/features/0004-Add-config-to-enable-function-command.patch +++ b/lophine-server/minecraft-patches/features/0007-Add-config-to-enable-function-command.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add config to enable function command diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java -index 4fa276ba05a550cdf7ce48617056c5a4d4a18006..6cb0d4daf0f275b95d5ca09275e40ab32258eb39 100644 +index 4503e62a72e67d35db5b091c91e903058157bdbd..86866a9fa92d2e1ac0026e5764f459cc73e0b266 100644 --- a/net/minecraft/commands/Commands.java +++ b/net/minecraft/commands/Commands.java -@@ -215,7 +215,9 @@ public class Commands { +@@ -217,7 +217,9 @@ public class Commands { FillCommand.register(this.dispatcher, context); FillBiomeCommand.register(this.dispatcher, context); ForceLoadCommand.register(this.dispatcher); diff --git a/1todos/server/minecraft-patches/features/0006-Add-config-to-enable-scoreboard-command.patch b/lophine-server/minecraft-patches/features/0008-Add-config-to-enable-scoreboard-command.patch similarity index 74% rename from 1todos/server/minecraft-patches/features/0006-Add-config-to-enable-scoreboard-command.patch rename to lophine-server/minecraft-patches/features/0008-Add-config-to-enable-scoreboard-command.patch index 7ea5d88..d4ebcc4 100644 --- a/1todos/server/minecraft-patches/features/0006-Add-config-to-enable-scoreboard-command.patch +++ b/lophine-server/minecraft-patches/features/0008-Add-config-to-enable-scoreboard-command.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add config to enable scoreboard command diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java -index 48628174299f8f18170198df1834d6174bd1fafa..91e2f3e9e85622adbd3799473634e716383bbe94 100644 +index 86866a9fa92d2e1ac0026e5764f459cc73e0b266..f54f6047f326189329e11338b17105f5555dde12 100644 --- a/net/minecraft/commands/Commands.java +++ b/net/minecraft/commands/Commands.java -@@ -241,7 +241,11 @@ public class Commands { +@@ -244,7 +244,11 @@ public class Commands { RotateCommand.register(this.dispatcher); SayCommand.register(this.dispatcher); //ScheduleCommand.register(this.dispatcher); // Folia - region threading @@ -18,6 +18,6 @@ index 48628174299f8f18170198df1834d6174bd1fafa..91e2f3e9e85622adbd3799473634e716 + ScoreboardCommand.register(this.dispatcher, context); // Folia - region threading + } + // Lophine start - Add a config to enable scoreboard command - SeedCommand.register(this.dispatcher, selection != Commands.CommandSelection.INTEGRATED); - VersionCommand.register(this.dispatcher, selection != Commands.CommandSelection.INTEGRATED); + SeedCommand.register(this.dispatcher, commandSelection != Commands.CommandSelection.INTEGRATED); + VersionCommand.register(this.dispatcher, commandSelection != Commands.CommandSelection.INTEGRATED); SetBlockCommand.register(this.dispatcher, context); diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/CommandConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/CommandConfig.java index 45f5aa0..f5e3a78 100644 --- a/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/CommandConfig.java +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/CommandConfig.java @@ -11,16 +11,16 @@ public class CommandConfig implements IConfigModule { // """ // Allow to use tick command""") // public static boolean tick = false; -// -// @ConfigInfo(name = "function_command_enabled", comments = -// """ -// Allow to use function command""") -// public static boolean function = false; -// -// @ConfigInfo(name = "scoreboard_command_enabled", comments = -// """ -// Allow to use scoreboard command""") -// public static boolean scoreboard = false; + + @ConfigInfo(name = "function_command_enabled", comments = + """ + Allow to use function command""") + public static boolean function = false; + + @ConfigInfo(name = "scoreboard_command_enabled", comments = + """ + Allow to use scoreboard command""") + public static boolean scoreboard = false; @ConfigInfo(name = "enabled", directory = {"save_all_command"}, comments = """ diff --git a/1todos/server/config-files/experiment/EntityDamageSourceTraceConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/EntityDamageSourceTraceConfig.java similarity index 100% rename from 1todos/server/config-files/experiment/EntityDamageSourceTraceConfig.java rename to lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/EntityDamageSourceTraceConfig.java