diff --git a/.gitignore b/.gitignore index f550ab5..44591d7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ build /lophine-server/build.gradle.kts /lophine-api/build.gradle.kts -/lophine-server/src/minecraft +/luminol-server/src/minecraft /paper-server /paper-api /paper-api-generator diff --git a/gradle.properties b/gradle.properties index c15a8a7..0df727a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ weightVersion=2.0.12 # 0 for skip release, 1 for pre-release, 2 for release release=0 -luminolRef=e82ebef452376ed8f35d851d80197d0644000a26 +luminolRef=8bd475309e1871dd20ebebf61191cd5699ec4ef6 org.gradle.configuration-cache=true org.gradle.caching=true diff --git a/lophine-server/luminol-patches/features/0002-Transformed-Configs.patch b/lophine-server/luminol-patches/features/0002-Transformed-Configs.patch new file mode 100644 index 0000000..324c2af --- /dev/null +++ b/lophine-server/luminol-patches/features/0002-Transformed-Configs.patch @@ -0,0 +1,57 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MrHua269 +Date: Sat, 2 May 2026 22:53:17 +0800 +Subject: [PATCH] Transformed Configs + + +diff --git a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java +index 30f78cbae7aea3e9fcee6d97f229ddf8e8344299..7da4c1ee037315437c752544ab7e1f6d242fe3e4 100644 +--- a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java ++++ b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandConfig.java +@@ -4,6 +4,7 @@ import me.earthme.luminol.config.IConfigModule; + import me.earthme.luminol.config.flags.ConfigClassInfo; + import me.earthme.luminol.config.flags.ConfigInfo; + import me.earthme.luminol.config.flags.HotReloadUnsupported; ++import me.earthme.luminol.config.flags.TransformedConfig; + import me.earthme.luminol.enums.EnumConfigCategory; + + @ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "command") +@@ -11,12 +12,17 @@ public class CommandConfig implements IConfigModule { + @ConfigInfo(name = "enable_data_command") + @HotReloadUnsupported + public static boolean data = false; ++ @TransformedConfig(name = "command_block_enabled", directory = {"experiment", "command"}, originInstance = "lophine") ++ @TransformedConfig(name = "enabled", directory = {"experiment", "force_enable_command_block_command_execution"}) + @ConfigInfo(name = "enable_command_block", comments = """ + Force to enable command blocks. + ATTENTION: WOULD CAUSE SERVER CRASHING AS SOME THREADING ISSUE!!! + DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING!!! + """) + public static boolean commandBlock = false; ++ @TransformedConfig(name = "enable-waypoint", directory = {"experiment", "waypoint bar"}, originInstance = "lophine") ++ @TransformedConfig(name = "enable-waypoint", directory = {"experiment", "waypoint_bar"}, originInstance = "lophine") ++ @TransformedConfig(name = "waypoint_command_enabled", directory = {"experiment", "command"}, originInstance = "lophine") + @ConfigInfo(name = "enable_waypoints_and_waypoint_command", comments = """ + Enable waypoint and waypoint command. + WARN: Still under testing +diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java +index e80d1784a7b136d26020c721a851c1275423c763..d5f99fd672e33c16fc3c3e2031ce2e5a5001ab55 100644 +--- a/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java ++++ b/src/main/java/me/earthme/luminol/config/modules/misc/PaperPacketLimiterConfig.java +@@ -3,6 +3,7 @@ package me.earthme.luminol.config.modules.misc; + import me.earthme.luminol.config.IConfigModule; + import me.earthme.luminol.config.flags.ConfigClassInfo; + import me.earthme.luminol.config.flags.ConfigInfo; ++import me.earthme.luminol.config.flags.TransformedConfig; + import me.earthme.luminol.enums.EnumConfigCategory; + + @ConfigClassInfo(category = EnumConfigCategory.MISC, name = "force_disable_packet_limiter_of_paper", comments = +@@ -10,6 +11,8 @@ import me.earthme.luminol.enums.EnumConfigCategory; + "has negative impacts on security" + ) + public class PaperPacketLimiterConfig implements IConfigModule { ++ @TransformedConfig(name = "unlimit-packet", directory = {"misc", "network"}, originInstance = "lophine") ++ @TransformedConfig(name = "force_disable", directory = {"optimizations", "force_disable_packet_limiter_of_paper"}) + @ConfigInfo(name = "force_disable") + public static boolean forceDisable = false; + } diff --git a/lophine-server/minecraft-patches/features/0001-Leaves-Utilities.patch b/lophine-server/minecraft-patches/features/0001-Leaves-Utilities.patch new file mode 100644 index 0000000..e4a7b79 --- /dev/null +++ b/lophine-server/minecraft-patches/features/0001-Leaves-Utilities.patch @@ -0,0 +1,106 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MrHua269 +Date: Sat, 2 May 2026 23:06:28 +0800 +Subject: [PATCH] Leaves Utilities + +This is a part of Leaves(https://github.com/LeavesMC/Leaves/blob/2f7f7165765b6373a101bc5e2f04a4573d79185a/leaves-server/minecraft-patches/features/0003-Leaves-Utils.patch) + +Original License: https://github.com/LeavesMC/Leaves/blob/2f7f7165765b6373a101bc5e2f04a4573d79185a/LICENSE.md + +diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java +index 0e543348e48fdf2131dfa1460e37db238d02988c..60a8c2edc34030a5269313750817515664117df8 100644 +--- a/net/minecraft/world/entity/Entity.java ++++ b/net/minecraft/world/entity/Entity.java +@@ -389,6 +389,8 @@ public abstract class Entity + public long activatedImmunityTick = Integer.MIN_VALUE; + public int teleportTickType = 0;// Luminol - Entity portal-teleport speed fix + ++ private net.minecraft.nbt.CompoundTag leavesData = new net.minecraft.nbt.CompoundTag(); // Leaves - Leaves ex data ++ + public void inactiveTick() { + } + // Paper end - EAR 2 +@@ -2723,6 +2725,7 @@ public abstract class Entity + output.putBoolean("Paper.FreezeLock", true); + } + // Paper end ++ output.store("Leaves.Data", net.minecraft.nbt.CompoundTag.CODEC, leavesData); // Leaves - leaves ex data + } catch (Throwable var7) { + CrashReport report = CrashReport.forThrowable(var7, "Saving entity NBT"); + CrashReportCategory category = report.addCategory("Entity being saved"); +@@ -2845,6 +2848,7 @@ public abstract class Entity + } + freezeLocked = input.getBooleanOr("Paper.FreezeLock", false); + // Paper end ++ leavesData = input.read("Leaves.Data", net.minecraft.nbt.CompoundTag.CODEC).orElse(new net.minecraft.nbt.CompoundTag()); + } catch (Throwable var7) { + CrashReport report = CrashReport.forThrowable(var7, "Loading entity NBT"); + CrashReportCategory category = report.addCategory("Entity being loaded"); +@@ -6410,6 +6414,11 @@ public abstract class Entity + return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition()); + } + // Paper end - Expose entity id counter ++ // Leaves start - leaves ex data ++ public net.minecraft.nbt.CompoundTag getLeavesData() { ++ return leavesData; ++ } ++ // Leaves end - leaves ex data + + public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG + } +diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java +index e06e48dd9c997ac1dc6e404aa0bc590c851e1ba8..67763966f751087ac5136c3d4288dc5c5b3d38f6 100644 +--- a/net/minecraft/world/level/Level.java ++++ b/net/minecraft/world/level/Level.java +@@ -999,7 +999,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + } + + // Paper start - if loaded +- @Nullable ++ @org.jetbrains.annotations.NotNull // Leaves - notnull + @Override + public final ChunkAccess getChunkIfLoadedImmediately(int x, int z) { + return ((ServerLevel)this).chunkSource.getChunkAtIfLoadedImmediately(x, z); +diff --git a/net/minecraft/world/level/LevelAccessor.java b/net/minecraft/world/level/LevelAccessor.java +index 58dcd774b00f171a94faf7581b79675ebc43030b..232720a391819d0ce51f77a5e57de0a5a2ac05ef 100644 +--- a/net/minecraft/world/level/LevelAccessor.java ++++ b/net/minecraft/world/level/LevelAccessor.java +@@ -48,7 +48,7 @@ public interface LevelAccessor extends CommonLevelAccessor, ScheduledTickAccess + return this.getLevelData().getGameTime(); + } + +- @Nullable MinecraftServer getServer(); ++ @org.jetbrains.annotations.NotNull MinecraftServer getServer(); // Leaves - notnull + + default Difficulty getDifficulty() { + return this.getLevelData().getDifficulty(); +diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java +index 0cdd88e530c660b65f3eb331b37cbd2c69fc2ff5..194f79d346bb671029eb20ad43bdb962be7d9e5f 100644 +--- a/net/minecraft/world/level/block/Block.java ++++ b/net/minecraft/world/level/block/Block.java +@@ -712,4 +712,12 @@ public class Block extends BlockBehaviour implements ItemLike { + @org.intellij.lang.annotations.MagicConstant(flags = {UPDATE_NEIGHBORS, UPDATE_CLIENTS, UPDATE_INVISIBLE, UPDATE_IMMEDIATE, UPDATE_KNOWN_SHAPE, UPDATE_SUPPRESS_DROPS, UPDATE_MOVE_BY_PISTON, UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE, UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS, UPDATE_SKIP_ON_PLACE}) // Paper - add back source-retention annotation for IDE + public @interface UpdateFlags { + } ++ ++ // Leaves start - reset push reaction ++ @org.jetbrains.annotations.Nullable ++ public net.minecraft.world.level.material.PushReaction getResetPushReaction() { ++ return null; ++ } ++ // Leaves end - reset push reaction ++ + } +diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java +index 0fbdf810c785c8a596d461e7651361fdedbb6217..6c20082a094bd98a7a0cd9aca2f9bc0ede065fb5 100644 +--- a/net/minecraft/world/level/block/state/BlockBehaviour.java ++++ b/net/minecraft/world/level/block/state/BlockBehaviour.java +@@ -782,7 +782,7 @@ public abstract class BlockBehaviour implements FeatureElement, org.leavesmc.lea + } + + public PushReaction getPistonPushReaction() { +- return !this.isDestroyable() ? PushReaction.BLOCK : this.pushReaction; // Paper - Protect Bedrock and End Portal/Frames from being destroyed ++ return !this.isDestroyable() ? PushReaction.BLOCK : this.getBlock().getResetPushReaction() == null ? this.pushReaction : this.getBlock().getResetPushReaction(); // Paper - Protect Bedrock and End Portal/Frames from being destroyed // Leaves - reset push reaction + } + + public boolean isSolidRender() {