Compare commits
20 Commits
ver/1.21.5
...
ver/1.21.7
| Author | SHA1 | Date | |
|---|---|---|---|
| 509e782d1a | |||
| bfb5f74600 | |||
| a697b179e7 | |||
| 904abaa564 | |||
| d1aeaa83f4 | |||
| 145eae3c41 | |||
| 6e61e12285 | |||
| 56e870d999 | |||
| 7f8135b193 | |||
| 31096e1a48 | |||
| f261b9fe58 | |||
| 92412e0a72 | |||
| 23f4d70fca | |||
| c613aaa191 | |||
| 692c38f7ac | |||
| 96683209f5 | |||
| 6d9458fa01 | |||
| 333a7fc17c | |||
| 914d8cc1dd | |||
| 6f9e4abcbf |
@@ -1,10 +1,10 @@
|
||||
name: Lophine CI - ver/1.21.5
|
||||
name: Lophine CI - ver/1.21.7
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/1.21.5" ]
|
||||
branches: [ "ver/1.21.7" ]
|
||||
pull_request:
|
||||
branches: [ "ver/1.21.5" ]
|
||||
branches: [ "ver/1.21.7" ]
|
||||
|
||||
permissions: write-all
|
||||
|
||||
+10
-9
@@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
java // TODO java launcher tasks
|
||||
id("io.papermc.paperweight.patcher") version "2.0.0-beta.17"
|
||||
id("moe.luminolmc.hyacinthusweight.patcher") version "+" // Automatically pulls the latest
|
||||
}
|
||||
|
||||
paperweight {
|
||||
@@ -41,6 +41,7 @@ paperweight {
|
||||
}
|
||||
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
val menthaMavenPublicUrl = "https://repo.menthamc.com/repository/maven-public/";
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
@@ -55,6 +56,7 @@ subprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven(paperMavenPublicUrl)
|
||||
maven(menthaMavenPublicUrl)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -65,16 +67,15 @@ subprojects {
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
}
|
||||
tasks.withType<JavaCompile> {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release = 21
|
||||
options.isFork = true
|
||||
options.forkOptions.memoryMaximumSize = "6g" // Prevent OOM during building
|
||||
}
|
||||
tasks.withType<Javadoc> {
|
||||
tasks.withType<Javadoc>().configureEach {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks.withType<ProcessResources> {
|
||||
tasks.withType<ProcessResources>().configureEach {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks.withType<Test> {
|
||||
@@ -90,14 +91,14 @@ subprojects {
|
||||
maven("https://repo.menthamc.com/repository/maven-snapshots/") {
|
||||
name = "MenthaMC"
|
||||
credentials(PasswordCredentials::class) {
|
||||
username = System.getenv("MAVEN_REPO_USER")
|
||||
password = System.getenv("MAVEN_REPO_PASSWORD")
|
||||
username = System.getenv("PRIVATE_MAVEN_REPO_USERNAME")
|
||||
password = System.getenv("PRIVATE_MAVEN_REPO_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
tasks.withType<Javadoc>().configureEach {
|
||||
options {
|
||||
(this as StandardJavadocDocletOptions).apply {
|
||||
addStringOption("-add-modules", "jdk.incubator.vector")
|
||||
@@ -105,4 +106,4 @@ subprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,19 +41,21 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
|
||||
1. 将你的仓库 clone 到本地;
|
||||
2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyAllPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyAllPatches`;
|
||||
3. 在执行操作后,仓库根目录下应该存在以下目录对: `lophine-api` 和 `lophine-server` , `folia-api` 和 `folia-server` , 以及 `paper-api` 和 `paper-server`(下文称作 `*-api` 和 `*-server` );
|
||||
3. 在执行操作后,仓库根目录下应该存在以下目录对: `lophine-api` 和 `lophine-server` , `luminol-api` 和 `luminol-server` , `folia-api` 和 `folia-server` , 以及 `paper-api` 和 `paper-server`(下文称作 `*-api` 和 `*-server` );
|
||||
4. 进入 仓库根目录下的 `*-api` 和 `*-server` 文件夹进行修改。
|
||||
|
||||
以下为对上述各个文件夹的简单描述,详细描述可以参考[这里](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md):
|
||||
1. API部分
|
||||
- `lophine-api` :暂无有效文件
|
||||
- `lophine-api` :对新增API的修改
|
||||
- `luminol-api` :对luminol-API的修改应当在此文件夹下进行
|
||||
- `folia-api` :对folia-API的修改应当在此文件夹下进行
|
||||
- `paper-api` :对paper-API/spigot-API/bukkit-API的修改应该在此文件夹下进行
|
||||
|
||||
2. Server部分
|
||||
- `lophine-server` :对Minecraft原版服务器的修改应当在此文件夹下进行
|
||||
- `folia-server` :暂无有效文件
|
||||
- `paper-server` :对于非原版的对服务器逻辑的修改应当在此文件夹下进行
|
||||
- `lophine-server` :对Minecraft原版服务器的修改和新增文件应当在此文件夹下进行
|
||||
- `luminol-server` :对luminol-server的修改应当在此文件夹下进行
|
||||
- `folia-server` :对folia-Server的修改应当在此文件夹下进行
|
||||
- `paper-server` :对于paper对服务器逻辑的修改应当在此文件夹下进行
|
||||
|
||||
顺便一提,仓库根目录下的 `*-api` 和 `*-server` 并不是正常的 git 仓库:
|
||||
|
||||
|
||||
@@ -44,20 +44,22 @@ If you have forked the main repository, then you should follow the steps below:
|
||||
|
||||
1. Clone your repository to local
|
||||
2. Run Gradle's `applyAllPatches` task in your IDE or terminal (You can run `./gradlew applyAllPatches` directly in terminal.)
|
||||
3. After performing the operation, the following directory pairs should exist in the root directory of the warehouse: `lophine-api` and `lophine-server` , `folia-api` and `folia-server` , `paper-api` and `paper-server` (Referred to `*-api` and `*-server` as below)
|
||||
3. After performing the operation, the following directory pairs should exist in the root directory of the warehouse: `lophine-api` and `lophine-server` , `luminol-api` and `luminol-server` , `folia-api` and `folia-server` , `paper-api` and `paper-server` (Referred to `*-api` and `*-server` as below)
|
||||
4. Enter `*-api` and `*-server` directory to carry out modifications.
|
||||
|
||||
The following is the simple description of the aforementioned folders, detailed description can be referred to [here](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md):
|
||||
|
||||
1. API part
|
||||
- `lophine-api` : There is no valid file
|
||||
- `lophine-api` : Modifications to the new API
|
||||
- `luminol-api` : Modifications to Luminol API should be carried out in this folder
|
||||
- `folia-api` : Modifications to Folia API should be carried out in this folder
|
||||
- `paper-api` : Modifications to Paper API/Spigot API/Bukkit API should be carried out in this folder
|
||||
|
||||
2. Server part
|
||||
- `lophine-server` : Modifications to Minecraft Vanilla Server's source logic should be carried out in this folder
|
||||
- `folia-server` : There is no valid file
|
||||
- `paper-server` : Modifications to non-vanilla server logic should be carried out in this folder
|
||||
- `lophine-server` : Changes and new files to the Minecraft vanilla server should be made in this folder
|
||||
- `luminol-server` : Changes to luminol-server should be made in this folder
|
||||
- `folia-server` : Changes to folia-server should be made in this folder
|
||||
- `paper-server` : Modifications to the server logic for paper should be made in this folder
|
||||
|
||||
BTW, `*-api` and `*-server` and are not normal git repositories.
|
||||
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
group=fun.bm.lophine
|
||||
version=1.21.5-R0.1-SNAPSHOT
|
||||
mcVersion=1.21.5
|
||||
version=1.21.7-R0.1-SNAPSHOT
|
||||
mcVersion=1.21.7
|
||||
|
||||
luminolRef=3eedf8615328bd7738d01e04694aacfa9601b17d
|
||||
luminolRef=5ec3986e676e309dd9a406693f1e396c941c18f0
|
||||
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.caching=true
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/luminol-server/build.gradle.kts
|
||||
+++ b/luminol-server/build.gradle.kts
|
||||
@@ -54,7 +_,23 @@
|
||||
@@ -52,7 +_,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
+
|
||||
+ activeFork = lophine
|
||||
|
||||
|
||||
spigot {
|
||||
buildDataRef = "702e1a0a5072b2c4082371d5228cb30525687efc"
|
||||
@@ -142,12 +_,16 @@
|
||||
resources { srcDir("../paper-server/src/main/resources") }
|
||||
java { srcDir("../folia-server/src/main/java") }
|
||||
@@ -47,11 +47,11 @@
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":luminol-api")) // Luminol
|
||||
+ implementation(project(":lophine-api")) // Luminol // Lophine
|
||||
implementation("com.electronwill.night-config:toml:3.8.2") // Luminol - Night config
|
||||
// Abomination start
|
||||
+ implementation(project(":lophine-api")) // Lophine
|
||||
// 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")
|
||||
@@ -265,14 +_,14 @@
|
||||
@@ -264,14 +_,14 @@
|
||||
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
|
||||
@@ -4,302 +4,30 @@ Date: Sun, 8 Jun 2025 00:58:13 +0800
|
||||
Subject: [PATCH] Rebrand to Lophine
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java b/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
|
||||
index fb63e2a3205ea9f7aaee0ff0f4dc0cc1a5268507..645f2f41de74f4461685c753dcd6cfc5dfa8b2ab 100644
|
||||
--- a/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
|
||||
+++ b/src/main/java/me/earthme/luminol/commands/LuminolConfigCommand.java
|
||||
@@ -13,11 +13,17 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/ConfigManager.java b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
index 26a812cd526acfd1edf31a5c9799fa6deeae927a..9b01cf6f066b2998a2b178321782be1c96f73b0c 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/ConfigManager.java
|
||||
@@ -19,6 +19,7 @@ public class ConfigManager {
|
||||
|
||||
public class LuminolConfigCommand extends Command {
|
||||
- public LuminolConfigCommand() {
|
||||
- super("luminolconfig");
|
||||
- this.setPermission("luminol.commands.luminolconfig");
|
||||
+ private LuminolConfig config;
|
||||
+
|
||||
+ public LuminolConfigCommand(String name) {
|
||||
+ super(name + "config");
|
||||
+ this.setPermission(name + ".commands." + name + "config");
|
||||
this.setDescription("Manage config file");
|
||||
- this.setUsage("/luminolconfig");
|
||||
+ this.setUsage("/" + name + "config");
|
||||
+ }
|
||||
+
|
||||
+ public void initConfig(LuminolConfig config) {
|
||||
+ this.config = config;
|
||||
public static void initConfigs() throws IOException {
|
||||
configfiles.put("luminol", new ConfigsInstance(new File("luminol_config"), "luminol", "me.earthme.luminol.config.modules"));
|
||||
+ configfiles.put("lophine", new ConfigsInstance(new File("lophine_config"), "lophine", "fun.bm.lophine.config.modules")); // add lophine config to global config
|
||||
preLoad();
|
||||
}
|
||||
|
||||
public void wrongUse(CommandSender sender) {
|
||||
@@ -38,7 +44,7 @@ public class LuminolConfigCommand extends Command {
|
||||
result.add("reset");
|
||||
result.add("reload");
|
||||
} else if (args.length == 2 && (args[0].equals("query") || args[0].equals("set") || args[0].equals("reset"))) {
|
||||
- result.addAll(LuminolConfig.completeConfigPath(args[1]));
|
||||
+ result.addAll(config.completeConfigPath(args[1]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -59,7 +65,7 @@ public class LuminolConfigCommand extends Command {
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java
|
||||
index 531214d7ab28ece4bf84e82b39d1c9f983f0fb0c..b68fa0427bb975e91e76f73ab4cc089a424937a3 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/modules/experiment/CommandBlockExecutionConfig.java
|
||||
@@ -5,6 +5,7 @@ import me.earthme.luminol.config.IConfigModule;
|
||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
|
||||
switch (args[0]) {
|
||||
case "reload" -> {
|
||||
- LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
+ config.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
Component
|
||||
.text("Reloaded config file!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
@@ -69,8 +75,8 @@ public class LuminolConfigCommand extends Command {
|
||||
if (args.length == 2 || args.length > 3) {
|
||||
wrongUse(sender);
|
||||
return true;
|
||||
- } else if (LuminolConfig.setConfig(args[1], args[2])) {
|
||||
- LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
+ } else if (config.setConfig(args[1], args[2])) {
|
||||
+ config.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
Component
|
||||
.text("Set Config " + args[1] + " to " + args[2] + " successfully!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
@@ -88,10 +94,10 @@ public class LuminolConfigCommand extends Command {
|
||||
wrongUse(sender);
|
||||
return true;
|
||||
} else {
|
||||
- LuminolConfig.resetConfig(args[1]);
|
||||
- LuminolConfig.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
+ config.resetConfig(args[1]);
|
||||
+ config.reloadAsync().thenAccept(nullValue -> sender.sendMessage(
|
||||
Component
|
||||
- .text("Reset Config " + args[1] + " to " + LuminolConfig.getConfig(args[1]) + " successfully!")
|
||||
+ .text("Reset Config " + args[1] + " to " + config.getConfig(args[1]) + " successfully!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
));
|
||||
}
|
||||
@@ -103,7 +109,7 @@ public class LuminolConfigCommand extends Command {
|
||||
} else {
|
||||
sender.sendMessage(
|
||||
Component
|
||||
- .text("Config " + args[1] + " is " + LuminolConfig.getConfig(args[1]) + "!")
|
||||
+ .text("Config " + args[1] + " is " + config.getConfig(args[1]) + "!")
|
||||
.color(TextColor.color(0, 255, 0))
|
||||
);
|
||||
}
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/LuminolConfig.java b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
||||
index 4526eba8e9dfb605bc4672a3eaf0688a5af66049..c05aa7296cd41e21306acd0b8fbc6d6684f56d9a 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
||||
+++ b/src/main/java/me/earthme/luminol/config/LuminolConfig.java
|
||||
@@ -29,22 +29,33 @@ import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
public class CommandBlockExecutionConfig implements IConfigModule {
|
||||
+ @me.earthme.luminol.config.flags.TransformedConfig(name = "command_block_enabled", category = {"experiment", "command"}, originInstance = "lophine")
|
||||
@ConfigInfo(baseName = "enabled")
|
||||
public static boolean enabled = false;
|
||||
|
||||
public class LuminolConfig {
|
||||
- public static final Logger logger = LogManager.getLogger();
|
||||
- private static final File baseConfigFolder = new File("luminol_config");
|
||||
- private static final File baseConfigFile = new File(baseConfigFolder, "luminol_global_config.toml");
|
||||
- private static final Set<IConfigModule> allInstanced = new HashSet<>();
|
||||
- private static final Map<String, Object> stagedConfigMap = new HashMap<>();
|
||||
- private static final Map<String, Object> defaultvalueMap = new HashMap<>();
|
||||
- public static boolean alreadyInit = false;
|
||||
- private static CommentedFileConfig configFileInstance;
|
||||
-
|
||||
- public static void setupLatch() {
|
||||
- Bukkit.getCommandMap().register("luminolconfig", "luminol", new LuminolConfigCommand());
|
||||
+ public final Logger logger = LogManager.getLogger();
|
||||
+ private final File baseConfigFolder;
|
||||
+ private final File baseConfigFile;
|
||||
+ private final String name;
|
||||
+ private final String pack;
|
||||
+ private final Set<IConfigModule> allInstanced = new HashSet<>();
|
||||
+ private final Map<String, Object> stagedConfigMap = new HashMap<>();
|
||||
+ private final Map<String, Object> defaultvalueMap = new HashMap<>();
|
||||
+ public boolean alreadyInit = false;
|
||||
+ private CommentedFileConfig configFileInstance;
|
||||
+
|
||||
+ public LuminolConfig(@NotNull File base, @NotNull String name, @NotNull String pack) {
|
||||
+ this.baseConfigFolder = base;
|
||||
+ this.name = name;
|
||||
+ this.pack = pack;
|
||||
+ this.baseConfigFile = new File(base, name + "_global_config.toml");
|
||||
+ }
|
||||
+
|
||||
+ public void setupLatch() {
|
||||
+ LuminolConfigCommand command = new LuminolConfigCommand(name);
|
||||
+ Bukkit.getCommandMap().register(name + "config", name, command);
|
||||
+ command.initConfig(this);
|
||||
alreadyInit = true;
|
||||
}
|
||||
|
||||
- public static void reload() {
|
||||
- RegionizedServer.ensureGlobalTickThread("Reload luminol config off global region thread!");
|
||||
+ public void reload() {
|
||||
+ RegionizedServer.ensureGlobalTickThread("Reload " + name + " config off global region thread!");
|
||||
|
||||
dropAllInstanced();
|
||||
try {
|
||||
@@ -56,8 +67,8 @@ public class LuminolConfig {
|
||||
}
|
||||
|
||||
@Contract(" -> new")
|
||||
- public static @NotNull CompletableFuture<Void> reloadAsync() {
|
||||
- return CompletableFuture.runAsync(LuminolConfig::reload, task -> RegionizedServer.getInstance().addTask(() -> {
|
||||
+ public @NotNull CompletableFuture<Void> reloadAsync() {
|
||||
+ return CompletableFuture.runAsync(this::reload, task -> RegionizedServer.getInstance().addTask(() -> {
|
||||
try {
|
||||
task.run();
|
||||
} catch (Exception e) {
|
||||
@@ -66,17 +77,17 @@ public class LuminolConfig {
|
||||
}));
|
||||
}
|
||||
|
||||
- public static void dropAllInstanced() {
|
||||
+ public void dropAllInstanced() {
|
||||
allInstanced.clear();
|
||||
}
|
||||
|
||||
- public static void finalizeLoadConfig() {
|
||||
+ public void finalizeLoadConfig() {
|
||||
for (IConfigModule module : allInstanced) {
|
||||
module.onLoaded(configFileInstance);
|
||||
}
|
||||
}
|
||||
|
||||
- public static void preLoadConfig() throws IOException {
|
||||
+ public void preLoadConfig() throws IOException {
|
||||
baseConfigFolder.mkdirs();
|
||||
|
||||
if (!baseConfigFile.exists()) {
|
||||
@@ -98,21 +109,21 @@ public class LuminolConfig {
|
||||
saveConfigs();
|
||||
}
|
||||
|
||||
- private static void loadAllModules() throws IllegalAccessException {
|
||||
+ private void loadAllModules() throws IllegalAccessException {
|
||||
for (IConfigModule instanced : allInstanced) {
|
||||
loadForSingle(instanced);
|
||||
}
|
||||
}
|
||||
|
||||
- private static void instanceAllModule() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
|
||||
- for (Class<?> clazz : getClasses("me.earthme.luminol.config.modules")) {
|
||||
+ private void instanceAllModule() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
|
||||
+ for (Class<?> clazz : getClasses(pack)) {
|
||||
if (IConfigModule.class.isAssignableFrom(clazz)) {
|
||||
allInstanced.add((IConfigModule) clazz.getConstructor().newInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- private static void loadForSingle(@NotNull IConfigModule singleConfigModule) throws IllegalAccessException {
|
||||
+ private void loadForSingle(@NotNull IConfigModule singleConfigModule) throws IllegalAccessException {
|
||||
final EnumConfigCategory category = singleConfigModule.getCategory();
|
||||
|
||||
Field[] fields = singleConfigModule.getClass().getDeclaredFields();
|
||||
@@ -203,7 +214,7 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- public static void removeConfig(String name, String[] keys) {
|
||||
+ public void removeConfig(String name, String[] keys) {
|
||||
configFileInstance.remove(name);
|
||||
Object configAtPath = configFileInstance.get(String.join(".", keys));
|
||||
if (configAtPath instanceof UnmodifiableConfig && ((UnmodifiableConfig) configAtPath).isEmpty()) {
|
||||
@@ -211,7 +222,7 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- public static void removeConfig(String[] keys) {
|
||||
+ public void removeConfig(String[] keys) {
|
||||
configFileInstance.remove(String.join(".", keys));
|
||||
Object configAtPath = configFileInstance.get(String.join(".", Arrays.copyOfRange(keys, 1, keys.length)));
|
||||
if (configAtPath instanceof UnmodifiableConfig && ((UnmodifiableConfig) configAtPath).isEmpty()) {
|
||||
@@ -219,11 +230,11 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- public static boolean setConfig(String[] keys, Object value) {
|
||||
+ public boolean setConfig(String[] keys, Object value) {
|
||||
return setConfig(String.join(".", keys), value);
|
||||
}
|
||||
|
||||
- public static boolean setConfig(String key, Object value) {
|
||||
+ public boolean setConfig(String key, Object value) {
|
||||
if (configFileInstance.contains(key) && configFileInstance.get(key) != null) {
|
||||
stagedConfigMap.put(key, value);
|
||||
return true;
|
||||
@@ -231,7 +242,7 @@ public class LuminolConfig {
|
||||
return false;
|
||||
}
|
||||
|
||||
- private static Object tryTransform(Class<?> targetType, Object value) {
|
||||
+ private Object tryTransform(Class<?> targetType, Object value) {
|
||||
if (!targetType.isAssignableFrom(value.getClass())) {
|
||||
try {
|
||||
if (targetType == Integer.class) {
|
||||
@@ -255,27 +266,27 @@ public class LuminolConfig {
|
||||
return value;
|
||||
}
|
||||
|
||||
- public static void saveConfigs() {
|
||||
+ public void saveConfigs() {
|
||||
configFileInstance.save();
|
||||
}
|
||||
|
||||
- public static void resetConfig(String[] keys) {
|
||||
+ public void resetConfig(String[] keys) {
|
||||
resetConfig(String.join(".", keys));
|
||||
}
|
||||
|
||||
- public static void resetConfig(String key) {
|
||||
+ public void resetConfig(String key) {
|
||||
stagedConfigMap.put(key, null);
|
||||
}
|
||||
|
||||
- public static String getConfig(String[] keys) {
|
||||
+ public String getConfig(String[] keys) {
|
||||
return getConfig(String.join(".", keys));
|
||||
}
|
||||
|
||||
- public static String getConfig(String key) {
|
||||
+ public String getConfig(String key) {
|
||||
return configFileInstance.get(key).toString();
|
||||
}
|
||||
|
||||
- public static List<String> completeConfigPath(String partialPath) {
|
||||
+ public List<String> completeConfigPath(String partialPath) {
|
||||
List<String> allPaths = getAllConfigPaths(partialPath);
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
@@ -295,13 +306,13 @@ public class LuminolConfig {
|
||||
return result;
|
||||
}
|
||||
|
||||
- private static List<String> getAllConfigPaths(String currentPath) {
|
||||
+ private List<String> getAllConfigPaths(String currentPath) {
|
||||
return defaultvalueMap.keySet().stream()
|
||||
.filter(k -> k.startsWith(currentPath))
|
||||
.toList();
|
||||
}
|
||||
|
||||
- public static @NotNull Set<Class<?>> getClasses(String pack) {
|
||||
+ public @NotNull Set<Class<?>> getClasses(String pack) {
|
||||
Set<Class<?>> classes = new LinkedHashSet<>();
|
||||
String packageDirName = pack.replace('.', '/');
|
||||
Enumeration<URL> dirs;
|
||||
@@ -332,7 +343,7 @@ public class LuminolConfig {
|
||||
return classes;
|
||||
}
|
||||
|
||||
- private static void findClassesInPackageByFile(String packageName, String packagePath, Set<Class<?>> classes) {
|
||||
+ private void findClassesInPackageByFile(String packageName, String packagePath, Set<Class<?>> classes) {
|
||||
File dir = new File(packagePath);
|
||||
|
||||
if (!dir.exists() || !dir.isDirectory()) {
|
||||
@@ -356,7 +367,7 @@ public class LuminolConfig {
|
||||
}
|
||||
}
|
||||
|
||||
- private static void findClassesInPackageByJar(String packageName, Enumeration<JarEntry> entries, String packageDirName, Set<Class<?>> classes) {
|
||||
+ private void findClassesInPackageByJar(String packageName, Enumeration<JarEntry> entries, String packageDirName, Set<Class<?>> classes) {
|
||||
while (entries.hasMoreElements()) {
|
||||
JarEntry entry = entries.nextElement();
|
||||
String name = entry.getName();
|
||||
diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||
index ded1f0667327a70a923ebda55c41b1c9094d3e37..57ddc0832b919b115b85c81ac30f136e32f1e77e 100644
|
||||
--- a/src/main/java/me/earthme/luminol/config/modules/misc/ServerModNameConfig.java
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 8 Jun 2025 00:58:12 +0800
|
||||
Subject: [PATCH] Rebrand to Lophine
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||
index fcf599846a38beeb8f094d5376c01d5a690f7a2f..48ef71f32b9aa385a8caecafcc8442f932ef8470 100644
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -108,7 +108,7 @@ public class Main {
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
- me.earthme.luminol.config.LuminolConfig.preLoadConfig(); // Luminol - Luminol config
|
||||
+ fun.bm.lophine.config.LophineConfig.initConfigs(); // Lophine - Lophine config
|
||||
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
||||
Bootstrap.bootStrap();
|
||||
Bootstrap.validate();
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 5290b9cb524160717fb40704fb10fc0d0a37941b..1b60378cdbf5bc88f996010a61cceec7c2b9e2dc 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -171,8 +171,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
- me.earthme.luminol.config.LuminolConfig.finalizeLoadConfig(); //Luminol - load config file
|
||||
- me.earthme.luminol.config.LuminolConfig.setupLatch(); //Luminol - load config file
|
||||
+ fun.bm.lophine.config.LophineConfig.loadConfigFiles(); //Luminol - load config file // Lophine - load config file
|
||||
if (false) this.server.spark.enableEarlyIfRequested(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
if (this.convertOldUsers()) {
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrHua269 <wangxyper@163.com>
|
||||
Date: Sun, 12 Jan 2025 10:36:31 +0800
|
||||
Subject: [PATCH] Add config for command block command execution
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/BaseCommandBlock.java b/net/minecraft/world/level/BaseCommandBlock.java
|
||||
index 91e30f9c83259abc0589f4ee69c429cd4305d6ea..e1cc5576017358849e7c536accd14d2e6eb5c706 100644
|
||||
--- a/net/minecraft/world/level/BaseCommandBlock.java
|
||||
+++ b/net/minecraft/world/level/BaseCommandBlock.java
|
||||
@@ -102,7 +102,7 @@ public abstract class BaseCommandBlock implements CommandSource {
|
||||
}
|
||||
|
||||
public boolean performCommand(Level level) {
|
||||
- if (true) return false; // Folia - region threading
|
||||
+ if (!fun.bm.lophine.config.modules.experiment.CommandConfig.block) return false; // Folia - region threading // Luminol
|
||||
if (level.isClientSide || level.getGameTime() == this.lastExecution) {
|
||||
return false;
|
||||
} else if ("Searge".equalsIgnoreCase(this.command)) {
|
||||
+10
-10
@@ -5,7 +5,7 @@ Subject: [PATCH] Add config to enable tick command
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
index 8e91ec81128bdbd5f78e1f04fe17bcbd6e5dc280..acdc5dbc34071dc4342f17fab0d483d775c9044d 100644
|
||||
index e1842ab8f20271a8b20ab8462b09a4745a612a9a..8405157ec35a443e238fa6866772c839621d73d7 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
@@ -299,6 +299,11 @@ public final class RegionizedServer {
|
||||
@@ -18,9 +18,9 @@ index 8e91ec81128bdbd5f78e1f04fe17bcbd6e5dc280..acdc5dbc34071dc4342f17fab0d483d7
|
||||
+ }
|
||||
+ // Luminol end - Add a config to enable tick command
|
||||
// expire invalid click command callbacks
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue((int)this.tickCount);
|
||||
|
||||
@@ -321,6 +326,13 @@ public final class RegionizedServer {
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.ADVENTURE_CLICK_MANAGER.handleQueue((int)this.tickCount); // Paper // Folia - region threading - moved to global tick
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.DIALOG_CLICK_MANAGER.handleQueue((int)this.tickCount); // Paper // Folia - region threading - moved to global tick
|
||||
@@ -322,6 +327,13 @@ public final class RegionizedServer {
|
||||
this.globalTick(world, tickCount);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ index 8e91ec81128bdbd5f78e1f04fe17bcbd6e5dc280..acdc5dbc34071dc4342f17fab0d483d7
|
||||
// tick connections
|
||||
this.tickConnections();
|
||||
|
||||
@@ -454,7 +466,7 @@ public final class RegionizedServer {
|
||||
@@ -455,7 +467,7 @@ public final class RegionizedServer {
|
||||
}
|
||||
|
||||
private void tickTime(final ServerLevel world, final int tickCount) {
|
||||
@@ -97,10 +97,10 @@ index 0357792de0ed8ec9058d1847c8b45c33ff365af6..4945c11f573a53df2f5be4beb7af6a3f
|
||||
this.scheduler.regionFailed(this, false, thr);
|
||||
// regionFailed will schedule a shutdown, so we should avoid letting this region tick further
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index ea50e3c0c4044f03dc8257680814f808fbf3a177..63154426854c507738d646490ac76f531145fab2 100644
|
||||
index 8a90aa5c145f53afbb3f2371f97cb09974f30bbb..0d5ed9602492c8393088954105e9a19032067b8b 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -214,7 +214,11 @@ public class Commands {
|
||||
@@ -243,7 +243,11 @@ public class Commands {
|
||||
TeleportCommand.register(this.dispatcher);
|
||||
TellRawCommand.register(this.dispatcher, context);
|
||||
//TestCommand.register(this.dispatcher, context); // Folia - region threading
|
||||
@@ -114,10 +114,10 @@ index ea50e3c0c4044f03dc8257680814f808fbf3a177..63154426854c507738d646490ac76f53
|
||||
TitleCommand.register(this.dispatcher, context);
|
||||
//TriggerCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 33d596c0f07d076886c0dd8eb93e901cdb56e438..87625b365e04ce05fa2b6cdf2003c839255c4393 100644
|
||||
index 2ed2f4cca3a81117c0beaf7a11bbbe8156f6a9ce..6675b83c9f15d0341dcf169ec3ac20f401c5d10b 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -266,7 +266,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -267,7 +267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
private String serverId;
|
||||
public MinecraftServer.ReloadableResources resources;
|
||||
private final StructureTemplateManager structureTemplateManager;
|
||||
@@ -153,7 +153,7 @@ index 40338efd1c0e56d869d03f1d0687e7ff0fcbf11a..d0d90a25a10bbecfffceee1992af88c6
|
||||
this.sprintTimeSpend = this.sprintTimeSpend + (System.nanoTime() - this.sprintTickStartTime);
|
||||
}
|
||||
diff --git a/net/minecraft/server/commands/TickCommand.java b/net/minecraft/server/commands/TickCommand.java
|
||||
index 6b6c8ce49eda6806c8288d70848dd143ba2c4703..5d09d2c8bb45cc10b2a13100793249adc7b5a7e9 100644
|
||||
index 126685fb266692082b432ed297a499149e921dfb..9d8f6025c420e651611da17e77a362c738228b72 100644
|
||||
--- a/net/minecraft/server/commands/TickCommand.java
|
||||
+++ b/net/minecraft/server/commands/TickCommand.java
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.server.ServerTickRateManager;
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Wed, 2 Jul 2025 23:36:25 +0800
|
||||
Subject: [PATCH] Add config to enable datapack command
|
||||
|
||||
|
||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||
index 0d5ed9602492c8393088954105e9a19032067b8b..e2fc15d84fafde6847ecead23c55169449275e1b 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -192,7 +192,9 @@ public class Commands {
|
||||
if(me.earthme.luminol.config.modules.experiment.CommandDataConfig.enabled) {
|
||||
DataCommands.register(this.dispatcher); // Folia - region threading - TODO
|
||||
}
|
||||
- //DataPackCommand.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||
+ if (fun.bm.lophine.config.modules.experiment.CommandConfig.datapack) {
|
||||
+ DataPackCommand.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||
+ }
|
||||
//DebugCommand.register(this.dispatcher); // Folia - region threading - TODO
|
||||
DefaultGameModeCommands.register(this.dispatcher);
|
||||
//DialogCommand.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 6675b83c9f15d0341dcf169ec3ac20f401c5d10b..e8c9e739de35313c0212bab97a202fa362fd0887 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2349,6 +2349,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return this.reloadResources(selectedIds, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN);
|
||||
}
|
||||
|
||||
+ // Lophine start - region thread skip reload // TODO - add reload support
|
||||
+ public void saveDatapacks(Collection<String> selectedIds) {
|
||||
+ this.packRepository.setSelected(selectedIds, false); // Paper - add pendingReload flag to determine required pack loading - false as this is *after* a reload (see above)
|
||||
+ WorldDataConfiguration worldDataConfiguration = new WorldDataConfiguration(
|
||||
+ getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures()
|
||||
+ );
|
||||
+ this.worldData.setDataConfiguration(worldDataConfiguration);
|
||||
+ }
|
||||
+ // Lophine end - region thread skip reload // TODO - add reload support
|
||||
+
|
||||
public CompletableFuture<Void> reloadResources(Collection<String> selectedIds, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause cause) {
|
||||
// Paper end - Add ServerResourcesReloadedEvent
|
||||
CompletableFuture<Void> completableFuture = CompletableFuture.<ImmutableList>supplyAsync(
|
||||
diff --git a/net/minecraft/server/commands/ReloadCommand.java b/net/minecraft/server/commands/ReloadCommand.java
|
||||
index b540a3c3a02f7242578a63477e34b9063e86f1d2..9f0adf157872e1c68cd7752a24eacdc636e8d17a 100644
|
||||
--- a/net/minecraft/server/commands/ReloadCommand.java
|
||||
+++ b/net/minecraft/server/commands/ReloadCommand.java
|
||||
@@ -16,6 +16,12 @@ public class ReloadCommand {
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public static void reloadPacks(Collection<String> selectedIds, CommandSourceStack source) {
|
||||
+ // Lophine start - region thread skip reload // TODO - add reload support
|
||||
+ if (true) {
|
||||
+ source.getServer().saveDatapacks(selectedIds);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Lophine end - region thread skip reload // TODO - add reload support
|
||||
source.getServer().reloadResources(selectedIds, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.COMMAND).exceptionally(throwable -> { // Paper - Add ServerResourcesReloadedEvent
|
||||
LOGGER.warn("Failed to execute reload", throwable);
|
||||
source.sendFailure(Component.translatable("commands.reload.failure"));
|
||||
+7
-4
@@ -3,6 +3,9 @@ From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Fri, 11 Apr 2025 16:53:57 +0800
|
||||
Subject: [PATCH] Add config to revert raid changes
|
||||
|
||||
Co-authored by: huanli233 <392352840@qq.com>
|
||||
Some of changes is a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/b5793e809b6346e16b7ea218496806a312562e27/leaves-server/minecraft-patches/features/0106-Revert-raid-changes.patch)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java
|
||||
index 80f17f33f670018240c854df589cf90cdeab6e70..985f27d249810bf133a520d937b7006e57f553ec 100644
|
||||
@@ -21,7 +24,7 @@ index 80f17f33f670018240c854df589cf90cdeab6e70..985f27d249810bf133a520d937b7006e
|
||||
if (raidAt == null || raidAt.getRaidOmenLevel() < raidAt.getMaxRaidOmenLevel()) {
|
||||
serverPlayer.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplifier));
|
||||
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
|
||||
index dbb207c638a64b733dc21704033ff55ca1f44f1d..bcafacb6fce19212e99a3f04e0356b34304d92f1 100644
|
||||
index 1910bff3f08147bfd63703097e30b9f88c84e337..26f4d7359f638a11ea2d768d18091e261d6b1791 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -340,7 +340,20 @@ public class Raid {
|
||||
@@ -126,10 +129,10 @@ index dbb207c638a64b733dc21704033ff55ca1f44f1d..bcafacb6fce19212e99a3f04e0356b34
|
||||
// Folia start - make raids thread-safe
|
||||
if (!this.ownsRaid(level)) {
|
||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||
index f6f36c15120da6c57c0cbea3743a0819252cb6cc..3ab6288dc1903da0aaf93ed8b5d9848e4fe663f1 100644
|
||||
index 3e30989c99cd11c8c94d6fd194d2969e3a7efda6..510514e363f4816a6e286fb9b5488153e03c9e55 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -127,6 +127,41 @@ public abstract class Raider extends PatrollingMonster {
|
||||
@@ -128,6 +128,41 @@ public abstract class Raider extends PatrollingMonster {
|
||||
|
||||
currentRaid.removeFromRaid(serverLevel, this, false);
|
||||
}
|
||||
@@ -171,7 +174,7 @@ index f6f36c15120da6c57c0cbea3743a0819252cb6cc..3ab6288dc1903da0aaf93ed8b5d9848e
|
||||
}
|
||||
|
||||
super.die(cause);
|
||||
@@ -155,7 +190,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
@@ -156,7 +191,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
}
|
||||
|
||||
public boolean hasRaid() {
|
||||
+11
-11
@@ -5,10 +5,10 @@ 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 c3201cb0ba6f928f658d4c74a1ef2b7e8900b1f6..a4eeb75eeb1cd69c60cd1c273f23f9744837148f 100644
|
||||
index 06e41bca6b964ca71ea7bca547b03cdb3610ba31..b7bc75648634aefc549a69631ab6e401eb902e7d 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1330,6 +1330,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1341,6 +1341,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.awardStat(Stats.ENTITY_KILLED_BY.get(killCredit.getType()));
|
||||
killCredit.awardKillScore(this, cause);
|
||||
this.createWitherRose(killCredit);
|
||||
@@ -22,7 +22,7 @@ index c3201cb0ba6f928f658d4c74a1ef2b7e8900b1f6..a4eeb75eeb1cd69c60cd1c273f23f974
|
||||
}
|
||||
|
||||
this.level().broadcastEntityEvent(this, (byte)3);
|
||||
@@ -1353,6 +1360,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1364,6 +1371,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
}
|
||||
// Leaves end - exp fix
|
||||
|
||||
@@ -48,10 +48,10 @@ index c3201cb0ba6f928f658d4c74a1ef2b7e8900b1f6..a4eeb75eeb1cd69c60cd1c273f23f974
|
||||
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 5b5e63c4dc10076ba33a8ddf0ebae96643b1161f..f5a1b2711a4eb910decb26b26c57ebfa7cedb231 100644
|
||||
index d55a6989fd68f0bcf7bd05e9420fda1115afa6c0..5369a6597e48ed9f0d8f7f0b9685ce4950df4fe5 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1191,6 +1191,29 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1216,6 +1216,29 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ index 5b5e63c4dc10076ba33a8ddf0ebae96643b1161f..f5a1b2711a4eb910decb26b26c57ebfa
|
||||
public boolean canBeAffected(MobEffectInstance effectInstance) {
|
||||
if (this.getType().is(EntityTypeTags.IMMUNE_TO_INFESTED)) {
|
||||
return !effectInstance.is(MobEffects.INFESTED);
|
||||
@@ -1916,6 +1939,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1948,6 +1971,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
final LivingEntity killer = this.getKillCredit();
|
||||
if (killer != null) {
|
||||
killer.awardKillScore(this, damageSource);
|
||||
@@ -95,7 +95,7 @@ index 5b5e63c4dc10076ba33a8ddf0ebae96643b1161f..f5a1b2711a4eb910decb26b26c57ebfa
|
||||
}
|
||||
}); // Paper end
|
||||
this.postDeathDropItems(deathEvent); // Paper
|
||||
@@ -1926,6 +1956,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1958,6 +1988,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
return deathEvent; // Paper
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ index 5b5e63c4dc10076ba33a8ddf0ebae96643b1161f..f5a1b2711a4eb910decb26b26c57ebfa
|
||||
protected void dropEquipment(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
|
||||
@@ -2524,6 +2566,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2556,6 +2598,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,16 +134,16 @@ index 5b5e63c4dc10076ba33a8ddf0ebae96643b1161f..f5a1b2711a4eb910decb26b26c57ebfa
|
||||
return (float)this.getAttributeValue(Attributes.MAX_HEALTH);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
|
||||
index 3ab6288dc1903da0aaf93ed8b5d9848e4fe663f1..61eab8abd59914a7bf613393059ec039bab1b8ee 100644
|
||||
index 510514e363f4816a6e286fb9b5488153e03c9e55..4638af10539a316acae64fb26881c8e699c496e0 100644
|
||||
--- a/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -156,7 +156,13 @@ public abstract class Raider extends PatrollingMonster {
|
||||
@@ -157,7 +157,13 @@ public abstract class Raider extends PatrollingMonster {
|
||||
net.minecraft.world.effect.MobEffectInstance mobeffect1 = new net.minecraft.world.effect.MobEffectInstance(net.minecraft.world.effect.MobEffects.BAD_OMEN, fun.bm.lophine.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, i, false, false, true);
|
||||
|
||||
if (!serverLevel.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_DISABLE_RAIDS)) {
|
||||
- entityhuman.addEffect(mobeffect1, entityhuman, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true); // CraftBukkit
|
||||
+ // Luminol start - Raid changes adapt DamageSource trace
|
||||
+ if (fun.bm.lophine.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
||||
+ // Luminol start - Raid changes adapt DamageSource trace
|
||||
+ entityhuman.addEffect(mobeffect1, entityhuman, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true, true);
|
||||
+ } else {
|
||||
+ entityhuman.addEffect(mobeffect1, entityhuman, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true); // CraftBukkit
|
||||
+13
-13
@@ -5,7 +5,7 @@ Subject: [PATCH] Add config to enable Raytracing tracker
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
||||
index ee53f78396f4377d3e5c2998826f231208066ef6..607091ecbd4a7261f2c0d839ee4dd1d27fa2190a 100644
|
||||
index 6868b915bf3deb85783a638d4441a15fea6da2dc..70740381c6501c1a518c52b24381edd16792507f 100644
|
||||
--- a/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1278,7 +1278,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -18,19 +18,19 @@ index ee53f78396f4377d3e5c2998826f231208066ef6..607091ecbd4a7261f2c0d839ee4dd1d2
|
||||
double rangeY = level.paperConfig().entities.trackingRangeY.get(this.entity, -1);
|
||||
if (rangeY != -1) {
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index a023cc399fc8bfee7771e5ca6716578f89b7072f..88ce4001a2fa764a4dc41ca0132ad067d40d3d03 100644
|
||||
index dc3d29b7d1590ba366755fef51e4254d901d0da8..34b1597c56046f8fc5ab5fe9d8a5d3c96a4bc134 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -140,7 +140,7 @@ import net.minecraft.world.scores.ScoreHolder;
|
||||
import net.minecraft.world.scores.Team;
|
||||
@@ -147,7 +147,7 @@ import net.minecraft.world.waypoints.WaypointTransmitter;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
-public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||
+public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity, dev.tr7zw.entityculling.versionless.access.Cullable { // Paper - rewrite chunk system // Paper - optimise entity tracker // Luminol - Ray tracing entity tracker
|
||||
// CraftBukkit start
|
||||
private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger();
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
@@ -6106,4 +6106,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public boolean preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; keep initial motion on first snapTo
|
||||
@@ -6352,4 +6352,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// Paper end - Expose entity id counter
|
||||
|
||||
public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
|
||||
@@ -78,10 +78,10 @@ index a023cc399fc8bfee7771e5ca6716578f89b7072f..88ce4001a2fa764a4dc41ca0132ad067
|
||||
+
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
|
||||
index 6b72ab233508e6df1eca34360ce76d102ee25a41..f39ee4605cc15102d6560afd1dad5f56dd53cf4e 100644
|
||||
index 6f00ffa05d9597917574357e0069c9b056aa5ce2..5cc7a91e32f17d8d9585ae4844a4ed3b706e3273 100644
|
||||
--- a/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/net/minecraft/world/entity/EntityType.java
|
||||
@@ -1109,6 +1109,9 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
@@ -1119,6 +1119,9 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
public final int passengerTickTimerId;
|
||||
public final int passengerInactiveTickTimerId;
|
||||
// Folia end - profiler
|
||||
@@ -92,10 +92,10 @@ index 6b72ab233508e6df1eca34360ce76d102ee25a41..f39ee4605cc15102d6560afd1dad5f56
|
||||
public EntityType(
|
||||
EntityType.EntityFactory<T> factory,
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index 543750bee43bfaaaf33f2cec53eb0de05e7a1dd2..a26ec6f1a1553bf0b415f382177c75f481e21180 100644
|
||||
index 2842314c712449625e9275aff7707c916c3ea767..09b549fa9568aa1ae13b1b975db14a6268fdaa46 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -220,6 +220,25 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -229,6 +229,25 @@ public abstract class Player extends LivingEntity {
|
||||
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -119,9 +119,9 @@ index 543750bee43bfaaaf33f2cec53eb0de05e7a1dd2..a26ec6f1a1553bf0b415f382177c75f4
|
||||
+ }
|
||||
+ // Luminol end
|
||||
|
||||
public Player(Level level, BlockPos pos, float yRot, GameProfile gameProfile) {
|
||||
public Player(Level level, GameProfile gameProfile) {
|
||||
super(EntityType.PLAYER, level);
|
||||
@@ -277,6 +296,26 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -287,6 +306,26 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -148,7 +148,7 @@ index 543750bee43bfaaaf33f2cec53eb0de05e7a1dd2..a26ec6f1a1553bf0b415f382177c75f4
|
||||
this.noPhysics = this.isSpectator();
|
||||
if (this.isSpectator() || this.isPassenger()) {
|
||||
this.setOnGround(false);
|
||||
@@ -1415,6 +1454,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1426,6 +1465,7 @@ public abstract class Player extends LivingEntity {
|
||||
if (this.containerMenu != null && this.hasContainerOpen()) {
|
||||
this.doCloseContainer();
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 7 Jul 2025 16:30:54 +0800
|
||||
Subject: [PATCH] Add config to allow infinite trade
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/item/trading/Merchant.java b/net/minecraft/world/item/trading/Merchant.java
|
||||
index 6e2fa442ddcd4ef3c4fe789b9ebac9dd409c9de7..a876335e26daec9a9a3a2f00ee5cb23cfd913aa6 100644
|
||||
--- a/net/minecraft/world/item/trading/Merchant.java
|
||||
+++ b/net/minecraft/world/item/trading/Merchant.java
|
||||
@@ -42,7 +42,14 @@ public interface Merchant {
|
||||
new SimpleMenuProvider((containerId, inventory, player1) -> new MerchantMenu(containerId, inventory, this), displayName)
|
||||
);
|
||||
if (optionalInt.isPresent()) {
|
||||
- MerchantOffers offers = this.getOffers();
|
||||
+ // Lophine start - infinite trade
|
||||
+ MerchantOffers offers = this.getOffers().copy();
|
||||
+ if (fun.bm.lophine.config.modules.misc.VillagerConfig.villagerInfiniteTrade) {
|
||||
+ for (MerchantOffer merchantOffer : offers) {
|
||||
+ merchantOffer.maxUses = 16384;
|
||||
+ }
|
||||
+ }
|
||||
+ // Lophine end - infinite trade
|
||||
if (!offers.isEmpty()) {
|
||||
player.sendMerchantOffers(optionalInt.getAsInt(), offers, level, this.getVillagerXp(), this.showProgressBar(), this.canRestock());
|
||||
}
|
||||
diff --git a/net/minecraft/world/item/trading/MerchantOffer.java b/net/minecraft/world/item/trading/MerchantOffer.java
|
||||
index 64c99df8ff305fa28c75dc03fc5ef8c61634ad84..21ec77d5167cfdf05043ea474165148fb2b0c2d9 100644
|
||||
--- a/net/minecraft/world/item/trading/MerchantOffer.java
|
||||
+++ b/net/minecraft/world/item/trading/MerchantOffer.java
|
||||
@@ -196,7 +196,7 @@ public class MerchantOffer {
|
||||
}
|
||||
|
||||
public boolean isOutOfStock() {
|
||||
- return this.uses >= this.maxUses;
|
||||
+ return (this.uses >= this.maxUses && !fun.bm.lophine.config.modules.misc.VillagerConfig.villagerInfiniteTrade); // Lophine - infinite trade
|
||||
}
|
||||
|
||||
public void setToOutOfStock() {
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 7 Jul 2025 18:19:00 +0800
|
||||
Subject: [PATCH] Add config to enable unsafe waypoint bar
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/waypoints/ServerWaypointManager.java b/net/minecraft/server/waypoints/ServerWaypointManager.java
|
||||
index 0f8cacbb8fe55a60e2f0c98bf36c005b29f41a4b..36e9b027ce5213f8914728293633e78e9905c1b2 100644
|
||||
--- a/net/minecraft/server/waypoints/ServerWaypointManager.java
|
||||
+++ b/net/minecraft/server/waypoints/ServerWaypointManager.java
|
||||
@@ -22,7 +22,14 @@ public class ServerWaypointManager implements WaypointManager<WaypointTransmitte
|
||||
|
||||
@Override
|
||||
public void trackWaypoint(WaypointTransmitter waypoint) {
|
||||
- // Folia - region threading
|
||||
+ // Lophine start - unsafe waypoint bar
|
||||
+ if (!fun.bm.lophine.config.modules.experiment.WaypointConfig.forceEnableWaypointUnsafe) return;
|
||||
+ this.waypoints.add(waypoint);
|
||||
+
|
||||
+ for (ServerPlayer serverPlayer : this.players) {
|
||||
+ this.createConnection(serverPlayer, waypoint);
|
||||
+ }
|
||||
+ // Lophine end - unsafe waypoint bar
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,14 +57,48 @@ public class ServerWaypointManager implements WaypointManager<WaypointTransmitte
|
||||
|
||||
public void addPlayer(ServerPlayer player) {
|
||||
// Folia - region threading
|
||||
+ // Lophine start - unsafe waypoint bar
|
||||
+ if (!fun.bm.lophine.config.modules.experiment.WaypointConfig.forceEnableWaypointUnsafe) return;
|
||||
+ this.players.add(player);
|
||||
+
|
||||
+ for (WaypointTransmitter waypointTransmitter : this.waypoints) {
|
||||
+ this.createConnection(player, waypointTransmitter);
|
||||
+ }
|
||||
+
|
||||
+ if (player.isTransmittingWaypoint()) {
|
||||
+ this.trackWaypoint((WaypointTransmitter)player);
|
||||
+ }
|
||||
+ // Lophine end - unsafe waypoint bar
|
||||
}
|
||||
|
||||
public void updatePlayer(ServerPlayer player) {
|
||||
// Folia - region threading
|
||||
+ // Lophine start - unsafe waypoint bar
|
||||
+ if (!fun.bm.lophine.config.modules.experiment.WaypointConfig.forceEnableWaypointUnsafe) return;
|
||||
+ Map<WaypointTransmitter, WaypointTransmitter.Connection> map = this.connections.row(player);
|
||||
+ SetView<WaypointTransmitter> set = Sets.difference(this.waypoints, map.keySet());
|
||||
+
|
||||
+ for (Entry<WaypointTransmitter, WaypointTransmitter.Connection> entry : ImmutableSet.copyOf(map.entrySet())) {
|
||||
+ this.updateConnection(player, entry.getKey(), entry.getValue());
|
||||
+ }
|
||||
+
|
||||
+ for (WaypointTransmitter waypointTransmitter : set) {
|
||||
+ this.createConnection(player, waypointTransmitter);
|
||||
+ }
|
||||
+ // Lophine end - unsafe waypoint bar
|
||||
}
|
||||
|
||||
public void removePlayer(ServerPlayer player) {
|
||||
// Folia - region threading
|
||||
+ // Lophine start - unsafe waypoint bar
|
||||
+ if (!fun.bm.lophine.config.modules.experiment.WaypointConfig.forceEnableWaypointUnsafe) return;
|
||||
+ this.connections.row(player).values().removeIf(connection -> {
|
||||
+ connection.disconnect();
|
||||
+ return true;
|
||||
+ });
|
||||
+ this.untrackWaypoint((WaypointTransmitter)player);
|
||||
+ this.players.remove(player);
|
||||
+ // Lophine end - unsafe waypoint bar
|
||||
}
|
||||
|
||||
public void breakAllConnections() {
|
||||
+7
-7
@@ -8,10 +8,10 @@ As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18
|
||||
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 001483b7098523f3645a95c81fcf0e38b551705e..70be6c3ef009f1746353cc330a188bc693174ed7 100644
|
||||
index a24c332a8f9cb2ebc6f9926c6dabf1238238028d..58c2a6a3304e1bea25980b04046fe7c0017bc90d 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1116,6 +1116,10 @@ public abstract class PlayerList {
|
||||
@@ -1086,6 +1086,10 @@ public abstract class PlayerList {
|
||||
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
|
||||
this.server.getCommands().sendCommands(player);
|
||||
} // Paper - Add sendOpLevel API
|
||||
@@ -21,12 +21,12 @@ index 001483b7098523f3645a95c81fcf0e38b551705e..70be6c3ef009f1746353cc330a188bc6
|
||||
+ // Purpur end - Barrels and enderchests 6 rows
|
||||
}
|
||||
|
||||
public boolean isWhiteListed(GameProfile profile) {
|
||||
// Paper start - whitelist verify event / login event
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index a26ec6f1a1553bf0b415f382177c75f481e21180..1f7a97b0a52461108fe5a17d2ecc224b1a9f26a1 100644
|
||||
index 09b549fa9568aa1ae13b1b975db14a6268fdaa46..6c933c27ce155eb516a9ede96fb2c3bd19251bfa 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -210,6 +210,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -219,6 +219,7 @@ public abstract class Player extends LivingEntity {
|
||||
private int currentImpulseContextResetGraceTime = 0;
|
||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
||||
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
|
||||
@@ -70,7 +70,7 @@ index 0fffa384f928ab84451331380968fb4650eafe26..d84a10396395939149da88bcb01be59e
|
||||
return new ChestMenu(MenuType.GENERIC_9x6, containerId, playerInventory, container, 6);
|
||||
}
|
||||
diff --git a/net/minecraft/world/inventory/PlayerEnderChestContainer.java b/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
index bc2b95973192069fc64581b59583b19df876f55d..89a2f0286b9ab036f4412a9d657c0105382ed64f 100644
|
||||
index beb74bc8398de8b48f41af7daef14d624826310e..5dd6e89931d397b8afdb84024ed46b0d06dcf347 100644
|
||||
--- a/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
+++ b/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
||||
@@ -25,11 +25,18 @@ public class PlayerEnderChestContainer extends SimpleContainer {
|
||||
@@ -115,7 +115,7 @@ index 5077a9ff7b78801bdc53536a37aee07b8d86ee4d..fe374f08b7829b846b2a1c2ac3ca500c
|
||||
// Paper end - Fix InventoryOpenEvent cancellation - moved up;
|
||||
player.awardStat(Stats.OPEN_ENDERCHEST);
|
||||
diff --git a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
index 027502d0af5512c31878978c4d05c52fa3029cca..e05239582477157bd530222704bf43b1254c63ca 100644
|
||||
index d679ab599dfd0bdbdc3ab5530d7fcd1c38baf7fa..6b4e2956222a0ca7f72f73032dc98878fbd257ee 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
@@ -56,7 +56,17 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
@@ -1,171 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sat, 14 Jun 2025 05:32:51 +0800
|
||||
Subject: [PATCH] Better ShulkerBox
|
||||
|
||||
You can open shulker box with shift & right click
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index a4eeb75eeb1cd69c60cd1c273f23f9744837148f..5596214edb14d30c9ed5af4ffdcdd2041d135c6d 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2351,6 +2351,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.containerMenu.removed(this);
|
||||
this.inventoryMenu.transferState(this.containerMenu);
|
||||
this.containerMenu = this.inventoryMenu;
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.clearMap(this); // Lophine - better shulker box
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
|
||||
index 9020f7c83e5bd19e9a9d3748d200ce5772a9cefa..5bd913911075c0d93f4434e88c9cf7f3ac7248fc 100644
|
||||
--- a/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -299,6 +299,11 @@ public class Inventory implements Container, Nameable {
|
||||
|
||||
int i = this.getMaxStackLeaves(item) - item.getCount();
|
||||
int min = Math.min(count, i);
|
||||
+ // Lophine start - better shulker box
|
||||
+ if (fun.bm.lophine.config.modules.misc.ContainerExpansionConfig.betterShulker) {
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.inventoryCallBack(player, slot);
|
||||
+ }
|
||||
+ // Lophine end - better shulker box
|
||||
if (min == 0) {
|
||||
return count;
|
||||
} else {
|
||||
@@ -351,6 +356,11 @@ public class Inventory implements Container, Nameable {
|
||||
if (slot >= 0) {
|
||||
this.items.set(slot, stack.copyAndClear());
|
||||
this.items.get(slot).setPopTime(5);
|
||||
+ // Lophine start - better shulker box
|
||||
+ if (fun.bm.lophine.config.modules.misc.ContainerExpansionConfig.betterShulker) {
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.inventoryCallBack(player, slot);
|
||||
+ }
|
||||
+ // Lophine end - better shulker box
|
||||
return true;
|
||||
} else if (this.player.hasInfiniteMaterials()) {
|
||||
stack.setCount(0);
|
||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||
index 1f7a97b0a52461108fe5a17d2ecc224b1a9f26a1..86854467df17cc72e48360a0f19a4bbe4aaba3e8 100644
|
||||
--- a/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/net/minecraft/world/entity/player/Player.java
|
||||
@@ -595,11 +595,13 @@ public abstract class Player extends LivingEntity {
|
||||
// Paper start - special close for unloaded inventory
|
||||
public void closeUnloadedInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) {
|
||||
this.containerMenu = this.inventoryMenu;
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.clearMap(this); // Lophine - better shulker box
|
||||
}
|
||||
// Paper end - special close for unloaded inventory
|
||||
|
||||
public void closeContainer() {
|
||||
this.containerMenu = this.inventoryMenu;
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.clearMap(this); // Lophine - better shulker box
|
||||
}
|
||||
|
||||
protected void doCloseContainer() {
|
||||
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 45ff5b9a50bdec611f7c1aa4cb77fb0b13b6910c..606025e0e4bfbcc996ce5a54ccf74c74430531a1 100644
|
||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -658,6 +658,11 @@ public abstract class AbstractContainerMenu {
|
||||
}
|
||||
}
|
||||
}
|
||||
+ // Lophine start - better shulker box
|
||||
+ if (fun.bm.lophine.config.modules.misc.ContainerExpansionConfig.betterShulker) {
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.inventoryCallBack(player, slotId - 54);
|
||||
+ }
|
||||
+ // Lophine end - better shulker box
|
||||
}
|
||||
|
||||
private boolean tryItemClickBehaviourOverride(Player player, ClickAction action, Slot slot, ItemStack clickedItem, ItemStack carriedItem) {
|
||||
diff --git a/net/minecraft/world/inventory/ShulkerBoxMenu.java b/net/minecraft/world/inventory/ShulkerBoxMenu.java
|
||||
index 903025c659e6a9423224fe65973696405c69ec6a..eb20f83d5aa2c06f60c3941e8a54434737c017c4 100644
|
||||
--- a/net/minecraft/world/inventory/ShulkerBoxMenu.java
|
||||
+++ b/net/minecraft/world/inventory/ShulkerBoxMenu.java
|
||||
@@ -53,7 +53,7 @@ public class ShulkerBoxMenu extends AbstractContainerMenu {
|
||||
|
||||
@Override
|
||||
public boolean stillValid(Player player) {
|
||||
- if (!this.checkReachable) return true; // CraftBukkit
|
||||
+ if (!this.checkReachable || fun.bm.lophine.utils.ShulkerBoxesUtil.checkIfValid(player)) return true; // CraftBukkit // Lophine - better shulker box
|
||||
return this.container.stillValid(player);
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/item/Item.java b/net/minecraft/world/item/Item.java
|
||||
index c52fb17d1e496a91223b7387cacb128c1865caee..af070f075b1b6523040a4ff29ef37c730af28427 100644
|
||||
--- a/net/minecraft/world/item/Item.java
|
||||
+++ b/net/minecraft/world/item/Item.java
|
||||
@@ -187,6 +187,13 @@ public class Item implements FeatureElement, ItemLike {
|
||||
player.startUsingItem(hand);
|
||||
return InteractionResult.CONSUME;
|
||||
} else {
|
||||
+ // Lophine start - better shulker box
|
||||
+ if (fun.bm.lophine.config.modules.misc.ContainerExpansionConfig.betterShulker
|
||||
+ && player.isShiftKeyDown()
|
||||
+ && fun.bm.lophine.utils.ShulkerBoxesUtil.checkIfCanOpen(itemInHand)) {
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.openShulkerBox(player, itemInHand, hand);
|
||||
+ }
|
||||
+ // Lophine end - better shulker box
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/item/component/ItemContainerContents.java b/net/minecraft/world/item/component/ItemContainerContents.java
|
||||
index ecf794f94177fc7b6df483516d920719fbc6fa43..4fda59a4c17009a0009f3d3c13258f4ffcb300c3 100644
|
||||
--- a/net/minecraft/world/item/component/ItemContainerContents.java
|
||||
+++ b/net/minecraft/world/item/component/ItemContainerContents.java
|
||||
@@ -33,7 +33,7 @@ public final class ItemContainerContents implements TooltipProvider {
|
||||
public final NonNullList<ItemStack> items;
|
||||
private final int hashCode;
|
||||
|
||||
- private ItemContainerContents(NonNullList<ItemStack> items) {
|
||||
+ public ItemContainerContents(NonNullList<ItemStack> items) { // Lophine - better shulker box
|
||||
if (items.size() > 256) {
|
||||
throw new IllegalArgumentException("Got " + items.size() + " items, but maximum is 256");
|
||||
} else {
|
||||
diff --git a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
index 87ebdb6deb66662a38b3eec0dae27eaf859ecabb..a36080d522841c4d9b186b475aa6667d1942c0eb 100644
|
||||
--- a/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java
|
||||
@@ -46,6 +46,10 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
private ShulkerBoxBlockEntity.AnimationStatus animationStatus = ShulkerBoxBlockEntity.AnimationStatus.CLOSED;
|
||||
private float progress;
|
||||
private float progressOld;
|
||||
+ // Lophine start - better shulker box
|
||||
+ public boolean haveRealBlock = true;
|
||||
+ public int slot;
|
||||
+ // Lophine end - better shulker box
|
||||
@Nullable
|
||||
private final DyeColor color;
|
||||
|
||||
@@ -236,6 +240,15 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
return Component.translatable("container.shulkerBox");
|
||||
}
|
||||
|
||||
+ // Lophine start - better shulker box
|
||||
+ public void setItem(int index, ItemStack stack) {
|
||||
+ super.setItem(index, stack);
|
||||
+ if (fun.bm.lophine.config.modules.misc.ContainerExpansionConfig.betterShulker && !haveRealBlock) {
|
||||
+ fun.bm.lophine.utils.ShulkerBoxesUtil.shulkerBoxEntityCallBack(this);
|
||||
+ }
|
||||
+ }
|
||||
+ // Lophine end - better shulker box
|
||||
+
|
||||
@Override
|
||||
protected void loadAdditional(CompoundTag tag, HolderLookup.Provider registries) {
|
||||
super.loadAdditional(tag, registries);
|
||||
@@ -258,12 +271,12 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl
|
||||
}
|
||||
|
||||
@Override
|
||||
- protected NonNullList<ItemStack> getItems() {
|
||||
+ public NonNullList<ItemStack> getItems() { // Lophine - better shulker box
|
||||
return this.itemStacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
- protected void setItems(NonNullList<ItemStack> items) {
|
||||
+ public void setItems(NonNullList<ItemStack> items) { // Lophine - better shulker box
|
||||
this.itemStacks = items;
|
||||
}
|
||||
|
||||
+39
-39
@@ -24,10 +24,10 @@ index 643797124fe5a4489d0b7419b7e600c04f283ef2..3b4d97c76db9c742072c92dd7c8b3955
|
||||
return itemStack;
|
||||
}
|
||||
diff --git a/net/minecraft/server/commands/GiveCommand.java b/net/minecraft/server/commands/GiveCommand.java
|
||||
index f06753a8fa1138fa165de0a8367e04d79eaad381..267d9d2532302a7fb4ba55e8920dbb8891b2c232 100644
|
||||
index 5a1c21b05545a03fbb00cf734605049870d3eecb..2ade5ce23cdab08b1746e2cbe99bfe1d3da42f02 100644
|
||||
--- a/net/minecraft/server/commands/GiveCommand.java
|
||||
+++ b/net/minecraft/server/commands/GiveCommand.java
|
||||
@@ -52,7 +52,7 @@ public class GiveCommand {
|
||||
@@ -55,7 +55,7 @@ public class GiveCommand {
|
||||
private static int giveItem(CommandSourceStack source, ItemInput item, Collection<ServerPlayer> targets, int count) throws CommandSyntaxException {
|
||||
ItemStack itemStack = item.createItemStack(1, false);
|
||||
final Component displayName = itemStack.getDisplayName(); // Paper - get display name early
|
||||
@@ -37,10 +37,10 @@ index f06753a8fa1138fa165de0a8367e04d79eaad381..267d9d2532302a7fb4ba55e8920dbb88
|
||||
if (count > i) {
|
||||
source.sendFailure(Component.translatable("commands.give.failed.toomanyitems", i, itemStack.getDisplayName()));
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4fc3c9f2b04711569c12a0efa027601fdd0a40b5..a726ce12ecac55912606c4a1958b5afa07c491bc 100644
|
||||
index 3a78b917cfa2947f26a25e4d77d825e8113a83ef..bec1592ea6ce909bf9b1067e0a32d00c2c4e43f5 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3056,7 +3056,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3072,7 +3072,7 @@ public class ServerGamePacketListenerImpl
|
||||
} else if (slot.mayPlace(cursor)) {
|
||||
if (ItemStack.isSameItemSameComponents(clickedItem, cursor)) {
|
||||
int toPlace = packet.buttonNum() == 0 ? cursor.getCount() : 1;
|
||||
@@ -49,7 +49,7 @@ index 4fc3c9f2b04711569c12a0efa027601fdd0a40b5..a726ce12ecac55912606c4a1958b5afa
|
||||
toPlace = Math.min(toPlace, slot.container.getMaxStackSize() - clickedItem.getCount());
|
||||
if (toPlace == 1) {
|
||||
action = InventoryAction.PLACE_ONE;
|
||||
@@ -3092,7 +3092,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3108,7 +3108,7 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
} else if (ItemStack.isSameItemSameComponents(cursor, clickedItem)) {
|
||||
if (clickedItem.getCount() >= 0) {
|
||||
@@ -58,7 +58,7 @@ index 4fc3c9f2b04711569c12a0efa027601fdd0a40b5..a726ce12ecac55912606c4a1958b5afa
|
||||
// As of 1.5, this is result slots only
|
||||
action = InventoryAction.PICKUP_ALL;
|
||||
}
|
||||
@@ -3351,6 +3351,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3319,6 +3319,7 @@ public class ServerGamePacketListenerImpl
|
||||
this.player.containerMenu.broadcastFullState();
|
||||
} else {
|
||||
this.player.containerMenu.broadcastChanges();
|
||||
@@ -66,7 +66,7 @@ index 4fc3c9f2b04711569c12a0efa027601fdd0a40b5..a726ce12ecac55912606c4a1958b5afa
|
||||
}
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdates(); // Paper - Force update attributes.
|
||||
}
|
||||
@@ -3463,7 +3464,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3429,7 +3430,7 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
|
||||
boolean flag1 = packet.slotNum() >= 1 && packet.slotNum() <= 45;
|
||||
@@ -75,7 +75,7 @@ index 4fc3c9f2b04711569c12a0efa027601fdd0a40b5..a726ce12ecac55912606c4a1958b5afa
|
||||
if (flag || (flag1 && !ItemStack.matches(this.player.inventoryMenu.getSlot(packet.slotNum()).getItem(), packet.itemStack()))) { // Insist on valid slot
|
||||
// CraftBukkit start - Call click event
|
||||
org.bukkit.inventory.InventoryView inventory = this.player.inventoryMenu.getBukkitView();
|
||||
@@ -3505,6 +3506,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -3471,6 +3472,7 @@ public class ServerGamePacketListenerImpl
|
||||
this.player.inventoryMenu.getSlot(packet.slotNum()).setByPlayer(itemStack);
|
||||
this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemStack);
|
||||
this.player.inventoryMenu.broadcastChanges();
|
||||
@@ -101,7 +101,7 @@ index b382665cc125b8b5c0938e5e55984e4bf91d37ff..5d8bd05f966cf9befe8b8f3359b2fa4c
|
||||
|
||||
boolean stillValid(Player player);
|
||||
diff --git a/net/minecraft/world/SimpleContainer.java b/net/minecraft/world/SimpleContainer.java
|
||||
index 133e042371bcf84f1935903ec57d204e3b7abd84..201599988e20219b6a99bf1594ad6c0c19e09038 100644
|
||||
index d907e24d563e27acab2f2bf9711b1755ea9afd19..6189cb7c1745a242b610e89c859cc849f16cc9e3 100644
|
||||
--- a/net/minecraft/world/SimpleContainer.java
|
||||
+++ b/net/minecraft/world/SimpleContainer.java
|
||||
@@ -211,7 +211,7 @@ public class SimpleContainer implements Container, StackedContentsCompatible {
|
||||
@@ -123,10 +123,10 @@ index 133e042371bcf84f1935903ec57d204e3b7abd84..201599988e20219b6a99bf1594ad6c0c
|
||||
if (min > 0) {
|
||||
other.grow(min);
|
||||
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index a9cc35b4b253d9a7fd90f811af9be629b164fad0..1e0c8a256b9602a56f607274e93208bf5b04ee0d 100644
|
||||
index b745eb5d9c68547335247910ff2ae8d5fb36349c..6d8675b918f92dc3ce85825edf2b33469950ef9d 100644
|
||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -281,10 +281,45 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -279,10 +279,45 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
|
||||
private boolean isMergable() {
|
||||
ItemStack item = this.getItem();
|
||||
@@ -174,10 +174,10 @@ index a9cc35b4b253d9a7fd90f811af9be629b164fad0..1e0c8a256b9602a56f607274e93208bf
|
||||
ItemStack item1 = itemEntity.getItem();
|
||||
if (Objects.equals(this.target, itemEntity.target) && areMergable(item, item1)) {
|
||||
diff --git a/net/minecraft/world/entity/player/Inventory.java b/net/minecraft/world/entity/player/Inventory.java
|
||||
index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..9020f7c83e5bd19e9a9d3748d200ce5772a9cefa 100644
|
||||
index a6bb436dc80daf6901dc027a6011ead4b3ed27e2..53210a7d32241c47c2b1cd698b515726f0a1fd0d 100644
|
||||
--- a/net/minecraft/world/entity/player/Inventory.java
|
||||
+++ b/net/minecraft/world/entity/player/Inventory.java
|
||||
@@ -149,8 +149,8 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -166,8 +166,8 @@ public class Inventory implements Container, Nameable {
|
||||
|
||||
private boolean hasRemainingSpaceForItem(ItemStack destination, ItemStack origin) {
|
||||
return !destination.isEmpty()
|
||||
@@ -188,7 +188,7 @@ index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..9020f7c83e5bd19e9a9d3748d200ce57
|
||||
&& ItemStack.isSameItemSameComponents(destination, origin); // Paper - check if itemstack is stackable first
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -181,7 +181,7 @@ public class Inventory implements Container, Nameable {
|
||||
}
|
||||
|
||||
if (this.hasRemainingSpaceForItem(itemInSlot, itemStack)) {
|
||||
@@ -197,7 +197,7 @@ index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..9020f7c83e5bd19e9a9d3748d200ce57
|
||||
}
|
||||
if (remains <= 0) {
|
||||
return itemStack.getCount();
|
||||
@@ -173,7 +173,7 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -190,7 +190,7 @@ public class Inventory implements Container, Nameable {
|
||||
|
||||
ItemStack itemInOffhand = this.equipment.get(EquipmentSlot.OFFHAND);
|
||||
if (this.hasRemainingSpaceForItem(itemInOffhand, itemStack)) {
|
||||
@@ -206,7 +206,7 @@ index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..9020f7c83e5bd19e9a9d3748d200ce57
|
||||
}
|
||||
if (remains <= 0) {
|
||||
return itemStack.getCount();
|
||||
@@ -297,7 +297,7 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -314,7 +314,7 @@ public class Inventory implements Container, Nameable {
|
||||
this.setItem(slot, item);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ index d9cb4f0ed0c4f63362c837aeef3c4194911455c9..9020f7c83e5bd19e9a9d3748d200ce57
|
||||
int min = Math.min(count, i);
|
||||
if (min == 0) {
|
||||
return count;
|
||||
@@ -403,7 +403,7 @@ public class Inventory implements Container, Nameable {
|
||||
@@ -420,7 +420,7 @@ public class Inventory implements Container, Nameable {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ index 83ccde54c625d40dc595e000c533f60aa929bd5a..3206b599481eeab29c58bc1ca9cac693
|
||||
|
||||
public void accountStack(ItemStack stack, int maxStackSize) {
|
||||
diff --git a/net/minecraft/world/entity/vehicle/ContainerEntity.java b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
index feebd1610ebd3c26a337259c14f5c774dc72b937..7df6ff842e41763aec2d88d1f8a5f7503932d905 100644
|
||||
index 02d2efef2dc0f0e12eac0c71fa290af706f7694d..d042b3729a615bdabeb08f559ac895a731856545 100644
|
||||
--- a/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/ContainerEntity.java
|
||||
@@ -163,7 +163,7 @@ public interface ContainerEntity extends Container, MenuProvider {
|
||||
@@ -251,10 +251,10 @@ index feebd1610ebd3c26a337259c14f5c774dc72b937..7df6ff842e41763aec2d88d1f8a5f750
|
||||
|
||||
default SlotAccess getChestVehicleSlot(final int index) {
|
||||
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b13b6910c 100644
|
||||
index 9b6cd35e4dfa894069238a1365db16050aa5542b..a928c2e50e43245542a8bc8e307acf27259bbf74 100644
|
||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -234,6 +234,14 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -258,6 +258,14 @@ public abstract class AbstractContainerMenu {
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
public void broadcastChanges() {
|
||||
for (int i = 0; i < this.slots.size(); i++) {
|
||||
ItemStack item = this.slots.get(i).getItem();
|
||||
@@ -427,7 +435,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -451,7 +459,7 @@ public abstract class AbstractContainerMenu {
|
||||
&& (this.quickcraftType == 2 || carried1.getCount() >= this.quickcraftSlots.size())
|
||||
&& this.canDragTo(slot1)) {
|
||||
int i2 = slot1.hasItem() ? slot1.getItem().getCount() : 0;
|
||||
@@ -278,7 +278,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
int min1 = Math.min(getQuickCraftPlaceCount(this.quickcraftSlots, this.quickcraftType, itemStack) + i2, min);
|
||||
count -= min1 - i2;
|
||||
// slot1.setByPlayer(itemStack.copyWithCount(min1));
|
||||
@@ -541,7 +549,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -563,7 +571,7 @@ public abstract class AbstractContainerMenu {
|
||||
slot.setByPlayer(carried2);
|
||||
}
|
||||
} else if (ItemStack.isSameItemSameComponents(carried, carried2)) {
|
||||
@@ -287,7 +287,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
optional1.ifPresent(itemStack2 -> {
|
||||
carried2.grow(itemStack2.getCount());
|
||||
slot.onTake(player, itemStack2);
|
||||
@@ -603,7 +611,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -625,7 +633,7 @@ public abstract class AbstractContainerMenu {
|
||||
Slot slot2 = this.slots.get(slotId);
|
||||
if (slot2.hasItem()) {
|
||||
ItemStack itemStack = slot2.getItem();
|
||||
@@ -296,7 +296,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
}
|
||||
} else if (clickType == ClickType.THROW && this.getCarried().isEmpty() && slotId >= 0) {
|
||||
Slot slot2 = this.slots.get(slotId);
|
||||
@@ -634,15 +642,15 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -656,15 +664,15 @@ public abstract class AbstractContainerMenu {
|
||||
int maxStackSize = button == 0 ? 1 : -1;
|
||||
|
||||
for (int i3 = 0; i3 < 2; i3++) {
|
||||
@@ -315,7 +315,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
itemStack.grow(itemStack1.getCount());
|
||||
}
|
||||
}
|
||||
@@ -744,7 +752,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -766,7 +774,7 @@ public abstract class AbstractContainerMenu {
|
||||
i = endIndex - 1;
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
while (!stack.isEmpty() && (reverseDirection ? i >= startIndex : i < endIndex)) {
|
||||
Slot slot = this.slots.get(i);
|
||||
ItemStack item = slot.getItem();
|
||||
@@ -845,7 +853,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -867,7 +875,7 @@ public abstract class AbstractContainerMenu {
|
||||
public static boolean canItemQuickReplace(@Nullable Slot slot, ItemStack stack, boolean stackSizeMatters) {
|
||||
boolean flag = slot == null || !slot.hasItem();
|
||||
return !flag && ItemStack.isSameItemSameComponents(stack, slot.getItem())
|
||||
@@ -333,7 +333,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
: flag;
|
||||
}
|
||||
|
||||
@@ -853,7 +861,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -875,7 +883,7 @@ public abstract class AbstractContainerMenu {
|
||||
return switch (type) {
|
||||
case 0 -> Mth.floor((float)stack.getCount() / slots.size());
|
||||
case 1 -> 1;
|
||||
@@ -342,7 +342,7 @@ index a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2..45ff5b9a50bdec611f7c1aa4cb77fb0b
|
||||
default -> stack.getCount();
|
||||
};
|
||||
}
|
||||
@@ -875,7 +883,7 @@ public abstract class AbstractContainerMenu {
|
||||
@@ -897,7 +905,7 @@ public abstract class AbstractContainerMenu {
|
||||
for (int i = 0; i < container.getContainerSize(); i++) {
|
||||
ItemStack item = container.getItem(i);
|
||||
if (!item.isEmpty()) {
|
||||
@@ -378,10 +378,10 @@ index 5ceb8964476b40db4511bec91ff13c4f522a1357..dd978d1590fb896775a240ed87e38d85
|
||||
|
||||
@Nullable
|
||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||
index 09455150810e4fb6e4637fdb9e2e8a30fe0bc247..9ea26913cbaa7571a107b421614380e2755f4430 100644
|
||||
index 6154da1158756cff072d7e8cae10e20eafed1eec..687249e1ad1cb09edbe2939f1db2f90e146cd664 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -165,7 +165,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -162,7 +162,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@Deprecated
|
||||
@Nullable
|
||||
private Item item;
|
||||
@@ -390,7 +390,7 @@ index 09455150810e4fb6e4637fdb9e2e8a30fe0bc247..9ea26913cbaa7571a107b421614380e2
|
||||
@Nullable
|
||||
private Entity entityRepresentation;
|
||||
|
||||
@@ -192,7 +192,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -189,7 +189,8 @@ public final class ItemStack implements DataComponentHolder {
|
||||
} else {
|
||||
Holder<Item> holder = Item.STREAM_CODEC.decode(buffer);
|
||||
DataComponentPatch dataComponentPatch = codec.decode(buffer);
|
||||
@@ -400,7 +400,7 @@ index 09455150810e4fb6e4637fdb9e2e8a30fe0bc247..9ea26913cbaa7571a107b421614380e2
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,13 +202,15 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -198,13 +199,15 @@ public final class ItemStack implements DataComponentHolder {
|
||||
if (value.isEmpty() || value.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
|
||||
buffer.writeVarInt(0);
|
||||
} else {
|
||||
@@ -420,7 +420,7 @@ index 09455150810e4fb6e4637fdb9e2e8a30fe0bc247..9ea26913cbaa7571a107b421614380e2
|
||||
} finally {
|
||||
net.minecraft.network.chat.ComponentSerialization.DONT_RENDER_TRANSLATABLES.set(prev);
|
||||
}
|
||||
@@ -302,7 +305,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -299,7 +302,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
|
||||
for (ItemStack itemStack : itemContainerContents.nonEmptyItems()) {
|
||||
int count = itemStack.getCount();
|
||||
@@ -430,10 +430,10 @@ index 09455150810e4fb6e4637fdb9e2e8a30fe0bc247..9ea26913cbaa7571a107b421614380e2
|
||||
return DataResult.error(() -> "Item stack with count of " + count + " was larger than maximum: " + maxStackSize);
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/AbstractCauldronBlock.java b/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
||||
index ad3f32888afd8b5f0038445a1b0fcc8cacec9fe2..3e3d516ff62f49a3cc00375d173af137b555d515 100644
|
||||
index 1a927b08f86c0585e62d8c4207954ab36d3316ee..e9899a03b15a2ca3dbd941775f14b041bbcfc85e 100644
|
||||
--- a/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
||||
+++ b/net/minecraft/world/level/block/AbstractCauldronBlock.java
|
||||
@@ -62,9 +62,27 @@ public abstract class AbstractCauldronBlock extends Block {
|
||||
@@ -57,9 +57,27 @@ public abstract class AbstractCauldronBlock extends Block {
|
||||
ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult
|
||||
) {
|
||||
CauldronInteraction cauldronInteraction = this.interactions.map().get(stack.getItem());
|
||||
@@ -476,7 +476,7 @@ index 38b03c7b02bdfc579e5e126c12de3d878e26d188..33e24f2c3b63b2d3b55dfae2f2e55869
|
||||
org.bukkit.craftbukkit.inventory.CraftItemStack oitemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack);
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
index c5b3b5e5f621f8db152aa190374ae0fe567d6828..0ca27b83151c3e7be3d681aa087fa72fb5bef0c3 100644
|
||||
index 36a72a11d28f99bfe85868461925b778cc01478e..831900a4ed6ca335707289391a095af7717a01a4 100644
|
||||
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -409,7 +409,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -489,10 +489,10 @@ index c5b3b5e5f621f8db152aa190374ae0fe567d6828..0ca27b83151c3e7be3d681aa087fa72f
|
||||
this.cookingTotalTime = getTotalCookTime(serverLevel, this, this.recipeType, this.cookSpeedMultiplier); // Paper - cook speed multiplier API
|
||||
this.cookingTimer = 0;
|
||||
diff --git a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
index c63370fd458fb4f7190b79b1a8174fcc92d88f9c..4cca3fbbb93bb76d5d501dfad6997d909211809e 100644
|
||||
index 5a094257a31f0500278a706a418e1697f8810ffb..1f132848ae284668c05d6ca17d5890fa341e14cd 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
@@ -148,7 +148,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
@@ -145,7 +145,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
@Override
|
||||
public void setItem(int slot, ItemStack stack) {
|
||||
this.getItems().set(slot, stack);
|
||||
@@ -502,7 +502,7 @@ index c63370fd458fb4f7190b79b1a8174fcc92d88f9c..4cca3fbbb93bb76d5d501dfad6997d90
|
||||
}
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index 6f5a47a3e9452f25b318e4a7a628e917da99c96f..52032c6bbc7e1c37a50d9b7334f1830896cb462d 100644
|
||||
index 5de769e7bd56bb3355c3c711d46ce5e103ea4409..061501979195cf43c6da4d4b6cf6359251978bd3 100644
|
||||
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -123,7 +123,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Spawn invulnerable time
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 5596214edb14d30c9ed5af4ffdcdd2041d135c6d..bf76bdf5f4c5a490f8de8d924b371cd98b63bfa4 100644
|
||||
index b7bc75648634aefc549a69631ab6e401eb902e7d..0e2d575200f3ff3ec1600a0663152e3c37ea67b0 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -221,6 +221,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -232,6 +232,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
private int lastSentFood = -99999999;
|
||||
private boolean lastFoodSaturationZero = true;
|
||||
public int lastSentExp = -99999999;
|
||||
@@ -16,7 +16,7 @@ index 5596214edb14d30c9ed5af4ffdcdd2041d135c6d..bf76bdf5f4c5a490f8de8d924b371cd9
|
||||
private ChatVisiblity chatVisibility = ChatVisiblity.FULL;
|
||||
public ParticleStatus particleStatus = ParticleStatus.ALL;
|
||||
private boolean canChatColor = true;
|
||||
@@ -923,6 +924,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -925,6 +926,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.tickClientLoadTimeout();
|
||||
this.gameMode.tick();
|
||||
this.wardenSpawnTracker.tick();
|
||||
@@ -24,7 +24,7 @@ index 5596214edb14d30c9ed5af4ffdcdd2041d135c6d..bf76bdf5f4c5a490f8de8d924b371cd9
|
||||
if (this.invulnerableTime > 0) {
|
||||
this.invulnerableTime--;
|
||||
}
|
||||
@@ -1420,6 +1422,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1431,6 +1433,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
if (this.isInvulnerableTo(level, damageSource)) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Mon, 7 Jul 2025 15:33:57 +0800
|
||||
Subject: [PATCH] Old Explosion Damage Calculator
|
||||
|
||||
Co-authored by: MC_XiaoHei <xor7xiaohei@gmail.com>
|
||||
As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/3e96b237749a960f297f211d439ffc9ea7fd2381/leaves-server/minecraft-patches/features/0134-Old-wet-tnt-explode-behavior.patch)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
||||
index b3e897a4afee742b5055d652ad7047a660d8ea04..cf8869fac003c73024634078b2f7b36cddda640e 100644
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -729,6 +729,7 @@ public class ServerExplosion implements Explosion {
|
||||
public boolean shouldAffectBlocklikeEntities() {
|
||||
boolean _boolean = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
||||
boolean flag = this.source == null || this.source.getType() != EntityType.BREEZE_WIND_CHARGE && this.source.getType() != EntityType.WIND_CHARGE;
|
||||
+ if (fun.bm.lophine.config.modules.misc.OldFeatureConfig.oldExplosionDamageCalculator) flag = flag && (this.source == null || !this.source.isInWater()); // Leaves - Old MC TNT wet explosion no item damage
|
||||
return _boolean ? flag : this.blockInteraction.shouldAffectBlocklikeEntities() && flag;
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Sun, 18 May 2025 23:48:59 +0800
|
||||
Subject: [PATCH] Old nether portal collision
|
||||
|
||||
This patch should removed in 1.21.6 when mojang revert it.
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
index 421ea9c748159ac989900427a13abe9b244dc7aa..a5a220e6d41c992d1db8617069aa00eddcf7b95a 100644
|
||||
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
|
||||
@@ -65,7 +65,7 @@ public class NetherPortalBlock extends Block implements Portal {
|
||||
|
||||
@Override
|
||||
protected VoxelShape getEntityInsideCollisionShape(BlockState state, BlockGetter level, BlockPos pos, Entity entity) {
|
||||
- return state.getShape(level, pos);
|
||||
+ return fun.bm.lophine.config.modules.misc.OldFeatureConfig.oldNetherPortalCollision ? Shapes.block() : state.getShape(level, pos); // Lophine - Old nether portal collision
|
||||
}
|
||||
|
||||
@Override
|
||||
+3
-12
@@ -5,24 +5,15 @@ Subject: [PATCH] Old replaceable by mushrooms
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index ba1ccd6eab77e27a38d22c12dba0797d65cc4c4e..373f91df79fc7a7bd6fd137bf53b8a55dd745e31 100644
|
||||
index 93d722d437121e605cee0e168ac17ee9bef0610e..cb2a2fbd17157726b285665fdca0ab9663e0d1de 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -11,6 +11,8 @@ import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
+
|
||||
+import fun.bm.lophine.config.modules.misc.OldFeatureConfig;
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
import net.minecraft.ReportedException;
|
||||
@@ -1111,7 +1113,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
@@ -1111,7 +1111,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
if (worldData.captureTreeGeneration) { // Folia - region threading
|
||||
// Paper start - Protect Bedrock and End Portal/Frames from being destroyed
|
||||
BlockState type = getBlockState(pos);
|
||||
- if (!type.isDestroyable()) return false;
|
||||
+ if (!type.isDestroyable() && !(OldFeatureConfig.oldReplaceableByMushrooms && flags == 3)) return false;
|
||||
+ if (!type.isDestroyable() && !(fun.bm.lophine.config.modules.misc.OldFeatureConfig.oldReplaceableByMushrooms && flags == 3)) return false;
|
||||
// Paper end - Protect Bedrock and End Portal/Frames from being destroyed
|
||||
CraftBlockState blockstate = worldData.capturedBlockStates.get(pos); // Folia - region threading
|
||||
if (blockstate == null) {
|
||||
+2
-2
@@ -5,10 +5,10 @@ Subject: [PATCH] Old zombie reinforcement
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 4395947fc8c719864ac2afde5e6bbb53da5129c2..f2b2859084bcff3a004d9b4bfac1f51e75970d39 100644
|
||||
index 14d0758aca54d9a25e369dfa8c89c930f27946c9..6f1f26b7f759e56f843e674167470da943785728 100644
|
||||
--- a/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -342,7 +342,7 @@ public class Zombie extends Monster {
|
||||
@@ -341,7 +341,7 @@ public class Zombie extends Monster {
|
||||
int floor = Mth.floor(this.getX());
|
||||
int floor1 = Mth.floor(this.getY());
|
||||
int floor2 = Mth.floor(this.getZ());
|
||||
@@ -5,13 +5,13 @@ Subject: [PATCH] I18n support
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 1b60378cdbf5bc88f996010a61cceec7c2b9e2dc..dd701b07c4d5894516f613aca687a969f1bbee90 100644
|
||||
index c6c6432c2efeb7b95c2894b188cd966321ae3186..1cd9af71ee66df5f277748c0a5a59a30bd57accc 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -172,6 +172,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
fun.bm.lophine.config.LophineConfig.loadConfigFiles(); //Luminol - load config file // Lophine - load config file
|
||||
me.earthme.luminol.config.ConfigManager.loadConfigFiles(); // Luminol - load config file
|
||||
+ fun.bm.lophine.utils.ServerI18nUtil.init(); // Lophine - I18n support
|
||||
if (false) this.server.spark.enableEarlyIfRequested(); // Paper - spark // Luminol - Force disable builtin spark
|
||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||
|
||||
@@ -57,7 +57,7 @@ index 22125dbe1765f930fe10fe420be1c275ec553139..d5b070d1a3d84e228960dacd614e0f1a
|
||||
final @Nullable Component history = this.getHistory();
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
index e3c5f4c31f084294a59830f3e764921433dd80d5..fe0f4aee0ad92e2e9713f88e328d6588f494dfd3 100644
|
||||
index 4ada790812957657d580cb748077c4961987d0cb..3a539df860305e777e85ed6dc72b5effe76734b4 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
@@ -31,7 +31,7 @@ public record ServerBuildInfoImpl(
|
||||
@@ -78,8 +78,8 @@ index e3c5f4c31f084294a59830f3e764921433dd80d5..fe0f4aee0ad92e2e9713f88e328d6588
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
|
||||
- .orElse(BRAND_LUMINOL_NAME), // Folia // Luminol
|
||||
+ .orElse(BRAND_LOPHINE_NAME), // Folia // Luminol // Lophine
|
||||
SharedConstants.getCurrentVersion().getId(),
|
||||
SharedConstants.getCurrentVersion().getName(),
|
||||
SharedConstants.getCurrentVersion().id(),
|
||||
SharedConstants.getCurrentVersion().name(),
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
||||
@@ -62,7 +62,7 @@ public record ServerBuildInfoImpl(
|
||||
|
||||
|
||||
+2
-2
@@ -5,10 +5,10 @@ Subject: [PATCH] Purpur-Barrels-and-enderchests-6-rows
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index c00ddfe41439954fa0fd87c0933f274c8a752eb6..77aa23d252e429e01bc7bd8c47e23d12ca596fdb 100644
|
||||
index 2f41a92465b9da28e026297cc3528898bb1c8412..fb5300ec1bd19b3dfd6a2b4106440b9f73c48205 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -150,9 +150,26 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
@@ -148,9 +148,26 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
case PLAYER:
|
||||
case CHEST:
|
||||
case ENDER_CHEST:
|
||||
|
||||
@@ -96,7 +96,7 @@ public class CullTask implements Runnable {
|
||||
lastCheckedTime = (System.currentTimeMillis() - start);
|
||||
}
|
||||
}
|
||||
}finally {
|
||||
} finally {
|
||||
if (this.scheduleNext) {
|
||||
this.worker.execute(this);
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package fun.bm.lophine.config;
|
||||
|
||||
import me.earthme.luminol.config.LuminolConfig;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LophineConfig {
|
||||
public static final Map<String, LuminolConfig> configfiles = new HashMap<>();
|
||||
private static final File luminolConfigFolder = new File("luminol_config");
|
||||
private static final File lophineConfigFolder = new File("lophine_config");
|
||||
|
||||
public static void initConfigs() throws IOException {
|
||||
configfiles.put("luminol", new LuminolConfig(luminolConfigFolder, "luminol", "me.earthme.luminol.config.modules"));
|
||||
configfiles.put("lophine", new LuminolConfig(lophineConfigFolder, "lophine", "fun.bm.lophine.config.modules"));
|
||||
preLoad();
|
||||
}
|
||||
|
||||
public static void preLoad() throws IOException {
|
||||
for (LuminolConfig config : configfiles.values()) {
|
||||
config.preLoadConfig();
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadConfigFiles() {
|
||||
for (LuminolConfig config : configfiles.values()) {
|
||||
config.finalizeLoadConfig();
|
||||
config.setupLatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-5
@@ -5,16 +5,17 @@ import me.earthme.luminol.config.IConfigModule;
|
||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
|
||||
public class CommandConfig implements IConfigModule {
|
||||
@ConfigInfo(baseName = "command_block_enabled", comments =
|
||||
"""
|
||||
Allow to use command block""")
|
||||
public static boolean block = false;
|
||||
|
||||
@ConfigInfo(baseName = "tick_command_enabled", comments =
|
||||
"""
|
||||
Allow to use tick command""")
|
||||
public static boolean tick = false;
|
||||
|
||||
@ConfigInfo(baseName = "datapack_command_enabled", comments =
|
||||
"""
|
||||
Allow to use datapack command
|
||||
--- datapack hot-update unsupported, please restart server""")
|
||||
public static boolean datapack = false;
|
||||
|
||||
@Override
|
||||
public EnumConfigCategory getCategory() {
|
||||
return EnumConfigCategory.EXPERIMENT;
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package fun.bm.lophine.config.modules.experiment;
|
||||
|
||||
import me.earthme.luminol.config.EnumConfigCategory;
|
||||
import me.earthme.luminol.config.IConfigModule;
|
||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
import me.earthme.luminol.config.flags.TransformedConfig;
|
||||
|
||||
public class WaypointConfig implements IConfigModule {
|
||||
@TransformedConfig(name = "enable-waypoint", category = {"experiment", "waypoint bar"})
|
||||
@ConfigInfo(baseName = "enabled", comments =
|
||||
"""
|
||||
Enable waypoint bar unsafe""")
|
||||
public static boolean forceEnableWaypointUnsafe = false;
|
||||
|
||||
@Override
|
||||
public EnumConfigCategory getCategory() {
|
||||
return EnumConfigCategory.EXPERIMENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return "waypoint_bar";
|
||||
}
|
||||
}
|
||||
-5
@@ -20,11 +20,6 @@ public class ContainerExpansionConfig implements IConfigModule {
|
||||
range: 1~64""")
|
||||
public static int shulkerCount = 1;
|
||||
|
||||
@ConfigInfo(baseName = "better_shulker_box", comments =
|
||||
"""
|
||||
Enable sneak + use to open shulker box.""")
|
||||
public static boolean betterShulker = false;
|
||||
|
||||
@Override
|
||||
public EnumConfigCategory getCategory() {
|
||||
return EnumConfigCategory.MISC;
|
||||
|
||||
+3
-3
@@ -5,9 +5,6 @@ import me.earthme.luminol.config.IConfigModule;
|
||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
|
||||
public class OldFeatureConfig implements IConfigModule {
|
||||
@ConfigInfo(baseName = "old_nether_portal_collision")
|
||||
public static boolean oldNetherPortalCollision = false;
|
||||
|
||||
@ConfigInfo(baseName = "spawn_invulnerable_time")
|
||||
public static boolean spawnInvulnerableTime = false;
|
||||
|
||||
@@ -17,6 +14,9 @@ public class OldFeatureConfig implements IConfigModule {
|
||||
@ConfigInfo(baseName = "old_replaceable_by_mushrooms")
|
||||
public static boolean oldReplaceableByMushrooms = false;
|
||||
|
||||
@ConfigInfo(baseName = "old_explosion_damage_calculator")
|
||||
public static boolean oldExplosionDamageCalculator = false;
|
||||
|
||||
@Override
|
||||
public EnumConfigCategory getCategory() {
|
||||
return EnumConfigCategory.MISC;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package fun.bm.lophine.config.modules.misc;
|
||||
|
||||
import me.earthme.luminol.config.EnumConfigCategory;
|
||||
import me.earthme.luminol.config.IConfigModule;
|
||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
|
||||
public class VillagerConfig implements IConfigModule {
|
||||
@ConfigInfo(baseName = "villager-infinite-trade", comments =
|
||||
"""
|
||||
Allow villager infinite trade (limit of 16384 times)
|
||||
---- we won't edit saved data, only edit in send data to client.""")
|
||||
public static boolean villagerInfiniteTrade = false;
|
||||
|
||||
@Override
|
||||
public EnumConfigCategory getCategory() {
|
||||
return EnumConfigCategory.MISC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return "villager-config";
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -6,7 +6,8 @@ import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
import me.earthme.luminol.config.flags.TransformedConfig;
|
||||
|
||||
public class RemovedConfig implements IConfigModule {
|
||||
@TransformedConfig(name = "example", category = {"removed", "example"}, transform = false)
|
||||
@TransformedConfig(name = "old_nether_portal_collision", category = {"misc", "old-feature"}, transform = false)
|
||||
@TransformedConfig(name = "better_shulker_box", category = {"misc", "container_expansion"}, transform = false)
|
||||
@ConfigInfo(baseName = "removed", comments =
|
||||
"""
|
||||
RemovedConfig redirect to here, no any function.""")
|
||||
|
||||
@@ -32,14 +32,14 @@ import java.util.function.BiConsumer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/*
|
||||
* authored by: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
* modified by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
|
||||
* Some of diff form Leaves
|
||||
*/
|
||||
* authored by: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
* modified by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
|
||||
* Some of diff form Leaves
|
||||
*/
|
||||
public class ServerI18nUtil {
|
||||
|
||||
private static final Logger logger = Logger.getLogger("LangLoader");
|
||||
private static final String VERSION = DetectedVersion.BUILT_IN.getName();
|
||||
private static final String VERSION = DetectedVersion.BUILT_IN.name();
|
||||
private static final String BASE_PATH = "cache/lophine/" + VERSION + "/";
|
||||
private static final String manifestUrl = "https://launchermeta.mojang.com/mc/game/version_manifest.json";
|
||||
private static final String resourceBaseUrl = "https://resources.download.minecraft.net/";
|
||||
|
||||
@@ -1,31 +1,18 @@
|
||||
package fun.bm.lophine.utils;
|
||||
|
||||
import fun.bm.lophine.config.modules.misc.ContainerExpansionConfig;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.stats.Stats;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.SlotAccess;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.component.ItemContainerContents;
|
||||
import net.minecraft.world.level.block.ShulkerBoxBlock;
|
||||
import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
public class ShulkerBoxesUtil {
|
||||
// Better ShulkerBoxes used
|
||||
public static HashMap<Player, ShulkerBoxBlockEntity> shulkerMap = new HashMap<>();
|
||||
public static HashMap<ShulkerBoxBlockEntity, Player> playerMap = new HashMap<>();
|
||||
|
||||
// Stackable ShulkerBoxes part
|
||||
public static boolean shouldCheck() {
|
||||
return ContainerExpansionConfig.shulkerCount > 1 && ContainerExpansionConfig.shulkerCount <= 64;
|
||||
}
|
||||
@@ -88,76 +75,4 @@ public class ShulkerBoxesUtil {
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
// Better ShulkerBox part
|
||||
public static boolean checkIfCanOpen(ItemStack itemStack) {
|
||||
return checkIsShulkerBox(itemStack) && itemStack.getCount() == 1;
|
||||
}
|
||||
|
||||
public static boolean checkIfValid(Player player) {
|
||||
return shulkerMap.get(player) != null;
|
||||
}
|
||||
|
||||
public static void openShulkerBox(Player player, ItemStack item, InteractionHand hand) {
|
||||
ItemStack itemInHand = item.copy();
|
||||
ShulkerBoxBlockEntity shulkerBoxEntity = new ShulkerBoxBlockEntity(
|
||||
player.blockPosition(),
|
||||
((BlockItem) itemInHand.getItem()).getBlock().defaultBlockState()
|
||||
);
|
||||
ItemContainerContents container = itemInHand.getOrDefault(
|
||||
DataComponents.CONTAINER,
|
||||
ItemContainerContents.EMPTY
|
||||
);
|
||||
|
||||
NonNullList<ItemStack> items = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
for (int i = 0; i < container.items.size(); i++) {
|
||||
items.set(i, container.items.get(i));
|
||||
}
|
||||
|
||||
shulkerBoxEntity.setItems(items);
|
||||
|
||||
shulkerBoxEntity.haveRealBlock = false;
|
||||
shulkerBoxEntity.slot = hand == InteractionHand.MAIN_HAND ? player.getInventory().getSelectedSlot() : 40;
|
||||
shulkerBoxEntity.setLevel(player.level());
|
||||
|
||||
shulkerMap.put(player, shulkerBoxEntity);
|
||||
playerMap.put(shulkerBoxEntity, player);
|
||||
|
||||
if (player.openMenu(shulkerBoxEntity).isPresent()) {
|
||||
player.awardStat(Stats.OPEN_SHULKER_BOX);
|
||||
}
|
||||
}
|
||||
|
||||
public static void shulkerBoxEntityCallBack(ShulkerBoxBlockEntity shulkerBoxEntity) {
|
||||
Player player = playerMap.get(shulkerBoxEntity);
|
||||
if (player != null) {
|
||||
SlotAccess slot = player.getSlot(shulkerBoxEntity.slot);
|
||||
ItemStack currentItem = slot.get();
|
||||
ItemStack copy = currentItem.copy();
|
||||
|
||||
copy.set(DataComponents.CONTAINER, ItemContainerContents.fromItems(shulkerBoxEntity.getItems()));
|
||||
|
||||
slot.set(copy);
|
||||
}
|
||||
}
|
||||
|
||||
public static void inventoryCallBack(Player player, int slotId) {
|
||||
ShulkerBoxBlockEntity entity = shulkerMap.get(player);
|
||||
if (entity != null) {
|
||||
if ((slotId == entity.slot) && player instanceof ServerPlayer serverPlayer)
|
||||
serverPlayer.closeContainer();
|
||||
}
|
||||
}
|
||||
|
||||
public static void clearMap(Player p) {
|
||||
ShulkerBoxBlockEntity e = shulkerMap.get(p);
|
||||
if (e != null) playerMap.remove(e);
|
||||
shulkerMap.remove(p);
|
||||
}
|
||||
|
||||
public static void clearMap(ShulkerBoxBlockEntity e) {
|
||||
Player p = playerMap.get(e);
|
||||
if (p != null) shulkerMap.remove(p);
|
||||
playerMap.remove(e);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ pluginManagement {
|
||||
gradlePluginPortal()
|
||||
mavenLocal()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://repo.menthamc.com/repository/maven-public/")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user