Compare commits

...

9 Commits

Author SHA1 Message Date
Helvetica Volubi 43a5ea0385 Update Luminol 2025-10-18 02:34:13 +08:00
Helvetica Volubi 678882a435 Update Luminol & fix a bug in shutdown server 2025-10-14 19:14:12 +08:00
Helvetica Volubi 8e5884147f fix: fix async bugs
fixes #70
2025-10-12 11:54:30 +08:00
Helvetica Volubi b999cf9f5f [ci skip] update ci 2025-10-11 23:34:49 +08:00
Helvetica Volubi 847bcd54e0 Update Luminol 2025-10-06 14:20:14 +08:00
Helvetica Volubi 15a55403ff Modify merge ItemEntity logic
Add followTickSequenceMerge to modify merge items, due to Paper's modification of the merge radius, when the merge radius is large and stacks containing many items get stuck in an unexpected position, individual items may never reach their destination. This configuration option is added to fix this behavior.
2025-10-04 01:15:49 +08:00
Helvetica Volubi 482809df6e [ci skip]fix: fix default translations support 2025-10-03 18:24:30 +08:00
Helvetica Volubi 5db8ec4bd9 fix: pre fix a bug in I18n (will cause bug in 1.21.9) 2025-10-03 17:03:37 +08:00
Helvetica Volubi d60cd46c15 Update Luminol 2025-10-02 16:51:47 +08:00
16 changed files with 129 additions and 64 deletions
+10 -10
View File
@@ -10,13 +10,13 @@ on:
workflow_dispatch:
inputs:
force-release:
description: "Force release if you enter 1, default release if not released else skip release"
description: "Force disable release if you enter 2, force release if you enter 1, default release if not released else skip release"
required: false
default: "0"
default: ""
force-push:
description: "Push to repo if you enter 1, default push if not released else skip push repo"
description: "Force disable push to repo if you enter 2, push to repo if you enter 1, default push if not released else skip push repo"
required: false
default: "0"
default: ""
comments:
description: "Add comments to release"
required: false
@@ -39,7 +39,7 @@ jobs:
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
- name: Grant execute permission for gradlew
run: chmod +x gradlew
@@ -50,7 +50,7 @@ jobs:
- name: Apply All Patches
run: ./gradlew --refresh-dependencies applyAllPatches
- name: CreateMojmapPaperclipJar
- name: Build Paperclip Jar
run: ./gradlew --refresh-dependencies createMojmapPaperclipJar
- name: Upload Artifact
@@ -59,7 +59,7 @@ jobs:
name: ${{ env.project_id_b }} CI Artifacts
path: lophine-server/build/libs/*-paperclip-*-mojmap.jar
- name: SetENV
- name: Set Environment
if: github.event_name != 'pull_request'
run: sh scripts/SetENV.sh
@@ -84,8 +84,8 @@ jobs:
fi
echo "release_exists=${release_exists}" >> $GITHUB_ENV
- name: Publish to repo
if: (( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' ) || ( env.release_exists == 'true' && inputs.force-push == '1' )) && false # do not push to any repo
- name: Publish To Repo
if: (( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' && !(inputs.force-push == '2')) || inputs.force-push == '1') && false # do not push to any repo
continue-on-error: true
run: ./gradlew --refresh-dependencies generateDevelopmentBundle publish -PpublishDevBundle=true
env:
@@ -93,7 +93,7 @@ jobs:
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
- name: Create Release - Pre Process
if: ( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' ) || ( env.release_exists == 'true' && inputs.force-release == '1' )
if: ( github.event_name != 'pull_request' && env.flag_release == 'true' && env.release_exists != 'true' && !(inputs.force-release == '2')) || inputs.force-release == '1'
run: |
if [ ${{ inputs.comments }} == "" ]; then
echo "No comments provided"
+1 -1
View File
@@ -4,7 +4,7 @@ mcVersion=1.21.8
release=2
# 0 for skip release, 1 for pre-release, 2 for release
luminolRef=9c79e227fcbb2bdfa624e97f522ca36aa4901100
luminolRef=d872c4621ee629fe748a32b3461d877925aac425
org.gradle.configuration-cache=true
org.gradle.caching=true
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+2 -2
View File
@@ -51,7 +51,7 @@
// Luminol start - Dependenices insert
implementation("com.electronwill.night-config:toml:3.8.2") // Night config
implementation("com.github.luben:zstd-jni:1.5.4-1")
@@ -276,14 +_,14 @@
@@ -275,14 +_,14 @@
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
@@ -70,7 +70,7 @@
"Build-Number" to (build ?: ""),
"Build-Time" to buildTime.toString(),
"Git-Branch" to gitBranch,
@@ -447,7 +_,7 @@
@@ -446,7 +_,7 @@
}
fill {
@@ -5,14 +5,14 @@ Subject: [PATCH] Rebrand to Lophine
diff --git a/src/main/java/me/earthme/luminol/config/ConfigManager.java b/src/main/java/me/earthme/luminol/config/ConfigManager.java
index 6f294437d8791487d559e52a23a859c0572c0034..4d7e7d7a9c16d416d0ba4c77be061718c9793cb1 100644
index d8066afd5f3f2ea9a5dff87d853562e22268785c..f8b2364fa162a41304a99a4993354e33528ab801 100644
--- a/src/main/java/me/earthme/luminol/config/ConfigManager.java
+++ b/src/main/java/me/earthme/luminol/config/ConfigManager.java
@@ -22,6 +22,7 @@ public class ConfigManager {
@@ -21,6 +21,7 @@ public class ConfigManager {
public static void initConfigs() {
configfiles.put("luminol", ConfigsInstance.of(new File("luminol_config"), "luminol", "me.earthme.luminol.config.modules"));
+ configfiles.put("lophine", ConfigsInstance.of(new File("lophine_config"), "lophine", "fun.bm.lophine.config.modules")); // add lophine config to global config
configfiles.put("luminol", ConfigsInstance.of("luminol", "me.earthme.luminol.config.modules"));
+ configfiles.put("lophine", ConfigsInstance.of("lophine", "fun.bm.lophine.config.modules")); // add lophine config to global config
preLoad();
}
@@ -5,10 +5,18 @@ Subject: [PATCH] I18n support
diff --git a/net/minecraft/locale/Language.java b/net/minecraft/locale/Language.java
index 7b9e2a1a208b46a69c16e6afd8b502259893574f..db46a31ea8a36562e548eb07f0c4cf9b9e8c3360 100644
index 7b9e2a1a208b46a69c16e6afd8b502259893574f..c300ae4363298fecef8fa9bf739f01c0a11e145f 100644
--- a/net/minecraft/locale/Language.java
+++ b/net/minecraft/locale/Language.java
@@ -65,7 +65,7 @@ public abstract class Language {
@@ -36,6 +36,7 @@ public abstract class Language {
Map<String, String> map = new HashMap<>();
BiConsumer<String, String> biConsumer = map::put;
parseTranslations(biConsumer, "/assets/minecraft/lang/en_us.json");
+ fun.bm.lophine.utils.ServerI18nUtil.loadLophineI18nDefault(biConsumer);
deprecatedTranslationsInfo.applyToMap(map);
final Map<String, String> map1 = Map.copyOf(map);
return new Language() {
@@ -65,7 +66,7 @@ public abstract class Language {
};
}
@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Fri, 3 Oct 2025 19:43:36 +0800
Subject: [PATCH] Modify merge ItemEntity logic
Add followTickSequenceMerge to modify merge items, due to Paper's modification of the merge radius, when the merge radius is large and stacks containing many items get stuck in an unexpected position, individual items may never reach their destination. This configuration option is added to fix this behavior.
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
index e5e8c752129a6ebb0dd1315c9b8ec459be11ef07..dfd202a74ec7f2cdb9cdc208a6428090a110f811 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
@@ -295,7 +295,7 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish
ItemStack item = this.getItem();
ItemStack item1 = itemEntity.getItem();
if (Objects.equals(this.target, itemEntity.target) && areMergable(item, item1)) {
- if (item1.getCount() < item.getCount()) {
+ if (fun.bm.lophine.config.modules.misc.ItemEntityConfig.followTickSequenceMerge || item1.getCount() < item.getCount()) { // Lophine - add follow Tick Sequence Merge, see Paper#13073
merge(this, item, itemEntity, item1);
} else {
merge(itemEntity, item1, this, item);
@@ -30,7 +30,7 @@ public class CommandConfig implements IConfigModule {
"""
Allow to use waypoint command""")
public static boolean waypoint = false;
@ConfigInfo(name = "scoreboard_command_enabled", comments =
"""
Allow to use scoreboard command""")
@@ -23,14 +23,16 @@ public class ContainerExpansionConfig implements IConfigModule {
range: 1~6""")
public static int enderchestRows = 3;
@TransformedConfig(name = "shulker_stackable_count", directory = {"function", "container_expansion"})
@TransformedConfig(name = "shulker_stackable_count", directory = {"misc", "container_expansion"})
@CommandSuggestions(suggest = {"1", "2", "32", "64"})
@ConfigInfo(name = "shulker_stackable_count", comments =
@ConfigInfo(name = "shulker_stackable_count", directory = {"shulker_box"}, comments =
"""
range: 1~64""")
public static int shulkerCount = 1;
@TransformedConfig(name = "same_nbt_shulker_stackable", directory = {"function", "container_expansion"})
@TransformedConfig(name = "same_nbt_shulker_stackable", directory = {"misc", "container_expansion"})
@ConfigInfo(name = "same_nbt_shulker_stackable")
@ConfigInfo(name = "same_nbt_shulker_stackable", directory = {"shulker_box"})
public static boolean nbtShulkerStackable = false;
}
@@ -0,0 +1,16 @@
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;
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "item-entity")
public class ItemEntityConfig implements IConfigModule {
@ConfigInfo(name = "follow-tick-sequence-merge", comments = """
Due to Paper's modification of the merge radius,
when the merge radius is large and stacks containing many items get stuck in an unexpected position,
individual items may never reach their destination.
This configuration option is added to fix this behavior.""")
public static boolean followTickSequenceMerge = false;
}
@@ -6,9 +6,9 @@ import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import com.mojang.logging.LogUtils;
import fun.bm.lophine.config.modules.function.LanguageConfig;
import io.papermc.paper.ServerBuildInfo;
import me.earthme.luminol.config.ConfigManager;
import me.earthme.luminol.config.ConfigsInstance;
import net.minecraft.DetectedVersion;
import net.minecraft.locale.DeprecatedTranslationsInfo;
import net.minecraft.locale.Language;
import net.minecraft.network.chat.FormattedText;
@@ -41,7 +41,7 @@ import java.util.function.BiConsumer;
*/
public class ServerI18nUtil {
private static final Logger logger = LogUtils.getClassLogger();
private static final String VERSION = DetectedVersion.BUILT_IN.name();
private static final String VERSION = ServerBuildInfo.buildInfo().minecraftVersionId();
private static final String BASE_PATH = "cache/lophine/" + VERSION + "/";
private static final String defaultLophineLangPath = "/assets/lophine/lang/en_us.json";
private static final String manifestUrl = "https://launchermeta.mojang.com/mc/game/version_manifest.json";
@@ -24,6 +24,7 @@ import com.mojang.authlib.properties.Property;
import com.mojang.logging.LogUtils;
import fun.bm.lophine.config.modules.function.FakeplayerConfig;
import io.papermc.paper.adventure.PaperAdventure;
import io.papermc.paper.threadedregions.RegionizedServer;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.Style;
import net.minecraft.nbt.CompoundTag;
@@ -173,31 +174,14 @@ public class BotList {
bot.supressTrackerForLogin = true;
io.papermc.paper.threadedregions.RegionizedServer.getInstance().taskQueue.queueTickTaskQueue(
world, net.minecraft.util.Mth.floor(location.getX()) >> 4, net.minecraft.util.Mth.floor(location.getZ()) >> 4,
() -> {
world.addNewPlayer(bot);
BotJoinEvent event1 = new BotJoinEvent(bot.getBukkitEntity(), PaperAdventure.asAdventure(Component.translatable("multiplayer.player.joined", bot.getDisplayName())).style(Style.style(NamedTextColor.YELLOW)));
this.server.server.getPluginManager().callEvent(event1);
net.kyori.adventure.text.Component joinMessage = event1.joinMessage();
if (joinMessage != null && !joinMessage.equals(net.kyori.adventure.text.Component.empty())) {
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(joinMessage), false);
}
bot.renderInfo();
bot.supressTrackerForLogin = false;
bot.level().getChunkSource().chunkMap.addEntity(bot);
bot.renderData();
bot.initInventoryMenu();
botsNameByWorldUuid
.computeIfAbsent(bot.level().uuid.toString(), (k) -> new HashSet<>())
.add(bot.getBukkitEntity().getRealName());
BotList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", bot.getName().getString(), "Local", bot.getId(), bot.level().serverLevelData.getLevelName(), bot.getX(), bot.getY(), bot.getZ());
},
ca.spottedleaf.concurrentutil.util.Priority.HIGHER);
if (TickThread.isTickThreadFor(world, net.minecraft.util.Mth.floor(location.getX()) >> 4, net.minecraft.util.Mth.floor(location.getZ()) >> 4)) {
summonBot(bot, world);
} else {
RegionizedServer.getInstance().taskQueue.queueTickTaskQueue(
world, net.minecraft.util.Mth.floor(location.getX()) >> 4, net.minecraft.util.Mth.floor(location.getZ()) >> 4,
() -> summonBot(bot, world),
ca.spottedleaf.concurrentutil.util.Priority.HIGHER);
}
optional.ifPresent(nbt -> {
bot.loadAndSpawnEnderPearls(nbt);
bot.loadAndSpawnParentVehicle(nbt);
@@ -205,6 +189,30 @@ public class BotList {
return bot;
}
private ServerBot summonBot(ServerBot bot, ServerLevel world) {
world.addNewPlayer(bot);
BotJoinEvent event1 = new BotJoinEvent(bot.getBukkitEntity(), PaperAdventure.asAdventure(Component.translatable("multiplayer.player.joined", bot.getDisplayName())).style(Style.style(NamedTextColor.YELLOW)));
this.server.server.getPluginManager().callEvent(event1);
net.kyori.adventure.text.Component joinMessage = event1.joinMessage();
if (joinMessage != null && !joinMessage.equals(net.kyori.adventure.text.Component.empty())) {
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(joinMessage), false);
}
bot.renderInfo();
bot.supressTrackerForLogin = false;
bot.level().getChunkSource().chunkMap.addEntity(bot);
bot.renderData();
bot.initInventoryMenu();
botsNameByWorldUuid
.computeIfAbsent(bot.level().uuid.toString(), (k) -> new HashSet<>())
.add(bot.getBukkitEntity().getRealName());
BotList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", bot.getName().getString(), "Local", bot.getId(), bot.level().serverLevelData.getLevelName(), bot.getX(), bot.getY(), bot.getZ());
return bot;
}
public boolean removeBot(@NotNull ServerBot bot, @NotNull BotRemoveEvent.RemoveReason reason, @Nullable CommandSender remover, boolean saved) {
return this.removeBot(bot, reason, remover, saved, this.dataStorage);
}
@@ -301,19 +309,27 @@ public class BotList {
} else {
finished = false;
check.getAndIncrement();
bot.getBukkitEntity().taskScheduler.schedule((Entity unused) -> {
BotList.this.removeBot(bot, BotRemoveEvent.RemoveReason.INTERNAL, null, FakeplayerConfig.canResident);
received.getAndIncrement();
if (received.get() >= check.get()) {
this.forceShutdown = true;
MinecraftServer.getServer().stopServer();
}
}, null, 1L);
removeBot(bot, check, received, new AtomicInteger());
}
}
return finished;
}
private void removeBot(ServerBot bot, AtomicInteger check, AtomicInteger received, AtomicInteger counter) {
bot.getBukkitEntity().taskScheduler.schedule((Entity unused) -> {
if (counter.get() >= 20) {
BotList.LOGGER.info("Try to remove bot {} located in [{}]{},{},{} too many times!", bot.getName().getString(), bot.level().serverLevelData.getLevelName(), bot.getX(), bot.getY(), bot.getZ());
}
counter.getAndIncrement();
this.removeBot(bot, BotRemoveEvent.RemoveReason.INTERNAL, null, FakeplayerConfig.canResident);
received.getAndIncrement();
if (received.get() >= check.get()) {
this.forceShutdown = true;
MinecraftServer.getServer().stopServer();
}
}, (Entity unused) -> removeBot(bot, check, received, counter), 1L);
}
public void loadBotInfo() {
if (!FakeplayerConfig.enable || !FakeplayerConfig.canResident) {
return;
@@ -41,6 +41,7 @@ import org.slf4j.Logger;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
// Powered by Servux(https://github.com/sakura-ryoko/servux)
@@ -50,7 +51,7 @@ public class ServuxEntityDataProtocol implements LeavesProtocol {
public static final int PROTOCOL_VERSION = 1;
private static final Map<UUID, Long> readingSessionKeys = new HashMap<>();
private static final Map<UUID, Long> readingSessionKeys = new ConcurrentHashMap<>();
@ProtocolHandler.PlayerJoin
public static void onPlayerJoin(ServerPlayer player) {
@@ -46,17 +46,18 @@ import org.leavesmc.leaves.protocol.servux.logger.DataLogger;
import javax.annotation.Nonnull;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@LeavesProtocol.Register(namespace = "servux")
public class ServuxHudDataProtocol implements LeavesProtocol {
public static final int PROTOCOL_VERSION = 2;
private static final List<ServerPlayer> players = new ArrayList<>();
private static final List<ServerPlayer> players = Collections.synchronizedList(new ArrayList<>());
private static final int updateInterval = 80;
private static final HashMap<ServerPlayer, List<DataLogger.Type>> loggerPlayers = new HashMap<>();
private static final HashMap<DataLogger.Type, DataLogger<?>> LOGGERS = new HashMap<>();
private static final ConcurrentHashMap<ServerPlayer, List<DataLogger.Type>> loggerPlayers = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<DataLogger.Type, DataLogger<?>> LOGGERS = new ConcurrentHashMap<>();
private static final Table<DataLogger.Type, ServerPlayer, Tag> DATA = HashBasedTable.create();
public static boolean refreshSpawnMetadata = false;
@@ -58,7 +58,7 @@ public class ServuxStructuresProtocol implements LeavesProtocol {
public static final int PROTOCOL_VERSION = 2;
private static final int updateInterval = 40;
private static final Map<Integer, ServerPlayer> players = new ConcurrentHashMap<>();
private static final Map<UUID, Map<ChunkPos, Timeout>> timeouts = new HashMap<>();
private static final Map<UUID, Map<ChunkPos, Timeout>> timeouts = new ConcurrentHashMap<>();
private static int retainDistance;
@ProtocolHandler.PlayerJoin
@@ -54,6 +54,7 @@ import org.leavesmc.leaves.protocol.servux.litematics.utils.ReplaceBehavior;
import org.leavesmc.leaves.util.TagUtil;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@LeavesProtocol.Register(namespace = "servux")
public class ServuxLitematicsProtocol implements LeavesProtocol {
@@ -61,7 +62,7 @@ public class ServuxLitematicsProtocol implements LeavesProtocol {
public static final int PROTOCOL_VERSION = 1;
private static final CompoundTag metadata = new CompoundTag();
private static final Map<UUID, Long> playerSession = new HashMap<>();
private static final Map<UUID, Long> playerSession = new ConcurrentHashMap<>();
@ProtocolHandler.Init
public static void init() {