Compare commits
28 Commits
dev/1.21.5
...
ver/1.21.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0dacad28d | ||
|
|
c82af261e8 | ||
|
|
a328d9d818 | ||
|
|
28d29498df | ||
|
|
d8a01345c6 | ||
|
|
a4124d5cda | ||
|
|
3eedf86153 | ||
|
|
68e8267c24 | ||
|
|
cd8a4e11dc | ||
|
|
c69087ba64 | ||
|
|
784ce10986 | ||
|
|
25b9e3f213 | ||
|
|
4855a4f76f | ||
|
|
818e1132df | ||
|
|
4cb423d24a | ||
|
|
6eebbe4221 | ||
|
|
85f3e2875f | ||
|
|
07f2fcd405 | ||
|
|
9e3360efa0 | ||
|
|
8c0a143ce1 | ||
|
|
785d82c433 | ||
|
|
0a2838607c | ||
|
|
180b64aca2 | ||
|
|
04233ea992 | ||
|
|
d2fc625ce9 | ||
|
|
70efb6748b | ||
|
|
4ea7b2833b | ||
|
|
7bc857b294 |
2
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -15,7 +15,7 @@ body:
|
|||||||
如果此bug被尝试修复,您可以帮助我们测试并回复。若bug的确被修复,您可以关闭issue来让开发者确认。
|
如果此bug被尝试修复,您可以帮助我们测试并回复。若bug的确被修复,您可以关闭issue来让开发者确认。
|
||||||
If this bug is tried to fix, you can help us test and reply. If the bug is fixed, you can close the issue to let the developer confirm.
|
If this bug is tried to fix, you can help us test and reply. If the bug is fixed, you can close the issue to let the developer confirm.
|
||||||
- type: input
|
- type: input
|
||||||
id: leavesMC-version
|
id: luminolMC-version
|
||||||
attributes:
|
attributes:
|
||||||
label: 服务端版本 LuminolMC Version
|
label: 服务端版本 LuminolMC Version
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
name: Luminol CI - ver/1.21.5
|
name: Luminol CI - ver/1.21.6
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "ver/1.21.5" ]
|
branches: [ "ver/1.21.6" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "ver/1.21.5" ]
|
branches: [ "ver/1.21.6" ]
|
||||||
|
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ jobs:
|
|||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: zulu
|
||||||
java-version: '22'
|
java-version: 22
|
||||||
|
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v4
|
uses: gradle/actions/setup-gradle@v4
|
||||||
@@ -28,17 +28,16 @@ jobs:
|
|||||||
- name: Configure Git User Details
|
- name: Configure Git User Details
|
||||||
run: git config --global user.email "ci@luminolmc.com" && git config --global user.name "LuminolMC CI"
|
run: git config --global user.email "ci@luminolmc.com" && git config --global user.name "LuminolMC CI"
|
||||||
|
|
||||||
- name: Apply Patches
|
- name: Apply All Patches
|
||||||
run: ./gradlew applyAllPatches
|
run: ./gradlew applyAllPatches
|
||||||
|
|
||||||
- name: CreateJar
|
- name: CreateMojmapPaperclipJar
|
||||||
run: ./gradlew createMojmapPaperclipJar
|
run: ./gradlew createMojmapPaperclipJar
|
||||||
|
|
||||||
- name: Publish to repo
|
- name: Publish to repo
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && false # do not push in preview
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: ./gradlew generateDevelopmentBundle publish -PpublishDevBundle=true
|
||||||
./gradlew generateDevelopmentBundle publish -PpublishDevBundle=true
|
|
||||||
env:
|
env:
|
||||||
PRIVATE_MAVEN_REPO_PASSWORD: ${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
|
PRIVATE_MAVEN_REPO_PASSWORD: ${{ secrets.PRIVATE_MAVEN_REPO_PASSWORD }}
|
||||||
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
|
PRIVATE_MAVEN_REPO_USERNAME: ${{ secrets.PRIVATE_MAVEN_REPO_USERNAME }}
|
||||||
@@ -46,15 +45,15 @@ jobs:
|
|||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ env.project_id_b }} CI Artifacts"
|
name: ${{ env.project_id_b }} CI Artifacts
|
||||||
path: "luminol-server/build/libs/*-paperclip-*-mojmap.jar"
|
path: luminol-server/build/libs/*-paperclip-*-mojmap.jar
|
||||||
|
|
||||||
- name: SetENV
|
- name: SetENV
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
run: sh scripts/SetENV.sh
|
run: sh scripts/SetENV.sh
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request' && false # do not push in preview
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
tag: ${{ env.tag }}
|
tag: ${{ env.tag }}
|
||||||
@@ -64,9 +63,8 @@ jobs:
|
|||||||
This release is automatically compiled by GitHub Actions
|
This release is automatically compiled by GitHub Actions
|
||||||
### Commit Message
|
### Commit Message
|
||||||
${{ env.commit_msg }}
|
${{ env.commit_msg }}
|
||||||
artifacts: |
|
artifacts: ${{ env.jar_dir }}
|
||||||
${{ env.jar_dir }}
|
|
||||||
generateReleaseNotes: true
|
generateReleaseNotes: true
|
||||||
prerelease: false
|
prerelease: ${{ env.pre }}
|
||||||
makeLatest: ${{ env.make_latest }}
|
makeLatest: ${{ env.make_latest }}
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -63,7 +63,7 @@ BTW, `*-api` and `*-server` and are not normal git repositories.
|
|||||||
|
|
||||||
- Before applying patches, the base will point to unmodified source code.
|
- Before applying patches, the base will point to unmodified source code.
|
||||||
- Every commit after the base is a patch.
|
- Every commit after the base is a patch.
|
||||||
- Only commits after the last commit of Paper will be considered as Luminol patches.
|
- Only commits after the last commit of Folia will be considered as Luminol patches.
|
||||||
|
|
||||||
## Adding new patches
|
## Adding new patches
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
group = me.earthme.luminol
|
group = me.earthme.luminol
|
||||||
version=1.21.5-R0.1-SNAPSHOT
|
version=1.21.6-R0.1-SNAPSHOT
|
||||||
mcVersion=1.21.5
|
mcVersion=1.21.6
|
||||||
|
|
||||||
foliaRef=da0d7cd1beb8eb7b84a5210dcefa6ffb4cce7415
|
foliaRef=03cc09fa2601f8ec7f70753e5f0d527997c06618
|
||||||
|
|
||||||
org.gradle.configuration-cache=true
|
org.gradle.configuration-cache=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -4,177 +4,6 @@ Date: Sun, 12 Jan 2025 13:27:38 +0800
|
|||||||
Subject: [PATCH] Pufferfish Sentry
|
Subject: [PATCH] Pufferfish Sentry
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..c7772aac00f6db664f7a5673bc2585fa025e6aad
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
|
|
||||||
@@ -0,0 +1,165 @@
|
|
||||||
+package gg.pufferfish.pufferfish.sentry;
|
|
||||||
+
|
|
||||||
+import com.google.gson.Gson;
|
|
||||||
+
|
|
||||||
+import java.lang.reflect.Field;
|
|
||||||
+import java.lang.reflect.Modifier;
|
|
||||||
+import java.util.Map;
|
|
||||||
+import java.util.TreeMap;
|
|
||||||
+
|
|
||||||
+import org.apache.logging.log4j.ThreadContext;
|
|
||||||
+import org.bukkit.command.Command;
|
|
||||||
+import org.bukkit.command.CommandSender;
|
|
||||||
+import org.bukkit.entity.Player;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.player.PlayerEvent;
|
|
||||||
+import org.bukkit.plugin.Plugin;
|
|
||||||
+import org.bukkit.plugin.RegisteredListener;
|
|
||||||
+import org.jetbrains.annotations.Nullable;
|
|
||||||
+
|
|
||||||
+public class SentryContext {
|
|
||||||
+
|
|
||||||
+ private static final Gson GSON = new Gson();
|
|
||||||
+
|
|
||||||
+ public static void setPluginContext(@Nullable Plugin plugin) {
|
|
||||||
+ if (plugin != null) {
|
|
||||||
+ ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
|
|
||||||
+ ThreadContext.put("pufferfishsentry_pluginversion", plugin.getPluginMeta().getVersion());
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void removePluginContext() {
|
|
||||||
+ ThreadContext.remove("pufferfishsentry_pluginname");
|
|
||||||
+ ThreadContext.remove("pufferfishsentry_pluginversion");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void setSenderContext(@Nullable CommandSender sender) {
|
|
||||||
+ if (sender != null) {
|
|
||||||
+ ThreadContext.put("pufferfishsentry_playername", sender.getName());
|
|
||||||
+ if (sender instanceof Player player) {
|
|
||||||
+ ThreadContext.put("pufferfishsentry_playerid", player.getUniqueId().toString());
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void removeSenderContext() {
|
|
||||||
+ ThreadContext.remove("pufferfishsentry_playername");
|
|
||||||
+ ThreadContext.remove("pufferfishsentry_playerid");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void setEventContext(Event event, RegisteredListener registration) {
|
|
||||||
+ setPluginContext(registration.getPlugin());
|
|
||||||
+
|
|
||||||
+ try {
|
|
||||||
+ // Find the player that was involved with this event
|
|
||||||
+ Player player = null;
|
|
||||||
+ if (event instanceof PlayerEvent) {
|
|
||||||
+ player = ((PlayerEvent) event).getPlayer();
|
|
||||||
+ } else {
|
|
||||||
+ Class<? extends Event> eventClass = event.getClass();
|
|
||||||
+
|
|
||||||
+ Field playerField = null;
|
|
||||||
+
|
|
||||||
+ for (Field field : eventClass.getDeclaredFields()) {
|
|
||||||
+ if (field.getType().equals(Player.class)) {
|
|
||||||
+ playerField = field;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (playerField != null) {
|
|
||||||
+ playerField.setAccessible(true);
|
|
||||||
+ player = (Player) playerField.get(event);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (player != null) {
|
|
||||||
+ setSenderContext(player);
|
|
||||||
+ }
|
|
||||||
+ } catch (Exception ignored) {
|
|
||||||
+ } // We can't really safely log exceptions.
|
|
||||||
+
|
|
||||||
+ ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void removeEventContext() {
|
|
||||||
+ removePluginContext();
|
|
||||||
+ removeSenderContext();
|
|
||||||
+ ThreadContext.remove("pufferfishsentry_eventdata");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private static Map<String, String> serializeFields(Object object) {
|
|
||||||
+ Map<String, String> fields = new TreeMap<>();
|
|
||||||
+ fields.put("_class", object.getClass().getName());
|
|
||||||
+ for (Field declaredField : object.getClass().getDeclaredFields()) {
|
|
||||||
+ try {
|
|
||||||
+ if (Modifier.isStatic(declaredField.getModifiers())) {
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ String fieldName = declaredField.getName();
|
|
||||||
+ if (fieldName.equals("handlers")) {
|
|
||||||
+ continue;
|
|
||||||
+ }
|
|
||||||
+ declaredField.setAccessible(true);
|
|
||||||
+ Object value = declaredField.get(object);
|
|
||||||
+ if (value != null) {
|
|
||||||
+ fields.put(fieldName, value.toString());
|
|
||||||
+ } else {
|
|
||||||
+ fields.put(fieldName, "<null>");
|
|
||||||
+ }
|
|
||||||
+ } catch (Exception ignored) {
|
|
||||||
+ } // We can't really safely log exceptions.
|
|
||||||
+ }
|
|
||||||
+ return fields;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static class State {
|
|
||||||
+
|
|
||||||
+ private Plugin plugin;
|
|
||||||
+ private Command command;
|
|
||||||
+ private String commandLine;
|
|
||||||
+ private Event event;
|
|
||||||
+ private RegisteredListener registeredListener;
|
|
||||||
+
|
|
||||||
+ public Plugin getPlugin() {
|
|
||||||
+ return plugin;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setPlugin(Plugin plugin) {
|
|
||||||
+ this.plugin = plugin;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public Command getCommand() {
|
|
||||||
+ return command;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setCommand(Command command) {
|
|
||||||
+ this.command = command;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public String getCommandLine() {
|
|
||||||
+ return commandLine;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setCommandLine(String commandLine) {
|
|
||||||
+ this.commandLine = commandLine;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public Event getEvent() {
|
|
||||||
+ return event;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setEvent(Event event) {
|
|
||||||
+ this.event = event;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public RegisteredListener getRegisteredListener() {
|
|
||||||
+ return registeredListener;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public void setRegisteredListener(RegisteredListener registeredListener) {
|
|
||||||
+ this.registeredListener = registeredListener;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||||
index ab36e3aaff57e2f27b5aed06b4bdfe277f86a35e..96da9f1082ab134d197b3a6069f2fcdf38585efe 100644
|
index ab36e3aaff57e2f27b5aed06b4bdfe277f86a35e..96da9f1082ab134d197b3a6069f2fcdf38585efe 100644
|
||||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||||
|
|||||||
@@ -4,179 +4,8 @@ Date: Sun, 12 Jan 2025 14:00:28 +0800
|
|||||||
Subject: [PATCH] Pufferfish SIMD Utilities
|
Subject: [PATCH] Pufferfish SIMD Utilities
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..856de1331b15542c00e01990f471fa5152722c11
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
|
|
||||||
@@ -0,0 +1,35 @@
|
|
||||||
+package gg.pufferfish.pufferfish.simd;
|
|
||||||
+
|
|
||||||
+import jdk.incubator.vector.FloatVector;
|
|
||||||
+import jdk.incubator.vector.IntVector;
|
|
||||||
+import jdk.incubator.vector.VectorSpecies;
|
|
||||||
+import org.slf4j.Logger;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * Basically, java is annoying and we have to push this out to its own class.
|
|
||||||
+ */
|
|
||||||
+@Deprecated
|
|
||||||
+public class SIMDChecker {
|
|
||||||
+
|
|
||||||
+ @Deprecated
|
|
||||||
+ public static boolean canEnable(Logger logger) {
|
|
||||||
+ try {
|
|
||||||
+ SIMDDetection.testRun = true;
|
|
||||||
+
|
|
||||||
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
|
|
||||||
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
|
|
||||||
+
|
|
||||||
+ logger.info("Max SIMD vector size on this system is {} bits (int)", ISPEC.vectorBitSize());
|
|
||||||
+ logger.info("Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
|
|
||||||
+
|
|
||||||
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
|
|
||||||
+ logger.warn("SIMD is not properly supported on this system!");
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return true;
|
|
||||||
+ } catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..0a64cd0e88083ac4af6674ad0fb07b771109c737
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
|
|
||||||
@@ -0,0 +1,34 @@
|
|
||||||
+package gg.pufferfish.pufferfish.simd;
|
|
||||||
+
|
|
||||||
+import org.slf4j.Logger;
|
|
||||||
+
|
|
||||||
+@Deprecated
|
|
||||||
+public class SIMDDetection {
|
|
||||||
+
|
|
||||||
+ public static boolean isEnabled = false;
|
|
||||||
+ public static boolean testRun = false;
|
|
||||||
+
|
|
||||||
+ @Deprecated
|
|
||||||
+ public static boolean canEnable(Logger logger) {
|
|
||||||
+ try {
|
|
||||||
+ return SIMDChecker.canEnable(logger);
|
|
||||||
+ } catch (NoClassDefFoundError | Exception ignored) {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Deprecated
|
|
||||||
+ public static int getJavaVersion() {
|
|
||||||
+ // https://stackoverflow.com/a/2591122
|
|
||||||
+ String version = System.getProperty("java.version");
|
|
||||||
+ if(version.startsWith("1.")) {
|
|
||||||
+ version = version.substring(2, 3);
|
|
||||||
+ } else {
|
|
||||||
+ int dot = version.indexOf(".");
|
|
||||||
+ if(dot != -1) { version = version.substring(0, dot); }
|
|
||||||
+ }
|
|
||||||
+ version = version.split("-")[0]; // Azul is stupid
|
|
||||||
+ return Integer.parseInt(version);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..c26dcaaa2e85882730c854099df80d69eec70f33
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
|
|
||||||
@@ -0,0 +1,84 @@
|
|
||||||
+package gg.pufferfish.pufferfish.simd;
|
|
||||||
+
|
|
||||||
+import jdk.incubator.vector.FloatVector;
|
|
||||||
+import jdk.incubator.vector.IntVector;
|
|
||||||
+import jdk.incubator.vector.VectorMask;
|
|
||||||
+import jdk.incubator.vector.VectorSpecies;
|
|
||||||
+import org.bukkit.map.MapPalette;
|
|
||||||
+
|
|
||||||
+import java.awt.*;
|
|
||||||
+
|
|
||||||
+@Deprecated
|
|
||||||
+public class VectorMapPalette {
|
|
||||||
+
|
|
||||||
+ private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
|
|
||||||
+ private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
|
|
||||||
+
|
|
||||||
+ @Deprecated
|
|
||||||
+ public static void matchColorVectorized(int[] in, byte[] out) {
|
|
||||||
+ int speciesLength = I_SPEC.length();
|
|
||||||
+ int i;
|
|
||||||
+ for (i = 0; i < in.length - speciesLength; i += speciesLength) {
|
|
||||||
+ float[] redsArr = new float[speciesLength];
|
|
||||||
+ float[] bluesArr = new float[speciesLength];
|
|
||||||
+ float[] greensArr = new float[speciesLength];
|
|
||||||
+ int[] alphasArr = new int[speciesLength];
|
|
||||||
+
|
|
||||||
+ for (int j = 0; j < speciesLength; j++) {
|
|
||||||
+ alphasArr[j] = (in[i + j] >> 24) & 0xFF;
|
|
||||||
+ redsArr[j] = (in[i + j] >> 16) & 0xFF;
|
|
||||||
+ greensArr[j] = (in[i + j] >> 8) & 0xFF;
|
|
||||||
+ bluesArr[j] = (in[i + j] >> 0) & 0xFF;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
|
|
||||||
+ FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
|
|
||||||
+ FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
|
|
||||||
+ FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
|
|
||||||
+ IntVector resultIndex = IntVector.zero(I_SPEC);
|
|
||||||
+ VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
|
|
||||||
+
|
|
||||||
+ modificationMask = modificationMask.and(alphas.lt(128).not());
|
|
||||||
+ FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
|
|
||||||
+
|
|
||||||
+ for (int c = 4; c < MapPalette.colors.length; c++) {
|
|
||||||
+ // We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
|
|
||||||
+ // For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
|
|
||||||
+ FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
|
|
||||||
+ FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
|
|
||||||
+ FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
|
|
||||||
+
|
|
||||||
+ FloatVector rMean = reds.add(compReds).div(2.0f);
|
|
||||||
+ FloatVector rDiff = reds.sub(compReds);
|
|
||||||
+ FloatVector gDiff = greens.sub(compGreens);
|
|
||||||
+ FloatVector bDiff = blues.sub(compBlues);
|
|
||||||
+
|
|
||||||
+ FloatVector weightR = rMean.div(256.0f).add(2);
|
|
||||||
+ FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
|
|
||||||
+ FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
|
|
||||||
+
|
|
||||||
+ FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
|
|
||||||
+
|
|
||||||
+ // Now we compare to the best distance we've found.
|
|
||||||
+ // This mask contains a "1" if better, and a "0" otherwise.
|
|
||||||
+ VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
|
|
||||||
+ bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
|
|
||||||
+
|
|
||||||
+ // Update the result array
|
|
||||||
+ // We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
|
|
||||||
+ resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ for (int j = 0; j < speciesLength; j++) {
|
|
||||||
+ int index = resultIndex.lane(j);
|
|
||||||
+ out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // For the final ones, fall back to the regular method
|
|
||||||
+ for (; i < in.length; i++) {
|
|
||||||
+ out[i] = MapPalette.matchColor(new Color(in[i], true));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
||||||
index fc9728342de7605da69813fb44b008c1343124c0..d322e6c47d751b41e4b2f2fc45bb8d7498bff21d 100644
|
index fd6f3bce50a66004687b08fd80568543f814747a..bc565037b855f2063bdcbc6c5742b1985e27bff0 100644
|
||||||
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
||||||
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
||||||
@@ -35,7 +35,7 @@ public final class MapPalette {
|
@@ -35,7 +35,7 @@ public final class MapPalette {
|
||||||
@@ -186,7 +15,7 @@ index fc9728342de7605da69813fb44b008c1343124c0..d322e6c47d751b41e4b2f2fc45bb8d74
|
|||||||
- static final Color[] colors = {
|
- static final Color[] colors = {
|
||||||
+ public static final Color[] colors = { // Luminol - package-private -> public
|
+ public static final Color[] colors = { // Luminol - package-private -> public
|
||||||
// Start generate - MapPalette#colors
|
// Start generate - MapPalette#colors
|
||||||
// @GeneratedFrom 1.21.5
|
// @GeneratedFrom 1.21.6
|
||||||
new Color(0x00000000, true),
|
new Color(0x00000000, true),
|
||||||
@@ -395,9 +395,11 @@ public final class MapPalette {
|
@@ -395,9 +395,11 @@ public final class MapPalette {
|
||||||
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
|
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
|
||||||
|
|||||||
@@ -4,198 +4,11 @@ Date: Mon, 27 Jan 2025 13:01:59 +0800
|
|||||||
Subject: [PATCH] Tick regions api
|
Subject: [PATCH] Tick regions api
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/RegionStats.java b/src/main/java/me/earthme/luminol/api/RegionStats.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..96147cace1550d14c682258dab0397587dcf76a4
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/RegionStats.java
|
|
||||||
@@ -0,0 +1,25 @@
|
|
||||||
+package me.earthme.luminol.api;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A simple package of folia's tick region state.It linked to the RegionStats of the nms part so that</br>
|
|
||||||
+ * You could call these methods to get the status of this tick region</br>
|
|
||||||
+ */
|
|
||||||
+public interface RegionStats {
|
|
||||||
+ /**
|
|
||||||
+ * Get the entity count in this tick region
|
|
||||||
+ * @return the entity count
|
|
||||||
+ */
|
|
||||||
+ int getEntityCount();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the player count in this tick region
|
|
||||||
+ * @return the player count
|
|
||||||
+ */
|
|
||||||
+ int getPlayerCount();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the chunk count in this tick region
|
|
||||||
+ * @return the chunk count
|
|
||||||
+ */
|
|
||||||
+ int getChunkCount();
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/ThreadedRegion.java b/src/main/java/me/earthme/luminol/api/ThreadedRegion.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..01dac0602b5f66f80c0adfbb779666fe0325a24f
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/ThreadedRegion.java
|
|
||||||
@@ -0,0 +1,56 @@
|
|
||||||
+package me.earthme.luminol.api;
|
|
||||||
+
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
+import org.bukkit.World;
|
|
||||||
+
|
|
||||||
+import javax.annotation.Nullable;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A mirror of folia's ThreadedRegion</br>
|
|
||||||
+ * Including some handy methods to get the information of the tick region</br>
|
|
||||||
+ * Note: You should call these methods inside this tick region's thread context
|
|
||||||
+ */
|
|
||||||
+public interface ThreadedRegion {
|
|
||||||
+ /**
|
|
||||||
+ * Get the center chunk pos of this tick region</br>
|
|
||||||
+ * Note:</br>
|
|
||||||
+ * 1.Global region will return a null value(But we don't finish the global region yet()</br>
|
|
||||||
+ * 2.You should call these methods inside this tick region's thread context
|
|
||||||
+ * @return The center chunk pos
|
|
||||||
+ */
|
|
||||||
+ @Nullable
|
|
||||||
+ Location getCenterChunkPos();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the dead section percent of this tick region
|
|
||||||
+ * Note: </br>
|
|
||||||
+ * 1.Dead percent is mean the percent of the unloaded chunk count of this tick region, which is also used for determine
|
|
||||||
+ * that the tick region should or not check for splitting</br>
|
|
||||||
+ * 2.You should call these methods inside this tick region's thread context
|
|
||||||
+ * @return The dead section percent
|
|
||||||
+ */
|
|
||||||
+ double getDeadSectionPercent();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the tick region data of this tick region</br>
|
|
||||||
+ * Note:</br>
|
|
||||||
+ * 1.You should call this method inside this tick region's thread context</br>
|
|
||||||
+ * 2.You should call these methods inside this tick region's thread context
|
|
||||||
+ * @return The tick region data
|
|
||||||
+ */
|
|
||||||
+ TickRegionData getTickRegionData();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the world of this tick region</br>
|
|
||||||
+ * Note: Global region will return a null value too
|
|
||||||
+ * @return The world of this tick region
|
|
||||||
+ */
|
|
||||||
+ @Nullable
|
|
||||||
+ World getWorld();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the id of the tick region</br>
|
|
||||||
+ * @return The id of the tick region
|
|
||||||
+ */
|
|
||||||
+ long getId();
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/ThreadedRegionizer.java b/src/main/java/me/earthme/luminol/api/ThreadedRegionizer.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..ff31a68a019fd9e5e687e6818f8729f4950bc060
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/ThreadedRegionizer.java
|
|
||||||
@@ -0,0 +1,56 @@
|
|
||||||
+package me.earthme.luminol.api;
|
|
||||||
+
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+import org.jetbrains.annotations.Nullable;
|
|
||||||
+
|
|
||||||
+import java.util.Collection;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A mirror of folia's ThreadedRegionizer
|
|
||||||
+ */
|
|
||||||
+public interface ThreadedRegionizer {
|
|
||||||
+ /**
|
|
||||||
+ * Get all the tick regions
|
|
||||||
+ * @return Temporary copied collection of all tick regions
|
|
||||||
+ */
|
|
||||||
+ Collection<ThreadedRegion> getAllRegions();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the tick region at the given chunk coordinates
|
|
||||||
+ * @param chunkX Chunk X
|
|
||||||
+ * @param chunkZ Chunk Z
|
|
||||||
+ * @return The tick region at the given chunk coordinates
|
|
||||||
+ */
|
|
||||||
+ @Nullable
|
|
||||||
+ ThreadedRegion getAtSynchronized(int chunkX, int chunkZ);
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the tick region at the given chunk coordinates
|
|
||||||
+ * @param chunkX Chunk X
|
|
||||||
+ * @param chunkZ Chunk Z
|
|
||||||
+ * @return The tick region at the given chunk coordinates
|
|
||||||
+ */
|
|
||||||
+ @Nullable
|
|
||||||
+ ThreadedRegion getAtUnSynchronized(int chunkX, int chunkZ);
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the tick region at the given location
|
|
||||||
+ * @param pos The location
|
|
||||||
+ * @return The tick region at the given location
|
|
||||||
+ */
|
|
||||||
+ @Nullable
|
|
||||||
+ default ThreadedRegion getAtSynchronized(@NotNull Location pos) {
|
|
||||||
+ return this.getAtSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the tick region at the given location
|
|
||||||
+ * @param pos The location
|
|
||||||
+ * @return The tick region at the given location
|
|
||||||
+ */
|
|
||||||
+ @Nullable
|
|
||||||
+ default ThreadedRegion getAtUnSynchronized(@NotNull Location pos) {
|
|
||||||
+ return this.getAtUnSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/TickRegionData.java b/src/main/java/me/earthme/luminol/api/TickRegionData.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..ecde4462b08d701b8bff9f26902f17754cf791dd
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/TickRegionData.java
|
|
||||||
@@ -0,0 +1,26 @@
|
|
||||||
+package me.earthme.luminol.api;
|
|
||||||
+
|
|
||||||
+import org.bukkit.World;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A mirror of folia's tick region data
|
|
||||||
+ */
|
|
||||||
+public interface TickRegionData {
|
|
||||||
+ /**
|
|
||||||
+ * Get the world it's currently holding
|
|
||||||
+ * @return the world
|
|
||||||
+ */
|
|
||||||
+ World getWorld();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the current tick count
|
|
||||||
+ * @return the current tick count
|
|
||||||
+ */
|
|
||||||
+ long getCurrentTickCount();
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the region stats
|
|
||||||
+ * @return the region stats
|
|
||||||
+ */
|
|
||||||
+ RegionStats getRegionStats();
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||||
index a8b64f78bf3c453094074b4b4d3c8fd07b9eb273..7927012c1afe5289d22879353a88a4574da91e01 100644
|
index 04a1379f5fe281ab72610d2f8f18e1355fe3a134..d5116c1014ce123d831ce93c6204284a9642cc56 100644
|
||||||
--- a/src/main/java/org/bukkit/World.java
|
--- a/src/main/java/org/bukkit/World.java
|
||||||
+++ b/src/main/java/org/bukkit/World.java
|
+++ b/src/main/java/org/bukkit/World.java
|
||||||
@@ -4444,4 +4444,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
@@ -4462,4 +4462,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,3 +53,31 @@ index 76c08499b704a6cb0cb95ce69b9a9248d69cc127..d516595a8675a9f3d9c14658b66160ba
|
|||||||
+ }
|
+ }
|
||||||
+ // Leaves end - exp fix
|
+ // Leaves end - exp fix
|
||||||
}
|
}
|
||||||
|
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||||
|
index 6316a2f1d2dc0314397e33e6dbd354fb8bc50541..6e2d1bf0e8eb9fa4917b464324a02b9b5d0dd496 100644
|
||||||
|
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||||
|
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
||||||
|
@@ -25,6 +25,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||||
|
private boolean doExpDrop;
|
||||||
|
private boolean keepLevel = false;
|
||||||
|
private boolean keepInventory = false;
|
||||||
|
+ private boolean useApiExpDropStatus = false; // Leaves - exp fix
|
||||||
|
@Deprecated
|
||||||
|
private final List<ItemStack> itemsToKeep = new ArrayList<>();
|
||||||
|
|
||||||
|
@@ -82,8 +83,15 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||||
|
this.showDeathMessages = true;
|
||||||
|
this.deathMessage = LegacyComponentSerializer.legacySection().deserializeOrNull(deathMessage);
|
||||||
|
this.doExpDrop = doExpDrop;
|
||||||
|
+ this.useApiExpDropStatus = true; // Leaves - exp fix
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Leaves start - exp fix
|
||||||
|
+ public boolean forceUseEventDropStatus() {
|
||||||
|
+ return this.useApiExpDropStatus;
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - exp fix
|
||||||
|
+
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Player getEntity() {
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: MrHua269 <wangxyper@163.com>
|
From: MrHua269 <mrhua269@gmail.com>
|
||||||
Date: Thu, 30 Jan 2025 09:29:03 +0800
|
Date: Thu, 12 Jun 2025 08:00:15 +0800
|
||||||
Subject: [PATCH] Purpur Lobotomize stuck villagers
|
Subject: [PATCH] Purpur Lobotomize stuck villagers
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||||
index 02b86d9615f8150b13ff0beefd5ca502c0494f99..3a444609ea9fdeee9057d593fbd4d38cc9e1ad68 100644
|
index 4d88bb2eaa43709fb6103a6f77d8c01e83bfe743..60b87d52c20cec947b196f47fc333bc643accbd2 100644
|
||||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||||
@@ -391,4 +391,13 @@ public interface Villager extends AbstractVillager {
|
@@ -408,4 +408,13 @@ public interface Villager extends AbstractVillager {
|
||||||
* reputation regardless of its impact and the player associated.
|
* Demand is still updated even if all events are canceled.
|
||||||
*/
|
*/
|
||||||
public void clearReputations();
|
public void restock();
|
||||||
+ // Purpur start
|
+ // Purpur start
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
|||||||
@@ -1,357 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MrHua269 <wangxyper@163.com>
|
|
||||||
Date: Fri, 31 Jan 2025 20:28:47 +0800
|
|
||||||
Subject: [PATCH] Add missing teleportation apis for folia
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/entity/EntityTeleportAsyncEvent.java b/src/main/java/me/earthme/luminol/api/entity/EntityTeleportAsyncEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..a31c803831dad3d31386924cbe27deff59855fc9
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/entity/EntityTeleportAsyncEvent.java
|
|
||||||
@@ -0,0 +1,68 @@
|
|
||||||
+package me.earthme.luminol.api.entity;
|
|
||||||
+
|
|
||||||
+import org.apache.commons.lang3.Validate;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
+import org.bukkit.entity.Entity;
|
|
||||||
+import org.bukkit.event.Cancellable;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.HandlerList;
|
|
||||||
+import org.bukkit.event.player.PlayerTeleportEvent;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A simple event fired when a teleportAsync was called
|
|
||||||
+ * @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause)
|
|
||||||
+ * @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location)
|
|
||||||
+ * (Also fired when teleportAsync called from nms)
|
|
||||||
+ */
|
|
||||||
+public class EntityTeleportAsyncEvent extends Event {
|
|
||||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
|
||||||
+
|
|
||||||
+ private final Entity entity;
|
|
||||||
+ private final PlayerTeleportEvent.TeleportCause teleportCause;
|
|
||||||
+ private final Location destination;
|
|
||||||
+
|
|
||||||
+ public EntityTeleportAsyncEvent(Entity entity, PlayerTeleportEvent.TeleportCause teleportCause, Location destination) {
|
|
||||||
+ Validate.notNull(entity, "entity cannot be a null value!");
|
|
||||||
+ Validate.notNull(teleportCause, "teleportCause cannot be a null value!");
|
|
||||||
+ Validate.notNull(destination, "destination cannot be a null value!");
|
|
||||||
+
|
|
||||||
+ this.entity = entity;
|
|
||||||
+ this.teleportCause = teleportCause;
|
|
||||||
+ this.destination = destination;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the entity is about to be teleported
|
|
||||||
+ * @return that entity
|
|
||||||
+ */
|
|
||||||
+ public @NotNull Entity getEntity() {
|
|
||||||
+ return this.entity;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the cause of the teleport
|
|
||||||
+ * @return the cause
|
|
||||||
+ */
|
|
||||||
+ public @NotNull PlayerTeleportEvent.TeleportCause getTeleportCause() {
|
|
||||||
+ return this.teleportCause;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the destination of the teleport
|
|
||||||
+ * @return the destination
|
|
||||||
+ */
|
|
||||||
+ public @NotNull Location getDestination() {
|
|
||||||
+ return this.destination;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public @NotNull HandlerList getHandlers() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @NotNull
|
|
||||||
+ public static HandlerList getHandlerList() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/entity/PostEntityPortalEvent.java b/src/main/java/me/earthme/luminol/api/entity/PostEntityPortalEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..dd3087b407ccf4e96448701e6fbf75705498f982
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/entity/PostEntityPortalEvent.java
|
|
||||||
@@ -0,0 +1,41 @@
|
|
||||||
+package me.earthme.luminol.api.entity;
|
|
||||||
+
|
|
||||||
+import org.apache.commons.lang3.Validate;
|
|
||||||
+import org.bukkit.entity.Entity;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.HandlerList;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A simple event created for missing teleport events api of folia
|
|
||||||
+ * This event is fired when the entity portal process has been done
|
|
||||||
+ */
|
|
||||||
+public class PostEntityPortalEvent extends Event {
|
|
||||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
|
||||||
+
|
|
||||||
+ private final Entity teleportedEntity;
|
|
||||||
+
|
|
||||||
+ public PostEntityPortalEvent(Entity teleportedEntity) {
|
|
||||||
+ Validate.notNull(teleportedEntity, "teleportedEntity cannot be null!");
|
|
||||||
+
|
|
||||||
+ this.teleportedEntity = teleportedEntity;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the entity which was teleported
|
|
||||||
+ * @return the entity which was teleported
|
|
||||||
+ */
|
|
||||||
+ public Entity getTeleportedEntity() {
|
|
||||||
+ return this.teleportedEntity;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public @NotNull HandlerList getHandlers() {
|
|
||||||
+ return HANDLER_LIST;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @NotNull
|
|
||||||
+ public static HandlerList getHandlerList() {
|
|
||||||
+ return HANDLER_LIST;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/entity/PreEntityPortalEvent.java b/src/main/java/me/earthme/luminol/api/entity/PreEntityPortalEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..fc844429e3ecfe2529c0a49b8a5d958eeb188ad9
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/entity/PreEntityPortalEvent.java
|
|
||||||
@@ -0,0 +1,78 @@
|
|
||||||
+package me.earthme.luminol.api.entity;
|
|
||||||
+
|
|
||||||
+import org.apache.commons.lang3.Validate;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
+import org.bukkit.World;
|
|
||||||
+import org.bukkit.entity.Entity;
|
|
||||||
+import org.bukkit.event.Cancellable;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.HandlerList;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A simple event created for missing teleport events api of folia
|
|
||||||
+ * This event will be fired when a portal teleportation is about to happen
|
|
||||||
+ */
|
|
||||||
+public class PreEntityPortalEvent extends Event implements Cancellable {
|
|
||||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
|
||||||
+
|
|
||||||
+ private final Entity entity;
|
|
||||||
+ private final Location portalPos;
|
|
||||||
+ private final World destination;
|
|
||||||
+
|
|
||||||
+ private boolean cancelled = false;
|
|
||||||
+
|
|
||||||
+ public PreEntityPortalEvent(Entity entity, Location portalPos, World destination) {
|
|
||||||
+ Validate.notNull(entity, "entity cannot be null!");
|
|
||||||
+ Validate.notNull(portalPos, "portalPos cannot be null!");
|
|
||||||
+ Validate.notNull(destination, "destination cannot be null!");
|
|
||||||
+
|
|
||||||
+ this.entity = entity;
|
|
||||||
+ this.portalPos = portalPos;
|
|
||||||
+ this.destination = destination;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the entity that is about to teleport
|
|
||||||
+ * @return the entity
|
|
||||||
+ */
|
|
||||||
+ public @NotNull Entity getEntity() {
|
|
||||||
+ return this.entity;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the location of the portal
|
|
||||||
+ * @return the portal location
|
|
||||||
+ */
|
|
||||||
+ public @NotNull Location getPortalPos() {
|
|
||||||
+ return this.portalPos;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the destination world
|
|
||||||
+ * @return the destination world
|
|
||||||
+ */
|
|
||||||
+ public @NotNull World getDestination() {
|
|
||||||
+ return this.destination;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isCancelled() {
|
|
||||||
+ return this.cancelled;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void setCancelled(boolean cancel) {
|
|
||||||
+ this.cancelled = cancel;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public @NotNull HandlerList getHandlers() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @NotNull
|
|
||||||
+ public static HandlerList getHandlerList() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/entity/player/PostPlayerRespawnEvent.java b/src/main/java/me/earthme/luminol/api/entity/player/PostPlayerRespawnEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..9a561455560dfeee1d8762297ebf15a7c11de4d1
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/entity/player/PostPlayerRespawnEvent.java
|
|
||||||
@@ -0,0 +1,40 @@
|
|
||||||
+package me.earthme.luminol.api.entity.player;
|
|
||||||
+
|
|
||||||
+import org.apache.commons.lang3.Validate;
|
|
||||||
+import org.bukkit.entity.Player;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.HandlerList;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A simple event fired when the respawn process of player is done
|
|
||||||
+ */
|
|
||||||
+public class PostPlayerRespawnEvent extends Event {
|
|
||||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
|
||||||
+
|
|
||||||
+ private final Player player;
|
|
||||||
+
|
|
||||||
+ public PostPlayerRespawnEvent(Player player) {
|
|
||||||
+ Validate.notNull(player, "Player cannot be a null value!");
|
|
||||||
+
|
|
||||||
+ this.player = player;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the respawned player
|
|
||||||
+ * @return the player
|
|
||||||
+ */
|
|
||||||
+ public @NotNull Player getPlayer() {
|
|
||||||
+ return this.player;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public @NotNull HandlerList getHandlers() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @NotNull
|
|
||||||
+ public static HandlerList getHandlerList() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/portal/EndPlatformCreateEvent.java b/src/main/java/me/earthme/luminol/api/portal/EndPlatformCreateEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..cf87a7cce5d1ebec9709b762595609344807150b
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/portal/EndPlatformCreateEvent.java
|
|
||||||
@@ -0,0 +1,35 @@
|
|
||||||
+package me.earthme.luminol.api.portal;
|
|
||||||
+
|
|
||||||
+import org.bukkit.event.Cancellable;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.HandlerList;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A event fired when an end platform is created.
|
|
||||||
+ */
|
|
||||||
+public class EndPlatformCreateEvent extends Event implements Cancellable {
|
|
||||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
|
||||||
+
|
|
||||||
+ private boolean cancelled = false;
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isCancelled() {
|
|
||||||
+ return this.cancelled;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void setCancelled(boolean cancel) {
|
|
||||||
+ this.cancelled = cancel;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public @NotNull HandlerList getHandlers() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @NotNull
|
|
||||||
+ public static HandlerList getHandlerList() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/me/earthme/luminol/api/portal/PortalLocateEvent.java b/src/main/java/me/earthme/luminol/api/portal/PortalLocateEvent.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..e09ffb99aad6f6acca3d6a411877715b90413eb0
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/me/earthme/luminol/api/portal/PortalLocateEvent.java
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+package me.earthme.luminol.api.portal;
|
|
||||||
+
|
|
||||||
+import org.apache.commons.lang3.Validate;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
+import org.bukkit.event.Event;
|
|
||||||
+import org.bukkit.event.HandlerList;
|
|
||||||
+import org.jetbrains.annotations.NotNull;
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * A event fired when the portal process started locating the destination position
|
|
||||||
+ * Notice: If you changed the destination to an another position in end teleportation.The end platform won't create under the entity and won't create
|
|
||||||
+ * if the position is out of current tick region
|
|
||||||
+ */
|
|
||||||
+public class PortalLocateEvent extends Event {
|
|
||||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
|
||||||
+
|
|
||||||
+ private final Location original;
|
|
||||||
+ private final Location destination;
|
|
||||||
+
|
|
||||||
+ public PortalLocateEvent(Location original, Location destination) {
|
|
||||||
+ Validate.notNull(original, "original couldn't be null!");
|
|
||||||
+ Validate.notNull(destination, "destination couldn't be null!");
|
|
||||||
+
|
|
||||||
+ this.original = original;
|
|
||||||
+ this.destination = destination;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the destination position of this teleportation
|
|
||||||
+ * @return the destination position
|
|
||||||
+ */
|
|
||||||
+ public Location getDestination() {
|
|
||||||
+ return this.destination;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Get the original portal position of this teleportation
|
|
||||||
+ * @return the original portal position
|
|
||||||
+ */
|
|
||||||
+ public Location getOriginal() {
|
|
||||||
+ return this.original;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public @NotNull HandlerList getHandlers() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @NotNull
|
|
||||||
+ public static HandlerList getHandlerList() {
|
|
||||||
+ return HANDLERS;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
||||||
Date: Sat, 24 May 2025 01:47:10 +0800
|
|
||||||
Subject: [PATCH] Leaves Fix SculkCatalyst exp skip
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
|
||||||
index 6316a2f1d2dc0314397e33e6dbd354fb8bc50541..6e2d1bf0e8eb9fa4917b464324a02b9b5d0dd496 100644
|
|
||||||
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
|
||||||
@@ -25,6 +25,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
|
||||||
private boolean doExpDrop;
|
|
||||||
private boolean keepLevel = false;
|
|
||||||
private boolean keepInventory = false;
|
|
||||||
+ private boolean useApiExpDropStatus = false; // Leaves - exp fix
|
|
||||||
@Deprecated
|
|
||||||
private final List<ItemStack> itemsToKeep = new ArrayList<>();
|
|
||||||
|
|
||||||
@@ -82,8 +83,15 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
|
||||||
this.showDeathMessages = true;
|
|
||||||
this.deathMessage = LegacyComponentSerializer.legacySection().deserializeOrNull(deathMessage);
|
|
||||||
this.doExpDrop = doExpDrop;
|
|
||||||
+ this.useApiExpDropStatus = true; // Leaves - exp fix
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Leaves start - exp fix
|
|
||||||
+ public boolean forceUseEventDropStatus() {
|
|
||||||
+ return this.useApiExpDropStatus;
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - exp fix
|
|
||||||
+
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
public Player getEntity() {
|
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
package gg.pufferfish.pufferfish.sentry;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.ThreadContext;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.player.PlayerEvent;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import org.bukkit.plugin.RegisteredListener;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
public class SentryContext {
|
||||||
|
|
||||||
|
private static final Gson GSON = new Gson();
|
||||||
|
|
||||||
|
public static void setPluginContext(@Nullable Plugin plugin) {
|
||||||
|
if (plugin != null) {
|
||||||
|
ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
|
||||||
|
ThreadContext.put("pufferfishsentry_pluginversion", plugin.getPluginMeta().getVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removePluginContext() {
|
||||||
|
ThreadContext.remove("pufferfishsentry_pluginname");
|
||||||
|
ThreadContext.remove("pufferfishsentry_pluginversion");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setSenderContext(@Nullable CommandSender sender) {
|
||||||
|
if (sender != null) {
|
||||||
|
ThreadContext.put("pufferfishsentry_playername", sender.getName());
|
||||||
|
if (sender instanceof Player player) {
|
||||||
|
ThreadContext.put("pufferfishsentry_playerid", player.getUniqueId().toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeSenderContext() {
|
||||||
|
ThreadContext.remove("pufferfishsentry_playername");
|
||||||
|
ThreadContext.remove("pufferfishsentry_playerid");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setEventContext(Event event, RegisteredListener registration) {
|
||||||
|
setPluginContext(registration.getPlugin());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Find the player that was involved with this event
|
||||||
|
Player player = null;
|
||||||
|
if (event instanceof PlayerEvent) {
|
||||||
|
player = ((PlayerEvent) event).getPlayer();
|
||||||
|
} else {
|
||||||
|
Class<? extends Event> eventClass = event.getClass();
|
||||||
|
|
||||||
|
Field playerField = null;
|
||||||
|
|
||||||
|
for (Field field : eventClass.getDeclaredFields()) {
|
||||||
|
if (field.getType().equals(Player.class)) {
|
||||||
|
playerField = field;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playerField != null) {
|
||||||
|
playerField.setAccessible(true);
|
||||||
|
player = (Player) playerField.get(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player != null) {
|
||||||
|
setSenderContext(player);
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
} // We can't really safely log exceptions.
|
||||||
|
|
||||||
|
ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeEventContext() {
|
||||||
|
removePluginContext();
|
||||||
|
removeSenderContext();
|
||||||
|
ThreadContext.remove("pufferfishsentry_eventdata");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, String> serializeFields(Object object) {
|
||||||
|
Map<String, String> fields = new TreeMap<>();
|
||||||
|
fields.put("_class", object.getClass().getName());
|
||||||
|
for (Field declaredField : object.getClass().getDeclaredFields()) {
|
||||||
|
try {
|
||||||
|
if (Modifier.isStatic(declaredField.getModifiers())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String fieldName = declaredField.getName();
|
||||||
|
if (fieldName.equals("handlers")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
declaredField.setAccessible(true);
|
||||||
|
Object value = declaredField.get(object);
|
||||||
|
if (value != null) {
|
||||||
|
fields.put(fieldName, value.toString());
|
||||||
|
} else {
|
||||||
|
fields.put(fieldName, "<null>");
|
||||||
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
} // We can't really safely log exceptions.
|
||||||
|
}
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class State {
|
||||||
|
|
||||||
|
private Plugin plugin;
|
||||||
|
private Command command;
|
||||||
|
private String commandLine;
|
||||||
|
private Event event;
|
||||||
|
private RegisteredListener registeredListener;
|
||||||
|
|
||||||
|
public Plugin getPlugin() {
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlugin(Plugin plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Command getCommand() {
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommand(Command command) {
|
||||||
|
this.command = command;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommandLine() {
|
||||||
|
return commandLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommandLine(String commandLine) {
|
||||||
|
this.commandLine = commandLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Event getEvent() {
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEvent(Event event) {
|
||||||
|
this.event = event;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RegisteredListener getRegisteredListener() {
|
||||||
|
return registeredListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegisteredListener(RegisteredListener registeredListener) {
|
||||||
|
this.registeredListener = registeredListener;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package gg.pufferfish.pufferfish.simd;
|
||||||
|
|
||||||
|
import jdk.incubator.vector.FloatVector;
|
||||||
|
import jdk.incubator.vector.IntVector;
|
||||||
|
import jdk.incubator.vector.VectorSpecies;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basically, java is annoying and we have to push this out to its own class.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public class SIMDChecker {
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static boolean canEnable(Logger logger) {
|
||||||
|
try {
|
||||||
|
SIMDDetection.testRun = true;
|
||||||
|
|
||||||
|
VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
|
||||||
|
VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
|
||||||
|
|
||||||
|
logger.info("Max SIMD vector size on this system is {} bits (int)", ISPEC.vectorBitSize());
|
||||||
|
logger.info("Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
|
||||||
|
|
||||||
|
if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
|
||||||
|
logger.warn("SIMD is not properly supported on this system!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package gg.pufferfish.pufferfish.simd;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public class SIMDDetection {
|
||||||
|
|
||||||
|
public static boolean isEnabled = false;
|
||||||
|
public static boolean testRun = false;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static boolean canEnable(Logger logger) {
|
||||||
|
try {
|
||||||
|
return SIMDChecker.canEnable(logger);
|
||||||
|
} catch (NoClassDefFoundError | Exception ignored) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static int getJavaVersion() {
|
||||||
|
// https://stackoverflow.com/a/2591122
|
||||||
|
String version = System.getProperty("java.version");
|
||||||
|
if(version.startsWith("1.")) {
|
||||||
|
version = version.substring(2, 3);
|
||||||
|
} else {
|
||||||
|
int dot = version.indexOf(".");
|
||||||
|
if(dot != -1) { version = version.substring(0, dot); }
|
||||||
|
}
|
||||||
|
version = version.split("-")[0]; // Azul is stupid
|
||||||
|
return Integer.parseInt(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package gg.pufferfish.pufferfish.simd;
|
||||||
|
|
||||||
|
import jdk.incubator.vector.FloatVector;
|
||||||
|
import jdk.incubator.vector.IntVector;
|
||||||
|
import jdk.incubator.vector.VectorMask;
|
||||||
|
import jdk.incubator.vector.VectorSpecies;
|
||||||
|
import org.bukkit.map.MapPalette;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public class VectorMapPalette {
|
||||||
|
|
||||||
|
private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
|
||||||
|
private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static void matchColorVectorized(int[] in, byte[] out) {
|
||||||
|
int speciesLength = I_SPEC.length();
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < in.length - speciesLength; i += speciesLength) {
|
||||||
|
float[] redsArr = new float[speciesLength];
|
||||||
|
float[] bluesArr = new float[speciesLength];
|
||||||
|
float[] greensArr = new float[speciesLength];
|
||||||
|
int[] alphasArr = new int[speciesLength];
|
||||||
|
|
||||||
|
for (int j = 0; j < speciesLength; j++) {
|
||||||
|
alphasArr[j] = (in[i + j] >> 24) & 0xFF;
|
||||||
|
redsArr[j] = (in[i + j] >> 16) & 0xFF;
|
||||||
|
greensArr[j] = (in[i + j] >> 8) & 0xFF;
|
||||||
|
bluesArr[j] = (in[i + j] >> 0) & 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
|
||||||
|
FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
|
||||||
|
FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
|
||||||
|
FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
|
||||||
|
IntVector resultIndex = IntVector.zero(I_SPEC);
|
||||||
|
VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
|
||||||
|
|
||||||
|
modificationMask = modificationMask.and(alphas.lt(128).not());
|
||||||
|
FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
|
||||||
|
|
||||||
|
for (int c = 4; c < MapPalette.colors.length; c++) {
|
||||||
|
// We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
|
||||||
|
// For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
|
||||||
|
FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
|
||||||
|
FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
|
||||||
|
FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
|
||||||
|
|
||||||
|
FloatVector rMean = reds.add(compReds).div(2.0f);
|
||||||
|
FloatVector rDiff = reds.sub(compReds);
|
||||||
|
FloatVector gDiff = greens.sub(compGreens);
|
||||||
|
FloatVector bDiff = blues.sub(compBlues);
|
||||||
|
|
||||||
|
FloatVector weightR = rMean.div(256.0f).add(2);
|
||||||
|
FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
|
||||||
|
FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
|
||||||
|
|
||||||
|
FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
|
||||||
|
|
||||||
|
// Now we compare to the best distance we've found.
|
||||||
|
// This mask contains a "1" if better, and a "0" otherwise.
|
||||||
|
VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
|
||||||
|
bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
|
||||||
|
|
||||||
|
// Update the result array
|
||||||
|
// We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
|
||||||
|
resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < speciesLength; j++) {
|
||||||
|
int index = resultIndex.lane(j);
|
||||||
|
out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For the final ones, fall back to the regular method
|
||||||
|
for (; i < in.length; i++) {
|
||||||
|
out[i] = MapPalette.matchColor(new Color(in[i], true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package me.earthme.luminol.api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple package of folia's tick region state.It linked to the RegionStats of the nms part so that</br>
|
||||||
|
* You could call these methods to get the status of this tick region</br>
|
||||||
|
*/
|
||||||
|
public interface RegionStats {
|
||||||
|
/**
|
||||||
|
* Get the entity count in this tick region
|
||||||
|
* @return the entity count
|
||||||
|
*/
|
||||||
|
int getEntityCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the player count in this tick region
|
||||||
|
* @return the player count
|
||||||
|
*/
|
||||||
|
int getPlayerCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the chunk count in this tick region
|
||||||
|
* @return the chunk count
|
||||||
|
*/
|
||||||
|
int getChunkCount();
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package me.earthme.luminol.api;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mirror of folia's ThreadedRegion</br>
|
||||||
|
* Including some handy methods to get the information of the tick region</br>
|
||||||
|
* Note: You should call these methods inside this tick region's thread context
|
||||||
|
*/
|
||||||
|
public interface ThreadedRegion {
|
||||||
|
/**
|
||||||
|
* Get the center chunk pos of this tick region</br>
|
||||||
|
* Note:</br>
|
||||||
|
* 1.Global region will return a null value(But we don't finish the global region yet()</br>
|
||||||
|
* 2.You should call these methods inside this tick region's thread context
|
||||||
|
* @return The center chunk pos
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
Location getCenterChunkPos();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the dead section percent of this tick region
|
||||||
|
* Note: </br>
|
||||||
|
* 1.Dead percent is mean the percent of the unloaded chunk count of this tick region, which is also used for determine
|
||||||
|
* that the tick region should or not check for splitting</br>
|
||||||
|
* 2.You should call these methods inside this tick region's thread context
|
||||||
|
* @return The dead section percent
|
||||||
|
*/
|
||||||
|
double getDeadSectionPercent();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tick region data of this tick region</br>
|
||||||
|
* Note:</br>
|
||||||
|
* 1.You should call this method inside this tick region's thread context</br>
|
||||||
|
* 2.You should call these methods inside this tick region's thread context
|
||||||
|
* @return The tick region data
|
||||||
|
*/
|
||||||
|
TickRegionData getTickRegionData();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the world of this tick region</br>
|
||||||
|
* Note: Global region will return a null value too
|
||||||
|
* @return The world of this tick region
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
World getWorld();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the id of the tick region</br>
|
||||||
|
* @return The id of the tick region
|
||||||
|
*/
|
||||||
|
long getId();
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package me.earthme.luminol.api;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mirror of folia's ThreadedRegionizer
|
||||||
|
*/
|
||||||
|
public interface ThreadedRegionizer {
|
||||||
|
/**
|
||||||
|
* Get all the tick regions
|
||||||
|
* @return Temporary copied collection of all tick regions
|
||||||
|
*/
|
||||||
|
Collection<ThreadedRegion> getAllRegions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tick region at the given chunk coordinates
|
||||||
|
* @param chunkX Chunk X
|
||||||
|
* @param chunkZ Chunk Z
|
||||||
|
* @return The tick region at the given chunk coordinates
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
ThreadedRegion getAtSynchronized(int chunkX, int chunkZ);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tick region at the given chunk coordinates
|
||||||
|
* @param chunkX Chunk X
|
||||||
|
* @param chunkZ Chunk Z
|
||||||
|
* @return The tick region at the given chunk coordinates
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
ThreadedRegion getAtUnSynchronized(int chunkX, int chunkZ);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tick region at the given location
|
||||||
|
* @param pos The location
|
||||||
|
* @return The tick region at the given location
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
default ThreadedRegion getAtSynchronized(@NotNull Location pos) {
|
||||||
|
return this.getAtSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the tick region at the given location
|
||||||
|
* @param pos The location
|
||||||
|
* @return The tick region at the given location
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
default ThreadedRegion getAtUnSynchronized(@NotNull Location pos) {
|
||||||
|
return this.getAtUnSynchronized(pos.getBlockX() >> 4, pos.getBlockZ() >> 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package me.earthme.luminol.api;
|
||||||
|
|
||||||
|
import org.bukkit.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mirror of folia's tick region data
|
||||||
|
*/
|
||||||
|
public interface TickRegionData {
|
||||||
|
/**
|
||||||
|
* Get the world it's currently holding
|
||||||
|
* @return the world
|
||||||
|
*/
|
||||||
|
World getWorld();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current tick count
|
||||||
|
* @return the current tick count
|
||||||
|
*/
|
||||||
|
long getCurrentTickCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the region stats
|
||||||
|
* @return the region stats
|
||||||
|
*/
|
||||||
|
RegionStats getRegionStats();
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package me.earthme.luminol.api.entity;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.Validate;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple event fired when a teleportAsync was called
|
||||||
|
* @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause)
|
||||||
|
* @see org.bukkit.entity.Entity#teleportAsync(org.bukkit.Location)
|
||||||
|
* (Also fired when teleportAsync called from nms)
|
||||||
|
*/
|
||||||
|
public class EntityTeleportAsyncEvent extends Event {
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
private final Entity entity;
|
||||||
|
private final PlayerTeleportEvent.TeleportCause teleportCause;
|
||||||
|
private final Location destination;
|
||||||
|
|
||||||
|
public EntityTeleportAsyncEvent(Entity entity, PlayerTeleportEvent.TeleportCause teleportCause, Location destination) {
|
||||||
|
Validate.notNull(entity, "entity cannot be a null value!");
|
||||||
|
Validate.notNull(teleportCause, "teleportCause cannot be a null value!");
|
||||||
|
Validate.notNull(destination, "destination cannot be a null value!");
|
||||||
|
|
||||||
|
this.entity = entity;
|
||||||
|
this.teleportCause = teleportCause;
|
||||||
|
this.destination = destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the entity is about to be teleported
|
||||||
|
* @return that entity
|
||||||
|
*/
|
||||||
|
public @NotNull Entity getEntity() {
|
||||||
|
return this.entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the cause of the teleport
|
||||||
|
* @return the cause
|
||||||
|
*/
|
||||||
|
public @NotNull PlayerTeleportEvent.TeleportCause getTeleportCause() {
|
||||||
|
return this.teleportCause;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the destination of the teleport
|
||||||
|
* @return the destination
|
||||||
|
*/
|
||||||
|
public @NotNull Location getDestination() {
|
||||||
|
return this.destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package me.earthme.luminol.api.entity;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.Validate;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple event created for missing teleport events api of folia
|
||||||
|
* This event is fired when the entity portal process has been done
|
||||||
|
*/
|
||||||
|
public class PostEntityPortalEvent extends Event {
|
||||||
|
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||||
|
|
||||||
|
private final Entity teleportedEntity;
|
||||||
|
|
||||||
|
public PostEntityPortalEvent(Entity teleportedEntity) {
|
||||||
|
Validate.notNull(teleportedEntity, "teleportedEntity cannot be null!");
|
||||||
|
|
||||||
|
this.teleportedEntity = teleportedEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the entity which was teleported
|
||||||
|
* @return the entity which was teleported
|
||||||
|
*/
|
||||||
|
public Entity getTeleportedEntity() {
|
||||||
|
return this.teleportedEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull HandlerList getHandlers() {
|
||||||
|
return HANDLER_LIST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLER_LIST;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package me.earthme.luminol.api.entity;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.Validate;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple event created for missing teleport events api of folia
|
||||||
|
* This event will be fired when a portal teleportation is about to happen
|
||||||
|
*/
|
||||||
|
public class PreEntityPortalEvent extends Event implements Cancellable {
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
private final Entity entity;
|
||||||
|
private final Location portalPos;
|
||||||
|
private final World destination;
|
||||||
|
|
||||||
|
private boolean cancelled = false;
|
||||||
|
|
||||||
|
public PreEntityPortalEvent(Entity entity, Location portalPos, World destination) {
|
||||||
|
Validate.notNull(entity, "entity cannot be null!");
|
||||||
|
Validate.notNull(portalPos, "portalPos cannot be null!");
|
||||||
|
Validate.notNull(destination, "destination cannot be null!");
|
||||||
|
|
||||||
|
this.entity = entity;
|
||||||
|
this.portalPos = portalPos;
|
||||||
|
this.destination = destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the entity that is about to teleport
|
||||||
|
* @return the entity
|
||||||
|
*/
|
||||||
|
public @NotNull Entity getEntity() {
|
||||||
|
return this.entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the location of the portal
|
||||||
|
* @return the portal location
|
||||||
|
*/
|
||||||
|
public @NotNull Location getPortalPos() {
|
||||||
|
return this.portalPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the destination world
|
||||||
|
* @return the destination world
|
||||||
|
*/
|
||||||
|
public @NotNull World getDestination() {
|
||||||
|
return this.destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return this.cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancelled = cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package me.earthme.luminol.api.entity.player;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.Validate;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple event fired when the respawn process of player is done
|
||||||
|
*/
|
||||||
|
public class PostPlayerRespawnEvent extends Event {
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
private final Player player;
|
||||||
|
|
||||||
|
public PostPlayerRespawnEvent(Player player) {
|
||||||
|
Validate.notNull(player, "Player cannot be a null value!");
|
||||||
|
|
||||||
|
this.player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the respawned player
|
||||||
|
* @return the player
|
||||||
|
*/
|
||||||
|
public @NotNull Player getPlayer() {
|
||||||
|
return this.player;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package me.earthme.luminol.api.portal;
|
||||||
|
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A event fired when an end platform is created.
|
||||||
|
*/
|
||||||
|
public class EndPlatformCreateEvent extends Event implements Cancellable {
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
private boolean cancelled = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return this.cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancel) {
|
||||||
|
this.cancelled = cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package me.earthme.luminol.api.portal;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.Validate;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A event fired when the portal process started locating the destination position
|
||||||
|
* Notice: If you changed the destination to an another position in end teleportation.The end platform won't create under the entity and won't create
|
||||||
|
* if the position is out of current tick region
|
||||||
|
*/
|
||||||
|
public class PortalLocateEvent extends Event {
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
private final Location original;
|
||||||
|
private final Location destination;
|
||||||
|
|
||||||
|
public PortalLocateEvent(Location original, Location destination) {
|
||||||
|
Validate.notNull(original, "original couldn't be null!");
|
||||||
|
Validate.notNull(destination, "destination couldn't be null!");
|
||||||
|
|
||||||
|
this.original = original;
|
||||||
|
this.destination = destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the destination position of this teleportation
|
||||||
|
* @return the destination position
|
||||||
|
*/
|
||||||
|
public Location getDestination() {
|
||||||
|
return this.destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the original portal position of this teleportation
|
||||||
|
* @return the original portal position
|
||||||
|
*/
|
||||||
|
public Location getOriginal() {
|
||||||
|
return this.original;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
--- a/folia-server/build.gradle.kts
|
--- a/folia-server/build.gradle.kts
|
||||||
+++ b/folia-server/build.gradle.kts
|
+++ b/folia-server/build.gradle.kts
|
||||||
@@ -29,6 +_,7 @@
|
@@ -27,6 +_,7 @@
|
||||||
//}
|
gitFilePatches = false
|
||||||
|
|
||||||
val fork = forks.register("folia") {
|
val fork = forks.register("folia") {
|
||||||
+ rootDirectory = upstreamsDirectory().map { it.dir("folia") }
|
+ rootDirectory = upstreamsDirectory().map { it.dir("folia") }
|
||||||
upstream.patchDir("paperServer") {
|
upstream.patchDir("paperServer") {
|
||||||
upstreamPath = "paper-server"
|
upstreamPath = "paper-server"
|
||||||
excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
||||||
@@ -37,7 +_,23 @@
|
@@ -35,7 +_,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
+
|
+
|
||||||
+ activeFork = luminol
|
+ activeFork = luminol
|
||||||
|
|
||||||
|
|
||||||
spigot {
|
spigot {
|
||||||
buildDataRef = "702e1a0a5072b2c4082371d5228cb30525687efc"
|
|
||||||
@@ -123,10 +_,14 @@
|
@@ -123,10 +_,14 @@
|
||||||
main {
|
main {
|
||||||
java { srcDir("../paper-server/src/main/java"); srcDir("../paper-server/src/generated/java") }
|
java { srcDir("../paper-server/src/main/java"); srcDir("../paper-server/src/generated/java") }
|
||||||
@@ -48,13 +48,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val log4jPlugins = sourceSets.create("log4jPlugins") {
|
val log4jPlugins = sourceSets.create("log4jPlugins") {
|
||||||
@@ -153,7 +_,14 @@
|
@@ -153,12 +_,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
- implementation(project(":folia-api"))
|
- implementation(project(":folia-api"))
|
||||||
+ implementation(project(":luminol-api")) // Luminol
|
+ implementation(project(":luminol-api")) // Luminol
|
||||||
+ implementation("com.electronwill.night-config:toml:3.6.6") // Luminol - Night config
|
+ implementation("com.electronwill.night-config:toml:3.8.2") // Luminol - Night config
|
||||||
+ // Abomination start
|
+ // Abomination start
|
||||||
+ implementation("com.github.luben:zstd-jni:1.5.4-1")
|
+ implementation("com.github.luben:zstd-jni:1.5.4-1")
|
||||||
+ implementation("org.lz4:lz4-java:1.8.0")
|
+ implementation("org.lz4:lz4-java:1.8.0")
|
||||||
@@ -64,17 +64,23 @@
|
|||||||
implementation("ca.spottedleaf:concurrentutil:0.0.3")
|
implementation("ca.spottedleaf:concurrentutil:0.0.3")
|
||||||
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||||
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||||
@@ -217,26 +_,33 @@
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||||
|
implementation("net.kyori:adventure-text-serializer-ansi:4.21.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||||
|
+ implementation("net.openhft:affinity:3.23.3") // Luminol
|
||||||
|
runtimeConfiguration(sourceSets.main.map { it.runtimeClasspath })
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -216,27 +_,33 @@
|
||||||
|
implementation("me.lucko:spark-api:0.1-20240720.200737-2")
|
||||||
implementation("me.lucko:spark-paper:1.10.133-20250413.112336-1")
|
implementation("me.lucko:spark-paper:1.10.133-20250413.112336-1")
|
||||||
}
|
}
|
||||||
|
|
||||||
+// Pufferfish Start
|
+// Pufferfish Start
|
||||||
+tasks.withType<JavaCompile> {
|
+tasks.withType<JavaCompile> {
|
||||||
+ val compilerArgs = options.compilerArgs
|
+ val compilerArgs = options.compilerArgs
|
||||||
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
||||||
+}
|
+}
|
||||||
+// Pufferfish End
|
+// Pufferfish End
|
||||||
+
|
|
||||||
tasks.jar {
|
tasks.jar {
|
||||||
manifest {
|
manifest {
|
||||||
val git = Git(rootProject.layout.projectDirectory.path)
|
val git = Git(rootProject.layout.projectDirectory.path)
|
||||||
@@ -104,14 +110,12 @@
|
|||||||
"Build-Number" to (build ?: ""),
|
"Build-Number" to (build ?: ""),
|
||||||
"Build-Time" to buildTime.toString(),
|
"Build-Time" to buildTime.toString(),
|
||||||
"Git-Branch" to gitBranch,
|
"Git-Branch" to gitBranch,
|
||||||
@@ -393,3 +_,10 @@
|
@@ -400,7 +_,7 @@
|
||||||
classpath(tasks.createReobfPaperclipJar.flatMap { it.outputZip })
|
|
||||||
mainClass.set(null as String?)
|
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+// Pufferfish Start
|
fill {
|
||||||
+tasks.withType<JavaCompile> {
|
- project("folia")
|
||||||
+ val compilerArgs = options.compilerArgs
|
+ project("luminol") // Luminol
|
||||||
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
|
||||||
+}
|
version(paperweight.minecraftVersion)
|
||||||
+// Pufferfish End
|
|
||||||
|
|||||||
@@ -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..21a22d6fca111dd6a8cd4c7a6f994aa87d06feb4 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 (!me.earthme.luminol.config.modules.experiment.CommandBlockConfig.enabled) return false; // Folia - region threading // Luminol
|
|
||||||
if (level.isClientSide || level.getGameTime() == this.lastExecution) {
|
|
||||||
return false;
|
|
||||||
} else if ("Searge".equalsIgnoreCase(this.command)) {
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
Date: Sun, 22 Jun 2025 23:53:59 +0800
|
||||||
|
Subject: [PATCH] Rebrand to Luminol
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||||
|
index fd3553bdc1c3cdbf6aa3dc00e0a4987f8eaa4fb8..a75a5ce8477da8d3f7b0ae41bfbd75defe1d2ed4 100644
|
||||||
|
--- a/net/minecraft/server/Main.java
|
||||||
|
+++ b/net/minecraft/server/Main.java
|
||||||
|
@@ -109,6 +109,7 @@ public class Main {
|
||||||
|
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ me.earthme.luminol.config.LuminolConfig.preLoadConfig(); // Luminol - Luminol 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 d8bab0ba6e2374fb74f3fa9f7db802f442240414..f21026ef975864700ad5ef86052acdcb7621e210 100644
|
||||||
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
@@ -171,6 +171,8 @@ 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
|
||||||
|
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||||
|
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||||
|
if (this.convertOldUsers()) {
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add config for offline mode warning
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 898373c7be5a80e82138f66bb5f739c0d4b10e5e..e76599e92e4bf4f5b5d7176f4a0a2a854d10818a 100644
|
index f21026ef975864700ad5ef86052acdcb7621e210..61d63e5668e110e9c0b891959bf4cd7c91e54645 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -243,7 +243,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -243,7 +243,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config for server mod name
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index 02676eb449bb98bc959717c72356bc980d4662f8..db435869dd2a2dfe0c36c62e46e5389170cfb0cd 100644
|
index 29101af861b6b8c577d08c940cea17c843d00081..7e4fe0f33f69ae37fd8b1ffbfc8795a2b7ba3cad 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1965,7 +1965,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1966,7 +1966,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config for unsafe teleportation
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java
|
diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
index e77276b1dccebd5b768c3cdbe5e0206da32b91ff..95f3bcf2f3093e66602e4323708ac349d58db4c1 100644
|
index 34e31fa13e5107f13e166f694fafe58e306330ae..c444c4b7dc8454abd257030a8c59b9b22b9013d9 100644
|
||||||
--- a/net/minecraft/world/entity/item/FallingBlockEntity.java
|
--- a/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
+++ b/net/minecraft/world/entity/item/FallingBlockEntity.java
|
+++ b/net/minecraft/world/entity/item/FallingBlockEntity.java
|
||||||
@@ -67,7 +67,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -70,7 +70,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
public float fallDamagePerDistance = 0.0F;
|
public float fallDamagePerDistance = 0.0F;
|
||||||
@Nullable
|
@Nullable
|
||||||
public CompoundTag blockData;
|
public CompoundTag blockData;
|
||||||
@@ -17,7 +17,7 @@ index e77276b1dccebd5b768c3cdbe5e0206da32b91ff..95f3bcf2f3093e66602e4323708ac349
|
|||||||
protected static final EntityDataAccessor<BlockPos> DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS);
|
protected static final EntityDataAccessor<BlockPos> DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS);
|
||||||
public boolean autoExpire = true; // Paper - Expand FallingBlock API
|
public boolean autoExpire = true; // Paper - Expand FallingBlock API
|
||||||
|
|
||||||
@@ -382,7 +382,7 @@ public class FallingBlockEntity extends Entity {
|
@@ -387,7 +387,7 @@ public class FallingBlockEntity extends Entity {
|
||||||
ResourceKey<Level> resourceKey1 = this.level().dimension();
|
ResourceKey<Level> resourceKey1 = this.level().dimension();
|
||||||
boolean flag = (resourceKey1 == Level.END || resourceKey == Level.END) && resourceKey1 != resourceKey;
|
boolean flag = (resourceKey1 == Level.END || resourceKey == Level.END) && resourceKey1 != resourceKey;
|
||||||
Entity entity = super.teleport(teleportTransition);
|
Entity entity = super.teleport(teleportTransition);
|
||||||
@@ -27,10 +27,10 @@ index e77276b1dccebd5b768c3cdbe5e0206da32b91ff..95f3bcf2f3093e66602e4323708ac349
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
|
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
|
||||||
index 685c0fb071efd8e3c4e81cb89e93d8f7707773c1..eaf46427e07edc59b6cffd3fec76489fe65f8f14 100644
|
index 6e495b2c4176d5a30ea911f8e44a22655df92ef6..cd12e35d784c8ac4737fa617d2e78cef6606299f 100644
|
||||||
--- a/net/minecraft/world/level/block/EndPortalBlock.java
|
--- a/net/minecraft/world/level/block/EndPortalBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
|
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
|
||||||
@@ -68,6 +68,11 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
@@ -69,6 +69,11 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
||||||
if (level.paperConfig().misc.disableEndCredits) {serverPlayer.seenCredits = true; return;} // Paper - Option to disable end credits
|
if (level.paperConfig().misc.disableEndCredits) {serverPlayer.seenCredits = true; return;} // Paper - Option to disable end credits
|
||||||
serverPlayer.showEndCredits();
|
serverPlayer.showEndCredits();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ Subject: [PATCH] Add config for vanilla random
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 414be522896c63c34100199177788d71e8f2d326..bf177d9f7e5d9f643d13fcb9ea23686fd0f32dc5 100644
|
index 737ae61a40385d6231576e3cec405b1bdfbd08a9..49c76f150c913fdc21d0e253b78625e273f69a22 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -261,7 +261,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -281,7 +281,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
public double yOld;
|
public double yOld;
|
||||||
public double zOld;
|
public double zOld;
|
||||||
public boolean noPhysics;
|
public boolean noPhysics;
|
||||||
- public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
|
- public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
|
||||||
+ public final RandomSource random = me.earthme.luminol.config.modules.fixes.VanillaRandomSourceConfig.useLegacyRandomSourceForPlayers ? RandomSource.create() : SHARED_RANDOM; // Paper - Share random for entities to make them more random // Luminol - Add config for vanilla random SHARED_RANDOM
|
+ public final RandomSource random = me.earthme.luminol.config.modules.fixes.VanillaRandomSourceConfig.useLegacyRandomSourceForPlayers ? RandomSource.create() : SHARED_RANDOM; // Paper - Share random for entities to make them more random // Luminol - Add config for vanilla random SHARED_RANDOM
|
||||||
public int tickCount;
|
public int tickCount;
|
||||||
private int remainingFireTicks = -this.getFireImmuneTicks();
|
private int remainingFireTicks;
|
||||||
public boolean wasTouchingWater;
|
public boolean wasTouchingWater;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add config for watchdog timeout
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/io/papermc/paper/threadedregions/FoliaWatchdogThread.java b/io/papermc/paper/threadedregions/FoliaWatchdogThread.java
|
diff --git a/io/papermc/paper/threadedregions/FoliaWatchdogThread.java b/io/papermc/paper/threadedregions/FoliaWatchdogThread.java
|
||||||
index 258d82ab2c78482e1561343e8e1f81fc33f1895e..967107c0f4a18a29877883ccddb4d7962f4b5788 100644
|
index e9ca1a15049b0211d10401cb78e953b93afaf6c7..fe1560579f9c9572082d52cf910f5916957f5601 100644
|
||||||
--- a/io/papermc/paper/threadedregions/FoliaWatchdogThread.java
|
--- a/io/papermc/paper/threadedregions/FoliaWatchdogThread.java
|
||||||
+++ b/io/papermc/paper/threadedregions/FoliaWatchdogThread.java
|
+++ b/io/papermc/paper/threadedregions/FoliaWatchdogThread.java
|
||||||
@@ -65,7 +65,7 @@ public final class FoliaWatchdogThread extends Thread {
|
@@ -65,7 +65,7 @@ public final class FoliaWatchdogThread extends Thread {
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
||||||
Date: Wed, 21 May 2025 13:04:00 +0800
|
|
||||||
Subject: [PATCH] Add config to disable end crystal check
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/dimension/end/EndDragonFight.java b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
||||||
index 4fa8371c212dcc02b8cf5fd267b736e1cf3f50c1..e80afd034eba10c9adaa5df776c728253e874af4 100644
|
|
||||||
--- a/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
||||||
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
|
||||||
@@ -547,6 +547,8 @@ public class EndDragonFight {
|
|
||||||
|
|
||||||
blockPos = this.portalLocation;
|
|
||||||
}
|
|
||||||
+ // Luminol start - Disable end crystal check
|
|
||||||
+ if (!me.earthme.luminol.config.modules.misc.DisableEndCrystalCheckConfig.disableEndCrystalCheck) {
|
|
||||||
// Paper start - Perf: Do crystal-portal proximity check before entity lookup
|
|
||||||
if (placedEndCrystalPos != null) {
|
|
||||||
// The end crystal must be 0 or 1 higher than the portal origin
|
|
||||||
@@ -562,6 +564,7 @@ public class EndDragonFight {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Paper end - Perf: Do crystal-portal proximity check before entity lookup
|
|
||||||
+ } // Luminol end - Disable end crystal check
|
|
||||||
|
|
||||||
|
|
||||||
List<EndCrystal> list = Lists.newArrayList();
|
|
||||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add config to disable entity tick catchers
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||||
index 0e7e2a17a9ba3b90d4458032b6d5ff324fad77b5..ba1ccd6eab77e27a38d22c12dba0797d65cc4c4e 100644
|
index 5fe048ce442957a534d44454e0bb908afe8ad3a6..93d722d437121e605cee0e168ac17ee9bef0610e 100644
|
||||||
--- a/net/minecraft/world/level/Level.java
|
--- a/net/minecraft/world/level/Level.java
|
||||||
+++ b/net/minecraft/world/level/Level.java
|
+++ b/net/minecraft/world/level/Level.java
|
||||||
@@ -1533,6 +1533,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
@@ -1533,6 +1533,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||||
@@ -30,7 +30,7 @@ index 8a3a8b0fdf9545a41501dc992c6982d9c8ce7b66..8f9f5b0bf098a32a732e3ff9f636e3ea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
diff --git a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
||||||
index 49b810ae9d9a8d0718a5f8c512e15a5573ed04fd..37ebb23c9c053de0530254d98f2120058833f232 100644
|
index 49b810ae9d9a8d0718a5f8c512e15a5573ed04fd..7d5fc6860ed426c4906f8c3eb2c10fd6db4296e5 100644
|
||||||
--- a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
--- a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
||||||
+++ b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
+++ b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
||||||
@@ -28,6 +28,11 @@ public class EndPlatformFeature extends Feature<NoneFeatureConfiguration> {
|
@@ -28,6 +28,11 @@ public class EndPlatformFeature extends Feature<NoneFeatureConfiguration> {
|
||||||
@@ -89,14 +89,13 @@ index 49b810ae9d9a8d0718a5f8c512e15a5573ed04fd..37ebb23c9c053de0530254d98f212005
|
|||||||
+ blockList.placeBlocks();
|
+ blockList.placeBlocks();
|
||||||
+ }
|
+ }
|
||||||
} else {
|
} else {
|
||||||
- blockList.placeBlocks();
|
|
||||||
+ if (dropBlocks) {
|
+ if (dropBlocks) {
|
||||||
+ blockList.getSnapshotBlocks().forEach((state) -> {
|
+ blockList.getSnapshotBlocks().forEach((state) -> {
|
||||||
+ level.destroyBlock(state.getPosition(), !blockList1.contains(state.getPosition()), null);
|
+ level.destroyBlock(state.getPosition(), !blockList1.contains(state.getPosition()), null);
|
||||||
+ state.update();
|
|
||||||
+ });
|
+ });
|
||||||
+ // Luminol - prevent tripwire dupe in end platform generate
|
+ // Luminol - prevent tripwire dupe in end platform generate
|
||||||
+ }
|
+ }
|
||||||
|
blockList.placeBlocks();
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
||||||
Date: Thu, 1 May 2025 22:43:08 +0800
|
|
||||||
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..55476f0d4898c67e433dcee769a5cf8bd6109930 100644
|
|
||||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
|
||||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
|
||||||
@@ -299,6 +299,11 @@ public final class RegionizedServer {
|
|
||||||
this.randomWalk();
|
|
||||||
*/
|
|
||||||
++this.tickCount;
|
|
||||||
+ // Luminol start - Add a config to enable tick command
|
|
||||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
|
||||||
+ MinecraftServer.tickRateManager.tick();
|
|
||||||
+ }
|
|
||||||
+ // 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 {
|
|
||||||
this.globalTick(world, tickCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol start - Add a config to enable tick command
|
|
||||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
|
||||||
+ MinecraftServer.tickRateManager.reduceSprintTicks();
|
|
||||||
+ MinecraftServer.tickRateManager.endTickWork();
|
|
||||||
+ }
|
|
||||||
+ // Luminol end - Add a config to enable tick command
|
|
||||||
+
|
|
||||||
// tick connections
|
|
||||||
this.tickConnections();
|
|
||||||
|
|
||||||
@@ -454,7 +466,7 @@ public final class RegionizedServer {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void tickTime(final ServerLevel world, final int tickCount) {
|
|
||||||
- if (world.tickTime) {
|
|
||||||
+ if ((!me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled || world.tickRateManager().runsNormally()) && world.tickTime) { // Luminol - Add a config to enable tick command
|
|
||||||
if (world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
|
||||||
world.setDayTime(world.levelData.getDayTime() + (long)tickCount);
|
|
||||||
}
|
|
||||||
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
|
||||||
index 7123b3eb2f2e52946b8ef9de993a6828eb0bb6f7..82948984404a183711588932a4a026dc4c241feb 100644
|
|
||||||
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
|
||||||
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
|
||||||
@@ -31,8 +31,8 @@ public final class TickRegionScheduler {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- public static final int TICK_RATE = 20;
|
|
||||||
- public static final long TIME_BETWEEN_TICKS = 1_000_000_000L / TICK_RATE; // ns
|
|
||||||
+ public static float TICK_RATE = 20; // Luminol - Add tick command support
|
|
||||||
+ public static long TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE); // ns // Luminol - Add tick command support
|
|
||||||
|
|
||||||
// Folia start - watchdog
|
|
||||||
public static final FoliaWatchdogThread WATCHDOG_THREAD = new FoliaWatchdogThread();
|
|
||||||
@@ -375,8 +375,23 @@ public final class TickRegionScheduler {
|
|
||||||
final long cpuStart = MEASURE_CPU_TIME ? THREAD_MX_BEAN.getCurrentThreadCpuTime() : 0L;
|
|
||||||
final long tickStart = System.nanoTime();
|
|
||||||
|
|
||||||
- // use max(), don't assume that tickStart >= scheduledStart
|
|
||||||
- final int tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
|
||||||
+ // Luminol start - Add a config to enable tick command
|
|
||||||
+ final int tickCount;
|
|
||||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
|
||||||
+ if (MinecraftServer.tickRateManager.isSprinting() && MinecraftServer.tickRateManager.checkShouldSprintThisTick()) {
|
|
||||||
+ TICK_RATE = net.minecraft.server.commands.TickCommand.MAX_TICKRATE;
|
|
||||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
|
||||||
+ tickCount = 1;
|
|
||||||
+ } else {
|
|
||||||
+ TICK_RATE = MinecraftServer.tickRateManager.tickrate();
|
|
||||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
|
||||||
+ tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ // use max(), don't assume that tickStart >= scheduledStart
|
|
||||||
+ tickCount = Math.max(1, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
|
||||||
+ }
|
|
||||||
+ // Luminol end - Add tick command support
|
|
||||||
|
|
||||||
if (!this.tryMarkTicking()) {
|
|
||||||
if (!this.cancelled.get()) {
|
|
||||||
@@ -416,6 +431,11 @@ public final class TickRegionScheduler {
|
|
||||||
try {
|
|
||||||
// next start isn't updated until the end of this tick
|
|
||||||
this.tickRegion(tickCount, tickStart, scheduledEnd);
|
|
||||||
+ // Luminol start - Add a config to enable tick command
|
|
||||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
|
||||||
+ MinecraftServer.tickRateManager.endTickWork();
|
|
||||||
+ }
|
|
||||||
+ // Luminol end - Add a config to enable tick command
|
|
||||||
} catch (final Throwable thr) {
|
|
||||||
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 4e3bfa25ec4917d2bca594b050e38be3bdea077b..fca716bf52e114b196c7617f352e9394c7185271 100644
|
|
||||||
--- a/net/minecraft/commands/Commands.java
|
|
||||||
+++ b/net/minecraft/commands/Commands.java
|
|
||||||
@@ -212,7 +212,11 @@ public class Commands {
|
|
||||||
TeleportCommand.register(this.dispatcher);
|
|
||||||
TellRawCommand.register(this.dispatcher, context);
|
|
||||||
//TestCommand.register(this.dispatcher, context); // Folia - region threading
|
|
||||||
- //TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
|
||||||
+ // Luminol start - Add a config to enable tick command
|
|
||||||
+ if (me.earthme.luminol.config.modules.experiment.CommandTickConfig.enabled) {
|
|
||||||
+ TickCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
|
||||||
+ }
|
|
||||||
+ // Luminol end - Add a config to enable tick command
|
|
||||||
TimeCommand.register(this.dispatcher);
|
|
||||||
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 db435869dd2a2dfe0c36c62e46e5389170cfb0cd..a90ac07eaea956cb7c50b66a27dd47c955f98feb 100644
|
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
|
||||||
@@ -266,7 +266,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
||||||
private String serverId;
|
|
||||||
public MinecraftServer.ReloadableResources resources;
|
|
||||||
private final StructureTemplateManager structureTemplateManager;
|
|
||||||
- private final ServerTickRateManager tickRateManager;
|
|
||||||
+ public static ServerTickRateManager tickRateManager; // Luminol - Add tick command support
|
|
||||||
protected WorldData worldData;
|
|
||||||
public PotionBrewing potionBrewing;
|
|
||||||
private FuelValues fuelValues;
|
|
||||||
diff --git a/net/minecraft/server/ServerTickRateManager.java b/net/minecraft/server/ServerTickRateManager.java
|
|
||||||
index 40338efd1c0e56d869d03f1d0687e7ff0fcbf11a..d0d90a25a10bbecfffceee1992af88c60d14fd87 100644
|
|
||||||
--- a/net/minecraft/server/ServerTickRateManager.java
|
|
||||||
+++ b/net/minecraft/server/ServerTickRateManager.java
|
|
||||||
@@ -105,7 +105,7 @@ public class ServerTickRateManager extends TickRateManager {
|
|
||||||
return false;
|
|
||||||
} else if (this.remainingSprintTicks > 0L) {
|
|
||||||
this.sprintTickStartTime = System.nanoTime();
|
|
||||||
- this.remainingSprintTicks--;
|
|
||||||
+ // this.remainingSprintTicks--; // Luminol - Add tick command support
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
this.finishTickSprint();
|
|
||||||
@@ -113,6 +113,12 @@ public class ServerTickRateManager extends TickRateManager {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol start - Add tick command support
|
|
||||||
+ public void reduceSprintTicks() {
|
|
||||||
+ this.remainingSprintTicks--;
|
|
||||||
+ }
|
|
||||||
+ // Luminol end - Add tick command support
|
|
||||||
+
|
|
||||||
public void endTickWork() {
|
|
||||||
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
|
|
||||||
--- a/net/minecraft/server/commands/TickCommand.java
|
|
||||||
+++ b/net/minecraft/server/commands/TickCommand.java
|
|
||||||
@@ -14,7 +14,7 @@ import net.minecraft.server.ServerTickRateManager;
|
|
||||||
import net.minecraft.util.TimeUtil;
|
|
||||||
|
|
||||||
public class TickCommand {
|
|
||||||
- private static final float MAX_TICKRATE = 10000.0F;
|
|
||||||
+ public static final float MAX_TICKRATE = 10000.0F; // Luminol - Add tick command support
|
|
||||||
private static final String DEFAULT_TICKRATE = String.valueOf(20);
|
|
||||||
|
|
||||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
|
|
||||||
@@ -22,7 +22,7 @@ index a814512fcfb85312474ae2c2c21443843bf57831..2e084a5b28cbe4737f48c25e10af5892
|
|||||||
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
|
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
|
||||||
final int chunkX, final int chunkZ, final CompoundTag compound
|
final int chunkX, final int chunkZ, final CompoundTag compound
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||||
index 709df35246fb328cda21679b53d44d9f96206cb3..a26e1dbce1b34aba6f88c1c61ebd168dcb4206bd 100644
|
index f5ed467c0880e4bcdf1b9ae773a5aac21c4381c3..f517079dad3b7e29af33feb78fe344d006570aab 100644
|
||||||
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||||
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
|
||||||
@@ -1260,7 +1260,7 @@ public final class MoonriseRegionFileIO {
|
@@ -1260,7 +1260,7 @@ public final class MoonriseRegionFileIO {
|
||||||
@@ -55,10 +55,10 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..c7d4d944eb198ac53a3eeae717a25c7d
|
|||||||
+ public void moonrise$write(final abomination.IRegionFile regionFile) throws IOException; // Luminol - Configurable region file format
|
+ public void moonrise$write(final abomination.IRegionFile regionFile) throws IOException; // Luminol - Configurable region file format
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index a90ac07eaea956cb7c50b66a27dd47c955f98feb..ecf185fce582a542c65a9544388b84835643978b 100644
|
index 7e4fe0f33f69ae37fd8b1ffbfc8795a2b7ba3cad..8502fdb94142cf12b8d9d4900d8a2440051051ae 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -978,10 +978,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -981,10 +981,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
if (flush) {
|
if (flush) {
|
||||||
for (ServerLevel serverLevel2 : this.getAllLevels()) {
|
for (ServerLevel serverLevel2 : this.getAllLevels()) {
|
||||||
@@ -72,7 +72,7 @@ index a90ac07eaea956cb7c50b66a27dd47c955f98feb..ecf185fce582a542c65a9544388b8483
|
|||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
diff --git a/net/minecraft/util/worldupdate/WorldUpgrader.java b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
diff --git a/net/minecraft/util/worldupdate/WorldUpgrader.java b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
index 559bd4eef7174b04f5aa71b982ba34cbace8da8a..8284320bf596f4b06e1dadbfac4b7ac97361ff7f 100644
|
index 79d57ca8a7870a02e95562d89cbd4341d8282660..9ac0e2f5ee4e8ac2e70c5445a7c9f47f0e414929 100644
|
||||||
--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
|
--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
@@ -75,7 +75,7 @@ public class WorldUpgrader implements AutoCloseable {
|
@@ -75,7 +75,7 @@ public class WorldUpgrader implements AutoCloseable {
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
||||||
Date: Fri, 11 Apr 2025 16:53:57 +0800
|
|
||||||
Subject: [PATCH] Add config to revert raid changes
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java
|
|
||||||
index 80f17f33f670018240c854df589cf90cdeab6e70..8672757a4d5fb5c247599782fece6b8d7d6ec921 100644
|
|
||||||
--- a/net/minecraft/world/effect/BadOmenMobEffect.java
|
|
||||||
+++ b/net/minecraft/world/effect/BadOmenMobEffect.java
|
|
||||||
@@ -22,6 +22,11 @@ class BadOmenMobEffect extends MobEffect {
|
|
||||||
&& !serverPlayer.isSpectator()
|
|
||||||
&& level.getDifficulty() != Difficulty.PEACEFUL
|
|
||||||
&& level.isVillage(serverPlayer.blockPosition())) {
|
|
||||||
+ // Leaves start - Revert raid changes
|
|
||||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.trigger) {
|
|
||||||
+ return level.getRaids().createOrExtendRaid(serverPlayer, serverPlayer.blockPosition()) == null;
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - Revert raid changes
|
|
||||||
Raid raidAt = level.getRaidAt(serverPlayer.blockPosition());
|
|
||||||
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..8401b3e9968e48c7a936386f3290315091501d4f 100644
|
|
||||||
--- a/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
+++ b/net/minecraft/world/entity/raid/Raid.java
|
|
||||||
@@ -340,7 +340,20 @@ public class Raid {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag1) {
|
|
||||||
- this.waveSpawnPos = this.getValidSpawnPos(level);
|
|
||||||
+ // Luminol Start - Raid revert
|
|
||||||
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert) {
|
|
||||||
+ this.waveSpawnPos = this.getValidSpawnPos(level);
|
|
||||||
+ } else {
|
|
||||||
+ int n4 = 0;
|
|
||||||
+ if (this.raidCooldownTicks < 100) {
|
|
||||||
+ n4 = 1;
|
|
||||||
+ }
|
|
||||||
+ if (this.raidCooldownTicks < 40) {
|
|
||||||
+ n4 = 2;
|
|
||||||
+ }
|
|
||||||
+ this.waveSpawnPos = this.getValidSpawnPos(level, n4);
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Raid revert
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) {
|
|
||||||
@@ -375,7 +388,14 @@ public class Raid {
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
while (this.shouldSpawnGroup()) {
|
|
||||||
- BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20));
|
|
||||||
+ // Luminol Start - Raid revert
|
|
||||||
+ BlockPos blockPos;
|
|
||||||
+ if (!me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert) {
|
|
||||||
+ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20));
|
|
||||||
+ } else {
|
|
||||||
+ blockPos = this.waveSpawnPos.isPresent() ? this.waveSpawnPos.get() : this.findRandomSpawnPos(level, i, 20);
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Raid revert
|
|
||||||
if (blockPos != null) {
|
|
||||||
this.started = true;
|
|
||||||
this.spawnGroup(level, blockPos);
|
|
||||||
@@ -387,7 +407,7 @@ public class Raid {
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (i > 5) {
|
|
||||||
+ if (i > (me.earthme.luminol.config.modules.misc.RaidChangesConfig.posRevert ? 3 : 5)) { // Luminol - Raid revert
|
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(level, this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit
|
|
||||||
this.stop();
|
|
||||||
break;
|
|
||||||
@@ -458,6 +478,17 @@ public class Raid {
|
|
||||||
return blockPos != null ? Optional.of(blockPos) : Optional.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol Start - Raid revert
|
|
||||||
+ private Optional<BlockPos> getValidSpawnPos(ServerLevel level, int n) {
|
|
||||||
+ for (int i = 0; i < 3; ++i) {
|
|
||||||
+ BlockPos blockPos = this.findRandomSpawnPos(level, n, 1);
|
|
||||||
+ if (blockPos == null) continue;
|
|
||||||
+ return Optional.of(blockPos);
|
|
||||||
+ }
|
|
||||||
+ return Optional.empty();
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Raid revert
|
|
||||||
+
|
|
||||||
private boolean hasMoreWaves() {
|
|
||||||
return this.hasBonusWave() ? !this.hasSpawnedBonusWave() : !this.isFinalWave();
|
|
||||||
}
|
|
||||||
@@ -683,7 +714,7 @@ public class Raid {
|
|
||||||
int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f);
|
|
||||||
int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f);
|
|
||||||
int height = level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3);
|
|
||||||
- if (Mth.abs(height - this.center.getY()) <= 96) {
|
|
||||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.heightCheck || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - Disable height check
|
|
||||||
mutableBlockPos.set(i2, height, i3);
|
|
||||||
if (!level.isVillage(mutableBlockPos) || i <= 7) {
|
|
||||||
int i4 = 10;
|
|
||||||
@@ -702,6 +733,26 @@ public class Raid {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol Start - Raid revert
|
|
||||||
+ @Nullable
|
|
||||||
+ private BlockPos findRandomSpawnPos(ServerLevel level, int n, int n2) {
|
|
||||||
+ int n3 = 2 - n;
|
|
||||||
+ BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
|
||||||
+ SpawnPlacementType spawnPlacementType = SpawnPlacements.getPlacementType(EntityType.RAVAGER);
|
|
||||||
+ for (int i = 0; i < n2; ++i) {
|
|
||||||
+ float f = level.random.nextFloat() * ((float)Math.PI * 2);
|
|
||||||
+ int n4 = this.center.getX() + Mth.floor(Mth.cos(f) * 32.0f * (float)n3) + level.random.nextInt(5);
|
|
||||||
+ int n5 = this.center.getZ() + Mth.floor(Mth.sin(f) * 32.0f * (float)n3) + level.random.nextInt(5);
|
|
||||||
+ int n6 = level.getHeight(Heightmap.Types.WORLD_SURFACE, n4, n5);
|
|
||||||
+ mutableBlockPos.set(n4, n6, n5);
|
|
||||||
+ if (level.isVillage(mutableBlockPos) && n < 2) continue;
|
|
||||||
+ if (!level.hasChunksAt(mutableBlockPos.getX() - 10, mutableBlockPos.getZ() - 10, mutableBlockPos.getX() + 10, mutableBlockPos.getZ() + 10) || !level.isPositionEntityTicking(mutableBlockPos) || !spawnPlacementType.isSpawnPositionOk(level, mutableBlockPos, EntityType.RAVAGER) && (!level.getBlockState(mutableBlockPos.below()).is(Blocks.SNOW) || !level.getBlockState(mutableBlockPos).isAir())) continue;
|
|
||||||
+ return mutableBlockPos;
|
|
||||||
+ }
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Raid revert
|
|
||||||
+
|
|
||||||
private boolean addWaveMob(ServerLevel level, int wave, Raider raider) {
|
|
||||||
// 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..cb537b243b16876e7922cd732ab8dad8d046a450 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 {
|
|
||||||
|
|
||||||
currentRaid.removeFromRaid(serverLevel, this, false);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Leaves start - Revert raid changes
|
|
||||||
+ if (me.earthme.luminol.config.modules.misc.RaidChangesConfig.effect && !this.hasRaid()) {
|
|
||||||
+ ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
|
||||||
+ net.minecraft.world.entity.player.Player entityhuman = null;
|
|
||||||
+ if (entity instanceof net.minecraft.world.entity.player.Player player) {
|
|
||||||
+ entityhuman = player;
|
|
||||||
+ } else if (entity instanceof net.minecraft.world.entity.animal.wolf.Wolf wolf) {
|
|
||||||
+ LivingEntity entityliving = wolf.getOwner();
|
|
||||||
+ if (wolf.isTame() && entityliving instanceof net.minecraft.world.entity.player.Player player) {
|
|
||||||
+ entityhuman = player;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (entityhuman != null && !itemstack.isEmpty() && this.isCaptain()) {
|
|
||||||
+ net.minecraft.world.effect.MobEffectInstance mobeffect = entityhuman.getEffect(net.minecraft.world.effect.MobEffects.BAD_OMEN);
|
|
||||||
+ int i = 1;
|
|
||||||
+
|
|
||||||
+ if (mobeffect != null) {
|
|
||||||
+ i += mobeffect.getAmplifier();
|
|
||||||
+ entityhuman.removeEffectNoUpdate(net.minecraft.world.effect.MobEffects.BAD_OMEN);
|
|
||||||
+ } else {
|
|
||||||
+ --i;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ i = net.minecraft.util.Mth.clamp(i, 0, 4);
|
|
||||||
+ net.minecraft.world.effect.MobEffectInstance mobeffect1 = new net.minecraft.world.effect.MobEffectInstance(net.minecraft.world.effect.MobEffects.BAD_OMEN, me.earthme.luminol.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
|
|
||||||
+ }
|
|
||||||
+ this.setPatrolLeader(false);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ // Leaves end - Revert raid changes
|
|
||||||
}
|
|
||||||
|
|
||||||
super.die(cause);
|
|
||||||
@@ -155,7 +190,7 @@ public abstract class Raider extends PatrollingMonster {
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasRaid() {
|
|
||||||
- return this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null);
|
|
||||||
+ return !me.earthme.luminol.config.modules.misc.RaidChangesConfig.selfCheck && (this.level() instanceof ServerLevel serverLevel && (this.getCurrentRaid() != null || serverLevel.getRaidAt(this.blockPosition()) != null)); // Leaves - Disable raid self check
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasActiveRaid() {
|
|
||||||
diff --git a/net/minecraft/world/item/component/OminousBottleAmplifier.java b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
|
||||||
index 33907bb190ffa22ccf9ea424b1e536297878711a..ee8f7d840520b113036e7d2e5e36f626651e1fa5 100644
|
|
||||||
--- a/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
|
||||||
+++ b/net/minecraft/world/item/component/OminousBottleAmplifier.java
|
|
||||||
@@ -29,7 +29,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConsume(Level level, LivingEntity entity, ItemStack stack, Consumable consumable) {
|
|
||||||
- entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below
|
|
||||||
+ entity.addEffect(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Paper - properly resend entities - diff on change for below // Luminol - Raid effect infinite
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paper start - properly resend entities - collect packets for bundle
|
|
||||||
@@ -41,7 +41,7 @@ public record OminousBottleAmplifier(int value) implements ConsumableListener, T
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addToTooltip(Item.TooltipContext context, Consumer<Component> tooltipAdder, TooltipFlag flag, DataComponentGetter componentGetter) {
|
|
||||||
- List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, 120000, this.value, false, false, true));
|
|
||||||
+ List<MobEffectInstance> list = List.of(new MobEffectInstance(MobEffects.BAD_OMEN, me.earthme.luminol.config.modules.misc.RaidChangesConfig.infinite ? net.minecraft.world.effect.MobEffectInstance.INFINITE_DURATION : 120000, this.value, false, false, true)); // Luminol - Raid effect infinite
|
|
||||||
PotionContents.addPotionTooltip(list, tooltipAdder, 1.0F, context.tickRate());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: MrHua269 <wangxyper@163.com>
|
||||||
|
Date: Sun, 12 Jan 2025 10:39:35 +0800
|
||||||
|
Subject: [PATCH] Add fix for off region adult following ai behavior
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||||
|
index d69cb6f45cba4234605c7a0f7ddf8f331eee0c62..2ac16196b96041abc82bd3230d8305fe3333831f 100644
|
||||||
|
--- a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||||
|
+++ b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||||
|
@@ -29,6 +29,12 @@ public class BabyFollowAdult {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
LivingEntity livingEntity = instance.get(memoryAccessor);
|
||||||
|
+ // Luminol start - Fix off world entity following which caused async issue
|
||||||
|
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(livingEntity)) {
|
||||||
|
+ memoryAccessor.erase();
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ // Luminol end
|
||||||
|
if (entity.closerThan(livingEntity, followRange.getMaxValue() + 1) && !entity.closerThan(livingEntity, followRange.getMinValue())) {
|
||||||
|
// CraftBukkit start
|
||||||
|
org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(entity, livingEntity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER);
|
||||||
|
@@ -39,6 +45,12 @@ public class BabyFollowAdult {
|
||||||
|
memoryAccessor.erase();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
+ // Luminol start - Fix off region baby follow adult ai
|
||||||
|
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity)event.getTarget()).getHandleRaw())) {
|
||||||
|
+ memoryAccessor.erase();
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ // Luminol end
|
||||||
|
livingEntity = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle();
|
||||||
|
// CraftBukkit end
|
||||||
|
WalkTarget walkTarget = new WalkTarget(
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add force the data command to be enabled config
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||||
index fca716bf52e114b196c7617f352e9394c7185271..5a275b9ac7e706012ae5d8a12ee8a3f00f129f93 100644
|
index 68f2f2d8067d11fa4459c9fa21bc3fd4134b9157..14719cca5ff91c8647b3b616b2dfd4d153946d92 100644
|
||||||
--- a/net/minecraft/commands/Commands.java
|
--- a/net/minecraft/commands/Commands.java
|
||||||
+++ b/net/minecraft/commands/Commands.java
|
+++ b/net/minecraft/commands/Commands.java
|
||||||
@@ -162,7 +162,9 @@ public class Commands {
|
@@ -189,7 +189,9 @@ public class Commands {
|
||||||
ClearInventoryCommands.register(this.dispatcher, context);
|
ClearInventoryCommands.register(this.dispatcher, context);
|
||||||
//CloneCommands.register(this.dispatcher, context); // Folia - region threading - TODO
|
//CloneCommands.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||||
DamageCommand.register(this.dispatcher, context);
|
DamageCommand.register(this.dispatcher, context);
|
||||||
@@ -16,6 +16,6 @@ index fca716bf52e114b196c7617f352e9394c7185271..5a275b9ac7e706012ae5d8a12ee8a3f0
|
|||||||
+ if(me.earthme.luminol.config.modules.experiment.CommandDataConfig.enabled) {
|
+ if(me.earthme.luminol.config.modules.experiment.CommandDataConfig.enabled) {
|
||||||
+ DataCommands.register(this.dispatcher); // Folia - region threading - TODO
|
+ DataCommands.register(this.dispatcher); // Folia - region threading - TODO
|
||||||
+ }
|
+ }
|
||||||
//DataPackCommand.register(this.dispatcher); // Folia - region threading - TODO
|
//DataPackCommand.register(this.dispatcher, context); // Folia - region threading - TODO
|
||||||
//DebugCommand.register(this.dispatcher); // Folia - region threading - TODO
|
//DebugCommand.register(this.dispatcher); // Folia - region threading - TODO
|
||||||
DefaultGameModeCommands.register(this.dispatcher);
|
DefaultGameModeCommands.register(this.dispatcher);
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
||||||
Date: Tue, 29 Apr 2025 23:03:56 +0800
|
|
||||||
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 f90defbc0d06b48bdfd6bdfa1a2bf4a6267a45d2..d42f4375952239ecc53a8fbca449120d8a1c52a6 100644
|
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
|
||||||
@@ -1289,6 +1289,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);
|
|
||||||
+ // Luminol Start - Cross Region Damage trace
|
|
||||||
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
|
||||||
+ final LivingEntity entitylivingnew = this.getKillCreditOrigin();
|
|
||||||
+ if (entitylivingnew != null) {
|
|
||||||
+ this.damageTransferToAsync(entitylivingnew, cause);
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Cross Region Damage trace
|
|
||||||
}
|
|
||||||
|
|
||||||
this.level().broadcastEntityEvent(this, (byte)3);
|
|
||||||
@@ -1303,6 +1310,24 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
|
||||||
this.setClientLoaded(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol Start - Cross Region Damage trace
|
|
||||||
+ private void damageTransferToAsync(LivingEntity entity, DamageSource cause) {
|
|
||||||
+ // Operations running on current entity
|
|
||||||
+ this.awardStat(Stats.ENTITY_KILLED_BY.get(entity.getType()));
|
|
||||||
+ this.createWitherRose(entity);
|
|
||||||
+
|
|
||||||
+ // the entity might be in another tickregion sometimes, so we need to schedule the task onto the entity
|
|
||||||
+ // to ensure thread safe
|
|
||||||
+ entity.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
|
|
||||||
+ try {
|
|
||||||
+ nmsEntity.awardKillScore(this, cause);
|
|
||||||
+ } catch (Throwable ex) {
|
|
||||||
+ LOGGER.error(ex.getMessage(), ex);
|
|
||||||
+ }
|
|
||||||
+ }, null, 1L );
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Cross Region Damage trace
|
|
||||||
+
|
|
||||||
private void tellNeutralMobsThatIDied() {
|
|
||||||
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 6102493315f1db2695478ecd7a346cc3f371ebe0..c1d53987991a0808733eac3b500d5d5a0f5d7ac2 100644
|
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
|
||||||
@@ -1190,6 +1190,29 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol Start - raid revert adapt Cross Region Damage trace
|
|
||||||
+ public boolean addEffect(MobEffectInstance effectInstance, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause, boolean fireEvent, boolean async) {
|
|
||||||
+ if (ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
|
|
||||||
+ return addEffect(effectInstance, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true);
|
|
||||||
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
|
||||||
+ postToEntityThreadAddEffect(effectInstance, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.PATROL_CAPTAIN, true);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private void postToEntityThreadAddEffect(MobEffectInstance effectInstance, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause, boolean fireEvent) {
|
|
||||||
+ if (entity != null)
|
|
||||||
+ entity.getBukkitEntity().taskScheduler.schedule((Entity nmsEntity) -> {
|
|
||||||
+ try {
|
|
||||||
+ addEffect(effectInstance, nmsEntity, cause, fireEvent);
|
|
||||||
+ } catch (Throwable ex) {
|
|
||||||
+ LOGGER.error(ex.getMessage(), ex);
|
|
||||||
+ }
|
|
||||||
+ }, null, 1L );
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - raid revert adapt Cross Region Damage trace
|
|
||||||
+
|
|
||||||
public boolean canBeAffected(MobEffectInstance effectInstance) {
|
|
||||||
if (this.getType().is(EntityTypeTags.IMMUNE_TO_INFESTED)) {
|
|
||||||
return !effectInstance.is(MobEffects.INFESTED);
|
|
||||||
@@ -1914,6 +1937,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
||||||
final LivingEntity killer = this.getKillCredit();
|
|
||||||
if (killer != null) {
|
|
||||||
killer.awardKillScore(this, damageSource);
|
|
||||||
+ // Luminol Start - Cross Region Damage trace
|
|
||||||
+ } else if (me.earthme.luminol.config.modules.experiment.EntityDamageSourceTraceConfig.enabled) {
|
|
||||||
+ final LivingEntity killernew = this.getKillCreditOrigin();
|
|
||||||
+ if (killernew != null) {
|
|
||||||
+ this.damageTransferToAsync(killernew, damageSource);
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Cross Region Damage trace
|
|
||||||
}
|
|
||||||
}); // Paper end
|
|
||||||
this.postDeathDropItems(deathEvent); // Paper
|
|
||||||
@@ -1924,6 +1954,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
||||||
return deathEvent; // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol Start - Cross Region Damage trace
|
|
||||||
+ private void damageTransferToAsync(LivingEntity entity, DamageSource damageSource) {
|
|
||||||
+ entity.getBukkitEntity().taskScheduler.schedule((LivingEntity nmsEntity) -> {
|
|
||||||
+ try {
|
|
||||||
+ nmsEntity.awardKillScore(this, damageSource);
|
|
||||||
+ } catch (Throwable ex) {
|
|
||||||
+ LOGGER.error(ex.getMessage(), ex);
|
|
||||||
+ }
|
|
||||||
+ }, null, 1L );
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Cross Region Damage trace
|
|
||||||
+
|
|
||||||
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
|
|
||||||
@@ -2508,6 +2550,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Luminol Start - Cross Region Damage trace
|
|
||||||
+ @Nullable
|
|
||||||
+ public LivingEntity getKillCreditOrigin() {
|
|
||||||
+ if (this.lastHurtByPlayer != null) {
|
|
||||||
+ return this.lastHurtByPlayer.getEntity(this.level(), Player.class);
|
|
||||||
+ } else if (this.lastHurtByMob != null) {
|
|
||||||
+ return this.lastHurtByMob.getEntity(this.level(), LivingEntity.class);
|
|
||||||
+ }
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
+ // Luminol End - Cross Region Damage trace
|
|
||||||
+
|
|
||||||
public final float getMaxHealth() {
|
|
||||||
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 cb537b243b16876e7922cd732ab8dad8d046a450..c25f4b6bb3e11cc13d2de6f2d123d8c7d5a58649 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 {
|
|
||||||
net.minecraft.world.effect.MobEffectInstance mobeffect1 = new net.minecraft.world.effect.MobEffectInstance(net.minecraft.world.effect.MobEffects.BAD_OMEN, me.earthme.luminol.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
|
|
||||||
+ if (me.earthme.luminol.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
|
|
||||||
+ }
|
|
||||||
+ // Luminol end - Raid changes adapt DamageSource trace
|
|
||||||
}
|
|
||||||
this.setPatrolLeader(false);
|
|
||||||
}
|
|
||||||
@@ -1,160 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MrHua269 <wangxyper@163.com>
|
|
||||||
Date: Wed, 5 Feb 2025 15:22:19 +0800
|
|
||||||
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 d0c03dc51c8ad4997963b244ada855827a4c4065..99a8b9a8ee2032107be03bbc13d0275a337faf7b 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
|
|
||||||
double d1 = vec3_dx * vec3_dx + vec3_dz * vec3_dz; // Paper
|
|
||||||
double d2 = d * d;
|
|
||||||
// Paper start - Configurable entity tracking range by Y
|
|
||||||
- boolean flag = d1 <= d2;
|
|
||||||
+ boolean flag = d1 <= d2 && !entity.isCulled(); // Luminol - Ray tracing entity tracker
|
|
||||||
if (flag && level.paperConfig().entities.trackingRangeY.enabled) {
|
|
||||||
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 b5838a0320c729778f27f0d6a623eed4ef7c3a52..e9ea86d77395975afbe189993ee0dbbd066c3536 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;
|
|
||||||
import org.jetbrains.annotations.Contract;
|
|
||||||
|
|
||||||
-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;
|
|
||||||
@@ -5957,4 +5957,48 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
||||||
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
|
|
||||||
}
|
|
||||||
// Paper end - Expose entity id counter
|
|
||||||
+
|
|
||||||
+ public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
|
|
||||||
+
|
|
||||||
+ private long lasttime = 0;
|
|
||||||
+ private boolean culled = false;
|
|
||||||
+ private boolean outOfCamera = false;
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void setTimeout() {
|
|
||||||
+ this.lasttime = System.currentTimeMillis() + 1000;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isForcedVisible() {
|
|
||||||
+ return this.lasttime > System.currentTimeMillis();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void setCulled(boolean value) {
|
|
||||||
+ this.culled = value;
|
|
||||||
+ if (!value) {
|
|
||||||
+ setTimeout();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isCulled() {
|
|
||||||
+ if (!me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.enabled)
|
|
||||||
+ return false;
|
|
||||||
+ return this.culled;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void setOutOfCamera(boolean value) {
|
|
||||||
+ this.outOfCamera = value;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isOutOfCamera() {
|
|
||||||
+ if (!me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.enabled)
|
|
||||||
+ return false;
|
|
||||||
+ return this.outOfCamera;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
}
|
|
||||||
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
|
|
||||||
index 6b72ab233508e6df1eca34360ce76d102ee25a41..f39ee4605cc15102d6560afd1dad5f56dd53cf4e 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
|
|
||||||
public final int passengerTickTimerId;
|
|
||||||
public final int passengerInactiveTickTimerId;
|
|
||||||
// Folia end - profiler
|
|
||||||
+ // Luminol - Raytracing entity tracker
|
|
||||||
+ public boolean skipRaytracningCheck = false;
|
|
||||||
+ // Luminol end
|
|
||||||
|
|
||||||
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 aed525af488eb839d31d6bec0673b7e128ca4068..5af32286092222f09ad2b54dd2fa6bd9ad3a8f40 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 {
|
|
||||||
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
+ // Luminol start - Raytracing entity tracker
|
|
||||||
+ public dev.tr7zw.entityculling.CullTask cullTask;
|
|
||||||
+ {
|
|
||||||
+ if (!me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.enabled) {
|
|
||||||
+ this.cullTask = null;
|
|
||||||
+ }else {
|
|
||||||
+ final com.logisticscraft.occlusionculling.OcclusionCullingInstance culling = new com.logisticscraft.occlusionculling.OcclusionCullingInstance(
|
|
||||||
+ me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.tracingDistance,
|
|
||||||
+ new dev.tr7zw.entityculling.DefaultChunkDataProvider(this.level())
|
|
||||||
+ );
|
|
||||||
+
|
|
||||||
+ this.cullTask = new dev.tr7zw.entityculling.CullTask(
|
|
||||||
+ culling, this,
|
|
||||||
+ me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.hitboxLimit,
|
|
||||||
+ me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.checkIntervalMs
|
|
||||||
+ );
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ // Luminol end
|
|
||||||
|
|
||||||
public Player(Level level, BlockPos pos, float yRot, GameProfile gameProfile) {
|
|
||||||
super(EntityType.PLAYER, level);
|
|
||||||
@@ -277,6 +296,26 @@ public abstract class Player extends LivingEntity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void tick() {
|
|
||||||
+ // Luminol start - Ray tracing entity tracker
|
|
||||||
+ if (!me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.enabled) {
|
|
||||||
+ if (this.cullTask != null) this.cullTask.signalStop();
|
|
||||||
+ this.cullTask = null;
|
|
||||||
+ }else {
|
|
||||||
+ final com.logisticscraft.occlusionculling.OcclusionCullingInstance culling = new com.logisticscraft.occlusionculling.OcclusionCullingInstance(
|
|
||||||
+ me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.tracingDistance,
|
|
||||||
+ new dev.tr7zw.entityculling.DefaultChunkDataProvider(this.level())
|
|
||||||
+ );
|
|
||||||
+
|
|
||||||
+ this.cullTask = new dev.tr7zw.entityculling.CullTask(
|
|
||||||
+ culling, this,
|
|
||||||
+ me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.hitboxLimit,
|
|
||||||
+ me.earthme.luminol.config.modules.experiment.RayTrackingEntityTrackerConfig.checkIntervalMs
|
|
||||||
+ );
|
|
||||||
+ }
|
|
||||||
+ if (this.cullTask != null) this.cullTask.setup();
|
|
||||||
+ if (this.cullTask != null) this.cullTask.requestCullSignal(); // Luminol - Ray tracing entity tracker
|
|
||||||
+ // Luminol end
|
|
||||||
+
|
|
||||||
this.noPhysics = this.isSpectator();
|
|
||||||
if (this.isSpectator() || this.isPassenger()) {
|
|
||||||
this.setOnGround(false);
|
|
||||||
@@ -1415,6 +1454,7 @@ public abstract class Player extends LivingEntity {
|
|
||||||
if (this.containerMenu != null && this.hasContainerOpen()) {
|
|
||||||
this.doCloseContainer();
|
|
||||||
}
|
|
||||||
+ if (this.cullTask != null) this.cullTask.signalStop(); // Luminol - Ray tracing entity tracker
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -17,10 +17,10 @@ index bd3ce123652af11974be4cbf8d2e96f1b2ee0a68..5f26fd89704aa3fd9c37a1d68a7c4c65
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index ecf185fce582a542c65a9544388b84835643978b..12062e37c0e832f27ba52844739d0e8d5519a30a 100644
|
index 8502fdb94142cf12b8d9d4900d8a2440051051ae..d824b49b98266539258a83f9a36f73c5961a1588 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -1663,7 +1663,46 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1664,7 +1664,46 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// Folia end - region threading
|
// Folia end - region threading
|
||||||
//this.tickCount++; // Folia - region threading
|
//this.tickCount++; // Folia - region threading
|
||||||
//this.tickRateManager.tick(); // Folia - region threading
|
//this.tickRateManager.tick(); // Folia - region threading
|
||||||
@@ -68,10 +68,10 @@ index ecf185fce582a542c65a9544388b84835643978b..12062e37c0e832f27ba52844739d0e8d
|
|||||||
this.lastServerStatus = nanos;
|
this.lastServerStatus = nanos;
|
||||||
this.status = this.buildServerStatus();
|
this.status = this.buildServerStatus();
|
||||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index e76599e92e4bf4f5b5d7176f4a0a2a854d10818a..20df6b46c420b25b598accb57b921055fb0c988b 100644
|
index 61d63e5668e110e9c0b891959bf4cd7c91e54645..f07d3009caf964b8e1b5328bb3e28866e0c41955 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -724,6 +724,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -721,6 +721,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stopServer() {
|
public void stopServer() {
|
||||||
@@ -82,10 +82,10 @@ index e76599e92e4bf4f5b5d7176f4a0a2a854d10818a..20df6b46c420b25b598accb57b921055
|
|||||||
//Util.shutdownExecutors(); // Paper - Improved watchdog support; moved into super
|
//Util.shutdownExecutors(); // Paper - Improved watchdog support; moved into super
|
||||||
SkullBlockEntity.clear();
|
SkullBlockEntity.clear();
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 94fb1c99baefbdde91dc5fcf103683c7ffda6baf..b4fdbdba579fa7c7de4928c259b5ff16b0e83aeb 100644
|
index 5e3be75b27ed609be005e8169dc84c125518253e..00482efc8e736e73ad136105ad7b9dd2cafd581f 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1342,6 +1342,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -1350,6 +1350,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
final int timerId = isActive ? entity.getType().tickTimerId : entity.getType().inactiveTickTimerId;
|
final int timerId = isActive ? entity.getType().tickTimerId : entity.getType().inactiveTickTimerId;
|
||||||
final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler();
|
final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler();
|
||||||
profiler.startTimer(timerId);
|
profiler.startTimer(timerId);
|
||||||
@@ -94,7 +94,7 @@ index 94fb1c99baefbdde91dc5fcf103683c7ffda6baf..b4fdbdba579fa7c7de4928c259b5ff16
|
|||||||
try {
|
try {
|
||||||
// Folia end - profiler
|
// Folia end - profiler
|
||||||
if (isActive) { // Paper - EAR 2
|
if (isActive) { // Paper - EAR 2
|
||||||
@@ -1359,6 +1361,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -1367,6 +1369,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
} else {entity.inactiveTick();} // Paper - EAR 2
|
} else {entity.inactiveTick();} // Paper - EAR 2
|
||||||
profilerFiller.pop();
|
profilerFiller.pop();
|
||||||
} finally { profiler.stopTimer(timerId); } // Folia - profiler
|
} finally { profiler.stopTimer(timerId); } // Folia - profiler
|
||||||
@@ -102,7 +102,7 @@ index 94fb1c99baefbdde91dc5fcf103683c7ffda6baf..b4fdbdba579fa7c7de4928c259b5ff16
|
|||||||
|
|
||||||
for (Entity entity1 : entity.getPassengers()) {
|
for (Entity entity1 : entity.getPassengers()) {
|
||||||
this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2
|
this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2
|
||||||
@@ -1378,6 +1381,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -1386,6 +1389,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
final int timerId = isActive ? passengerEntity.getType().tickTimerId : passengerEntity.getType().inactiveTickTimerId;
|
final int timerId = isActive ? passengerEntity.getType().tickTimerId : passengerEntity.getType().inactiveTickTimerId;
|
||||||
final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler();
|
final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle profiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler();
|
||||||
profiler.startTimer(timerId);
|
profiler.startTimer(timerId);
|
||||||
@@ -111,7 +111,7 @@ index 94fb1c99baefbdde91dc5fcf103683c7ffda6baf..b4fdbdba579fa7c7de4928c259b5ff16
|
|||||||
try {
|
try {
|
||||||
// Folia end - profiler
|
// Folia end - profiler
|
||||||
passengerEntity.setOldPosAndRot();
|
passengerEntity.setOldPosAndRot();
|
||||||
@@ -1412,6 +1417,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -1420,6 +1425,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2
|
this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2
|
||||||
}
|
}
|
||||||
} finally { profiler.stopTimer(timerId); } // Folia - profiler
|
} finally { profiler.stopTimer(timerId); } // Folia - profiler
|
||||||
@@ -120,10 +120,10 @@ index 94fb1c99baefbdde91dc5fcf103683c7ffda6baf..b4fdbdba579fa7c7de4928c259b5ff16
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 111f2f05d0ad3f290dab97f231caf8516821e030..047279cce3ff3a9eedd54db370b8fa6754d85ee4 100644
|
index 5e7a9be34bec7eefbb46db1409bfd90351866ec2..4e3c545f6121d3846d81d776c29edc42d6204f5c 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -420,7 +420,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -431,7 +431,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||||
public @Nullable String clientBrandName = null; // Paper - Brand support
|
public @Nullable String clientBrandName = null; // Paper - Brand support
|
||||||
public @Nullable org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
public @Nullable org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
||||||
@@ -134,7 +134,7 @@ index 111f2f05d0ad3f290dab97f231caf8516821e030..047279cce3ff3a9eedd54db370b8fa67
|
|||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||||
private final ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder viewDistanceHolder = new ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder();
|
private final ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder viewDistanceHolder = new ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.ViewDistanceHolder();
|
||||||
@@ -957,8 +959,35 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1025,8 +1027,35 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
this.trackEnteredOrExitedLavaOnVehicle();
|
this.trackEnteredOrExitedLavaOnVehicle();
|
||||||
this.updatePlayerAttributes();
|
this.updatePlayerAttributes();
|
||||||
this.advancements.flushDirty(this, true);
|
this.advancements.flushDirty(this, true);
|
||||||
@@ -171,10 +171,10 @@ index 111f2f05d0ad3f290dab97f231caf8516821e030..047279cce3ff3a9eedd54db370b8fa67
|
|||||||
AttributeInstance attribute = this.getAttribute(Attributes.BLOCK_INTERACTION_RANGE);
|
AttributeInstance attribute = this.getAttribute(Attributes.BLOCK_INTERACTION_RANGE);
|
||||||
if (attribute != null) {
|
if (attribute != null) {
|
||||||
diff --git a/net/minecraft/world/entity/AreaEffectCloud.java b/net/minecraft/world/entity/AreaEffectCloud.java
|
diff --git a/net/minecraft/world/entity/AreaEffectCloud.java b/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
index bfd904e468bbf2cc1a5b3353d3a69ad5087c81ae..116933975ac975bb5a801be81e1c0e9bd641f162 100644
|
index ec20a5a6d7c8f65abda528fec36bec7bc71117f6..b971cd61db1cfa05b8f2fd6c8a2dac2e27851288 100644
|
||||||
--- a/net/minecraft/world/entity/AreaEffectCloud.java
|
--- a/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
+++ b/net/minecraft/world/entity/AreaEffectCloud.java
|
+++ b/net/minecraft/world/entity/AreaEffectCloud.java
|
||||||
@@ -436,4 +436,11 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
@@ -423,4 +423,11 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
|
||||||
return super.applyImplicitComponent(component, value);
|
return super.applyImplicitComponent(component, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -187,20 +187,21 @@ index bfd904e468bbf2cc1a5b3353d3a69ad5087c81ae..116933975ac975bb5a801be81e1c0e9b
|
|||||||
+ // KioCG end
|
+ // KioCG end
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index e9ea86d77395975afbe189993ee0dbbd066c3536..0228471a16805042f13158b86379a77371600489 100644
|
index 49c76f150c913fdc21d0e253b78625e273f69a22..f5f03801da03089ea1d22de1012d90a2b7b17322 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -6000,5 +6000,4 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -6218,4 +6218,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return false;
|
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
|
||||||
return this.outOfCamera;
|
|
||||||
}
|
}
|
||||||
-
|
// Paper end - Expose entity id counter
|
||||||
|
+
|
||||||
|
+ public boolean shouldTickHot() { return this.tickCount > 20 * 10 && this.isAlive(); } // KioCG
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/LightningBolt.java b/net/minecraft/world/entity/LightningBolt.java
|
diff --git a/net/minecraft/world/entity/LightningBolt.java b/net/minecraft/world/entity/LightningBolt.java
|
||||||
index c1c63c77598786d86b4aa4475cc4d36e60955085..27dd86d1d94959cbe8376ee714e3306732151105 100644
|
index b091a382624140acb3f3f82647bdd592b7ee1f95..81b4e418687536b54f4ee8bd131185a8547ae651 100644
|
||||||
--- a/net/minecraft/world/entity/LightningBolt.java
|
--- a/net/minecraft/world/entity/LightningBolt.java
|
||||||
+++ b/net/minecraft/world/entity/LightningBolt.java
|
+++ b/net/minecraft/world/entity/LightningBolt.java
|
||||||
@@ -287,4 +287,11 @@ public class LightningBolt extends Entity {
|
@@ -288,4 +288,11 @@ public class LightningBolt extends Entity {
|
||||||
public final boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
|
public final boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -213,10 +214,10 @@ index c1c63c77598786d86b4aa4475cc4d36e60955085..27dd86d1d94959cbe8376ee714e33067
|
|||||||
+ // KioCG end
|
+ // KioCG end
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||||
index a96318e5684d61b2bee998531695b0fe12e9deac..34738e880e6ef30730fc72d7b0fb89c53783be17 100644
|
index 1240fb5394b1475c8e95a0e65bd03f2d15565d6f..d9ee3b56db44687cfcc6a75f44a1abbcc8ef95a9 100644
|
||||||
--- a/net/minecraft/world/entity/Mob.java
|
--- a/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/net/minecraft/world/entity/Mob.java
|
+++ b/net/minecraft/world/entity/Mob.java
|
||||||
@@ -1592,4 +1592,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
@@ -1618,4 +1618,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
this.getNavigation().updatePathfinderMaxVisitedNodes();
|
this.getNavigation().updatePathfinderMaxVisitedNodes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,10 +230,10 @@ index a96318e5684d61b2bee998531695b0fe12e9deac..34738e880e6ef30730fc72d7b0fb89c5
|
|||||||
+ // KioCG end
|
+ // KioCG end
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/animal/horse/TraderLlama.java b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
diff --git a/net/minecraft/world/entity/animal/horse/TraderLlama.java b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
||||||
index 38a5554d6e28ab73c225625531c94592a46d50a8..149fe0c4c2df7cd6925308f6bca5772050594cf3 100644
|
index 2cd1b988f44caf271a7d2dfccf118be53b77caba..d829b230ab366922697061bdbb9a4f1cdc00744f 100644
|
||||||
--- a/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
--- a/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
||||||
+++ b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
+++ b/net/minecraft/world/entity/animal/horse/TraderLlama.java
|
||||||
@@ -156,4 +156,11 @@ public class TraderLlama extends Llama {
|
@@ -157,4 +157,11 @@ public class TraderLlama extends Llama {
|
||||||
super.start();
|
super.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,10 +246,10 @@ index 38a5554d6e28ab73c225625531c94592a46d50a8..149fe0c4c2df7cd6925308f6bca57720
|
|||||||
+ // KioCG end
|
+ // KioCG end
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/npc/WanderingTrader.java b/net/minecraft/world/entity/npc/WanderingTrader.java
|
diff --git a/net/minecraft/world/entity/npc/WanderingTrader.java b/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||||
index 70cc20483905d3877e2ffb51afb4902bd59f0cd0..fff3965d892e20a3ad9c84fad2c2df2ffe931fe2 100644
|
index c2573946dd1244eb5d1ef2be7823211064daa80d..7e9662bf7c17b2f5eda2ff88970a23e4fb09456a 100644
|
||||||
--- a/net/minecraft/world/entity/npc/WanderingTrader.java
|
--- a/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||||
+++ b/net/minecraft/world/entity/npc/WanderingTrader.java
|
+++ b/net/minecraft/world/entity/npc/WanderingTrader.java
|
||||||
@@ -277,4 +277,11 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
@@ -278,4 +278,11 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
|
||||||
return !pos.closerToCenterThan(this.trader.position(), distance);
|
return !pos.closerToCenterThan(this.trader.position(), distance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,10 +262,10 @@ index 70cc20483905d3877e2ffb51afb4902bd59f0cd0..fff3965d892e20a3ad9c84fad2c2df2f
|
|||||||
+ // KioCG end
|
+ // KioCG end
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
||||||
index 5af32286092222f09ad2b54dd2fa6bd9ad3a8f40..0d774fd4be1cdcf03e76db8b17309bbf01bafc55 100644
|
index 73d1557f2d7d60a9a2ad2c3f710b0969c4c5cf40..47f62fbe97c559c25ad2bc67c18f2025c78e2c69 100644
|
||||||
--- a/net/minecraft/world/entity/player/Player.java
|
--- a/net/minecraft/world/entity/player/Player.java
|
||||||
+++ b/net/minecraft/world/entity/player/Player.java
|
+++ b/net/minecraft/world/entity/player/Player.java
|
||||||
@@ -1521,6 +1521,13 @@ public abstract class Player extends LivingEntity {
|
@@ -1493,6 +1493,13 @@ public abstract class Player extends LivingEntity {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,10 +280,10 @@ index 5af32286092222f09ad2b54dd2fa6bd9ad3a8f40..0d774fd4be1cdcf03e76db8b17309bbf
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
return this.startSleepInBed(bedPos, false);
|
return this.startSleepInBed(bedPos, false);
|
||||||
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
|
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
index 487e550d6d1f44597cfe14c4aaeb3713e3d916b7..7308dab3248b3319cee6fd0dabfe8e4b7c2628cf 100644
|
index b6cdd02ead8ecc38afd4e76fa0c19a9433550b1d..71c1473e470db82dffcf6be4b4ded61564577e92 100644
|
||||||
--- a/net/minecraft/world/entity/projectile/Projectile.java
|
--- a/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
+++ b/net/minecraft/world/entity/projectile/Projectile.java
|
+++ b/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
@@ -527,4 +527,11 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
@@ -488,4 +488,11 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
public interface ProjectileFactory<T extends Projectile> {
|
public interface ProjectileFactory<T extends Projectile> {
|
||||||
T create(ServerLevel level, LivingEntity owner, ItemStack spawnedFrom);
|
T create(ServerLevel level, LivingEntity owner, ItemStack spawnedFrom);
|
||||||
}
|
}
|
||||||
@@ -295,10 +296,10 @@ index 487e550d6d1f44597cfe14c4aaeb3713e3d916b7..7308dab3248b3319cee6fd0dabfe8e4b
|
|||||||
+ // KioCG end
|
+ // KioCG end
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
index 23ccd2bc86e643eb3e79195d20c1182d3ad7ead6..569c13814e99f884048742226c2871fabf1e9790 100644
|
index e74ea44096e071878372c5b8889f45cd2bd4ae23..7add73f2dd957374661affebfa2b0102d99363f8 100644
|
||||||
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
--- a/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
|
||||||
@@ -104,6 +104,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
@@ -106,6 +106,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
private boolean postProcessingDone;
|
private boolean postProcessingDone;
|
||||||
private ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder chunkAndHolder;
|
private ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder chunkAndHolder;
|
||||||
@@ -306,7 +307,7 @@ index 23ccd2bc86e643eb3e79195d20c1182d3ad7ead6..569c13814e99f884048742226c2871fa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean moonrise$isPostProcessingDone() {
|
public final boolean moonrise$isPostProcessingDone() {
|
||||||
@@ -930,6 +931,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
@@ -937,6 +938,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
try {
|
try {
|
||||||
ProfilerFiller profilerFiller = Profiler.get();
|
ProfilerFiller profilerFiller = Profiler.get();
|
||||||
profilerFiller.push(this::getType);
|
profilerFiller.push(this::getType);
|
||||||
@@ -314,7 +315,7 @@ index 23ccd2bc86e643eb3e79195d20c1182d3ad7ead6..569c13814e99f884048742226c2871fa
|
|||||||
profiler.startTimer(timerId); try { // Folia - profiler
|
profiler.startTimer(timerId); try { // Folia - profiler
|
||||||
BlockState blockState = LevelChunk.this.getBlockState(blockPos);
|
BlockState blockState = LevelChunk.this.getBlockState(blockPos);
|
||||||
if (this.blockEntity.getType().isValid(blockState)) {
|
if (this.blockEntity.getType().isValid(blockState)) {
|
||||||
@@ -944,7 +946,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
@@ -951,7 +953,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||||
}
|
}
|
||||||
// Paper end - Remove the Block Entity if it's invalid
|
// Paper end - Remove the Block Entity if it's invalid
|
||||||
}
|
}
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add missing teleportation apis for folia
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 047279cce3ff3a9eedd54db370b8fa6754d85ee4..bcc0c3cfa5be4daeec6e95a1b63a6cd38890f04d 100644
|
index 4e3c545f6121d3846d81d776c29edc42d6204f5c..2b06a0fba825199b07febf368418af803d8c3f8c 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -1631,6 +1631,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1701,6 +1701,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
if (respawnComplete != null) {
|
if (respawnComplete != null) {
|
||||||
respawnComplete.accept(ServerPlayer.this);
|
respawnComplete.accept(ServerPlayer.this);
|
||||||
}
|
}
|
||||||
@@ -19,10 +19,10 @@ index 047279cce3ff3a9eedd54db370b8fa6754d85ee4..bcc0c3cfa5be4daeec6e95a1b63a6cd3
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 0228471a16805042f13158b86379a77371600489..9d945f615187f86913be8a9b83b1aada3a1336b6 100644
|
index f5f03801da03089ea1d22de1012d90a2b7b17322..50b4a82a054d41ac1439f9769eaefebc103b6d94 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -4108,6 +4108,31 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4310,6 +4310,31 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO any events that can modify go HERE
|
// TODO any events that can modify go HERE
|
||||||
@@ -54,7 +54,7 @@ index 0228471a16805042f13158b86379a77371600489..9d945f615187f86913be8a9b83b1aada
|
|||||||
|
|
||||||
// check for same region
|
// check for same region
|
||||||
if (destination == this.level()) {
|
if (destination == this.level()) {
|
||||||
@@ -4224,7 +4249,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4426,7 +4451,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
// we just select the spawn position
|
// we just select the spawn position
|
||||||
case END: {
|
case END: {
|
||||||
if (destination.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.END) {
|
if (destination.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.END) {
|
||||||
@@ -74,7 +74,7 @@ index 0228471a16805042f13158b86379a77371600489..9d945f615187f86913be8a9b83b1aada
|
|||||||
// need to load chunks so we can create the platform
|
// need to load chunks so we can create the platform
|
||||||
destination.moonrise$loadChunksAsync(
|
destination.moonrise$loadChunksAsync(
|
||||||
targetPos, 16, // load 16 blocks to be safe from block physics
|
targetPos, 16, // load 16 blocks to be safe from block physics
|
||||||
@@ -4245,7 +4281,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4447,7 +4483,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -94,7 +94,7 @@ index 0228471a16805042f13158b86379a77371600489..9d945f615187f86913be8a9b83b1aada
|
|||||||
// need to load chunk for heightmap
|
// need to load chunk for heightmap
|
||||||
destination.moonrise$loadChunksAsync(
|
destination.moonrise$loadChunksAsync(
|
||||||
spawnPos, 0,
|
spawnPos, 0,
|
||||||
@@ -4296,8 +4343,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4498,8 +4545,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
|
||||||
WorldBorder destinationBorder = destination.getWorldBorder();
|
WorldBorder destinationBorder = destination.getWorldBorder();
|
||||||
double dimensionScale = net.minecraft.world.level.dimension.DimensionType.getTeleportationScale(origin.dimensionType(), destination.dimensionType());
|
double dimensionScale = net.minecraft.world.level.dimension.DimensionType.getTeleportationScale(origin.dimensionType(), destination.dimensionType());
|
||||||
@@ -114,7 +114,7 @@ index 0228471a16805042f13158b86379a77371600489..9d945f615187f86913be8a9b83b1aada
|
|||||||
ca.spottedleaf.concurrentutil.completable.CallbackCompletable<BlockUtil.FoundRectangle> portalFound
|
ca.spottedleaf.concurrentutil.completable.CallbackCompletable<BlockUtil.FoundRectangle> portalFound
|
||||||
= new ca.spottedleaf.concurrentutil.completable.CallbackCompletable<>();
|
= new ca.spottedleaf.concurrentutil.completable.CallbackCompletable<>();
|
||||||
|
|
||||||
@@ -4434,6 +4491,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4636,6 +4693,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
if (!this.canPortalAsync(destination, takePassengers)) {
|
if (!this.canPortalAsync(destination, takePassengers)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ index 0228471a16805042f13158b86379a77371600489..9d945f615187f86913be8a9b83b1aada
|
|||||||
|
|
||||||
Vec3 initialPosition = this.position();
|
Vec3 initialPosition = this.position();
|
||||||
ChunkPos initialPositionChunk = new ChunkPos(
|
ChunkPos initialPositionChunk = new ChunkPos(
|
||||||
@@ -4501,6 +4567,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4703,6 +4769,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
if (teleportComplete != null) {
|
if (teleportComplete != null) {
|
||||||
teleportComplete.accept(teleported);
|
teleportComplete.accept(teleported);
|
||||||
}
|
}
|
||||||
@@ -139,10 +139,10 @@ index 0228471a16805042f13158b86379a77371600489..9d945f615187f86913be8a9b83b1aada
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||||
index 4961bf492e692f9278aadd90ac9d55b2f1c50cba..fc529ece01d8a85e600eb8910662010ab6851d82 100644
|
index 12b9a6c16501cb0c01983c44bb247071ce675274..2dbf5064f0353b5d60d75573dc9724c3c42a25fe 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||||
@@ -191,6 +191,18 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
@@ -193,6 +193,18 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||||
portalTile.trySearchForExit(portalWorld, portalPos);
|
portalTile.trySearchForExit(portalWorld, portalPos);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MrHua269 <wangxyper@163.com>
|
|
||||||
Date: Sun, 12 Jan 2025 10:39:35 +0800
|
|
||||||
Subject: [PATCH] Add fix for off region adult following ai behavior
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
|
||||||
index a9be3acbf4ea52d2988347abfa6f4f8c02b1da26..7ddf9fae8e50bbda2502c6b584fac135fac21773 100644
|
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
|
||||||
@@ -25,6 +25,14 @@ public class BabyFollowAdult {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
LivingEntity ageableMob = instance.get(nearestVisibleAdult); // CraftBukkit - type
|
|
||||||
+
|
|
||||||
+ // Luminol start - Fix off world entity following which caused async issue
|
|
||||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(ageableMob)) {
|
|
||||||
+ nearestVisibleAdult.erase();
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ // Luminol end
|
|
||||||
+
|
|
||||||
if (mob.closerThan(ageableMob, followRange.getMaxValue() + 1) && !mob.closerThan(ageableMob, followRange.getMinValue())) {
|
|
||||||
// CraftBukkit start
|
|
||||||
org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(mob, ageableMob, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER);
|
|
||||||
@@ -35,6 +43,12 @@ public class BabyFollowAdult {
|
|
||||||
nearestVisibleAdult.erase();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
+ // Luminol start - Fix off region baby follow adult ai
|
|
||||||
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity)event.getTarget()).getHandleRaw())) {
|
|
||||||
+ nearestVisibleAdult.erase();
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ // Luminol end
|
|
||||||
ageableMob = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle();
|
|
||||||
// CraftBukkit end
|
|
||||||
WalkTarget walkTarget1 = new WalkTarget(
|
|
||||||
@@ -10,10 +10,10 @@ Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
|||||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
index bed9b564c493cd84bf53fc49368fda736f3fbc2b..c61071e0019a18eb73223ed9b64619c9cb691896 100644
|
index fdb02fc40579866167e8cc9bcefbd961588b53a6..58d8424262db14b2dca0b2c5a40748b6c0c18e83 100644
|
||||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||||
@@ -14,9 +14,11 @@ import net.minecraft.nbt.ListTag;
|
@@ -14,9 +14,11 @@ import net.minecraft.core.Holder;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
|
||||||
public class AttributeMap {
|
public class AttributeMap {
|
||||||
@@ -10,10 +10,10 @@ VMP (https://github.com/RelativityMC/VMP-fabric)
|
|||||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 9d945f615187f86913be8a9b83b1aada3a1336b6..06496237f947af4849cb7f364eacf11d53736e3d 100644
|
index 50b4a82a054d41ac1439f9769eaefebc103b6d94..803cdabbcde93be8352e7370cf1f129f4663d277 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1081,7 +1081,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -1107,7 +1107,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
private double moveStartZ;
|
private double moveStartZ;
|
||||||
// Paper end - detailed watchdog information
|
// Paper end - detailed watchdog information
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ index 9d945f615187f86913be8a9b83b1aada3a1336b6..06496237f947af4849cb7f364eacf11d
|
|||||||
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
|
||||||
// Paper start - detailed watchdog information
|
// Paper start - detailed watchdog information
|
||||||
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
|
||||||
@@ -5048,6 +5055,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -5273,6 +5280,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setBoundingBox(AABB bb) {
|
public final void setBoundingBox(AABB bb) {
|
||||||
@@ -10,7 +10,7 @@ Kaiiju (https://github.com/KaiijuMC/Kaiiju)
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java
|
diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java
|
||||||
index d5d8134da9423cec199cf44762460104677194d6..e0eed27cb33348fcb46858c40014b5fe5dbaf426 100644
|
index 73e04606e2cc5f30377550d1f2a5aa355b173257..c4d5dad5dc02534ef76d65e75e89058ced9699b0 100644
|
||||||
--- a/net/minecraft/util/Mth.java
|
--- a/net/minecraft/util/Mth.java
|
||||||
+++ b/net/minecraft/util/Mth.java
|
+++ b/net/minecraft/util/Mth.java
|
||||||
@@ -58,18 +58,15 @@ public class Mth {
|
@@ -58,18 +58,15 @@ public class Mth {
|
||||||
@@ -8,10 +8,10 @@ As part of: Gale (https://github.com/GaleMC/Gale/blob/276e903b2688f23b19bdc8d493
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
index 5ca1ed5e564038d6ee0b8437fb477fe8c8f09d94..aec5370b285d4648280b3e1c4c2fcaa501376739 100644
|
index c0d23b0b5adca79ce451da8cca16dc3aeac2c799..328cf3c11c3ad5aa2b92a6c3bd350dd37ce6041a 100644
|
||||||
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
@@ -54,27 +54,39 @@ public final class ActivationRange {
|
@@ -60,27 +60,39 @@ public final class ActivationRange {
|
||||||
if (entity.activationType == ActivationType.VILLAGER) {
|
if (entity.activationType == ActivationType.VILLAGER) {
|
||||||
if (inactiveFor > config.wakeUpInactiveVillagersEvery && worldData.wakeupInactiveRemainingVillagers > 0) { // Folia - threaded regions
|
if (inactiveFor > config.wakeUpInactiveVillagersEvery && worldData.wakeupInactiveRemainingVillagers > 0) { // Folia - threaded regions
|
||||||
worldData.wakeupInactiveRemainingVillagers--; // Folia - threaded regions
|
worldData.wakeupInactiveRemainingVillagers--; // Folia - threaded regions
|
||||||
@@ -9,10 +9,10 @@ As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40
|
|||||||
Licensed under: MIT (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/MIT.txt)
|
Licensed under: MIT (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/MIT.txt)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||||
index 44994e63a1e48efe69c0b67d02b99a3c814026b7..001483b7098523f3645a95c81fcf0e38b551705e 100644
|
index dd68471549096b86ea82f2add3d3886fb054e78b..b8bd7410e3d5cd8f81f41b52a3a8732134829478 100644
|
||||||
--- a/net/minecraft/server/players/PlayerList.java
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -1430,6 +1430,8 @@ public abstract class PlayerList {
|
@@ -1418,6 +1418,8 @@ public abstract class PlayerList {
|
||||||
if (serverStatsCounter == null) {
|
if (serverStatsCounter == null) {
|
||||||
File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile();
|
File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile();
|
||||||
File file1 = new File(file, uuid + ".json");
|
File file1 = new File(file, uuid + ".json");
|
||||||
@@ -21,7 +21,7 @@ index 44994e63a1e48efe69c0b67d02b99a3c814026b7..001483b7098523f3645a95c81fcf0e38
|
|||||||
if (!file1.exists()) {
|
if (!file1.exists()) {
|
||||||
File file2 = new File(file, displayName + ".json"); // CraftBukkit
|
File file2 = new File(file, displayName + ".json"); // CraftBukkit
|
||||||
Path path = file2.toPath();
|
Path path = file2.toPath();
|
||||||
@@ -1437,6 +1439,8 @@ public abstract class PlayerList {
|
@@ -1425,6 +1427,8 @@ public abstract class PlayerList {
|
||||||
file2.renameTo(file1);
|
file2.renameTo(file1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,21 +8,20 @@ As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40
|
|||||||
Licensed under: GPL-3.0 (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/GPL-3.0.txt)
|
Licensed under: GPL-3.0 (https://github.com/Winds-Studio/Leaf/blob/7f3e240bbe0970683c40279a7a65f0fde47503b6/licenses/GPL-3.0.txt)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/commands/SeedCommand.java b/net/minecraft/server/commands/SeedCommand.java
|
diff --git a/net/minecraft/server/commands/SeedCommand.java b/net/minecraft/server/commands/SeedCommand.java
|
||||||
index a65affc41a4fc299bc2281f0f53f2e075633899d..f071e469468b768bd9c063d78c222b1b3e3b13bd 100644
|
index 7c1e18d8362be5ae885c32b05e98b9ef45942d93..eb77dd6c009a0121e03a4041761dd2d69adcdfe9 100644
|
||||||
--- a/net/minecraft/server/commands/SeedCommand.java
|
--- a/net/minecraft/server/commands/SeedCommand.java
|
||||||
+++ b/net/minecraft/server/commands/SeedCommand.java
|
+++ b/net/minecraft/server/commands/SeedCommand.java
|
||||||
@@ -12,6 +12,17 @@ public class SeedCommand {
|
@@ -12,6 +12,16 @@ public class SeedCommand {
|
||||||
long seed = context.getSource().getLevel().getSeed();
|
long seed = commandContext.getSource().getLevel().getSeed();
|
||||||
Component component = ComponentUtils.copyOnClickText(String.valueOf(seed));
|
Component component = ComponentUtils.copyOnClickText(String.valueOf(seed));
|
||||||
context.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false);
|
commandContext.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false);
|
||||||
+
|
|
||||||
+ // Leaf start - Matter - SecureSeed Command
|
+ // Leaf start - Matter - SecureSeed Command
|
||||||
+ if (me.earthme.luminol.config.modules.misc.SecureSeedConfig.enabled) {
|
+ if (me.earthme.luminol.config.modules.misc.SecureSeedConfig.enabled) {
|
||||||
+ su.plo.matter.Globals.setupGlobals(context.getSource().getLevel());
|
+ su.plo.matter.Globals.setupGlobals(commandContext.getSource().getLevel());
|
||||||
+ String seedStr = su.plo.matter.Globals.seedToString(su.plo.matter.Globals.worldSeed);
|
+ String seedStr = su.plo.matter.Globals.seedToString(su.plo.matter.Globals.worldSeed);
|
||||||
+ Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr);
|
+ Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr);
|
||||||
+
|
+
|
||||||
+ context.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false);
|
+ commandContext.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false);
|
||||||
+ }
|
+ }
|
||||||
+ // Leaf end - Matter - SecureSeed Command
|
+ // Leaf end - Matter - SecureSeed Command
|
||||||
+
|
+
|
||||||
@@ -30,10 +29,10 @@ index a65affc41a4fc299bc2281f0f53f2e075633899d..f071e469468b768bd9c063d78c222b1b
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
index f6518e29f805018c72222f5aaa7b662071665b65..8d082996a0f361cfd12af6a2138efd7057732fc8 100644
|
index 4a01088da91fc6d620cb804a9ab6d6eb1630b473..3360d691cfdb8f83d6e396c83aeaa9e809d7e8db 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
@@ -113,7 +113,17 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
@@ -115,7 +115,17 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||||
String string = this.get("level-seed", "");
|
String string = this.get("level-seed", "");
|
||||||
boolean flag = this.get("generate-structures", true);
|
boolean flag = this.get("generate-structures", true);
|
||||||
long l = WorldOptions.parseSeed(string).orElse(WorldOptions.randomSeed());
|
long l = WorldOptions.parseSeed(string).orElse(WorldOptions.randomSeed());
|
||||||
@@ -53,7 +52,7 @@ index f6518e29f805018c72222f5aaa7b662071665b65..8d082996a0f361cfd12af6a2138efd70
|
|||||||
this.get("generator-settings", property -> GsonHelper.parse(!property.isEmpty() ? property : "{}"), new JsonObject()),
|
this.get("generator-settings", property -> GsonHelper.parse(!property.isEmpty() ? property : "{}"), new JsonObject()),
|
||||||
this.get("level-type", property -> property.toLowerCase(Locale.ROOT), WorldPresets.NORMAL.location().toString())
|
this.get("level-type", property -> property.toLowerCase(Locale.ROOT), WorldPresets.NORMAL.location().toString())
|
||||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 357d81d42f187fb1c52584e6c9cfe611fe755aba..6dc5b1a8bdba998e11bcdf352bcc0fc7161a484c 100644
|
index 250d09fe3c49d1d0cbfde0fc06abd16fe329f9ed..05bad0366bd36b8134290a0cceb4d4dfcbbd0544 100644
|
||||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
--- a/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -674,6 +674,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
@@ -674,6 +674,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||||
@@ -65,10 +64,10 @@ index 357d81d42f187fb1c52584e6c9cfe611fe755aba..6dc5b1a8bdba998e11bcdf352bcc0fc7
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index b4fdbdba579fa7c7de4928c259b5ff16b0e83aeb..19c472901f1fd982115779dfad31a7487334f606 100644
|
index 00482efc8e736e73ad136105ad7b9dd2cafd581f..55f3497503e3317d765abb0bd4a9a620f63cd240 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -564,6 +564,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -567,6 +567,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
chunkGenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkGenerator, gen);
|
chunkGenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkGenerator, gen);
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -77,10 +76,10 @@ index b4fdbdba579fa7c7de4928c259b5ff16b0e83aeb..19c472901f1fd982115779dfad31a748
|
|||||||
DataFixer fixerUpper = server.getFixerUpper();
|
DataFixer fixerUpper = server.getFixerUpper();
|
||||||
// Paper - rewrite chunk system
|
// Paper - rewrite chunk system
|
||||||
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
|
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
|
||||||
index 5a81172c88f5699f1440b69b331a8ea353c1950a..8fc1f8ff2e4378f4c2b0755f5c203eec0167df7e 100644
|
index 7b9105cc38380d60892647e52608787dbde28f0d..88c1880947cd9d8b3952cce3f8f3ae04ce047968 100644
|
||||||
--- a/net/minecraft/world/entity/monster/Slime.java
|
--- a/net/minecraft/world/entity/monster/Slime.java
|
||||||
+++ b/net/minecraft/world/entity/monster/Slime.java
|
+++ b/net/minecraft/world/entity/monster/Slime.java
|
||||||
@@ -328,7 +328,12 @@ public class Slime extends Mob implements Enemy {
|
@@ -329,7 +329,12 @@ public class Slime extends Mob implements Enemy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ChunkPos chunkPos = new ChunkPos(pos);
|
ChunkPos chunkPos = new ChunkPos(pos);
|
||||||
@@ -95,10 +94,10 @@ index 5a81172c88f5699f1440b69b331a8ea353c1950a..8fc1f8ff2e4378f4c2b0755f5c203eec
|
|||||||
final double maxHeightSlimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum;
|
final double maxHeightSlimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum;
|
||||||
if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) {
|
if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) {
|
||||||
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
|
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
index 3b7f0d5fe40bdda65ab859a0c22bf0d369dc0f01..6683df8d0f5a61ab094393f761a3d3a22d6e0455 100644
|
index 182c14b660f8860bed627eed4e01fd4002153e9a..686c031ec73acc80683aaa39a78fe9221f0215a6 100644
|
||||||
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
|
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
|
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
|
||||||
@@ -87,6 +87,10 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
@@ -88,6 +88,10 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||||
public org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer(ChunkAccess.DATA_TYPE_REGISTRY);
|
public org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer(ChunkAccess.DATA_TYPE_REGISTRY);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
public final Registry<Biome> biomeRegistry; // CraftBukkit
|
public final Registry<Biome> biomeRegistry; // CraftBukkit
|
||||||
@@ -109,7 +108,7 @@ index 3b7f0d5fe40bdda65ab859a0c22bf0d369dc0f01..6683df8d0f5a61ab094393f761a3d3a2
|
|||||||
|
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
private volatile ca.spottedleaf.moonrise.patches.starlight.light.SWMRNibbleArray[] blockNibbles;
|
private volatile ca.spottedleaf.moonrise.patches.starlight.light.SWMRNibbleArray[] blockNibbles;
|
||||||
@@ -191,6 +195,17 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
@@ -192,6 +196,17 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
|
||||||
return GameEventListenerRegistry.NOOP;
|
return GameEventListenerRegistry.NOOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,10 +8,10 @@ As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 77546196289bccbbc0c40c2d69ff9ddd2bc98ffe..d6a284bcdd9cb6b7442f99f9c7e9f2293fa0a218 100644
|
index 4bab02bb85b4be5bf539b498de040fd1d4fc671a..4ced5b334fbfe68ce8eef38eeea5af6d007cea00 100644
|
||||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -573,7 +573,7 @@ public class ServerGamePacketListenerImpl
|
@@ -600,7 +600,7 @@ public class ServerGamePacketListenerImpl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Paper end - Prevent moving into unloaded chunks
|
// Paper end - Prevent moving into unloaded chunks
|
||||||
@@ -20,16 +20,16 @@ index 77546196289bccbbc0c40c2d69ff9ddd2bc98ffe..d6a284bcdd9cb6b7442f99f9c7e9f229
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
||||||
@@ -603,7 +603,7 @@ public class ServerGamePacketListenerImpl
|
@@ -630,7 +630,7 @@ public class ServerGamePacketListenerImpl
|
||||||
d5 = d2 - rootVehicle.getZ();
|
d5 = d2 - rootVehicle.getZ();
|
||||||
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
||||||
boolean flag2 = false;
|
boolean flag1 = false;
|
||||||
- if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
- if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
||||||
+ if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot // Leaves - disable can
|
+ if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
||||||
flag2 = true; // Paper - diff on change, this should be moved wrongly
|
flag1 = true; // Paper - diff on change, this should be moved wrongly
|
||||||
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
|
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
|
||||||
}
|
}
|
||||||
@@ -1487,7 +1487,7 @@ public class ServerGamePacketListenerImpl
|
@@ -1519,7 +1519,7 @@ public class ServerGamePacketListenerImpl
|
||||||
|
|
||||||
if (this.shouldCheckPlayerMovement(isFallFlying)) {
|
if (this.shouldCheckPlayerMovement(isFallFlying)) {
|
||||||
float f2 = isFallFlying ? 300.0F : 100.0F;
|
float f2 = isFallFlying ? 300.0F : 100.0F;
|
||||||
@@ -38,7 +38,7 @@ index 77546196289bccbbc0c40c2d69ff9ddd2bc98ffe..d6a284bcdd9cb6b7442f99f9c7e9f229
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
// Paper start - Add fail move event
|
// Paper start - Add fail move event
|
||||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
||||||
@@ -1561,7 +1561,8 @@ public class ServerGamePacketListenerImpl
|
@@ -1593,7 +1593,8 @@ public class ServerGamePacketListenerImpl
|
||||||
d5 = d2 - this.player.getZ();
|
d5 = d2 - this.player.getZ();
|
||||||
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
||||||
boolean movedWrongly = false; // Paper - Add fail move event; rename
|
boolean movedWrongly = false; // Paper - Add fail move event; rename
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
Date: Wed, 4 Jun 2025 12:51:07 +0800
|
||||||
|
Subject: [PATCH] Leaves: Configurable collision behavior
|
||||||
|
|
||||||
|
Co-authored by: Fortern <blueten.ki@gmail.com>
|
||||||
|
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/c5f18b7864206cea4411211b51787f10affbcb9c/leaves-server/minecraft-patches/features/0111-Configurable-collision-behavior.patch)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
||||||
|
index 864ce0bd822a2bd6fb39866103dc54b56bf0b63c..b03096b298dbdd35ac0e4d54f96c2ab3b5b4bd21 100644
|
||||||
|
--- a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
||||||
|
+++ b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
||||||
|
@@ -101,6 +101,14 @@ public final class CollisionUtil {
|
||||||
|
(box1.minZ - box2.maxZ) < -COLLISION_EPSILON && (box1.maxZ - box2.minZ) > COLLISION_EPSILON;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Leaves start - Configurable collision behavior
|
||||||
|
+ public static boolean voxelShapeIntersectVanilla(final AABB box1, final AABB box2) {
|
||||||
|
+ return box1.minX < box2.maxX && box1.maxX > box2.minX &&
|
||||||
|
+ box1.minY < box2.maxY && box1.maxY > box2.minY &&
|
||||||
|
+ box1.minZ < box2.maxZ && box1.maxZ > box2.minZ;
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - Configurable collision behavior
|
||||||
|
+
|
||||||
|
// assume !isEmpty(target) && abs(source_move) >= COLLISION_EPSILON
|
||||||
|
public static double collideX(final AABB target, final AABB source, final double source_move) {
|
||||||
|
if ((source.minY - target.maxY) < -COLLISION_EPSILON && (source.maxY - target.minY) > COLLISION_EPSILON &&
|
||||||
|
@@ -2025,7 +2033,7 @@ public final class CollisionUtil {
|
||||||
|
AABB singleAABB = ((CollisionVoxelShape)blockCollision).moonrise$getSingleAABBRepresentation();
|
||||||
|
if (singleAABB != null) {
|
||||||
|
singleAABB = singleAABB.move((double)blockX, (double)blockY, (double)blockZ);
|
||||||
|
- if (!voxelShapeIntersect(aabb, singleAABB)) {
|
||||||
|
+ if (shouldSkip(aabb, blockCollision, singleAABB)) { // Leaves - Configurable collision behavior
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2078,6 +2086,18 @@ public final class CollisionUtil {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Leaves start - Configurable collision behavior
|
||||||
|
+ private static boolean shouldSkip(AABB aabb, VoxelShape blockCollision, AABB singleAABB) {
|
||||||
|
+ boolean isBlockShape = blockCollision == Shapes.block();
|
||||||
|
+ return switch (me.earthme.luminol.config.modules.misc.CollisionBehaviorConfig.behaviorMode) {
|
||||||
|
+ case "VANILLA" -> !voxelShapeIntersectVanilla(aabb, singleAABB);
|
||||||
|
+ case "PAPER" -> !voxelShapeIntersect(aabb, singleAABB);
|
||||||
|
+ default -> isBlockShape && !voxelShapeIntersectVanilla(aabb, singleAABB) || !isBlockShape && !voxelShapeIntersect(aabb, singleAABB);
|
||||||
|
+ // All other value as BLOCK_SHAPE_VANILLA to process
|
||||||
|
+ };
|
||||||
|
+ }
|
||||||
|
+ // Leaves end - Configurable collision behavior
|
||||||
|
+
|
||||||
|
public static boolean getEntityHardCollisions(final Level world, final Entity entity, AABB aabb,
|
||||||
|
final List<AABB> into, final int collisionFlags, final Predicate<Entity> predicate) {
|
||||||
|
final boolean checkOnly = (collisionFlags & COLLISION_FLAG_CHECK_ONLY) != 0;
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
Date: Wed, 4 Jun 2025 12:54:22 +0800
|
||||||
|
Subject: [PATCH] Leaves: Fix chunk reload detector
|
||||||
|
|
||||||
|
Co-authored by: Fortern <blueten.ki@gmail.com>
|
||||||
|
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/c5f18b7864206cea4411211b51787f10affbcb9c/leaves-server/minecraft-patches/features/0123-Fix-chunk-reload-detector.patch)
|
||||||
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||||
|
index e96d4dee14c05f2fa329bfb1588ec795d4e3d730..2d4c68b01cc1508a1a4715a91316a7db80d4efa2 100644
|
||||||
|
--- a/net/minecraft/server/level/ServerEntity.java
|
||||||
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||||
|
@@ -370,7 +370,7 @@ public class ServerEntity {
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
consumer.accept(new ClientboundSetEquipmentPacket(this.entity.getId(), list, true)); // Paper - data sanitization
|
||||||
|
}
|
||||||
|
- ((LivingEntity) this.entity).detectEquipmentUpdates(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending
|
||||||
|
+ if (this.entity.totalEntityAge == 0) ((LivingEntity) this.entity).detectEquipmentUpdates(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending // Leaves - fix chunk reload detector (#492)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.entity.getPassengers().isEmpty()) {
|
||||||
@@ -8,21 +8,21 @@ As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54
|
|||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 5564bba66959a2a280f700f6c6a05d292faced88..4492f3ab470c0bf735b6fdc69115c1ebbcd727ef 100644
|
index 2b06a0fba825199b07febf368418af803d8c3f8c..8b6b881896797b93a2f475c21101463e1888cee1 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -1285,7 +1285,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1362,7 +1362,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
}
|
}
|
||||||
|
|
||||||
// SPIGOT-5478 must be called manually now
|
// SPIGOT-5478 must be called manually now
|
||||||
- if (event.shouldDropExperience()) this.dropExperience(this.serverLevel(), cause.getEntity()); // Paper - tie to event
|
- if (event.shouldDropExperience()) this.dropExperience(this.level(), cause.getEntity()); // Paper - tie to event
|
||||||
+ if (shouldDropExperience(event.shouldDropExperience(), event.forceUseEventDropStatus())) this.dropExperience(this.serverLevel(), cause.getEntity()); // Paper - tie to event // Leaves - exp fix
|
+ if (shouldDropExperience(event.shouldDropExperience(), event.forceUseEventDropStatus())) this.dropExperience(this.level(), cause.getEntity()); // Paper - tie to event
|
||||||
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
||||||
if (!event.getKeepInventory()) {
|
if (!event.getKeepInventory()) {
|
||||||
// Paper start - PlayerDeathEvent#getItemsToKeep
|
// Paper start - PlayerDeathEvent#getItemsToKeep
|
||||||
@@ -1357,6 +1357,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -1409,6 +1409,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
|
this.setClientLoaded(false);
|
||||||
}
|
}
|
||||||
// Luminol End - Cross Region Damage trace
|
|
||||||
|
|
||||||
+ // Leaves start - exp fix
|
+ // Leaves start - exp fix
|
||||||
+ private boolean shouldDropExperience(boolean eventResult, boolean forceUseEvent) {
|
+ private boolean shouldDropExperience(boolean eventResult, boolean forceUseEvent) {
|
||||||
@@ -37,18 +37,18 @@ index 5564bba66959a2a280f700f6c6a05d292faced88..4492f3ab470c0bf735b6fdc69115c1eb
|
|||||||
AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0);
|
AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0);
|
||||||
this.level()
|
this.level()
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index c1d53987991a0808733eac3b500d5d5a0f5d7ac2..dcec5d26950bc654f67e7de7688c074cc502e486 100644
|
index 144d15bda80d3e5fbae0a824088fe05567a259c6..45b6bce44db3f262f59e4473029568a1efd5a083 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -264,6 +264,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -277,6 +277,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
protected final EntityEquipment equipment;
|
private Waypoint.Icon locatorBarIcon = new Waypoint.Icon();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public int expToDrop;
|
public int expToDrop;
|
||||||
+ public int expToReward; // Leaves - exp fix
|
+ public int expToReward; // Leaves - exp fix
|
||||||
public List<DefaultDrop> drops = new java.util.ArrayList<>(); // Paper - Restore vanilla drops behavior
|
public List<DefaultDrop> drops = new java.util.ArrayList<>(); // Paper - Restore vanilla drops behavior
|
||||||
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||||
public boolean collides = true;
|
public boolean collides = true;
|
||||||
@@ -1870,6 +1871,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1879,6 +1880,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
entity.killedEntity((ServerLevel) this.level(), this);
|
entity.killedEntity((ServerLevel) this.level(), this);
|
||||||
}
|
}
|
||||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||||
@@ -56,7 +56,7 @@ index c1d53987991a0808733eac3b500d5d5a0f5d7ac2..dcec5d26950bc654f67e7de7688c074c
|
|||||||
} else {
|
} else {
|
||||||
this.dead = false;
|
this.dead = false;
|
||||||
this.setHealth((float) deathEvent.getReviveHealth());
|
this.setHealth((float) deathEvent.getReviveHealth());
|
||||||
@@ -1950,7 +1952,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -1952,7 +1954,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
this.drops = new java.util.ArrayList<>();
|
this.drops = new java.util.ArrayList<>();
|
||||||
// this.dropEquipment(level); // CraftBukkit - moved up
|
// this.dropEquipment(level); // CraftBukkit - moved up
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -66,7 +66,7 @@ index c1d53987991a0808733eac3b500d5d5a0f5d7ac2..dcec5d26950bc654f67e7de7688c074c
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
diff --git a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
||||||
index c94d3c755449e23e77d5ba82c6c5e384ff5cedc7..376d2b9a45e0d9b1f90ae356416370340e7cee1f 100644
|
index 91ddb30cd98b11f70b196a108e7cc11d39ca1a71..ebc8d936d8796f869dfe264c0f4523115389fea8 100644
|
||||||
--- a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
--- a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
||||||
+++ b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
+++ b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
|
||||||
@@ -96,8 +96,7 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi
|
@@ -96,8 +96,7 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi
|
||||||
@@ -33,7 +33,7 @@ index 63fd7b45750430b565d599337d3112cbaa7e7550..1363c80e7c7be20c52a947f2eb6fabc5
|
|||||||
|
|
||||||
public static Direction getApproximateNearest(double x, double y, double z) {
|
public static Direction getApproximateNearest(double x, double y, double z) {
|
||||||
diff --git a/net/minecraft/world/phys/AABB.java b/net/minecraft/world/phys/AABB.java
|
diff --git a/net/minecraft/world/phys/AABB.java b/net/minecraft/world/phys/AABB.java
|
||||||
index c22acc8889fbb3c9ee698624189c195ee4b5eefb..85942c81db268fb6e827683651003bff217ad309 100644
|
index 84f3073444ae9e11e5d11224d6af6474ced925e2..e1bcb22d4efcfa1eb8dedb011e632cbeeabb2e82 100644
|
||||||
--- a/net/minecraft/world/phys/AABB.java
|
--- a/net/minecraft/world/phys/AABB.java
|
||||||
+++ b/net/minecraft/world/phys/AABB.java
|
+++ b/net/minecraft/world/phys/AABB.java
|
||||||
@@ -19,6 +19,15 @@ public class AABB {
|
@@ -19,6 +19,15 @@ public class AABB {
|
||||||
@@ -12,10 +12,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
|||||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index dcec5d26950bc654f67e7de7688c074cc502e486..0a06dc4b7fac7c7d63996553e2cb2a38ddb5f195 100644
|
index 45b6bce44db3f262f59e4473029568a1efd5a083..cb02249308aa3f94b337a6413bc5b3b178f374f7 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -2746,6 +2746,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -2724,6 +2724,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateSwingTime() {
|
protected void updateSwingTime() {
|
||||||
@@ -23,9 +23,9 @@ index dcec5d26950bc654f67e7de7688c074cc502e486..0a06dc4b7fac7c7d63996553e2cb2a38
|
|||||||
int currentSwingDuration = this.getCurrentSwingDuration();
|
int currentSwingDuration = this.getCurrentSwingDuration();
|
||||||
if (this.swinging) {
|
if (this.swinging) {
|
||||||
this.swingTime++;
|
this.swingTime++;
|
||||||
@@ -3629,6 +3630,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -3631,6 +3632,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
protected void updateFallFlying() {
|
protected void updateFallFlying() {
|
||||||
this.checkSlowFallDistance();
|
this.checkFallDistanceAccumulation();
|
||||||
if (!this.level().isClientSide) {
|
if (!this.level().isClientSide) {
|
||||||
+ if (!this.isFallFlying() && this.fallFlyTicks == 0) return; // Leaf - Lithium - entity.fast_elytra_check
|
+ if (!this.isFallFlying() && this.fallFlyTicks == 0) return; // Leaf - Lithium - entity.fast_elytra_check
|
||||||
if (!this.canGlide()) {
|
if (!this.canGlide()) {
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MrHua269 <wangxyper@163.com>
|
|
||||||
Date: Sat, 8 Feb 2025 14:25:16 +0800
|
|
||||||
Subject: [PATCH] Leaves: Fix Incorrect Collision Behavior for Block Shape
|
|
||||||
|
|
||||||
Co-authored by: Fortern <blueten.ki@gmail.com>
|
|
||||||
As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54a69b6479f1959ed24a60/leaves-server/minecraft-patches/features/0110-Fix-Incorrect-Collision-Behavior-for-Block-Shape.patch)
|
|
||||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
||||||
|
|
||||||
diff --git a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
|
||||||
index e1bf7bc3cca63101b3c0550b5b4c0d28d0f3776e..ea01087967dd9ff32b23661079e97ea468d31163 100644
|
|
||||||
--- a/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
|
||||||
+++ b/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
|
|
||||||
@@ -101,6 +101,14 @@ public final class CollisionUtil {
|
|
||||||
(box1.minZ - box2.maxZ) < -COLLISION_EPSILON && (box1.maxZ - box2.minZ) > COLLISION_EPSILON;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Leaves start
|
|
||||||
+ public static boolean voxelShapeIntersectVanilla(final net.minecraft.world.phys.AABB box1, final net.minecraft.world.phys.AABB box2) {
|
|
||||||
+ return box1.minX < box2.maxX && box1.maxX > box2.minX &&
|
|
||||||
+ box1.minY < box2.maxY && box1.maxY > box2.minY &&
|
|
||||||
+ box1.minZ < box2.maxZ && box1.maxZ > box2.minZ;
|
|
||||||
+ }
|
|
||||||
+ // Leaves end
|
|
||||||
+
|
|
||||||
// assume !isEmpty(target) && abs(source_move) >= COLLISION_EPSILON
|
|
||||||
public static double collideX(final AABB target, final AABB source, final double source_move) {
|
|
||||||
if ((source.minY - target.maxY) < -COLLISION_EPSILON && (source.maxY - target.minY) > COLLISION_EPSILON &&
|
|
||||||
@@ -2025,7 +2033,10 @@ public final class CollisionUtil {
|
|
||||||
AABB singleAABB = ((CollisionVoxelShape)blockCollision).moonrise$getSingleAABBRepresentation();
|
|
||||||
if (singleAABB != null) {
|
|
||||||
singleAABB = singleAABB.move((double)blockX, (double)blockY, (double)blockZ);
|
|
||||||
- if (!voxelShapeIntersect(aabb, singleAABB)) {
|
|
||||||
+ // Leaves start - Fix incorrect collision behavior for block shape
|
|
||||||
+ boolean isBlockShape = blockCollision == net.minecraft.world.phys.shapes.Shapes.block();
|
|
||||||
+ if (isBlockShape && !voxelShapeIntersectVanilla(aabb, singleAABB) || !isBlockShape && !voxelShapeIntersect(aabb, singleAABB)) {
|
|
||||||
+ // Leaves end - Fix incorrect collision behavior for block shape
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -8,10 +8,10 @@ As part of: Kaiiju (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2e
|
|||||||
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
|
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
|
||||||
|
|
||||||
diff --git a/io/papermc/paper/threadedregions/RegionizedWorldData.java b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
diff --git a/io/papermc/paper/threadedregions/RegionizedWorldData.java b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
||||||
index 17bf9a4cf48273d5021d48ae57acc4fd053dd32d..0168c2a0e3ce16f107bbd83e1071004e61de32f8 100644
|
index 01ea2e7133a41f1a75169c7e3edbd528b268412b..8c4d89c47fd176d584d3dbd0e3325f69b5e847c3 100644
|
||||||
--- a/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
--- a/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
||||||
+++ b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
+++ b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
||||||
@@ -354,6 +354,7 @@ public final class RegionizedWorldData {
|
@@ -357,6 +357,7 @@ public final class RegionizedWorldData {
|
||||||
private final IteratorSafeOrderedReferenceSet<Mob> navigatingMobs = new IteratorSafeOrderedReferenceSet<>();
|
private final IteratorSafeOrderedReferenceSet<Mob> navigatingMobs = new IteratorSafeOrderedReferenceSet<>();
|
||||||
public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
|
public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
|
||||||
public final ReferenceList<Entity> trackerUnloadedEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
|
public final ReferenceList<Entity> trackerUnloadedEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
|
||||||
@@ -20,10 +20,10 @@ index 17bf9a4cf48273d5021d48ae57acc4fd053dd32d..0168c2a0e3ce16f107bbd83e1071004e
|
|||||||
// block ticking
|
// block ticking
|
||||||
private final ObjectLinkedOpenHashSet<BlockEventData> blockEvents = new ObjectLinkedOpenHashSet<>();
|
private final ObjectLinkedOpenHashSet<BlockEventData> blockEvents = new ObjectLinkedOpenHashSet<>();
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 19c472901f1fd982115779dfad31a7487334f606..8329bc0cf531a1317ff8e213e948019d28df1eea 100644
|
index 55f3497503e3317d765abb0bd4a9a620f63cd240..7b7c72f14ae966ef142d68615b2f88ba42a079f5 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -803,6 +803,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -807,6 +807,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
|
|
||||||
profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.ACTIVATE_ENTITIES); try { // Folia - profiler
|
profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.ACTIVATE_ENTITIES); try { // Folia - profiler
|
||||||
@@ -31,7 +31,7 @@ index 19c472901f1fd982115779dfad31a7487334f606..8329bc0cf531a1317ff8e213e948019d
|
|||||||
io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR
|
io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR
|
||||||
} finally { profiler.stopTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.ACTIVATE_ENTITIES); } // Folia - profiler
|
} finally { profiler.stopTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.ACTIVATE_ENTITIES); } // Folia - profiler
|
||||||
profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.ENTITY_TICK); try { // Folia - profiler
|
profiler.startTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.ENTITY_TICK); try { // Folia - profiler
|
||||||
@@ -824,6 +825,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -828,6 +829,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
|
|
||||||
entity.stopRiding();
|
entity.stopRiding();
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ index 19c472901f1fd982115779dfad31a7487334f606..8329bc0cf531a1317ff8e213e948019d
|
|||||||
|
|
||||||
profilerFiller.push("tick");
|
profilerFiller.push("tick");
|
||||||
this.guardEntityTick(this::tickNonPassenger, entity);
|
this.guardEntityTick(this::tickNonPassenger, entity);
|
||||||
@@ -833,6 +841,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -837,6 +845,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -8,10 +8,10 @@ As part of: Kaiiju (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2e
|
|||||||
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
|
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 06496237f947af4849cb7f364eacf11d53736e3d..af793516943582d92fe02a222b8c73f759ee8aae 100644
|
index 803cdabbcde93be8352e7370cf1f129f4663d277..e5de7480c2e025fc9a8b4845fdb959049f1afdda 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -4273,14 +4273,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4475,14 +4475,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
targetPos, 16, // load 16 blocks to be safe from block physics
|
targetPos, 16, // load 16 blocks to be safe from block physics
|
||||||
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
|
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
|
||||||
(chunks) -> {
|
(chunks) -> {
|
||||||
@@ -34,7 +34,7 @@ index 06496237f947af4849cb7f364eacf11d53736e3d..af793516943582d92fe02a222b8c73f7
|
|||||||
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
|
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
|
||||||
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
|
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
|
||||||
)
|
)
|
||||||
@@ -4306,11 +4310,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4508,11 +4512,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
|
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
|
||||||
(chunks) -> {
|
(chunks) -> {
|
||||||
BlockPos adjustedSpawn = destination.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, spawnPos);
|
BlockPos adjustedSpawn = destination.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, spawnPos);
|
||||||
@@ -52,7 +52,7 @@ index 06496237f947af4849cb7f364eacf11d53736e3d..af793516943582d92fe02a222b8c73f7
|
|||||||
Relative.union(Relative.DELTA, Relative.ROTATION),
|
Relative.union(Relative.DELTA, Relative.ROTATION),
|
||||||
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
|
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
|
||||||
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
|
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
|
||||||
@@ -4507,6 +4515,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4709,6 +4717,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Luminol end
|
// Luminol end
|
||||||
@@ -63,7 +63,7 @@ index 06496237f947af4849cb7f364eacf11d53736e3d..af793516943582d92fe02a222b8c73f7
|
|||||||
|
|
||||||
Vec3 initialPosition = this.position();
|
Vec3 initialPosition = this.position();
|
||||||
ChunkPos initialPositionChunk = new ChunkPos(
|
ChunkPos initialPositionChunk = new ChunkPos(
|
||||||
@@ -4571,8 +4583,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4773,8 +4785,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
info.postTeleportTransition().onTransition(teleported);
|
info.postTeleportTransition().onTransition(teleported);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9,10 +9,10 @@ As part of: Paper (https://github.com/PaperMC/Paper/blob/2ae1f05336d0f13b646e6c2
|
|||||||
Licensed under: GPL-3.0 (https://github.com/PaperMC/Paper/blob/fa360aa83657d15e8e803ce55800986f6bff8f70/licenses/GPL.md)
|
Licensed under: GPL-3.0 (https://github.com/PaperMC/Paper/blob/fa360aa83657d15e8e803ce55800986f6bff8f70/licenses/GPL.md)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
|
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
|
||||||
index 39b65970a48568c95ff482b9636e7391f300ffa8..4395947fc8c719864ac2afde5e6bbb53da5129c2 100644
|
index a23607874a72723914cbfeea0ad1c51236c044d8..14d0758aca54d9a25e369dfa8c89c930f27946c9 100644
|
||||||
--- a/net/minecraft/world/entity/monster/Zombie.java
|
--- a/net/minecraft/world/entity/monster/Zombie.java
|
||||||
+++ b/net/minecraft/world/entity/monster/Zombie.java
|
+++ b/net/minecraft/world/entity/monster/Zombie.java
|
||||||
@@ -353,6 +353,13 @@ public class Zombie extends Monster {
|
@@ -352,6 +352,13 @@ public class Zombie extends Monster {
|
||||||
int i2 = floor1 + Mth.nextInt(this.random, 7, 40) * Mth.nextInt(this.random, -1, 1);
|
int i2 = floor1 + Mth.nextInt(this.random, 7, 40) * Mth.nextInt(this.random, -1, 1);
|
||||||
int i3 = floor2 + Mth.nextInt(this.random, 7, 40) * Mth.nextInt(this.random, -1, 1);
|
int i3 = floor2 + Mth.nextInt(this.random, 7, 40) * Mth.nextInt(this.random, -1, 1);
|
||||||
BlockPos blockPos = new BlockPos(i1, i2, i3);
|
BlockPos blockPos = new BlockPos(i1, i2, i3);
|
||||||
@@ -8,10 +8,10 @@ As part of: Petal (https://github.com/Bloom-host/Petal/blob/cc691540fb48240f38b3
|
|||||||
Licensed under: GPL-3.0 (https://github.com/Bloom-host/Petal/blob/cc691540fb48240f38b376f3d94c8b0db2b60d99/LICENSE)
|
Licensed under: GPL-3.0 (https://github.com/Bloom-host/Petal/blob/cc691540fb48240f38b376f3d94c8b0db2b60d99/LICENSE)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||||
index 34738e880e6ef30730fc72d7b0fb89c53783be17..92d967ca683c50e072419e9398d671a01e0263bc 100644
|
index d9ee3b56db44687cfcc6a75f44a1abbcc8ef95a9..4c1442410f18b2ebafdb4c4d480f0f59ef656492 100644
|
||||||
--- a/net/minecraft/world/entity/Mob.java
|
--- a/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/net/minecraft/world/entity/Mob.java
|
+++ b/net/minecraft/world/entity/Mob.java
|
||||||
@@ -736,11 +736,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
@@ -753,11 +753,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Paper end - Allow nerfed mobs to jump and float
|
// Paper end - Allow nerfed mobs to jump and float
|
||||||
@@ -8,10 +8,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249
|
|||||||
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
||||||
|
|
||||||
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
index aec5370b285d4648280b3e1c4c2fcaa501376739..21ca0737d07e4edb5c9f52a703ba1ea0d290925e 100644
|
index 328cf3c11c3ad5aa2b92a6c3bd350dd37ce6041a..7e8e67a413ec5d8ca6a0ce54fba884d361acde95 100644
|
||||||
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
@@ -237,7 +237,7 @@ public final class ActivationRange {
|
@@ -243,7 +243,7 @@ public final class ActivationRange {
|
||||||
}
|
}
|
||||||
// special cases.
|
// special cases.
|
||||||
if (entity instanceof final LivingEntity living) {
|
if (entity instanceof final LivingEntity living) {
|
||||||
@@ -21,10 +21,10 @@ index aec5370b285d4648280b3e1c4c2fcaa501376739..21ca0737d07e4edb5c9f52a703ba1ea0
|
|||||||
}
|
}
|
||||||
if (entity instanceof final Mob mob && mob.getTarget() != null) {
|
if (entity instanceof final Mob mob && mob.getTarget() != null) {
|
||||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 0a06dc4b7fac7c7d63996553e2cb2a38ddb5f195..ae83447f99f483e1b509c52060353bd13ddbc458 100644
|
index cb02249308aa3f94b337a6413bc5b3b178f374f7..19b44e5b5c4c0b7caee7f67420ac4732da52c375 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -2156,6 +2156,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -2146,6 +2146,20 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
return this.lastClimbablePos;
|
return this.lastClimbablePos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,10 +8,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249
|
|||||||
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
Licensed under: GPL-3.0 (https://github.com/pufferfish-gg/Pufferfish/blob/04bc249f9eee6157338b6884113b6fa3192bf59b/PATCH-LICENSE)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
index ab7f7846d3fc0252c6f71277b3e67d7a785a96b5..0f496f0e1c63bc3d8b17a8f0cb065138cb079334 100644
|
index 4edd94ac765d2ab107612504b67e6e07da609313..c0e38131da55d8a85444ef4248224d37a7271089 100644
|
||||||
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
--- a/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
+++ b/net/minecraft/world/entity/monster/EnderMan.java
|
||||||
@@ -300,11 +300,18 @@ public class EnderMan extends Monster implements NeutralMob {
|
@@ -296,11 +296,18 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||||
private boolean teleport(double x, double y, double z) {
|
private boolean teleport(double x, double y, double z) {
|
||||||
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(x, y, z);
|
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(x, y, z);
|
||||||
|
|
||||||
@@ -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)
|
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||||
index aac65526817b1767511c7e180a4d9ded89ef89a1..02f1e08789d47d2e4f3ca51c1196dccea872963f 100644
|
index 3a4d349738aada9c171f01cd695987a21da3785c..6ce3d8c406f7afbc9aa8e0d6577ebf9b4724ae36 100644
|
||||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||||
@@ -196,6 +196,53 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
@@ -197,6 +197,53 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||||
this.setVillagerData(this.getVillagerData().withType(villagerType).withProfession(level.registryAccess(), VillagerProfession.NONE));
|
this.setVillagerData(this.getVillagerData().withType(villagerType).withProfession(level.registryAccess(), VillagerProfession.NONE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ index aac65526817b1767511c7e180a4d9ded89ef89a1..02f1e08789d47d2e4f3ca51c1196dcce
|
|||||||
@Override
|
@Override
|
||||||
public Brain<Villager> getBrain() {
|
public Brain<Villager> getBrain() {
|
||||||
return (Brain<Villager>)super.getBrain();
|
return (Brain<Villager>)super.getBrain();
|
||||||
@@ -292,11 +339,20 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
@@ -293,11 +340,20 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||||
// Paper start - EAR 2
|
// Paper start - EAR 2
|
||||||
this.customServerAiStep(level, false);
|
this.customServerAiStep(level, false);
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ Co-authored by: MrPowerGamerBR <git@mrpowergamerbr.com>
|
|||||||
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/paper-patches/features/0005-Optimize-canSee-checks.patch)
|
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/paper-patches/features/0005-Optimize-canSee-checks.patch)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
|
||||||
index 99a8b9a8ee2032107be03bbc13d0275a337faf7b..607091ecbd4a7261f2c0d839ee4dd1d27fa2190a 100644
|
index 4d603fafd07141a63db22f6e5a544fabbb6b9630..6868b915bf3deb85783a638d4441a15fea6da2dc 100644
|
||||||
--- a/net/minecraft/server/level/ChunkMap.java
|
--- a/net/minecraft/server/level/ChunkMap.java
|
||||||
+++ b/net/minecraft/server/level/ChunkMap.java
|
+++ b/net/minecraft/server/level/ChunkMap.java
|
||||||
@@ -1294,7 +1294,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -1294,7 +1294,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
@@ -8,10 +8,10 @@ Co-authored by: MrPowerGamerBR <git@mrpowergamerbr.com>
|
|||||||
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/minecraft-patches/features/0002-Skip-distanceToSqr-call-in-ServerEntity-sendChanges-.patch)
|
As part of: SparklyPaper (https://github.com/SparklyPower/SparklyPaper/blob/a69d3690472c9967772ffd4d4bd1f41403b7ea6f/sparklypaper-server/minecraft-patches/features/0002-Skip-distanceToSqr-call-in-ServerEntity-sendChanges-.patch)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||||
index b118e91f1e0b5a8b8c0b2a4a32faabc5a34a5954..8c232ae73a8c6500723994af3a28b36814cccae0 100644
|
index 2d4c68b01cc1508a1a4715a91316a7db80d4efa2..3a9293d5328ef0befa0b709169489b61a2266807 100644
|
||||||
--- a/net/minecraft/server/level/ServerEntity.java
|
--- a/net/minecraft/server/level/ServerEntity.java
|
||||||
+++ b/net/minecraft/server/level/ServerEntity.java
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||||
@@ -205,6 +205,8 @@ public class ServerEntity {
|
@@ -209,6 +209,8 @@ public class ServerEntity {
|
||||||
|
|
||||||
if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
|
if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
|
||||||
Vec3 deltaMovement = this.entity.getDeltaMovement();
|
Vec3 deltaMovement = this.entity.getDeltaMovement();
|
||||||
@@ -20,7 +20,7 @@ index b118e91f1e0b5a8b8c0b2a4a32faabc5a34a5954..8c232ae73a8c6500723994af3a28b368
|
|||||||
double d = deltaMovement.distanceToSqr(this.lastSentMovement);
|
double d = deltaMovement.distanceToSqr(this.lastSentMovement);
|
||||||
if (d > 1.0E-7 || d > 0.0 && deltaMovement.lengthSqr() == 0.0) {
|
if (d > 1.0E-7 || d > 0.0 && deltaMovement.lengthSqr() == 0.0) {
|
||||||
this.lastSentMovement = deltaMovement;
|
this.lastSentMovement = deltaMovement;
|
||||||
@@ -222,6 +224,7 @@ public class ServerEntity {
|
@@ -226,6 +228,7 @@ public class ServerEntity {
|
||||||
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Correct player respawn place
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
index 4492f3ab470c0bf735b6fdc69115c1ebbcd727ef..8b9c823deed1844fa69d1456a91ac65487b8ae69 100644
|
index 8b6b881896797b93a2f475c21101463e1888cee1..a632bfb00e151a395e886aff3471084dc6cf4102 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -492,8 +492,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -566,8 +566,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
double amountX = selectMaxX - selectMinX;
|
double amountX = selectMaxX - selectMinX;
|
||||||
double amountZ = selectMaxZ - selectMinZ;
|
double amountZ = selectMaxZ - selectMinZ;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ index 4492f3ab470c0bf735b6fdc69115c1ebbcd727ef..8b9c823deed1844fa69d1456a91ac654
|
|||||||
|
|
||||||
return new BlockPos(selectX, 0, selectZ);
|
return new BlockPos(selectX, 0, selectZ);
|
||||||
}
|
}
|
||||||
@@ -504,10 +506,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
@@ -578,10 +580,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BlockPos findSpawnAround(ServerLevel world, ServerPlayer player, BlockPos selected) {
|
private static BlockPos findSpawnAround(ServerLevel world, ServerPlayer player, BlockPos selected) {
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Command IllegalArgumentException crash fix
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/commands/FillCommand.java b/net/minecraft/server/commands/FillCommand.java
|
diff --git a/net/minecraft/server/commands/FillCommand.java b/net/minecraft/server/commands/FillCommand.java
|
||||||
index 3172e86defe86f44b1b095d89e2a35b06372dae9..5ce1f5c3e42fd0b8674cce8da9f3a732114607fb 100644
|
index 7665bff921eda626c0f1498a4ca03b62483d10ed..350adc15b06f2405137c2c753cbb673541df61fb 100644
|
||||||
--- a/net/minecraft/server/commands/FillCommand.java
|
--- a/net/minecraft/server/commands/FillCommand.java
|
||||||
+++ b/net/minecraft/server/commands/FillCommand.java
|
+++ b/net/minecraft/server/commands/FillCommand.java
|
||||||
@@ -245,6 +245,10 @@ public class FillCommand {
|
@@ -248,6 +248,10 @@ public class FillCommand {
|
||||||
// Folia start - region threading
|
// Folia start - region threading
|
||||||
} catch (CommandSyntaxException ex) {
|
} catch (CommandSyntaxException ex) {
|
||||||
sendMessage(source, ex);
|
sendMessage(source, ex);
|
||||||
@@ -20,10 +20,10 @@ index 3172e86defe86f44b1b095d89e2a35b06372dae9..5ce1f5c3e42fd0b8674cce8da9f3a732
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/server/commands/SetBlockCommand.java b/net/minecraft/server/commands/SetBlockCommand.java
|
diff --git a/net/minecraft/server/commands/SetBlockCommand.java b/net/minecraft/server/commands/SetBlockCommand.java
|
||||||
index 96819168051a971685c9b69044fb5c4953bebd95..7f538574a44d4815687fe1f4cc3e7de47cac703b 100644
|
index 07cff4e1e7af98cf3ead1f255557c1a994072610..34cc1906bfb49501bb2b3477bc99429e05cbb0f6 100644
|
||||||
--- a/net/minecraft/server/commands/SetBlockCommand.java
|
--- a/net/minecraft/server/commands/SetBlockCommand.java
|
||||||
+++ b/net/minecraft/server/commands/SetBlockCommand.java
|
+++ b/net/minecraft/server/commands/SetBlockCommand.java
|
||||||
@@ -101,6 +101,15 @@ public class SetBlockCommand {
|
@@ -102,6 +102,15 @@ public class SetBlockCommand {
|
||||||
}
|
}
|
||||||
// Folia end - region threading
|
// Folia end - region threading
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ index 96819168051a971685c9b69044fb5c4953bebd95..7f538574a44d4815687fe1f4cc3e7de4
|
|||||||
private static int setBlock(
|
private static int setBlock(
|
||||||
CommandSourceStack source, BlockPos pos, BlockInput block, SetBlockCommand.Mode mode, @Nullable Predicate<BlockInWorld> filter, boolean strict
|
CommandSourceStack source, BlockPos pos, BlockInput block, SetBlockCommand.Mode mode, @Nullable Predicate<BlockInWorld> filter, boolean strict
|
||||||
) throws CommandSyntaxException {
|
) throws CommandSyntaxException {
|
||||||
@@ -137,6 +146,10 @@ public class SetBlockCommand {
|
@@ -139,6 +148,10 @@ public class SetBlockCommand {
|
||||||
// Folia start - region threading
|
// Folia start - region threading
|
||||||
} catch (CommandSyntaxException ex) {
|
} catch (CommandSyntaxException ex) {
|
||||||
sendMessage(source, ex);
|
sendMessage(source, ex);
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
||||||
Date: Thu, 20 Feb 2025 01:00:28 +0800
|
|
||||||
Subject: [PATCH] Purpur: Barrels and enderchests 6 rows
|
|
||||||
|
|
||||||
Co-authored by: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/purpur-server/minecraft-patches/features/0003-Barrels-and-enderchests-6-rows.patch)
|
|
||||||
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..8a32580897c6814ca7cbc7cdfc3a3e41b4ce788f 100644
|
|
||||||
--- a/net/minecraft/server/players/PlayerList.java
|
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
|
||||||
@@ -1116,6 +1116,10 @@ public abstract class PlayerList {
|
|
||||||
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
|
|
||||||
this.server.getCommands().sendCommands(player);
|
|
||||||
} // Paper - Add sendOpLevel API
|
|
||||||
+
|
|
||||||
+ // Purpur start - Barrels and enderchests 6 rows
|
|
||||||
+ player.enderChestSlotCount = me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.enderchestRows < 7 && me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.enderchestRows > 0 ? 9 * me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.enderchestRows : 27;
|
|
||||||
+ // Purpur end - Barrels and enderchests 6 rows
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isWhiteListed(GameProfile profile) {
|
|
||||||
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
|
||||||
index 0d774fd4be1cdcf03e76db8b17309bbf01bafc55..1230effe955a627ff24866fdac4c55bff45cc241 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 {
|
|
||||||
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
|
|
||||||
+ public int enderChestSlotCount = -1; // Purpur - Barrels and enderchests 6 rows
|
|
||||||
|
|
||||||
// CraftBukkit start
|
|
||||||
public boolean fauxSleeping;
|
|
||||||
diff --git a/net/minecraft/world/inventory/ChestMenu.java b/net/minecraft/world/inventory/ChestMenu.java
|
|
||||||
index 0fffa384f928ab84451331380968fb4650eafe26..d84a10396395939149da88bcb01be59e220c340e 100644
|
|
||||||
--- a/net/minecraft/world/inventory/ChestMenu.java
|
|
||||||
+++ b/net/minecraft/world/inventory/ChestMenu.java
|
|
||||||
@@ -66,10 +66,30 @@ public class ChestMenu extends AbstractContainerMenu {
|
|
||||||
return new ChestMenu(MenuType.GENERIC_9x6, containerId, playerInventory, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start - Barrels and enderchests 6 rows
|
|
||||||
+ public static ChestMenu oneRow(int syncId, Inventory playerInventory, Container inventory) {
|
|
||||||
+ return new ChestMenu(MenuType.GENERIC_9x1, syncId, playerInventory, inventory, 1);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static ChestMenu twoRows(int syncId, Inventory playerInventory, Container inventory) {
|
|
||||||
+ return new ChestMenu(MenuType.GENERIC_9x2, syncId, playerInventory, inventory, 2);
|
|
||||||
+ }
|
|
||||||
+ // Purpur end - Barrels and enderchests 6 rows
|
|
||||||
+
|
|
||||||
public static ChestMenu threeRows(int containerId, Inventory playerInventory, Container container) {
|
|
||||||
return new ChestMenu(MenuType.GENERIC_9x3, containerId, playerInventory, container, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start - Barrels and enderchests 6 rows
|
|
||||||
+ public static ChestMenu fourRows(int syncId, Inventory playerInventory, Container inventory) {
|
|
||||||
+ return new ChestMenu(MenuType.GENERIC_9x4, syncId, playerInventory, inventory, 4);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static ChestMenu fiveRows(int syncId, Inventory playerInventory, Container inventory) {
|
|
||||||
+ return new ChestMenu(MenuType.GENERIC_9x5, syncId, playerInventory, inventory, 5);
|
|
||||||
+ }
|
|
||||||
+ // Purpur end - Barrels and enderchests 6 rows
|
|
||||||
+
|
|
||||||
public static ChestMenu sixRows(int containerId, Inventory playerInventory, Container container) {
|
|
||||||
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..72b8532acd7838e94e2cc0e2085d2ad84ba56f5e 100644
|
|
||||||
--- a/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
|
||||||
+++ b/net/minecraft/world/inventory/PlayerEnderChestContainer.java
|
|
||||||
@@ -25,11 +25,18 @@ public class PlayerEnderChestContainer extends SimpleContainer {
|
|
||||||
}
|
|
||||||
|
|
||||||
public PlayerEnderChestContainer(Player owner) {
|
|
||||||
- super(27);
|
|
||||||
+ super(me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.enderchestRows < 7 && me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.enderchestRows > 0 ? 9 * me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.enderchestRows : 27);
|
|
||||||
this.owner = owner;
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start - Barrels and enderchests 6 rows
|
|
||||||
+ @Override
|
|
||||||
+ public int getContainerSize() {
|
|
||||||
+ return owner.enderChestSlotCount < 0 ? super.getContainerSize() : owner.enderChestSlotCount;
|
|
||||||
+ }
|
|
||||||
+ // Purpur end - Barrels and enderchests 6 rows
|
|
||||||
+
|
|
||||||
public void setActiveChest(EnderChestBlockEntity enderChestBlockEntity) {
|
|
||||||
this.activeChest = enderChestBlockEntity;
|
|
||||||
}
|
|
||||||
diff --git a/net/minecraft/world/level/block/EnderChestBlock.java b/net/minecraft/world/level/block/EnderChestBlock.java
|
|
||||||
index 5077a9ff7b78801bdc53536a37aee07b8d86ee4d..17b43a2c793dff0576a26e6ac3764b87faf4112e 100644
|
|
||||||
--- a/net/minecraft/world/level/block/EnderChestBlock.java
|
|
||||||
+++ b/net/minecraft/world/level/block/EnderChestBlock.java
|
|
||||||
@@ -85,8 +85,14 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
|
|
||||||
enderChestInventory.setActiveChest(enderChestBlockEntity); // Needs to happen before ChestMenu.threeRows as it is required for opening animations
|
|
||||||
if (level instanceof ServerLevel serverLevel && player.openMenu(
|
|
||||||
new SimpleMenuProvider(
|
|
||||||
- (containerId, playerInventory, player1) -> ChestMenu.threeRows(containerId, playerInventory, enderChestInventory), CONTAINER_TITLE
|
|
||||||
- )
|
|
||||||
+ (containerId, playerInventory, player1) -> switch (me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.enderchestRows) {
|
|
||||||
+ case 6 -> ChestMenu.sixRows(containerId, playerInventory, enderChestInventory);
|
|
||||||
+ case 5 -> ChestMenu.fiveRows(containerId, playerInventory, enderChestInventory);
|
|
||||||
+ case 4 -> ChestMenu.fourRows(containerId, playerInventory, enderChestInventory);
|
|
||||||
+ case 2 -> ChestMenu.twoRows(containerId, playerInventory, enderChestInventory);
|
|
||||||
+ case 1 -> ChestMenu.oneRow(containerId, playerInventory, enderChestInventory);
|
|
||||||
+ default -> ChestMenu.threeRows(containerId, playerInventory, enderChestInventory);
|
|
||||||
+ }, CONTAINER_TITLE) // Purpur - Barrels and enderchests 6 rows
|
|
||||||
).isPresent()) {
|
|
||||||
// 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..2724b762bfb44e48619d4449560cf968a8fa7dee 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 {
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
|
|
||||||
- private NonNullList<ItemStack> items = NonNullList.withSize(27, ItemStack.EMPTY);
|
|
||||||
+ // Purpur start - Barrels and enderchests 6 rows
|
|
||||||
+ private NonNullList<ItemStack> items = NonNullList.withSize(switch (me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.barrelRows) {
|
|
||||||
+ case 6 -> 54;
|
|
||||||
+ case 5 -> 45;
|
|
||||||
+ case 4 -> 36;
|
|
||||||
+ case 2 -> 18;
|
|
||||||
+ case 1 -> 9;
|
|
||||||
+ default -> 27;
|
|
||||||
+ }, ItemStack.EMPTY);
|
|
||||||
+ // Purpur end - Barrels and enderchests 6 rows
|
|
||||||
+
|
|
||||||
public final ContainerOpenersCounter openersCounter = new ContainerOpenersCounter() {
|
|
||||||
@Override
|
|
||||||
protected void onOpen(Level level, BlockPos pos, BlockState state) {
|
|
||||||
@@ -108,7 +118,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getContainerSize() {
|
|
||||||
- return 27;
|
|
||||||
+ // Purpur start - Barrels and enderchests 6 rows
|
|
||||||
+ return switch (me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.barrelRows) {
|
|
||||||
+ case 6 -> 54;
|
|
||||||
+ case 5 -> 45;
|
|
||||||
+ case 4 -> 36;
|
|
||||||
+ case 2 -> 18;
|
|
||||||
+ case 1 -> 9;
|
|
||||||
+ default -> 27;
|
|
||||||
+ };
|
|
||||||
+ // Purpur end - Barrels and enderchests 6 rows
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -128,7 +147,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected AbstractContainerMenu createMenu(int id, Inventory player) {
|
|
||||||
- return ChestMenu.threeRows(id, player, this);
|
|
||||||
+ // Purpur start - Barrels and enderchests 6 rows
|
|
||||||
+ return switch (me.earthme.luminol.config.modules.misc.ContainerExpansionConfig.barrelRows) {
|
|
||||||
+ case 6 -> ChestMenu.sixRows(id, player, this);
|
|
||||||
+ case 5 -> ChestMenu.fiveRows(id, player, this);
|
|
||||||
+ case 4 -> ChestMenu.fourRows(id, player, this);
|
|
||||||
+ case 2 -> ChestMenu.twoRows(id, player, this);
|
|
||||||
+ case 1 -> ChestMenu.oneRow(id, player, this);
|
|
||||||
+ default -> ChestMenu.threeRows(id, player, this);
|
|
||||||
+ };
|
|
||||||
+ // Purpur end - Barrels and enderchests 6 rows
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Force disable builtin spark plugin
|
|||||||
The spark passed down from paper has some memory leaking issue, so we fully removed it from the code to prevent that memory leaking issue.
|
The spark passed down from paper has some memory leaking issue, so we fully removed it from the code to prevent that memory leaking issue.
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839255c4393 100644
|
index d824b49b98266539258a83f9a36f73c5961a1588..737df5c9345e22fa4487cbb83c7462b92a4f9e78 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -781,8 +781,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -783,8 +783,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// Paper end - Configurable player collision
|
// Paper end - Configurable player collision
|
||||||
|
|
||||||
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD);
|
||||||
@@ -20,7 +20,7 @@ index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839
|
|||||||
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
|
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
|
||||||
io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setValid(); // Paper - reset invalid state for event fire below
|
io.papermc.paper.command.brigadier.PaperCommands.INSTANCE.setValid(); // Paper - reset invalid state for event fire below
|
||||||
io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.callReloadableRegistrarEvent(io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents.COMMANDS, io.papermc.paper.command.brigadier.PaperCommands.INSTANCE, org.bukkit.plugin.Plugin.class, io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.INITIAL); // Paper - call commands event for regular plugins
|
io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.INSTANCE.callReloadableRegistrarEvent(io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents.COMMANDS, io.papermc.paper.command.brigadier.PaperCommands.INSTANCE, org.bukkit.plugin.Plugin.class, io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.INITIAL); // Paper - call commands event for regular plugins
|
||||||
@@ -1064,7 +1064,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1067,7 +1067,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (this.server != null) {
|
if (this.server != null) {
|
||||||
@@ -29,7 +29,7 @@ index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839
|
|||||||
this.server.disablePlugins();
|
this.server.disablePlugins();
|
||||||
this.server.waitForAsyncTasksShutdown(); // Paper - Wait for Async Tasks during shutdown
|
this.server.waitForAsyncTasksShutdown(); // Paper - Wait for Async Tasks during shutdown
|
||||||
}
|
}
|
||||||
@@ -1248,7 +1248,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1251,7 +1251,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.statusIcon = this.loadStatusIcon().orElse(null);
|
this.statusIcon = this.loadStatusIcon().orElse(null);
|
||||||
this.status = this.buildServerStatus();
|
this.status = this.buildServerStatus();
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839
|
|||||||
// Folia start - region threading
|
// Folia start - region threading
|
||||||
if (true) {
|
if (true) {
|
||||||
io.papermc.paper.threadedregions.RegionizedServer.getInstance().init(); // Folia - region threading - only after loading worlds
|
io.papermc.paper.threadedregions.RegionizedServer.getInstance().init(); // Folia - region threading - only after loading worlds
|
||||||
@@ -1591,7 +1591,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1594,7 +1594,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.emptyTicks >= i) {
|
if (this.emptyTicks >= i) {
|
||||||
@@ -47,7 +47,7 @@ index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839
|
|||||||
if (this.emptyTicks == i) {
|
if (this.emptyTicks == i) {
|
||||||
LOGGER.info("Server empty for {} seconds, pausing", this.pauseWhileEmptySeconds());
|
LOGGER.info("Server empty for {} seconds, pausing", this.pauseWhileEmptySeconds());
|
||||||
this.autoSave();
|
this.autoSave();
|
||||||
@@ -1610,7 +1610,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1613,7 +1613,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// Paper end - avoid issues with certain tasks not processing during sleep
|
// Paper end - avoid issues with certain tasks not processing during sleep
|
||||||
//this.server.spark.executeMainThreadTasks(); // Paper - spark // Folia - region threading
|
//this.server.spark.executeMainThreadTasks(); // Paper - spark // Folia - region threading
|
||||||
this.tickConnection();
|
this.tickConnection();
|
||||||
@@ -56,7 +56,7 @@ index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1633,7 +1633,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
};
|
};
|
||||||
// Folia end - region threading
|
// Folia end - region threading
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839
|
|||||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent((int)region.getCurrentTick()).callEvent(); // Paper - Server Tick Events // Folia - region threading
|
new com.destroystokyo.paper.event.server.ServerTickStartEvent((int)region.getCurrentTick()).callEvent(); // Paper - Server Tick Events // Folia - region threading
|
||||||
// Folia start - region threading
|
// Folia start - region threading
|
||||||
if (region != null) {
|
if (region != null) {
|
||||||
@@ -1743,7 +1743,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1744,7 +1744,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
long remaining = scheduledEnd - endTime; // Folia - region ticking
|
long remaining = scheduledEnd - endTime; // Folia - region ticking
|
||||||
new com.destroystokyo.paper.event.server.ServerTickEndEvent((int)io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick(), ((double)(endTime - startTime) / 1000000D), remaining).callEvent(); // Folia - region ticking
|
new com.destroystokyo.paper.event.server.ServerTickEndEvent((int)io.papermc.paper.threadedregions.RegionizedServer.getCurrentTick(), ((double)(endTime - startTime) / 1000000D), remaining).callEvent(); // Folia - region ticking
|
||||||
// Paper end - Server Tick Events
|
// Paper end - Server Tick Events
|
||||||
@@ -75,13 +75,13 @@ index 12062e37c0e832f27ba52844739d0e8d5519a30a..87625b365e04ce05fa2b6cdf2003c839
|
|||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
index 20df6b46c420b25b598accb57b921055fb0c988b..5290b9cb524160717fb40704fb10fc0d0a37941b 100644
|
index f07d3009caf964b8e1b5328bb3e28866e0c41955..1f3c26cc9f3b687693c36f2946394fad5ab6bc9f 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -173,7 +173,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@@ -173,7 +173,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
// Paper end - initialize global and world-defaults configuration
|
// Paper end - initialize global and world-defaults configuration
|
||||||
me.earthme.luminol.config.LuminolConfig.finalizeLoadConfig(); //Luminol - load config file
|
me.earthme.luminol.config.LuminolConfig.finalizeLoadConfig(); // Luminol - load config file
|
||||||
me.earthme.luminol.config.LuminolConfig.setupLatch(); //Luminol - load config file
|
me.earthme.luminol.config.LuminolConfig.setupLatch(); // Luminol - load config file
|
||||||
- this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
- this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
||||||
+ if (false) this.server.spark.enableEarlyIfRequested(); // Paper - spark // Luminol - Force disable builtin spark
|
+ 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
|
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
||||||
@@ -62,10 +62,10 @@ index 36a9887f8be04c5c3fda6d926d819a9e5b2a79f2..5681592bdeb050d875c4c5d0dfaf6e01
|
|||||||
return Optional.of(new BlockPosTracker(globalPos.pos().above()));
|
return Optional.of(new BlockPosTracker(globalPos.pos().above()));
|
||||||
}
|
}
|
||||||
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
index d34dcbbdeae41d23d6fb497e0e8da038580b6d01..50097fbb673655c2513770319e316a43449afa21 100644
|
index 6a9f31c1f39cc14ad7b5ae3af85908bc7a4caae4..34fea93dddfe0b947eb2517dd083ca842d19a0c6 100644
|
||||||
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||||
@@ -257,7 +257,17 @@ public class Sniffer extends Animal {
|
@@ -268,7 +268,17 @@ public class Sniffer extends Animal {
|
||||||
|
|
||||||
private boolean canDig(BlockPos pos) {
|
private boolean canDig(BlockPos pos) {
|
||||||
return this.level().getBlockState(pos).is(BlockTags.SNIFFER_DIGGABLE_BLOCK)
|
return this.level().getBlockState(pos).is(BlockTags.SNIFFER_DIGGABLE_BLOCK)
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix creative player item pick
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
index 38f0aacba93236b8e5c19bb729326feac3285c94..a9cc35b4b253d9a7fd90f811af9be629b164fad0 100644
|
index a596813c3cbacb1a4be86d41be01e8850fc6799c..244996de73d75e812e27aa896cd3875a14179b74 100644
|
||||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||||
@@ -424,7 +424,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
@@ -409,7 +409,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||||
Item item1 = item.getItem();
|
Item item1 = item.getItem();
|
||||||
int count = item.getCount();
|
int count = item.getCount();
|
||||||
// CraftBukkit start - fire PlayerPickupItemEvent
|
// CraftBukkit start - fire PlayerPickupItemEvent
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix entity portal-teleport speed
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
index 8329bc0cf531a1317ff8e213e948019d28df1eea..84a6bf575902676fc06211562b57806415528e64 100644
|
index 7b7c72f14ae966ef142d68615b2f88ba42a079f5..87377bba2ebdc0eba5b7b212d971994c35ca0b62 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -1356,7 +1356,27 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -1364,7 +1364,27 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
if (levelChunk != null) levelChunk.getChunkHot().startTicking(); try { // KioCG
|
if (levelChunk != null) levelChunk.getChunkHot().startTicking(); try { // KioCG
|
||||||
try {
|
try {
|
||||||
// Folia end - profiler
|
// Folia end - profiler
|
||||||
@@ -36,7 +36,7 @@ index 8329bc0cf531a1317ff8e213e948019d28df1eea..84a6bf575902676fc06211562b578064
|
|||||||
entity.tick();
|
entity.tick();
|
||||||
// Folia start - region threading
|
// Folia start - region threading
|
||||||
if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
|
if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(entity)) {
|
||||||
@@ -1367,6 +1387,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
@@ -1375,6 +1395,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
// portalled
|
// portalled
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -46,10 +46,10 @@ index 8329bc0cf531a1317ff8e213e948019d28df1eea..84a6bf575902676fc06211562b578064
|
|||||||
} else {entity.inactiveTick();} // Paper - EAR 2
|
} else {entity.inactiveTick();} // Paper - EAR 2
|
||||||
profilerFiller.pop();
|
profilerFiller.pop();
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index af793516943582d92fe02a222b8c73f759ee8aae..9f1d0c85631a585e00a8b20f3536f1f61b011201 100644
|
index e5de7480c2e025fc9a8b4845fdb959049f1afdda..4d275da5772f90ed460f6aafef483c06b740c702 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -350,6 +350,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -371,6 +371,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
public long activatedTick = Integer.MIN_VALUE;
|
public long activatedTick = Integer.MIN_VALUE;
|
||||||
public boolean isTemporarilyActive;
|
public boolean isTemporarilyActive;
|
||||||
public long activatedImmunityTick = Integer.MIN_VALUE;
|
public long activatedImmunityTick = Integer.MIN_VALUE;
|
||||||
@@ -57,7 +57,7 @@ index af793516943582d92fe02a222b8c73f759ee8aae..9f1d0c85631a585e00a8b20f3536f1f6
|
|||||||
|
|
||||||
public void inactiveTick() {
|
public void inactiveTick() {
|
||||||
}
|
}
|
||||||
@@ -3223,6 +3224,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -3422,6 +3423,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
} else {
|
} else {
|
||||||
if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) {
|
if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) {
|
||||||
this.portalProcess = new PortalProcessor(portal, pos.immutable());
|
this.portalProcess = new PortalProcessor(portal, pos.immutable());
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix off tickregion sync teleport
|
|||||||
Folis's teleportAsync implementation has some checks missing during the sync teleportation checks, if we are teleport to the edge of the tickregion, it is still asserting that we are in the same tickregion and moved us directly, but there is actually some logics is already touching the stuff out of current tickregion.So we added some new edge checks to the sync teleportation checks which will check the tickregion belonging in a shape of cycle which is in min(entity's bounding box + simulate distance, 6) of radius to fix that issue
|
Folis's teleportAsync implementation has some checks missing during the sync teleportation checks, if we are teleport to the edge of the tickregion, it is still asserting that we are in the same tickregion and moved us directly, but there is actually some logics is already touching the stuff out of current tickregion.So we added some new edge checks to the sync teleportation checks which will check the tickregion belonging in a shape of cycle which is in min(entity's bounding box + simulate distance, 6) of radius to fix that issue
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 9f1d0c85631a585e00a8b20f3536f1f61b011201..87e22d1fed087886ac845f6e816be5bf20fac9fb 100644
|
index 4d275da5772f90ed460f6aafef483c06b740c702..43d0ad699a02a5156fe958f709c941a7cab6daa3 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -4024,6 +4024,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4226,6 +4226,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
this.resetStoredPositions();
|
this.resetStoredPositions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ index 9f1d0c85631a585e00a8b20f3536f1f61b011201..87e22d1fed087886ac845f6e816be5bf
|
|||||||
protected final void transform(TeleportTransition telpeort) {
|
protected final void transform(TeleportTransition telpeort) {
|
||||||
PositionMoveRotation move = PositionMoveRotation.calculateAbsolute(
|
PositionMoveRotation move = PositionMoveRotation.calculateAbsolute(
|
||||||
PositionMoveRotation.of(this), PositionMoveRotation.of(telpeort), telpeort.relatives()
|
PositionMoveRotation.of(this), PositionMoveRotation.of(telpeort), telpeort.relatives()
|
||||||
@@ -4146,7 +4161,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -4348,7 +4363,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
// check for same region
|
// check for same region
|
||||||
if (destination == this.level()) {
|
if (destination == this.level()) {
|
||||||
Vec3 currPos = this.position();
|
Vec3 currPos = this.position();
|
||||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Fix uncorrected death check of folia
|
|||||||
In the new mc version, mojang changed some checks in A.C.M(AbstractContainerMenu) and there is a new death check of player which will be executed when player dead.But on folia, player entity cannot be discarded unless they disconnected from the server, so there is an obvious bug that when player dead, the logic depend on that dead check will not be executed correctly because the check logic is still asserting the player is alive by checking if the player is discarded, which caused some exploits can save items in the crafting slots(with InventoryTweaks turned on in meteor client) when keepInventory is set to false
|
In the new mc version, mojang changed some checks in A.C.M(AbstractContainerMenu) and there is a new death check of player which will be executed when player dead.But on folia, player entity cannot be discarded unless they disconnected from the server, so there is an obvious bug that when player dead, the logic depend on that dead check will not be executed correctly because the check logic is still asserting the player is alive by checking if the player is discarded, which caused some exploits can save items in the crafting slots(with InventoryTweaks turned on in meteor client) when keepInventory is set to false
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||||
index 813417a09b4acc7d57e80a53d970767e230d75b1..a9cf0ef95b706f05060bbcd2a4f5a03c60f783d2 100644
|
index f4548edae77eb86e54ba499acbb20613fd60d7bd..852b4381985ed167b05881f068e9542c31cdaf23 100644
|
||||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||||
@@ -690,7 +690,7 @@ public abstract class AbstractContainerMenu {
|
@@ -690,7 +690,7 @@ public abstract class AbstractContainerMenu {
|
||||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Teleport async if entity was moving to another region at once
|
|||||||
On folia, entity usually cannot move out of the tickregion, but sometimes it actually does(like some end pearl gun that can shoot an end pearl to the block faraway than 10000 blocks even more). To fix this, we added a temporary fix which teleport these entities to the destination instead running its move logics so that we could ensure anything is under control.But one thing need to consider is that teleportAsync is actually calling halfway of the entity tick and there is still something running when teleportAsync called, which is actually modified the entity in another thread, so there is still need an improvement
|
On folia, entity usually cannot move out of the tickregion, but sometimes it actually does(like some end pearl gun that can shoot an end pearl to the block faraway than 10000 blocks even more). To fix this, we added a temporary fix which teleport these entities to the destination instead running its move logics so that we could ensure anything is under control.But one thing need to consider is that teleportAsync is actually calling halfway of the entity tick and there is still something running when teleportAsync called, which is actually modified the entity in another thread, so there is still need an improvement
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
index 87e22d1fed087886ac845f6e816be5bf20fac9fb..b163c43f5398b9f38c75ae7af6a3015b686624ce 100644
|
index 43d0ad699a02a5156fe958f709c941a7cab6daa3..990ea0359c9015f867dc529a284148cd4846f5e8 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -1084,6 +1084,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -1110,6 +1110,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
|
||||||
private boolean boundingBoxChanged = false; // Gale - VMP - skip entity move if movement is zero
|
private boolean boundingBoxChanged = false; // Gale - VMP - skip entity move if movement is zero
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ index 87e22d1fed087886ac845f6e816be5bf20fac9fb..b163c43f5398b9f38c75ae7af6a3015b
|
|||||||
public void move(MoverType type, Vec3 movement) {
|
public void move(MoverType type, Vec3 movement) {
|
||||||
// Gale start - VMP - skip entity move if movement is zero
|
// Gale start - VMP - skip entity move if movement is zero
|
||||||
if (!this.boundingBoxChanged && movement.equals(Vec3.ZERO)) {
|
if (!this.boundingBoxChanged && movement.equals(Vec3.ZERO)) {
|
||||||
@@ -1099,6 +1103,32 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -1125,6 +1129,32 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
this.moveStartZ = this.getZ();
|
this.moveStartZ = this.getZ();
|
||||||
this.moveVector = movement;
|
this.moveVector = movement;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: MrHua269 <mrhua269@gmail.com>
|
||||||
|
Date: Sun, 15 Jun 2025 16:58:05 +0800
|
||||||
|
Subject: [PATCH] Do not fire pre creature spawn event unless some plugin is
|
||||||
|
listening it
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java
|
||||||
|
index f324a74a191d3fe3e270556d07c4543ec34e0195..2fb36cba4cda3f7b84efae9cba6bed2394fb0457 100644
|
||||||
|
--- a/net/minecraft/world/level/NaturalSpawner.java
|
||||||
|
+++ b/net/minecraft/world/level/NaturalSpawner.java
|
||||||
|
@@ -360,16 +360,18 @@ public final class NaturalSpawner {
|
||||||
|
) {
|
||||||
|
EntityType<?> entityType = data.type();
|
||||||
|
// Paper start - PreCreatureSpawnEvent
|
||||||
|
- com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
||||||
|
- org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, level),
|
||||||
|
- org.bukkit.craftbukkit.entity.CraftEntityType.minecraftToBukkit(entityType), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL
|
||||||
|
- );
|
||||||
|
- if (!event.callEvent()) {
|
||||||
|
- if (event.shouldAbortSpawn()) {
|
||||||
|
- return PreSpawnStatus.ABORT;
|
||||||
|
+ if (com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent.getHandlerList().getRegisteredListeners().length != 0) { // Luminol - Do not fire pre creature spawn event unless some plugin is listening it
|
||||||
|
+ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
||||||
|
+ org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, level),
|
||||||
|
+ org.bukkit.craftbukkit.entity.CraftEntityType.minecraftToBukkit(entityType), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL
|
||||||
|
+ );
|
||||||
|
+ if (!event.callEvent()) {
|
||||||
|
+ if (event.shouldAbortSpawn()) {
|
||||||
|
+ return PreSpawnStatus.ABORT;
|
||||||
|
+ }
|
||||||
|
+ return PreSpawnStatus.CANCELLED;
|
||||||
|
}
|
||||||
|
- return PreSpawnStatus.CANCELLED;
|
||||||
|
- }
|
||||||
|
+ } // Luminol - Do not fire pre creature spawn event unless some plugin is listening it
|
||||||
|
final boolean success = entityType.getCategory() != MobCategory.MISC
|
||||||
|
// Paper end - PreCreatureSpawnEvent
|
||||||
|
&& (
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MrHua269 <mrhua269@gmail.com>
|
|
||||||
Date: Sun, 25 May 2025 23:05:15 +0800
|
|
||||||
Subject: [PATCH] Fix chunk iteration self modification
|
|
||||||
|
|
||||||
We use the old-like logics which is in 1.21.4.
|
|
||||||
Might fixes: https://github.com/PaperMC/Folia/issues/363
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
|
|
||||||
index f8322334fb6a0cea38c4d1981862ba673fd1b100..0e08512ce94435ca90a2344eefc761fa4fcdeb18 100644
|
|
||||||
--- a/net/minecraft/server/level/ServerChunkCache.java
|
|
||||||
+++ b/net/minecraft/server/level/ServerChunkCache.java
|
|
||||||
@@ -173,14 +173,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
|
||||||
// 2. _removes_ are impossible at this stage in the tick
|
|
||||||
final LevelChunk[] raw = entityTickingChunks.getRawDataUnchecked();
|
|
||||||
final int size = entityTickingChunks.size(); foliaProfiler.addCounter(ca.spottedleaf.leafprofiler.LProfilerRegistry.RANDOM_CHUNK_TICK_COUNT, (long)size); // Folia - profiler
|
|
||||||
+ // Luminol start - Fix chunk iteration self modification - use copy of raw array
|
|
||||||
+ final LevelChunk[] rawCopy = new LevelChunk[size];
|
|
||||||
+ System.arraycopy(raw, 0, rawCopy, 0, size);
|
|
||||||
+ // Luminol end
|
|
||||||
|
|
||||||
- java.util.Objects.checkFromToIndex(0, size, raw.length);
|
|
||||||
+ this.level.getServer().moonrise$executeMidTickTasks(); // Luminol - Fix chunk iteration self modification - try executing mid-tick tasks for once chunk system task parsing
|
|
||||||
+ java.util.Objects.checkFromToIndex(0, size, rawCopy.length); // Luminol - Fix chunk iteration self modification - use copy of raw array
|
|
||||||
for (int i = 0; i < size; ++i) {
|
|
||||||
- world.tickChunk(raw[i], randomTickSpeed);
|
|
||||||
+ // Luminol start - Fix chunk iteration self modification
|
|
||||||
+ final LevelChunk chunk = rawCopy[i];
|
|
||||||
+
|
|
||||||
+ if (!chunk.getFullStatus().isOrAfter(FullChunkStatus.ENTITY_TICKING)) {
|
|
||||||
+ continue; // skip chunks which are not entity ticking(probably downgraded from last iteration)
|
|
||||||
+ }
|
|
||||||
+ // Luminol end
|
|
||||||
+ world.tickChunk(chunk, randomTickSpeed); // Luminol - Fix chunk iteration self modification - use copy of raw array
|
|
||||||
|
|
||||||
// call mid-tick tasks for chunk system
|
|
||||||
if ((i & 7) == 0) {
|
|
||||||
- //((ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer)this.level.getServer()).moonrise$executeMidTickTasks(); // Folia - TODO restore this
|
|
||||||
+ ((ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer)this.level.getServer()).moonrise$executeMidTickTasks(); // Folia - TODO restore this // Luminol - Fix chunk iteration self modification - restore mid tasks here
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
|
||||||
|
Date: Tue, 9 Nov 2077 00:00:00 +0800
|
||||||
|
Subject: [PATCH] Cpu affinity
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||||
|
index fa6b8d756195c1b430cc11214a901bd42eebc98d..0357792de0ed8ec9058d1847c8b45c33ff365af6 100644
|
||||||
|
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||||
|
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||||
|
@@ -49,6 +49,25 @@ public final class TickRegionScheduler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Thread newThread(final Runnable run) {
|
||||||
|
+ // Luminol start - cpu affinity
|
||||||
|
+ if (me.earthme.luminol.config.modules.misc.CpuAffinityConfig.cpuAffinityEnabled) {
|
||||||
|
+ Runnable affinityRunnable = new Runnable() {
|
||||||
|
+ private boolean affinitySet = false;
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void run() {
|
||||||
|
+ if (!this.affinitySet) {
|
||||||
|
+ this.affinitySet = true;
|
||||||
|
+ net.openhft.affinity.Affinity.setAffinity(me.earthme.luminol.config.modules.misc.CpuAffinityConfig.tickRegionAffinityBitSet);
|
||||||
|
+ }
|
||||||
|
+ run.run();
|
||||||
|
+ }
|
||||||
|
+ };
|
||||||
|
+ final Thread ret = new TickThreadRunner(affinityRunnable, "Region Scheduler Thread #" + this.idGenerator.getAndIncrement());
|
||||||
|
+ ret.setUncaughtExceptionHandler(TickRegionScheduler.this::uncaughtException);
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+ // Luminol end - cpu affinity
|
||||||
|
final Thread ret = new TickThreadRunner(run, "Region Scheduler Thread #" + this.idGenerator.getAndIncrement());
|
||||||
|
ret.setUncaughtExceptionHandler(TickRegionScheduler.this::uncaughtException);
|
||||||
|
return ret;
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
Date: Wed, 18 Jun 2025 23:46:20 +0800
|
||||||
|
Subject: [PATCH] Temporarily fix teleport yam and pitch
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/commands/TeleportCommand.java b/net/minecraft/server/commands/TeleportCommand.java
|
||||||
|
index 178a67b24095af02e7f75e8d80abdfc7b462639a..ebb16cf81e3b8f26df72e7f63a86938f7a402f24 100644
|
||||||
|
--- a/net/minecraft/server/commands/TeleportCommand.java
|
||||||
|
+++ b/net/minecraft/server/commands/TeleportCommand.java
|
||||||
|
@@ -283,8 +283,8 @@ public class TeleportCommand {
|
||||||
|
if (true) {
|
||||||
|
ServerLevel worldFinal = level;
|
||||||
|
Vec3 posFinal = new Vec3(x, y, z);
|
||||||
|
- Float yawFinal = Float.valueOf(f);
|
||||||
|
- Float pitchFinal = Float.valueOf(f1);
|
||||||
|
+ Float yawFinal = Float.valueOf(f + target.getYRot());
|
||||||
|
+ Float pitchFinal = Float.valueOf(f1 + target.getXRot());
|
||||||
|
target.getBukkitEntity().taskScheduler.schedule((Entity nmsEntity) -> {
|
||||||
|
nmsEntity.unRide();
|
||||||
|
nmsEntity.teleportAsync(
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MrHua269 <mrhua269@gmail.com>
|
|
||||||
Date: Sat, 31 May 2025 16:28:19 +0800
|
|
||||||
Subject: [PATCH] Fix mispatched entity custom spawning logic
|
|
||||||
|
|
||||||
we should use local players as each tickregion will only foreach their own player entities so that we won't come across async accessing world data
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/npc/CatSpawner.java b/net/minecraft/world/entity/npc/CatSpawner.java
|
|
||||||
index f5d27988605d48cdf314f28ba332f33f0a314266..39b506dad0601b2d75acb14989f2758132155d1b 100644
|
|
||||||
--- a/net/minecraft/world/entity/npc/CatSpawner.java
|
|
||||||
+++ b/net/minecraft/world/entity/npc/CatSpawner.java
|
|
||||||
@@ -27,7 +27,7 @@ public class CatSpawner implements CustomSpawner {
|
|
||||||
worldData.catSpawnerNextTick--; // Folia - region threading
|
|
||||||
if (worldData.catSpawnerNextTick <= 0) { // Folia - region threading
|
|
||||||
worldData.catSpawnerNextTick = 1200; // Folia - region threading
|
|
||||||
- Player randomPlayer = level.getRandomPlayer();
|
|
||||||
+ Player randomPlayer = level.getRandomLocalPlayer(); // Luminol - Fix mispatched entity custom spawning logic - Use local players for only the players in current tickregion
|
|
||||||
if (randomPlayer != null) {
|
|
||||||
RandomSource randomSource = level.random;
|
|
||||||
int i = (8 + randomSource.nextInt(24)) * (randomSource.nextBoolean() ? -1 : 1);
|
|
||||||
diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
||||||
index a7f56126a26e1fca86c39d8d656b648f5d6bb4ca..4626ee9f4410d8fd683db17b49ef79ab67eeda5f 100644
|
|
||||||
--- a/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
||||||
+++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
||||||
@@ -40,7 +40,7 @@ public class PhantomSpawner implements CustomSpawner {
|
|
||||||
worldData.phantomSpawnerNextTick += (spawnAttemptMinSeconds + randomSource.nextInt(spawnAttemptMaxSeconds - spawnAttemptMinSeconds + 1)) * 20; // Folia - region threading
|
|
||||||
// Paper end - Ability to control player's insomnia and phantoms
|
|
||||||
if (level.getSkyDarken() >= 5 || !level.dimensionType().hasSkyLight()) {
|
|
||||||
- for (ServerPlayer serverPlayer : level.players()) {
|
|
||||||
+ for (ServerPlayer serverPlayer : level.getLocalPlayers()) { // Luminol - Fix mispatched entity custom spawning logic - Use local players for only the players in current tickregion
|
|
||||||
if (!serverPlayer.isSpectator() && (!level.paperConfig().entities.behavior.phantomsDoNotSpawnOnCreativePlayers || !serverPlayer.isCreative())) { // Paper - Add phantom creative and insomniac controls
|
|
||||||
BlockPos blockPos = serverPlayer.blockPosition();
|
|
||||||
if (!level.dimensionType().hasSkyLight() || blockPos.getY() >= level.getSeaLevel() && level.canSeeSky(blockPos)) {
|
|
||||||
@@ -7,10 +7,10 @@ As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18
|
|||||||
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
|
Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE)
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
index 8bc92e45099007fa2120184916c4cdca98a6a452..50ddb37511074b01749a7c60b1d639ec67b3644c 100644
|
index 62b00aae7d31b79356dec44ce89cf9f2ce9c9bc2..a483d3001e05649ea332f17359218b6e21d9c527 100644
|
||||||
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
@@ -41,6 +41,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -43,6 +43,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
private long keepAliveChallenge;
|
private long keepAliveChallenge;
|
||||||
private long closedListenerTime;
|
private long closedListenerTime;
|
||||||
private boolean closed = false;
|
private boolean closed = false;
|
||||||
@@ -18,7 +18,7 @@ index 8bc92e45099007fa2120184916c4cdca98a6a452..50ddb37511074b01749a7c60b1d639ec
|
|||||||
private int latency;
|
private int latency;
|
||||||
private volatile boolean suspendFlushingOnServerThread = false;
|
private volatile boolean suspendFlushingOnServerThread = false;
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -130,6 +131,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -132,6 +133,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
|
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
|
||||||
@@ -35,7 +35,7 @@ index 8bc92e45099007fa2120184916c4cdca98a6a452..50ddb37511074b01749a7c60b1d639ec
|
|||||||
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
|
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
|
||||||
int i = (int)(Util.getMillis() - this.keepAliveTime);
|
int i = (int)(Util.getMillis() - this.keepAliveTime);
|
||||||
this.latency = (this.latency * 3 + i) / 4;
|
this.latency = (this.latency * 3 + i) / 4;
|
||||||
@@ -254,6 +265,21 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -262,6 +273,21 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
|
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
|
||||||
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
|
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
|
||||||
final long elapsedTime = millis - this.keepAliveTime;
|
final long elapsedTime = millis - this.keepAliveTime;
|
||||||
@@ -57,7 +57,7 @@ index 8bc92e45099007fa2120184916c4cdca98a6a452..50ddb37511074b01749a7c60b1d639ec
|
|||||||
if (!this.isSingleplayerOwner() && elapsedTime >= 15000L) { // use vanilla's 15000L between keep alive packets
|
if (!this.isSingleplayerOwner() && elapsedTime >= 15000L) { // use vanilla's 15000L between keep alive packets
|
||||||
if (this.keepAlivePending) {
|
if (this.keepAlivePending) {
|
||||||
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
|
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
|
||||||
@@ -267,6 +293,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
@@ -275,6 +301,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
|
this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
--- a/net/minecraft/server/Main.java
|
|
||||||
+++ b/net/minecraft/server/Main.java
|
|
||||||
@@ -108,6 +_,7 @@
|
|
||||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ me.earthme.luminol.config.LuminolConfig.preLoadConfig(); // Luminol - Luminol config
|
|
||||||
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
|
||||||
Bootstrap.bootStrap();
|
|
||||||
Bootstrap.validate();
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
|
||||||
@@ -171,6 +_,8 @@
|
|
||||||
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
|
|
||||||
this.server.spark.enableEarlyIfRequested(); // Paper - spark
|
|
||||||
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
|
|
||||||
if (this.convertOldUsers()) {
|
|
||||||
@@ -63,7 +63,7 @@ index 1783f9ea48154dcc8971fc5ef088f5a8c0f0b2ff..22125dbe1765f930fe10fe420be1c275
|
|||||||
} else {
|
} else {
|
||||||
final Optional<String> gitBranch = build.gitBranch();
|
final Optional<String> gitBranch = build.gitBranch();
|
||||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||||
index e741201fdbea0dbbc0e42313ebd33368014c9dc4..e3c5f4c31f084294a59830f3e764921433dd80d5 100644
|
index 10a0be7a4db1a51579d113d279af7a9effe7f438..4ada790812957657d580cb748077c4961987d0cb 100644
|
||||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||||
@@ -31,6 +31,7 @@ public record ServerBuildInfoImpl(
|
@@ -31,6 +31,7 @@ public record ServerBuildInfoImpl(
|
||||||
@@ -83,8 +83,8 @@ index e741201fdbea0dbbc0e42313ebd33368014c9dc4..e3c5f4c31f084294a59830f3e7649214
|
|||||||
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
|
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
|
||||||
- .orElse("Folia"), // Folia
|
- .orElse("Folia"), // Folia
|
||||||
+ .orElse(BRAND_LUMINOL_NAME), // Folia // Luminol
|
+ .orElse(BRAND_LUMINOL_NAME), // Folia // Luminol
|
||||||
SharedConstants.getCurrentVersion().getId(),
|
SharedConstants.getCurrentVersion().id(),
|
||||||
SharedConstants.getCurrentVersion().getName(),
|
SharedConstants.getCurrentVersion().name(),
|
||||||
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
||||||
@@ -61,7 +62,7 @@ public record ServerBuildInfoImpl(
|
@@ -61,7 +62,7 @@ public record ServerBuildInfoImpl(
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ index 400e632208d133a3f49fc7f14bceb48a1026769b..631bec0adee5b01bfb931c25195b949e
|
|||||||
+ // KioCG end
|
+ // KioCG end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 0e32a9ad852e521ce9618acc1642d3748995b4bf..7133038efdef5d60a1bdccb012a2020e432ef25e 100644
|
index cd3ba724cc36400a7706c83757c8b2def1cc81bd..643f6a138d9f0c0ff3cf9eb739a31152ef807de0 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -2368,6 +2368,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -2371,6 +2371,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
handle.newLevel = data.getIntOr("newLevel", 0);
|
handle.newLevel = data.getIntOr("newLevel", 0);
|
||||||
handle.expToDrop = data.getIntOr("expToDrop", 0);
|
handle.expToDrop = data.getIntOr("expToDrop", 0);
|
||||||
handle.keepLevel = data.getBooleanOr("keepLevel", false);
|
handle.keepLevel = data.getBooleanOr("keepLevel", false);
|
||||||
@@ -41,7 +41,7 @@ index 0e32a9ad852e521ce9618acc1642d3748995b4bf..7133038efdef5d60a1bdccb012a2020e
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2389,6 +2398,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -2388,6 +2397,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
data.putLong("lastPlayed", System.currentTimeMillis());
|
data.putLong("lastPlayed", System.currentTimeMillis());
|
||||||
data.putString("lastKnownName", handle.getScoreboardName());
|
data.putString("lastKnownName", handle.getScoreboardName());
|
||||||
|
|
||||||
@@ -55,9 +55,9 @@ index 0e32a9ad852e521ce9618acc1642d3748995b4bf..7133038efdef5d60a1bdccb012a2020e
|
|||||||
+ data.putBoolean("regionbarVisible", handle.isRegionBarVisible);
|
+ data.putBoolean("regionbarVisible", handle.isRegionBarVisible);
|
||||||
+ //Luminol end
|
+ //Luminol end
|
||||||
// Paper start - persist for use in offline save data
|
// Paper start - persist for use in offline save data
|
||||||
if (!tag.contains("Paper")) {
|
ValueOutput paper = output.child("Paper");
|
||||||
tag.put("Paper", new CompoundTag());
|
paper.putLong("LastLogin", handle.loginTime);
|
||||||
@@ -3581,4 +3599,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -3576,4 +3594,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
public void setDeathScreenScore(final int score) {
|
public void setDeathScreenScore(final int score) {
|
||||||
getHandle().setScore(score);
|
getHandle().setScore(score);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ index a0b84535a9d3833d4df692b85b272f145559dd80..c2ba46408b5ad727d7a17f21d47b2898
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 1091d2747c04166447540b37d86f51fe2591adc8..e0cee79b949fd2a4684bdfe7aa257c2ea96914b0 100644
|
index ecab0322ae03b7a3133eae192076aaf463237cd6..59f6c3ef5d4080c6661c71d68fcc63919ad170a9 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -314,7 +314,7 @@ public final class CraftServer implements Server {
|
@@ -313,7 +313,7 @@ public final class CraftServer implements Server {
|
||||||
public static Exception excessiveVelEx;
|
public static Exception excessiveVelEx;
|
||||||
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher();
|
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher();
|
||||||
private final io.papermc.paper.potion.PaperPotionBrewer potionBrewer;
|
private final io.papermc.paper.potion.PaperPotionBrewer potionBrewer;
|
||||||
@@ -30,7 +30,7 @@ index 1091d2747c04166447540b37d86f51fe2591adc8..e0cee79b949fd2a4684bdfe7aa257c2e
|
|||||||
private final ServerConfiguration serverConfig = new PaperServerConfiguration();
|
private final ServerConfiguration serverConfig = new PaperServerConfiguration();
|
||||||
|
|
||||||
// Paper start - Folia region threading API
|
// Paper start - Folia region threading API
|
||||||
@@ -496,7 +496,7 @@ public final class CraftServer implements Server {
|
@@ -495,7 +495,7 @@ public final class CraftServer implements Server {
|
||||||
}
|
}
|
||||||
this.potionBrewer = new io.papermc.paper.potion.PaperPotionBrewer(console); // Paper - custom potion mixes
|
this.potionBrewer = new io.papermc.paper.potion.PaperPotionBrewer(console); // Paper - custom potion mixes
|
||||||
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
|
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
|
||||||
@@ -39,7 +39,7 @@ index 1091d2747c04166447540b37d86f51fe2591adc8..e0cee79b949fd2a4684bdfe7aa257c2e
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean getCommandBlockOverride(String command) {
|
public boolean getCommandBlockOverride(String command) {
|
||||||
@@ -1141,7 +1141,7 @@ public final class CraftServer implements Server {
|
@@ -1109,7 +1109,7 @@ public final class CraftServer implements Server {
|
||||||
this.reloadData();
|
this.reloadData();
|
||||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||||
@@ -48,7 +48,7 @@ index 1091d2747c04166447540b37d86f51fe2591adc8..e0cee79b949fd2a4684bdfe7aa257c2e
|
|||||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||||
|
|
||||||
@@ -1170,7 +1170,7 @@ public final class CraftServer implements Server {
|
@@ -1138,7 +1138,7 @@ public final class CraftServer implements Server {
|
||||||
this.loadPlugins();
|
this.loadPlugins();
|
||||||
this.enablePlugins(PluginLoadOrder.STARTUP);
|
this.enablePlugins(PluginLoadOrder.STARTUP);
|
||||||
this.enablePlugins(PluginLoadOrder.POSTWORLD);
|
this.enablePlugins(PluginLoadOrder.POSTWORLD);
|
||||||
@@ -5,10 +5,10 @@ Subject: [PATCH] SparklyPaper Optimize canSee checks
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 7133038efdef5d60a1bdccb012a2020e432ef25e..77dd160db2d05d6542ae336fbd71eeae76479b91 100644
|
index 643f6a138d9f0c0ff3cf9eb739a31152ef807de0..3e73a79404dc1169ec2824b68290b7b00e39f83b 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -216,7 +216,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -219,7 +219,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
private boolean hasPlayedBefore = false;
|
private boolean hasPlayedBefore = false;
|
||||||
private final ConversationTracker conversationTracker = new ConversationTracker();
|
private final ConversationTracker conversationTracker = new ConversationTracker();
|
||||||
private final Set<String> channels = new HashSet<String>();
|
private final Set<String> channels = new HashSet<String>();
|
||||||
@@ -17,7 +17,7 @@ index 7133038efdef5d60a1bdccb012a2020e432ef25e..77dd160db2d05d6542ae336fbd71eeae
|
|||||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||||
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
||||||
private int hash = 0;
|
private int hash = 0;
|
||||||
@@ -2267,9 +2267,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -2270,9 +2270,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||||
@@ -23,10 +23,10 @@ index 631bec0adee5b01bfb931c25195b949eaf2efd27..05d364bcadb137af4e1a8c955643b7dc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index e0cee79b949fd2a4684bdfe7aa257c2ea96914b0..047369190b8d03c5765595ba898da3a5c463a6c0 100644
|
index 59f6c3ef5d4080c6661c71d68fcc63919ad170a9..44b7ac045c028f3bc940d78f158079e20582f4b8 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1392,7 +1392,11 @@ public final class CraftServer implements Server {
|
@@ -1360,7 +1360,11 @@ public final class CraftServer implements Server {
|
||||||
registryAccess = levelDataAndDimensions.dimensions().dimensionsRegistryAccess();
|
registryAccess = levelDataAndDimensions.dimensions().dimensionsRegistryAccess();
|
||||||
} else {
|
} else {
|
||||||
LevelSettings levelSettings;
|
LevelSettings levelSettings;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user