apply some patches

This commit is contained in:
Helvetica Volubi
2026-05-03 00:29:10 +08:00
parent 42d870e32b
commit 017e49da8a
8 changed files with 12 additions and 208 deletions
@@ -1,29 +0,0 @@
package fun.bm.lophine.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.enums.EnumConfigCategory;
/*
* This file is only for showing auto update config.
* The function is implemented in luminol-server and not provide any function.
* Please use luminol-server's auto update config.
*/
@ConfigClassInfo(
category = EnumConfigCategory.MISC,
name = "auto_update",
comments = """
Checks GitHub Releases for newer version's jars on a schedule.
Downloads are staged under auto_update/lophine and written to auto_update/core.path,
which Hyacinthusclip can consume on the next restart.
ATTENTION: full config option should be edited in luminol config system >> misc >> auto_update"""
)
public class AutoUpdateConfig implements IConfigModule {
@ConfigInfo(name = "enabled", comments = """
Whether the server should check for updates automatically.
You can enable it by edit this config, because they are both control the function.
One of them enabled, the full function will be enabled.""")
public static boolean enabled = false;
}
@@ -5,7 +5,7 @@ Subject: [PATCH] Diff in auto-update patch
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java
index ce01352b637547c1cf8308d56d4b3f9c48fcca70..d57c04d839401e8ba88e56d92be2798bb312949f 100644
index ce01352b637547c1cf8308d56d4b3f9c48fcca70..9b5623ce1de3d68c949c3c00b966cedab3a4c986 100644
--- a/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java
+++ b/src/main/java/me/earthme/luminol/config/modules/misc/AutoUpdateConfig.java
@@ -16,13 +16,13 @@ import java.util.Set;
@@ -35,15 +35,6 @@ index ce01352b637547c1cf8308d56d4b3f9c48fcca70..d57c04d839401e8ba88e56d92be2798b
and let Hyacinthusclip switch to it through auto_update/core.path on restart.""")
public static String targetJarPath = "";
@@ -42,7 +42,7 @@ public class AutoUpdateConfig implements IConfigModule {
@Override
public void onLoaded(CommentedFileConfig configInstance, @Nullable Set<Exception> exs) {
- if (enabled) {
+ if (enabled || fun.bm.lophine.config.modules.misc.AutoUpdateConfig.enabled) {
if (instance == null) {
instance = new AutoUpdateHelper();
}
diff --git a/src/main/java/me/earthme/luminol/utils/AutoUpdateHelper.java b/src/main/java/me/earthme/luminol/utils/AutoUpdateHelper.java
index 94a25cd681c9352d6931edafd9ec67fd7ba8a777..d0d0cf5e5ff8d4b8efa4d9778c27267b41cf8cf8 100644
--- a/src/main/java/me/earthme/luminol/utils/AutoUpdateHelper.java
@@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
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;
}
@@ -1,106 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
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() {
@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Suisuroru <qwertyuiop14077@qq.com>
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Thu, 20 Feb 2025 01:00:29 +0800
Subject: [PATCH] Purpur: Barrels and enderchests 6 rows
Co-authored by: William Blake Galbreath <Blake.Galbreath@GMail.com>
As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/purpur-server/paper-patches/features/0003-Barrels-and-enderchests-6-rows.patch)
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
Co-authored by: William Blake Galbreath <blake.galbreath@gmail.com>
As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/dc46f46d28dcdcaf33bb533f9571a107db98c1d7/purpur-server/paper-patches/features/0003-Barrels-and-enderchests-6-rows.patch)
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/dc46f46d28dcdcaf33bb533f9571a107db98c1d7/LICENSE)
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
index 2f41a92465b9da28e026297cc3528898bb1c8412..168301a2f1c3081ae15d3695c2dcc72b4538cdfb 100644
@@ -41,7 +41,7 @@ index 2f41a92465b9da28e026297cc3528898bb1c8412..168301a2f1c3081ae15d3695c2dcc72b
case DROPPER:
this.delegate = new DispenserMenu(windowId, bottom, top);
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index 9d5fe6fc727948955d89f9ed5e181185393a9611..1343972a3a230dcef7349f014a80362ffcb0fe94 100644
index 9d5fe6fc727948955d89f9ed5e181185393a9611..5e5a4e48b2a96c355256b8f8bfcc09225d562944 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -85,7 +85,7 @@ public class CraftInventory implements Inventory {
@@ -49,7 +49,7 @@ index 9d5fe6fc727948955d89f9ed5e181185393a9611..1343972a3a230dcef7349f014a80362f
@Override
public void setContents(ItemStack[] items) {
- Preconditions.checkArgument(items.length <= this.getSize(), "Invalid inventory size (%s); expected %s or less", items.length, this.getSize());
+ // Preconditions.checkArgument(items.length <= this.getSize(), "Invalid inventory size (%s); expected %s or less", items.length, this.getSize()); // Purpur - Barrels and enderchests 6 rows
+ // Preconditions.checkArgument(items.length <= this.getSize(), "Invalid inventory size (%s); expected %s or less", items.length, this.getSize()); // Purpur - Barrels and enderchests 6 rows
for (int i = 0; i < this.getSize(); i++) {
if (i >= items.length) {
@@ -4,16 +4,19 @@ import me.earthme.luminol.config.IConfigModule;
import me.earthme.luminol.config.flags.CommandSuggestions;
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.enums.EnumConfigCategory;
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "container_expansion")
public class ContainerExpansionConfig implements IConfigModule {
@HotReloadUnsupported
@CommandSuggestions(suggest = {"1", "2", "3", "4", "5", "6"})
@ConfigInfo(name = "barrel_rows", comments =
"""
range: 1~6""")
public static int barrelRows = 3;
@HotReloadUnsupported
@CommandSuggestions(suggest = {"1", "2", "3", "4", "5", "6"})
@ConfigInfo(name = "enderchest_rows", comments =
"""
@@ -3,10 +3,12 @@ package fun.bm.lophine.config.modules.removed;
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.REMOVED, name = "removed_config")
public class RemovedConfig implements IConfigModule {
@TransformedConfig(name = "enabled", directory = {"misc", "auto_update"})
@ConfigInfo(name = "removed", comments =
"""
RemovedConfig redirect to here, no any function.""")